[Q] Cherry-Picking help

Search This thread

brajesh.sharma87

Senior Member
Jan 27, 2011
2,092
2,837
Kolkata
I want to cherry-pick "custom notification led settings" from purity to my aosp build.

So I went ahead and picked up these two commits

https://github.com/KitKatPurity/pla...mmit/c85834ed460ec99e0752f1f13e58cad74abf844e

and

https://github.com/KitKatPurity/pla...mmit/b37fdf4238b11b0232b12f218294131ea77ec309

The framework part ran well and there was no conflict. The settings part returned a small conflict which I solved myself. Now as I go on compiling, everything compiled good but then at the time of Settings.apk compiling it returned this error.

Code:
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:119: cannot find symbol
symbol  : variable mDisplayManager
location: class com.android.settings.DisplaySettings
        mDisplayManager = (DisplayManager)getActivity().getSystemService(
        ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:119: cannot find symbol
symbol  : class DisplayManager
location: class com.android.settings.DisplaySettings
        mDisplayManager = (DisplayManager)getActivity().getSystemService(
                           ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:121: cannot find symbol
symbol  : variable mWifiDisplayStatus
location: class com.android.settings.DisplaySettings
        mWifiDisplayStatus = mDisplayManager.getWifiDisplayStatus();
        ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:121: cannot find symbol
symbol  : variable mDisplayManager
location: class com.android.settings.DisplaySettings
        mWifiDisplayStatus = mDisplayManager.getWifiDisplayStatus();
                             ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:122: cannot find symbol
symbol  : variable mWifiDisplayPreference
location: class com.android.settings.DisplaySettings
        mWifiDisplayPreference = (Preference)findPreference(KEY_WIFI_DISPLAY);
        ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:122: cannot find symbol
symbol  : variable KEY_WIFI_DISPLAY
location: class com.android.settings.DisplaySettings
        mWifiDisplayPreference = (Preference)findPreference(KEY_WIFI_DISPLAY);
                                                            ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:123: cannot find symbol
symbol  : variable mWifiDisplayStatus
location: class com.android.settings.DisplaySettings
        if (mWifiDisplayStatus.getFeatureState()
            ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:124: cannot find symbol
symbol  : variable WifiDisplayStatus
location: class com.android.settings.DisplaySettings
                == WifiDisplayStatus.FEATURE_STATE_UNAVAILABLE) {
                   ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:125: cannot find symbol
symbol  : variable mWifiDisplayPreference
location: class com.android.settings.DisplaySettings
            getPreferenceScreen().removePreference(mWifiDisplayPreference);
                                                   ^
packages/apps/Settings/src/com/android/settings/DisplaySettings.java:126: cannot find symbol
symbol  : variable mWifiDisplayPreference
location: class com.android.settings.DisplaySettings
            mWifiDisplayPreference = null;
            ^
packages/apps/Settings/src/com/android/settings/purity/notificationlight/ApplicationLightPreference.java:170: method does not override or implement a method from a supertype
    @Override
    ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
11 errors
make: *** [out/target/common/obj/APPS/Settings_intermediates/classes-full-debug.jar] Error 41
make: *** Waiting for unfinished jobs....

Here are the link of the 2 files where the error is shown:

ApplicationLightPreference.java
DisplaySettings.java

I tried the following combination to solve it:
in ApplicationLightPreference.java, I deleted the line which returned the error.
in DisplaySettings.java I deleted the line which returned the error.
The build compiles fine, boot fines but but when I select display settings, it force closes.

Any help in solving this error is appreciated.
 

Spastic909

Senior Member
Dec 28, 2010
1,786
188
Since this is a question why not post in the section clearly marked for questions??

Sent from my Nexus 4 using xda premium
 

MBQ_

Senior Member
Sep 3, 2011
14,799
22,998
29
Phoenix, Arizona
MBQonXDA.com
I tried the following combination to solve it:
in ApplicationLightPreference.java, I deleted the line which returned the error.
in DisplaySettings.java I deleted the line which returned the error.
The build compiles fine, boot fines but but when I select display settings, it force closes.

Any help in solving this error is appreciated.

Find the commit that added the missing variable(s) and method(s)

pull a log for the force close.
 
  • Like
Reactions: brajesh.sharma87

brajesh.sharma87

Senior Member
Jan 27, 2011
2,092
2,837
Kolkata
Find the commit that added the missing variable(s) and method(s)

pull a log for the force close.

Not sure what to do about the first line but here's the log

Code:
I/ActivityManager(  647): Displayed com.android.settings/.Settings: +631ms
I/ActivityManager(  647): START u0 {act=android.intent.action.MAIN cmp=com.android.settings/.SubSettings (has extras)} from pid 9823
D/audio_hw_primary(  170): select_devices: out_snd_device(2: speaker) in_snd_device(0: )
D/ACDB-LOADER(  170): ACDB -> send_afe_cal
D/SubSettings( 9823): Launching fragment com.android.settings.DisplaySettings
D/AndroidRuntime( 9823): Shutting down VM
W/dalvikvm( 9823): threadid=1: thread exiting with uncaught exception (group=0x415adba8)
E/AndroidRuntime( 9823): FATAL EXCEPTION: main
E/AndroidRuntime( 9823): Process: com.android.settings, PID: 9823
E/AndroidRuntime( 9823): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.SubSettings}: java.lang.NullPointerException
E/AndroidRuntime( 9823): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
E/AndroidRuntime( 9823): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
E/AndroidRuntime( 9823): 	at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime( 9823): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime( 9823): 	at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 9823): 	at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime( 9823): 	at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime( 9823): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 9823): 	at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 9823): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime( 9823): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime( 9823): 	at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 9823): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 9823): 	at com.android.settings.DisplaySettings.onCreate(DisplaySettings.java:134)
E/AndroidRuntime( 9823): 	at android.app.Fragment.performCreate(Fragment.java:1678)
E/AndroidRuntime( 9823): 	at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:859)
E/AndroidRuntime( 9823): 	at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1062)
E/AndroidRuntime( 9823): 	at android.app.BackStackRecord.run(BackStackRecord.java:684)
E/AndroidRuntime( 9823): 	at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1447)
E/AndroidRuntime( 9823): 	at android.app.Activity.performStart(Activity.java:5240)
E/AndroidRuntime( 9823): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2168)
E/AndroidRuntime( 9823): 	... 11 more
W/ActivityManager(  647):   Force finishing activity com.android.settings/.SubSettings
W/ActivityManager(  647):   Force finishing activity com.android.settings/.Settings
W/ActivityManager(  647): Activity pause timeout for ActivityRecord{41e72210 u0 com.android.settings/.SubSettings t14 f}
W/Sidekick_LocationOracleImpl( 2543): Best location was null
I/Process ( 9823): Sending signal. PID: 9823 SIG: 9
V/SearchControllerCache( 2543): creating SearchController
W/Sidekick_LocationOracleImpl( 2543): Best location was null
W/GCoreFlp( 8127): No location to return for getLastLocation()
I/ActivityManager(  647): Process com.android.settings (pid 9823) has died.
I/WindowState(  647): WIN DEATH: Window{419b9318 u0 com.android.settings/com.android.settings.Settings}
D/dalvikvm( 2543): GC_FOR_ALLOC freed 1110K, 57% free 5133K/11704K, paused 27ms, total 27ms
I/MicroHotwordRecognitionRunner( 2543): Starting hotword detection.
D/audio_hw_primary(  170): select_devices: out_snd_device(0: ) in_snd_device(34: voice-rec-mic)
E/ACDB-LOADER(  170): Error: ACDB AudProc vol returned = -8
D/dalvikvm( 2543): GC_CONCURRENT freed 6K, 51% free 5756K/11704K, paused 2ms+3ms, total 32ms
I/SearchController( 2543): #onHotwordDetectorStarted
 

GeyerA

Senior Member
Apr 6, 2009
979
1,586
Germany, Gerolzhofen
Hi, I checked and you miss the declaration in the Android Manifest in the packages_apps_settings. Go and check my Github commits. You do not need the modifcation in the proguard.flags though.

https://github.com/GeyerA/platform_...mmit/347e74714f0c6efa2dbd3ba49b5612e1cc11bf4f

For completeness also check the commits in the frameworks_base

https://github.com/GeyerA/platform_frameworks_base/commit/a77810164cb1bcb1d449f603f31a97939d9f9b3b

Also, make sure you got these...

https://github.com/PSX-PureSpeed/an...mmit/3e29b10a377f0985ee221aaa4fe10838733ed3df
https://github.com/PSX-PureSpeed/an...mmit/2ae7fbb6134f6831fba8184d0dd1092f5bee1f7a

This should fix your issues, just let me know or PM me as I am not always checking on your thread.
Nice week to everbody. Calo
 
Last edited:
  • Like
Reactions: brajesh.sharma87

brajesh.sharma87

Senior Member
Jan 27, 2011
2,092
2,837
Kolkata
Hi, I checked and you miss the declaration in the Android Manifest in the packages_apps_settings. Go and check my Github commits. You do not need the modifcation in the proguard.flags though.

