April Fools Round Up: The Year of Nostalgia

April Fools Day is once again upon us and as usual, tech companies everywhere have not … more

Android 5.1 OTA for Nexus Round-Up

The beginning of April is dominated by April Fools. There are jokes and pranks everywhere, which are … more

Official Lollipop for LG G2 Captured

LG is rolling out the Lollipop update for the LG G2. KDZ images for both 16 GB and 32 GB variants … more

Google’s Prank Roundup for April Fools 2015

Once again, we have arrived on the most magical of holidays – the annual … more
Post Reply Subscribe to Thread Email Thread

ROM Compiling Issues

6th July 2014, 07:02 AM |#1  
KerryWood34's Avatar
OP Senior Member
Thanks Meter: 154
 
348 posts
Join Date:Joined: Aug 2012
Donate to Me
More
I'm currently trying to implement native battery percentage into my source built ROM, but keep running into errors. Mainly, this one:

Code:
packages/apps/Settings/src/com/android/settings/rascarlo/StatusBarSettings.java:103: cannot find symbol
symbol  : method isPhone(android.app.Activity)
location: class com.android.settings.Utils
        if (!Utils.isPhone(getActivity())) {
                  ^
I look at other developers' code and they all have that period there so I am not sure why it is an error for me. Must do more research.
6th July 2014, 07:47 AM |#2  
sumit77seo's Avatar
Senior Member
Flag New Delhi
Thanks Meter: 54
 
169 posts
Join Date:Joined: Sep 2012
Donate to Me
More
Can you show us the code piece which is creating problem? I think u have missed something like semicolons. or that method isPhone() is not accessible. Show us the particular fragment of code to which error is pointing.
Last edited by sumit77seo; 6th July 2014 at 08:10 AM.
The Following User Says Thank You to sumit77seo For This Useful Post: [ View ]
6th July 2014, 08:31 PM |#3  
KerryWood34's Avatar
OP Senior Member
Thanks Meter: 154
 
348 posts
Join Date:Joined: Aug 2012
Donate to Me
More
I will be starting work at 3 and won't be back home until about 12:30am. I will post the code then. I don't have the error window open anymore but I will just open the SatusBarSettings.java file and post the code from there.
7th July 2014, 07:46 AM |#4  
KerryWood34's Avatar
OP Senior Member
Thanks Meter: 154
 
348 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Here is the section of code where the error seems to be taking place.

Code:
// Quick settings category
        // Quick Settings pull down
        mQuickPulldown = (ListPreference) getPreferenceScreen().findPreference(QUICK_PULLDOWN);
        // only show on phones
        if (!Utils.isPhone(getActivity())) {
            if (mQuickPulldown != null)
                mStatusBarGeneralCategory.removePreference(mQuickPulldown);
        } else {
            mQuickPulldown.setOnPreferenceChangeListener(this);
            int quickPulldownValue = Settings.System.getInt(getActivity().getApplicationContext()
                    .getContentResolver(),
                    Settings.System.QS_QUICK_PULLDOWN, 0);
            mQuickPulldown.setValue(String.valueOf(quickPulldownValue));
            mQuickPulldown.setSummary(mQuickPulldown.getEntry());
I am not sure if it is because I am trying to simply add native battery percentage and do not have quick pulldown or any other status bar mods implemented yet or what.

Also, I am not writing this code myself in case that wasn't clear. I did a cherry-pick of rascarlo's native battery percentage.

Thanks for the help
Last edited by KerryWood34; 7th July 2014 at 11:43 AM.
8th July 2014, 12:45 AM |#5  
sumit77seo's Avatar
Senior Member
Flag New Delhi
Thanks Meter: 54
 
169 posts
Join Date:Joined: Sep 2012
Donate to Me
More
This seems that isPhone() method is not accessible. Do u have the source code of Utils class? Check into the Utils class for isPhone() method.

Sent from my Micromax A120 using XDA Free mobile app
The Following User Says Thank You to sumit77seo For This Useful Post: [ View ]
8th July 2014, 11:34 AM |#6  
KerryWood34's Avatar
OP Senior Member
Thanks Meter: 154
 
348 posts
Join Date:Joined: Aug 2012
Donate to Me
More
Quote:
Originally Posted by sumit77seo

This seems that isPhone() method is not accessible. Do u have the source code of Utils class? Check into the Utils class for isPhone() method.

Sent from my Micromax A120 using XDA Free mobile app

Could you explain a little more in detail what I need to look for?I have downloaded source code and have been trying to just do a cherry pick. How do I check into the utils class for is phone() method?
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes