[Q] Help implementing a settings toggle! - Android Q&A, Help & Troubleshooting

Hi,
I've been trying to implement a toggle for my Galaxy Ace II X (running ICS 4.0.4). I wish for the toggle to allow the enabling of the "config_unplugTurnsOnScreen" boolean. I used this DIFF guide for reference (yes, I DID sort through the several mods in the DIFF guide) because I previously had success with the CRT animation toggle on that same page. (I substituted a lot of the AOSP lockscreen code for Unplug Screen On code) Instead of referencing to /system/framework/services.jar/smali/com/android/server/PowerManagerService$BrightnessState.smali, I referenced to the PowerManagerService$BatteryReceiver.smali in the same directory (because it is the only smali I could find that mentioned "mUnplugTurnsOnScreen"). I first modded the services.jar, and I used $3100 for the access (I compared the access used for the CRT animation with the rest of the services.jar and I got found a common factor, so I searched for the factor in my services.jar and I found the access I was looking for). It booted fine, no problems at all. Then I modded the SecSettings.apk. I thought I did a pretty good job with it. Pushed it to my device. When I opened the Display Settings and clicked on the toggle, Settings FCed. Same happened with the CRT animation toggle that I had previously implemented. Logcats revealed this:
E/AndroidRuntime( 2805): FATAL EXCEPTION: main
E/AndroidRuntime( 2805): java.lang.NoSuchFieldError: com.android.settings.DisplaySettings.mUnplugScreenOn
E/AndroidRuntime( 2805): at com.android.settings.DisplaySettings.onPreferenceTreeClick(DisplaySettings.java:773)
E/AndroidRuntime( 2805): at android.preference.Preference.performClick(Preference.java:949)
E/AndroidRuntime( 2805): at android.preference.PreferenceScreen.onItemClick(PreferenceScreen.java:202)
E/AndroidRuntime( 2805): at android.widget.AdapterView.performItemClick(AdapterView.java:292)
E/AndroidRuntime( 2805): at android.widget.AbsListView.performItemClick(AbsListView.java:1394)
E/AndroidRuntime( 2805): at android.widget.AbsListView$PerformClick.run(AbsListView.java:3024)
E/AndroidRuntime( 2805): at android.widget.AbsListView$1.run(AbsListView.java:3830)
E/AndroidRuntime( 2805): at android.os.Handler.handleCallback(Handler.java:605)
E/AndroidRuntime( 2805): at android.os.Handler.dispatchMessage(Handler.java:92)
E/AndroidRuntime( 2805): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 2805): at android.app.ActivityThread.main(ActivityThread.java:4517)
E/AndroidRuntime( 2805): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 2805): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 2805): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
E/AndroidRuntime( 2805): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
E/AndroidRuntime( 2805): at dalvik.system.NativeStart.main(Native Method)
E/android.os.Debug( 1523): [email protected] > dumpstate -k -t -n -z -d -o /data/log/dumpstate_app_error
Click to expand...
Click to collapse
I don't know what to do. I tried modifying all the code related to mUnplugScreenOn, but I'm dumbfounded. Somebody please help me out here. Or at least, lead me in the right direction. Though, I would prefer the first choice. Anyways, here are my SecSettings.apk and services.jar decompiled and zipped up. They might be a bit messy because I have numerous mods applied to them. This is my first real mod I've tried doing without any other guides or threads related to it. I would really appreciate the help. I think if I could knock down this mod, I discover a whole new realm of modding.

Related

[Q] phone.apk java.lang.ClassCastException: android.widget.EditText

