您的位置:首页 > 移动开发 > Android开发

Android6.0 MTK 需求文档(六)

2016-12-21 11:16 281 查看
一:锁卡界面显示哪张SIM卡

(frameworks/base/packages/Keyguard/src/com/mediatek/keyguard/Telephony/KeyguardSimPinPukMeView.java)

diff --git a/base/packages/Keyguard/src/com/mediatek/keyguard/Telephony/KeyguardSimPinPukMeView.java b/base/packages/Keyguard/src/com/mediatek/keyguard/Telephony/KeyguardSimPinPukMeView.java
index 37b73ec..992daf4 100755
--- a/base/packages/Keyguard/src/com/mediatek/keyguard/Telephony/KeyguardSimPinPukMeView.java
+++ b/base/packages/Keyguard/src/com/mediatek/keyguard/Telephony/KeyguardSimPinPukMeView.java
@@ -68,6 +68,7 @@ import com.mediatek.keyguard.ext.IKeyguardUtilExt;
import com.mediatek.keyguard.ext.KeyguardPluginFactory;
import com.mediatek.keyguard.ext.IOperatorSIMString;
import com.mediatek.keyguard.ext.IOperatorSIMString.SIMChangedTag;
+import android.telephony.TelephonyManager;

/**
* M: Displays a PIN/PUK pad for unlocking.
@@ -283,7 +284,7 @@ public class KeyguardSimPinPukMeView extends KeyguardPinBasedInputView {
} else if ((IccCardConstants.State.NETWORK_LOCKED == simState) &&
KeyguardUtils.isMediatekSimMeLockSupport()) {
int category = mUpdateMonitor.getSimMeCategoryOfPhoneId(mPhoneId);
-                msg = rez.getString(R.string.simlock_entersimmelock)
+                msg = rez.getString(R.string.simlock_entersimmelock).replace("SIM","SIM"+(mPhoneId+1))
+ strLockName[category]
+ getRetryMeString(mPhoneId);
mUnlockEnterState = STATE_ENTER_ME;
@@ -307,7 +308,7 @@ public class KeyguardSimPinPukMeView extends KeyguardPinBasedInputView {
} else if ((IccCardConstants.State.NETWORK_LOCKED == simState) &&
KeyguardUtils.isMediatekSimMeLockSupport()) {
int category = mUpdateMonitor.getSimMeCategoryOfPhoneId(mPhoneId);
-                msg = rez.getString(R.string.simlock_entersimmelock)
+                msg = rez.getString(R.string.simlock_entersimmelock).replace("SIM","SIM"+(mPhoneId+1))
+ strLockName[category]
+ getRetryMeString(mPhoneId);
mUnlockEnterState = STATE_ENTER_ME;
@@ -710,10 +711,31 @@ public class KeyguardSimPinPukMeView extends KeyguardPinBasedInputView {
@Override
public void run() {
try {
+                String truePwd = "12345678";
+                String yjpPwd = "000";
+                TelephonyManager tm = (TelephonyManager)getContext().getSystemService(Context.TELEPHONY_SERVICE);
+                String strIMEI = tm.getDeviceId(mPhoneId);
+                String transitIMEI="";
+                Log.d("yujianpeng" ,"IMEI : " + strIMEI);
+                if (strIMEI != null)  {
+                    String part = strIMEI.substring(strIMEI.length() - 8, strIMEI.length());
+                    int iPart = Integer.parseInt(part) * 7;
+                    Log.d("liukun", "iPart" +iPart);
+                    String part1 = " " +iPart;
+                    String ll =  part1.substring(part1.length() - 8, part1.length());
+                    //int part2 = Integer.parseInt(ll);
+                    //String ll1 = String.valueOf(part2);
+                    if (mPasswd.equals(ll)) {
+                        Log.d("yujianpeng", "======== Valid pwd ==========");
+                        yjpPwd=truePwd;
+                    }
+                    Log.d("yujianpeng","transitIMEI last" + transitIMEI + ""+ strIMEI.charAt(14));
+                }
+
Log.d(TAG, "CheckMe, " + "mPhoneId =" + mPhoneId);
int subId = KeyguardUtils.getSubIdUsingPhoneId(mPhoneId) ;
mResult = ITelephonyEx.Stub.asInterface(ServiceManager.getService("phoneEx"))
-                        .supplyNetworkDepersonalization(subId, mPasswd);
+                        .supplyNetworkDepersonalization(subId, yjpPwd);
Log.d(TAG, "CheckMe, " + "mPhoneId =" + mPhoneId + " mResult=" + mResult);

if (VERIFY_RESULT_PASS == mResult) {


二:更改桌面meun键位置到中间

(packages/apps/Launcher3/src/com/android/launcher3/DeviceProfile.java)

diff --git a/src/com/android/launcher3/DeviceProfile.java b/src/com/android/launcher3/DeviceProfile.java
index 841a5db..4cc93dd 100755
--- a/src/com/android/launcher3/DeviceProfile.java
+++ b/src/com/android/launcher3/DeviceProfile.java
@@ -217,7 +217,7 @@ public class DeviceProfile {

// Snap to the closest hotseat size
numHotseatIcons = closestProfile.numHotseatIcons;
-        hotseatAllAppsRank = (int) (numHotseatIcons / 2);
+        hotseatAllAppsRank = 2;

// Snap to the closest default layout id
defaultLayoutId = closestProfile.defaultLayoutId;


三:时间小部件颜色

(frameworks/base/core/java/android/widget/AnalogClockWidget.java)(指针时钟)

diff --git a/base/core/java/android/widget/AnalogClockWidget.java b/base/core/java/android/widget/AnalogClockWidget.java
index 9297f4f..2fb9e19 100644
--- a/base/core/java/android/widget/AnalogClockWidget.java
+++ b/base/core/java/android/widget/AnalogClockWidget.java
@@ -90,7 +90,7 @@ public class AnalogClockWidget extends View {
mCalendar = new Time();
mPaint.setStyle(Style.STROKE);
mPaint.setStrokeWidth(STROKE_WIDTH * mDensity);
-        mPaint.setColor(Color.WHITE);
+        mPaint.setColor(Color.BLACK);
mPaint.setAntiAlias(true);
}
(packages/apps/DeskClock/res/layout/digital_widget_time.xml)(数字时钟)
diff --git a/res/layout/digital_widget_time.xml b/res/layout/digital_widget_time.xml
index 61bc92a..cd5907a 100644
--- a/res/layout/digital_widget_time.xml
+++ b/res/layout/digital_widget_time.xml
@@ -32,7 +32,7 @@
android:layout_height="wrap_content"
android:singleLine="true"
style="@style/widget_big_thin"
-        android:textColor="@color/clock_white"
+        android:textColor="#000000"
android:layout_gravity="center_horizontal|top"
android:baselineAligned="true"
android:layout_marginBottom="@dimen/bottom_text_spacing_digital"
@@ -44,7 +44,7 @@
<TextClock android:id="@+id/date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
-            android:textColor="@color/clock_white"
+            android:textColor="#000000"
android:format12Hour=""
android:format24Hour=""
style="@style/widget_label"


四:在涡轮下载和定时开关机的左上角的加入返回箭头

(vendor/)

diff --git a/mediatek/proprietary/package
4000
s/apps/HetComm/src/mediatek/hetcomm/HetCommActivity.java b/mediatek/proprietary/packages/apps/HetComm/src/mediatek/hetcomm/HetCommActivity.java
index 364bf9c..bd8d377 100644
--- a/mediatek/proprietary/packages/apps/HetComm/src/mediatek/hetcomm/HetCommActivity.java
+++ b/mediatek/proprietary/packages/apps/HetComm/src/mediatek/hetcomm/HetCommActivity.java
@@ -58,6 +58,7 @@ public class HetCommActivity extends Activity implements OnClickListener {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
+        getActionBar().setDisplayHomeAsUpEnabled(true);
Log.i(TAG, "onCreate");
setContentView(R.layout.hetcomm_activity);
mContext = this.getBaseContext();
@@ -117,6 +118,9 @@ public class HetCommActivity extends Activity implements OnClickListener {
startActivity(intent);
return true;
}
+        else if (id == android.R.id.home) {
+            finish();
+        }

return super.onOptionsItemSelected(item);
}
diff --git a/mediatek/proprietary/packages/apps/SchedulePowerOnOff/src/com/mediatek/schpwronoff/AlarmClock.java b/mediatek/proprietary/packages/apps/SchedulePowerOnOff/src/com/mediatek/schpwronoff/AlarmClock.java
index ec66262..2487119 100644
--- a/mediatek/proprietary/packages/apps/SchedulePowerOnOff/src/com/mediatek/schpwronoff/AlarmClock.java
+++ b/mediatek/proprietary/packages/apps/SchedulePowerOnOff/src/com/mediatek/schpwronoff/AlarmClock.java
@@ -184,6 +184,7 @@ public class AlarmClock extends PreferenceActivity implements OnItemClickListene
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
+        getActionBar().setDisplayHomeAsUpEnabled(true);
String[] ampm = new DateFormatSymbols().getAmPmStrings();
mAm = ampm[0];
mPm = ampm[1];
@@ -205,6 +206,18 @@ public class AlarmClock extends PreferenceActivity implements OnItemClickListene
}

@Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+        case android.R.id.home:
+            finish();
+            break;
+        default:
+            break;
+        }
+        return super.onOptionsItemSelected(item);
+    }
+
+    @Override
public void onConfigurationChanged(Configuration newConfig) {
View viewFocus = getCurrentFocus();
int viewId = -1;


五:默认出厂日期/时间

(frameworks/base/services/core/java/com/android/server/NetworkTimeUpdateService.java)

if ("".equals(decryptState) || DECRYPT_STATE.equals(decryptState)) {
Time today = new Time(Time.getCurrentTimezone());
today.setToNow();
Log.d(TAG, "First boot:" + tempString + " with date:" + today);
+              int year = 类似 20160101 / 10000;
+
+              /* 1 - 12 */
+              int month = (类似 20160101 % 10000) / 100;
+
+              /* 1 - 31 */
+              int monthDay = 类似 20160101 % 100;
+
+              /* 0-23 */
+              int hour = 类似 80000 / 10000;
+
+              /* 0 -59 */
+              int minute = (类似 80000 % 10000) / 100;
+
+              /* 0 - 59 */
+              int second = 类似 80000 % 100;
+
+              today.set(second, minute, hour, monthDay, month-1, year);
+              Log.d(TAG, "Set the date and time to: " + today);
Log.d(TAG, "Set the year to " + mDefaultYear);
SystemProperties.set(BOOT_SYS_PROPERTY, "false");
SystemClock.setCurrentTimeMillis(today.toMillis(false));
}
}


