yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] millo1978:
Hi :)

I have a Huawei p9 lite...

In keyguard only Default Music Player is displayed.

I want to add other Players.

I can manually add Music Player with SQLEditor in "white_music_for_keyguard" key, but I want create a Popup:

All downloaded app are there,

I choose my personal Music Player,

Then selected Music Player goes to white_music_for_keyguard key.

For example:

terminal command works so (with VLC app):

su shell settings put system white_music_for_keyguard org.videolan.vlc
[Android Apps and Games] Wuby986:
i don't actually remeber all the prefs of RCv1 but there should be one list pref that retrieve the app pkg name and saves as value assigned to your desired key then you don't need anything else

Inviato dal mio SM-G930F utilizzando Tapatalk
[Android Apps and Games] millo1978:
With:

<com.wubydax.romcontrol.prefs.IntentDialogPreference
includeSearch="true"
setSeparatorString=";"
android:key="white_music_for_keyguard"
android:title="@string/choose_app" />

I can choose the music app to view and use in keyguard :)
[Android Apps and Games] cyjaneczek:
Hello :D

I`ll ask you how I can add this project to CM-based ROM sources? I`ll compile ROM with this app, how can I do this?

Sorry for stupid asks but I`m newbie :/
[Android Apps and Games] Wuby986:
it's been already asked and is not so stupid.. you can compile as separate app by now. we did not looked into it since most of our user are developping sammy based rom

Inviato dal mio SM-G930F utilizzando Tapatalk
[Android Apps and Games] cyjaneczek:
Oh, so that`s good :D I didn`t wanted to check 112 pages to search ask like mine xD Can you explain me how I can after compile add this separated app as a system app to my local rom sources? I`m Working with CM 13 if this is important :D

Thanks for fast reply :D
[Android Apps and Games] Wuby986:
i guess you can include it once compiled. you can compile the rom with all the mods that rc should change and add the app once rom is ready

Inviato dal mio SM-G930F utilizzando Tapatalk
[Android Apps and Games] LiquidT:
[MENTION=5493353]Wuby986[/MENTION], [MENTION=4714483]daxgirl[/MENTION]

I'm doing something wrong. I have tried to follow the OP to add the Power Menu example, and all i get is errors. The file system layout doesn't look like the examples. I'm sure there probably was an update to the files from the OP. I'm new to development and coding, so trying to learn. Just can't find what I may have done wrong.

Gradle tasks [:app:assembleDebug]

C:\Users\h\StudioProjects\CustomSettingsForDevs\app\src\main\java\com\wubydax\romcontrol\MainViewActivity.java

Error:(130, 102) error: incompatible types: PowerMenuFragment cannot be converted to Fragment

C:\Users\h\StudioProjects\CustomSettingsForDevs\app\src\main\java\com\wubydax\romcontrol\PowerMenuFragment.java

Error:(78, 5) error: method does not override or implement a method from a supertype

Error:(80, 24) error: incompatible types: Context cannot be converted to Activity

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

> Compilation failed; see the compiler error output for details.

BUILD FAILED
[Android Apps and Games] daxgirl:
Yeah. You're definitely doing something wrong. Like sticking your nose in things it doesn't belong in without understanding what you're doing.

If you're new to development you have no place in coding I to a project of this complexity. Especially while providing me with a logcat and not showing what you actually did (mind you, it's NOT an invitation to show me what you did). It's not a complicated log, btw. Basically it says "dude, what the **** did you do?"

This thread is not for noobs, mate.

Cheers.
[Android Apps and Games] LiquidT:
There are no words for people like you.
[Android Apps and Games] Jeronim0h:
Look at this treat, there is a guy that sell your mod Rom Control for 5 €, Screenshot from telegram is on the last Page

https://xdaforums.com/t/rom-r-11-0-...r-s10e-s10-s10-stable-odex-fucd-v4-1.4221707/
[Android Apps and Games] Zaileion:
So will this work on a Samsung Note 10+ rom? I've done this before with some success back when I had my note 4 (best phone I've ever held in my hands) but years have passed and I am now on Android 11 and wondered if anyone knows if this is still usable in R.

Thanks for your work. I'm not sure howm any people know it but you are one of about 10 developers that have code in just about ever rom. XDA exists because of people like you. Your a staple in this community. Plus you have the most killer 3minit battery icons! Thank you!

Oh, and by the way, I love your rules section. All you have to do is pay it forward keeping code open. If only everyone had your philosophy this world would be a better place! Remarkable!
[Android Apps and Games] Rixsta:
[MENTION=4715535]wuby[/MENTION] and daxgirl

Amazing work and very well written thread.

Dax, such a helpful person, not only on xda but outside of the forums too.

Your both a credit to XDA and I wish you well
[Android Apps and Games] rompnit:
Works like a charm!! :good: Awesome as usual :D ;)
[Android Apps and Games] Kamy:
Same here works great. Though I couldn't figure out appsRequiedReboot for SystemUI part yet.
[Android Apps and Games] rompnit:
I removed that case (2) from the method altogether, unless you want to restart the UI w/o prompting the user.. So it looks like this:

private void handleKeysToKillProcess(String key){
String[] keysForContacts = {"dialer_background_color", "main_digit_color", "main_letter_color", "dialer_background_style"};
String[] keysForInCallUI = {"incall_digit_color", "incall_letter_color", "incall_background", "dialer_background_switcher", "db_call_delay"};
String[][] allArrays = {keysForContacts, keysForInCallUI}; //the order of objects matters! (0,1,2)
for (int objPos = 0; objPos<allArrays.length; objPos++){
for(int keyPos=0; keyPos<allArrays[objPos].length; keyPos++){
if(key.equals(allArrays[objPos][keyPos])){
switch(objPos){
case 0: //array keysForContacts
killProcess("com.android.contacts");
break;
case 1: //array keysForInCallUI
killProcess("com.android.incallui");
break;

}
}
}
}
}

Otherwise adding what's in red below will actually popup a dialogue prompting the user to reboot the UI, or they can cancel it out if they choose. The 'appRebootRequired' method is already contained in the class. :highfive:

case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
[COLOR="Red"]if (key.equals("your_key_here")) {
appRebootRequired("com.android.systemui");
}[/COLOR]
break;

Post #4 in the OP has some more detail on this :good:
[Android Apps and Games] daxgirl:
Maybe the confusion is the entire language structure, that's new for you.

When you say in java appRebootRequired("com.android.systemui") that means you're invoking a method in the same class. The method is called appRebootRequired and what you have in the parentheses is the parameter that the method requires. Not all methods require parameters. But if you find this method in class HandlePreferenceFragments you will see that it's called something like

private void appRebootRequired(String pckgName) { ... }

In between parentheses you have the required parameter. In this case you can see that it requires you to pass it an object of kind String and based on the object name you understand that it's supposed to be a package name for the app you want to kill. So when you call this method you need to pass a string and for the method to work it needs to be a valid package name. This entire method is based on this string. It presents you with a dialog prompting that the reboot of an app is required. It shows an icon of an app and puts it's name in the dialog message based on the string you provided. It uses android class AplicationInfo to extract those attributes.
[Android Apps and Games] Kamy:
Thanks for explaining in detail, understood, and the way [MENTION=1167171]rompnit[/MENTION] describe also was very helpful. I have such popup dialog with normal keys.