Hi,
I'm modifying phone.apk on android 1.6 for research activities.
First I added following lines to call_card.xml and everything worked fine
<ImageView
android:src="@drawable/unknowncaller"
android:layout_width="320sp"
android:layout_height="320sp"
></ImageView>
Then I modified the ImageView and added an id:
<ImageView
android:id="@+id/callscreen_test_test"
android:src="@drawable/unknowncaller"
android:layout_width="320sp"
android:layout_height="320sp"
></ImageView>
Since then I get the following exception:
E/AndroidRuntime( 961): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 961): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.phone/com.android.phone.InCallScreen}: java.lang.ClassCastException: android.widget.EditText
E/AndroidRuntime( 961): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2401)
E/AndroidRuntime( 961): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2417)
E/AndroidRuntime( 961): at android.app.ActivityThread.access $2100(ActivityThread.java:116)
E/AndroidRuntime( 961): at android.app.ActivityThread $H.handleMessage(ActivityThread.java:1794)
E/AndroidRuntime( 961): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 961): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 961): at android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime( 961): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 961): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 961): at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 961): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime( 961): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 961): Caused by: java.lang.ClassCastException: android.widget.EditText
E/AndroidRuntime( 961): at com.android.phone.InCallScreen.onCreate(InCallScreen.java:462)
E/AndroidRuntime( 961): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1123)
E/AndroidRuntime( 961): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2364)
E/AndroidRuntime( 961): ... 11 more
I don't think that's a bug in the syntax (or I'm blind?), I think that's a bug in compiling and some R.id.* were not updated or so... I compile phone.apk with "mmm packages/apps/Phone".
Please help me.
Thanks
No idea?
Does anyone knows an opensource implementation from an modified phone.apk where I can have a look at?
Thanks

Need some help

Hello,
Im working on porting an Evo 4g rom to the Thunderbolt. Problems im running into deal with 4g and WiMax differences in the rom. I dont know what to change or where to look as Im new to this. The phone works making and reciving calls. Im just stuck on data.
I do have a log cat with:
E/AndroidRuntime( 1715): FATAL EXCEPTION: main
E/AndroidRuntime( 1715): java.lang.NoClassDefFoundError: com.android.internal.telephony.cat.CatService
E/AndroidRuntime( 1715): at com.android.stk.StkAppService.onStart(StkAppService.java:180)
E/AndroidRuntime( 1715): at android.app.Service.onStartCommand(Service.java:428)
E/AndroidRuntime( 1715): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2160)
E/AndroidRuntime( 1715): at android.app.ActivityThread.access$2800(ActivityThread.java:123)
E/AndroidRuntime( 1715): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1002)
E/AndroidRuntime( 1715): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 1715): at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime( 1715): at android.app.ActivityThread.main(ActivityThread.java:3835)
E/AndroidRuntime( 1715): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1715): at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 1715): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
E/AndroidRuntime( 1715): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
E/AndroidRuntime( 1715): at dalvik.system.NativeStart.main(Native Method)
I know i have some apk editing to do for the menu stuff but im focusing on just getting the data to work.
Thanks for pointing me in the direction I need to go.

[Q] cm 10.1 2m contacts has stopped when accessing the dialer

