Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
iwillkillyou
Old
#221  
iwillkillyou's Avatar
Senior Member
Thanks Meter 41
Posts: 564
Join Date: Aug 2010
Would this method work for the screenshot in the power menu? ICS and gingerbread roms have it. I miss that feature greatly.

Sent from my SGH-T959 using XDA
The Satanist from birth has a maturity which does not require supernatural or governmental parental figures.
 
pvyParts
Old
#222  
pvyParts's Avatar
Recognized Developer
Thanks Meter 2084
Posts: 1,663
Join Date: Oct 2010
Quote:
Originally Posted by iwillkillyou View Post
Would this method work for the screenshot in the power menu? ICS and gingerbread roms have it. I miss that feature greatly.

Sent from my SGH-T959 using XDA
Sortof. You need different commands in the smali but the principal is the same

Pvy


Sent from my TEAM powered Arc S
 
Rookie407
Old
#223  
Member
Thanks Meter 8
Posts: 92
Join Date: Dec 2011
Location: Clinton
trying to get this to work on a samsung galaxy precedent AOSP ROM. having an issue with step 2 in the shutdownthread.smali. more specificaly this part

Code:
:reboot
	
const-string v4, "now"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
	
:rebootRecovery
	
const-string v4, "recovery"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
	
:rebootDownload
	
const-string v4, "download"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
should i change the parts where it says (exp. :rebootDownload) to the string id? and if i do i get this error when compiling (mismatched input '0x010404bd' expecting END_METHOD_DIRECTIVE)

if i try to change the corrisponding parts from the code inserted above it i get this error


(AutoSmali_In\com\android\internal\app\ShutdownThr ead.smali[2337,18] no viable alternative at input '0x010404bd'
AutoSmali_In\com\android\internal\app\ShutdownThre ad.smali[2341,18] no viable alternative at input '0x010404bb'
AutoSmali_In\com\android\internal\app\ShutdownThre ad.smali[2345,18] no viable alternative at input '0x010404bc'
AutoSmali_In\com\android\internal\app\ShutdownThre ad.smali[2352,4] mismatched input '0x010404bd' expecting END_METHOD_DIRECTIVE)

any clue on a fix?
Devices:

Current:
Phones:
SamSung Galaxy S2 SGH-S959g (Straight Talk)
Rooted: Yes
Recovery: ClockWorkMod
Rom: Slim Bean
Kernel: STI Kernel

Tablets:
Acer Iconia Tab A100 (refurbished)
Rooted: Yes
Recovery: ClockWorkMod
ROM: Flex Reaper
Kernel: God Machine

Layed To Rest:

 
pvyParts
Old
#224  
pvyParts's Avatar
Recognized Developer
Thanks Meter 2084
Posts: 1,663
Join Date: Oct 2010
Quote:
Originally Posted by Rookie407 View Post
trying to get this to work on a samsung galaxy precedent AOSP ROM. having an issue with step 2 in the shutdownthread.smali. more specificaly this part

Code:
:reboot
	
const-string v4, "now"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
	
:rebootRecovery
	
const-string v4, "recovery"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
	
:rebootDownload
	
const-string v4, "download"
	
invoke-static {v4}, Landroid/os/Power;->reboot(Ljava/lang/String;)V

return-void
should i change the parts where it says (exp. :rebootDownload) to the string id? and if i do i get this error when compiling (mismatched input '0x010404bd' expecting END_METHOD_DIRECTIVE)

if i try to change the corrisponding parts from the code inserted above it i get this error


(AutoSmali_In\com\android\internal\app\ShutdownThr ead.smali[2337,18] no viable alternative at input '0x010404bd'
AutoSmali_In\com\android\internal\app\ShutdownThre ad.smali[2341,18] no viable alternative at input '0x010404bb'
AutoSmali_In\com\android\internal\app\ShutdownThre ad.smali[2345,18] no viable alternative at input '0x010404bc'
AutoSmali_In\com\android\internal\app\ShutdownThre ad.smali[2352,4] mismatched input '0x010404bd' expecting END_METHOD_DIRECTIVE)

any clue on a fix?

reread the TUt, specifically step 3 you don't put the resID's there they go in the globalActions

Pvy.
 
Rookie407
Old
#225  
Member
Thanks Meter 8
Posts: 92
Join Date: Dec 2011
Location: Clinton
Quote:
Originally Posted by pvyParts View Post
reread the TUt, specifically step 3 you don't put the resID's there they go in the globalActions

Pvy.
i got that part... i was just wondering if it would be diff cus its a diff phone. i know with LG phones you dont have to edit the shutdownthread.smali at all and it works just fine.
Devices:

Current:
Phones:
SamSung Galaxy S2 SGH-S959g (Straight Talk)
Rooted: Yes
Recovery: ClockWorkMod
Rom: Slim Bean
Kernel: STI Kernel

Tablets:
Acer Iconia Tab A100 (refurbished)
Rooted: Yes
Recovery: ClockWorkMod
ROM: Flex Reaper
Kernel: God Machine

Layed To Rest:

 
pvyParts
Old
#226  
pvyParts's Avatar
Recognized Developer
Thanks Meter 2084
Posts: 1,663
Join Date: Oct 2010
Quote:
Originally Posted by Rookie407 View Post
i got that part... i was just wondering if it would be diff cus its a diff phone. i know with LG phones you dont have to edit the shutdownthread.smali at all and it works just fine.
If you follow the tut it will work. If the stuff is already there don't re add it.

But you were editing the wrong area. The IDs don't go where you put them.

Pvy.

Sent from my LT18i using xda premium
 
Rookie407
Old
#227  
Member
Thanks Meter 8
Posts: 92
Join Date: Dec 2011
Location: Clinton
Quote:
Originally Posted by pvyParts View Post
If you follow the tut it will work. If the stuff is already there don't re add it.

But you were editing the wrong area. The IDs don't go where you put them.

Pvy.

Sent from my LT18i using xda premium
if the stuff was there i wouldnt be doing this... and if it worked i wouldnt be posting... like i said before this is the sammy precedent im working n 100% AOSP. would u like the logcat errors?
Devices:

Current:
Phones:
SamSung Galaxy S2 SGH-S959g (Straight Talk)
Rooted: Yes
Recovery: ClockWorkMod
Rom: Slim Bean
Kernel: STI Kernel

Tablets:
Acer Iconia Tab A100 (refurbished)
Rooted: Yes
Recovery: ClockWorkMod
ROM: Flex Reaper
Kernel: God Machine

Layed To Rest:

 
pvyParts
Old
#228  
pvyParts's Avatar
Recognized Developer
Thanks Meter 2084
Posts: 1,663
Join Date: Oct 2010
Quote:
Originally Posted by Rookie407 View Post
if the stuff was there i wouldnt be doing this... and if it worked i wouldnt be posting... like i said before this is the sammy precedent im working n 100% AOSP. would u like the logcat errors?
sure go for it it may shed more light as to what the problem was i have a feeeling we are on 2 different pages...

100% AOSP as in your are compiling it first? then decompiling it to add mods? O_O

Pvy.
 
Rookie407
Old
(Last edited by Rookie407; 22nd April 2012 at 01:41 PM.)
#229  
Member
Thanks Meter 8
Posts: 92
Join Date: Dec 2011
Location: Clinton
Quote:
Originally Posted by pvyParts View Post
sure go for it it may shed more light as to what the problem was i have a feeeling we are on 2 different pages...

100% AOSP as in your are compiling it first? then decompiling it to add mods? O_O

Pvy.
yes it was compiled by our main dev now im working to get the reboot options there. i have it showing up in the power menu it just does what can only be described as the FC vibrations...


Code:
I/StatusBarPolicy( 3033): BAT. status:2 health:2
I/StatusBarPolicy( 3033): BAT. status:2 health:2
I/StatusBarPolicy( 3033): BAT. status:2 health:2
I/WindowManager( 2978): interceptKeyBeforeDispatching
W/KeyCharacterMap( 3055): No keyboard for id 0
W/KeyCharacterMap( 3055): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
W/dalvikvm( 2978): VFY: unable to resolve static field 47 (mReboot) in Lcom/android/internal/app/ShutdownThread;

W/dalvikvm( 2978): VFY: unable to resolve static field 47 (mReboot) in Lcom/android/internal/app/ShutdownThread;

W/dalvikvm( 2978): VFY: unable to resolve static field 47 (mReboot) in Lcom/android/internal/app/ShutdownThread;