I am also trying on a key which is script dependent (f.e: script#statusbar_aokp or script#enable_fullscreen_call) seems I am a bit lost in this and need a hit whether it works as in a no silent way or even silent way.
[Android Apps and Games] daxgirl:
You will need to show me the scripts that you're trying to run and I will see what's the functionality you're trying to achieve.

Please attach your scripts and your methods on java so I can understand what you need.

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
I have two version of incallui in /system/aryamod/files/incallui folder, one is full screen and another one stock screen, the script would rename them based on what users wants on ROM Control

<PreferenceScreen
android:key="script#enable_fullscreen_call"
android:summary="PHONE WILL REBOOT AUTOMATICALLY"
android:title="FullScreen In-call" />
<PreferenceScreen
android:key="script#disable_fullscreen_call"
android:summary="PHONE WILL REBOOT AUTOMATICALLY"
android:title="Stock In-call Screen" />

#!/system/bin/sh
export PATH=/system/bin:$PATH

mount -o rw,remount /system

cp -p /system/aryamod/files/incallui/aryamod.fs.LegacyInCallUI.apk /system/app/LegacyInCallUI/LegacyInCallUI.apk

pkill zygote

#!/system/bin/sh
export PATH=/system/bin:$PATH

mount -o rw,remount /system

cp -p /system/aryamod/files/incallui/aryamod.stock.LegacyInCallUI.apk /system/app/LegacyInCallUI/LegacyInCallUI.apk

pkill zygote
[Android Apps and Games] daxgirl:
This is nice. And correctly used.

This of course will be the silent way, since the reboot is done by killing zygote from your script.

We can do some nice things about it. For the keys that require phone reboot we can make some kinda warning dialog if you wish. But generally speaking, you add the warning in your summary, so that's enough imo.

You use it in the correct way. It doesn't require java modification for those keys.

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] daxgirl:
[MENTION=4819130]kmokhtar79[/MENTION] in general you can't use anything related to onSharedPreferencesChanged for script executing preference screen. Those preferences never write to shared preferences, so they never will trigger the onpreferencechange listener. They are an entity of their own. They just run the script.

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
Oh, ok. Understood.
[Android Apps and Games] Kamy:
Question: how to create default smali hex value? Let me ask in detail; we have a mod as you guided us for custom carrier here and how to adding colorizer by [MENTION=1042140]tdunham[/MENTION] here , so for such mod how to create the default color? I am asking it as you mentioned in op that

Adding following preference would cause crashing for the tab which I specify it in custom settings as "Notification Panel".

<com.wubydax.romcontrol.prefs.ColorPickerPreference
alphaSlider="true"
android:defaultValue="-16777215"
android:key="clock_color"
android:title="Choose Clock Color" />
[Android Apps and Games] tdunham:
The default value is dependent on the preference.

For instance, for color it would be android:defaultValue="-1" for white as default color. I think if you use [MENTION=4714483]daxgirl[/MENTION] color app or the other one I posted, you can find the values you need for colors.

Links are near the bottom of this page for color conversion tools:

http://xdaforums.com/showpost.php?p=61120581&postcount=3
[Android Apps and Games] tdunham:
This is an example of the little pc executable I posted for color conversions.
[Android Apps and Games] Kamy:
Thanks mate for heads up, yes I am using [MENTION=4714483]daxgirl[/MENTION] 's hex color app but setting this android:defaultValue="-1" would cause fc as I mentioned. My question is about smali part, do I even need to edit my smali for default value in SystemUI (as the code is in there)?
[Android Apps and Games] tdunham:
I'm not sure I understand, is it mod control or the system force closing?

As far as I know, you HAVE to assign a default color that fits into the construct for smali. A logcat would help you here. If you assign a color that wont fit into the construct:

const v3 -0x1

is fine

const v3 -16777215

is not

It wont fit and a logcat would tell you if the field is too short, so for this case, (I think) the const would have to be:

const/16 v3 -16777215

I know my syntax is all off but you get the idea. ;)
[Android Apps and Games] Kamy:
It's mod control crashing, I just wanted to know the logic. OK I would try to specify my color and check. Again appreciate your hint. :good:
[Android Apps and Games] tdunham:
Same thing, log the crash and see if it provides any clues. :)

---------- Post added at 11:40 AM ---------- Previous post was at 11:35 AM ----------

And another hint about logs, I LIVE off of dumpstate_app_error.txt.gz from data/log. If you have a recovery that mounts storage like KTsoonsez custom twrp recovery, it has a built-in file manager so you can pull the log, copy it to SD and fix your error while still mounted in recovery.

This can be a lifesaver when modifying framework files that force the phone to rebuild ART after every change.
[Android Apps and Games] daxgirl:
Did you by any chance apply the fix for colorpicker preference I published before? Because there is a chance that's what is crashing your app...

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
Oh my... Yes I saw it but I forgot, a lot of things in my mind...:silly:
[Android Apps and Games] daxgirl:
Listen, this is the full bug fix as I pushed to the original dev's repository. Change your entire method exactly like on this commit. What has minus you remove, what has plus you add

https://github.com/attenzione/andro...mmit/e3aa3010165ba86eca82ba107877bd8dfd3e4ff4

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
It seems const/16 v3 -16777215 is not letting me compile

..\3-Out\SystemUI.apk\smali\com\android\systemui\statusbar\policy\NetworkControllerImpl.smali[24123,16] extraneous input '-16777215' expecting COMMA
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: com/android/systemui/statusbar/policy/NetworkControllerImpl.smali

