
Android 系统 (127)
ODM 开发用户常见需求文档(一)
Andorid6.0 ——
一:短信签名(在 vendor 下)
diff --git a/mediatek/proprietary/packages/apps/Mms/res/values-zh-rCN/strings_custon_l b/mediatek/proprietary/packages/apps/Mms/res/values-zh-rCN/strings_custon_l
- new file mode 100644
- index 0000000.. 5af5489
- --- /dev/ null
- +++ b/mediatek/proprietary/packages/apps/Mms/res/values-zh-rCN/strings_custon_l
- @@ - 0, 0 + 1, 10 @@
- +<?xml version= "1.0" encoding= "UTF-8"?>
- +<resources xmlns:android= ""
- + xmlns:xliff= "urn:oasis:names:tc:xliff:document:1.2">
- + <string name= "signature_text_hint"> "请输入签名"</string>
- + <string name= "signature_text_default"> "<这里填写短信签名>"</string>
- + <string name= "mms_signature_title"> "签名设置"</string>
- + <string name= "signature_title"> "签名选项"</string>
- + <string name= "signature_text_title"> "短信签名"</string>
- + <string name= "mms_signature_summary"> "当发送短信时,自动附加短信签名"</string>
- +</resources>
- diff --git a/mediatek/proprietary/packages/apps/Mms/res/values/strings_custon_l b/mediatek/proprietary/packages/apps/Mms/res/values/strings_custon_l
- new file mode 100644
- index 0000000.. 7ac7b9f
- --- /dev/ null
- +++ b/mediatek/proprietary/packages/apps/Mms/res/values/strings_custon_l
- @@ - 0, 0 + 1, 10 @@
- +<?xml version= "1.0" encoding= "utf-8"?>
- +<resources xmlns:xliff= "urn:oasis:names:tc:xliff:document:1.2">
- + <string name= "signature_text_hint">Please enter a signature</string>
- + <string name= "signature_text_default"> "<这里填写短信签名>"</string>
- + <string name= "mms_signature_title"> "Signature Setting"</string>
- + <string name= "signature_title"> "Optional signature"</string>
- + <string name= "signature_text_title"> "SMS signature"</string>
- + <string name= "mms_signature_summary"> "Automatically append signature to every MMS message you send"</string>
- +</resources>
- +
- diff --git a/mediatek/proprietary/packages/apps/Mms/res/l b/mediatek/proprietary/packages/apps/Mms/res/l
- index 901c106.. 1b64ffa 100755
- --- a/mediatek/proprietary/packages/apps/Mms/res/l
- +++ b/mediatek/proprietary/packages/apps/Mms/res/l
- @@ - 45, 6 + 45, 18 @@
- android:persistent= "false">
- </Preference>
- </PreferenceCategory>
- + <PreferenceCategory android:title= "@string/mms_signature_title"
- + android:key= "pref_key_mms_signature_settings">
- + <CheckBoxPreference android:defaultValue= "true"
- + android:key= "pref_key_signature_switch"
- + android:summary= "@string/mms_signature_summary"
- + android:title= "@string/signature_title" />
- + <Preference android:key= "pref_key_signature_text_editor"
- + android:title= "@string/signature_text_title"
- + android:dependency= "pref_key_signature_switch"
- + android:summary= "@string/signature_text_default"
- + android:persistent= "false"/>
- + </PreferenceCategory>
-
- <PreferenceCategory android:title= "@string/pref_title_wappush_settings"
- android:key= "pref_key_wappush_settings">
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/transaction/SmsMessageSender.java b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/transaction/SmsMessageSender.java
- index b9f396d.. 1633a59 100644
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/transaction/SmsMessageSender.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/transaction/SmsMessageSender.java
- @@ - 51, 7 + 51, 7 @@ public class SmsMessageSender implements MessageSender {
- protected final Context mContext;
- protected final int mNumberOfDests;
- private final String[] mDests;
- - protected final String mMessageText;
- + protected String mMessageText;
- protected final String mServiceCenter;
- protected final long mThreadId;
- protected int mSubId;
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/transaction/SmsSingleRecipientSender.java b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/transaction/SmsSingleRecipientSender.java
- index 4aab62f.. 2d60f08 100644
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/transaction/SmsSingleRecipientSender.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/transaction/SmsSingleRecipientSender.java
- @@ - 34, 6 + 34, 10 @@ import s.MmsApp;
- import com.lephony.PhoneConstants;
- import s.util.PhoneUtils;
- import s.util.MmsLog;
- + diatek.setting.GeneralPreferenceActivity;
- + import android.preference.PreferenceManager;
- + t.SharedPreferences;
- +
-
-
- public class SmsSingleRecipientSender extends SmsMessageSender {
- @@ - 42, 6 + 46, 7 @@ public class SmsSingleRecipientSender extends SmsMessageSender {
- private String mDest;
- private Uri mUri;
- private static final String TAG = "SmsSingleRecipientSender";
- + private Context mContext;
-
- private IOpSmsSingleRecipientSenderExt mOpSmsSenderExt;
-
- @@ - 51, 6 + 56, 7 @@ public class SmsSingleRecipientSender extends SmsMessageSender {
- mRequestDeliveryReport = requestDeliveryReport;
- mDest = dest;
- mUri = uri;
- + mContext = context;
- mOpSmsSenderExt = OpMessagePlugin().getOpSmsSingleRecipientSenderExt();
- }
-
- @@ - 65, 6 + 71, 15 @@ public class SmsSingleRecipientSender extends SmsMessageSender {
- }
-
- /// M:Code analyze 002,add a variable to caculate the length of sms @{
- + SharedPreferences sp = DefaultSharedPreferences(mContext);
- + StringBuffer addSignature = new StringBuffer(mMessageText);
- + Boolean(GeneralPreferenceActivity.SMS_SIGNATURE_SWITCH, true)){
- + addSignature.append( "nn"String(GeneralPreferenceActivity.SMS_SIGNATURE_TEXT, "<这里填写短信签名>"));
- + android.util.Log.i( "jiangyanqing", " addSignature : "+addSignature);
- + }
- + mMessageText = addSignature+ "";
- int codingType = SmsMessage.ENCODING_UNKNOWN;
- codingType = mOpSmsSenderExt.sendMessagePrepare(mContext, codingType);
-
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/setting/GeneralPreferenceActivity.java b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/setting/GeneralPreferenceActivity.java
- index 4d12a2f.. 8dd0c87 100755
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/setting/GeneralPreferenceActivity.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/setting/GeneralPreferenceActivity.java
- @@ - 88, 6 + 88, 11 @@ import java.io.OutputStream;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- + import android.widget.EditText;
- + aphics.Color;
- + t.DialogInterface.OnClickListener;
- + t.SharedPreferences.Editor;
- +
-
- /**
- * With this activity, users can set preferences for MMS and SMS and
- @@ -124,6 +129,10 @@ public class GeneralPreferenceActivity extends PreferenceActivity
-
- public static final String WAPPUSH_ENABLED = "pref_key_wappush_enable";
-
- + public static final String SMS_SIGNATURE_SWITCH = "pref_key_signature_switch";
- +
- + public static final String SMS_SIGNATURE_TEXT = "pref_key_signature_text_editor";
- +
- private static final String MAX_SMS_PER_THREAD = "MaxSmsMessagesPerThread";
-
- private static final String MAX_MMS_PER_THREAD = "MaxMmsMessagesPerThread";
- @@ -143,6 +152,10 @@ public class GeneralPreferenceActivity extends PreferenceActivity
-
- private Preference mChatWallpaperPref;
-
- + private Preference mSmsSignatureTextPref;
- +
- + private Preference mSmsSignatureSwitch;
- +
- private Preference mSmsLimitPref;
-
- private Preference mMmsLimitPref;
- @@ -294,7 +307,18 @@ public class GeneralPreferenceActivity extends PreferenceActivity
- .getOpGeneralPreferenceActivityExt();
- mOpGeneralPreferenceActivityExt.setMessagePreferences(
- GeneralPreferenceActivity.this, storageCategory);
- -
- + mSmsSignatureTextPref = (Preference) findPreference(SMS_SIGNATURE_TEXT);
- + android.util.Log.i("jiangyanqing", " signature txt :"String(SMS_SIGNATURE_TEXT,""));
- + String(SMS_SIGNATURE_TEXT,"").equals("")){
- + Editor ed = DefaultSharedPreferences(GeneralPreferenceActivity.this).edit();
- + ed.putString(SMS_SIGNATURE_TEXT, getString(R.string.signature_text_default));
- + edmit();
- + }
- + android.util.Log.i("jiangyanqing", " signature txt 2222:"String(SMS_SIGNATURE_TEXT,""));
- + mSmsSignatureTextPref.String(SMS_SIGNATURE_TEXT,""));
- + mSmsSignatureSwitch = (Preference) findPreference(SMS_SIGNATURE_SWITCH);
- mFontSize = (Preference) findPreference(FONT_SIZE_SETTING);
- mFontSizeChoices = getResourceArray(R.array.pref_message_font_size_choices);
- mFontSizeValues = getResourceArray(R.array.pref_message_font_size_values);
- @@ -409,6 +433,37 @@ public class GeneralPreferenceActivity extends PreferenceActivity
- showDialog(FONT_SIZE_DIALOG);
- } else if (preference == mChatWallpaperPref) {
- pickChatWallpaper();
- + }else if (preference == mSmsSignatureTextPref){
- + final EditText smsSignatureEdit = new EditText(this);
- + smsSignatureEdit.setHint(R.string.signature_text_hint);
- + smsSignatureEdit.setTextColor(Color.BLACK);
- + smsSignatureEditputeScroll();
- + if (Summary().length() > 0) {
- + smsSignatureEdit.Summary());
- + }
- + new AlertDialog.Builder(this)
- + //.setTitle(R.string.signature_text_title)
- + .setTitle(getString(s_signature_title))
- + .setView(smsSignatureEdit)
- + .setPositiveButton(R.string.OK, new OnClickListener() {
- + @Override
- + public void onClick(DialogInterface dialog, int which) {
- + String text = Text().toString();
- + if (text.length() <= 0) {
- + text = getResources().getString(R.string.signature_text_default);
- + }
- + mSmsSignatureTextPref.setSummary(text);
- + SharedPreferences.Editor ed = DefaultSharedPreferences(GeneralPreferenceActivity.this).edit();
- + ed.putString(SMS_SIGNATURE_TEXT, text);
- + edmit();
- + }
- + })
- + .setNegativeButton(R.string.Cancel, null)
- + .show();
- + }else if(preference == mSmsSignatureSwitch){
- +
- }
- PreferenceTreeClick(preferenceScreen, preference);
- }
- @@ -425,6 +480,9 @@ public class GeneralPreferenceActivity extends PreferenceActivity
- editor.putBoolean(CELL_BROADCAST, false);
- /// M: fix bug ALPS00759844, WAPPUSH_ENABLED should be true.
- editor.putBoolean(WAPPUSH_ENABLED, true);
- + editor.putBoolean(SMS_SIGNATURE_SWITCH,true);
- + editor.putString(SMS_SIGNATURE_TEXT,getString(R.string.signature_text_default));
- +
- editor.putBoolean(WAPPUSH_AUTO_DOWNLOAD, false);
- /// M: fix bug ALPS00432361, restore default preferences
- /// about GroupMms and ShowEmailAddress @{
-
二: 第三方app状态栏作成沉浸式的(在 frameworks 下)
- diff --git a/base/core/java/com/android/internal/policy/PhoneWindow.java b/base/core/java/com/android/internal/policy/PhoneWindow.java
- index 0ab5aed..f627612 100644
- --- a/base/core/java/com/android/internal/policy/PhoneWindow.java
- +++ b/base/core/java/com/android/internal/policy/PhoneWindow.java
- @@ - 2966, 7 + 2966, 8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
- WindowManager.LayoutParams attrs = getAttributes();
- int sysUiVisibility = attrs.systemUiVisibility | getWindowSystemUiVisibility();
-
- - if (!mIsFloating && ActivityManager.isHighEndGfx()) {
- + // if (!mIsFloating && ActivityManager.isHighEndGfx()) {
- + if (!mIsFloating && (ActivityManager.isHighEndGfx() || Boolean( fig.low_ram", true))){
- boolean disallowAnimate = !isLaidOut();
- disallowAnimate |= ((mLastWindowFlags ^ attrs.flags)
- & FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) != 0;
- @@ - 3879, 7 + 3880, 8 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
-
- // Non-floating windows on high end devices must put up decor beneath the system bars and
- // therefore must know about visibility changes of those.
- - if (!mIsFloating && ActivityManager.isHighEndGfx()) {
- + // if (!mIsFloating && ActivityManager.isHighEndGfx()) {
- + if (!mIsFloating && (ActivityManager.isHighEndGfx() || Boolean( fig.low_ram", true))){
- if (!targetPreL && a.getBoolean(
- R.styleable.Window_windowDrawsSystemBarBackgrounds,
- false)) {
三:相机人脸识别开关(在 vendor/mediatek/proprietary/packages/apps/Camera/res/l 里)
- <resources xmlns:xliff= "urn:oasis:names:tc:xliff:document:1.2">
- <!-- catpure mode -->
- <string name= "pref_camera_face_detect_default" translatable= "false">off</string>
- </resources>
四: 添加时区
先 frameworks/base/packages/SettingsLib/res/l 里找一下有没有你要默认的时区,里面有的可以直接做默认时区,没有的话请下载我资源中的timezones文件并解压,
再在其中搜索你要添加的时区(搜索到的格式必须为.../...的标准时区格式),如果搜索到的话可以添加进l,如果没有搜索到的话,证明不能添加时区,如果客户必须要这些时区的话
我们可以把+/-时区时间相同的另一个时区改名为客户要的...以下为patch(右边替换左边)
- diff --git a/base/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java b/base/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java
- index 7b5bfb5.. 0520960 100644
- --- a/base/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java
- +++ b/base/packages/SettingsLib/src/com/android/settingslib/datetime/ZoneGetter.java
- @@ - 118, 7 + 118, 7 @@ public class ZoneGetter {
- boolean isLocalZoneId = ains(olsonId);
- boolean preferLongName = isLocalZoneId && !localLongNamesAreAmbiguous;
- String displayName = getZoneDisplayName(locale, tz, now, preferLongName);
- -
- + displayName = place( "Dhaka", "Astana").replace( "达卡", "阿斯塔纳").replace( "Дакка", "Астана").replace( "Magadan", "Severo-Kurilsk").replace( "马加丹", "塞维罗-库里尔斯克").replace( "Магадан", "Северо-Курильск").replace( "Vladivostok", "Khabarovsk").replace( "海参崴", "哈巴罗夫斯克").replace( "Владивосток", "Хабаровск");
- String gmtOffsetString = getGmtOffsetString(locale, tz, now);
- int offsetMillis = tz.Time());
- Map<String, Object> displayEntry =
如果要做默认时区的话还需注意的是:如果有Google开机向导,那么需要察看默认的时区在Google开机向导中是否存在该时区,如果不存在,那么该时区不能作为默认时区添加
五: 开机点击菜单按钮,桌面与主菜单重叠
在 packages/apps/Launcher3 中让用户第一次点击时停2秒就解决了
- diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
- index 9366659.. 8b3ea5a 100644
- --- a/src/com/android/launcher3/Launcher.java
- +++ b/src/com/android/launcher3/Launcher.java
- @@ - 255, 7 + 255, 7 @@ public class Launcher extends Activity
- public static final int EXIT_SPRINGLOADED_MODE_SHORT_TIMEOUT = 300;
- private static final int ON_ACTIVITY_RESULT_ANIMATION_DELAY = 500;
- private static final int ACTIVITY_START_DELAY = 1000;
- -
- + private int mSleep = 0;
- private HashMap<Integer, Integer> mItemIdToViewId = new HashMap<Integer, Integer>();
- private static final AtomicInteger sNextGeneratedId = new AtomicInteger( 1);
-
- @@ - 2887, 7 + 2887, 19 @@ public class Launcher extends Activity
- onClickFolderIcon (v);
- }
- } else if (v == mAllAppsButton) {
- - onClickAllAppsButton(v);
- + if(mSleep == 0){
- + Handler handler = new Handler();
- + handler.postDelayed( new Runnable() {
- + @Override
- + public void run() {
- + mSleep = 1;
- + onClickAllAppsButton(mAllAppsButton);
- + }
- + }, 2000);
- + }
- + else{
- + onClickAllAppsButton(v);
- + }
- } else if (tag instanceof AppInfo) {
- startAppShortcutOrInfoActivity(v);
- } else if (tag instanceof LauncherAppWidgetInfo) {
六:设置 > 位置信息 ( frameworks/base/packages/SettingsProvider/res/values/ l )
- <resources>
- <string name= "def_location_providers_allowed" translatable= "false"></string>
- </resources>
里面填 gps 是打开 network 是高精度,两个都要就用;连接 默认到节电就这样( packages/apps/Settings)
- diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java
- index 3b71e79.. 3324c4d 100644
- --- a/src/com/android/settings/location/LocationSettings.java
- +++ b/src/com/android/settings/location/LocationSettings.java
- @@ - 385, 7 + 385, 7 @@ public class LocationSettings extends LocationSettingsBase
- @ Override
- public void onSwitchChanged( Switch switchView, boolean isChecked) {
- if (isChecked) {
- - setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_HIGH_ACCURACY);
- + setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_BATTERY_SAVING);
- } else {
- setLocationMode(android.provider.Settings.Secure.LOCATION_MODE_OFF);
- }
七: 基带版本号和内核版本号(在packages/apps/Settings 下)
- diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
- index e77726a.. 192aa59 100644
- --- a/src/com/android/settings/DeviceInfoSettings.java
- +++ b/src/com/android/settings/DeviceInfoSettings.java
- @@ - 140, 13 + 140, 13 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
- getPreferenceScreen (). removePreference (findPreference(KEY_SECURITY_PATCH));
-
- }
- - setValueSummary(KEY_BASEBAND_VERSION, "gsm.version.baseband");
- //基带版本号
- + findPreference(KEY_BASEBAND_VERSION).setSummary( "MOLY.WR8.W1449.MD.WG.MP.V6.P6, n2016/06/16 19:48");
- setStringSummary(KEY_DEVICE_MODEL, Build.MODEL + getMsvSuffix());
- setValueSummary(KEY_EQUIPMENT_ID, PROPERTY_EQUIPMENT_ID);
- setStringSummary(KEY_DEVICE_MODEL, Build.MODEL);
- setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
- findPreference(KEY_BUILD_NUMBER).setEnabled( true);
- - findPreference(KEY_KERNEL_VERSION).setSummary(getFormattedKernelVersion());
- //内核版本号
- + findPreference(KEY_KERNEL_VERSION).setSummary( "3.10.72+ nsonglixin@v106 #1 nThu Jun 16 20:02:31 CST 2016");
-
- if (!SELinux.isSELinuxEnabled()) {
- String status = getResources().getString(R.string.selinux_status_disabled);
- diff --git a/src/com/mediatek/settings/deviceinfo/DeviceInfoSettingsExts.java b/src/com/mediatek/settings/deviceinfo/DeviceInfoSettingsExts.java
- index 0bcca55.. 234a286 100644
- --- a/src/com/mediatek/settings/deviceinfo/DeviceInfoSettingsExts.java
- +++ b/src/com/mediatek/settings/deviceinfo/DeviceInfoSettingsExts.java
- @@ - 139, 7 + 139, 7 @@ public class DeviceInfoSettingsExts {
- baseband = "gsm.version.baseband.2";
- }
- Log.d(TAG, "baseband = " + baseband);
- - setValueSummary(KEY_BASEBAND_VERSION, baseband);
- + findPreference(KEY_BASEBAND_VERSION).setSummary( "MOLY.WR8.W1449.MD.WG.MP.V6.P6, n2016/06/16 19:48");
-
- if (hasExternalModem && !FeatureOption.PURE_AP_USE_EXTERNAL_MODEM) {
- String baseband2 = "gsm.version.baseband.2";
八:合入FOTA
除了加入客户提供的fota apk 外,还要在关于手机里面加入无线升级(fota 入口) (在packages/apps/Settings 中)
- diff --git a/res/xml/device_l b/res/xml/device_l
- index b9ac889.. 67c155d 100644
- --- a/res/xml/device_l
- +++ b/res/xml/device_l
- @@ - 37, 8 + 37, 8 @@
- <!-- fota start -->
- <PreferenceScreen android:key= "adupsfota_software_update"
- android:title= "Wireless update">
- - <intent android:targetPackage= "com.adups.fota"
- - android:targetClass= "com.adups.fota.GoogleOtaClient"/>
- //apk包名
- + <intent android:targetPackage= "ru.drivepixels.fota"
- //apk类名
- + android:targetClass= "ru.drivepixels.fota.Fota"/>
- </PreferenceScreen>
- <!-- fota end -->
- <!-- End of Vanzo:tanglei -->
- diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
- index fbb818b.. 5375b93 100644
- --- a/src/com/android/settings/DeviceInfoSettings.java
- +++ b/src/com/android/settings/DeviceInfoSettings.java
- @@ - 240, 14 + 240, 14 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
- /* Vanzo:tanglei on: Sun, 03 Jan 2016 15:57:06 +0800
- */
- //fota start
- - if(!isApkExist(act, "com.adups.fota")){
- + if(!isApkExist(act, "ru.drivepixels.fota")){
- if(findPreference( "adupsfota_software_update") != null){
- getPreferenceScreen().removePreference(findPreference( "adupsfota_software_update"));
- }
- } else {
- Preference preference = findPreference( "adupsfota_software_update");
- if (preference != null) {
- - preference.setTitle(getAppName(act, "com.adups.fota"));
- + preference.setTitle(getAppName(act, "ru.drivepixels.fota"));
- }
- }
- //fota end
九: 暗码
1)工程代码/查看软件版本 (packages/apps/Dialer/res/values/l)
<resources>
- //工程
- <string name= "engineer_mode_code">#*# 77250411##*</string>
- // 软件版本
- <string name= "build_version_code">*#*# 77111269#*#*</string>
- </resources>
2)工厂模式( packages/apps/Dialer/res/values/ l)
- <resources xmlns:xliff= "urn:oasis:names:tc:xliff:document:1.2">
- <string name= "engineer_code_factorymode">*# 66*#</string>
- </resources>
3) 查PCB版本和查看硬件指令和软件版本和软硬件版本指令(packages/apps/Dialer)
- diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java
- index f0d069e..b03efeb 100755
- --- a/src/com/android/dialer/SpecialCharSequenceMgr.java
- +++ b/src/com/android/dialer/SpecialCharSequenceMgr.java
- @@ - 176, 6 + 176, 9 @@ public class SpecialCharSequenceMgr {
- if(input.Resources().getString(ineer_mode_code))) {
- input= "*#*#3646633#*#*";
- }
- //硬件指令(外面的是客户提供的里面的是内部的)
- + if (input.equals( "*#6666*#")) {
- + input = "*#*#9646633#*#*";
- + }
- // End of Vanzo:yujianpeng
- //get rid of the separators so that the string gets parsed correctly
- String dialString = PhoneNumberUtils.stripSeparators(input);
- @@ - 197, 6 + 200, 7 @@ public class SpecialCharSequenceMgr {
- || handlePinEntry(context, dialString)
- || handleAdnEntry(context, dialString, textField)
- || handleSecretCode(context, dialString)
- + || handlePCBVersion(context, dialString)
+ || handleExternalBuildNumber(context,dialString)
- + || handleInternalBuildNumber(context,dialString)
- /// M: for OP09 6M project @{
- || handleVersionCode(context, dialString)
- /// @}
- @@ - 221, 6 + 225, 18 @@ public class SpecialCharSequenceMgr {
- return false;
- }
- + //PCB版本
- + static boolean handlePCBVersion(Context context, String input) {
- + if (input.equals( "*#7777*#")) {
- + AlertDialog alert = new AlertDialog.Builder(context)
- + .setTitle( "PCB")
- + .setMessage( "W371_MB_MP1.0_MT6580")
- + .setPositiveButton(android.R.string.ok, null).setCancelable( false).create();
- + alert.show();
- + return true;
- + }
- + return false;
- + }
- + // 软硬件版本指令
- + static boolean handleExternalBuildNumber(Context context,String input) {
- + if(input.equals( "#*8378#1#")) {
- + String displayId = ( "ro.build.display.id");
- + String hardwareId = ( "ro.build.display.hardware.id", "UNKOWN");
- + AlertDialog alert = new AlertDialog.Builder(context)
- + .Resources().getString(R.string.sw_version_title))
- + .setMessage( "Version de Softwaren" + displayId + "n" + "Version de Hardwaren" +hardwareId)
- + .setPositiveButton(android.R.string.ok, null)
- + .setCancelable( false)
- + .show();
- + return true;
- + }
- + return false;
- + }
- + //内部版本指令
- + static boolean handleInternalBuildNumber(Context context,String input) {
- + if(input.equals( "*1111#")) {
- + String innerId = ( "ro.build.display.inner.id", "UNKOWN");
+ //这个要在下面的buildinfo.sh中定义
- + String buildtime = ( "ro.d", "UNKOWN");
- + AlertDialog alert = new AlertDialog.Builder(context)
- + .Resources().getString(R.string.sw_version_title))
- + .setMessage( "Version de Softwaren" + innerId + "_" + buildtime)
- + .setPositiveButton(android.R.string.ok, null)
- + .setCancelable( false)
- + .show();
- + return true;
- + }
- + return false;
- + }
(build/tools/buildinfo.sh)
- +diff --git a/tools/buildinfo.sh b/tools/buildinfo.sh
- +index 3254ce4.. 25d24b2 100755
- +--- a/tools/buildinfo.sh
- ++++ b/tools/buildinfo.sh
- +@@ - 28, 6 + 28, 7 @@ fi
- + echo "ro.build.version.security_patch=$PLATFORM_SECURITY_PATCH"
- + echo "ro.build.version.base_os=$PLATFORM_BASE_OS"
- + echo "ro.build.date=`date`"
- ++echo "ro.d=`date +%Y%m%d`"
- + echo "ro.build.date.utc=`date +%s`"
- + echo "pe=$TARGET_BUILD_TYPE"
- + echo "ro.build.user=$USER"
(packages/apps/Settings/)硬件版本号
- +diff --git a/res/l b/res/l
- +index 8c647c8..a752eac 100644
- +--- a/res/l
- ++++ b/res/l
- +@@ - 900, 7 + 900, 8 @@
- + <string name= "fcc_equipment_id" msgid= "149114368246356737"> "ID del equipo"</string>
- + <string name= "baseband_version" msgid= "1848990160763524801"> "Versión de banda base"</string>
- + <string name= "kernel_version" msgid= "9192574954196167602"> "Versión de núcleo"</string>
- +- <string name= "build_number" msgid= "3075795840572241758"> "Número de compilación"</string>
- ++ <string name= "build_number" msgid= "3075795840572241758"> "Versión de Software"</string>
- ++ <string name= "hardware_version" msgid= "3075795840572241758"> "Versión de Hardware"</string>
- + <string name= "selinux_status" msgid= "6212165375172061672"> "Estado de SELinux"</string>
- + <string name= "device_info_not_available" msgid= "8062521887156825182"> "No disponible"</string>
- + <string name= "device_status_activity_title" msgid= "1411201799384697904"> "Estado"</string>
- +diff --git a/res/l b/res/l
- +index 94e27ea.. 6a19598 100644
- +--- a/res/l
- ++++ b/res/l
- +@@ - 900, 7 + 900, 8 @@
- + <string name= "fcc_equipment_id" msgid= "149114368246356737"> "设备 ID"</string>
- + <string name= "baseband_version" msgid= "1848990160763524801"> "基带版本"</string>
- + <string name= "kernel_version" msgid= "9192574954196167602"> "内核版本"</string>
- +- <string name= "build_number" msgid= "3075795840572241758"> "版本号"</string>
- ++ <string name= "build_number" msgid= "3075795840572241758"> "软件版本号"</string>
- ++ <string name= "hardware_version" msgid= "3075795840572241758"> "硬件版本号"</string>
- + <string name= "selinux_status" msgid= "6212165375172061672"> "SELinux 状态"</string>
- + <string name= "device_info_not_available" msgid= "8062521887156825182"> "不可用"</string>
- + <string name= "device_status_activity_title" msgid= "1411201799384697904"> "状态信息"</string>
- +diff --git a/res/l b/res/l
- +index ad5ca8c.. 33ac7b3 100644
- +--- a/res/l
- ++++ b/res/l
- +@@ - 2148, 7 + 2148, 8 @@
- + <!-- About phone screen, setting option name [CHAR LIMIT= 40] -->
- + <string name= "kernel_version">Kernel version</string>
- + <!-- About phone screen, setting option name [CHAR LIMIT= 40] -->
- +- <string name= "build_number">Build number</string>
- ++ <string name= "build_number">Build number </string>
- ++ <string name= "hardware_version">Hardware version</string>
- + <!-- About phone screen, setting option name [CHAR LIMIT= 40] -->
- + <string name= "selinux_status">SELinux status</string>
- +
- +diff --git a/res/xml/device_l b/res/xml/device_l
- +index b9ac889..de65506 100644
- +--- a/res/xml/device_l
- ++++ b/res/xml/device_l
- +@@ - 153, 6 + 153, 12 @@ add brand name
- + android:title= "@string/build_number"
- + android:summary= "@string/device_info_default"/>
- +
- ++ <!-- Detailed hardware version -->
- ++ <Preference android:key= "hardware_version"
- ++ style= "?android:preferenceInformationStyle"
- ++ android:title= "@string/hardware_version"
- ++ android:summary= "@string/device_info_default"/>
- ++
- + <!-- SELinux status information -->
- + <Preference android:key= "selinux_status"
- + style= "?android:preferenceInformationStyle"
- +diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
- +index fbb818b.. 7ff26f5 100644
- +--- a/src/com/android/settings/DeviceInfoSettings.java
- ++++ b/src/com/android/settings/DeviceInfoSettings.java
- +@@ - 80, 6 + 80, 7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
- + private static final String PROPERTY_SELINUX_STATUS = "ro.build.selinux";
- + private static final String KEY_KERNEL_VERSION = "kernel_version";
- + private static final String KEY_BUILD_NUMBER = "build_number";
- ++ private static final String KEY_HARDWARE_VERSION = "hardware_version";
- + private static final String KEY_DEVICE_MODEL = "device_model";
- + /* Vanzo:tanglei on: Fri, 24 Apr 2015 15:18:32 +0800
- + * add brand name
- +@@ -148,6 +149,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
- + setValueSummary(KEY_EQUIPMENT_ID, PROPERTY_EQUIPMENT_ID);
- + setStringSummary(KEY_DEVICE_MODEL, Build.MODEL);
- + setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
- ++ setValueSummary(KEY_HARDWARE_VERSION, "ro.build.display.hardware.id");
- + findPreference(KEY_BUILD_NUMBER).setEnabled(true);
- + findPreference(KEY_KERNEL_VERSION).setSummary(getFormattedKernelVersion());
十:android键盘 打开俄罗斯语言和英文
(packages/inputmethods)
- diff --git a/LatinIME/java/Android.mk b/LatinIME/java/Android.mk
- index 7a4df92..b94dae0 100644
- --- a/LatinIME/java/Android.mk
- +++ b/LatinIME/java/Android.mk
- @@ - 35, 6 + 35, 8 @@ LOCAL_STATIC_JAVA_LIBRARIES :=
-
-
-
- +LOCAL_JAVA_LIBRARIES := mediatek-common
- +LOCAL_PRIVILEGED_MODULE := true
- # Do not compress dictionary files to mmap dict data runtime
- LOCAL_AAPT_FLAGS := - 0 .dict
-
- diff --git a/LatinIME/l b/LatinIME/l
- index a1f469e.. 22b4ff0 100644
- --- a/LatinIME/l
- +++ b/LatinIME/l
- @@ - 34, 6 + 34, 10 @@
- <uses-permission android:name= "android.permission.WRITE_EXTERNAL_STORAGE" />
- <uses-permission android:name= "android.permission.WRITE_SYNC_SETTINGS" />
- <uses-permission android:name= "android.permission.WRITE_USER_DICTIONARY" />
- + <uses-permission android:name= "android.permission.WRITE_SETTINGS" />
- + <uses-permission android:name= "android.permission.WRITE_SECURE_SETTINGS" />
- + <uses-permission android:name= "android.permission.WRITE_SETTINGS" />
- + <uses-permission android:name= "android.permission.WRITE_SECURE_SETTINGS" />
-
- <application android:label= "@string/english_ime_name"
- android:icon= "@drawable/ic_launcher_keyboard"
- @@ - 170, 5 + 174, 10 @@
- android:multiprocess= "false"
- android:label= "@string/dictionary_provider_name">
- </provider>
- + <receiver android:name= "LatinImeReceiver" android:enabled= "true">
- + <intent-filter>
- + <action android:name= "android.intent.action.BOOT_COMPLETED" />
- + </intent-filter>
- + </receiver>
- </application>
- </manifest>
- diff --git a/LatinIME/java/res/l b/LatinIME/java/res/l
- index 19742d4.. 0e3fea2 100644
- --- a/LatinIME/java/res/l
- +++ b/LatinIME/java/res/l
- @@ - 810, 14 + 810, 6 @@
- android:imeSubtypeMode= "keyboard"
- android:imeSubtypeExtraValue= "KeyboardLayoutSet=bengali,SupportTouchPositionCorrection,EmojiCapable"
- />
- - <!-- Burmese -->
- - <subtype android:icon= "@drawable/ic_ime_switcher_dark"
- - android:label= "@string/subtype_generic"
- - android:subtypeId= "0x00000003"
- - android:imeSubtypeLocale= "my_MM"
- - android:imeSubtypeMode= "keyboard"
- - android:imeSubtypeExtraValue= "KeyboardLayoutSet=burmese,SupportTouchPositionCorrection,EmojiCapable"
- - />
- <!-- Urdu -->
- <subtype android:icon= "@drawable/ic_ime_switcher_dark"
- android:label= "@string/subtype_generic"
- diff --git a/LatinIME/java/src/com/android/inputmethod/latin/LatinImeReceiver.java b/LatinIME/java/src/com/android/inputmethod/latin/LatinImeReceiver.java
- new file mode 100644
- 685ed7
- --- /dev/ null
- +++ b/LatinIME/java/src/com/android/inputmethod/latin/LatinImeReceiver.java
- @@ - 0, 0 + 1, 130 @@
- + package com.android.inputmethod.latin;
- + t.BroadcastReceiver;
- + t.Context;
- + t.Intent;
- + t.SharedPreferences;
- + import android.provider.Settings;
- + import android.util.Log;
- + import android.view.inputmethod.InputMethodInfo;
- + import android.view.inputmethod.InputMethodManager;
- + import android.view.inputmethod.InputMethodSubtype;
- + TextUtils;
- + import java.util.Locale;
- +
- + public class LatinImeReceiver extends BroadcastReceiver {
- + private static final String TAG = SimpleName();
- + @Override
- + public void onReceive(Context context, Intent intent) {
- + // Set the default input language at the system boot completed.
- + if (Intent.ACTION_BOOT_COMPLETED.Action())) {
- + SharedPreferences sp = SharedPreferences( "default_input_language_config",
- + Context.MODE_PRIVATE);
- + boolean hasSet = sp.getBoolean( "has_set", false);
- +
- + if (!hasSet) {
- + setDefaultSubtypes(context);
- + sp.edit().putBoolean( "has_set", true)mit();
- + }
- + }
- + }
- +
- + /**
- + * M: Set the default IME subtype.
- + */
- + private void setDefaultSubtypes(Context context) {
- + final String serviceName = "com.android.inputmethod.latin/.LatinIME";
- + final String currentPackageName = "com.android.inputmethod.latin";
- + final String enable = ContentResolver(),
- + Settings.Secure.ENABLED_INPUT_METHODS);
- + final InputMethodManager imm = (InputMethodManager) SystemService(
- + Context.INPUT_METHOD_SERVICE);
- + final StringBuilder builder = new StringBuilder();
- +
- + // Get sub type hash code
- + for (InputMethodInfo info : InputMethodList()) {
- + if (currentPackageName.PackageName())) {
- + for ( int i = 0; i < SubtypeCount(); i++) {
- + final InputMethodSubtype subtype = SubtypeAt(i);
- + final String locale = Locale().toString();
- + if (isDefaultLocale(locale)) {
- + Log.i(TAG, "default enabled subtype locale = " + locale);
- + builder.append( ';');
- + builder.append(subtype.hashCode());
- + }
- + }
- +
- + break;
- + }
- + }
- +
- + // Insert the sub type
- + if (builder.length() > 0 && !TextUtils.isEmpty(enable)) {
- + final String subtype = String();
- + builder.setLength( 0);
- +
- + final int index = enable.indexOf(serviceName) + serviceName.length();
- + if (enable.length() > index) {
- + builder.append(enable.substring( 0, index));
- + builder.append(subtype);
- + builder.append(enable.substring(index));
- + } else if (enable.length() == index) {
- + builder.append(enable);
- + builder.append(subtype);
- + } else {
- + return;
- + }
- + } else {
- + Log.w(TAG, "Build Latin IME subtype failed: " + " builder length = " + builder.length()
- + + "; enable isEmpty :" + TextUtils.isEmpty(enable));
- + return;
- + }
- +
- + // Commit the result
- + android.provider.Settings.Secure.ContentResolver(),
- + android.provider.Settings.Secure.ENABLED_INPUT_METHODS, String());
- +
- +
- + String lastInputMethodId = String(context
- + .getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD);
- + Log.w(TAG, "DEFAULT_INPUT_METHOD = " + lastInputMethodId);
- + if(lastInputMethodId.equals(serviceName)) {
- + Log.w(TAG, "DEFAULT_INPUT_METHOD = com.android.inputmethod.latin/.LatinIME" );
- + for (InputMethodInfo info : InputMethodList()) {
- + if (currentPackageName.PackageName())) {
- + for ( int i = 0; i < SubtypeCount(); i++) {
- + final InputMethodSubtype subtype = SubtypeAt(i);
- + String country = Default().toString();
- +
- + Locale())) {
- + Log.w(TAG, "putString " + subtype.hashCode());
- + android.provider.Settings.Secure.ContentResolver(),
- + android.provider.Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE, subtype.hashCode());
- +
- + }
- + }
- +
- + break;
- + }
- + }
- +
- + }
- + }
- +
- + /**
- + * M: Check if the current locale is default or not.
- + */
- + private boolean isDefaultLocale (String locale) {
- //这里控制打开的
- + final String[] locales = { "ru", "en_US"};
- + for (String s : locales) {
- + if (s.equals(locale)) {
- + return true;
- + }
- + }
- +
- + return false;
- + }
- +}
十一: 在电话本里,电话匹配长度是7 位数字(从右向左,7位数字)
(frameworks/base/telephony/java/android/telephony/PhoneNumberUtils.java)
public static final int VANZO_FEATURE_DEFAULT_PHONENUMBER_MIN_MATCH = 7;
- if (sIsCtaSupport) {
- minMatchLen = MIN_MATCH_CTA;
- } else if (sPhoneNumberExt != null) {
- - minMatchLen = MinMatch();
- + minMatchLen = MIN_MATCH;
- }
-
- Rlog.d(LOG_TAG, "[compareLoosely] a: " + a + ", b: " + b + ", minMatchLen:" + minMatchLen);
- @@ - 905, 7 + 914, 12 @@ public class PhoneNumberUtils
- if (sIsCtaSupport) {
- minMatchLen = MIN_MATCH_CTA;
- } else if (sPhoneNumberExt != null) {
- - minMatchLen = MinMatch();
- + minMatchLen = MIN_MATCH;
- }
-
- String strStrippedReversed = internalGetStrippedReversed(np, minMatchLen);
- @@ - 1715, 7 + 1729, 12 @@ public class PhoneNumberUtils
- //
- // However, in order to loose match 650-555-1212 and 555-1212, we need to set the min match
- // to 7.
- - static final int MIN_MATCH = 7;
- + static final int MIN_MATCH = VANZO_FEATURE_DEFAULT_PHONENUMBER_MIN_MATCH;
- /// M: [mtk04070][111116][ALPS00093395]Add a constant integer. @{
- static final int MIN_MATCH_CTA = 11;
- /// @}
在不过gms的情况下,还要额外加上一段修改(packages/providers)
- diff --git a/ContactsProvider/src/com/android/providers/contacts/ContactsDatabaseHelper.java b/ContactsProvider/src/com/android/providers/contacts/ContactsDatabaseHelper.java
- index e1d3b77..b3300a4 100644
- --- a/ContactsProvider/src/com/android/providers/contacts/ContactsDatabaseHelper.java
- +++ b/ContactsProvider/src/com/android/providers/contacts/ContactsDatabaseHelper.java
- @@ - 5731, 33 + 5731, 12 @@ public class ContactsDatabaseHelper extends SQLiteOpenHelper {
- */
- public void buildFallbackPhoneLookupAndContactQuery(SQLiteQueryBuilder qb, String number) {
- final String minMatch = CallerIDMinMatch(number);
- - final StringBuilder sb = new StringBuilder();
- - // Append lookup tables.
- - sb.append(Tables.RAW_CONTACTS);
- - sb.append( " JOIN " + Views.CONTACTS + " as contacts_view"
- - + " ON (contacts_view._id = " + Tables.RAW_CONTACTS
- - + "." + RawContacts.CONTACT_ID + ")" +
- - " JOIN (SELECT " + PhoneLookupColumns.DATA_ID + "," +
- - PhoneLookupColumns.NORMALIZED_NUMBER + " FROM "+ Tables.PHONE_LOOKUP + " "
- - + "WHERE (" + Tables.PHONE_LOOKUP + "." + PhoneLookupColumns.MIN_MATCH + " = '");
- - sb.append(minMatch);
- - sb.append( "')) AS lookup " +
- - "ON lookup." + PhoneLookupColumns.DATA_ID + "=" + Tables.DATA + "." + Data._ID
- - + " JOIN " + Tables.DATA + " "
- - + "ON " + Tables.DATA + "." + Data.RAW_CONTACT_ID + "=" + Tables.RAW_CONTACTS + "."
- - + RawContacts._ID);
- -
- - /**
- - * M: append this table for some query(fix ALPS00532279) @{
- - */
- + StringBuilder sb = new StringBuilder();
- + appendPhoneLookupTables(sb, minMatch, true);
- appendPresenceAndStautsTable(sb);
- - /** @} */
- qb.String());
- -
- - sb.setLength( 0);
- - sb.append( "PHONE_NUMBERS_EQUAL(" + Tables.DATA + "." + Phone.NUMBER + ", ");
- - DatabaseUtils.appendEscapedSQLString(sb, number);
- - sb.append(mUseStrictPhoneNumberComparison ? ", 1)" : ", 0)");
- + sb = new StringBuilder();
- + appendPhoneLookupSelection(sb, null, null);
- qb.String());
- }
- /** @} */
十二:去除工厂模式中的 光感/距感测试项 ( vanzo )
- diff --git a/packages/FactoryMode/src/com/mediatek/factorymode/FactoryMode.java b/packages/FactoryMode/src/com/mediatek/factorymode/FactoryMode.java
- index 6100b0e.. 449b5fa 100755
- --- a/packages/FactoryMode/src/com/mediatek/factorymode/FactoryMode.java
- +++ b/packages/FactoryMode/src/com/mediatek/factorymode/FactoryMode.java
- @@ - 56, 7 + 56, 7 @@ public class FactoryMode extends Activity implements OnItemClickListener {
-
- private TextView mMotherBoardResult;
-
- - public static boolean mHavePsensor = true;
- + public static boolean mHavePsensor = false;
-
- public static boolean mHaveMsensor = true;
十三: 相机零延迟开关/ 避免闪烁没有默认60HZ
零延迟:(vendor/mediatek/proprietary/packages/apps/Camera/res/l)
- <resources xmlns:xliff= "urn:oasis:names:tc:xliff:document:1.2">
- <string name= "pref_camera_zsd_default" translatable= "false">on</string>
- </resources>
避免闪烁没有默认60HZ:(vendor)
-
diff --git a/mediatek/proprietary/packages/apps/Camera/res/l b/mediatek/proprietary/packages/apps/Camera/res/l
-
index 607f6a0..a01f714 100755
-
--- a/mediatek/proprietary/packages/apps/Camera/res/l
-
+++ b/mediatek/proprietary/packages/apps/Camera/res/l
-
@@ -684,6 +684,7 @@ add 16M 16_9
-
</string-array>
-
<!-- Default antibanding setting.-->
-
<string-array name="pref_camera_antibanding_default_array" translatable="false">
-
+ <item>60hz</item>
-
<item>auto</item>
-
<item>off</item>
-
<item>50hz</item>
十四:WIFI默认关闭 ( packages/apps/Launcher3 )
- diff --git l l
- index df22272.. 8929289 100755
- --- l
- +++ l
- @@ - 70, 6 + 70, 8 @@
- <uses-permission android:name= "com.android.launcher3.permission.RECEIVE_FIRST_LOAD_BROADCAST" />
- <!-- M: hide apps activity requires this permission to get package size. -->
- <uses-permission android:name= "android.permission.GET_PACKAGE_SIZE"/>
- + <uses-permission android:name= "android.permission.CHANGE_WIFI_STATE" />
- + <uses-permission android:name= "android.permission.ACCESS_NETWORK_STATE" />
- <!-- M: ALSP02141215, android security patch. -->
- <uses-permission android:name= "android.permission.GET_TASKS" />
- <!-- M: ALSP02241595, add MANAGE_USERS permission. -->
- diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
- index 9366659.. 7c30d9d 100644
- --- a/src/com/android/launcher3/Launcher.java
- +++ b/src/com/android/launcher3/Launcher.java
- @@ - 146, 6 + 146, 9 @@ import android.hardware.SensorEvent;
- import android.hardware.SensorEventListener;
- import android.hardware.SensorManager;
- import com.android.featureoption.FeatureOption;
- + import android.NetworkInfo;
- + import android.wifi.WifiManager;
- + import android.ConnectivityManager;
- // End of Vanzo:hanshengpeng
-
- /**
- @@ -5163,6 +5166,18 @@ public class Launcher extends Activity
- editor.apply();
- }
-
- + private void closeWifiGps() {
- + // Intent sh = new Intent("com.android.settings.location.CLOSE");
- + //sendBroadcast(sh);
- + final WifiManager wifiManager = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
- + ConnectivityManager con = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
- + NetworkInfo netWork = NetworkInfo(ConnectivityManager.TYPE_WIFI);
- + if (wifiManager == null || netWork.isConnected()) {
- + return;
- + }
- + wifiManager.setWifiEnabled(false);
- + }
- +
- @Thunk void showFirstRunClings() {
- // The two first run cling paths are mutually exclusive, if the launcher is preinstalled
- // on the device, then we always show the first run cling experience (or if there is no
- @@ -5175,6 +5190,7 @@ public class Launcher extends Activity
- } else {
- launcherClings.showLongPressCling(true);
- }
- + closeWifiGps();
- }
- }
十五:壁纸不滑动(packages/apps/Launcher3)
- diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
- index e299302.. 5ac7b2b 100755
- --- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
- +++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
- @@ - 1059, 11 + 1059, 15 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
-
- if (partner == null || !partner.hideDefaultWallpaper()) {
- // Add an entry for the default wallpaper (stored in system resources)
- + /* Vanzo:yujianpeng on: Fri, 01 Apr 2016 15:39:35 +0800
- + * TODO: replace this line with your comment
- WallpaperTileInfo defaultWallpaperInfo = Utilities.ATLEAST_KITKAT
- ? getDefaultWallpaper() : getPreKKDefaultWallpaperInfo();
- if (defaultWallpaperInfo != null) {
- bundled.add(0, defaultWallpaperInfo);
- }
- + */
- + // End of Vanzo:yujianpeng
- }
- return bundled;
- }
十六:插入SD卡时默认为SD卡( packages/apps/Settings)
- diff --git l l
- index c8b252a..bed2c41 100644
- --- l
- +++ l
- @@ - 3173, 6 + 3173, 12 @@ add fp control
- </intent-filter>
- </receiver>
- <!-- End of Vanzo:fenghaitao -->
- -
- + <receiver android:name= ".UsbBroadCastReceiver">
- + <intent-filter android:priority= "1000">
- + <action android:name= "android.intent.action.MEDIA_MOUNTED"/>
- + <action android:name= "android.intent.action.MEDIA_EJECT" />
- + <data android:scheme= "file"/>
- + </intent-filter>
- + </receiver>
- </application>
- </manifest>
- diff --git a/src/com/android/settings/UsbBroadCastReceiver.java b/src/com/android/settings/UsbBroadCastReceiver.java
- new file mode 100644
- index 0000000..b578167
- --- /dev/ null
- +++ b/src/com/android/settings/UsbBroadCastReceiver.java
- @@ - 0, 0 + 1, 26 @@
- + package com.android.settings;
- +
- + t.BroadcastReceiver;
- + t.Context;
- + t.Intent;
- + import android.provider.Settings;
- + import android.util.Log;
- + import android.os.storage.IMountService;
- + diatek.storage.StorageManagerEx;
- +
- + public class UsbBroadCastReceiver extends BroadcastReceiver {
- + String TAG = "UsbBroadCastReceiver";
- + String ExternalStoragePath = ExternalStoragePath();
- +
- +
- + public void onReceive(Context context, Intent intent) {
- +
- + Log.i(TAG, "receive change request");
- + if (Intent.ACTION_MEDIA_MOUNTED.Action())) {
- + Log.d( "yjp", "intent : ACTION_MEDIA_MOUNTED");
- + Log.d( "yjp", "ExternalStoragePath " + ExternalStoragePath + " getInternalStoragePath : " + InternalStoragePath());
- + StorageManagerEx.setDefaultPath(ExternalStoragePath);
- + }
- + }
- +
- +}
十七: 邮箱默认签名,默认西班牙语下: 英语和其他语言下:Sent from (packages/apps/Email)
- diff --git a/UnifiedEmail/src/com/android/mail/compose/ComposeActivity.java b/UnifiedEmail/src/com/android/mail/compose/ComposeActivity.java
- 8bdab6 100755
- --- a/UnifiedEmail/src/com/android/mail/compose/ComposeActivity.java
- +++ b/UnifiedEmail/src/com/android/mail/compose/ComposeActivity.java
- @@ - 78, 6 + 78, 8 @@ import android.widget.ScrollView;
- import android.widget.MultiAutoCompleteTextView;
- import android.widget.TextView;
- import android.widget.Toast;
- + import android.preference.EditTextPreference;
- + import java.util.Locale;
-
- import com.androidmon.Rfc822Validator;
- import acts.DataUsageStatUpdater;
- @@ - 1116, 6 + 1118, 15 @@ public class ComposeActivity extends ActionBarActivity
- DataCollectUtils. clearRecordedList();
- }
- /** @} */
- + if(mSignature.equals( "Enviado desde mi smartphone LOGIC")){
- + Text().toString().contains( "Enviado desde mi smartphone LOGIC")){
- + Default().getLanguage().equals( "es")) {
- + mBodyView.Text().toString());
- + } else {
- + mBodyView.Text().toString());
- + }
- + }
- + }
- }
-
- @Override
- @@ - 1890, 6 + 1901, 17 @@ public class ComposeActivity extends ActionBarActivity
- message. bodyHtml. length());
- }
- }
- + if(mSignature.equals( "Enviado desde mi smartphone LOGIC") || mSignature.equals( "Sent from my LOGIC smartphone.")){
- + if(body.equals( "Enviado desde mi smartphone LOGIC") || body.equals( "Sent from my LOGIC smartphone.") ){
- + Default().getLanguage().equals( "es")){
- + mBodyView.setText( "Enviado desde mi smartphone LOGIC");
- + } else {
- + mBodyView.setText( "Sent from my LOGIC smartphone.");
- + }
- + }
- + } else{
- + mBodyView.setText(body);
- + }
- new HtmlToSpannedTask().execute(body);
- } else {
- final String body = message.bodyText;
- @@ - 4229, 6 + 4251, 15 @@ public class ComposeActivity extends ActionBarActivity
- mSignature = newSignature;
- if (!TextUtils.isEmpty(mSignature)) {
- // Appending a signature does not count as changing text.
- + if(mSignature.equals( "Enviado desde mi smartphone LOGIC") || mSignature.equals( "Sent from my LOGIC smartphone.")){
- + Default().getLanguage().equals( "es")){
- + mSignature = "Enviado desde mi smartphone LOGIC";
- + } else{
- + mSignature = "Sent from my LOGIC smartphone.";
- + }
- + } else {
- + mSignature = newSignature;
- + }
- veTextChangedListener( this);
- mBodyView.append(convertToPrintableSignature(mSignature));
- mBodyView.addTextChangedListener( this);
- diff --git a/emailcommon/src/com/android/emailcommon/provider/Account.java b/emailcommon/src/com/android/emailcommon/provider/Account.java
- 7a184 100755
- --- a/emailcommon/src/com/android/emailcommon/provider/Account.java
- +++ b/emailcommon/src/com/android/emailcommon/provider/Account.java
- @@ - 44, 6 + 44, 7 @@ import org.json.JSONException;
- import org.json.JSONObject;
-
- import java.util.ArrayList;
- + import java.util.Locale;
-
- public final class Account extends EmailContent implements Parcelable {
- public static final String TABLE_NAME = "Account";
- @@ - 144, 6 + 145, 7 @@ public final class Account extends EmailContent implements Parcelable {
- public String mProtocolVersion;
- public String mSecuritySyncKey;
- public String mSignature;
- + public String CUSTOM_SIGNATURE = "Sent from my LOGIC smartphone.";
- public long mPolicyKey;
- public long mPingDuration;
-
- @@ - 211, 6 + 213, 13 @@ public final class Account extends EmailContent implements Parcelable {
- mSyncInterval = - 1;
- mSyncLookback = - 1;
- mFlags = 0;
- + Default().getLanguage().equals( "en")){
- + mSignature = "Sent from my LOGIC smartphone.";
- + } else Default().getLanguage().equals( "es")){
- + mSignature = "Enviado desde mi smartphone LOGIC";
- + } else{
- + mSignature = CUSTOM_SIGNATURE;
- + }
- }
-
- public static Account restoreAccountWithId(Context context, long id) {
- @@ - 285, 7 + 294, 14 @@ public final class Account extends EmailContent implements Parcelable {
- mRingtoneUri = String(CONTENT_RINGTONE_URI_COLUMN);
- mProtocolVersion = String(CONTENT_PROTOCOL_VERSION_COLUMN);
- mSecuritySyncKey = String(CONTENT_SECURITY_SYNC_KEY_COLUMN);
- - mSignature = String(CONTENT_SIGNATURE_COLUMN);
- + //mSignature = String(CONTENT_SIGNATURE_COLUMN);
- + Default().getLanguage().equals( "en")){
- + CUSTOM_SIGNATURE = "Sent from my LOGIC smartphone.";
- + } else Default().getLanguage().equals( "es")){
- + CUSTOM_SIGNATURE = "Enviado desde mi smartphone LOGIC";
- + } else{
- + mSignature = CUSTOM_SIGNATURE;
- + }
- mPolicyKey = Long(CONTENT_POLICY_KEY_COLUMN);
- mPingDuration = Long(CONTENT_PING_DURATION_COLUMN);
- }
- @@ - 957, 6 + 973, 13 @@ public final class Account extends EmailContent implements Parcelable {
- mProtocolVersion = in.readString();
- /* mNewMessageCount = */ in.readInt();
- mSecuritySyncKey = in.readString();
- + Default().getLanguage().equals( "en")){
- + CUSTOM_SIGNATURE = "Sent from my LOGIC smartphone.";
- + } else Default().getLanguage().equals( "es")){
- + CUSTOM_SIGNATURE = "Enviado desde mi smartphone LOGIC";
- + } else{
- + mSignature = CUSTOM_SIGNATURE;
- + }
- mSignature = in.readString();
- mPolicyKey = in.readLong();
-
- diff --git a/src/com/android/email/activity/setup/AccountFinalizeFragment.java b/src/com/android/email/activity/setup/AccountFinalizeFragment.java
- index f2b9cde..bdfecf9 100755
- --- a/src/com/android/email/activity/setup/AccountFinalizeFragment.java
- +++ b/src/com/android/email/activity/setup/AccountFinalizeFragment.java
- @@ - 127, 13 + 127, 6 @@ public class AccountFinalizeFragment extends Fragment {
- public Boolean loadInBackground() {
- // Update the account in the database
- final ContentValues cv = new ContentValues();
- - /* Vanzo:tanglei on: Mon, 09 Feb 2015 20:34:31 +0800
- - * email default signature
- - */
- - if (!FeatureOption.VANZO_FEATURE_EMAIL_DEFAULT_SIGNATURE.equals( "")) {
- - cv.put(EmailContent.AccountColumns.SIGNATURE, FeatureOption.VANZO_FEATURE_EMAIL_DEFAULT_SIGNATURE);
- - }
- - // End of Vanzo:tanglei
- cv.put(EmailContent.AccountColumns.DISPLAY_NAME, DisplayName());
- cv.put(EmailContent.AccountColumns.SENDER_NAME, SenderName());
- mAccount.update(getContext(), cv);
十八: 在短信设置里:有(100K, 200K, 300K, 600K, 1M)选项可以选择
短信默认最大160个字节,超过部分作为第二个短信,默认编辑方式:7 Bits
(vendor )
- diff --git a/mediatek/proprietary/packages/apps/Mms/res/values/l b/mediatek/proprietary/packages/apps/Mms/res/values/l
- f0535 100755
- --- a/mediatek/proprietary/packages/apps/Mms/res/values/l
- +++ b/mediatek/proprietary/packages/apps/Mms/res/values/l
- @@ - 44, 11 + 44, 15 @@
- <item> 100K</item>
- <item> 200K</item>
- <item> 300K</item>
- + <item> 600K</item>
- + <item> 1MB</item>
- </string-array>
- <string-array name= "pref_mms_size_limit_values" translatable= "false">
- <item> 100</item>
- <item> 200</item>
- <item> 300</item>
- + <item> 600</item>
- + <item> 1024</item>
- </string-array>
- <string-array name= "pref_key_mms_priority_choices">
- <item>High</item>
- diff --git a/mediatek/proprietary/packages/apps/Mms/res/xml/l b/mediatek/proprietary/packages/apps/Mms/res/xml/l
- index 3e87525.. 76aa9e6 100644
- --- a/mediatek/proprietary/packages/apps/Mms/res/xml/l
- +++ b/mediatek/proprietary/packages/apps/Mms/res/xml/l
- @@ - 26, 7 + 26, 7 @@
- <bool name= "enabledMMS"> true</bool>
-
- <!-- Maximum message size in bytes for a MMS message -->
- - < int name= "maxMessageSize"> 307200</ int>
- + < int name= "maxMessageSize"> 1048576</ int>
-
- <!-- Maximum height for an attached image -->
- < int name= "maxImageHeight"> 480</ int>
- diff --git a/mediatek/proprietary/packages/apps/Mms/res/l b/mediatek/proprietary/packages/apps/Mms/res/l
- index 70a9ebe..d47b8e4 100755
- --- a/mediatek/proprietary/packages/apps/Mms/res/l
- +++ b/mediatek/proprietary/packages/apps/Mms/res/l
- @@ - 76, 7 + 76, 7 @@
- <ListPreference
- android:key= "pref_key_sms_input_mode"
- android:title= "@string/sms_input_mode_title"
- - android:defaultValue= "Automatic"
- + android:defaultValue= "GSM alphabet"
- android:entries= "@array/pref_sms_input_mode_choice"
- android:entryValues= "@array/pref_sms_input_mode_values"
- android:dialogTitle= "@string/sms_input_mode_dialog_title"
- diff --git a/mediatek/proprietary/packages/apps/Mms/res/l b/mediatek/proprietary/packages/apps/Mms/res/l
- index 0017a83.. 5c8a7b9 100644
- --- a/mediatek/proprietary/packages/apps/Mms/res/l
- +++ b/mediatek/proprietary/packages/apps/Mms/res/l
- @@ - 76, 7 + 76, 7 @@
- <ListPreference
- android:key= "pref_key_sms_input_mode"
- android:title= "@string/sms_input_mode_title"
- - android:defaultValue= "Automatic"
- + android:defaultValue= "GSM alphabet"
- android:entries= "@array/pref_sms_input_mode_choice"
- android:entryValues= "@array/pref_sms_input_mode_values"
- android:dialogTitle= "@string/sms_input_mode_dialog_title"
- diff --git a/mediatek/proprietary/packages/apps/Mms/res/l b/mediatek/proprietary/packages/apps/Mms/res/l
- index c083bc3.. 5c84396 100755
- --- a/mediatek/proprietary/packages/apps/Mms/res/l
- +++ b/mediatek/proprietary/packages/apps/Mms/res/l
- @@ - 30, 7 + 30, 7 @@
- android:entryValues= "@array/pref_sms_save_location_values"
- android:dialogTitle= "@string/sms_save_location" android:summary= "@string/sms_save_location" />
- <ListPreference android:key= "pref_key_sms_input_mode"
- - android:title= "@string/sms_input_mode_title" android:defaultValue= "Automatic"
- + android:title= "@string/sms_input_mode_title" android:defaultValue= "GSM alphabet"
- android:entries= "@array/pref_sms_input_mode_choice"
- android:entryValues= "@array/pref_sms_input_mode_values"
- android:dialogTitle= "@string/sms_input_mode_dialog_title"
- diff --git a/mediatek/proprietary/packages/apps/Mms/res/l b/mediatek/proprietary/packages/apps/Mms/res/l
- index 730ff0f..d479da8 100755
- --- a/mediatek/proprietary/packages/apps/Mms/res/l
- +++ b/mediatek/proprietary/packages/apps/Mms/res/l
- @@ - 30, 7 + 30, 7 @@
- android:entryValues= "@array/pref_sms_save_location_values"
- android:dialogTitle= "@string/sms_save_location" android:summary= "@string/sms_save_location" />
- <ListPreference android:key= "pref_key_sms_input_mode"
- - android:title= "@string/sms_input_mode_title" android:defaultValue= "Automatic"
- + android:title= "@string/sms_input_mode_title" android:defaultValue= "GSM alphabet"
- android:entries= "@array/pref_sms_input_mode_choice"
- android:entryValues= "@array/pref_sms_input_mode_values"
- android:dialogTitle= "@string/sms_input_mode_dialog_title"
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/MmsConfig.java b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/MmsConfig.java
- index 5142ff5..fc7b4de 100755
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/MmsConfig.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/MmsConfig.java
- @@ - 95, 7 + 95, 7 @@ public class MmsConfig {
- */
- private static boolean mTransIdEnabled = false;
- private static int mMmsEnabled = 1; // default to true
- - private static int mMaxMessageSize = 300 * 1024; // default to 300k max size
- + private static int mMaxMessageSize = 1 * 1024 * 1024; // default to 300k max size
- private static String mUserAgent = DEFAULT_USER_AGENT;
- private static String mUaProfTagName = DEFAULT_HTTP_KEY_X_WAP_PROFILE;
- private static String mUaProfUrl = null;
- @@ - 562, 10 + 562, 9 @@ public class MmsConfig {
- }
-
- /// APARTODO
- - // public static boolean getSIMSmsAtSettingEnabled() {
- - // return mMmsFeatureManagerPlugin.isFeatureEnabled(
- - // IMmsFeatureManagerExt.SHOW_SIM_SMS_ENTRY_IN_SETTINGS);
- - // }
- + public static boolean getSIMSmsAtSettingEnabled() {
- + return true;
- + }
-
- public static int getPluginMenuIDBase() {
- return 0x100;
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/ComposeMessageActivity.java b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/ComposeMessageActivity.java
- index 872e3b3.. 64c0399 100644
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/ComposeMessageActivity.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/ComposeMessageActivity.java
- @@ - 1049, 8 + 1049, 11 @@ public class ComposeMessageActivity extends Activity
- int encodingType = SmsMessage.ENCODING_UNKNOWN;
-
- encodingType = SmsEncodingType(encodingType, ComposeMessageActivity. this);
- -
- - params = SmsMessage.calculateLength(text, false, encodingType);
- + if (encodingType == 1) {
- + params = SmsMessage.calculateLength(text, true, encodingType);
- + } else {
- + params = SmsMessage.calculateLength(text, false, encodingType);
- + }
- /* SmsMessage.calculateLength returns an int[4] with:
- * int[0] being the number of SMS's required,
- * int[1] the number of code units used,
- diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/MessageUtils.java b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/MessageUtils.java
- index 91f4ed0..15882f3 100644
- --- a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/MessageUtils.java
- +++ b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/MessageUtils.java
- @@ -3101,6 +3101,10 @@ public class MessageUtils {
- mMmsSizeLimit = 100;
- } else if (mSizeLimitTemp != null && 0 == mSizeLimitTemppareTo("200")) {
- mMmsSizeLimit = 200;
- + }else if (mSizeLimitTemp != null && 0 == mSizeLimitTemppareTo("600")) {
- + mMmsSizeLimit = 600;
- + } else if (mSizeLimitTemp != null && 0 == mSizeLimitTemppareTo("1024")) {
- + mMmsSizeLimit = 1024;
- } else {
- mMmsSizeLimit = 300;
- }
十九:更改时间格式 (frameworks)
- +++ b/base/
- @@ - 34813, 6 + 34813, 7 @@ format {
- method public static java.lang. CharSequence format(java.lang.CharSequence, java.util.Calendar);
- method public static java.lang. String getBestDateTimePattern(java.util.Locale, java.lang.String);
- method public DateFormat t.Context);
- + method public DateFormat t.Context, java.lang.String);
- method public static char[] t.Context);
- method public DateFormat t.Context);
- method public DateFormat t.Context);
- diff --git a/base/core/java/android/text/format/DateFormat.java b/base/core/java/android/text/format/DateFormat.java
- index 8d5555d.. 1555939 100755
- --- a/base/core/java/android/text/format/DateFormat.java
- +++ b/base/core/java/android/text/format/DateFormat.java
- @@ - 292, 7 + 292, 14 @@ public class DateFormat {
- * @return the { @DateFormat} object that properly formats the date.
- */
- public DateFormat getDateFormat(Context context) {
- + /* Vanzo:yujianpeng on: Sat, 02 Apr 2016 11:22:51 +0800
- + * add choose date format
- DateFormat.SHORT);
- + */
- + String value = ContentResolver(),
- + Settings.System.DATE_FORMAT);
- + return getDateFormatForSetting(context, value);
- + // End of Vanzo:yujianpeng
- }
-
- /**
- @@ -325,9 +332,16 @@ public class DateFormat {
- * order returned here.
- */
- public static char[] getDateFormatOrder(Context context) {
- + /* Vanzo:yujianpeng on: Sat, 02 Apr 2016 11:27:55 +0800
- + * add choose date format
- DateFormatOrder(getDateFormatString());
- + */
- + DateFormatOrder(getDateFormatString(context));
- + // End of Vanzo:yujianpeng
- }
-
- + /* Vanzo:yujianpeng on: Sat, 02 Apr 2016 11:28:07 +0800
- + * add choose date format
- private static String getDateFormatString() {
- DateFormat df = DateFormat.SHORT);
- if (df instanceof SimpleDateFormat) {
- @@ -336,6 +350,13 @@ public class DateFormat {
-
- throw new AssertionError("!(df instanceof SimpleDateFormat)");
- }
- + */
- + private static String getDateFormatString(Context context) {
- + String value = ContentResolver(),
- + Settings.System.DATE_FORMAT);
- + return getDateFormatStringForSetting(context, value);
- + }
- + // End of Vanzo:yujianpeng
-
- /**
- * Given a format string and a time in milliseconds since Jan 1, 1970 GMT, returns a
- @@ -636,4 +657,116 @@ public class DateFormat {
- private static String zeroPad(int inValue, int inMinDigits) {
- return String.Default(), "%0" + inMinDigits + "d", inValue);
- }
- +/* Vanzo:yujianpeng on: Sat, 02 Apr 2016 11:13:06 +0800
- + * TODO: replace this line with your comment
- + */
- +
- + public DateFormat getDateFormatForSetting(Context context, String value) {
- + String format = getDateFormatStringForSetting(context, value);
- + return SimpleDateFormat(format);
- + }
- +
- + private static String getDateFormatStringForSetting(Context context, String value) {
- + String result = null;
- + if (value != null) {
- + /// M: add week and arrange month day year according to resource's date format defination for settings. CR: ALPS00049014 @{
- + String dayValue = value.indexOf( "dd") < 0 ? "d" : "dd";
- + String monthValue = value.indexOf( "MMMM") < 0 ? (value.indexOf( "MMM") < 0 ? (value.indexOf( "MM") < 0 ? "M" : "MM") : "MMM") : "MMMM";
- + String yearValue = value.indexOf( "yyyy") < 0 ? "y" : "yyyy";
- + String weekValue = value.indexOf( "EEEE") < 0 ? "E" : "EEEE";
- +
- + int day = value.indexOf(dayValue);
- + int month = value.indexOf(monthValue);
- + int year = value.indexOf(yearValue);
- + int week = value.indexOf(weekValue);
- +
- + if (week >= 0 && month >= 0 && day >= 0 && year >= 0) {
- + String template = null;
- + if (week < day) {
- + if (year < month && year < day) {
- + if (month < day) {
- + template = diatek.internal.R.string.wday_year_month_day);
- + result = String.format(template, weekValue, yearValue, monthValue, dayValue);
- + } else {
- + template = diatek.internal.R.string.wday_year_day_month);
- + result = String.format(template, weekValue, yearValue, dayValue, monthValue);
- + }
- + } else if (month < day) {
- + if (day < year) {
- + template = diatek.internal.R.string.wday_month_day_year);
- + result = String.format(template, weekValue, monthValue, dayValue, yearValue);
- + } else {
- + template = diatek.internal.R.string.wday_month_year_day);
- + result = String.format(template, weekValue, monthValue, yearValue, dayValue);
- + }
- + } else {
- + if (month < year) {
- + template = diatek.internal.R.string.wday_day_month_year);
- + result = String.format(template, weekValue, dayValue, monthValue, yearValue);
- + } else {
- + template = diatek.internal.R.string.wday_day_year_month);
- + result = String.format(template, weekValue, dayValue, yearValue, monthValue);
- + }
- + }
- + } else {
- + if (year < month && year < day) {
- + if (month < day) {
- + template = diatek.internal.ar_month_day_wday);
- + result = String.format(template, yearValue, monthValue, dayValue, weekValue);
- + } else {
- + template = diatek.internal.ar_day_month_wday);
- + result = String.format(template, yearValue, dayValue, monthValue, weekValue);
- + }
- + } else if (month < day) {
- + if (day < year) {
- + template = diatek.internal.h_day_year_wday);
- + result = String.format(template, monthValue, dayValue, yearValue, weekValue);
- + } else {
- + template = diatek.internal.h_year_day_wday);
- + result = String.format(template, monthValue, yearValue, dayValue, weekValue);
- + }
- + } else {
- + if (month < year) {
- + template = diatek.internal.R.string.day_month_year_wday);
- + result = String.format(template, dayValue, monthValue, yearValue, weekValue);
- + } else {
- + template = diatek.internal.R.string.day_year_month_wday);
- + result = String.format(template, dayValue, yearValue, monthValue, weekValue);
- + }
- + }
- + }
- +
- + return result;
- + /// M: @}
- + } else if (month >= 0 && day >= 0 && year >= 0) {
- + String template = String(com.android.internal.R.string.numeric_date_template);
- + if (year < month && year < day) {
- + if (month < day) {
- + result = String.format(template, yearValue, monthValue, dayValue);
- + } else {
- + result = String.format(template, yearValue, dayValue, monthValue);
- + }
- + } else if (month < day) {
- + if (day < year) {
- + result = String.format(template, monthValue, dayValue, yearValue);
- + } else { // unlikely
- + result = String.format(template, monthValue, yearValue, dayValue);
- + }
- + } else { // date < month
- + if (month < year) {
- + result = String.format(template, dayValue, monthValue, yearValue);
- + } else { // unlikely
- + result = String.format(template, dayValue, yearValue, monthValue);
- + }
- + }
- +
- + return result;
- + }
- + }
- +
- + // The setting is not set; use the locale's default.
- + LocaleData d = (Resources().getConfiguration().locale);
- + return d.shortDateFormat4;
- + }
- + // End of Vanzo:yujianpeng
- }
- diff --git a/base/core/res/res/l b/base/core/res/res/l
- index a8e2b2b.. 80db6e4 100755
- --- a/base/core/res/res/l
- +++ b/base/core/res/res/l
- @@ - 1, 6 + 1, 7 @@
- <?xml version= "1.0" encoding= "UTF-8"?>
- <resources xmlns:android= ""
- xmlns:xliff= "urn:oasis:names:tc:xliff:document:1.2">
- + <string name= "numeric_date_template"> "%s/%s/%s"</string>
- <string name= "month_day_year">%B %-e, %Y</string>
- <string name= "time_of_day">%-l:%M:%S %p</string>
- <string name= "date_and_time">%b %-e, %Y, %-l:%M:%S %p</string>
- diff --git a/base/core/res/res/l b/base/core/res/res/l
- index e9faf09.. 50a869a 100644
- --- a/base/core/res/res/l
- +++ b/base/core/res/res/l
- @@ - 2325, 7 + 2325, 7 @@
- <java-symbol type= "string" name= "global_action_reboot" />
- <java-symbol type= "string" name= "reboot_confirm_question" />
- <java-symbol type= "string" name= "reboot_confirm" />
- -
- + <java-symbol type= "string" name= "numeric_date_template" />
- <!-- Vanzo:tanglei on: Wed, 21 Jan 2015 11: 47: 03 + 0800
- -->
- <!-- For Smart Wake -->
- diff --git a/base/packages/Keyguard/res/values/l b/base/packages/Keyguard/res/values/l
- new file mode 100755
- 688ae5
- --- /dev/ null
- +++ b/base/packages/Keyguard/res/values/l
- @@ - 0, 0 + 1, 4 @@
- +<?xml version= "1.0" encoding= "utf-8"?>
- +<resources xmlns:xliff= "urn:oasis:names:tc:xliff:document:1.2">
- + <string name= "default_date_format"><xliff:g id= "default_date_format">dd-MM-yyyy</xliff:g></string>
- +</resources>
- diff --git a/base/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java b/base/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
- index 86244b8.. 6c22fea 100644
- --- a/base/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
- +++ b/base/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
- @@ - 35, 6 + 35, 12 @@ import android.widget.GridLayout;
- import android.widget.LinearLayout;
- import android.widget.TextClock;
- import android.widget.TextView;
- + /* Vanzo:yujianpeng on: Fri, 01 Apr 2016 21:54:21 +0800
- + * add choose date format
- + */
- + import android.provider.Settings;
- + import libcore.icu.LocaleData;
- + // End of Vanzo:yujianpeng
-
- import com.android.internal.widget.LockPatternUtils;
-
- @@ - 165, 8 + 171, 17 @@ public class KeyguardStatusView extends GridLayout {
- }
-
- public void refreshTime() {
- + /* Vanzo:yujianpeng on: Fri, 01 Apr 2016 21:55:48 +0800
- + * add choose date format
- mDateView.setFormat24Hour(Patterns.dateView);
- mDateView.setFormat12Hour(Patterns.dateView);
- + */
- + String dateFormat = getCustomDateFormatString(mContext);
- + if (dateFormat == null || "".equals(dateFormat))
- + dateFormat = getResources().getString(R.string.default_date_format);
- + mDateView.setFormat24Hour(dateFormat);
- + mDateView.setFormat12Hour(dateFormat);
- + // End of Vanzo:yujianpeng
-
- if (bA1Support) {
- mClockView.setFormat12Hour(Patterns.clockView12);
- @@ - 286, 4 + 301, 118 @@ public class KeyguardStatusView extends GridLayout {
- cacheKey = key;
- }
- }
- +
- + /* Vanzo:hanshengpeng on: Fri, 24 Jul 2015 15:57:35 +0800
- + * add choose date format
- + * this part was ported from 82lp
- +*/
- + private String getCustomDateFormatString(Context context) {
- + String value = ContentResolver(),
- + Settings.System.DATE_FORMAT);
- + return getDateFormatStringForSetting(context, value);
- + }
- +
- + private String getDateFormatStringForSetting(Context context, String value) {
- + String result = null;
- + if (value != null) {
- + /// M: add week and arrange month day year according to resource's date format defination for settings. CR: ALPS00049014 @{
- + String dayValue = value.indexOf( "dd") < 0 ? "d" : "dd";
- + String monthValue = value.indexOf( "MMMM") < 0 ? (value.indexOf( "MMM") < 0 ? (value.indexOf( "MM") < 0 ? "M" : "MM") : "MMM") : "MMMM";
- + String yearValue = value.indexOf( "yyyy") < 0 ? "y" : "yyyy";
- + String weekValue = value.indexOf( "EEEE") < 0 ? "E" : "EEEE";
- +
- + int day = value.indexOf(dayValue);
- + int month = value.indexOf(monthValue);
- + int year = value.indexOf(yearValue);
- + int week = value.indexOf(weekValue);
- +
- + if (week >= 0 && month >= 0 && day >= 0 && year >= 0) {
- + String template = null;
- + if (week < day) {
- + if (year < month && year < day) {
- + if (month < day) {
- + template = diatek.internal.R.string.wday_year_month_day);
- + result = String.format(template, weekValue, yearValue, monthValue, dayValue);
- + } else {
- + template = diatek.internal.R.string.wday_year_day_month);
- + result = String.format(template, weekValue, yearValue, dayValue, monthValue);
- + }
- + } else if (month < day) {
- + if (day < year) {
- + template = diatek.internal.R.string.wday_month_day_year);
- + result = String.format(template, weekValue, monthValue, dayValue, yearValue);
- + } else {
- + template = diatek.internal.R.string.wday_month_year_day);
- + result = String.format(template, weekValue, monthValue, yearValue, dayValue);
- + }
- + } else {
- + if (month < year) {
- + template = diatek.internal.R.string.wday_day_month_year);
- + result = String.format(template, weekValue, dayValue, monthValue, yearValue);
- + } else {
- + template = diatek.internal.R.string.wday_day_year_month);
- + result = String.format(template, weekValue, dayValue, yearValue, monthValue);
- + }
- + }
- + } else {
- + if (year < month && year < day) {
- + if (month < day) {
- + template = diatek.internal.ar_month_day_wday);
- + result = String.format(template, yearValue, monthValue, dayValue, weekValue);
- + } else {
- + template = diatek.internal.ar_day_month_wday);
- + result = String.format(template, yearValue, dayValue, monthValue, weekValue);
- + }
- + } else if (month < day) {
- + if (day < year) {
- + template = diatek.internal.R.string.wday_month_day_year);
- + result = String.format(template, weekValue, monthValue, dayValue, yearValue);
- + } else {
- + template = diatek.internal.R.string.wday_month_year_day);
- + result = String.format(template, weekValue, monthValue, yearValue, dayValue);
- + }
- + } else {
- + if (month < year) {
- + template = diatek.internal.R.string.wday_day_month_year);
- + result = String.format(template, weekValue, dayValue, monthValue, yearValue);
- + } else {
- + template = diatek.internal.R.string.wday_day_year_month);
- + result = String.format(template, weekValue, dayValue, yearValue, monthValue);
- + }
- + }
- + }
- +
- + return result;
- + /// M: @}
- + } else if (month >= 0 && day >= 0 && year >= 0) {
- + String template = String(com.android.internal.R.string.numeric_date_template);
- + if (year < month && year < day) {
- + if (month < day) {
- + result = String.format(template, yearValue, monthValue, dayValue);
- + } else {
- + result = String.format(template, yearValue, dayValue, monthValue);
- + }
- + } else if (month < day) {
- + if (day < year) {
- + result = String.format(template, monthValue, dayValue, yearValue);
- + } else { // unlikely
- + result = String.format(template, monthValue, yearValue, dayValue);
- + }
- + } else { // date < month
- + if (month < year) {
- + result = String.format(template, dayValue, monthValue, yearValue);
- + } else { // unlikely
- + result = String.format(template, dayValue, yearValue, monthValue);
- + }
- + }
- +
- + return result;
- + }
- + }
- +
- + // The setting is not set; use the locale's default.
- + LocaleData d = (Resources().getConfiguration().locale);
- + return d.shortDateFormat4;
- + }
- + // End of Vanzo:hanshengpeng
- }
- diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
- index 186005c..d9eaabc 100644
- --- a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
- +++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
- @@ - 31, 6 + 31, 11 @@ SimpleDateFormat;
- import java.util.Date;
- import java.util.Locale;
-
- + /* Vanzo:songlixin on: Fri, 25 Apr 2014 15:50:51 +0800
- + */
- + import java.util.Calendar;
- + format.DateFormat;
- + // End of Vanzo:songlixin
- public class DateView extends TextView {
- private static final String TAG = "DateView";
-
- @@ - 98, 6 + 103, 8 @@ public class DateView extends TextView {
- }
-
- protected void updateClock() {
- + /* Vanzo:hanshengpeng on: Fri, 01 Nov 2013 14:56:08 +0800
- + * porting jb2->kk #53983
- if (mDateFormat == null) {
- final Locale l = Default();
- final String fmt = BestDateTimePattern(l, mDatePattern);
- @@ -111,5 +118,10 @@ public class DateView extends TextView {
- setText(text);
- mLastText = text;
- }
- + */
- + DateFormat shortDateFormat = DateFormat(mContext);
- + final Calendar now = Instance();
- + setText(shortDateFormat.Time()));
- + // End of Vanzo:hanshengpeng
- }
- }
(packages/apps/Settings)
- diff --git a/res/xml/date_l b/res/xml/date_l
- index 39d8743..f169374 100644
- --- a/res/xml/date_l
- +++ b/res/xml/date_l
- @@ - 53, 4 + 53, 12 @@
- android:title= "@string/date_time_24hour"
- />
-
- +<!-- Vanzo:zhangsu on: Sat, 25 Jul 2015 18: 17: 42 + 0800
- +add date format
- +-->
- + <ListPreference
- + android:key= "date_format"
- + android:title= "@string/date_time_date_format"
- + android:summary= "dd/MM/yyyy"/>
- +<!-- End of Vanzo: zhangsu -->
- </PreferenceScreen>
- diff --git a/src/com/android/settings/DateTimeSettings.java b/src/com/android/settings/DateTimeSettings.java
- index 474f026..fed3f03 100644
- --- a/src/com/android/settings/DateTimeSettings.java
- +++ b/src/com/android/settings/DateTimeSettings.java
- @@ - 81, 6 + 81, 12 @@ public class DateTimeSettings extends SettingsPreferenceFragment
- private SwitchPreference mAutoTimeZonePref;
- private Preference mTimeZone;
- private Preference mDatePref;
- + /* Vanzo:zhangsu on: Sat, 25 Jul 2015 18:18:33 +0800
- + * add date format
- + */
- + private static final String KEY_DATE_FORMAT = "date_format";
- + private ListPreference mDateFormat;
- + // End of Vanzo: zhangsu
-
- // /M: add for GPS time sync feature @{
- private static final int DIALOG_GPS_CONFIRM = 2;
- @@ - 151, 8 + 157, 50 @@ public class DateTimeSettings extends SettingsPreferenceFragment
- mTime24Pref = findPreference( "24 hour");
- mTimeZone = findPreference( "timezone");
- mDatePref = findPreference( "date");
- + /* Vanzo:zhangsu on: Sat, 25 Jul 2015 18:18:52 +0800
- + * add date format
- + if (isFirstRun) {
- + getPreferenceScreen().removePreference(mTime24Pref);
- + }
- + */
- + mDateFormat = (ListPreference) findPreference(KEY_DATE_FORMAT);
- + if (isFirstRun) {
- + getPreferenceScreen().removePreference(mTime24Pref);
- + getPreferenceScreen().removePreference(mDateFormat);
- + }
- + 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 wipe)
- + if (currentFormat == null) {
- + currentFormat = "";
- + }
- +
- + // Prevents duplicated values on date format selector.
- + mDummyDate.(Calendar.YEAR), mDummyDate.DECEMBER, 31, 13, 0, 0);
- +
- + for ( int i = 0; i < formattedDates.length; i++) {
- + /* Vanzo:yujianpeng on: Fri, 01 Apr 2016 21:48:16 +0800
- + * TODO: replace this line with your comment
- + String formatted TimeFormat(getActivity()).Time());
- + */
- + String formatted DateFormatForSetting(getActivity(), dateFormats[i]).Time());
- + // End of Vanzo:yujianpeng
- +
- + if (dateFormats[i].length() == 0) {
- + formattedDates[i] = getResources().getString(al_date_format, formatted);
- + } else {
- + formattedDates[i] = formatted;
- + }
- + }
- +
- + mDateFormat.setEntries(formattedDates);
- + mDateFormat.setEntryValues(R.array.date_format_values);
- + mDateFormat.setValue(currentFormat);
- +
- + // End of Vanzo: zhangsu
-
- - // /M: modify as MTK add GPS time Sync feature
- boolean autoEnabled = autoTimeEnabled || autoTimeGpsEnabled;
- mTimePref.setEnabled(!autoEnabled);
- mDatePref.setEnabled(!autoEnabled);
- @@ - 193, 18 + 241, 51 @@ public class DateTimeSettings extends SettingsPreferenceFragment
- // We use 13:00 so we can demonstrate the 12/24 hour options.
- mDummyDate. set( now. get( Calendar. YEAR), 11, 31, 13, 0, 0);
- Date dummyDate = Time();
- + /* Vanzo:zhangsu on: Sat, 25 Jul 2015 18:20:40 +0800
- + * add date format
- + */
- + DateFormat shortDateFormat = DateFormat(context);
- + mDateFormat.setSummary(shortDateFormat.format(dummyDate));
- +
- + // End of Vanzo: zhangsu
- mDatePref.LongDateFormat(context).Time()));
- mTimePref.TimeFormat(getActivity()).Time()));
- mTimeZone.TimeZone(), Time()));
- mTime24Pref.TimeFormat(getActivity()).format(dummyDate));
- }
-
- + /* Vanzo:zhangsu on: Sat, 25 Jul 2015 18:21:01 +0800
- + * add date format
- + */
- + private void updateDateFormatEntries() {
- + String [] dateFormats = getResources().getStringArray(R.array.date_format_values);
- + String [] formattedDates = new String[dateFormats.length];
- + for ( int i = 0; i < formattedDates.length; i++) {
- + // String formatted TimeFormat(getActivity()).Time());
- + String formatted DateFormatForSetting(getActivity(), dateFormats[i]).Time());
- + if (dateFormats[i].length() == 0) {
- + formattedDates[i] = getResources().getString(al_date_format, formatted);
- + } else {
- + formattedDates[i] = formatted;
- + }
- + }
- + mDateFormat.setEntries(formattedDates);
- + }
- +
- + // End of Vanzo: zhangsu
- +
- @Override
- public void onDateSet(DatePicker view, int year, int month, int day) {
- final Activity activity = getActivity();
- if (activity != null) {
- setDate(activity, year, month, day);
- updateTimeAndDateDisplay(activity);
- + /* Vanzo:zhangsu on: Sat, 25 Jul 2015 18:21:25 +0800
- + * add date format
- + */
- + updateDateFormatEntries();
- +
- + // End of Vanzo: zhangsu
- }
- }
-
- @@ - 250, 6 + 331, 17 @@ public class DateTimeSettings extends SettingsPreferenceFragment
- Settings. Global. putInt(
- getContentResolver(), Settings. Global. AUTO_TIME_ZONE, autoZoneEnabled ? 1 : 0);
- mTimeZone.setEnabled(!autoZoneEnabled);
- + /* Vanzo:zhangsu on: Sat, 25 Jul 2015 18:21:54 +0800
- + * add date format
- + */
- + } else if (key.equals(KEY_DATE_FORMAT)) {
- + String format = String(key,getResources().getString(R.string.default_date_format));
- + Settings.System.putString(getContentResolver(),Settings.System.DATE_FORMAT, format);
- + updateTimeAndDateDisplay(getActivity());
- + Intent timeChanged = new Intent(Intent.ACTION_TIME_CHANGED);
- + getActivity().sendBroadcast(timeChanged);
- +
- + // End of Vanzo: zhangsu
- }
- }
-
- @@ - 372, 6 + 464, 14 @@ public class DateTimeSettings extends SettingsPreferenceFragment
- is24Hour? HOURS_24 : HOURS_12);
- }
-
- + /* Vanzo:zhangsu on: Sat, 25 Jul 2015 18:22:19 +0800
- + * add date format
- + */
- + private String getDateFormat() {
- + return String(getContentResolver(),Settings.System.DATE_FORMAT);
- + }
- + // End of Vanzo: zhangsu
- +
- private boolean getAutoState(String name) {
- try {
- return Int(getContentResolver(), name) > 0;
二十:日历以星期一为开始 ( vendor )
- diff --git a/mediatek/proprietary/packages/apps/Calendar/res/xml/l b/mediatek/proprietary/packages/apps/Calendar/res/xml/l
- index a0d1577.. 0b17327 100644
- --- a/mediatek/proprietary/packages/apps/Calendar/res/xml/l
- +++ b/mediatek/proprietary/packages/apps/Calendar/res/xml/l
- @@ - 26, 7 + 26, 7 @@
- android:title= "@string/preferences_show_week_num_title" />
- <ListPreference
- android:key= "preferences_week_start_day"
- - android:defaultValue= "@string/preferences_week_start_day_default"
- + android:defaultValue= "2"
- android:title= "@string/preferences_week_start_day_title"
- android:entries= "@array/preferences_week_start_day_labels"
- android:entryValues= "@array/preferences_week_start_day_values"
二十一:硬件版本号 ( packages/apps/Settings )
- diff --git a/res/l b/res/l
- b38e54 100644
- --- a/res/l
- +++ b/res/l
- @@ - 901, 6 + 901, 7 @@
- <string name= "baseband_version" msgid= "1848990160763524801"> "Versión de banda base"</string>
- <string name= "kernel_version" msgid= "9192574954196167602"> "Versión de núcleo"</string>
- <string name= "build_number" msgid= "3075795840572241758"> "Número de compilación"</string>
- + <string name= "hardware_version" msgid= "3075795840572241758"> "Versión de Hardware"</string>
- <string name= "selinux_status" msgid= "6212165375172061672"> "Estado de SELinux"</string>
- <string name= "device_info_not_available" msgid= "8062521887156825182"> "No disponible"</string>
- <string name= "device_status_activity_title" msgid= "1411201799384697904"> "Estado"</string>
- diff --git a/res/l b/res/l
- index 94e27ea.. 8dce7fe 100644
- --- a/res/l
- +++ b/res/l
- @@ - 901, 6 + 901, 7 @@
- <string name= "baseband_version" msgid= "1848990160763524801"> "基带版本"</string>
- <string name= "kernel_version" msgid= "9192574954196167602"> "内核版本"</string>
- <string name= "build_number" msgid= "3075795840572241758"> "版本号"</string>
- + <string name= "hardware_version" msgid= "3075795840572241758"> "硬件版本号"</string>
- <string name= "selinux_status" msgid= "6212165375172061672"> "SELinux 状态"</string>
- <string name= "device_info_not_available" msgid= "8062521887156825182"> "不可用"</string>
- <string name= "device_status_activity_title" msgid= "1411201799384697904"> "状态信息"</string>
- diff --git a/res/l b/res/l
- index ad5ca8c..b57782d 100644
- --- a/res/l
- +++ b/res/l
- @@ - 2149, 6 + 2149, 7 @@
- <string name= "kernel_version">Kernel version</string>
- <!-- About phone screen, setting option name [CHAR LIMIT= 40] -->
- <string name= "build_number">Build number</string>
- + <string name= "hardware_version">Hardware version</string>
- <!-- About phone screen, setting option name [CHAR LIMIT= 40] -->
- <string name= "selinux_status">SELinux status</string>
-
- diff --git a/res/xml/device_l b/res/xml/device_l
- index b9ac889..de65506 100644
- --- a/res/xml/device_l
- +++ b/res/xml/device_l
- @@ - 153, 6 + 153, 12 @@ add brand name
- android:title= "@string/build_number"
- android:summary= "@string/device_info_default"/>
-
- + <!-- Detailed hardware version -->
- + <Preference android:key= "hardware_version"
- + style= "?android:preferenceInformationStyle"
- + android:title= "@string/hardware_version"
- + android:summary= "@string/device_info_default"/>
- +
- <!-- SELinux status information -->
- <Preference android:key= "selinux_status"
- style= "?android:preferenceInformationStyle"
- diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
- index fbb818b.. 7ff26f5 100644
- --- a/src/com/android/settings/DeviceInfoSettings.java
- +++ b/src/com/android/settings/DeviceInfoSettings.java
- @@ - 80, 6 + 80, 7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
- private static final String PROPERTY_SELINUX_STATUS = "ro.build.selinux";
- private static final String KEY_KERNEL_VERSION = "kernel_version";
- private static final String KEY_BUILD_NUMBER = "build_number";
- + private static final String KEY_HARDWARE_VERSION = "hardware_version";
- private static final String KEY_DEVICE_MODEL = "device_model";
- /* Vanzo:tanglei on: Fri, 24 Apr 2015 15:18:32 +0800
- * add brand name
- @@ -148,6 +149,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
- setValueSummary(KEY_EQUIPMENT_ID, PROPERTY_EQUIPMENT_ID);
- setStringSummary(KEY_DEVICE_MODEL, Build.MODEL);
- setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
- + setValueSummary(KEY_HARDWARE_VERSION, "ro.build.display.hardware.id");
- findPreference(KEY_BUILD_NUMBER).setEnabled(true);
- findPreference(KEY_KERNEL_VERSION).setSummary(getFormattedKernelVersion());
二十二:锁屏界面的PIN码和设置里面的那个锁SIM的PIN码 不能超过8位 (设置 > 安全 > 屏幕锁定方式 > PIN码 这个可以输多个是正确的,不用改) 锁屏(frameworks)
- diff --git a/base/packages/Keyguard/src/com/android/keyguard/PasswordTextView.java b/base/packages/Keyguard/src/com/android/keyguard/PasswordTextView.java
- index c41a2d2.. 3bb3d34 100644
- --- a/base/packages/Keyguard/src/com/android/keyguard/PasswordTextView.java
- +++ b/base/packages/Keyguard/src/com/android/keyguard/PasswordTextView.java
- @@ - 187, 29 + 187, 33 @@ public class PasswordTextView extends View {
-
-
- public void append(char c) {
- - int visibleChars = mTextChars.size();
- - String textbefore = mText;
- - mText = mText + c;
- - int newLength = mText.length();
- - CharState charState;
- - if (newLength > visibleChars) {
- - charState = obtainCharState(c);
- - mTextChars.add(charState);
- - } else {
- - charState = (newLength - 1);
- - charState.whichChar = c;
- - }
- - charState.startAppearAnimation();
- + if(mText.length()< 8){
- + int visibleChars = mTextChars.size();
- + String textbefore = mText;
- + mText = mText + c;
- + int newLength = mText.length();
- + CharState charState;
- + if (newLength > visibleChars) {
- + charState = obtainCharState(c);
- + mTextChars.add(charState);
- + } else {
- + charState = (newLength - 1);
- + charState.whichChar = c;
- + }
- + charState.startAppearAnimation();
-
- - // ensure that the previous element is being swapped
- - if (newLength > 1) {
- - CharState previousState = (newLength - 2);
- - if (previousState.isDotSwapPending) {
- - previousState.swapToDotWhenAppearFinished();
- + // ensure that the previous element is being swapped
- + if (newLength > 1) {
- + CharState previousState = (newLength - 2);
- + if (previousState.isDotSwapPending) {
- + previousState.swapToDotWhenAppearFinished();
- + }
- }
- + userActivity();
- + sendAccessibilityEventTypeViewTextChanged(textbefore, textbefore.length(), 0, 1);
- + } else{
- + return;
- }
- - userActivity();
- - sendAccessibilityEventTypeViewTextChanged(textbefore, textbefore.length(), 0, 1);
- }
-
- public void setUserActivityListener(UserActivityListener userActivitiListener) {
SIM的( packages/apps/Settings)
- diff --git a/src/com/android/settings/IccLockSettings.java b/src/com/android/settings/IccLockSettings.java
- index 2d8134d.. 293eed9 100644
- --- a/src/com/android/settings/IccLockSettings.java
- +++ b/src/com/android/settings/IccLockSettings.java
- @@ - 39, 6 + 39, 7 @@ import android.widget.TabHost;
- import android.widget.TabHost.OnTabChangeListener;
- import android.widget.TabHost.TabContentFactory;
- import android.widget.TabHost.TabSpec;
- + InputFilter;
- import android.widget.TabWidget;
- import android.widget.Toast;
-
- @@ - 190, 6 + 191, 8 @@ public class IccLockSettings extends InstrumentedPreferenceActivity
- addPreferencesFromResource (R.xml.sim_lock_settings);
-
- mPinDialog = (EditPinPreference) findPreference(PIN_DIALOG);
- + EditText().setFilters( new InputFilter[]{ new InputFilter.LengthFilter( 8)});
- mPinToggle = (SwitchPreference) findPreference(PIN_TOGGLE);
- if (savedInstanceState != null && ainsKey(DIALOG_STATE)) {
-