Today to share with you on the modified MTK platform system on the first boot of the default screen backlight brightness, System language default English case modification date format, modify the photo properties, specific changes in the place is unclear or no one told
words, please refer to the previous blog methods to share, now directly into the theme
First, let's change the screen brightness of the first boot.
① Modify the system default screen backlight brightness for the first time, I am the------that is modified under the Java (the place of the comment is removed, because the comment place is modified)
Packages\apps\settings\src\com.mediatek.settings\restorerotationreceiver.java
Private Sharedpreferences msharedpreferences; @Override public void OnReceive (context context, Intent Intent) {String action = intent.getaction (); LOG.V ("Restorerotationreceiver_ipo", action);//msharedpreferences = Context.getsharedpreferences ("Walpad_first_ru n ", context.mode_private); if (action.equals (intent.action_boot_completed) | | action.equals ("Android.intent.action.ACTION_BOOT_IPO")) {Srestoreretore = Settings.System.getInt (context. Getcontentresolver (), Settings.System.ACCELEROMETER_ROTATION_RESTORE, 0)! = 0; engineer-jsp add Unknown sources and USB debugging default True if (Android.os.SystemProperties.isWalPadVer Sion () &&!isfirstrunsettings (context)) {//reboot first default UNKONWN sources check Settings.Global.putInt (Context.getcontentresolver (), Settings.Global.INSTALL_NON_MARKET_APPS, 1); Reboot first default USB debugging Check Settings.Global.putInt (Context.getcontentresolver (), SETTINGS.GL Obal. adb_enabled, 1); Save first reboot Falgs boolean//msharedpreferences.edit (). putstring ("Isfirstrun", string.valueof (True) ). commit (); FirstRun DEFAULR birghtness value for 100%//setwalpadcfirstrundefaultbrightness (context); } if (Srestoreretore) {Settings.System.putInt (Context.getcontentresolver (), Settings.System.ACCELEROMETER_ROTATION, 1); Settings.System.putInt (Context.getcontentresolver (), Settings.System.ACCELEROMETER_ROTATION_RESTORE , 0); }}}/** * ***-mtk-6582-8382©-*** * isfirstrunsettings (Context context) * Walpad c firstrun N Eed Default False * engineer-jsp Add * */public Boolean isfirstrunsettingS (context context) {if (Textutils.isempty (msharedpreferences.getstring ("Isfirstrun", ""))) {Msharedpreferences.edit (). putstring ("Isfirstrun", String.valueof (False)). commit ();} Return boolean.valueof (msharedpreferences.getstring ("Isfirstrun", "")); }/** * ***-mtk-6582-8382©-*** * setwalpadcfirstrundefaultbrightness (Context context) * Walpad C Firstru n Need default settings brightness value for 100% * engineer-jsp Add * */public void Setwalpadcfirstrunde Faultbrightness (Context context) {try{uri uri = Settings.System.getUriFor (Settings.System.SCREEN_BRIG htness); Settings.System.putInt (Context.getcontentresolver (), Settings.System.SCREEN_BRIGHTNESS, 255); Context.getcontentresolver (). Notifychange (URI, NULL); } catch (Exception localexception) {localexception.printstacktrace (); } }
backlight value of up to 255, so we set to the maximum OK, meaning 100% screen brightness, the execution condition is I wrote, respectively is Android.os.SystemProperties.isWalPadVersion (), this function is also
I was system code to add their own, the previous several blog also mentioned, here does not elaborate, the first boot record, because we only need to set the first boot 100% screen brightness
② Date Format Modification
Packages\apps\settings\src\com\android\settings\datetimesettings.java
@Override public void OnCreate (Bundle icicle) { super.oncreate (icicle); Addpreferencesfromresource (r.xml.date_time_prefs); Initui (); M:get plug in and move roaming time setting into date and time settings @{ mExt = Utilsext.getdatetimesettingsplu Gin (getactivity ()); Mext.customizepreferencescreen (Getactivity (), Getpreferencescreen ()); /// @} }
To modify the original system code before INITUI:
private void Initui () {Boolean autotimeenabled = Getautostate (Settings.Global.AUTO_TIME); Boolean autotimezoneenabled = Getautostate (Settings.Global.AUTO_TIME_ZONE); M:MTK use listpreference instead of Google Checkboxperference ... String [] dateformats = Getresources (). Getstringarray (R.array.date_format_values); String [] formatteddates = new String[dateformats.length]; String Currentformat = GetDateFormat (); Initialize If Date_format is not set in the system settings//This can happen after a factory reset (or data wi PE) if (Currentformat = = null) {Currentformat = ""; }//prevents duplicated values on date format selector. Mdummydate.set (Mdummydate.get (calendar.year), Mdummydate.december, 31, 13, 0, 0); for (int i = 0; i < formatteddates.length; i++) {String formatted = DATEFORMAT.GETDATEFO Rmatforsetting (Getactivity (), dateformats[i]) . Format (Mdummydate.gettime ()); if (dateformats[i].length () = = 0) {Formatteddates[i] = getresources (). GetString (R.string.normal_date_format, formatted); } else {formatteddates[i] = formatted; }} mdateformat.setentries (Formatteddates); Mdateformat.setentryvalues (r.array.date_format_values); Mdateformat.setvalue (Currentformat);
Original GetDateFormat ():
Private String GetDateFormat () { return Settings.System.getString (Getcontentresolver (), Settings.System.DATE_FORMAT); }
modified as follows (modified to date format default lunar year):
Initui:
private void Initui () {Boolean autotimeenabled = Getautostate (Settings.Global.AUTO_TIME); Boolean autotimezoneenabled = Getautostate (Settings.Global.AUTO_TIME_ZONE); M:MTK use listpreference instead of Google Checkboxperference ... String [] dateformats = Getresources (). Getstringarray (R.array.date_format_values); String [] formatteddates = new String[dateformats.length]; String Currentformat = GetDateFormat (dateformats[2]); Initialize If Date_format is not set in the system settings//This can happen after a factory reset (or data wi PE) if (Currentformat = = null) {Currentformat = ""; }//prevents duplicated values on date format selector. Mdummydate.set (Mdummydate.get (calendar.year), Mdummydate.december, 31, 13, 0, 0); for (int i = 0; i < formatteddates.length; i++) {String formatted = DATEFORMAT.GETDATEFO Rmatforsetting (Getactivity (), DAteformats[i]). Format (Mdummydate.gettime ()); if (dateformats[i].length () = = 0) {Formatteddates[i] = getresources (). GetString (R.string.normal_date_format, formatted); } else {formatteddates[i] = formatted; }} mdateformat.setentries (Formatteddates); Mdateformat.setentryvalues (r.array.date_format_values); Mdateformat.setvalue (Currentformat);
Modify DateFormat ():
private string GetDateFormat (string format) { //engineer-jsp add walpad C default date format if (android.os.Syst Emproperties.iswalpadversion ()) { Settings.System.putString (Getcontentresolver ()), Settings.System.DATE_ format, format); } Return Settings.System.getString (Getcontentresolver (), Settings.System.DATE_FORMAT); }
r.array.date_format_values:
<string-array name= "Date_format_values" translatable= "false" > <!--The blank item means to use whatever the Locale calls for. - <item></item> <item>MM-dd-yyyy</item> <item>dd-mm-yyyy</ item> <item>yyyy-MM-dd</item> <item>EE-MMM-d-yyyy</item> <item> ee-d-mmm-yyyy</item> <item>yyyy-MMM-d-EE</item> </string-array>
dateformats[2] = = <item>dd-MM-yyyy</item>
③picture Makeer model, modifying buildinfo.sh file, Model\product properties
Before you modify:
After modification:
③ is compiled, the first two of them are not posted.
The path to Android (first known MTK)------Default first boot screen brightness/date format/picture Makeer model