I tried this too but same const/16 v3, -16777215
[Android Apps and Games] tdunham:
Sorry about that. This would be the sql entry, you need to use the conversion tool to find the smali entry.
[Android Apps and Games] daxgirl:
This is the correct integer for color black to use in smali... your problem is with smali...

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] tdunham:
What are you trying to color?

The only thing I can find in there is the carrier text color and ours is this:

Locals was increased to accommodate toggle too.

.method private setCarrierText()V
[COLOR="Red"].locals 6
[/COLOR]
.
.
.
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

[COLOR="Blue"] invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->updateCarrierTextColor()V

iget v3, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mCarrierColor:I

invoke-virtual {v1, v3}, Landroid/widget/TextView;->setTextColor(I)V
[/COLOR]
goto :goto_0

:cond_0
return-void
.end method

New method:

.method updateCarrierTextColor()V
.locals 4

iget-object v1, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mContext:Landroid/content/Context;

invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

const-string v2, "panel_carrier_color"

const v3, -0x1

invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v1

iput v1, p0, Lcom/android/systemui/statusbar/policy/NetworkControllerImpl;->mCarrierColor:I

return-void
.end method

Edit: Have to add this instance too:

# instance fields
[COLOR="Blue"].field private mCarrierColor:I[/COLOR]
[Android Apps and Games] Kamy:
Yes. It can be colorized like that. But I thought we can use hex color changer too like conventional color picker in custom settings.
[Android Apps and Games] daxgirl:
I am lost.... I don't understand what you mean... ..

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
This is color changer from this project, right?

And this is color changer from custom settings by ficeto

without hex changer it's bit difficult to have a universal color.
[Android Apps and Games] tdunham:
Yes we are both lazy :rolleyes: and I am using both custom settings too.

Old one is easier to modify for quick test.

---------- Post added at 02:52 PM ---------- Previous post was at 02:51 PM ----------

And old habits are hard to break. LOL
[Android Apps and Games] Kamy:
[emoji16]

Sorry again me caused confusion for everybody.
[Android Apps and Games] daxgirl:
When you define your colorpicker preference in xml add attribute

hexValue="true"

And you will have option to choose hex as well

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] daxgirl:
Apktool junkie ???

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
Hmmm. My preference is like following is that correct? Maybe I am doing something wrong but hex chooser doesn't appear

<com.wubydax.romcontrol.prefs.ColorPickerPreference
android:key="panel_carrier_color"
android:title="Carrier Text Color"
android:defaultValue="ff000000"
android:summary="Choose carrier color"
alphaSlider="true"
hexValue="true" />
[Android Apps and Games] daxgirl:
I am answering thread today in between alot of work, when I get to pc I will test it and get back to you.

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
I didnt know. Apologies for inconvenience.
[Android Apps and Games] rompnit:
There's a 5 step program for that :p
[Android Apps and Games] tdunham:
The investment of a mini-frig is critical.

Placement next to the computer workstation is optional.

No steps... :silly::silly::silly:
[Android Apps and Games] eegii9999:
Thanks devs.
[Android Apps and Games] daxgirl:
Hey! Took me a while as I was very busy yesterday, but here is the hex value in color picker. Works like charm.

All I did was add hexValue="true" to the xml
[Android Apps and Games] Kamy:
So strange that it doesnt appear here!!!
[Android Apps and Games] daxgirl:
Can you please attach your java file for the colorpicker preference? Or better yet upload your whole code to git and I will have a look.

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
I updated colorpicker by this commit you shared from here: Copied the whole commit to mine

https://github.com/attenzione/andro...erence/colorpicker/ColorPickerPreference.java

Edit: It's working now, I didn't actually update the whole commit as I was thinking
[Android Apps and Games] daxgirl:
Glad to hear! I was about to upload the java class for you. :)

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
Thank you for nonstop support. You are amazing.
[Android Apps and Games] Kamy:
About integrating an application I need some help,

