Friday, February 7, 2014

How to Android Settings Setting the default option


            
Such as the title, now transplanted Android4.2.2, the need to achieve the developers in setting the default boot option checked Disable HW overlays options how to achieve? Similar to the following methods can now be found to:
The default value
If you want to modify the system's boot loader afterModify SettingsProvider defaults, Settings to configure various settings of the Android system, the default values ​​for these settings are made frameworks in SettingsProvider read from the database, then the first boot when these data are from where it ?
frameworks / base / packages / SettingsProvider / res / values ​​/ defaults.xml

This file is used to store default settings
Android systemFor example:
600000 Set Off screen timeout defaults
102 Set Default
brightness false Set whether to allow installation of non-Market application defaults
If you want to define defaults.xml did not, and after here to add, modify
frameworks / base / packages / SettingsProvider / src / com / android / providers / settings / DatabaseHelper.java, add your own storage code.
Read from the database that can not be achieved on the first boot is checked by default Disable HW overlays, and defaults.xml, no content on Developer options, how to add?
Reply:
Add yourself to initialize a loadStringSettings in DatabaseHelper Disable HW overlays
Reply:
cited a floor l417584711 reply:
himself in to add a loadStringSettings DatabaseHelper to initialize Disable HW overlays

SQLiteStatement stmt = null;
try {
stmt = db.compileStatement ("INSERT INTO system (name, value)"
+ "VALUES (,??);");
loadBooleanSetting (stmt, Settings.System.NOTIFICATION_LIGHT_PULSE ,
R.bool.def_ notification_pulse );
db.setTransactionSuccessful ();
} Finally {
db.endTransaction ();
if (stmt = null!) stmt.close ();
}
Modify the above code red part can define your own fields, the blue part of the developer the option corresponding Disable HW overlays field how to determine?
Reply:
This thing is not looked under the HWC with settingsprovider store. . . . . .
Then you go inside how to write database will not be called to. . . . . .
frameworks / native / services / surfaceflinger / SurfaceFlinger.cpp in

mDebugDisableHWC (0), you put the words into an initial try
Reply:
reference to the third floor l417584711 reply:
looked under HWC this thing is not using settingsprovider store. . . . . .
Then you go inside how to write database will not be called to. . . . . .
frameworks / native / services / surfaceflinger / SurfaceFlinger.cpp in

mDebugDisableHWC (0), you put the words into an initial try

Great! Indeed such a change, aSysBang how you are positioned to Disable HW overlays SurfaceFlinger.cpp mDebugDisableHWC (0) it?

No comments:

Post a Comment