一:去除摄像头的假对焦框
(vendor/)
(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/FocusManager.java)
import java.util.ArrayList;
import java.util.List;
+import com.android.camera.ui.FocusIndicatorRotateLayout.Listener;
/**
* A class that handles everything about focus in still picture mode. This also handles the metering
@@ -56,7 +57,7 @@ import java.util.List;
* Touch the screen to change metering area.
*/
public class FocusManager implements CameraActivity.OnOrientationListener,
- CameraActivity.OnParametersReadyListener {
+ CameraActivity.OnParametersReadyListener,FocusIndicatorRotateLayout.Listener {
private static final String TAG = "FocusManager";
private static final int RESET_TOUCH_FOCUS = 0;
@@ -86,6 +87,11 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
private Matrix mMatrix;
private Matrix mObjextMatrix;
+ private boolean mNeedPlaySound = false;
// The parent layout that includes only the focus indicator.
private FocusIndicatorRotateLayout mFocusIndicatorRotateLayout;
// The focus indicator view that holds the image resource.
@@ -228,6 +234,14 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
mParameters = parameters;
mFocusAreaSupported = (mParameters.getMaxNumFocusAreas() > 0 && isSupported(
Parameters.FOCUS_MODE_AUTO, mParameters.getSupportedFocusModes()));
+ if (mFocusIndicatorRotateLayout != null) {
+ mFocusIndicatorRotateLayout.mCustomFocusSupported = mFocusAreaSupported;
+ mFocusIndicatorRotateLayout.setCustomListener(this);
+ }
// mLockAeAwbNeeded = (mInitialParameters.isAutoExposureLockSupported()
// ||
// mInitialParameters.isAutoWhiteBalanceLockSupported());
@@ -427,9 +441,23 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
}
mListener.setFocusParameters();
if (moving) {
+ if (!mFocusAreaSupported) {
+ Log.e("vanzo","mNeedPlaySound-->false");
+ mNeedPlaySound = false;
+ }
mFocusIndicatorRotateLayout.showStart();
} else {
+/*
mFocusIndicatorRotateLayout.showSuccess(true);
+ */
+ if (mFocusAreaSupported)
+ mFocusIndicatorRotateLayout.showSuccess(true);
}
}
@@ -453,7 +481,11 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
// Check if metering area or focus area is supported.
if (!mFocusAreaSupported) {
Log.i(TAG, "[onSingleTapUp] mFocusAreaSupported is false");
+ // return;
}
if (!mInitialized || mState == STATE_FOCUSING_SNAP_ON_FINISH || mState == STATE_UNKNOWN) {
return;
@@ -528,6 +560,14 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
// it can't be called twice when focusing.
mListener.stopFaceDetection();
+ if (!mFocusAreaSupported) {
+ Log.e("vanzo","mNeedPlaySound-->true");
+ mNeedPlaySound = true;
+ }
// Set the focus area and metering area.
mListener.setFocusParameters();
Log.i(TAG, "onSingleTapUp, mFocusAreaSupported " + mFocusAreaSupported);
@@ -573,7 +613,13 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
getFrameview().resume();
}
mState = STATE_IDLE;
+/*
updateFocusUI();
+ */
+ if (mFocusAreaSupported)
+ updateFocusUI();
+// End of Vanzo:tangshenghu
mHandler.removeMessages(RESET_TOUCH_FOCUS);
}
@@ -968,4 +1014,13 @@ public class FocusManager implements CameraActivity.OnOrientationListener,
return isSupported;
}
+ @Override
+ public void playFocusSound() {
+ if (mListener != null && mNeedPlaySound)
+ mListener.playSound(MediaActionSound.FOCUS_COMPLETE);
+ }
}
(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/actor/PhotoActor.java)
// The next steps will be excuted only at the first time.
mCameraActivity.getFrameManager().initializeFrameView(false);
mIsInitialized = true;
+ mHandler.postDelayed(new Runnable() {
+ public void run() {
+ if(mCameraActivity==null||mCameraActivity.getParameters()==null){
+ return;
+ }
+ if (mCameraActivity.getParameters().getMaxNumFocusAreas() == 0)
+ mCameraActivity.getFocusManager().onAutoFocusMoving(true);
+ }
+ }, 1000);
}
private void startPreview(boolean needStop) {
@@ -983,7 +996,13 @@ public class PhotoActor extends CameraActor implements FocusManager.Listener,
if (mModuleManager.onSingleTapUp(view, x, y)) {
Log.i(TAG, "[onSingleTapUp] module manager has handled it,return.");
+ // return;
+ if (mCameraActivity.getCameraId() == 1)
+ return;
}
focusManager.onSingleTapUp(x, y);
(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/ui/FocusIndicatorRotateLayout.java)
private Runnable mDisappear = new Disappear();
private Runnable mEndAction = new EndAction();
+ private Runnable mShowAction = new ShowAction();
+ public boolean mCustomFocusSupported = true;
+ Listener mListener = null;
+ public interface Listener {
+ void playFocusSound();
+ }
private static final int SCALING_UP_TIME = 1000;
private static final int SCALING_DOWN_TIME = 200;
private static final int DISAPPEAR_TIMEOUT = 200;
@@ -100,8 +110,20 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd
Log.d(TAG, "showStart mState = " + mState);
if (mState == STATE_IDLE) {
setDrawable(R.drawable.ic_focus_focusing);
+/*
animate().withLayer().setDuration(SCALING_UP_TIME).scaleX(1.5f).scaleY(1.5f);
mState = STATE_FOCUSING;
+ */
+ if (mCustomFocusSupported) {
+ animate().withLayer().setDuration(SCALING_UP_TIME).scaleX(1.5f).scaleY(1.5f);
+ mState = STATE_FOCUSING;
+ } else {
+ mState = STATE_FOCUSING;
+ animate().withLayer().setDuration(SCALING_UP_TIME)
+ .scaleX(1.5f).scaleY(1.5f).withEndAction(mShowAction);
+ }
}
}
@@ -113,6 +135,12 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd
animate().withLayer().setDuration(SCALING_DOWN_TIME).scaleX(1f).scaleY(1f)
.withEndAction(timeout ? mEndAction : null);
mState = STATE_FINISHING;
+ if (!mCustomFocusSupported && mListener != null)
+ mListener.playFocusSound();
}
}
@@ -145,6 +173,17 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd
}
}
+ private class ShowAction implements Runnable {
+ @Override
+ public void run() {
+ // Keep the focus indicator for some time.
+ showSuccess(true);
+ }
+ }
private class Disappear implements Runnable {
@Override
public void run() {
@@ -175,4 +214,11 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd
}
return true;
}
+ public void setCustomListener(Listener listener) {
+ mListener = listener;
+ }
二:插卡开机时去掉通知栏中的读取sim卡联系人的提示消息
(packages/apps/Contacts/SimProcessor/src/com/mediatek/simprocessor/SimProcessorService.java)
ExtensionManager.registerApplicationContext(getApplication());
mProcessorManager = new SimProcessorManager(this, mListener);
+/*
Notification notification = new Notification(android.R.drawable.ic_dialog_alert,
ONGOING_NOTIFICATION, System.currentTimeMillis());
startForeground(ONGOING_NOTIFICATION_ID, notification);
+*/
}
@Override
@@ -100,7 +102,7 @@ public class SimProcessorService extends Service {
public void onDestroy() {
super.onDestroy();
Log.i(TAG, "[onDestroy]...");
- stopForeground(true);
+// stopForeground(true);
System.exit(0);
}
三:更换默认锁屏壁纸
(frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java)
diff --git a/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 9cf7063..d896704 100644
--- a/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -51,6 +51,7 @@ import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
+import android.graphics.Bitmap;
import android.inputmethodservice.InputMethodService;
import android.media.AudioAttributes;
import android.media.MediaMetadata;
@@ -176,6 +177,11 @@ import com.android.systemui.statusbar.stack.NotificationStackScrollLayout.OnChil
import com.android.systemui.statusbar.stack.StackStateAnimator;
import com.android.systemui.statusbar.stack.StackViewState;
import com.android.systemui.volume.VolumeComponent;
+import android.app.WallpaperManager;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import android.provider.Settings;
/// M: BMW
import com.mediatek.multiwindow.MultiWindowManager;
@@ -749,6 +755,28 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mScreenPinningRequest = new ScreenPinningRequest(mContext);
mFalsingManager = FalsingManager.getInstance(mContext);
+/*
+ * TODO: replace this line with your comment
+ */
+ if(Settings.System.getInt(mContext.getContentResolver(),"def_lock_wall_vanzo",0) != 1){
+ Settings.System.putInt(mContext.getContentResolver(),"def_lock_wall_vanzo" , 1);
+ WallpaperManager wallpaperManager = WallpaperManager.getInstance(mContext);
+ BitmapDrawable bitmapDrawable = (BitmapDrawable)mContext.getResources().getDrawable(R.drawable.default_lock_wallpaper);
+ Bitmap defaultLockWallpaper = bitmapDrawable.getBitmap();
+ ByteArrayOutputStream tmpOut = new ByteArrayOutputStream(2048);
+ if (defaultLockWallpaper.compress(Bitmap.CompressFormat.PNG, 100,tmpOut)) {
+ try {
+ byte[] outByteArray = tmpOut.toByteArray();
+ wallpaperManager.setStream(new ByteArrayInputStream(outByteArray),
+ null, true, WallpaperManager.FLAG_LOCK);
+ } catch (IOException e) {
+ Log.e(TAG, "IOException", e);
+ } catch (SecurityException e) {
+ Log.w(TAG, "SecurityException", e);
+ }
+ }
+ }
}
protected void createIconController() {
四:未接来电或未读短信没有显示未读数量
(packages/providers/)
(ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java)
diff --git a/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java b/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java
index 70c56d6..0916739 100644
--- a/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java
+++ b/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java
@@ -113,6 +113,15 @@ public class DbModifierWithNotification implements DatabaseModifier {
notifyCallLogChange();
}
+/*
+ * launcher show unread call
+ */
+ /** M: notify miss call & unread VVM count @{ */
+ if (rowId > 0) {
+ notifyNewCallsCount();
+ }
+
return rowId;
}
@@ -131,6 +140,15 @@ public class DbModifierWithNotification implements DatabaseModifier {
notifyCallLogChange();
}
+/*
+ * launcher show unread call
+ */
+ /** M: notify miss call & unread VVM count @{ */
+ if (rowId > 0) {
+ notifyNewCallsCount();
+ }
+
return rowId;
}
@@ -145,6 +163,17 @@ public class DbModifierWithNotification implements DatabaseModifier {
}
}
+/*
+ * launcher show unread call
+ */
+ /**
+ * M: notify launcher to display the count of missed call & VVM.
+ * */
+ private void notifyNewCallsCount() {
+ CallLogProviderEx.notifyNewCallsCount(mContext);
+ }
+
private void notifyVoicemailChangeOnInsert(Uri notificationUri, Set packagesModified) {
if (mIsCallsTable) {
notifyVoicemailChange(notificationUri, packagesModified,
@@ -183,6 +212,15 @@ public class DbModifierWithNotification implements DatabaseModifier {
notifyCallLogChange();
}
+/*
+ * launcher show unread call
+ */
+ /** M: notify miss call & unread VVM count @{ */
+ if (count > 0) {
+ notifyNewCallsCount();
+ }
+
return count;
}
@@ -217,6 +255,15 @@ public class DbModifierWithNotification implements DatabaseModifier {
notifyCallLogChange();
}
+ /*
+ * launcher show unread call
+ */
+ /** M: notify miss call & unread VVM count @{ */
+ if (count > 0) {
+ notifyNewCallsCount();
+ }
+
return count;
}
(ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java)
diff --git a/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java b/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java
index 1f6aaa4..61b9913 100755
--- a/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java
+++ b/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java
@@ -26,10 +26,15 @@ import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.UriMatcher;
+import android.content.ComponentName;
+import android.content.Intent;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteQueryBuilder;
+import android.database.sqlite.SQLiteStatement;
+import android.database.sqlite.SQLiteDiskIOException;
import android.net.Uri;
import android.os.UserHandle;
import android.os.UserManager;
@@ -41,12 +46,16 @@ import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
+import com.android.providers.contacts.ContactsDatabaseHelper;
+import android.provider.Settings;
import com.android.providers.contacts.CallLogDatabaseHelper;
import com.android.providers.contacts.CallLogDatabaseHelper.Tables;
import com.android.providers.contacts.ContactsProvider2;
import com.android.providers.contacts.DatabaseModifier;
import com.android.providers.contacts.DbModifierWithNotification;
import com.android.providers.contacts.VoicemailPermissions;
+import com.android.providers.contacts.ContactsDatabaseHelper.DbProperties;
+import com.android.providers.contacts.util.SelectionBuilder;
import com.android.providers.contacts.util.UserUtils;
import com.mediatek.providers.contacts.CallLogSearchSupport;
import com.mediatek.providers.contacts.ContactsProviderUtils;
@@ -87,6 +96,18 @@ public class CallLogProviderEx {
mContext = context;
}
+ private interface LegacyConstants {
+ /** Table name used in the contacts DB.*/
+ String CALLS_LEGACY = "calls";
+
+ /** Table name used in the contacts DB.*/
+ String VOICEMAIL_STATUS_LEGACY = "voicemail_status";
+
+ /** Prop name used in the contacts DB.*/
+ String CALL_LOG_LAST_SYNCED_LEGACY = "call_log_last_synced";
+ }
+
+
public static synchronized CallLogProviderEx getInstance(Context context) {
if (sCallLogProviderEx == null) {
sCallLogProviderEx = new CallLogProviderEx(context);
@@ -240,6 +261,73 @@ public class CallLogProviderEx {
.appendPath("call_log").build(), null, false);
}
+ // send new Calls broadcast to launcher to update unread icon
+ public static final void notifyNewCallsCount(Context context) {
+ SQLiteDatabase db = null;
+ Cursor c = null;
+ int newCallsCount = 0;
+/*
+ try {
+ Cursor cursor = context.getContentResolver().query(CallLog.Calls.CONTENT_URI,
+ new String[] { Calls.TYPE }, " type=?",
+ new String[] { Calls.MISSED_TYPE + ""}, "date desc");
+ if (cursor != null) {
+ newCallsCount = cursor.getCount();
+ cursor.close();
+ android.util.Log.d("yjp", " newCallsCount : " + newCallsCount);
+ }
+ android.util.Log.d("yjp", " cursor : " + cursor);
+ }catch (SecurityException e ) {
+ android.util.Log.d("yjp", " also return ");
+ // return ;
+ }
+ */
+ try {
+ db = getDatabaseHelper(context).getWritableDatabase();
+
+ if (db == null || context == null) {
+ LogUtils.w(TAG, "[notifyNewCallsCount] Cannot notify with null db or context.");
+ return;
+ }
+ android.util.Log.d("yjp", " notifyNewCallsCount db : " + db + "\n Tables.CALLS : " + Tables.CALLS);
+ db.beginTransaction();
+ c = db.rawQuery("SELECT count(*) FROM " + Tables.CALLS
+ + " WHERE " + Calls.TYPE + " in (" + Calls.MISSED_TYPE
+ + "," + Calls.VOICEMAIL_TYPE
+ + ") AND " + Calls.NEW + "=1", null);
+ if (c != null && c.moveToFirst()) {
+ newCallsCount = c.getInt(0);
+ }
+ } catch (SQLiteException e) {
+ LogUtils.w(TAG, "[notifyNewCallsCount] SQLiteException:" + e);
+ return;
+ } finally {
+ if (c != null) {
+ c.close();
+ }
+ db.endTransaction();
+ }
+
+ LogUtils.i(TAG, "[notifyNewCallsCount] newCallsCount = " + newCallsCount);
+ //send count=0 to clear the unread icon
+ if (newCallsCount >= 0) {
+ Intent newIntent = new Intent(Intent.ACTION_UNREAD_CHANGED);
+ newIntent.putExtra(Intent.EXTRA_UNREAD_NUMBER, newCallsCount);
+ newIntent.putExtra(Intent.EXTRA_UNREAD_COMPONENT,
+ new ComponentName(ConstantsUtils.CONTACTS_PACKAGE,
+ ConstantsUtils.CONTACTS_DIALTACTS_ACTIVITY));
+ context.sendBroadcast(newIntent);
+ // use the public key CONTACTS_UNREAD_KEY that statement in Setting Provider.
+ Settings.System.putInt(context.getContentResolver(),
+ "com_android_contacts_mtk_unread", Integer.valueOf(newCallsCount));
+ }
+ }
+
+ protected static CallLogDatabaseHelper getDatabaseHelper(final Context context) {
+ return CallLogDatabaseHelper.getInstance(context);
+ }
+
/**
* Returns a {@link DatabaseModifier} that takes care of sending necessary notifications
* after the operation is performed.
diff --git a/opt/net/wifi/service/Android.mk b/opt/net/wifi/service/Android.mk
index d4becf8..e577516 100644
--- a/opt/net/wifi/service/Android.mk
+++ b/opt/net/wifi/service/Android.mk
@@ -39,6 +39,8 @@ LOCAL_SRC_FILES := \
LOCAL_MODULE := libwifi-hal
+LOCAL_JAVA_LIBRARIES := bouncycastle conscrypt services telephony-common
+
include $(BUILD_STATIC_LIBRARY)
# Make HAL stub library 2
diff --git a/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java b/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java
index a4cd27a..d56740b 100644
--- a/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java
+++ b/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java
@@ -29,7 +29,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.Messenger;
import android.util.Log;
-
+import android.text.TextUtils;
import com.android.internal.util.AsyncChannel;
import com.android.internal.R;
import com.android.internal.util.State;
@@ -246,7 +246,14 @@ class WifiApConfigStore extends StateMachine {
will keep the device secure after the update */
private void setDefaultApConfiguration() {
WifiConfiguration config = new WifiConfiguration();
- IWifiFwkExt wifiFwkExt = MPlugin.createInstance(IWifiFwkExt.class.getName(), mContext);
+ int RandomNum = (int)(Math.random()*(9999-1000+1))+1000;
+ String tempSSID = "Kata L1_" + RandomNum;
+ Log.i("rmy", "tempSSID="+tempSSID);
+ config.SSID = tempSSID;
+ if (TextUtils.isEmpty(config.SSID)) {
+ config.SSID = mContext.getString(R.string.wifi_tether_configure_ssid_default);
+ }
+ /*IWifiFwkExt wifiFwkExt = MPlugin.createInstance(IWifiFwkExt.class.getName(), mContext);
if (SystemProperties.get("ro.mtk_bsp_package").equals("1")) {
if (wifiFwkExt != null) {
config.SSID = wifiFwkExt.getApDefaultSsid();
@@ -263,7 +270,7 @@ class WifiApConfigStore extends StateMachine {
config.SSID = config.SSID + random.nextInt(1000);
Log.d(TAG, "setDefaultApConfiguration, SSID:" + config.SSID);
}
- }
+ }*/
config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);
String randomUUID = UUID.randomUUID().toString();
//first 12 chars from xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
六:camera中的GPS开关
(vendor/)
diff --git a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java
index 2894994..e48f37e 100755
--- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java
+++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java
@@ -949,7 +949,7 @@ public class SettingUtils {
}
if (version == 2) {
editor.putString(SettingConstants.KEY_RECORD_LOCATION,
- pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, false) ?
+ pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, true) ?
RecordLocationPreference.VALUE_ON
: RecordLocationPreference.VALUE_NONE);
version = 3;
diff --git a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java
index cc6bbfd..be4fd74 100755
--- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java
+++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java
@@ -959,7 +959,7 @@ public class SettingCtrl {
}
if (version == 2) {
editor.putString(SettingKeys.KEY_RECORD_LOCATION,
- pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, false)
+ pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, true)
? "on" : "none");
version = 3;
}
七:设置 > 语言合输入法 > 个人字典中添加默认字符
(packages/apps/Settings/)
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index a1cbbd3..e8f7507 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -149,6 +149,11 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import android.content.ContentResolver;
+import android.net.Uri;
+import android.provider.UserDictionary.Words;
+import android.provider.UserDictionary;
+import android.content.ContentValues;
/* Vanzo:tanglei on: Mon, 26 Jan 2015 16:35:50 +0800
*/
@@ -908,6 +913,36 @@ public class SettingsActivity extends Activity
if(mDisplaySearch && !TextUtils.isEmpty(mSearchQuery)) {
onQueryTextSubmit(mSearchQuery);
}
+
+ if (android.provider.Settings.System.getInt(this.getContentResolver(),"first_write_contentvalues", 0) == 0) {
+ ContentResolver resolver = getContentResolver();
+ int COLUMN_COUNT = 5;
+ ContentValues values = new ContentValues(COLUMN_COUNT);
+ values.put(UserDictionary.Words.WORD, "Kata");
+ values.put(UserDictionary.Words.SHORTCUT, "Kata");
+ values.put(UserDictionary.Words.FREQUENCY, 250);
+ Uri result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);
+
+ values = new ContentValues(COLUMN_COUNT);
+ values.put(UserDictionary.Words.WORD, "KataCloud");
+ values.put(UserDictionary.Words.SHORTCUT, "KataCloud");
+ values.put(UserDictionary.Words.FREQUENCY, 250);
+ result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);
+
+ values = new ContentValues(COLUMN_COUNT);
+ values.put(UserDictionary.Words.WORD, "128Online");
+ values.put(UserDictionary.Words.SHORTCUT, "128Online");
+ values.put(UserDictionary.Words.FREQUENCY, 250);
+ result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);
+
+ values = new ContentValues(COLUMN_COUNT);
+ values.put(UserDictionary.Words.WORD, "Owtel");
+ values.put(UserDictionary.Words.SHORTCUT, "Owtel");
+ values.put(UserDictionary.Words.FREQUENCY, 250);
+ result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);
+
+ android.provider.Settings.System.putInt(this.getContentResolver(),"first_write_contentvalues", 1);
+ }
}
@Override
八:图库中图片拉伸放大倍数
(packages/apps/Gallery2/)
diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java
index 07dc434..562b99b 100755
--- a/src/com/android/gallery3d/ui/PositionController.java
+++ b/src/com/android/gallery3d/ui/PositionController.java
@@ -90,7 +90,7 @@ public class PositionController {
// We try to scale up the image to fill the screen. But in order not to
// scale too much for small icons, we limit the max up-scaling factor here.
- private static final float SCALE_LIMIT = 4;
+ private static final float SCALE_LIMIT = 2.5f;
// For user's gestures, we give a temporary extra scaling range which goes
// above or below the usual scaling limits.
九:图库中双击图片放大倍数
(packages/apps/Gallery2)
diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java
index 07dc434..562b99b 100755
--- a/src/com/android/gallery3d/ui/PositionController.java
+++ b/src/com/android/gallery3d/ui/PositionController.java
@@ -90,7 +90,7 @@ public class PositionController {
// We try to scale up the image to fill the screen. But in order not to
// scale too much for small icons, we limit the max up-scaling factor here.
- private static final float SCALE_LIMIT = 4;
+ private static final float SCALE_LIMIT = 2.5f;
// For user's gestures, we give a temporary extra scaling range which goes
// above or below the usual scaling limits.
十:默认MTK fota
1) 加入ngm宏
NGM_SYSTEM_UPDATE_SUPPORT_FOR_80M=yes
2) 删除广升 fota
ADUPS_FOTA_SUPPORT=no
3) 配置fota网址
(vanzo/)
diff --git a/packages/SystemUpdate_for_80m/res/values/address.xml b/packages/SystemUpdate_for_80m/res/values/address.xml
index e891226..20261f7 100755
--- a/packages/SystemUpdate_for_80m/res/values/address.xml
+++ b/packages/SystemUpdate_for_80m/res/values/address.xml
@@ -1,9 +1,9 @@
- http://ota.ngmitalia.it/fota/download/login.php
- http://ota.ngmitalia.it/fota/download/checkversion.php
- http://ota.ngmitalia.it/fota/download/downloadfullota.php
- http://ota.ngmitalia.it/fota/download/download.php
+ 客户提供
+ 客户提供
+ 客户提供
+ 客户提供
updateResult
/system/etc/permissions/com.google.android.gms.releasenote.xml
4) 加入fota入口
(packages/apps/Settings/)
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 94e27ea..4e3a489 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -20,6 +20,7 @@
"否"
"创建"
"允许"
+ 系统升级
"拒绝"
"关闭"
"切换"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ad5ca8c..202090e 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -29,7 +29,7 @@
Close
Switch
-
+ System Update
Unknown
diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml
index 06d543a..f2dd846 100644
--- a/res/xml/device_info_settings.xml
+++ b/res/xml/device_info_settings.xml
@@ -65,6 +65,13 @@
android:summary="@string/software_updates_more_summary" >
+
+
+
+
(frameworks/base/services/core/java/com/android/server/MountService.java)
diff --git a/base/services/core/java/com/android/server/MountService.java b/base/services/core/java/com/android/server/MountService.java
2 index 7204af3..f38c4b0 100755
--- a/base/services/core/java/com/android/server/MountService.java
+++ b/base/services/core/java/com/android/server/MountService.java
@@ -1301,7 +1301,7 @@ class MountService extends IMountService.Stub
// Adoptable public disks are visible to apps, since they meet
// public API requirement of being in a stable location.
- if (vol.disk.isAdoptable() || vol.isPhoneStorage()) {
+ if (vol.disk.isAdoptable() || vol.isPhoneStorage() || vol.isUSBOTG()) {
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
}
(vendor/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java)
diff --git a/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java b/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java
index 4f3234c..a68047a 100755
--- a/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java
+++ b/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java
@@ -394,7 +394,14 @@ public class CameraActivity extends ActivityBase implements
CameraPerformanceTracker.onEvent(TAG,
CameraPerformanceTracker.NAME_CAMERA_ON_RESUME,
CameraPerformanceTracker.ISEND);
+ setScreenBrightness(1.0f);
}
+ private void setScreenBrightness(float value) {
+ WindowManager.LayoutParams params = this.getWindow().getAttributes();
+ params.screenBrightness = value;
+ this.getWindow().setAttributes(params);
+ }
+
/**
* the result if CameraActivity permission check.
十三:相机中的GPS默认开启
(vendor/)
diff --git a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java
index 2894994..e48f37e 100755
--- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java
+++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java
@@ -949,7 +949,7 @@ public class SettingUtils {
}
if (version == 2) {
editor.putString(SettingConstants.KEY_RECORD_LOCATION,
- pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, false) ?
+ pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, true) ?
RecordLocationPreference.VALUE_ON
: RecordLocationPreference.VALUE_NONE);
version = 3;
diff --git a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java
index cc6bbfd..be4fd74 100755
--- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java
+++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java
@@ -959,7 +959,7 @@ public class SettingCtrl {
}
if (version == 2) {
editor.putString(SettingKeys.KEY_RECORD_LOCATION,
- pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, false)
+ pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, true)
? "on" : "none");
version = 3;
}
十四:开机动画完成后,闪半张壁纸
7.0 默认不滑动的壁纸宽不用X2
(frameworks/)
diff --git a/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index 33ec45a..c62e223 100644
--- a/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -2003,9 +2003,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
private void ensureSaneWallpaperData(WallpaperData wallpaper) {
// We always want to have some reasonable width hint.
int baseSize = getMaximumSizeDimension();
+/* Vanzo:zhongyeqing on: Thu, 22 Jun 2017 15:43:08 +0800
+ * TODO: replace this line with your comment
if (wallpaper.width < baseSize) {
wallpaper.width = baseSize;
}
+ */
+// End of Vanzo: zhongyeqing
if (wallpaper.height < baseSize) {
wallpaper.height = baseSize;
}
(packages/apps/Launcher3/)
diff --git a/WallpaperPicker/res/values/dimens.xml b/WallpaperPicker/res/values/dimens.xml
index 0447c6d..a1ff7b7 100755
--- a/WallpaperPicker/res/values/dimens.xml
+++ b/WallpaperPicker/res/values/dimens.xml
@@ -16,7 +16,7 @@
- 106.5dp
- 94.5dp
+ 48dp
+ 85dp
32dp
diff --git a/src/com/android/launcher3/util/WallpaperUtils.java b/src/com/android/launcher3/util/WallpaperUtils.java
index b9fccbc..6a78892 100755
--- a/src/com/android/launcher3/util/WallpaperUtils.java
+++ b/src/com/android/launcher3/util/WallpaperUtils.java
@@ -110,13 +110,15 @@ public final class WallpaperUtils {
// We need to ensure that there is enough extra space in the wallpaper
// for the intended parallax effects
+ Point realSize = new Point();
+ windowManager.getDefaultDisplay().getRealSize(realSize);
final int defaultWidth, defaultHeight;
if (res.getConfiguration().smallestScreenWidthDp >= 720) {
defaultWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim));
defaultHeight = maxDim;
} else {
- defaultWidth = Math.max((int) (minDim * WALLPAPER_SCREENS_SPAN), maxDim);
- defaultHeight = maxDim;
+ defaultWidth = realSize.x;
+ defaultHeight = realSize.y;
}
sDefaultWallpaperSize = new Point(defaultWidth, defaultHeight);
}
diff --git a/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java
index 9d3b655..4ac7646 100644
--- a/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java
+++ b/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java
@@ -453,7 +453,7 @@ functions = addFunction(functions, UsbManager.USB_FUNCTION_ACM);
private boolean mHostConnected;
private boolean mSourcePower;
private boolean mConfigured;
- private boolean mUsbDataUnlocked;
+ private boolean mUsbDataUnlocked = true;
private String mCurrentFunctions;
private String mDefaultFunctions;
private boolean mCurrentFunctionsApplied;
@@ -1361,7 +1361,7 @@ functions = addFunction(functions, UsbManager.USB_FUNCTION_ACM);
mUsbConfigured = mConfigured;
if (!mConnected) {
// When a disconnect occurs, relock access to sensitive user data
- mUsbDataUnlocked = false;
+ // mUsbDataUnlocked = false;
}
updateUsbNotification();
updateAdbNotification();
@@ -1370,7 +1370,7 @@ functions = addFunction(functions, UsbManager.USB_FUNCTION_ACM);
updateCurrentAccessory();
} else if (!mConnected) {
// restore defaults when USB is disconnected
- setEnabledFunctions(null, false);
+ // setEnabledFunctions(null, false);
}
if (mBootCompleted) {
updateUsbStateBroadcastIfNeeded();
十六:7.0 电脑上显示的mtp名字
(frameworks/)
diff --git a/av/media/mtp/MtpServer.cpp b/av/media/mtp/MtpServer.cpp
index 9f5d3b7..2a219be 100755
--- a/av/media/mtp/MtpServer.cpp
+++ b/av/media/mtp/MtpServer.cpp
@@ -500,7 +500,13 @@ MtpResponseCode MtpServer::doGetDeviceInfo() {
mData.putString(string); // Manufacturer
property_get("ro.product.model", prop_value, "MTP Device");
+
+/*
+ * TODO: replace this line with your comment
string.set(prop_value);
+ */
+ string.set("ADVAN S50H");
+// End of
mData.putString(string); // Model
string.set("1.0");
mData.putString(string); // Device Version
diff --git a/base/media/java/android/mtp/MtpDatabase.java b/base/media/java/android/mtp/MtpDatabase.java
index 794b893..027395b 100755
--- a/base/media/java/android/mtp/MtpDatabase.java
+++ b/base/media/java/android/mtp/MtpDatabase.java
@@ -44,6 +44,7 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import java.util.concurrent.atomic.AtomicBoolean;
+import android.os.SystemProperties;
/**
* {@hide}
@@ -851,18 +852,81 @@ public class MtpDatabase implements AutoCloseable {
private int getDeviceProperty(int property, long[] outIntValue, char[] outStringValue) {
Log.d(TAG, "getDeviceProperty property = 0x" + Integer.toHexString(property));
+ String value = "",deviceName;
+ int length = 0,lengthDeviceName = 0;
switch (property) {
case MtpConstants.DEVICE_PROPERTY_SYNCHRONIZATION_PARTNER:
+ //Ainge
+ // writable string properties kept in shared preferences
+ value = mDeviceProperties.getString(Integer.toString(property), "");
+ length = value.length();
+ if (length > 255) {
+ length = 255;
+ }
+ value.getChars(0, length, outStringValue, 0);
+ outStringValue[length] = 0;
+ /// M: Added for USB Develpment debug, more log for more debuging help @{
+ if(length > 0) {
+ Log.d(TAG, "getDeviceProperty property = " + Integer.toHexString(property));
+ Log.d(TAG, "getDeviceProperty value = " + value + ", length = " + length);
+ }
+ Log.d(TAG, "getDeviceProperty length = " + length);
+ /// M: Added Modification for ALPS00278882 @{
+ // Return the device name for the PC display if the FriendlyName is empty!!
+ deviceName = "ADVAN S50H";
+
+ lengthDeviceName = deviceName.length();
+ if (lengthDeviceName > 255) {
+ lengthDeviceName = 255;
+ }
+ if(lengthDeviceName >0) {
+ deviceName.getChars(0, lengthDeviceName, outStringValue, 0);
+ outStringValue[lengthDeviceName] = 0;
+ Log.d(TAG, "getDeviceProperty deviceName = " + deviceName + ", lengthDeviceName = " + lengthDeviceName);
+ } else {
+ Log.d(TAG, "getDeviceProperty lengthDeviceName = " + lengthDeviceName);
+ }
+ /// M: @}
+ return MtpConstants.RESPONSE_OK;
case MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME:
// writable string properties kept in shared preferences
- String value = mDeviceProperties.getString(Integer.toString(property), "");
- int length = value.length();
+ //String value = mDeviceProperties.getString(Integer.toString(property), "");
+ //int length = value.length();
+ value = mDeviceProperties.getString(Integer.toString(property), "");
+ length = value.length();
if (length > 255) {
length = 255;
}
value.getChars(0, length, outStringValue, 0);
outStringValue[length] = 0;
+ /// M: Added for USB Develpment debug, more log for more debuging help @{
+ if(length > 0) {
+ Log.d(TAG, "getDeviceProperty property = " + Integer.toHexString(property));
+ Log.d(TAG, "getDeviceProperty value = " + value + ", length = " + length);
+ }
+ else if(SystemProperties.get("ro.sys.usb.mtp.whql.enable").equals("0"))
+ {
+ Log.d(TAG, "getDeviceProperty length = " + length);
+ /// M: Added Modification for ALPS00278882 @{
+ if(property == MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME) {
+ // Return the device name for the PC display if the FriendlyName is empty!!
+ deviceName = "ADVAN S50H";
+ lengthDeviceName = deviceName.length();
+ if (lengthDeviceName > 255) {
+ lengthDeviceName = 255;
+ }
+ if(lengthDeviceName >0) {
+ deviceName.getChars(0, lengthDeviceName, outStringValue, 0);
+ outStringValue[lengthDeviceName] = 0;
+ Log.d(TAG, "getDeviceProperty deviceName = " + deviceName + ", lengthDeviceName = " + lengthDeviceName);
+ } else {
+ Log.d(TAG, "getDeviceProperty lengthDeviceName = " + lengthDeviceName);
+ }
+ }
+ /// M: @}
+ }
+ /// M: @}
return MtpConstants.RESPONSE_OK;
case MtpConstants.DEVICE_PROPERTY_IMAGE_SIZE:
十七:设置 > SIM卡应用 > 短信 删除总是询问
(packages/apps/Settings/)
(ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java)
diff --git a/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java b/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java
index 38b192b..2ea8474 100644
--- a/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java
+++ b/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java
@@ -29,7 +29,7 @@ public class DefaultRCSSettings implements IRCSSettings {
*/
public boolean isNeedAskFirstItemForSms() {
Log.d("@M_" + TAG, "isNeedAskFirstItemForSms");
- return true;
+ return false;
}
/**
@@ -619,13 +626,9 @@ public class SimDialogActivity extends Activity {
if (value < 1) {
int length = subInfoList == null ? 0 : subInfoList.size();
- if (length == 1) {
subId = subInfoList.get(value).getSubscriptionId();
- } else {
- subId = DefaultSmsSimSettings.ASK_USER_SUB_ID;
- }
} else if (value >= 1 && value < subInfoList.size() + 1) {
- subId = subInfoList.get(value - 1).getSubscriptionId();
+ subId = subInfoList.get(value).getSubscriptionId();
} else {
/// M: for plug-in
subId = mSimManagementExt.getDefaultSmsSubIdForAuto();
十八:设置 > SIM卡应用 > 短信 默认SIM卡1
(packages/apps/Settings/)
(src/com/android/settings/sim/SimDialogActivity.java)
@@ -72,6 +72,7 @@ public class SimDialogActivity extends Activity {
public static final int CALLS_PICK = 1;
public static final int SMS_PICK = 2;
public static final int PREFERRED_PICK = 3;
+ public static final int DEFAULT_DATA_PICK = 4;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -118,6 +119,9 @@ public class SimDialogActivity extends Activity {
/// @}
displayPreferredDialog(extras.getInt(PREFERRED_SIM));
break;
+ case DEFAULT_DATA_PICK:
+ setDefaultSmsSubId(this,extras.getInt(PREFERRED_SIM));
+ break;
default:
throw new IllegalArgumentException("Invalid dialog type " + dialogType + " sent.");
}
(src/com/android/settings/sim/SimSelectNotification.java)
@@ -172,27 +174,43 @@ public class SimSelectNotification extends BroadcastReceiver {
/// @}
// If there is only one subscription, ask if user wants to use if for everything
+ Log.i("rmy", "---------- one sim --------------");
Intent newIntent = new Intent(context, SimDialogActivity.class);
newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.PREFERRED_PICK);
- newIntent.putExtra(SimDialogActivity.PREFERRED_SIM, sil.get(0).getSimSlotIndex());
+ newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DEFAULT_DATA_PICK);
+ Log.i("rmy", "getSimSlotIndex() ="+ sil.get(0).getSimSlotIndex());
+ Log.i("rmy", "getSubscriptionId() = "+ sil.get(0).getSubscriptionId());
+ newIntent.putExtra(SimDialogActivity.PREFERRED_SIM, sil.get(0).getSubscriptionId());
context.startActivity(newIntent);
+ setDefaultSmsSubId(context,sil.get(0).getSubscriptionId());
+
/// M: for [C2K OMH Warning]
OmhEventHandler.getInstance(context).sendEmptyMessage(OmhEventHandler.SET_BUSY);
- } else if (!dataSelected ||
- /// M: Op01 open market request. @{
- SystemProperties.get("ro.cmcc_light_cust_support").equals("1")) {
- /// @}
+ } else{
+ Log.i("rmy", "---------- two sim --------------");
// If there are multiple, ensure they pick default data
- Intent newIntent = new Intent(context, SimDialogActivity.class);
- newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DATA_PICK);
- context.startActivity(newIntent);
- /// M: for [C2K OMH Warning]
- OmhEventHandler.getInstance(context).sendEmptyMessage(OmhEventHandler.SET_BUSY);
+ if (!dataSelected){
+ Intent newIntent = new Intent(context, SimDialogActivity.class);
+ newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DEFAULT_DATA_PICK);
+ newIntent.putExtra(SimDialogActivity.PREFERRED_SIM, sil.get(0).getSubscriptionId());
+ context.startActivity(newIntent);
+ }
+
+ if (!smsSelected){
+ setDefaultSmsSubId(context,sil.get(0).getSubscriptionId());
+ }