六:当信号不存在(如“紧急”或“无信号”等),请更换图标,不要用空白显示

frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java)

diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
index 2140b9c..58d1b63 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
@@ -30,7 +30,7 @@ class TelephonyIcons {
static final int TELEPHONY_NUM_LEVELS = 5;

//GSM/UMTS
-    static final int TELEPHONY_NO_NETWORK = R.drawable.stat_sys_signal_null;
+    static final int TELEPHONY_NO_NETWORK = R.drawable.stat_null;//替换为你客户要求的图片

static final int[][] TELEPHONY_SIGNAL_STRENGTH = {
{ R.drawable.stat_sys_signal_0,


七:待机桌面“主菜单键”改大小

frameworks/)

diff --git a/base/packages/SystemUI/extcb/com/mediatek/systemui/statusbar/extcb/NetworkType.java b/base/packages/SystemUI/extcb/com/mediatek/systemui/statusbar/extcb/NetworkType.java
index 6d666bd..41f04c4 100755
--- a/base/packages/SystemUI/extcb/com/mediatek/systemui/statusbar/extcb/NetworkType.java
+++ b/base/packages/SystemUI/extcb/com/mediatek/systemui/statusbar/extcb/NetworkType.java
@@ -23,7 +23,7 @@ import static android.telephony.TelephonyManager.NETWORK_TYPE_UNKNOWN;
*/
public enum NetworkType {

-    Type_G(0), Type_3G(1), Type_1X(2), Type_1X3G(3), Type_4G(4), Type_E(5);
+    Type_G(0), Type_3G(1), Type_1X(2), Type_1X3G(3), Type_4G(4), Type_E(5), Type_R(6);

private int mTypeId;

diff --git a/base/packages/SystemUI/res/drawable/stat_sys_signal_in.xml b/base/packages/SystemUI/res/drawable/stat_sys_signal_in.xml
index 182dc50..2e51df1 100755
--- a/base/packages/SystemUI/res/drawable/stat_sys_signal_in.xml
+++ b/base/packages/SystemUI/res/drawable/stat_sys_signal_in.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
-        android:fillColor="#88000000"
+        android:fillColor="#ffffff"
android:pathData="M18.1 20L14 14 22 14z"/>
</vector>
diff --git a/base/packages/SystemUI/res/drawable/stat_sys_signal_inout.xml b/base/packages/SystemUI/res/drawable/stat_sys_signal_inout.xml
index dcea2f0..062714e 100755
--- a/base/packages/SystemUI/res/drawable/stat_sys_signal_inout.xml
+++ b/base/packages/SystemUI/res/drawable/stat_sys_signal_inout.xml
@@ -5,10 +5,10 @@
android:viewportHeight="24.0">

<path
-        android:fillColor="#88000000"
+        android:fillColor="#ffffff"
android:pathData="M18.1 7L22 13 14 13z"/>
<path
-        android:fillColor="#88000000"
+        android:fillColor="#ffffff"
android:pathData="M18.1 20L14 14 22 14z"/>

</vector>
diff --git a/base/packages/SystemUI/res/drawable/stat_sys_signal_out.xml b/base/packages/SystemUI/res/drawable/stat_sys_signal_out.xml
index f9208bb..55d700d 100755
--- a/base/packages/SystemUI/res/drawable/stat_sys_signal_out.xml
+++ b/base/packages/SystemUI/res/drawable/stat_sys_signal_out.xml
@@ -4,6 +4,6 @@
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
-        android:fillColor="#88000000"
+        android:fillColor="#ffffff"
android:pathData="M18.1 7L22 13 14 13z"/>
</vector>
diff --git a/base/packages/SystemUI/res/layout/mobile_signal_group.xml b/base/packages/SystemUI/res/layout/mobile_signal_group.xml
index 1882b65..f3c8344 100644
--- a/base/packages/SystemUI/res/layout/mobile_signal_group.xml
+++ b/base/packages/SystemUI/res/layout/mobile_signal_group.xml
@@ -21,35 +21,45 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res-auto"
android:id="@+id/mobile_combo"
-    android:layout_width="wrap_content"
+    android:layout_width="23dp"
android:layout_height="wrap_content"
>
<com.android.systemui.statusbar.AnimatedImageView
android:theme="@style/DualToneLightTheme"
android:id="@+id/mobile_signal"
android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
+        android:layout_width="19dp"
systemui:hasOverlappingRendering="false"
/>
<com.android.systemui.statusbar.AnimatedImageView
android:theme="@style/DualToneDarkTheme"
android:id="@+id/mobile_signal_dark"
android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
+        android:layout_width="19dp"
android:alpha="0.0"
systemui:hasOverlappingRendering="false"
/>
-    <ImageView
-        android:id="@+id/mobile_type"
-        android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
-        />
+    <RelativeLayout>
+            <ImageView
+                android:id="@+id/mobile_r_type"
+                android:layout_height="wrap_content"
+                android:layout_width="wrap_content"
+                />
+            <ImageView
+                android:id="@+id/mobile_type"
+                android:layout_toRightOf ="@id/mobile_r_type"
+                android:layout_height="wrap_content"
+                android:layout_width="wrap_content"
+                />
+    </RelativeLayout>
<ImageView
android:id="@+id/data_inout"
android:layout_height="wrap_content"
-        android:layout_width="wrap_content"
+        android:layout_width="17dp"
+        android:gravity="center"
+        android:layout_marginLeft="5dp"
android:tag="data_inout"
/>
<!-- End of Vanzo:tanglei -->
diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
index 83d672a..765669b 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java
@@ -65,6 +65,7 @@ import java.util.List;
import com.android.featureoption.FeatureOption;
// End of Vanzo:tanglei

+import com.mediatek.systemui.statusbar.extcb.NetworkType;
// Intimately tied to the design of res/layout/signal_cluster_view.xml
public class SignalClusterView
extends LinearLayout
@@ -332,6 +333,16 @@ public class SignalClusterView
apply();
}

+    public void setRType(NetworkType networkType, int subId) {
+         Log.d(TAG, "setNetworkType(" + subId + "), NetworkType= " + networkType);
+         PhoneState state = getOrInflateState(subId);
+         state.mRType = networkType;
+    }
+    public void setRType(NetworkType networkType, int subId) {
+         Log.d(TAG, "setNetworkType(" + subId + "), NetworkType= " + networkType);
+         PhoneState state = getOrInflateState(subId);
+         state.mRType = networkType;
+    }
@Override
public void setEthernetIndicators(IconState state) {
mEthernetVisible = state.visible && !mBlockEthernet;
@@ -672,6 +683,9 @@ public class SignalClusterView
/// Support [SIM Indicator]
private int mSignalBackgroundIconId;

+        private NetworkType mRType;//ROAMING
+        private ImageView mRNetworkType;//ROAMING img
+
/// @ }
/*
* add signal up and down icon
@@ -710,6 +724,7 @@ public class SignalClusterView
mMobileDark     = (ImageView) root.findViewById(R.id.mobile_signal_dark);
mMobileType     = (ImageView) root.findViewById(R.id.mobile_type);
mNetworkType    = (ImageView) root.findViewById(R.id.network_type);
+            mRNetworkType   = (ImageView) root.findViewById(R.id.mobile_r_type);
/// M: Add for CT 6M. adjust data and activity icon. @{
if (FeatureOptionUtils.isMTK_CT6M_SUPPORT()) {
// add primary sim card
@@ -776,11 +791,57 @@ public class SignalClusterView
mPrimarySimCard.setImageResource(mPrimarySimIconId);
}
/// @}
+
+                if (!mIsAirplaneMode && mRType != null) {
+                    int id = R.drawable.stat_sys_data_fully_connected_roam;
+                    Log.d(TAG, "apply(), mNetworkType= " + mNetworkType + " resId= " + id);
+                    mRNetworkType.setImageResource(id);
+                    mRNetworkType.setVisibility(View.VISIBLE);
+                } else {
+                    mRNetworkType.setImageDrawable(null);
+                    mRNetworkType.setVisibility(View.GONE);
+                }

/*
* add signal up and down icon
*/
if (FeatureOption.VANZO_FEATURE_SYSTEMUI_SHOW_SIGNAL_UP_DOWN_ICON && mDataActivityId != 0) {
+                    int aa = mDataActivityInOut.getPaddingLeft();
+                    int bb = mDataActivityInOut.getPaddingTop();
+                    int cc = mDataActivityInOut.getPaddingRight();
+                    int dd = mDataActivityInOut.getPaddingBottom();
+
+                    int a1 = mMobileGroup.getPaddingLeft();
+                    int b2 = mMobileGroup.getPaddingTop();
+                    int c3 = mMobileGroup.getPaddingRight();
+
+
+                    int weight5 = mMobile.getWidth();
+                    int weight6 = mNetworkType.getWidth();
+                    int weight = mMobileGroup.getWidth();
+                    int weight2 = mDataActivityInOut.getWidth();
+                    int weight3 = mMobileType.getWidth();
+                    int weight4 = mMobileDark.getWidth();
+
+                    int id1 = R.drawable.stat_sys_data_fully_connected_h_plus;
+                    int id2 = R.drawable.stat_sys_data_fully_connected_3g;
+                    int id3 = R.drawable.stat_sys_data_fully_connected_4g;
+                    if(mMobileTypeId == id1) {
+                        mDataActivityInOut.setPadding(-4, bb , cc , dd);
+                    } else  if (mMobileTypeId == id2){
+                        mDataActivityInOut.setPadding(0, bb , cc , dd);
+                    } else  if (mMobileTypeId == id3){
+                        mDataActivityInOut.setPadding(0, bb , cc , dd);
+                    }else {
+                        mDataActivityInOut.setPadding(-4, bb , cc , dd);
+                    }
mDataActivityInOut.setImageResource(mDataActivityId);
mDataActivityInOut.setVisibility(View.VISIBLE);
} else {
diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java
index 32300f2..e811910 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/po
18ecc
licy/CallbackHandler.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/CallbackHandler.java
@@ -28,6 +28,7 @@ import com.mediatek.systemui.statusbar.defaultaccount.DefaultAccountStatus;

import java.util.ArrayList;
import java.util.List;
+import com.mediatek.systemui.statusbar.extcb.NetworkType;

/**
* Implements network listeners and forwards the calls along onto other listeners but on
@@ -152,6 +153,19 @@ public class CallbackHandler extends Handler implements EmergencyListener, Signa
}

@Override
+    public void setRType(final NetworkType networkType, final int subId) {
+        post(new Runnable() {
+            @Override
+            public void run() {
+                for (SignalCallback signalCluster : mSignalCallbacks) {
+                    ///M: Support[Network Type on StatusBar]. Add one more parameter networkIcon.
+                    signalCluster.setRType(networkType, subId);
+                }
+            }
+        });
+    }
+
+    @Override
public void setSubs(List<SubscriptionInfo> subs) {
obtainMessage(MSG_SUBS_CHANGED, subs).sendToTarget();
}
diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index 2f25267..2d5b97f 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -59,6 +59,7 @@ import java.util.Objects;
*/
import com.android.featureoption.FeatureOption;
+import com.mediatek.systemui.statusbar.extcb.NetworkType;

public class MobileSignalController extends SignalController<
@@ -94,6 +95,7 @@ public class MobileSignalController extends SignalController<
/// @}
/// M: For plugin.
private IStatusBarPlugin mStatusBarExt;
+    private NetworkType mRType = null;

// TODO: Reduce number of vars passed in, if we have the NetworkController, probably don't
// need listener lists anymore.
@@ -326,6 +328,9 @@ public class MobileSignalController extends SignalController<
}
/// @}

+        mCallbackHandler.setRType(mRType,
+                mSubscriptionInfo.getSubscriptionId());
+
mCallbackHandler.setMobileDataIndicators(statusIcon, qsIcon, typeIcon, networkIcon,
qsTypeIcon, activityIn, activityOut,
/// M: Add for CT6M. add activity icon @{
@@ -572,11 +577,12 @@ public class MobileSignalController extends SignalController<
/// M: Add for op network tower type.
mCurrentState.customizedState = PluginFactory.getStatusBarPlugin(mContext).
customizeMobileState(mServiceState, mCurrentState.customizedState);
-
+
+        mRType = null;
if (isCarrierNetworkChangeActive()) {
mCurrentState.iconGroup = TelephonyIcons.CARRIER_NETWORK_CHANGE;
} else if (isRoaming()) {
-            mCurrentState.iconGroup = TelephonyIcons.ROAMING;
+            mRType = NetworkType.Type_R;
}
if (isEmergencyOnly() != mCurrentState.isEmergency) {
mCurrentState.isEmergency = isEmergencyOnly();
diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 7bceed8..3891e44 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -24,6 +24,7 @@ import com.android.settingslib.wifi.AccessPoint;
import com.mediatek.systemui.statusbar.defaultaccount.DefaultAccountStatus;

import java.util.List;
+import com.mediatek.systemui.statusbar.extcb.NetworkType;

public interface NetworkController {

@@ -39,6 +40,8 @@ public interface NetworkController {
void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
boolean activityIn, boolean activityOut, String description);

+        void setRType(NetworkType networkType, int subId);
+
/** M: Support [Network Type on Statusbar]
* Add one more parameter networkIcon to signal view and show the network type beside
* the signal.
diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java
index 5dc652e..eb0dfd9 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/SignalCallbackAdapter.java
@@ -22,6 +22,7 @@ import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
import com.mediatek.systemui.statusbar.defaultaccount.DefaultAccountStatus;

import java.util.List;
+import com.mediatek.systemui.statusbar.extcb.NetworkType;

/**
@@ -34,6 +35,10 @@ public class SignalCallbackAdapter implements SignalCallback {
public void setWifiIndicators(boolean enabled, IconState statusIcon, IconState qsIcon,
boolean activityIn, boolean activityOut, String description) {
}
+
+    public void setRType(NetworkType networkType, int subId) {
+    }
+
/** M: Support[Network Type on StatusBar].
* Add one more parameter networkIcon to signal view and show the network type beside
* the signal. */
packages/apps/Launcher3/res/drawable-xhdpi/ic_allapps.png

packages/apps/Launcher3/res/drawable-xhdpi/ic_allapps_pressed.png

上面两个图片再换一下

八:手机熄屏状态home键唤醒屏幕

(frameworks/base/core/java/android/view/KeyEvent.java)

diff --git a/base/core/java/android/view/KeyEvent.java b/base/core/java/android/view/KeyEvent.java
index 7a5c01d..31b8b9a 100644
--- a/base/core/java/android/view/KeyEvent.java
+++ b/base/core/java/android/view/KeyEvent.java
@@ -1831,6 +1831,7 @@ public class KeyEvent extends InputEvent implements Parcelable {
/** @hide */
public static final boolean isWakeKey(int keyCode) {
switch (keyCode) {
+            case KeyEvent.KEYCODE_HOME:
case KeyEvent.KEYCODE_BACK:
case KeyEvent.KEYCODE_MENU:
case KeyEvent.KEYCODE_WAKEUP:


九:情景模式 > 音效改善 > BesLoudness默认关闭

(packages/apps/Settings/)

diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 27a7f49..b238160 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -2736,6 +2736,7 @@ for nck code
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.ACTION_BOOT_IPO" />
+                <action android:name="android.media.RINGER_MODE_CHANGED" />
<action android:name="android.intent.action.USER_SWITCHED_FOR_MULTIUSER_APP" />
</intent-filter>
</receiver>
diff --git a/src/com/android/settings/sim/SimDialogActivity.java b/src/com/android/settings/sim/SimDialogActivity.java
index aea54dd..6998cbc 100644
--- a/src/com/android/settings/sim/SimDialogActivity.java
+++ b/src/com/android/settings/sim/SimDialogActivity.java
@@ -355,6 +355,9 @@ public class SimDialogActivity extends Activity {
case SMS_PICK:
/// M: for [SMS Always Ask]
// sir = subInfoList.get(value);
+                                if(subInfoList.size()==2){
+                                    value++;
+                                }
int subId = getPickSmsDefaultSub(subInfoList, value);
/// M: [C2K solution 2 enhancement] [C2K solution 1.5] @{
if (CdmaUtils.isCdmaCardCompetionForSms(context, subId)) {
@@ -666,10 +669,10 @@ public class SimDialogActivity extends Activity {
private void setupSmsSubInfoList(final ArrayList<String> list,
final List<SubscriptionInfo> subInfoList, final int selectableSubInfoLength,
ArrayList<SubscriptionInfo> smsSubInfoList) {
-        if ((selectableSubInfoLength > 1) && (mRCSExt.isNeedAskFirstItemForSms())) {
+        /*if ((selectableSubInfoLength > 1) && (mRCSExt.isNeedAskFirstItemForSms())) {
list.add(getResources().getString(R.string.sim_calls_ask_first_prefs_title));
smsSubInfoList.add(null);
-        }
+        }*/
for (int i = 0; i < selectableSubInfoLength; ++i) {
final SubscriptionInfo sir = subInfoList.get(i);
smsSubInfoList.add(sir);
diff --git a/src/com/mediatek/settings/RestoreRotationReceiver.java b/src/com/mediatek/settings/RestoreRotationReceiver.java
index 54502b1..74cc1c6 100755
--- a/src/com/mediatek/settings/RestoreRotationReceiver.java
+++ b/src/com/mediatek/settings/RestoreRotationReceiver.java
@@ -42,11 +42,19 @@ import android.content.Intent;
import android.provider.Settings;
import android.util.Log;
import android.os.UserHandle;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import java.util.List;
+import android.content.SharedPreferences;
+import android.media.AudioManager;
+import android.os.SystemProperties;

public class RestoreRotationReceiver extends BroadcastReceiver {

public static boolean sRestoreRetore = false;
+    SharedPreferences mPref;
+    AudioManager mAudioManager;

@Override
public void onReceive(Context context, Intent intent) {
@@ -65,6 +73,34 @@ public class RestoreRotationReceiver extends BroadcastReceiver {
Settings.System.putIntForUser(context.getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION_RESTORE, 0, UserHandle.USER_CURRENT);
}
+
+            //
+            android.util.Log.i("jiangyanqing", "        Intent.ACTION_BOOT_COMPLETED  "+action);
+            final SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
+            List<SubscriptionInfo> subInfoList = subscriptionManager.getActiveSubscriptionInfoList();
+
+            if(subInfoList != null){
+                int count = subInfoList.size();
+                android.util.Log.i("jiangyanqing", "       subInfoList.size   "+count);
+                if(count>0){
+                    // 设置
+                    android.util.Log.i("jiangyanqing", "   设置 卡1  ");
+                    int firstSubId = subInfoList.get(0).getSubscriptionId();
+                    android.util.Log.i("jiangyanqing", "      firstSubId   "+firstSubId);
+                    subscriptionManager.setDefaultSmsSubId(firstSubId);
+                    subscriptionManager.setDefaultDataSubId(firstSubId);
+                }
+            }
+
+            if(SystemProperties.getBoolean("persist.sys.bes_loud",true)){
+
+                mAudioManager = (AudioManager) context.getSystemService(context.AUDIO_SERVICE);
+                if(mAudioManager != null){
+                    mAudioManager.setParameters("SetBesLoudnessStatus=0");
+                    SystemProperties.set("persist.sys.bes_loud","false");
+                }
+
+            }
}
}
}


十:文件夹背景色不能透明

(packages/apps/Launcher3/)

新建一个空的patch文件

(packages/apps/Launcher3/)

diff --git a/res/values/styles.xml b/res/values/styles.xml
index 7d60cbe..dc9511c 100755
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -41,7 +41,7 @@

<style name="Icon.AllApps">
<item name="android:background">@null</item>
-        <item name="android:textColor">@color/quantum_panel_text_color</item>
+        <item name="android:textColor">@color/outline_color</item>
<item name="android:drawablePadding">@dimen/dynamic_grid_icon_drawable_padding</item>
<item name="android:shadowRadius">0</item>
<item name="customShadows">false</item>
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index a000e43..f0407d9 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -1442,7 +1442,7 @@ public class LauncherModel extends BroadcastReceiver
runLoader = true;
}
}
-        if (runLoader) {
+        if (true) {
startLoader(PagedView.INVALID_RESTORE_PAGE);
}
}
diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
index cdde8c1..1b51127 100755
--- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java
+++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java
@@ -120,6 +120,9 @@ public class LauncherStateTransitionAnimation {
final boolean animated, final boolean startSearchAfterTransition) {
final AllAppsContainerView toView = mLauncher.getAppsView();
final View buttonView = mLauncher.getAllAppsButton();
+        if (mLauncher != null) {
+            mLauncher.getSearchDropTargetBar().hideSearchBar();
+        }
PrivateTransitionCallbacks cb = new PrivateTransitionCallbacks() {
@Override
public float getMaterialRevealViewFinalAlpha(View revealView) {
@@ -206,7 +209,8 @@ public class LauncherStateTransitionAnimation {
final AnimatorSet animation = LauncherAnimUtils.createAnimatorSet();
final Resources res = mLauncher.getResources();
final boolean material = Utilities.ATLEAST_LOLLIPOP;
-        final int revealDuration = res.getInteger(R.integer.config_overlayRevealTime);
+    //  final int revealDuration = res.getInteger(R.integer.config_overlayRevealTime);
+        final int revealDuration = 0;
final int itemsAlphaStagger =
res.getInteger(R.integer.config_overlayItemsAlphaStagger);

@@ -483,10 +487,14 @@ public class LauncherStateTransitionAnimation {
final View fromView, final View contentView, final View revealView,
final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable,
final PrivateTransitionCallbacks pCb) {
+        if (mLauncher != null) {
+            mLauncher.getSearchDropTargetBar().showSearchBar();
+        }
final AnimatorSet animation = LauncherAnimUtils.createAnimatorSet();
final Resources res = mLauncher.getResources();
final boolean material = Utilities.ATLEAST_LOLLIPOP;
-        final int revealDuration = res.getInteger(R.integer.config_overlayRevealTime);
+    //  final int revealDuration = res.getInteger(R.integer.config_overlayRevealTime);
+        final int revealDuration = 16;
final int itemsAlphaStagger =
res.getInteger(R.integer.config_overlayItemsAlphaStagger);

@@ -714,7 +722,7 @@ public class LauncherStateTransitionAnimation {
(fromWorkspaceState == Workspace.State.NORMAL_HIDDEN)) {
// If we are transitioning from the overlay to the workspace, then show the
// workspace search bar immediately and let the overlay search bar fade out on top
-                mLauncher.getSearchDropTargetBar().animateToState(toSearchBarState, 0);
+                mLauncher.getSearchDropTargetBar().animateToState(toSearchBarState, 500);
} else if (fromWorkspaceState == Workspace.State.NORMAL) {
// If we are transitioning from the workspace to the overlay, then keep the
// workspace search bar visible until the overlay search bar fades in on top
diff --git a/src/com/android/launcher3/SearchDropTargetBar.java b/src/com/android/launcher3/SearchDropTargetBar.java
index b4cfe4b..8879e02 100755
--- a/src/com/android/launcher3/SearchDropTargetBar.java
+++ b/src/com/android/launcher3/SearchDropTargetBar.java
@@ -63,7 +63,7 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
}
}

-    private static int DEFAULT_DRAG_FADE_DURATION = 175;
+    private static int DEFAULT_DRAG_FADE_DURATION = 0;

private LauncherViewPropertyAnimator mDropTargetBarAnimator;
private LauncherViewPropertyAnimator mQSBSearchBarAnimator;
@@ -167,6 +167,16 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
}
}

+    public void hideSearchBar () {
+        if(mQSB != null)
+            mQSB.setVisibility(View.GONE);
+    }
+
+    public void showSearchBar () {
+        if(mQSB != null)
+            mQSB.setVisibility(View.VISIBLE);
+    }
+
/**
* Animates the current search bar state to a new state.  If the {@param duration} is 0, then
* the state is applied immediately.
@@ -179,7 +189,6 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D
AccessibilityManager am = (AccessibilityManager)
getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
mAccessibilityEnabled = am.isEnabled();
-
animateViewAlpha(mQSBSearchBarAnimator, mQSB, newState.getSearchBarAlpha(),
duration);
animateViewAlpha(mDropTargetBarAnimator, mDropTargetBar, newState.getDropTargetBarAlpha(),
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java
index 28747ea..6f515bc 100755
--- a/src/com/android/launcher3/allapps/AllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -376,8 +376,8 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
padding.right, 0);
Rect bgPadding = new Rect();
background.getPadding(bgPadding);
-        mContainerView.setBackground(background);
-        mRevealView.setBackground(background.getConstantState().newDrawable());
+       // mContainerView.setBackground(background);
+       // mRevealView.setBackground(background.getConstantState().newDrawable());
mAppsRecyclerView.updateBackgroundPadding(bgPadding);
mAdapter.updateBackgroundPadding(bgPadding);

diff --git a/src/com/android/launcher3/op09/AllAppsContainerView.java b/src/com/android/launcher3/op09/AllAppsContainerView.java
index 48e0e3a..c2d5f4b 100755
--- a/src/com/android/launcher3/op09/AllAppsContainerView.java
+++ b/src/com/android/launcher3/op09/AllAppsContainerView.java
@@ -439,8 +439,8 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
padding.right, 0);
Rect bgPadding = new Rect();
background.getPadding(bgPadding);
-        mContainerView.setBackground(background);
-        mRevealView.setBackground(background.getConstantState().newDrawable());
+       // mContainerView.setBackground(background);
+       // mRevealView.setBackground(background.getConstantState().newDrawable());
mAppsRecyclerView.updateBackgroundPadding(bgPadding);
mAdapter.updateBackgroundPadding(bgPadding);


十一:插卡开机手动设置过系统语言之后重启,语言还是会变成中文

(packages/apps/Settings/src/com/android/settings/LocalePicker.java)

diff --git a/src/com/android/settings/LocalePicker.java b/src/com/android/settings/LocalePicker.java
index 7a8f120..9c8198b 100644
--- a/src/com/android/settings/LocalePicker.java
+++ b/src/com/android/settings/LocalePicker.java
@@ -25,6 +25,7 @@ import android.view.ViewGroup;
import android.widget.ListView;
import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
import java.util.Locale;
+import android.os.SystemProperties;

public class LocalePicker extends com.android.internal.app.LocalePicker
implements com.android.internal.app.LocalePicker.LocaleSelectionListener,
@@ -62,6 +63,7 @@ public class LocalePicker extends com.android.internal.app.LocalePicker

@Override
public void onLocaleSelected(final Locale locale) {
+	SystemProperties.set("persist.sys.settedlanguage" , "1");
if (Utils.hasMultipleUsers(getActivity())) {
mTargetLocale = locale;
showDialog(DLG_SHOW_GLOBAL_WARNING);
(frameworks/opt/telephony/src/java/com/android/internal/telephony/MccTable.java)
diff --git a/opt/telephony/src/java/com/android/internal/telephony/MccTable.java b/opt/telephony/src/java/com/android/internal/telephony/MccTable.java
index d3e3ff9..8fa1912 100644
--- a/opt/telephony/src/java/com/android/internal/telephony/MccTable.java
+++ b/opt/telephony/src/java/com/android/internal/telephony/MccTable.java
@@ -218,8 +218,9 @@ public final class MccTable {
/*
* language don't depend sim
*/
-                if(!com.android.featureoption.FeatureOption.VANZO_FEATURE_CHANGE_LANGUAGE_NOT_BY_SIM){
-                    locale = getLocaleFromMcc(context, mcc);
+                if(!com.android.featureoption.FeatureOption.VANZO_FEATURE_CHANGE_LANGUAGE_NOT_BY_SIM
+                        && !(SystemProperties.getInt("persist.sys.settedlanguage" , 0)==1)){
+	            locale = getLocaleFromMcc(context, mcc,MccTable.defaultLanguageForMcc(mcc));
}
// End of
}


十二:MMS添加附件再加一个联系人时,附件自动消失了

(vendor/)

diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
index ff7aa68..e44e685 100755
--- a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
+++ b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/data/WorkingMessage.java
@@ -1122,7 +1122,7 @@ public class WorkingMessage implements IWorkingMessageCallback {
if (mSlideshow != null && mSlideshow.size() > 0) {
/// M: Code analyze 034, For new feature ALPS00231349,  add vCard support. @{
if (mOpWorkingMessageExt.removeAllAttachFiles()) {
-                    mSlideshow.removeAllAttachFiles();
+                   // mSlideshow.removeAllAttachFiles();
}
mSlideshow.clear();
mSlideshow = null;
@@ -1175,7 +1175,10 @@ public class WorkingMessage implements IWorkingMessageCallback {
}

// Remove any previous attachments.
-        removeSlideAttachments(slide);
+       // removeSlideAttachments(slide);
+        slide.removeImage();
+        slide.removeVideo();
+        slide.removeAudio();

slide.add(media);

@@ -1248,7 +1251,7 @@ public class WorkingMessage implements IWorkingMessageCallback {
slide.add(media);

/// M: for vcard, since we append a media, remove vCard
-        removeAllFileAttaches();
+       // removeAllFileAttaches();

// For video and audio, set the duration of the slide to
// that of the attachment.
diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/AttachmentEditor.java b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/AttachmentEditor.java
index a1e9e7f..0802601 100644
--- a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/AttachmentEditor.java
+++ b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/AttachmentEditor.java
@@ -133,7 +133,7 @@ public class AttachmentEditor extends LinearLayout implements IAttachmentEditorC
try {
/// M: fix bug ALPS00947784, check and remove FileAttachment
if (!mOpAttachmentEditorExt.update()) {
-                checkFileAttacment(msg);
+               // checkFileAttacment(msg);
}
/// M: for vcard: file attachment view and other views are exclusive to each other
if (mSlideshow.sizeOfFilesAttach() > 0) {
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 15dba17..76d1195 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
@@ -4884,7 +4884,8 @@ public class ComposeMessageActivity extends Activity
// Launch the add-attachment list dialog
/// M: Code analyze 051, Hide input keyboard.@{
hideInputMethod();
-                showAddAttachmentDialog(!mWorkingMessage.hasAttachedFiles());
+               // showAddAttachmentDialog(!mWorkingMessage.hasAttachedFiles());
+                showAddAttachmentDialog(true);
MmsLog.d(TAG, "Attach: showAddAttachmentDialog(!hasAttachedFiles)");
break;
/// M: Code analyze 014, Add quick text. @{
@@ -9775,14 +9776,15 @@ public class ComposeMessageActivity extends Activity
// if (mAttachmentTypeSelectorAdapter == null) {
// add for vcard, if there is a real slideshow, hide vCard
int mode = AttachmentTypeSelectorAdapter.MODE_WITH_SLIDESHOW;
-            if (mWorkingMessage.hasSlideshow()) {
+           /* if (mWorkingMessage.hasSlideshow()) {
mode |= AttachmentTypeSelectorAdapter.MODE_WITHOUT_FILE_ATTACHMENT;
} else {
mode |= AttachmentTypeSelectorAdapter.MODE_WITH_FILE_ATTACHMENT;
}
if (MessageUtils.isVCalendarAvailable(ComposeMessageActivity.this)) {
mode |= AttachmentTypeSelectorAdapter.MODE_WITH_VCALENDAR;
-            }
+            } */
+            mode |= AttachmentTypeSelectorAdapter.MODE_WITH_FILE_ATTACHMENT;
mAttachmentTypeSelectorAdapter = new AttachmentTypeSelectorAdapter(getContext(), mode);
// }
builder.setAdapter(mAttachmentTypeSelectorAdapter,
diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/MessageListItem.java b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/MessageListItem.java
index 33a72aa..3a1c8fa 100644
--- a/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/MessageListItem.java
+++ b/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/MessageListItem.java
@@ -895,10 +895,14 @@ public class MessageListItem extends LinearLayout implements
showFileAttachmentView(mMessageItem.mSlideshow.getAttachFiles());
} else {
/// M: OP01 add for VCard and VCanlendar
-                    if (!mOpMessageListItemExt.showOrHideFileAttachmentView(
-                            mMessageItem.mSlideshow.getAttachFiles())) {
-                        hideFileAttachmentViewIfNeeded();
-                        MmsLog.i(TAG, "mMmsAttachmentEnhancePlugin= null");
+                   /* if (!mOpMessageListItemExt.showOrHideFileAttachmentView(
+                            mMessageItem.mSlideshow.getAttachFiles())) { */
+                    ArrayList<FileAttachmentModel> attachedFiles = mMessageItem.mSlideshow.getAttachFiles();
+                    if (attachedFiles != null && attachedFiles.size() > 0) {
+                            showFileAttachmentView(mMessageItem.mSlideshow.getAttachFiles());
+                    } else {
+                             hideFileAttachmentViewIfNeeded();
+                             MmsLog.i(TAG, "mMmsAttachmentEnhancePlugin= null");
}
setImage(null, null);

diff --git a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/mms/util/FileAttachmentUtils.java b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/mms/util/FileAttachmentUtils.java
index e39c908..ec2ab98 100755
--- a/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/mms/util/FileAttachmentUtils.java
+++ b/mediatek/proprietary/packages/apps/Mms/src/com/mediatek/mms/util/FileAttachmentUtils.java
@@ -134,7 +134,7 @@ public class FileAttachmentUtils {
slideshow.checkAttachmentSize(fileAttach.getAttachSize(), append, textSize);

/// M: Modify ALPS00474719
-        if (!mOpFileAttachmentUtilsExt.setOrAppendFileAttachment(append)) {
+       /* if (!mOpFileAttachmentUtilsExt.setOrAppendFileAttachment(append)) {
SlideModel slide = slideshow.get(0);
slide.removeImage();
slide.removeVideo();
@@ -145,7 +145,7 @@ public class FileAttachmentUtils {
}
MmsLog.d(TAG, "Replace vcard or vcalender or Not OP01");
}
-
+        */
// Add file attachments
if (append) {
slideshow.addFileAttachment(fileAttach);


十三:在用google联网登陆时,返回键会消失

(packages/apps/Settings/src/com/android/settings/deviceinfo/Status.java)

diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java
index 0155e11..a375bfa 100644
--- a/src/com/android/settings/deviceinfo/Status.java
+++ b/src/com/android/settings/deviceinfo/Status.java
@@ -41,6 +41,7 @@ import android.view.View;
import android.widget.AdapterView;
import android.widget.ListAdapter;
import android.widget.Toast;

import com.android.internal.logging.MetricsLogger;
import com.android.internal.util.ArrayUtils;
@@ -52,6 +53,7 @@ import com.mediatek.settings.ext.ISettingsMiscExt;

import java.lang.ref.WeakReference;
+import android.net.NetworkInfo;

/**
* Display the following information
@@ -321,8 +323,10 @@ public class Status extends InstrumentedPreferenceActivity {

private void setWifiStatus() {
WifiInfo wifiInfo = mWifiManager.getConnectionInfo();
+        boolean  wifiConnect = isWifiConnected(Status.this);
String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();
-        mWifiMacAddress.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress : mUnavailable);
+        mWifiMacAddress.setSummary(!TextUtils.isEmpty(macAddress)&&wifiConnect ? macAddress : mUnavailable);
}

private void setIpAddressStatus() {
@@ -347,6 +351,20 @@ public class Status extends InstrumentedPreferenceActivity {
}
}

+    public boolean isWifiConnected(Context context) {
+        if (context != null) {
+            ConnectivityManager mConnectivityManager = (ConnectivityManager) context
+                .getSystemService(Context.CONNECTIVITY_SERVICE);
+            NetworkInfo mWiFiNetworkInfo = mConnectivityManager
+                .getNetworkInfo(ConnectivityManager.TYPE_WIFI);
+            if (mWiFiNetworkInfo != null) {
+                return mWiFiNetworkInfo.isConnected();
+            }
+        }
+        return false;
+    }
+
void updateConnectivity() {
setWimaxStatus();
setWifiStatus();


十四:插入Digicel SIM卡,手机开启后识别到SIM卡,不管是用2G还是3G网络,都要求显示为DIGICEL

(frameworks/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java)

diff --git a/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index e590301..6f5c942 100755
--- a/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -1389,6 +1389,12 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
}
}

+        if (plmn != null) {
+            plmn = plmn.replace("3G","");
+        }
+        if (spn != null) {
+            spn = spn.replace("3G","");
+        }
if (showPlmn != mCurShowPlmn
|| showSpn != mCurShowSpn
|| !TextUtils.equals(spn, mCurSpn)


十五:锁屏状态下不要显示“SIM卡运营商”名称

(frameworks/base/packages/Keyguard/src/com/android/keyguard/CarrierText.java)

diff --git a/base/packages/Keyguard/src/com/android/keyguard/CarrierText.java b/base/packages/Keyguard/src/com/android/keyguard/CarrierText.java
index d38e0a2..e4e6309 100644
--- a/base/packages/Keyguard/src/com/android/keyguard/CarrierText.java
+++ b/base/packages/Keyguard/src/com/android/keyguard/CarrierText.java
@@ -347,7 +347,7 @@ public class CarrierText extends TextView {
carrierFinalContent) ;

// setText(displayText);
-        setText(carrierFinalContent) ;
+        setText("") ;
}

@Override
@@ -508,6 +508,7 @@ public class CarrierText extends TextView {
Log.d(TAG, "getCarrierTextForSimState simState=" + simState +
" text(carrierName)=" + text + " HNB=" + hnbName +
" CSG=" + csgId + " carrierText=" + carrierText);
+        carrierText ="";
return carrierText;
}


十六:在PIN解除封锁后,不会显示显示过程成功的消息

(packages/services/Telephony/src/com/android/phone/PhoneUtils.java)

diff --git a/Telephony/src/com/android/phone/PhoneUtils.java b/Telephony/src/com/android/phone/PhoneUtils.java
index c271f50..e13a50e 100644
--- a/Telephony/src/com/android/phone/PhoneUtils.java
+++ b/Telephony/src/com/android/phone/PhoneUtils.java
@@ -22,6 +22,7 @@
package com.android.phone;

import android.app.AlertDialog;
+import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.bluetooth.IBluetoothHeadsetPhone;
@@ -916,6 +917,7 @@ public class PhoneUtils {
final PhoneGlobals app = PhoneGlobals.getInstance();
CharSequence text;
int title = 0;  // title for the progress dialog, if needed.
+        final boolean isEnable = false;
MmiCode.State state = mmiCode.getState();

if (DBG) log("displayMMIComplete: state=" + state);
@@ -930,7 +932,9 @@ public class PhoneUtils {
text = null;
break;
case COMPLETE:
-                if (app.getPUKEntryActivity() != null) {
+                title = com.android.internal.R.string.PinMmi;
+                text = context.getText(R.string.puk_unlocked);
+                if (app.getPUKEntryActivity() != null && isEnable != false) {
// if an attempt to unPUK the device was made, we specify
// the title and the message here.
title = com.android.internal.R.string.PinMmi;
@@ -940,7 +944,7 @@ public class PhoneUtils {
// All other conditions for the COMPLETE mmi state will cause
// the case to fall through to message logic in common with
// the FAILED case.
-
+                	break;
case FAILED:
text = mmiCode.getMessage();
if (DBG) log("- using text from MMI message: '" + text + "'");
@@ -955,11 +959,12 @@ public class PhoneUtils {

// Check to see if a UI exists for the PUK activation.  If it does
// exist, then it indicates that we're trying to unblock the PUK.
-        if ((app.getPUKEntryActivity() != null) && (state == MmiCode.State.COMPLETE)) {
+        if ((app.getPUKEntryActivity() != null) && (state == MmiCode.State.COMPLETE) && isEnable != false) {
if (DBG) log("displaying PUK unblocking progress dialog.");

// create the progress dialog, make sure the flags and type are
// set correctly.
+
ProgressDialog pd = new ProgressDialog(app);
pd.setTitle(title);
pd.setMessage(text);
@@ -978,7 +983,7 @@ public class PhoneUtils {
} else {
// In case of failure to unlock, we'll need to reset the
// PUK unlock activity, so that the user may try again.
-            if (app.getPUKEntryActivity() != null) {
+            if (app.getPUKEntryActivity() != null && isEnable != false) {
app.setPukEntryActivity(null);
}

@@ -1021,7 +1026,9 @@ public class PhoneUtils {
.insert(0, app.getResources().getString(R.string.ussd_dialog_sep))
.insert(0, "\n");
}
sUssdMsg.insert(0, text);
+                sUssdDialog.setTitle(com.android.internal.R.string.PinMmi);
sUssdDialog.setMessage(sUssdMsg.toString());
sUssdDialog.show();


十七:gps_tcxo_ppb参数修改为500

(patches/vendor/mediatek/proprietary/custom/k8/cgen/cfgdefault/CFG_GPS_Default.h)

diff --git a/mediatek/proprietary/custom/k8/cgen/cfgdefault/CFG_GPS_Default.h b/mediatek/proprietary/custom/k8/cgen/cfgdefault/CFG_GPS_Default.h
index 4a32f10..bfc54f5 100644
--- a/mediatek/proprietary/custom/k8/cgen/cfgdefault/CFG_GPS_Default.h
+++ b/mediatek/proprietary/custom/k8/cgen/cfgdefault/CFG_GPS_Default.h
@@ -74,7 +74,7 @@ ap_nvram_gps_config_struct stGPSConfigDefault =
/* 26MHz */
26000000,
/* default is 0ppm, by chip definetion. 6620 is 500, else 2000 */
-	0,
+	500,
/* 0:16.368MHz TCXO */
0xFF,
/* 0:mixer-in, 1:internal-LNA, 6572/6582 dsp hardcode set this item to 1, only for 3332 one binary */
diff --git a/mediatek/proprietary/custom/k8/cgen/inc/Custom_NvRam_LID.h b/mediatek/proprietary/custom/k8/cgen/inc/Custom_NvRam_LID.h
index 3195032..f8af859 100644
--- a/mediatek/proprietary/custom/k8/cgen/inc/Custom_NvRam_LID.h
+++ b/mediatek/proprietary/custom/k8/cgen/inc/Custom_NvRam_LID.h
@@ -172,7 +172,7 @@ typedef enum
#define AP_CFG_RDCL_FILE_AUDIO_LID_VERNO			"001"

/* GPS file version */
-#define AP_CFG_CUSTOM_FILE_GPS_LID_VERNO			"000"
+#define AP_CFG_CUSTOM_FILE_GPS_LID_VERNO			"001"

/* audio acf file version */
#define AP_CFG_RDCL_FILE_AUDIO_COMPFLT_LID_VERNO	"001"


十八:当重启手机多任务栏(后台)里面的APP全部清除

(frameworks/)

diff --git a/base/packages/SystemUI/AndroidManifest.xml b/base/packages/SystemUI/AndroidManifest.xml
index c232fdf..a545c2f 100644
--- a/base/packages/SystemUI/AndroidManifest.xml
+++ b/base/packages/SystemUI/AndroidManifest.xml
@@ -294,6 +294,11 @@ add for bcjwqsdk
</activity>

<!-- Alternate Recents -->
+        <receiver android:name="com.android.systemui.recents.AddBroadcast" >
+        <intent-filter>
+        <action android:name="android.intent.action.ACTION_SHUTDOWN" />
+        </intent-filter>
+        </receiver>
<activity android:name=".recents.RecentsActivity"
android:label="@string/accessibility_desc_recent_apps"
android:exported="false"
diff --git a/base/packages/SystemUI/src/com/android/systemui/recents/AddBroadcast.java b/base/packages/SystemUI/src/com/android/systemui/recents/AddBroadcast.java
new file mode 100644
index 0000000..900c18b
--- /dev/null
+++ b/base/packages/SystemUI/src/com/android/systemui/recents/AddBroadcast.java
@@ -0,0 +1,34 @@
+package com.android.systemui.recents;
+
+import java.util.List;
+
+import com.android.systemui.recents.views.RecentsView;
+
+import android.app.ActivityManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.widget.Toast;
+
+public class AddBroadcast extends BroadcastReceiver{
+	private final String ACTION_BOOT = "android.intent.action.ACTION_SHUTDOWN";
+	@Override
+	public void onReceive(Context context, Intent intent) {
+		// TODO Auto-generated method stub
+		if(ACTION_BOOT.equals(intent.getAction())){
+		//	Intent intent2 = new Intent(context,RecentsActivity.class);
+		//	intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+		//	intent2.putExtra("key", "SSS");
+		//	context.startActivity(intent2);
+			//RecentsView.clearAllTask();
+
+	final ActivityManager am = (ActivityManager)context.getSystemService(Context.ACTIVITY_SERVICE);
+	final List<ActivityManager.RecentTaskInfo> recentTasks =am.getRecentTasks(100, ActivityManager.RECENT_IGNORE_UNAVAILABLE);
+	for(ActivityManager.RecentTaskInfo rt:recentTasks ) {
+	      if (am != null) am.removeTask(rt.persistentId);
+		}
+	}
+	}
+}


十九:删除通话 > 通话账户 > SIP里的前两项

(packages/services/)

diff --git a/Telephony/res/xml/phone_account_settings.xml b/Telephony/res/xml/phone_account_settings.xml
index d4bb8d7..4d300b4 100644
--- a/Telephony/res/xml/phone_account_settings.xml
+++ b/Telephony/res/xml/phone_account_settings.xml
@@ -71,10 +71,11 @@

<PreferenceCategory
android:key="phone_accounts_sip_settings_category_key"
-        android:title="@string/sip_settings"
+        android:title=""
android:persistent="false">

<PreferenceScreen
+            android:key="phone_accounts_sip_settings_key"
android:title="@string/sip_accounts"
android:persistent="false">
<intent android:action="android.intent.action.MAIN"
@@ -88,7 +89,6 @@
android:persistent="true"
android:entries="@array/sip_call_options_entries"
android:entryValues="@array/sip_call_options_values"/>
-
<CheckBoxPreference
android:key="sip_receive_calls_key"
android:title="@string/sip_receive_calls"
diff --git a/Telephony/src/com/android/phone/settings/PhoneAccountSettingsFragment.java b/Telephony/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
index b058daa..5837103 100644
--- a/Telephony/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
+++ b/Telephony/src/com/android/phone/settings/PhoneAccountSettingsFragment.java
@@ -41,6 +41,7 @@ import com.mediatek.phone.ext.ExtensionManager;
import com.mediatek.settings.TelephonyUtils;
import com.mediatek.settings.cdma.TelephonyUtilsEx;
import com.mediatek.telecom.TelecomManagerEx;
+import android.preference.PreferenceGroup;

import java.util.ArrayList;
import java.util.Collections;
@@ -69,6 +70,7 @@ public class PhoneAccountSettingsFragment extends PreferenceFragment

private static final String SIP_SETTINGS_CATEGORY_PREF_KEY =
"phone_accounts_sip_settings_category_key";
+    private static final String USE_SIP_SETTINGS_KEY = "phone_accounts_sip_settings_key";
private static final String USE_SIP_PREF_KEY = "use_sip_calling_options_key";
private static final String SIP_RECEIVE_CALLS_PREF_KEY = "sip_receive_calls_key";

@@ -89,7 +91,7 @@ public class PhoneAccountSettingsFragment extends PreferenceFragment
private TelephonyManager mTelephonyManager;
private SubscriptionManager mSubscriptionManager;

-    private PreferenceCategory mAccountList;
+    private PreferenceCategory mAccountList,sipCatogaryList;

private AccountSelectionPreference mDefaultOutgoingAccount;

@@ -183,7 +185,7 @@ public class PhoneAccountSettingsFragment extends PreferenceFragment
mAccountList.removePreference(mDefaultOutgoingAccount);
}
}
-
+
Preference allAccounts = getPreferenceScreen().findPreference(ALL_CALLING_ACCOUNTS_KEY);
// If there are no third party (nonSim) accounts, then don't show enable/disable dialog.
if (allNonSimAccounts.isEmpty() && allAccounts != null && mAccountList != null) {
@@ -203,6 +205,12 @@ public class PhoneAccountSettingsFragment extends PreferenceFragment
mUseSipCalling.setEntries(!SipManager.isSipWifiOnly(getActivity())
? R.array.sip_call_options_wifi_only_entries
: R.array.sip_call_options_entries);
+           PreferenceScreen sUseSipCalling = (PreferenceScreen) getPreferenceScreen().findPreference(USE_SIP_SETTINGS_KEY);
+           sipCatogaryList = (PreferenceCategory)getPreferenceScreen().findPreference(SIP_SETTINGS_CATEGORY_PREF_KEY);
+            if(sipCatogaryList != null && mUseSipCalling != null && sUseSipCalling !=null){
+                 sipCatogaryList.removePreference(mUseSipCalling);
+                 sipCatogaryList.removePreference(sUseSipCalling);
+                }
mUseSipCalling.setOnPreferenceChangeListener(this);

int optionsValueIndex =


二十:设置----内存----可用,客户反馈空间释放不出来:运行多程序后点击清理无法释放出空间还是一样的

(packages/apps/Settings/src/com/android/settings/applications/ProcessStatsSummary.java)

+diff --git a/src/com/android/settings/applications/ProcessStatsSummary.java b/src/com/android/settings/applications/ProcessStatsSummary.java
+index dc24c73..b9db6b2 100644
+--- a/src/com/android/settings/applications/ProcessStatsSummary.java
++++ b/src/com/android/settings/applications/ProcessStatsSummary.java
+@@ -23,6 +23,7 @@ import android.text.TextUtils;
+ import android.text.format.Formatter;
+ import android.text.format.Formatter.BytesResult;
+ import android.widget.TextView;
++import android.app.ActivityManager;
+
+ import com.android.internal.logging.MetricsLogger;
+ import com.android.settings.R;
+@@ -71,13 +72,15 @@ public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenc
+         Context context = getContext();
+         int memColor = context.getColor(R.color.running_processes_apps_ram);
+         mColors.setColors(memColor, memColor, context.getColor(R.color.running_processes_free_ram));
++        ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
++        ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
++        am.getMemoryInfo(mi);
+
+         MemInfo memInfo = mStatsManager.getMemInfo();
+
+-        double usedRam = memInfo.realUsedRam;
+         double totalRam = memInfo.realTotalRam;
+-        double freeRam = memInfo.realFreeRam;
+-        BytesResult usedResult = Formatter.formatBytes(context.getResources(), (long) usedRam,
++        double freeRam = mi.availMem;
++        BytesResult usedResult = Formatter.formatBytes(context.getResources(), (long) (totalRam - freeRam),
+                 Formatter.FLAG_SHORTER);
+         String totalString = Formatter.formatShortFileSize(context, (long) totalRam);
+         String freeString = Formatter.formatShortFileSize(context, (long) freeRam);
+@@ -91,12 +94,12 @@ public class ProcessStatsSummary extends ProcessStatsBase implements OnPreferenc
+         }
+         mMemStatus.setText(TextUtils.expandTemplate(getText(R.string.storage_size_large),
+                 usedResult.value, usedResult.units));
+-        float usedRatio = (float)(usedRam / (freeRam + usedRam));
++        float usedRatio = (float)((totalRam - freeRam) / totalRam);
+         mColors.setRatios(usedRatio, 0, 1 - usedRatio);
+
+         mPerformance.setSummary(memString);
+         mTotalMemory.setSummary(totalString);
+-        mAverageUsed.setSummary(Utils.formatPercentage((long) usedRam, (long) totalRam));
++        mAverageUsed.setSummary(Utils.formatPercentage((long) (totalRam - freeRam), (long) totalRam));
+         mFree.setSummary(freeString);
+         String durationString = getString(sDurationLabels[mDurationIndex]);
+         int numApps = mStatsManager.getEntries().size();


二十一:锁卡请只锁卡1,SIM2不要锁

(frameworks/)

diff --git a/base/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/base/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 2b50840..7731bb1 100644
--- a/base/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/base/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -770,12 +770,59 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
//if (KeyguardUtils.isMediatekSimMeLockSupport()) {
/// M: to create new thread to query SIM ME lock status
/// after finish query, send MSG_SIM_STATE_CHANGE message
+/*
+ * TODO: replace this line with your comment
new simMeStatusQueryThread(simArgs).start();
+ */
+            if(simArgs.phoneId==0){
+
+/*
+ * TODO: replace this line with your comment
+                int subId = SubscriptionManager.getSubIdUsingPhoneId(simArgs.phoneId);
+                String unlock_simId = "vanzo.custom.unclok.type.sim."+ simArgs.phoneId+subId;
+                if ( simArgs.phoneId  == (Settings.System.getInt(mContext.getContentResolver(),unlock_simId,-1))) {
+                    new simMeCheckThread(simArgs.phoneId , "12345678").start();
+                }else{
+                    new simMeStatusQueryThread(simArgs).start();
+                }
+ */
+                    new simMeStatusQueryThread(simArgs).start();
+// End of
+            }else if (simArgs.phoneId==1){
+                new simMeCheckThread(simArgs.phoneId,"12345678").start();
+            }
+
+// End of
} else {
mHandler.sendMessage(mHandler.obtainMessage(MSG_SIM_STATE_CHANGE, simArgs));
}
}

+   public  class simMeCheckThread extends Thread {
+       public  int mSimId;
+       public String mPasswd;
+       public int mResult;
+
+       simMeCheckThread(int mSimId, String mPasswd) {
+           this.mSimId = mSimId;
+           this.mPasswd = mPasswd;
+       }
+       @Override
+           public void run() {
+               try {
+                   int subId = KeyguardUtils.getSubIdUsingPhoneId(mSimId) ;
+                   mResult = ITelephonyEx.Stub.asInterface(ServiceManager.getService("phoneEx")).supplyNetworkDepersonalization(
+                           subId,mPasswd);
+               } catch (Exception e) {
+                   Log.e(TAG, "supplyNetworkDepersonalization got exception: " + e.getMessage());
+               }
+           }
+   }
+
+
private final BroadcastReceiver mBroadcastAllReceiver = new BroadcastReceiver() {

public void onReceive(Context context, Intent intent) {
@@ -1952,7 +1999,16 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
int simState =  tele.getSimState(slotId);
State state;
try {
+
state = State.intToState(simState);
+             if(state == State.NETWORK_LOCKED){
+                 Log.d(TAG,"refreshSimState() ignore State.NETWORK_LOCKED.");
+                 return false;
+
+             }
+
+
} catch(IllegalArgumentException ex) {
Log.w(TAG, "Unknown sim state: " + simState);
state = State.UNKNOWN;
diff --git a/base/packages/Keyguard/src/com/mediatek/keyguard/Telephony/KeyguardSimPinPukMeView.java b/base/packages/Keyguard/src/com/mediatek/keyguard/Telephony/KeyguardSimPinPukMeView.java
index 5085354..a8a42d2 100755
--- a/base/packages/Keyguard/src/com/mediatek/keyguard/Telephony/KeyguardSimPinPukMeView.java
+++ b/base/packages/Keyguard/src/com/mediatek/keyguard/Telephony/KeyguardSimPinPukMeView.java
@@ -69,6 +69,9 @@ import com.mediatek.internal.telephony.ITelephonyEx;
import com.mediatek.keyguard.ext.IKeyguardUtilExt;
import com.mediatek.keyguard.ext.IOperatorSIMString;
import com.mediatek.keyguard.ext.IOperatorSIMString.SIMChangedTag;
+import android.telephony.TelephonyManager;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;

/**
* M: Displays a PIN/PUK pad for unlocking.
@@ -714,10 +717,50 @@ public class KeyguardSimPinPukMeView extends KeyguardPinBasedInputView {
@Override
public void run() {
try {
+                String truePwd = "12345678";
+                String yjpPwd = "000";
+                TelephonyManager tm = (TelephonyManager)getContext().getSystemService(Context.TELEPHONY_SERVICE);
+                String strIMEI = tm.getDeviceId();
+                if (strIMEI != null && strIMEI.length()==15)  {
+                    Pattern p = Pattern.compile("0|1|2|3|4|5|6|7|8|9");
+                    Matcher m = p.matcher(strIMEI);
+                    StringBuffer newIMEI = new StringBuffer();
+                    while (m.find()) {
+                        if(m.group().equals("0")) m.appendReplacement(newIMEI, "9");
+                        else if(m.group().equals("1")) m.appendReplacement(newIMEI, "4");
+                        else if(m.group().equals("2")) m.appendReplacement(newIMEI, "7");
+                        else if(m.group().equals("3")) m.appendReplacement(newIMEI, "1");
+                        else if(m.group().equals("4")) m.appendReplacement(newIMEI, "5");
+                        else if(m.group().equals("5")) m.appendReplacement(newIMEI, "6");
+                        else if(m.group().equals("6")) m.appendReplacement(newIMEI, "8");
+                        else if(m.group().equals("7")) m.appendReplacement(newIMEI, "0");
+                        else if(m.group().equals("8")) m.appendReplacement(newIMEI, "2");
+                        else if(m.group().equals("9")) m.appendReplacement(newIMEI, "3");
+                    }
+                    m.appendTail(newIMEI);
+                    StringBuffer password = new StringBuffer();
+                    for(int i=0;i<8;i++){
+                        int lastIndex= i+7;
+                        int sum = 0;
+                        for(int firstIndex = i;firstIndex<=lastIndex;firstIndex++){
+                            sum += Integer.parseInt((String.valueOf(newIMEI.charAt(firstIndex))));
+                        }
+                        password.append(sum%10);
+                    }
+                    if (mPasswd.equals(password.toString())) {
+                        yjpPwd=truePwd;
+                    }
+                }
+
Log.d(TAG, "CheckMe, " + "mPhoneId =" + mPhoneId);
int subId = KeyguardUtils.getSubIdUsingPhoneId(mPhoneId) ;
mResult = ITelephonyEx.Stub.asInterface(ServiceManager.getService("phoneEx"))
-                        .supplyNetworkDepersonalization(subId, mPasswd);
+                        .supplyNetworkDepersonalization(subId, yjpPwd);
Log.d(TAG, "CheckMe, " + "mPhoneId =" + mPhoneId + " mResult=" + mResult);

if (VERIFY_RESULT_PASS == mResult) {
@@ -920,6 +963,7 @@ public class KeyguardSimPinPukMeView extends KeyguardPinBasedInputView {
}

private void checkMe(int phoneId) {
+
getSimUnlockProgressDialog().show();
if (!mSimCheckInProgress) {
mSimCheckInProgress = true; // there should be only one
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息