Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] Cherry-Picking help

OP brajesh.sharma87

8th March 2014, 08:24 PM   |  #1  
brajesh.sharma87's Avatar
OP Senior Member
Flag Kolkata
Thanks Meter: 2,549
 
1,688 posts
Join Date:Joined: Jan 2011
Donate to Me
More
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/plat...58cad74abf844e

and

https://github.com/KitKatPurity/plat...94131ea77ec309

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.
8th March 2014, 10:32 PM   |  #2  
Spastic909's Avatar
Senior Member
Thanks Meter: 195
 
1,786 posts
Join Date:Joined: Dec 2010
More
Since this is a question why not post in the section clearly marked for questions??

Sent from my Nexus 4 using xda premium
9th March 2014, 09:08 PM   |  #3  
Account currently disabled
Flag Phoenix, Arizona
Thanks Meter: 23,072
 
13,922 posts
Join Date:Joined: Sep 2011
Donate to Me
More
Quote:
Originally Posted by brajesh.sharma87


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.
The Following User Says Thank You to MBQ_ For This Useful Post: [ View ]
9th March 2014, 09:45 PM   |  #4  
brajesh.sharma87's Avatar
OP Senior Member
Flag Kolkata
Thanks Meter: 2,549
 
1,688 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Quote:
Originally Posted by MBQ_

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
9th March 2014, 11:50 PM   |  #5  
Account currently disabled
Flag Phoenix, Arizona
Thanks Meter: 23,072
 
13,922 posts
Join Date:Joined: Sep 2011
Donate to Me
More
Quote:
Originally Posted by brajesh.sharma87

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

Something is wrong in the onCreate method of DisplaySettings.java
10th March 2014, 07:44 AM   |  #6  
GeyerA's Avatar
Senior Member
Flag Germany, Gerolzhofen
Thanks Meter: 1,108
 
745 posts
Join Date:Joined: Apr 2009
Donate to Me
More
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_p...5612e1cc11bf4f

For completeness also check the commits in the frameworks_base

https://github.com/GeyerA/platform_f...1a97939d9f9b3b

Also, make sure you got these...

https://github.com/PSX-PureSpeed/and...e10838733ed3df
https://github.com/PSX-PureSpeed/and...d1092f5bee1f7a

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 by GeyerA; 10th March 2014 at 12:39 PM.
The Following User Says Thank You to GeyerA For This Useful Post: [ View ]
10th March 2014, 02:26 PM   |  #7  
brajesh.sharma87's Avatar
OP Senior Member
Flag Kolkata
Thanks Meter: 2,549
 
1,688 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Quote:
Originally Posted by GeyerA

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_p...5612e1cc11bf4f

For completeness also check the commits in the frameworks_base

https://github.com/GeyerA/platform_f...1a97939d9f9b3b

Also, make sure you got these...

https://github.com/PSX-PureSpeed/and...e10838733ed3df
https://github.com/PSX-PureSpeed/and...d1092f5bee1f7a

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.
10th March 2014, 03:26 PM   |  #8  
GeyerA's Avatar
Senior Member
Flag Germany, Gerolzhofen
Thanks Meter: 1,108
 
745 posts
Join Date:Joined: Apr 2009
Donate to Me
More
Quote:
Originally Posted by brajesh.sharma87

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/plat...fb4ae1e7a9ac7c
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
The Following User Says Thank You to GeyerA For This Useful Post: [ View ]
10th March 2014, 03:37 PM   |  #9  
brajesh.sharma87's Avatar
OP Senior Member
Flag Kolkata
Thanks Meter: 2,549
 
1,688 posts
Join Date:Joined: Jan 2011
Donate to Me
More
Quote:
Originally Posted by GeyerA

........I am sure it will work then. Please do not delete everything again when something does not work, post the question first

Thanks but as i said, i wont have access to my laptop for next 8-10 days, will continue once i come back.

Sent from my Nexus 4 using Tapatalk
10th March 2014, 05:35 PM   |  #10  
brajesh.sharma87's Avatar
OP Senior Member
Flag Kolkata
Thanks Meter: 2,549
 
1,688 posts
Join Date:Joined: Jan 2011
Donate to Me
More
@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

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes