Build Variant Settings

237 views
Skip to first unread message

Jacob M Shufro

unread,
Apr 20, 2012, 1:12:34 PM4/20/12
to android-platform
Hi again folks,

So using the "debug" build variant automatically enables "USB
Debugging" in the settings- where is this done? I'd like to also
automatically enable the "Stay Awake" feature in apps/development and
the "Trust Unknown Sources" feature for installing 3rd party apps.

Jacob M Shufro

unread,
Apr 20, 2012, 5:10:56 PM4/20/12
to android-platform
I've found this section of build/core/main.mk

ifeq (true,$(strip $(enable_target_debugging)))
# Target is more debuggable and adbd is on by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
persist.service.adb.enable=1
# Include the debugging/testing OTA keys in this build.
INCLUDE_TEST_OTA_KEYS := true
else # !enable_target_debugging
# Target is less debuggable and adbd is off by default
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=0
persist.service.adb.enable=0
endif # !enable_target_debugging

Which enables ADB when a debug is built by
ADDITIONAL_DEFAULT_PROPERTIES += ro.debuggable=1
persist.service.adb.enable=1

Now I need to figure out what the other variables I need to set are
called.. assuming they exist.

Janice

unread,
Sep 27, 2013, 1:10:09 AM9/27/13
to android-...@googlegroups.com
Hi, Did you find the answer for "stay awake"? If so, where is it set?
 
Thank you!

shridutt kothari

unread,
Sep 30, 2013, 4:18:57 AM9/30/13
to android-...@googlegroups.com
Hi Janice,  

By default stay awake can be set by user by either system settings app, device admin app, or pragmatically, so to make the device stay awake by default,
I think you can make some change in code at either 
1. system settings 

or in
2.  powermanager service.


For more depth also see these classes for related code:
/packages/apps/Settings/src/com/android/settings/DevelopmentSettings.java
/frameworks/base/services/java/com/android/server/power/PowerManagerService.java
/frameworks/base/core/java/android/app/admin/DevicePolicyManager.java
/frameworks/base/services/java/com/android/server/DevicePolicyManagerService.java

Hope that gives you pointers!
Shridutt Kothari
Impetus Infotech Limited

Pratik

unread,
Oct 16, 2013, 2:32:11 AM10/16/13
to android-...@googlegroups.com
You can also check here frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java
Search for following code,
------------8<------------------------------------8<-------------------------------------
            loadSetting(stmt, Settings.System.STAY_ON_WHILE_PLUGGED_IN,
                    "1".equals(SystemProperties.get("ro.kernel.qemu")) ? 1 : 0);
------------8<------------------------------------8<-------------------------------------

Change it according to your requirements.

Regards,
Pratik
Reply all
Reply to author
Forward
0 new messages