If you click dialer you get error message that unfortunately contacts has stopped.
I have tried wipe cache, wipe dalvik fix permissions. This is on a fresh installed of cm10.1 2m from stock rooted ICS build. I did import my contacts from my back up pro. Only thing left I can think of thanks in advance for any help.
CM question answers discussion thread on the forum .
jje
Wipe contacts and dialler data
slap20 said:
Wipe contacts and dialler data
Click to expand...
Click to collapse
I had seen thar suggested. How do I wipe indivual data caches? Or do you mean deleting all contacta indivdual?
Settings/apps/all......find the apks, tap on them, hit wipe data
Thank you so much! That fixed it. So glad I didn't have to reflash
slaphead20 said:
Settings/apps/all......find the apks, tap on them, hit wipe data
Click to expand...
Click to collapse
Hi guys,
I'm sorry but I still have this problem. I wiped data from everything that may be related (contacts, dialer, google contacts, dialer/contacts storage) but still no joy.
I flashed the phone with CM 10.1 M3 a few days ago but frankly I don't remember I've ever seen the stock dialer open.
Logcat says:
W/dalvikvm( 8958): threadid=1: thread exiting with uncaught exception (group=0x40b54930)
E/AndroidRuntime( 8958): FATAL EXCEPTION: main
E/AndroidRuntime( 8958): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.contacts/com.android.contacts.activities.DialtactsActivity}: java.lang.NullPointerException
E/AndroidRuntime( 8958): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
E/AndroidRuntime( 8958): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2357)
E/AndroidRuntime( 8958): at android.app.ActivityThread.access$600(ActivityThread.java:153)
E/AndroidRuntime( 8958): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
E/AndroidRuntime( 8958): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 8958): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 8958): at android.app.ActivityThread.main(ActivityThread.java:5226)
E/AndroidRuntime( 8958): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 8958): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 8958): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
E/AndroidRuntime( 8958): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
E/AndroidRuntime( 8958): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 8958): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 8958): at com.android.contacts.activities.DialtactsActivity.setupDialer(DialtactsActivity.java:747)
E/AndroidRuntime( 8958): at com.android.contacts.activities.DialtactsActivity.onCreate(DialtactsActivity.java:530)
E/AndroidRuntime( 8958): at android.app.Activity.performCreate(Activity.java:5104)
E/AndroidRuntime( 8958): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
E/AndroidRuntime( 8958): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
E/AndroidRuntime( 8958): ... 11 more
Any ideas or should I buy an iPhone?
Aviopene said:
Hi guys,
I'm sorry but I still have this problem. I wiped data from everything that may be related (contacts, dialer, google contacts, dialer/contacts storage) but still no joy.
I flashed the phone with CM 10.1 M3 a few days ago but frankly I don't remember I've ever seen the stock dialer open.
Logcat says:
W/dalvikvm( 8958): threadid=1: thread exiting with uncaught exception (group=0x40b54930)
E/AndroidRuntime( 8958): FATAL EXCEPTION: main
E/AndroidRuntime( 8958): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.contacts/com.android.contacts.activities.DialtactsActivity}: java.lang.NullPointerException
E/AndroidRuntime( 8958): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
E/AndroidRuntime( 8958): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2357)
E/AndroidRuntime( 8958): at android.app.ActivityThread.access$600(ActivityThread.java:153)
E/AndroidRuntime( 8958): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
E/AndroidRuntime( 8958): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 8958): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 8958): at android.app.ActivityThread.main(ActivityThread.java:5226)
E/AndroidRuntime( 8958): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 8958): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 8958): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
E/AndroidRuntime( 8958): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
E/AndroidRuntime( 8958): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 8958): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 8958): at com.android.contacts.activities.DialtactsActivity.setupDialer(DialtactsActivity.java:747)
E/AndroidRuntime( 8958): at com.android.contacts.activities.DialtactsActivity.onCreate(DialtactsActivity.java:530)
E/AndroidRuntime( 8958): at android.app.Activity.performCreate(Activity.java:5104)
E/AndroidRuntime( 8958): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
E/AndroidRuntime( 8958): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2261)
E/AndroidRuntime( 8958): ... 11 more
Any ideas or should I buy an iPhone?
Click to expand...
Click to collapse
Found the cause of the problem. It was the theme's fault! I was (stupidly, I admit it) using an old CM7 theme (goo.gl -slash- 5wyP4) that was also working on CM9 but not in CM10.1. Apparently the stack trace was saying that the dialer activity failed to draw the interface.
Cheers
Avio

[Q] Every app, including launcher, crashes.