I/WindowManager( 2978): interceptKeyBeforeDispatching
I/WindowManager( 2978): interceptKeyBeforeDispatching
I/WindowManager( 2978): interceptKeyBeforeDispatching
W/KeyCharacterMap( 2978): No keyboard for id 0
W/KeyCharacterMap( 2978): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
I/WindowManager( 2978): interceptKeyBeforeDispatching
W/dalvikvm( 2978): threadid=21: thread exiting with uncaught exception (group=0x40020560)
V/AudioPolicyManager( 2967): getDeviceForStrategy() from cache strategy 0, device 2
V/AudioPolicyManager( 2967): getOutput() stream 3, samplingRate 0, format 0, channels c, flags 0
E/AndroidRuntime( 2978): *** FATAL EXCEPTION IN SYSTEM PROCESS: WindowManagerPolicy
E/AndroidRuntime( 2978): java.lang.IllegalAccessError: tried to access field com.android.internal.app.ShutdownTh
read.mReboot from class com.android.internal.policy.impl.GlobalActions$8
E/AndroidRuntime( 2978):        at com.android.internal.policy.impl.GlobalActions$8.onPress(GlobalActions.java:2
09)
E/AndroidRuntime( 2978):        at com.android.internal.policy.impl.GlobalActions.onClick(GlobalActions.java:272
)
E/AndroidRuntime( 2978):        at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertContr
oller.java:873)
E/AndroidRuntime( 2978):        at android.widget.AdapterView.performItemClick(AdapterView.java:284)
E/AndroidRuntime( 2978):        at android.widget.ListView.performItemClick(ListView.java:3513)
E/AndroidRuntime( 2978):        at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
E/AndroidRuntime( 2978):        at android.os.Handler.handleCallback(Handler.java:587)
E/AndroidRuntime( 2978):        at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 2978):        at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 2978):        at com.android.server.WindowManagerService$PolicyThread.run(WindowManagerService
.java:611)
V/AudioPolicyManager( 2967): startOutput() output 1, stream 3, session 3
V/AudioPolicyManager( 2967): changeRefCount() stream 3, count 1
V/AudioPolicyManager( 2967): getDeviceForStrategy() from cache strategy 0, device 2
V/AudioPolicyManager( 2967): getNewDevice() selected device 2
V/AudioPolicyManager( 2967): setOutputDevice() output 1 device 2 delayMs 0
V/AudioPolicyManager( 2967): setOutputDevice() setting same device 2 or null device for output 1
V/AudioHardwareMSM72XX( 2967): open driver
V/AudioHardwareMSM72XX( 2967): get config
V/AudioHardwareMSM72XX( 2967): set config
V/AudioHardwareMSM72XX( 2967): buffer_size: 4800
V/AudioHardwareMSM72XX( 2967): buffer_count: 2
V/AudioHardwareMSM72XX( 2967): channel_count: 2
V/AudioHardwareMSM72XX( 2967): sample_rate: 44100
W/AudioFlinger( 2967): write blocked for 164 msecs, 1 delayed writes, thread 0xcea8
V/AudioPolicyManager( 2967): stopOutput() output 1, stream 3, session 3
V/AudioPolicyManager( 2967): changeRefCount() stream 3, count 0
V/AudioPolicyManager( 2967): getNewDevice() selected device 0
V/AudioPolicyManager( 2967): setOutputDevice() output 1 device 0 delayMs 0
V/AudioPolicyManager( 2967): setOutputDevice() setting same device 0 or null device for output 1
D/VoldCmdListener(   85): asec list
I/StatusBarPolicy( 3033): BAT. status:2 health:2
I/StatusBarPolicy( 3033): BAT. status:2 health:2
keep in mind globalactions8 is pointing at the recovery. but all three options do the same thing with the same error.
Devices:

Current:
Phones:
SamSung Galaxy S2 SGH-S959g (Straight Talk)
Rooted: Yes
Recovery: ClockWorkMod
Rom: Slim Bean
Kernel: STI Kernel

Tablets:
Acer Iconia Tab A100 (refurbished)
Rooted: Yes
Recovery: ClockWorkMod
ROM: Flex Reaper
Kernel: God Machine

Layed To Rest:

 
lingfude
Old
#230  
lingfude's Avatar
Senior Member
Thanks Meter 116
Posts: 160
Join Date: Jun 2011

 
DONATE TO ME
Hi Rookie407,

I remember when I made this mod in my rom I had some errors at the first few times I tested this.
The errors were because I add the resources idds in the "public.xml" but I forgot to add the reboot and recovery images in the resource file.
Quote:
open "values\public.xml" and assign our strings resource id's

scroll until you get to the end of the "<public type="string"" id list
note the id of the last string, in this example it is "10403c2" sometimes
the id's are out of order so search for "10403c2 + 1" or "10403c3"
if the next id is unused then we can start assigning id's to the strings
we added.

Code:
<public type="string" name="reboot_recovery" id="0x010403c3" />
<public type="string" name="reboot_download" id="0x010403c4" />
<public type="string" name="reboot" id="0x010403c5" />
now is a good time to add the image resources so add your icons to
"res\drawable-hdpi"
and assign id's to them the same way we did for the strings
in this example, using the example icons in the zip file I had

Code:
<public type="drawable" name="reboot" id="0x010803aa" />
<public type="drawable" name="recovery" id="0x010803ab" />
<public type="drawable" name="download" id="0x010803ac" />
save and close
Don't know if this is your case but...

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

report this ad
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...