https://github.com/GeyerA/platform_...mmit/347e74714f0c6efa2dbd3ba49b5612e1cc11bf4f

For completeness also check the commits in the frameworks_base

https://github.com/GeyerA/platform_frameworks_base/commit/a77810164cb1bcb1d449f603f31a97939d9f9b3b

Also, make sure you got these...

https://github.com/PSX-PureSpeed/an...mmit/3e29b10a377f0985ee221aaa4fe10838733ed3df
https://github.com/PSX-PureSpeed/an...mmit/2ae7fbb6134f6831fba8184d0dd1092f5bee1f7a

This should fix your issues, just let me know or PM me as I am not always checking on your thread.
Nice week to everbody. Calo

Thanks for the answer. I discarded all the commits which I took from purity.
Started fresh and picked up the commits from your github. There was 1 conflict in DisplaySettings.java, I solved it and compiled. It then gave me error during compile about volume wake. I deleted those lines in question and compiled again. It compiled fine but after installing the output rom I still got FC when clicking on "Display Settings".

I didn't give up. I discarded all the previous commits again and this time picked up the volume wake commits first and then the LED customization commits and then from PSX commits which you advised. Everything ran well, there was not a single conflict this time. Even there was no error at the time of compilation. BUT as always on installing the rom I got the same FC on clicking Display settings. :(

Now I have deleted the entire out directory and this time will build fresh lets see if that can help, but for that I can only do it after 8-10 days as I am going out of station.

Thanks for all the help.
 

GeyerA

Senior Member
Apr 6, 2009
979
1,586
Germany, Gerolzhofen
Thanks for the answer. I discarded all the commits which I took from purity.
Started fresh and picked up the commits from your github. There was 1 conflict in DisplaySettings.java, I solved it and compiled. It then gave me error during compile about volume wake. I deleted those lines in question and compiled again. It compiled fine but after installing the output rom I still got FC when clicking on "Display Settings".

I didn't give up. I discarded all the previous commits again and this time picked up the volume wake commits first and then the LED customization commits and then from PSX commits which you advised. Everything ran well, there was not a single conflict this time. Even there was no error at the time of compilation. BUT as always on installing the rom I got the same FC on clicking Display settings. :(

Now I have deleted the entire out directory and this time will build fresh lets see if that can help, but for that I can only do it after 8-10 days as I am going out of station.

Thanks for all the help.

Hello, good that you have some progress although you might feel disappointed that it does not work. Here is one reason why I personally do not cherry-pick complex commits as it will also add the lines which are not part of that commit but part of my code.
Anyhow, I believe you missed one small thing which is in android_device_hammerhead. Sorry I forgot that one.
https://github.com/KitKatPurity/pla...mmit/217378d3e6a7a5370e7c1583fcfb4ae1e7a9ac7c
Especially this one in overlay/frameworks/base/core/res/res/values/config.xml
Code:
+    <!-- Is the battery LED intrusive? Used to decide if there should be a disable option -->
 +    <bool name="config_intrusiveBatteryLed">true</bool>
 +
 +    <!-- Does the battery LED support multiple colors? Used to decide if the user can change the colors -->
 +    <bool name="config_multiColorBatteryLed">true</bool>
 +
I am sure it will work then. Please do not delete everything again when something does not work, post the question first :silly:
 
  • Like
Reactions: brajesh.sharma87

brajesh.sharma87

