I am somewhat new to android development/porting and I am trying to port some features to a custom ROM. I am currently working on Settings.apk file.
The XML of base Settings.apk\res\xml\ambient_display\settings looks like this:
<SwitchPreference android:title="@string/doze_always_on_title" android:key="ambient_display_always_on" android:summary="@string/doze_always_on_summary" settings:controller="com.android.settings.display.AmbientDisplayAlwaysOnPreferenceController" />
I want to add this settings feature to my custom ROM's Settings.apk. **
Where do I find the android:key (like we find android:title in xml/values/string.xml)? And is there any effective way to port this feature to my ROM?
I tried editing the Settings.apk of the custom ROM, hoping that the backend exists, but the SystemUI.apk and Settings.apk kept on crashing after I made the changes.