一:相机连拍声音要比成像速度快
(vendor/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/util/CaptureSound.java)
diff --git a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/util/CaptureSound.java b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/util/CaptureSound.java
index da3f719..eda174c 100755
--- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/util/CaptureSound.java
+++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/util/CaptureSound.java
@@ -73,12 +73,13 @@ public class CaptureSound {
// force load if user don't call load before play.
load();
}
- mStreamId = mBurstSound.play(mSoundId, 1.0f, 1.0f, 1, -1, 1.0f);
+ mStreamId = mBurstSound.play(mSoundId, 1.0f, 1.0f, 1, -1, 0.5f);
if (mStreamId == 0) {
// play failed,load and play again.
load();
mUserCount--;
- mStreamId = mBurstSound.play(mSoundId, 1.0f, 1.0f, 1, -1, 1.0f);
+ mStreamId = mBurstSound.play(mSoundId, 1.0f, 1.0f, 1, -1, 0.5f);
Log.i(TAG, "[play]done mStreamId = " + mStreamId);
}
}
二:禁用USSD
(framworks/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java)
+diff --git a/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
+index 621aab7..cafaccb 100644
+--- a/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
++++ b/opt/telephony/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
+@@ -765,12 +765,12 @@ public final class GsmMmiCode extends Handler implements MmiCode {
+ static private boolean isShortCodeUSSD(String dialString, GSMPhone phone) {
+ if (dialString != null && dialString.length() <= MAX_LENGTH_SHORT_CODE) {
+ if (phone.isInCall()) {
+- return true;
++ return false;
+ }
+
+ if (dialString.length() != MAX_LENGTH_SHORT_CODE ||
+ dialString.charAt(0) != '1') {
+- return true;
++ return false;
+ }
+ }
+ return false;
三:桌面添加联系人小部件,点击拨号,提示需要开启权限
(frameworks/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java)
diff --git a/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java b/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
index 73418b0..94c94ff 100644
--- a/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
+++ b/base/services/core/java/com/android/server/pm/DefaultPermissionGrantPolicy.java
@@ -259,6 +259,10 @@ final class DefaultPermissionGrantPolicy {
syncAdapterPackagesProvider.getPackages(CalendarContract.AUTHORITY, userId) : null;
synchronized (mService.mPackages) {
+ PackageParser.Package launcherPackage = getSystemPackageLPr("com.android.launcher3");
+ if (launcherPackage != null) {
+ grantRuntimePermissionsLPw(launcherPackage, PHONE_PERMISSIONS, true, userId);
+ }
// Installer
PackageParser.Package installerPackage = getSystemPackageLPr(
mService.mRequiredInstallerPackage);
四:状态栏显示信号旁的网络标志
(frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/SignalClusterView.java)
boolean anyMobileVisible = false;
/// M: Support for [Network Type on Statusbar]
/// A spacer is set between networktype and WIFI icon @ {
+ if (能进去就是允许显示) {
anyMobileVisible = true;
+ }
/// @ }
int firstMobileTypeId = 0;
private void setNetworkIcon() {
// Network type is CTA feature, so non CTA project should not set this.
+ if (不能进去就是允许显示) {
+ return;
+ }
if (mNetworkIcon == 0) {
mNetworkType.setVisibility(View.GONE);
} else {
mNetworkType.setImageResource(mNetworkIcon);
mNetworkType.setVisibility(View.VISIBLE);
}
}
五:插入漫游4G卡,进入浏览器输入网址正常工作时,状态栏图标需要做成附图显示
(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/layout/mobile_signal_group.xml b/base/packages/SystemUI/res/layout/mobile_signal_group.xml
index 1882b65..d3be767 100644
--- a/base/packages/SystemUI/res/layout/mobile_signal_group.xml
+++ b/base/packages/SystemUI/res/layout/mobile_signal_group.xml
@@ -39,11 +39,22 @@
android:alpha="0.0"
systemui:hasOverlappingRendering="false"
/>
-
+ >
+
+
+
六:可以发送只有空格的短信
(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..d2e4dd7 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
@@ -811,6 +811,7 @@ public class WorkingMessage implements IWorkingMessageCallback {
/// M: fix bug ALPS00956551, need clear mText when add attachment twice
if (hasSlideshow()) {
mText = "";
+ mText = " ";
}
mAttachmentType = TEXT;
/// M: fix bug ALPS02141556 @{
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..ed733b7 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
@@ -101,10 +101,12 @@ public class SmsMessageSender implements MessageSender {
private boolean queueMessage(long token) throws MmsException {
/// M:
MmsLog.v(MmsApp.TXN_TAG, "queueMessage()");
+ /*
if ((mMessageText == null) || mMessageText.isEmpty() || (mNumberOfDests == 0)) {
// Don't try to send an empty message.
throw new MmsException("Null message body or dest.");
}
+ */
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
boolean requestDeliveryReport = prefs.getBoolean(mSubId + "_" + SmsPreferenceActivity.SMS_DELIVERY_REPORT_MODE,
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..3f0818c 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
@@ -4397,6 +4397,7 @@ public class ComposeMessageActivity extends Activity
private void unpreparedForSendingAlert() {
if (!isHasRecipientCount()) {
+ /*
new AlertDialog.Builder(this).setIconAttribute(
android.R.attr.alertDialogIcon).setTitle(
R.string.cannot_send_message).setMessage(
@@ -4409,6 +4410,12 @@ public class ComposeMessageActivity extends Activity
R.string.cannot_send_message_reason_no_content)
.setPositiveButton(R.string.yes,
new CancelSendingListener()).show();
+ */
+ mWorkingMessage.setText(" ");
+ mAttachmentEditor.onTextChangeForOneSlide();
+ updateSendButtonState(false);
+ checkRecipientsCount();
+ mUiHandler.sendEmptyMessageDelayed(MSG_RESUME_SEND_BUTTON, RESUME_BUTTON_INTERVAL);
}
}
@@ -4611,8 +4618,7 @@ public class ComposeMessageActivity extends Activity
hideButton = mSendButtonSms;
} else {
if (!mIpCompose.onIpShowSmsOrMmsSendButton(isMms)) {
- if ((mTextEditor.getText().toString().isEmpty())
- || mSubCount == 0
+ if (mSubCount == 0
|| (isRecipientsEditorVisible() && TextUtils.isEmpty(mRecipientsEditor.getText()))
|| recipientCount() > MmsConfig.getSmsRecipientLimit()
|| !mIsSmsEnabled) {
@@ -7292,7 +7298,7 @@ public class ComposeMessageActivity extends Activity
}
public void updateSendButtonState() {
- boolean enable = false;
+ boolean enable = true;
MmsLog.v(TAG, "lzd updateSendButtonState(): isPreparedForSending = " + isPreparedForSending());
if (isPreparedForSending()) {
/// M: Code analyze 049, Update send button or attachment editor state.@{
七:工厂测试模式里面按键测试按menu键会退出
(frameworks/)
diff --git a/base/policy/src/com/android/internal/policy/impl/PhoneWindow.java b/base/policy/src/com/android/internal/policy/impl/PhoneWindow.java
index 681ac18..1ed170e 100644
--- a/base/policy/src/com/android/internal/policy/impl/PhoneWindow.java
+++ b/base/policy/src/com/android/internal/policy/impl/PhoneWindow.java
@@ -999,15 +999,25 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
public final boolean onKeyDownPanel(int featureId, KeyEvent event) {
final int keyCode = event.getKeyCode();
+ PanelFeatureState st = getPanelState(featureId, false);
if (event.getRepeatCount() == 0) {
// The panel key was pushed, so set the chording key
mPanelChordingKey = keyCode;
- PanelFeatureState st = getPanelState(featureId, false);
if (st != null && !st.isOpen) {
return preparePanel(st, event);
}
}
+/*
+ * TODO: replace this line with your comment
+ */
+ else if (event.getRepeatCount() > 0){
+ if(st != null && !st.isOpen){
+ openPanel(st, event);
+ android.util.Log.d("dapeng"," down show menu");
+ }
+ }
+// End of
return false;
}
diff --git a/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 297a8af..3a9048e 100644
--- a/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -2620,6 +2620,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
WindowManager.LayoutParams.TYPE_SYSTEM_ERROR,
};
+ private boolean isFactoryModeTop() {
+ ActivityManager activityManager = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
+ String runningActivity = activityManager.getRunningTasks(1).get(0).topActivity.getPackageName();
+ return runningActivity.equals("com.mediatek.factorymode");
+ }
+
+
/** {@inheritDoc} */
@Override
public long interceptKeyBeforeDispatching(WindowState win, KeyEvent event, int policyFlags) {
@@ -2770,10 +2777,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
}
return -1;
- } else if (keyCode == KeyEvent.KEYCODE_MENU) {
+ } else if (keyCode == KeyEvent.KEYCODE_MENU && !isFactoryModeTop()) {
// Hijack modified menu keys for debugging features
final int chordBug = KeyEvent.META_SHIFT_ON;
+/*
+ * TODO: replace this line with your comment
+ *
if (down && repeatCount == 0) {
if (mEnableShiftMenuBugReports && (metaState & chordBug) == chordBug) {
Intent intent = new Intent(Intent.ACTION_BUG_REPORT);
@@ -2796,7 +2806,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
res, Settings.Global.SHOW_PROCESSES, shown ? 0 : 1);
return -1;
}
+ }*/
+ if (!keyguardOn) {
+ if (down && repeatCount == 0) {
+ preloadRecentApps();
+ } else if (!down) {
+ toggleRecentApps();
+ }
+ return -1;
}
+// End of
} else if (keyCode == KeyEvent.KEYCODE_SEARCH) {
if (down) {
if (repeatCount == 0) {
八:mccmnc为"74602"的apn不允许被编辑
(packages/apps/Settings/src/com/android/settings/ApnSettings.java)
diff --git a/src/com/android/settings/ApnSettings.java b/src/com/android/settings/ApnSettings.java
index 2d05d5c..40df438 100644
--- a/src/com/android/settings/ApnSettings.java
+++ b/src/com/android/settings/ApnSettings.java
@@ -320,6 +320,10 @@ public class ApnSettings extends SettingsPreferenceFragment implements
pref.setOnPreferenceChangeListener(this);
pref.setApnEditable(mExt.isAllowEditPresetApn(type, apn, mccmnc, sourcetype));
+ pref.setApnEditable(true);
+ if (sourcetype == 0 && "74602".equals(mccmnc)) {
+ pref.setApnEditable(false);
+ }
pref.setSubId(mSubscriptionInfo.getSubscriptionId());
/// M: All tether apn will be selectable for otthers , mms will not be selectable.
九:SIM卡解锁界面要有“忽略”解锁键 进入桌面
(frameworks/base/packages/Keyguard/res/layout/mtk_keyguard_sim_pin_puk_me_view.xml)
+diff --git a/base/packages/Keyguard/res/layout/mtk_keyguard_sim_pin_puk_me_view.xml b/base/packages/Keyguard/res/layout/mtk_keyguard_sim_pin_puk_me_view.xml
+index 0284046..a18b582 100755
+--- a/base/packages/Keyguard/res/layout/mtk_keyguard_sim_pin_puk_me_view.xml
++++ b/base/packages/Keyguard/res/layout/mtk_keyguard_sim_pin_puk_me_view.xml
+@@ -214,7 +214,6 @@
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="@drawable/ripple_drawable"
+- android:visibility="invisible"
+ />
+
+
十:增加一个公共解锁指令*#1108#,开机后按*#1108#解锁,再按*#1109#可以锁卡,恢复出厂设置后要求有锁卡功能,不能影响正常的解锁方式
(packages/apps/Dialer/src/com/android/dialer/SpecialCharSequenceMgr.java)
+diff --git a/src/com/android/dialer/SpecialCharSequenceMgr.java b/src/com/android/dialer/SpecialCharSequenceMgr.java
+index 14cb0c7..c8f2122 100755
+--- a/src/com/android/dialer/SpecialCharSequenceMgr.java
++++ b/src/com/android/dialer/SpecialCharSequenceMgr.java
+@@ -154,6 +154,7 @@ public class SpecialCharSequenceMgr {
+ /*
+ * add custom engineer code
+ */
++ || handleNPCode(context, dialString)
+ || handleEngineerCode(context, dialString)
+ || handleSarCode(context,dialString)
+ // End of
+@@ -300,6 +301,21 @@ public class SpecialCharSequenceMgr {
+ }
+ // End of
+
++ static boolean handleNPCode(Context context, String input) {
++ if (input.equals("*#1108#")) {
++ Intent intent = new Intent("com.mediatek.simmelock.MODIFY_NP");
++ intent.putExtra("state", "close");
++ context.sendBroadcast(intent);
++ return true;
++ } else if (input.equals("*#1109#")) {
++ Intent intent = new Intent("com.mediatek.simmelock.MODIFY_NP");
++ intent.putExtra("state", "open");
++ context.sendBroadcast(intent);
++ return true;
++ }
++ return false;
++ }
++
+ /*
+ * add change language code
+ */
(vendor/)
diff --git a/mediatek/proprietary/packages/apps/SimLock/Android.mk b/mediatek/proprietary/packages/apps/SimLock/Android.mk
index 69d7236..74186e9 100755
--- a/mediatek/proprietary/packages/apps/SimLock/Android.mk
+++ b/mediatek/proprietary/packages/apps/SimLock/Android.mk
@@ -32,7 +32,6 @@
# have been modified by MediaTek Inc. All revisions are subject to any receiver's
# applicable license agreements with MediaTek Inc.
-ifeq ($(MTK_INTERNAL), yes)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
@@ -50,5 +49,4 @@ include $(BUILD_PACKAGE)
# Use the folloing include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))
-endif
diff --git a/mediatek/proprietary/packages/apps/SimLock/AndroidManifest.xml b/mediatek/proprietary/packages/apps/SimLock/AndroidManifest.xml
index 71f2059..3fa023d 100644
--- a/mediatek/proprietary/packages/apps/SimLock/AndroidManifest.xml
+++ b/mediatek/proprietary/packages/apps/SimLock/AndroidManifest.xml
@@ -164,5 +164,12 @@
+
+
+
+
+
+
diff --git a/mediatek/proprietary/packages/apps/SimLock/src/com/mediatek/simmelock/ModifyNP.java b/mediatek/proprietary/packages/apps/SimLock/src/com/mediatek/simmelock/ModifyNP.java
new file mode 100644
index 0000000..6db4759
--- /dev/null
+++ b/mediatek/proprietary/packages/apps/SimLock/src/com/mediatek/simmelock/ModifyNP.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.mediatek.simmelock;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+//chengrongqiang start
+import com.android.internal.telephony.Phone;
+//import com.android.internal.telephony.gemini.GeminiPhone;
+import com.android.internal.telephony.PhoneFactory;
+import android.util.Log;
+import android.os.Handler;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.os.Message;
+import android.os.AsyncResult;
+import android.widget.Toast;
+import com.android.internal.telephony.PhoneConstants;
+//end
+
+
+/*
+ * Handles OTA Start procedure at phone power up. At phone power up, if phone is not OTA
+ * provisioned (check MIN value of the Phone) and 'device_provisioned' is not set,
+ * OTA Activation screen is shown that helps user activate the phone
+ */
+public class ModifyNP extends BroadcastReceiver {
+ //private GeminiPhone mPhone = null;
+ private Phone currentPhoneEx;
+ private final int EVENT_MODIFY_NP = 1;
+ private Context mContext;
+
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ mContext = context;
+ String subStr = intent.getStringExtra("state");
+
+ String imeiString[] = { "AT+CLOSENP=1,", "" };
+
+ if(subStr.equals("close")){
+ imeiString[0] = "AT+ESMLCK=0,0,\"12345678\"";
+ }else{
+ imeiString[0] = "AT+ESMLCK=0,1,\"12345678\"";
+ }
+ imeiString[1] = "ESMLCK";
+ Log.e("chengrongqiang","imeiString[0]"+imeiString[0]);
+
+ if(currentPhoneEx == null)
+ {
+ PhoneFactory.makeDefaultPhones(context);
+ //mPhone = (GeminiPhone)PhoneFactory.getDefaultPhone();
+ currentPhoneEx = PhoneFactory.getDefaultPhone();
+ }
+ currentPhoneEx.invokeOemRilRequestStrings(imeiString, mResponseHander.obtainMessage(EVENT_MODIFY_NP));
+
+
+ /* for(int i=0;i<5000;i++)
+ {}
+ mPhone.invokeOemRilRequestStringsGemini(imeiString,
+ mResponseHander.obtainMessage(EVENT_MODIFY_NP), PhoneConstants.GEMINI_SIM_2);*/
+ }
+ private Handler mResponseHander = new Handler() {
+ @Override
+ public void handleMessage(Message msg) {
+ AsyncResult ar;
+ switch (msg.what) {
+ case EVENT_MODIFY_NP:
+ ar = (AsyncResult) msg.obj;
+ if (ar.exception == null) {
+ Toast.makeText(mContext,"successfully.",Toast.LENGTH_SHORT).show();
+ } else {
+ Toast.makeText(mContext,"Fail",Toast.LENGTH_SHORT).show();
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ };
+}
十一:解锁码: IMEI后8位*7,取后8位数字
(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..50a51cb 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.
+@@ -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="";
++ if (strIMEI != null) {
++ String part = strIMEI.substring(strIMEI.length() - 8, strIMEI.length());
++ int iPart = Integer.parseInt(part) * 7;
++ 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)) {
++ 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) {
十二:闹钟不能设置当天的时间
(packages/apps/DeskClock/)
diff --git a/src/com/android/deskclock/AlarmClockFragment.java b/src/com/android/deskclock/AlarmClockFragment.java
index d35f632..4b33044 100644
--- a/src/com/android/deskclock/AlarmClockFragment.java
+++ b/src/com/android/deskclock/AlarmClockFragment.java
@@ -1049,6 +1049,13 @@ public abstract class AlarmClockFragment extends DeskClockFragment implements
updateDaysOfWeekButtons(itemHolder, alarm.daysOfWeek);
for (int i = 0; i < 7; i++) {
final int buttonIndex = i;
+/*
+ * update alarm buttons update
+ */
+ final int firstDay = Utils.getZeroIndexedFirstDayOfWeek(mContext);
+ itemHolder.dayButtons[i].setText(Utils.getShortWeekday(i, firstDay));
+ itemHolder.dayButtons[i].setContentDescription(Utils.getLongWeekday(i, firstDay));
+// End of
itemHolder.dayButtons[i].setOnClickListener(new View.OnClickListener() {
@Override
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 51e376d..de96add 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -122,6 +122,10 @@
- "Domingo"
- "Lunes"
+
+ - "Domingo"
+ - "Lunes"
+
"Listo"
"Revertir"
"Eliminar"
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index 753513a..97ad6dc 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -122,6 +122,10 @@
- "Domingo"
- "Lunes"
+
+ - "Domingo"
+ - "Lunes"
+
"Listo"
"Revertir"
"Eliminar"
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 03c00f9..c057de3 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -122,6 +122,10 @@
- "星期日"
- "星期一"
+
+ - "星期日"
+ - "星期一"
+
"完成"
"还原"
"删除闹钟"
diff --git a/res/values-zh-rHK/strings.xml b/res/values-zh-rHK/strings.xml
index a9d75f6..809031d 100644
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -122,6 +122,10 @@
- "星期日"
- "星期一"
+
+ - "星期日"
+ - "星期一"
+
"完成"
"復原"
"刪除"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 48044f1..73dca77 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -294,6 +294,11 @@
- Monday
+
+ - Sunday
+ - Monday
+
+
- 7
@@ -301,6 +306,11 @@
- 2
+
+ - 1
+ - 2
+
+
Done
diff --git a/res/xml/settings.xml b/res/xml/settings.xml
index 88cf3cd..b722c12 100644
--- a/res/xml/settings.xml
+++ b/res/xml/settings.xml
@@ -68,7 +68,7 @@
android:key="week_start"
android:title="@string/week_start_title"
android:dialogTitle="@string/week_start_title"
- android:entries="@array/week_start_entries"
- android:entryValues="@array/week_start_values" />
+ android:entries="@array/week_start_entries2"
+ android:entryValues="@array/week_start_values2" />
diff --git a/src/com/android/deskclock/Utils.java b/src/com/android/deskclock/Utils.java
index a4dea53..0a60284 100755
--- a/src/com/android/deskclock/Utils.java
+++ b/src/com/android/deskclock/Utils.java
@@ -97,7 +97,7 @@ public class Utils {
private static String[] sLongWeekdays = null;
private static final String DATE_FORMAT_LONG = "EEEE";
- public static final int DEFAULT_WEEK_START = Calendar.getInstance().getFirstDayOfWeek();
+ public static final int DEFAULT_WEEK_START = 2;
private static Locale sLocaleUsedForWeekdays;
十三:当使用mccmnc是
73009
和73007的sim卡时,隐藏漫游图标,并默认启用漫游数据选项
(packages/services/)
diff --git a/Telephony/AndroidManifest.xml b/Telephony/AndroidManifest.xml
index aaa35e8..a3026c4 100644
--- a/Telephony/AndroidManifest.xml
+++ b/Telephony/AndroidManifest.xml
@@ -780,6 +780,11 @@
+
+
+
+
+
十七:内置视频
在system/etc下有一份tree不出来的文件,进到system/etc目录,然后ll一下,会有一份.keeplist文件,进入并修改为
/system/media/~~~.mp4 /data/media/Movies/~~~.mp4
/system/media/~~~.mp4 /data/media/Movies/~~~.mp4
/system/media/~~~.mp4 /data/media/Movies/~~~.mp4
在system/media中放入mp4资源
在资源配置清单packages.xml中
(bootable/)
diff --git a/recovery/recovery.cpp b/recovery/recovery.cpp
index 40e7660..401e396 100644
--- a/recovery/recovery.cpp
+++ b/recovery/recovery.cpp
@@ -61,6 +61,14 @@
#include "mt_recovery.h"
#include "mt_partition.h"
+/*
+ * added for define
+ */
+#define MAX_SIZE 512
+#define KEEP_LIST_FILE "/system/etc/.keeplist"
+#define DATA_MEDIA_DIR "/data/media"
+//
+
/*
*/
//adupsfota start
@@ -466,6 +474,213 @@ finish_recovery(const char *send_intent) {
sync(); // For good measure.
}
+/*
+ * added for media file to restore
+ */
+
+/*added by wf*/
+void ltrim(char *s)
+{
+ int l=0,p=0,k=0;
+ l = strlen(s);
+ if( l == 0 ) return;
+ p = 0;
+ while(isspace(s[p])) p++;
+ if( p == 0 ) return;
+ while( s[k] != '\0') s[k++] = s[p++];
+ return;
+}
+
+void rtrim(char *s)
+{
+ int l=0,p=0;
+ l = strlen(s);
+ if( l == 0 ) return;
+ p = l -1;
+ while( isspace(s[p]) ) {
+ s[p--] = '\0';
+ if( p < 0 ) break;
+ }
+ return;
+}
+
+void trim(char *vspStr)
+{
+ if(!vspStr){
+ return ;
+ }
+ ltrim(vspStr);
+ rtrim(vspStr);
+}
+char *get_dir_name(char *dir)
+{
+ char work[MAX_SIZE]={0};
+ strcpy(work,dir);
+ char *p=strrchr(work,'/');
+ if(p){
+ p++;
+ if(*p){
+ *p=0;
+ LOGE("in gdn the work is %s\n",work);
+ return strdup(work);
+ }
+ LOGE("the last is /,so return the whole str\n");
+ return strdup(work);
+
+ }
+ return NULL;
+
+}
+int mkdir_p(const char *sPathName)
+{
+ char DirName[MAX_SIZE]={0};
+ int i,len;
+
+ if(!sPathName){
+ LOGE("sPathName is null in mp\n");
+ return -1;
+ }
+ LOGE("enter mp path is %s\n",sPathName);
+ if (!access(sPathName, R_OK)) {
+ LOGE("already exist in mp\n");
+ return 0;
+ }
+
+ strcpy(DirName, sPathName);
+ len = strlen(DirName);
+ if (DirName[len - 1] != '/') {
+ strcat(DirName, "/");
+ }
+ len = strlen(DirName);
+
+ for (i=1; i 0) {
+ write(out_fd, buf, n_chars);
+ }
+ close(out_fd);
+ }else{
+ LOGE("open dst %s error:%s\n",szDest,strerror(errno));
+ close(in_fd);
+ return -1;
+ }
+ close(in_fd);
+ return 0;
+ }else{
+ return -1;
+ }
+
+}
+
+/*above is added by wf*/
+static void restore_files()
+{
+ /*here to read keep list and recovery*/
+ LOGE("wyl enter restore_files\n");
+ int ret = ensure_path_mounted(KEEP_LIST_FILE);
+ if(ret == 0){
+ ret = ensure_path_mounted(DATA_MEDIA_DIR);
+ if(ret != 0){
+ LOGE("wyl mount data error\n");
+ return;
+ }
+ LOGE("wyl ensure_path_mounted success\n");
+ FILE *fp = fopen_path(KEEP_LIST_FILE, "r");
+ if (fp == NULL) {
+ LOGE("Can't open %s\n", KEEP_LIST_FILE);
+ } else {
+ LOGE("open %s success\n",KEEP_LIST_FILE);
+ char buffer[MAX_SIZE]={0};
+ while(fgets(buffer,MAX_SIZE-1,fp) != NULL){
+ trim(buffer);
+ char *p=strstr(buffer," ");
+ *p=0;
+ char *src=buffer;
+ p++;
+ char *dst=p;
+ trim(src);
+ trim(dst);
+ if(copy_one_file(src,dst) != 0){
+ LOGE("wyl copy_one_file %s to %s failed\n",src,dst);
+ }else{
+ LOGE("wyl copy_one_file %s to %s success\n",src,dst);
+ if(chown(dst,1023,1023) == -1){
+ LOGE("chown %s to 1023 error\n",dst);
+ }
+ if(chmod(dst,0644) == -1){
+ LOGE("chmod %s 644 error\n",dst);
+ }
+ }
+ }
+ fclose(fp);
+ }
+ }else{
+ LOGE("wyl ensure_path_mounted failed\n");
+ }
+ sync();
+}
+//
typedef struct _saved_log_file {
char* name;
struct stat st;
@@ -557,7 +772,15 @@ bool erase_volume(const char* volume) {
tmplog_offset = 0;
copy_logs();
}
-
+/*
+ * if data restore the media data
+ */
+ bool is_data = (strcmp(volume, "/data") == 0);
+ LOGE("in erase_volume wyl is_data is %d\n",is_data);
+ if(is_data){
+ restore_files();
+ }
+//
return (result == 0);
}
(external/)
diff --git a/sepolicy/recovery.te b/sepolicy/recovery.te
index cbea70e..d052d3a 100644
--- a/sepolicy/recovery.te
+++ b/sepolicy/recovery.te
@@ -58,6 +58,11 @@ recovery_only(`
access_kmsg(recovery)
+
+ allow recovery media_rw_data_file:dir create_dir_perms;
+ allow recovery media_rw_data_file:file create_file_perms;
+ allow recovery media_rw_data_file:file { getattr read write };
+
# Access /dev/android_adb or /dev/usb-ffs/adb/ep0
allow recovery adb_device:chr_file rw_file_perms;
allow recovery functionfs:dir search;
(build/)
diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py
index aa5e8d0..116950f 100755
--- a/tools/releasetools/add_img_to_target_files.py
+++ b/tools/releasetools/add_img_to_target_files.py
@@ -327,7 +327,6 @@ def AddImagesToTargetFiles(filename):
banner("custom")
AddCustom(output_zip)
banner("userdata")
- AddUserdata(output_zip)
banner("cache")
AddCache(output_zip)