Senior Member
Jan 27, 2011
2,092
2,837
Kolkata
@GeyerA you're a genius. I've been working on this for last 1 month and finally succeeded. :)

As I didnt have access to my laptop and the resolution that u you gave was also possible through apk tool, I sent the framework-res.apk to a friend and asked him to just change those two values to 'true' he did so and sent the same to me and boom it worked. Thank you so very much.

Sent from my Nexus 4 using Tapatalk
 

GeyerA

Senior Member
Apr 6, 2009
979
1,586
Germany, Gerolzhofen
Hello. I am happy to hear; great satisfaction that I could help. But the credit is Dario's from Kitkatpurity and Martin_Ro's from PSX. They helped me a lot and I suffered much more than you. No biggie but please use the thanks button .... :eek:

Sent from my AOSP on HammerHead using xda app-developers app
 
Last edited:
  • Like
Reactions: brajesh.sharma87

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    I tried the following combination to solve it:
    in ApplicationLightPreference.java, I deleted the line which returned the error.
    in DisplaySettings.java I deleted the line which returned the error.
    The build compiles fine, boot fines but but when I select display settings, it force closes.

    Any help in solving this error is appreciated.

    Find the commit that added the missing variable(s) and method(s)

    pull a log for the force close.
    1
    Hi, I checked and you miss the declaration in the Android Manifest in the packages_apps_settings. Go and check my Github commits. You do not need the modifcation in the proguard.flags though.

    https://github.com/GeyerA/platform_...mmit/347e74714f0c6efa2dbd3ba49b5612e1cc11bf4f

    For completeness also check the commits in the frameworks_base

    https://github.com/GeyerA/platform_frameworks_base/commit/a77810164cb1bcb1d449f603f31a97939d9f9b3b

    Also, make sure you got these...

    https://github.com/PSX-PureSpeed/an...mmit/3e29b10a377f0985ee221aaa4fe10838733ed3df
    https://github.com/PSX-PureSpeed/an...mmit/2ae7fbb6134f6831fba8184d0dd1092f5bee1f7a

    This should fix your issues, just let me know or PM me as I am not always checking on your thread.
    Nice week to everbody. Calo
    1
    Thanks for the answer. I discarded all the commits which I took from purity.
    Started fresh and picked up the commits from your github. There was 1 conflict in DisplaySettings.java, I solved it and compiled. It then gave me error during compile about volume wake. I deleted those lines in question and compiled again. It compiled fine but after installing the output rom I still got FC when clicking on "Display Settings".

    I didn't give up. I discarded all the previous commits again and this time picked up the volume wake commits first and then the LED customization commits and then from PSX commits which you advised. Everything ran well, there was not a single conflict this time. Even there was no error at the time of compilation. BUT as always on installing the rom I got the same FC on clicking Display settings. :(

    Now I have deleted the entire out directory and this time will build fresh lets see if that can help, but for that I can only do it after 8-10 days as I am going out of station.

    Thanks for all the help.

    Hello, good that you have some progress although you might feel disappointed that it does not work. Here is one reason why I personally do not cherry-pick complex commits as it will also add the lines which are not part of that commit but part of my code.
    Anyhow, I believe you missed one small thing which is in android_device_hammerhead. Sorry I forgot that one.
    https://github.com/KitKatPurity/pla...mmit/217378d3e6a7a5370e7c1583fcfb4ae1e7a9ac7c
    Especially this one in overlay/frameworks/base/core/res/res/values/config.xml
    Code:
    +    <!-- Is the battery LED intrusive? Used to decide if there should be a disable option -->
     +    <bool name="config_intrusiveBatteryLed">true</bool>
     +
     +    <!-- Does the battery LED support multiple colors? Used to decide if the user can change the colors -->
     +    <bool name="config_multiColorBatteryLed">true</bool>
     +
    I am sure it will work then. Please do not delete everything again when something does not work, post the question first :silly:
    1
    Hello. I am happy to hear; great satisfaction that I could help. But the credit is Dario's from Kitkatpurity and Martin_Ro's from PSX. They helped me a lot and I suffered much more than you. No biggie but please use the thanks button .... :eek:

    Sent from my AOSP on HammerHead using xda app-developers app