I am trying to link OTA Updates and 3Minit Battery Mod in Useful App list I have done following

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
[COLOR="SeaGreen"] <PreferenceScreen
android:key="com.sec.android.app.themechooser.MainTabActivity"
android:summary="Choose launcher theme"
android:title="Theme Manager" />
<PreferenceScreen
android:key="com.wubydax.geartwswipe.ResetDialogActivity"
android:summary="Alter home swipe target"
android:title="TW Swipe" />
<PreferenceScreen
android:key="com.android.settings.SViewColor2014"
android:summary="Choose Background for SView Window"
android:title="S View window wallpaper" />
<PreferenceScreen
android:key="mobi.xperiacle.upsm.manager.MainActivity"
android:summary="Enable apps on UPSM"
android:title="UPSM Manager" />
<PreferenceScreen
android:key="eu.chainfire.supersu.MainActivity"
android:summary="Root Access Control"
android:title="SuperSu" />[/COLOR]
[COLOR="Red"] <PreferenceScreen
android:key="com.ota.updates.activities.MainActivity"
android:summary="Check AryaMod Addons and Update"
android:title="OTA Updates" />
<PreferenceScreen
android:key="com.three.minit.minitbatterysettings.MainActivity"
android:summary="Custom battery chooser"
android:title="3Minit Battery Settings" />
</PreferenceScreen>[/COLOR]

Those in activities in green appear in the list but OTA Updates and 3Minit (in red) don't. I read that

But didn't get which "." is pointed to.
[Android Apps and Games] daxgirl:
I will test them and get back to you. Thanks for the info!

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
Appreciate your help [MENTION=4714483]daxgirl[/MENTION]

3Minit Battery Mod didn't appear and I don't know the reason too. Though I used the second approach as OTA you explained and it shows itself.

<PreferenceScreen
android:summary="Custom battery chooser"
android:title="3Minit Battery Mod">
<intent
android:targetClass="com.three.minit.minitbatterysettings.MainActivity"
android:targetPackage="com.three.minit.minitbatterysettings.free" />
</PreferenceScreen>
[Android Apps and Games] bawffg85:
Hello,my dear friends here.I just want to add some personal info to this great app,such as

<PreferenceScreen android:title="Follow Me">

<intent android:action="android.intent.action.VIEW" android:data="http://weibo.com/brom" />

</PreferenceScreen>

it should jump to the website "http://weibo.com/brom" after clicked,but nothing happened.Could you please have a look?Thanks in advance!
[Android Apps and Games] daxgirl:
You have a problem if it doesn't show without the second approach. It's not needed for 3 minit.

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] Kamy:
Both of them are on my list now. I used intent approach. Thanks
[Android Apps and Games] daxgirl:
See ,y reply to Mokhtar 2 posts above yours and implement the last part (in onPreferenceClick).Let me know if it works!
[Android Apps and Games] daxgirl:
I think the difference is I have the paid app. So the package name doesn't have the .free in the end. :)
[Android Apps and Games] daxgirl:
I think I will change a way the key is written for implicit intents. Because otherwise some apps are not registering as intent targets. This is a bug in the app. I will see if I can work on it later on tonight.
[Android Apps and Games] Kamy:
Apply changes from here, I just tried and worked as what you are asking.

Yes that worked I just tried this code for test and it took me to AryaMod thread

<PreferenceScreen
android:title="XDA Forum Thread">
<intent
android:action="android.intent.action.VIEW"
android:data="http://xdaforums.com/galaxy-note-3/development/rom-aryamod-v1-tw-lollipop-t2990920" />
[Android Apps and Games] daxgirl:
Cool! Thank you!

I think we might wanna make an About us fragment of sorts. Not a preference fragment but a regular one... where you can write alittle about your roms and yourselves.

If you guys think this could be a nice idea, let us know. Also what you would like to see there. . I.e .. dialog. .. fragment in container as the rest of them...

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] bawffg85:
It works fine following your instruction!!:DGreat!

And my another request,sorry for trouble you.Could you please add this feature,when we click,something like Facebook account is copied to clipboard?
[Android Apps and Games] daxgirl:
You mean the url of your intent is copied to clipboard?

Sent from my awesome g920f powered by 6thGear
[Android Apps and Games] bawffg85:
Yes,or any other words.
[Android Apps and Games] daxgirl:
Please give me an example:

1. What would you like to achieve? What is the use of it?

2. What kind if preference you would like to link to that function? How would you define that preference in xml?

I just want to understand that I get the full picture.

Sent from my awesome g920f powered by 6thGear