Hi,
It appears I've gotten myself into a little predicament. As the title indicates, after restarting my Galaxy S4 last night, everything crashes, basically rendering the device useless. The launcher is stuck in a crash loop, as well as any app I open via adb. I am currently running a rooted android 4.2.2 on the stock TouchWiz ROM which I believe is the MI1 build for my GS4.
I do have access to adb as well as su, so hopefully someone can help me through this.
A little more info on the things I've tried:
My initial thought as to why this was happening was because I froze some bloatware via App Quarantine. During this process, I disabled a few keyboards since SwiftKey would never be the default when I restarted Android, hoping that it would just eventually just default to SwiftKey. However, I also recently put a magnet on the back of my phone for use with a magnetic car mount, but I don't believe this is causing the issue.
I first tried disabling Xposed, this had no effect.
Next, I tried to install another keyboard through adb.
I tried to install an alternative launcher, this crashed as well.
I booted into safe mode, still no luck.
I tried launching apps through the monkey command, they crashed after a few seconds as well.
I believe my logcat points to the following error whenever anything crashes, however I cannot be certain.
Code:
E/AndroidRuntime( 8123): FATAL EXCEPTION: main
E/AndroidRuntime( 8123): java.lang.NullPointerException
E/AndroidRuntime( 8123): at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:1203)
E/AndroidRuntime( 8123): at android.view.inputmethod.InputMethodManager.onWindowFocus(InputMethodManager.java:1411)
E/AndroidRuntime( 8123): at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3298)
E/AndroidRuntime( 8123): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 8123): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 8123): at android.app.ActivityThread.main(ActivityThread.java:5329)
E/AndroidRuntime( 8123): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 8123): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 8123): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
E/AndroidRuntime( 8123): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
E/AndroidRuntime( 8123): at dalvik.system.NativeStart.main(Native Method)
Based on the presumed error, I made one last attempt and tried to change the keyboard via adb but I got the following error:
Code:
>adb shell ime list
Error: Could not access the Input Method Manager. Is the system running?
I have attached my error logcat, as well as the verbose logcat.
I'm basically at a loss here. I do have most of the bare-minimum, important data backed up with Titanium Backup, but I really don't want it to come to the point where I have to wipe my phone. Any help is appreciated.
Thanks.
Have you tried the No-Wipe Stock Image for odin?
bamige1 said:
Have you tried the No-Wipe Stock Image for odin?
Click to expand...
Click to collapse
I have not tried this yet. I had completely forgotten about those. I'll give it a shot and report back.
bamige1 said:
Have you tried the No-Wipe Stock Image for odin?
Click to expand...
Click to collapse
I just went ahead with the no wipe image and the problem still persists. I'm at a complete loss as of what to do next.
EDIT:
The logcat is giving this error as well:
Code:
E/ViewRootImpl( 875): sendUserActionEvent() mView == null
E/AndroidRuntime( 9913): FATAL EXCEPTION: main
E/AndroidRuntime( 9913): java.lang.NullPointerException
E/AndroidRuntime( 9913): at android.view.inputmethod.InputMethodManager.s
tartInputInner(InputMethodManager.java:1203)
E/AndroidRuntime( 9913): at android.view.inputmethod.InputMethodManager.o
nWindowFocus(InputMethodManager.java:1411)
E/AndroidRuntime( 9913): at android.view.ViewRootImpl$ViewRootHandler.han
dleMessage(ViewRootImpl.java:3298)
E/AndroidRuntime( 9913): at android.os.Handler.dispatchMessage(Handler.ja
va:99)
E/AndroidRuntime( 9913): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 9913): at android.app.ActivityThread.main(ActivityThrea
d.java:5329)
E/AndroidRuntime( 9913): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 9913): at java.lang.reflect.Method.invoke(Method.java:5
11)
E/AndroidRuntime( 9913): at com.android.internal.os.ZygoteInit$MethodAndA
rgsCaller.run(ZygoteInit.java:1102)
E/AndroidRuntime( 9913): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:869)
E/AndroidRuntime( 9913): at dalvik.system.NativeStart.main(Native Method)

Crash when trying to select Tiles[LOG]

Hi, I installed my rom, and it crashes like this:
E/AndroidRuntime( 2414): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setColorFilter(int, android.graphics.PorterDuff$Mode)' on a null object reference
E/AndroidRuntime( 2414): at com.android.settings.cyanogenmod.qs.QSTiles.buildQSTile(QSTiles.java:226)
E/AndroidRuntime( 2414): at com.android.settings.cyanogenmod.qs.QSTiles.onActivityCreated(QSTiles.java:76)
E/AndroidRuntime( 2414): at android.app.Fragment.performActivityCreated(Fragment.java:2061)
E/AndroidRuntime( 2414): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:912)
E/AndroidRuntime( 2414): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
E/AndroidRuntime( 2414): at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1049)
E/AndroidRuntime( 2414): at android.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:1869)
E/AndroidRuntime( 2414): at android.app.Activity.performCreateCommon(Activity.java:6856)
E/AndroidRuntime( 2414): at android.app.Activity.performCreate(Activity.java:6863)
E/AndroidRuntime( 2414): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
E/AndroidRuntime( 2414): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2306)
E/AndroidRuntime( 2414): ... 10 more
Just crash when I trying to get in. I tried to google it, but only same log in pastebin, I can't fine any solutions or something lie that. Any ideas?

Categories

Resources