Android 系统(191)---ODM 开发用户常见需求文档(九) Android 系统(191)---ODM 开发用户常见需求文档(九)

 Android 系统(191)---ODM 开发用户常见需求文档(九)

一:去除摄像头的假对焦框

(vendor/)

(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/FocusManager.java)

[java]  view plain  copy
  1.  import java.util.ArrayList;  
  2.  import java.util.List;  
  3. +import com.android.camera.ui.FocusIndicatorRotateLayout.Listener;  
  4.    
  5.  /** 
  6.   * A class that handles everything about focus in still picture mode. This also handles the metering 
  7. @@ -56,7 +57,7 @@ import java.util.List; 
  8.   * Touch the screen to change metering area. 
  9.   */  
  10.  public class FocusManager implements CameraActivity.OnOrientationListener,  
  11. -        CameraActivity.OnParametersReadyListener {  
  12. +        CameraActivity.OnParametersReadyListener,FocusIndicatorRotateLayout.Listener {  
  13.      private static final String TAG = "FocusManager";  
  14.    
  15.      private static final int RESET_TOUCH_FOCUS = 0;  
  16. @@ -86,6 +87,11 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  17.      private Matrix mMatrix;  
  18.      private Matrix mObjextMatrix;  
  19.    
  20. +    private boolean mNeedPlaySound = false;  
  21.      // The parent layout that includes only the focus indicator.  
  22.      private FocusIndicatorRotateLayout mFocusIndicatorRotateLayout;  
  23.      // The focus indicator view that holds the image resource.  
  24. @@ -228,6 +234,14 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  25.          mParameters = parameters;  
  26.          mFocusAreaSupported = (mParameters.getMaxNumFocusAreas() > 0 && isSupported(  
  27.                  Parameters.FOCUS_MODE_AUTO, mParameters.getSupportedFocusModes()));  
  28.   
  29. +        if (mFocusIndicatorRotateLayout != null) {  
  30. +            mFocusIndicatorRotateLayout.mCustomFocusSupported = mFocusAreaSupported;  
  31. +            mFocusIndicatorRotateLayout.setCustomListener(this);  
  32. +        }  
  33.          // mLockAeAwbNeeded = (mInitialParameters.isAutoExposureLockSupported()  
  34.          // ||  
  35.          // mInitialParameters.isAutoWhiteBalanceLockSupported());  
  36. @@ -427,9 +441,23 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  37.          }  
  38.          mListener.setFocusParameters();  
  39.          if (moving) {  
  40. +            if (!mFocusAreaSupported) {  
  41. +                Log.e("vanzo","mNeedPlaySound-->false");  
  42. +                mNeedPlaySound = false;  
  43. +            }  
  44.              mFocusIndicatorRotateLayout.showStart();  
  45.          } else {  
  46. +/* 
  47.              mFocusIndicatorRotateLayout.showSuccess(true); 
  48. + */  
  49. +            if (mFocusAreaSupported)  
  50. +                mFocusIndicatorRotateLayout.showSuccess(true);  
  51.          }  
  52.      }  
  53.    
  54. @@ -453,7 +481,11 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  55.          // Check if metering area or focus area is supported.  
  56.          if (!mFocusAreaSupported) {  
  57.              Log.i(TAG, "[onSingleTapUp] mFocusAreaSupported is false");  
  58.    
  59. +        //  return;  
  60.   
  61.   
  62.          }  
  63.          if (!mInitialized || mState == STATE_FOCUSING_SNAP_ON_FINISH || mState == STATE_UNKNOWN) {  
  64.              return;  
  65. @@ -528,6 +560,14 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  66.          // it can't be called twice when focusing.  
  67.          mListener.stopFaceDetection();  
  68.    
  69. +            if (!mFocusAreaSupported) {  
  70. +                Log.e("vanzo","mNeedPlaySound-->true");  
  71. +                mNeedPlaySound = true;  
  72. +            }  
  73.          // Set the focus area and metering area.  
  74.          mListener.setFocusParameters();  
  75.          Log.i(TAG, "onSingleTapUp,  mFocusAreaSupported " + mFocusAreaSupported);  
  76. @@ -573,7 +613,13 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  77.              getFrameview().resume();  
  78.          }  
  79.          mState = STATE_IDLE;  
  80. +/* 
  81.          updateFocusUI(); 
  82. + */  
  83. +        if (mFocusAreaSupported)  
  84. +            updateFocusUI();  
  85. +// End of Vanzo:tangshenghu  
  86.          mHandler.removeMessages(RESET_TOUCH_FOCUS);  
  87.      }  
  88.    
  89. @@ -968,4 +1014,13 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  90.          return isSupported;  
  91.      }  
  92.    
  93. +    @Override  
  94. +    public void playFocusSound() {  
  95. +        if (mListener != null && mNeedPlaySound)  
  96. +            mListener.playSound(MediaActionSound.FOCUS_COMPLETE);  
  97. +    }  
  98.  }  

(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/actor/PhotoActor.java)

[java]  view plain  copy
  1.          // The next steps will be excuted only at the first time.  
  2.          mCameraActivity.getFrameManager().initializeFrameView(false);  
  3.          mIsInitialized = true;  
  4. +        mHandler.postDelayed(new Runnable() {  
  5. +            public void run() {  
  6. +            if(mCameraActivity==null||mCameraActivity.getParameters()==null){  
  7. +                return;  
  8. +             }  
  9. +            if (mCameraActivity.getParameters().getMaxNumFocusAreas() == 0)  
  10. +                mCameraActivity.getFocusManager().onAutoFocusMoving(true);  
  11. +            }  
  12. +        }, 1000);  
  13.      }  
  14.        
  15.      private void startPreview(boolean needStop) {  
  16. @@ -983,7 +996,13 @@ public class PhotoActor extends CameraActor implements FocusManager.Listener,  
  17.                
  18.              if (mModuleManager.onSingleTapUp(view, x, y)) {  
  19.                  Log.i(TAG, "[onSingleTapUp] module manager has handled it,return.");  
  20. +            //  return;  
  21. +                if (mCameraActivity.getCameraId() == 1)  
  22. +                    return;  
  23.              }  
  24.    
  25.              focusManager.onSingleTapUp(x, y);  

(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/ui/FocusIndicatorRotateLayout.java)

[java]  view plain  copy
  1.      private Runnable mDisappear = new Disappear();  
  2.      private Runnable mEndAction = new EndAction();  
  3. +    private Runnable mShowAction = new ShowAction();  
  4. +    public boolean mCustomFocusSupported = true;  
  5. +    Listener mListener = null;  
  6. +    public interface Listener {  
  7. +        void playFocusSound();  
  8. +    }  
  9.      private static final int SCALING_UP_TIME = 1000;  
  10.      private static final int SCALING_DOWN_TIME = 200;  
  11.      private static final int DISAPPEAR_TIMEOUT = 200;  
  12. @@ -100,8 +110,20 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd  
  13.          Log.d(TAG, "showStart mState = " + mState);  
  14.          if (mState == STATE_IDLE) {  
  15.              setDrawable(R.drawable.ic_focus_focusing);  
  16. +/* 
  17.              animate().withLayer().setDuration(SCALING_UP_TIME).scaleX(1.5f).scaleY(1.5f); 
  18.              mState = STATE_FOCUSING; 
  19. + */  
  20. +            if (mCustomFocusSupported) {  
  21. +                animate().withLayer().setDuration(SCALING_UP_TIME).scaleX(1.5f).scaleY(1.5f);  
  22. +                mState = STATE_FOCUSING;  
  23. +            } else {  
  24. +                mState = STATE_FOCUSING;  
  25. +                animate().withLayer().setDuration(SCALING_UP_TIME)  
  26. +                        .scaleX(1.5f).scaleY(1.5f).withEndAction(mShowAction);  
  27. +            }  
  28.          }  
  29.      }  
  30.    
  31. @@ -113,6 +135,12 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd  
  32.              animate().withLayer().setDuration(SCALING_DOWN_TIME).scaleX(1f).scaleY(1f)  
  33.                      .withEndAction(timeout ? mEndAction : null);  
  34.              mState = STATE_FINISHING;  
  35. +            if (!mCustomFocusSupported && mListener != null)  
  36. +                mListener.playFocusSound();  
  37.          }  
  38.      }  
  39.    
  40. @@ -145,6 +173,17 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd  
  41.          }  
  42.      }  
  43.    
  44. +    private class ShowAction implements Runnable {  
  45. +        @Override  
  46. +        public void run() {  
  47. +            // Keep the focus indicator for some time.  
  48. +            showSuccess(true);  
  49. +        }  
  50. +    }  
  51.      private class Disappear implements Runnable {  
  52.          @Override  
  53.          public void run() {  
  54. @@ -175,4 +214,11 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd  
  55.          }  
  56.          return true;  
  57.      }  
  58. +    public void setCustomListener(Listener listener) {  
  59. +        mListener = listener;  
  60. +    }  

二:插卡开机时去掉通知栏中的读取sim卡联系人的提示消息
(packages/apps/Contacts/SimProcessor/src/com/mediatek/simprocessor/SimProcessorService.java)

[java]  view plain  copy
  1.          ExtensionManager.registerApplicationContext(getApplication());  
  2.          mProcessorManager = new SimProcessorManager(this, mListener);  
  3.    
  4. +/* 
  5.          Notification notification = new Notification(android.R.drawable.ic_dialog_alert, 
  6.                  ONGOING_NOTIFICATION, System.currentTimeMillis()); 
  7.          startForeground(ONGOING_NOTIFICATION_ID, notification); 
  8. +*/  
  9.      }  
  10.    
  11.      @Override  
  12. @@ -100,7 +102,7 @@ public class SimProcessorService extends Service {  
  13.      public void onDestroy() {  
  14.          super.onDestroy();  
  15.          Log.i(TAG, "[onDestroy]...");  
  16. -        stopForeground(true);  
  17. +//        stopForeground(true);  
  18.          System.exit(0);  
  19.      }  

三:更换默认锁屏壁纸
(frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java)

[java]  view plain  copy
  1. 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  
  2. index 9cf7063..d896704 100644  
  3. --- a/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java  
  4. +++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java  
  5. @@ -51,6 +51,7 @@ import android.graphics.Rect;  
  6.  import android.graphics.drawable.BitmapDrawable;  
  7.  import android.graphics.drawable.ColorDrawable;  
  8.  import android.graphics.drawable.Drawable;  
  9. +import android.graphics.Bitmap;  
  10.  import android.inputmethodservice.InputMethodService;  
  11.  import android.media.AudioAttributes;  
  12.  import android.media.MediaMetadata;  
  13. @@ -176,6 +177,11 @@ import com.android.systemui.statusbar.stack.NotificationStackScrollLayout.OnChil  
  14.  import com.android.systemui.statusbar.stack.StackStateAnimator;  
  15.  import com.android.systemui.statusbar.stack.StackViewState;  
  16.  import com.android.systemui.volume.VolumeComponent;  
  17. +import android.app.WallpaperManager;  
  18. +import java.io.ByteArrayInputStream;  
  19. +import java.io.ByteArrayOutputStream;  
  20. +import java.io.IOException;  
  21. +import android.provider.Settings;  
  22.  /// M: BMW  
  23.  import com.mediatek.multiwindow.MultiWindowManager;  
  24.    
  25. @@ -749,6 +755,28 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,  
  26.    
  27.          mScreenPinningRequest = new ScreenPinningRequest(mContext);  
  28.          mFalsingManager = FalsingManager.getInstance(mContext);  
  29. +/*  
  30. + * TODO: replace this line with your comment 
  31. + */  
  32. +        if(Settings.System.getInt(mContext.getContentResolver(),"def_lock_wall_vanzo",0) != 1){  
  33. +            Settings.System.putInt(mContext.getContentResolver(),"def_lock_wall_vanzo" , 1);  
  34. +            WallpaperManager wallpaperManager = WallpaperManager.getInstance(mContext);  
  35. +            BitmapDrawable bitmapDrawable = (BitmapDrawable)mContext.getResources().getDrawable(R.drawable.default_lock_wallpaper);  
  36. +            Bitmap defaultLockWallpaper = bitmapDrawable.getBitmap();  
  37. +            ByteArrayOutputStream tmpOut = new ByteArrayOutputStream(2048);  
  38. +            if (defaultLockWallpaper.compress(Bitmap.CompressFormat.PNG, 100,tmpOut)) {  
  39. +                try {  
  40. +                    byte[] outByteArray = tmpOut.toByteArray();  
  41. +                    wallpaperManager.setStream(new ByteArrayInputStream(outByteArray),   
  42. +                            nulltrue, WallpaperManager.FLAG_LOCK);  
  43. +                } catch (IOException e) {  
  44. +                    Log.e(TAG, "IOException", e);  
  45. +                } catch (SecurityException e) {  
  46. +                    Log.w(TAG, "SecurityException", e);  
  47. +                }  
  48. +            }  
  49. +        }  
  50.      }  
  51.    
  52.      protected void createIconController() {  

四:未接来电或未读短信没有显示未读数量
(packages/providers/)
(ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java)

[java]  view plain  copy
  1. diff --git a/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java b/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java  
  2. index 70c56d6..0916739 100644  
  3. --- a/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java  
  4. +++ b/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java  
  5. @@ -113,6 +113,15 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  6.              notifyCallLogChange();  
  7.          }  
  8.    
  9. +/* 
  10. + * launcher show unread call 
  11. + */  
  12. +        /** M: notify miss call & unread VVM count @{ */  
  13. +        if (rowId > 0) {  
  14. +            notifyNewCallsCount();  
  15. +        }  
  16. +  
  17.          return rowId;  
  18.      }  
  19.    
  20. @@ -131,6 +140,15 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  21.              notifyCallLogChange();  
  22.          }  
  23.    
  24. +/* 
  25. + * launcher show unread call 
  26. + */  
  27. +        /** M: notify miss call & unread VVM count @{ */  
  28. +        if (rowId > 0) {  
  29. +            notifyNewCallsCount();  
  30. +        }  
  31. +  
  32.          return rowId;  
  33.      }  
  34.    
  35. @@ -145,6 +163,17 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  36.          }  
  37.      }  
  38.    
  39. +/* 
  40. + * launcher show unread call 
  41. + */  
  42. +    /** 
  43. +     * M: notify launcher to display the count of missed call & VVM. 
  44. +     * */  
  45. +    private void notifyNewCallsCount() {  
  46. +        CallLogProviderEx.notifyNewCallsCount(mContext);  
  47. +    }  
  48. +  
  49.      private void notifyVoicemailChangeOnInsert(Uri notificationUri, Set<String> packagesModified) {  
  50.          if (mIsCallsTable) {  
  51.              notifyVoicemailChange(notificationUri, packagesModified,  
  52. @@ -183,6 +212,15 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  53.              notifyCallLogChange();  
  54.          }  
  55.    
  56. +/* 
  57. + * launcher show unread call 
  58. + */  
  59. +        /** M: notify miss call & unread VVM count @{ */  
  60. +        if (count > 0) {  
  61. +            notifyNewCallsCount();  
  62. +        }  
  63. +  
  64.          return count;  
  65.      }  
  66.    
  67. @@ -217,6 +255,15 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  68.              notifyCallLogChange();  
  69.          }  
  70.    
  71. /* 
  72. + * launcher show unread call 
  73. + */  
  74. +        /** M: notify miss call & unread VVM count @{ */  
  75. +        if (count > 0) {  
  76. +            notifyNewCallsCount();  
  77. +        }  
  78. +  
  79.          return count;  
  80.      }  
(ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java)

[java]  view plain  copy
  1. diff --git a/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java b/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java  
  2. index 1f6aaa4..61b9913 100755  
  3. --- a/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java  
  4. +++ b/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java  
  5. @@ -26,10 +26,15 @@ import android.content.ContentUris;  
  6.  import android.content.ContentValues;  
  7.  import android.content.Context;  
  8.  import android.content.UriMatcher;  
  9. +import android.content.ComponentName;  
  10. +import android.content.Intent;  
  11.  import android.database.Cursor;  
  12.  import android.database.DatabaseUtils;  
  13.  import android.database.sqlite.SQLiteDatabase;  
  14. +import android.database.sqlite.SQLiteException;  
  15.  import android.database.sqlite.SQLiteQueryBuilder;  
  16. +import android.database.sqlite.SQLiteStatement;  
  17. +import android.database.sqlite.SQLiteDiskIOException;  
  18.  import android.net.Uri;  
  19.  import android.os.UserHandle;  
  20.  import android.os.UserManager;  
  21. @@ -41,12 +46,16 @@ import android.telephony.PhoneNumberUtils;  
  22.  import android.text.TextUtils;  
  23.  import android.util.Log;  
  24.    
  25. +import com.android.providers.contacts.ContactsDatabaseHelper;  
  26. +import android.provider.Settings;  
  27.  import com.android.providers.contacts.CallLogDatabaseHelper;  
  28.  import com.android.providers.contacts.CallLogDatabaseHelper.Tables;  
  29.  import com.android.providers.contacts.ContactsProvider2;  
  30.  import com.android.providers.contacts.DatabaseModifier;  
  31.  import com.android.providers.contacts.DbModifierWithNotification;  
  32.  import com.android.providers.contacts.VoicemailPermissions;  
  33. +import com.android.providers.contacts.ContactsDatabaseHelper.DbProperties;  
  34. +import com.android.providers.contacts.util.SelectionBuilder;  
  35.  import com.android.providers.contacts.util.UserUtils;  
  36.  import com.mediatek.providers.contacts.CallLogSearchSupport;  
  37.  import com.mediatek.providers.contacts.ContactsProviderUtils;  
  38. @@ -87,6 +96,18 @@ public class CallLogProviderEx {  
  39.          mContext = context;  
  40.      }  
  41.    
  42. +    private interface LegacyConstants {  
  43. +        /** Table name used in the contacts DB.*/  
  44. +        String CALLS_LEGACY = "calls";  
  45. +  
  46. +        /** Table name used in the contacts DB.*/  
  47. +        String VOICEMAIL_STATUS_LEGACY = "voicemail_status";  
  48. +  
  49. +        /** Prop name used in the contacts DB.*/  
  50. +        String CALL_LOG_LAST_SYNCED_LEGACY = "call_log_last_synced";  
  51. +    }  
  52. +  
  53. +  
  54.      public static synchronized CallLogProviderEx getInstance(Context context) {  
  55.          if (sCallLogProviderEx == null) {  
  56.              sCallLogProviderEx = new CallLogProviderEx(context);  
  57. @@ -240,6 +261,73 @@ public class CallLogProviderEx {  
  58.                          .appendPath("call_log").build(), nullfalse);  
  59.      }  
  60.    
  61. +    // send new Calls broadcast to launcher to update unread icon  
  62. +    public static final void notifyNewCallsCount(Context context) {  
  63. +        SQLiteDatabase db = null;  
  64. +        Cursor c = null;  
  65. +        int newCallsCount = 0;  
  66. +/* 
  67. +        try { 
  68. +            Cursor cursor = context.getContentResolver().query(CallLog.Calls.CONTENT_URI, 
  69. +                    new String[] { Calls.TYPE }, " type=?", 
  70. +                    new String[] { Calls.MISSED_TYPE + ""}, "date desc"); 
  71. +            if (cursor != null) { 
  72. +                newCallsCount = cursor.getCount(); 
  73. +                cursor.close(); 
  74. +                android.util.Log.d("yjp", "    newCallsCount : " + newCallsCount); 
  75. +            }  
  76. +            android.util.Log.d("yjp", "    cursor  : " + cursor); 
  77. +        }catch (SecurityException e ) { 
  78. +            android.util.Log.d("yjp", "  also return "); 
  79. +        //    return ; 
  80. +        } 
  81. + */  
  82. +        try {  
  83. +            db = getDatabaseHelper(context).getWritableDatabase();  
  84. +  
  85. +            if (db == null || context == null) {  
  86. +                LogUtils.w(TAG, "[notifyNewCallsCount] Cannot notify with null db or context.");  
  87. +                return;  
  88. +            }  
  89. +            android.util.Log.d("yjp""    notifyNewCallsCount  db : " + db  + "\n   Tables.CALLS : " + Tables.CALLS);  
  90. +            db.beginTransaction();  
  91. +            c = db.rawQuery("SELECT count(*) FROM " + Tables.CALLS  
  92. +                    + " WHERE " + Calls.TYPE + " in (" + Calls.MISSED_TYPE  
  93. +                    + "," + Calls.VOICEMAIL_TYPE  
  94. +                    + ") AND " + Calls.NEW + "=1"null);  
  95. +            if (c != null && c.moveToFirst()) {  
  96. +                newCallsCount = c.getInt(0);  
  97. +            }  
  98. +        } catch (SQLiteException e) {  
  99. +            LogUtils.w(TAG, "[notifyNewCallsCount] SQLiteException:" + e);  
  100. +            return;  
  101. +        } finally {  
  102. +            if (c != null) {  
  103. +                c.close();  
  104. +            }  
  105. +            db.endTransaction();  
  106. +        }  
  107. +  
  108. +        LogUtils.i(TAG, "[notifyNewCallsCount] newCallsCount = " + newCallsCount);  
  109. +        //send count=0 to clear the unread icon  
  110. +        if (newCallsCount >= 0) {  
  111. +            Intent newIntent = new Intent(Intent.ACTION_UNREAD_CHANGED);  
  112. +            newIntent.putExtra(Intent.EXTRA_UNREAD_NUMBER, newCallsCount);  
  113. +            newIntent.putExtra(Intent.EXTRA_UNREAD_COMPONENT,  
  114. +                    new ComponentName(ConstantsUtils.CONTACTS_PACKAGE,  
  115. +                    ConstantsUtils.CONTACTS_DIALTACTS_ACTIVITY));  
  116. +            context.sendBroadcast(newIntent);  
  117. +            // use the public key CONTACTS_UNREAD_KEY that statement in Setting Provider.  
  118. +            Settings.System.putInt(context.getContentResolver(),  
  119. +                    "com_android_contacts_mtk_unread", Integer.valueOf(newCallsCount));  
  120. +        }  
  121. +    }  
  122. +  
  123. +    protected static CallLogDatabaseHelper getDatabaseHelper(final Context context) {  
  124. +        return CallLogDatabaseHelper.getInstance(context);  
  125. +    }  
  126. +  
  127.      /**  
  128.       * Returns a {@link DatabaseModifier} that takes care of sending necessary notifications  
  129.       * after the operation is performed.  

五:wifi热点名称自定义

(frameworks/)

[java]  view plain  copy
  1. diff --git a/opt/net/wifi/service/Android.mk b/opt/net/wifi/service/Android.mk  
  2. index d4becf8..e577516 100644  
  3. --- a/opt/net/wifi/service/Android.mk  
  4. +++ b/opt/net/wifi/service/Android.mk  
  5. @@ -39,6 +39,8 @@ LOCAL_SRC_FILES := \  
  6.    
  7.  LOCAL_MODULE := libwifi-hal  
  8.    
  9. +LOCAL_JAVA_LIBRARIES := bouncycastle conscrypt services telephony-common  
  10. +  
  11.  include $(BUILD_STATIC_LIBRARY)  
  12.    
  13.  # Make HAL stub library 2  
  14. 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  
  15. index a4cd27a..d56740b 100644  
  16. --- a/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java  
  17. +++ b/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java  
  18. @@ -29,7 +29,7 @@ import android.os.Handler;  
  19.  import android.os.Message;  
  20.  import android.os.Messenger;  
  21.  import android.util.Log;  
  22. -  
  23. +import android.text.TextUtils;  
  24.  import com.android.internal.util.AsyncChannel;  
  25.  import com.android.internal.R;  
  26.  import com.android.internal.util.State;  
  27. @@ -246,7 +246,14 @@ class WifiApConfigStore extends StateMachine {  
  28.         will keep the device secure after the update */  
  29.      private void setDefaultApConfiguration() {  
  30.          WifiConfiguration config = new WifiConfiguration();  
  31. -        IWifiFwkExt wifiFwkExt = MPlugin.createInstance(IWifiFwkExt.class.getName(), mContext);  
  32. +        int RandomNum = (int)(Math.random()*(9999-1000+1))+1000;  
  33. +        String tempSSID = "Kata L1_" + RandomNum;  
  34. +        Log.i("rmy""tempSSID="+tempSSID);  
  35. +        config.SSID = tempSSID;  
  36. +        if (TextUtils.isEmpty(config.SSID)) {  
  37. +            config.SSID = mContext.getString(R.string.wifi_tether_configure_ssid_default);  
  38. +        }  
  39. +        /*IWifiFwkExt wifiFwkExt = MPlugin.createInstance(IWifiFwkExt.class.getName(), mContext); 
  40.          if (SystemProperties.get("ro.mtk_bsp_package").equals("1")) { 
  41.              if (wifiFwkExt != null) { 
  42.                  config.SSID = wifiFwkExt.getApDefaultSsid(); 
  43. @@ -263,7 +270,7 @@ class WifiApConfigStore extends StateMachine { 
  44.                  config.SSID = config.SSID + random.nextInt(1000); 
  45.                  Log.d(TAG, "setDefaultApConfiguration, SSID:" + config.SSID); 
  46.              } 
  47. -        } 
  48. +        }*/  
  49.          config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);  
  50.          String randomUUID = UUID.randomUUID().toString();  
  51.          //first 12 chars from xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx  

六:camera中的GPS开关
(vendor/)

[java]  view plain  copy
  1. 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  
  2. index 2894994..e48f37e 100755  
  3. --- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java  
  4. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java  
  5. @@ -949,7 +949,7 @@ public class SettingUtils {  
  6.          }  
  7.          if (version == 2) {  
  8.              editor.putString(SettingConstants.KEY_RECORD_LOCATION,  
  9. -                    pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, false) ?  
  10. +                    pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, true) ?  
  11.                               RecordLocationPreference.VALUE_ON  
  12.                              : RecordLocationPreference.VALUE_NONE);  
  13.              version = 3;  
  14. 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  
  15. index cc6bbfd..be4fd74 100755  
  16. --- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java  
  17. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java  
  18. @@ -959,7 +959,7 @@ public class SettingCtrl {  
  19.          }  
  20.          if (version == 2) {  
  21.              editor.putString(SettingKeys.KEY_RECORD_LOCATION,  
  22. -                    pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, false)  
  23. +                    pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, true)  
  24.                      ? "on" : "none");  
  25.              version = 3;  
  26.          }  

七:设置 > 语言合输入法 > 个人字典中添加默认字符
(packages/apps/Settings/)

[java]  view plain  copy
  1. diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java  
  2. index a1cbbd3..e8f7507 100644  
  3. --- a/src/com/android/settings/SettingsActivity.java  
  4. +++ b/src/com/android/settings/SettingsActivity.java  
  5. @@ -149,6 +149,11 @@ import java.util.ArrayList;  
  6.  import java.util.List;  
  7.  import java.util.Map;  
  8.  import java.util.Set;  
  9. +import android.content.ContentResolver;  
  10. +import android.net.Uri;  
  11. +import android.provider.UserDictionary.Words;  
  12. +import android.provider.UserDictionary;  
  13. +import android.content.ContentValues;  
  14.    
  15.  /* Vanzo:tanglei on: Mon, 26 Jan 2015 16:35:50 +0800 
  16.   */  
  17. @@ -908,6 +913,36 @@ public class SettingsActivity extends Activity  
  18.          if(mDisplaySearch && !TextUtils.isEmpty(mSearchQuery)) {  
  19.              onQueryTextSubmit(mSearchQuery);  
  20.          }  
  21. +  
  22. +        if (android.provider.Settings.System.getInt(this.getContentResolver(),"first_write_contentvalues"0) == 0) {  
  23. +            ContentResolver resolver = getContentResolver();  
  24. +            int COLUMN_COUNT = 5;  
  25. +            ContentValues values = new ContentValues(COLUMN_COUNT);  
  26. +            values.put(UserDictionary.Words.WORD, "Kata");  
  27. +            values.put(UserDictionary.Words.SHORTCUT, "Kata");  
  28. +            values.put(UserDictionary.Words.FREQUENCY, 250);  
  29. +            Uri result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);  
  30. +  
  31. +            values = new ContentValues(COLUMN_COUNT);  
  32. +            values.put(UserDictionary.Words.WORD, "KataCloud");  
  33. +            values.put(UserDictionary.Words.SHORTCUT, "KataCloud");  
  34. +            values.put(UserDictionary.Words.FREQUENCY, 250);  
  35. +            result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);  
  36. +  
  37. +            values = new ContentValues(COLUMN_COUNT);  
  38. +            values.put(UserDictionary.Words.WORD, "128Online");  
  39. +            values.put(UserDictionary.Words.SHORTCUT, "128Online");  
  40. +            values.put(UserDictionary.Words.FREQUENCY, 250);  
  41. +            result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);  
  42. +  
  43. +            values = new ContentValues(COLUMN_COUNT);  
  44. +            values.put(UserDictionary.Words.WORD, "Owtel");  
  45. +            values.put(UserDictionary.Words.SHORTCUT, "Owtel");  
  46. +            values.put(UserDictionary.Words.FREQUENCY, 250);  
  47. +            result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);  
  48. +  
  49. +            android.provider.Settings.System.putInt(this.getContentResolver(),"first_write_contentvalues"1);  
  50. +        }  
  51.      }  
  52.    
  53.      @Override  

八:图库中图片拉伸放大倍数

(packages/apps/Gallery2/)

[java]  view plain  copy
  1. diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java  
  2. index 07dc434..562b99b 100755  
  3. --- a/src/com/android/gallery3d/ui/PositionController.java  
  4. +++ b/src/com/android/gallery3d/ui/PositionController.java  
  5. @@ -90,7 +90,7 @@ public class PositionController {  
  6.    
  7.      // We try to scale up the image to fill the screen. But in order not to  
  8.      // scale too much for small icons, we limit the max up-scaling factor here.  
  9. -    private static final float SCALE_LIMIT = 4;  
  10. +    private static final float SCALE_LIMIT = 2.5f;  
  11.    
  12.      // For user's gestures, we give a temporary extra scaling range which goes  
  13.      // above or below the usual scaling limits.  

九:图库中双击图片放大倍数

(packages/apps/Gallery2)

[java]  view plain  copy
  1. diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java  
  2. index 07dc434..562b99b 100755  
  3. --- a/src/com/android/gallery3d/ui/PositionController.java  
  4. +++ b/src/com/android/gallery3d/ui/PositionController.java  
  5. @@ -90,7 +90,7 @@ public class PositionController {  
  6.    
  7.      // We try to scale up the image to fill the screen. But in order not to  
  8.      // scale too much for small icons, we limit the max up-scaling factor here.  
  9. -    private static final float SCALE_LIMIT = 4;  
  10. +    private static final float SCALE_LIMIT = 2.5f;  
  11.    
  12.      // For user's gestures, we give a temporary extra scaling range which goes  
  13.      // 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/)

[java]  view plain  copy
  1. diff --git a/packages/SystemUpdate_for_80m/res/values/address.xml b/packages/SystemUpdate_for_80m/res/values/address.xml  
  2. index e891226..20261f7 100755  
  3. --- a/packages/SystemUpdate_for_80m/res/values/address.xml  
  4. +++ b/packages/SystemUpdate_for_80m/res/values/address.xml  
  5. @@ -1,9 +1,9 @@  
  6.  <?xml version="1.0" encoding="utf-8"?>  
  7.  <resources>  
  8. -    <string name="address_login" translatable="false">http://ota.ngmitalia.it/fota/download/login.php</string>  
  9. -    <string name="address_check_version" translatable="false">http://ota.ngmitalia.it/fota/download/checkversion.php</string>  
  10. -    <string name="address_download_full" translatable="false">http://ota.ngmitalia.it/fota/download/downloadfullota.php</string>  
  11. -    <string name="address_download_delta" translatable="false">http://ota.ngmitalia.it/fota/download/download.php</string>  
  12. +    <string name="address_login" translatable="false">客户提供</string>  
  13. +    <string name="address_check_version" translatable="false">客户提供</string>  
  14. +    <string name="address_download_full" translatable="false">客户提供</string>  
  15. +    <string name="address_download_delta" translatable="false">客户提供</string>  
  16.      <string name="address_update_result" translatable="false">updateResult</string>  
  17.      <string name="gms_load_flag" translatable="false">/system/etc/permissions/com.google.android.gms.releasenote.xml</string>      
  18.  </resources>  

4) 加入fota入口
(packages/apps/Settings/)

[java]  view plain  copy
  1. diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml  
  2. index 94e27ea..4e3a489 100644  
  3. --- a/res/values-zh-rCN/strings.xml  
  4. +++ b/res/values-zh-rCN/strings.xml  
  5. @@ -20,6 +20,7 @@  
  6.      <string name="no" msgid="6731231425810196216">"否"</string>  
  7.      <string name="create" msgid="3578857613172647409">"创建"</string>  
  8.      <string name="allow" msgid="3349662621170855910">"允许"</string>  
  9. +    <string name="system_update">系统升级</string>  
  10.      <string name="deny" msgid="6947806159746484865">"拒绝"</string>  
  11.      <string name="dlg_close" msgid="7471087791340790015">"关闭"</string>  
  12.      <string name="dlg_switch" msgid="6243971420240639064">"切换"</string>  
  13. diff --git a/res/values/strings.xml b/res/values/strings.xml  
  14. index ad5ca8c..202090e 100644  
  15. --- a/res/values/strings.xml  
  16. +++ b/res/values/strings.xml  
  17. @@ -29,7 +29,7 @@  
  18.      <string name="dlg_close">Close</string>  
  19.      <!-- Strings for Dialog switch button [CHAR LIMIT=20] -->  
  20.      <string name="dlg_switch">Switch</string>  
  21. -  
  22. +    <string name="system_update">System Update</string>  
  23.      <!-- Device Info --> <skip />  
  24.      <!-- Device Info screen. Used for a status item's value when the proper value is not known -->  
  25.      <string name="device_info_default">Unknown</string>  
  26. diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml  
  27. index 06d543a..f2dd846 100644  
  28. --- a/res/xml/device_info_settings.xml  
  29. +++ b/res/xml/device_info_settings.xml  
  30. @@ -65,6 +65,13 @@  
  31.          android:summary="@string/software_updates_more_summary" >  
  32.     </PreferenceScreen>  
  33.    
  34. +        <PreferenceScreen android:key="system_version"  
  35. +                android:title="@string/system_update">  
  36. +            <intent android:action="android.intent.action.MAIN"  
  37. +                    android:targetPackage="com.mediatek.systemupdate"  
  38. +                    android:targetClass="com.mediatek.systemupdate.MainEntry" />  
  39. +        </PreferenceScreen>  
  40. +  
  41.          <!-- Device status - launches activity -->  
  42.          <PreferenceScreen android:key="status_info"  
  43.                  android:title="@string/device_status"  


十一:otg做成5.1的样子,在filemanager中显示

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

[java]  view plain  copy
  1. diff --git a/base/services/core/java/com/android/server/MountService.java b/base/services/core/java/com/android/server/MountService.java  
  2.   2 index 7204af3..f38c4b0 100755  
  3.  --- a/base/services/core/java/com/android/server/MountService.java  
  4.  +++ b/base/services/core/java/com/android/server/MountService.java  
  5. @@ -1301,7 +1301,7 @@ class MountService extends IMountService.Stub  
  6.   
  7.               // Adoptable public disks are visible to apps, since they meet  
  8.               // public API requirement of being in a stable location.  
  9. -            if (vol.disk.isAdoptable() || vol.isPhoneStorage()) {  
  10. +            if (vol.disk.isAdoptable() || vol.isPhoneStorage() || vol.isUSBOTG()) {  
  11.                  vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;  
  12.              }  

十二:进入相机时亮度最大,退出还原

(vendor/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java)

[java]  view plain  copy
  1. 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  
  2. index 4f3234c..a68047a 100755  
  3. --- a/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java  
  4. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java  
  5. @@ -394,7 +394,14 @@ public class CameraActivity extends ActivityBase implements  
  6.          CameraPerformanceTracker.onEvent(TAG,  
  7.                  CameraPerformanceTracker.NAME_CAMERA_ON_RESUME,  
  8.                  CameraPerformanceTracker.ISEND);  
  9. +        setScreenBrightness(1.0f);  
  10.      }  
  11. +     private void setScreenBrightness(float value) {  
  12. +          WindowManager.LayoutParams params = this.getWindow().getAttributes();  
  13. +          params.screenBrightness = value;  
  14. +          this.getWindow().setAttributes(params);  
  15. +    }  
  16. +       
  17.    
  18.      /**  
  19.       * the result if CameraActivity permission check.  


十三:相机中的GPS默认开启

(vendor/)

[java]  view plain  copy
  1. 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  
  2. index 2894994..e48f37e 100755  
  3. --- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java  
  4. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java  
  5. @@ -949,7 +949,7 @@ public class SettingUtils {  
  6.          }  
  7.          if (version == 2) {  
  8.              editor.putString(SettingConstants.KEY_RECORD_LOCATION,  
  9. -                    pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, false) ?  
  10. +                    pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, true) ?  
  11.                               RecordLocationPreference.VALUE_ON  
  12.                              : RecordLocationPreference.VALUE_NONE);  
  13.              version = 3;  
  14. 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  
  15. index cc6bbfd..be4fd74 100755  
  16. --- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java  
  17. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java  
  18. @@ -959,7 +959,7 @@ public class SettingCtrl {  
  19.          }  
  20.          if (version == 2) {  
  21.              editor.putString(SettingKeys.KEY_RECORD_LOCATION,  
  22. -                    pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, false)  
  23. +                    pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, true)  
  24.                      ? "on" : "none");  
  25.              version = 3;  
  26.          }  


十四:开机动画完成后,闪半张壁纸

7.0 默认不滑动的壁纸宽不用X2

frameworks/

[java]  view plain  copy
  1. diff --git a/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java  
  2. index 33ec45a..c62e223 100644  
  3. --- a/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java  
  4. +++ b/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java  
  5. @@ -2003,9 +2003,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {  
  6.      private void ensureSaneWallpaperData(WallpaperData wallpaper) {  
  7.          // We always want to have some reasonable width hint.  
  8.          int baseSize = getMaximumSizeDimension();  
  9. +/* Vanzo:zhongyeqing on: Thu, 22 Jun 2017 15:43:08 +0800 
  10. + * TODO: replace this line with your comment 
  11.          if (wallpaper.width < baseSize) { 
  12.              wallpaper.width = baseSize; 
  13.          } 
  14. + */  
  15. +// End of Vanzo: zhongyeqing  
  16.          if (wallpaper.height < baseSize) {  
  17.              wallpaper.height = baseSize;  
  18.          }  

(packages/apps/Launcher3/)

[java]  view plain  copy
  1. diff --git a/WallpaperPicker/res/values/dimens.xml b/WallpaperPicker/res/values/dimens.xml  
  2. index 0447c6d..a1ff7b7 100755  
  3. --- a/WallpaperPicker/res/values/dimens.xml  
  4. +++ b/WallpaperPicker/res/values/dimens.xml  
  5. @@ -16,7 +16,7 @@  
  6.    
  7.  <resources>  
  8.  <!-- Wallpaper picker -->  
  9. -    <dimen name="wallpaperThumbnailWidth">106.5dp</dimen>  
  10. -    <dimen name="wallpaperThumbnailHeight">94.5dp</dimen>  
  11. +    <dimen name="wallpaperThumbnailWidth">48dp</dimen>  
  12. +    <dimen name="wallpaperThumbnailHeight">85dp</dimen>  
  13.      <dimen name="wallpaperItemIconSize">32dp</dimen>  
  14.  </resources>  
  15.   
  16. diff --git a/src/com/android/launcher3/util/WallpaperUtils.java b/src/com/android/launcher3/util/WallpaperUtils.java  
  17. index b9fccbc..6a78892 100755  
  18. --- a/src/com/android/launcher3/util/WallpaperUtils.java  
  19. +++ b/src/com/android/launcher3/util/WallpaperUtils.java  
  20. @@ -110,13 +110,15 @@ public final class WallpaperUtils {  
  21.    
  22.              // We need to ensure that there is enough extra space in the wallpaper  
  23.              // for the intended parallax effects  
  24. +            Point realSize = new Point();  
  25. +            windowManager.getDefaultDisplay().getRealSize(realSize);  
  26.              final int defaultWidth, defaultHeight;  
  27.              if (res.getConfiguration().smallestScreenWidthDp >= 720) {  
  28.                  defaultWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim));  
  29.                  defaultHeight = maxDim;  
  30.              } else {  
  31. -                defaultWidth = Math.max((int) (minDim * WALLPAPER_SCREENS_SPAN), maxDim);  
  32. -                defaultHeight = maxDim;  
  33. +                defaultWidth = realSize.x;  
  34. +                defaultHeight = realSize.y;  
  35.              }  
  36.              sDefaultWallpaperSize = new Point(defaultWidth, defaultHeight);  
  37.          }  


十五:7.0 默认 mtp

(frameworks/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java)

[java]  view plain  copy
  1. diff --git a/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java  
  2. index 9d3b655..4ac7646 100644  
  3. --- a/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java  
  4. +++ b/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java  
  5. @@ -453,7 +453,7 @@ functions = addFunction(functions, UsbManager.USB_FUNCTION_ACM);  
  6.          private boolean mHostConnected;  
  7.          private boolean mSourcePower;  
  8.          private boolean mConfigured;  
  9. -        private boolean mUsbDataUnlocked;  
  10. +        private boolean mUsbDataUnlocked = true;  
  11.          private String mCurrentFunctions;  
  12.          private String mDefaultFunctions;  
  13.          private boolean mCurrentFunctionsApplied;  
  14. @@ -1361,7 +1361,7 @@ functions = addFunction(functions, UsbManager.USB_FUNCTION_ACM);  
  15.                      mUsbConfigured = mConfigured;  
  16.                      if (!mConnected) {  
  17.                          // When a disconnect occurs, relock access to sensitive user data  
  18. -                        mUsbDataUnlocked = false;  
  19. +                    //  mUsbDataUnlocked = false;  
  20.                      }  
  21.                      updateUsbNotification();  
  22.                      updateAdbNotification();  
  23. @@ -1370,7 +1370,7 @@ functions = addFunction(functions, UsbManager.USB_FUNCTION_ACM);  
  24.                          updateCurrentAccessory();  
  25.                      } else if (!mConnected) {  
  26.                          // restore defaults when USB is disconnected  
  27. -                        setEnabledFunctions(nullfalse);  
  28. +                  //    setEnabledFunctions(null, false);  
  29.                      }  
  30.                      if (mBootCompleted) {  
  31.                          updateUsbStateBroadcastIfNeeded();  

十六:7.0 电脑上显示的mtp名字

(frameworks/)

[java]  view plain  copy
  1. diff --git a/av/media/mtp/MtpServer.cpp b/av/media/mtp/MtpServer.cpp  
  2. index 9f5d3b7..2a219be 100755  
  3. --- a/av/media/mtp/MtpServer.cpp  
  4. +++ b/av/media/mtp/MtpServer.cpp  
  5. @@ -500,7 +500,13 @@ MtpResponseCode MtpServer::doGetDeviceInfo() {  
  6.      mData.putString(string);   // Manufacturer  
  7.    
  8.      property_get("ro.product.model", prop_value, "MTP Device");  
  9. +  
  10. +/* 
  11. + * TODO: replace this line with your comment 
  12.      string.set(prop_value); 
  13. + */  
  14. +    string.set("ADVAN S50H");  
  15. +// End of  
  16.      mData.putString(string);   // Model  
  17.      string.set("1.0");  
  18.      mData.putString(string);   // Device Version  
  19. diff --git a/base/media/java/android/mtp/MtpDatabase.java b/base/media/java/android/mtp/MtpDatabase.java  
  20. index 794b893..027395b 100755  
  21. --- a/base/media/java/android/mtp/MtpDatabase.java  
  22. +++ b/base/media/java/android/mtp/MtpDatabase.java  
  23. @@ -44,6 +44,7 @@ import java.io.IOException;  
  24.  import java.util.HashMap;  
  25.  import java.util.Locale;  
  26.  import java.util.concurrent.atomic.AtomicBoolean;  
  27. +import android.os.SystemProperties;  
  28.    
  29.  /**  
  30.   * {@hide}  
  31. @@ -851,18 +852,81 @@ public class MtpDatabase implements AutoCloseable {  
  32.    
  33.      private int getDeviceProperty(int property, long[] outIntValue, char[] outStringValue) {  
  34.          Log.d(TAG, "getDeviceProperty  property = 0x" + Integer.toHexString(property));  
  35. +        String value = "",deviceName;  
  36. +        int length = 0,lengthDeviceName = 0;  
  37.    
  38.          switch (property) {  
  39.              case MtpConstants.DEVICE_PROPERTY_SYNCHRONIZATION_PARTNER:  
  40. +                //Ainge  
  41. +                // writable string properties kept in shared preferences  
  42. +                value = mDeviceProperties.getString(Integer.toString(property), "");   
  43. +                length = value.length();  
  44. +                if (length > 255) {  
  45. +                    length = 255;   
  46. +                }      
  47. +                value.getChars(0, length, outStringValue, 0);  
  48. +                outStringValue[length] = 0;   
  49. +                /// M: Added for USB Develpment debug, more log for more debuging help @{  
  50. +                if(length > 0) {   
  51. +                    Log.d(TAG, "getDeviceProperty  property = " + Integer.toHexString(property));  
  52. +                    Log.d(TAG, "getDeviceProperty  value = " + value + ", length = " + length);  
  53. +                }      
  54. +                Log.d(TAG, "getDeviceProperty  length = " + length);  
  55. +                /// M: Added Modification for ALPS00278882 @{  
  56. +                // Return the device name for the PC display if the FriendlyName is empty!!  
  57. +                deviceName = "ADVAN S50H";  
  58. +                 
  59. +                lengthDeviceName = deviceName.length();  
  60. +                if (lengthDeviceName > 255) {  
  61. +                    lengthDeviceName = 255;   
  62. +                }      
  63. +                if(lengthDeviceName >0) {  
  64. +                    deviceName.getChars(0, lengthDeviceName, outStringValue, 0);  
  65. +                    outStringValue[lengthDeviceName] = 0;   
  66. +                    Log.d(TAG, "getDeviceProperty  deviceName = " + deviceName + ", lengthDeviceName = " + lengthDeviceName);  
  67. +                } else {  
  68. +                    Log.d(TAG, "getDeviceProperty  lengthDeviceName = " + lengthDeviceName);  
  69. +                }      
  70. +                /// M: @}  
  71. +                return MtpConstants.RESPONSE_OK;  
  72.              case MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME:  
  73.                  // writable string properties kept in shared preferences  
  74. -                String value = mDeviceProperties.getString(Integer.toString(property), "");  
  75. -                int length = value.length();  
  76. +                //String value = mDeviceProperties.getString(Integer.toString(property), "");  
  77. +                //int length = value.length();  
  78. +                value = mDeviceProperties.getString(Integer.toString(property), "");  
  79. +                length = value.length();  
  80.                  if (length > 255) {  
  81.                      length = 255;  
  82.                  }  
  83.                  value.getChars(0, length, outStringValue, 0);  
  84.                  outStringValue[length] = 0;  
  85. +                /// M: Added for USB Develpment debug, more log for more debuging help @{  
  86. +                if(length > 0) {  
  87. +                    Log.d(TAG, "getDeviceProperty  property = " + Integer.toHexString(property));  
  88. +                    Log.d(TAG, "getDeviceProperty  value = " + value + ", length = " + length);  
  89. +                }  
  90. +                else if(SystemProperties.get("ro.sys.usb.mtp.whql.enable").equals("0"))  
  91. +                {  
  92. +                    Log.d(TAG, "getDeviceProperty  length = " + length);  
  93. +                  /// M: Added Modification for ALPS00278882 @{  
  94. +                    if(property == MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME) {  
  95. +                        // Return the device name for the PC display if the FriendlyName is empty!!  
  96. +                        deviceName = "ADVAN S50H";  
  97. +                        lengthDeviceName = deviceName.length();  
  98. +                        if (lengthDeviceName > 255) {  
  99. +                            lengthDeviceName = 255;  
  100. +                        }  
  101. +                        if(lengthDeviceName >0) {  
  102. +                            deviceName.getChars(0, lengthDeviceName, outStringValue, 0);  
  103. +                            outStringValue[lengthDeviceName] = 0;  
  104. +                            Log.d(TAG, "getDeviceProperty  deviceName = " + deviceName + ", lengthDeviceName = " + lengthDeviceName);  
  105. +                        } else {  
  106. +                            Log.d(TAG, "getDeviceProperty  lengthDeviceName = " + lengthDeviceName);  
  107. +                        }  
  108. +                    }  
  109. +                    /// M: @}  
  110. +                }  
  111. +                /// M: @}  
  112.                  return MtpConstants.RESPONSE_OK;  
  113.    
  114.              case MtpConstants.DEVICE_PROPERTY_IMAGE_SIZE:  

十七:设置 > SIM卡应用 > 短信            删除总是询问

(packages/apps/Settings/)

(ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java)

[java]  view plain  copy
  1. diff --git a/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java b/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java  
  2.    index 38b192b..2ea8474 100644  
  3.    --- a/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java  
  4.    +++ b/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java  
  5.    @@ -29,7 +29,7 @@ public class DefaultRCSSettings implements IRCSSettings {  
  6.          */  
  7.         public boolean isNeedAskFirstItemForSms() {  
  8.            Log.d("@M_" + TAG, "isNeedAskFirstItemForSms");  
  9.   -        return true;  
  10.   +        return false;  
  11.        }  
  12.     
  13.        /**  

(src/com/android/settings/sim/SimDialogActivity.java)

[java]  view plain  copy
  1. @@ -619,13 +626,9 @@ public class SimDialogActivity extends Activity {  
  2.    
  3.            if (value < 1) {  
  4.                int length = subInfoList == null ? 0 : subInfoList.size();  
  5.   -            if (length == 1) {  
  6.                    subId = subInfoList.get(value).getSubscriptionId();  
  7.   -            } else {  
  8.   -                subId = DefaultSmsSimSettings.ASK_USER_SUB_ID;  
  9.   -            }  
  10.            } else if (value >= 1 && value < subInfoList.size() + 1) {  
  11.   -            subId = subInfoList.get(value - 1).getSubscriptionId();  
  12.   +            subId = subInfoList.get(value).getSubscriptionId();  
  13.            } else {  
  14.                /// M: for plug-in  
  15.                subId = mSimManagementExt.getDefaultSmsSubIdForAuto();  


十八:设置 > SIM卡应用 > 短信       默认SIM卡1

(packages/apps/Settings/)

(src/com/android/settings/sim/SimDialogActivity.java)

[java]  view plain  copy
  1. <span style="font-size:10px;">@@ -72,6 +72,7 @@ public class SimDialogActivity extends Activity {  
  2.        public static final int CALLS_PICK = 1;  
  3.        public static final int SMS_PICK = 2;  
  4.        public static final int PREFERRED_PICK = 3;  
  5.   +    public static final int DEFAULT_DATA_PICK = 4;  
  6.     
  7.        @Override  
  8.        protected void onCreate(Bundle savedInstanceState) {  
  9.   @@ -118,6 +119,9 @@ public class SimDialogActivity extends Activity {  
  10.                    /// @}  
  11.                    displayPreferredDialog(extras.getInt(PREFERRED_SIM));  
  12.                    break;  
  13.   +            case DEFAULT_DATA_PICK:  
  14.   +                setDefaultSmsSubId(this,extras.getInt(PREFERRED_SIM));  
  15.   +                break;  
  16.                default:  
  17.                    throw new IllegalArgumentException("Invalid dialog type " + dialogType + " sent.");  
  18.            }</span>  


(src/com/android/settings/sim/SimSelectNotification.java)

[java]  view plain  copy
  1. @@ -172,27 +174,43 @@ public class SimSelectNotification extends BroadcastReceiver {  
  2.               /// @}  
  3.    
  4.               // If there is only one subscription, ask if user wants to use if for everything  
  5.  +            Log.i("rmy""---------- one sim --------------");  
  6.               Intent newIntent = new Intent(context, SimDialogActivity.class);  
  7.               newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
  8.  -            newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.PREFERRED_PICK);  
  9.  -            newIntent.putExtra(SimDialogActivity.PREFERRED_SIM, sil.get(0).getSimSlotIndex());  
  10.  +            newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DEFAULT_DATA_PICK);  
  11.  +            Log.i("rmy""getSimSlotIndex() ="+ sil.get(0).getSimSlotIndex());  
  12.  +            Log.i("rmy""getSubscriptionId() = "+ sil.get(0).getSubscriptionId());  
  13.  +            newIntent.putExtra(SimDialogActivity.PREFERRED_SIM, sil.get(0).getSubscriptionId());  
  14.               context.startActivity(newIntent);  
  15.  +            setDefaultSmsSubId(context,sil.get(0).getSubscriptionId());  
  16.  +  
  17.               /// M: for [C2K OMH Warning]  
  18.               OmhEventHandler.getInstance(context).sendEmptyMessage(OmhEventHandler.SET_BUSY);  
  19.  -        } else if (!dataSelected ||  
  20.  -            /// M: Op01 open market request. @{  
  21.  -                SystemProperties.get("ro.cmcc_light_cust_support").equals("1")) {  
  22.  -            /// @}  
  23.  +            } else{  
  24.  +            Log.i("rmy""---------- two sim --------------");  
  25.               // If there are multiple, ensure they pick default data  
  26.  -            Intent newIntent = new Intent(context, SimDialogActivity.class);  
  27.  -            newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
  28.  -            newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DATA_PICK);  
  29.  -            context.startActivity(newIntent);  
  30.  -            /// M: for [C2K OMH Warning]  
  31.  -            OmhEventHandler.getInstance(context).sendEmptyMessage(OmhEventHandler.SET_BUSY);  
  32.  +            if (!dataSelected){  
  33.  +                Intent newIntent = new Intent(context, SimDialogActivity.class);  
  34.  +                newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
  35.  +                newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DEFAULT_DATA_PICK);  
  36.  +                newIntent.putExtra(SimDialogActivity.PREFERRED_SIM, sil.get(0).getSubscriptionId());  
  37.  +                context.startActivity(newIntent);  
  38.  +            }  
  39.  +  
  40.  +            if (!smsSelected){  
  41.  +                setDefaultSmsSubId(context,sil.get(0).getSubscriptionId());  
  42.  +            }  

一:去除摄像头的假对焦框

(vendor/)

(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/FocusManager.java)

[java]  view plain  copy
  1.  import java.util.ArrayList;  
  2.  import java.util.List;  
  3. +import com.android.camera.ui.FocusIndicatorRotateLayout.Listener;  
  4.    
  5.  /** 
  6.   * A class that handles everything about focus in still picture mode. This also handles the metering 
  7. @@ -56,7 +57,7 @@ import java.util.List; 
  8.   * Touch the screen to change metering area. 
  9.   */  
  10.  public class FocusManager implements CameraActivity.OnOrientationListener,  
  11. -        CameraActivity.OnParametersReadyListener {  
  12. +        CameraActivity.OnParametersReadyListener,FocusIndicatorRotateLayout.Listener {  
  13.      private static final String TAG = "FocusManager";  
  14.    
  15.      private static final int RESET_TOUCH_FOCUS = 0;  
  16. @@ -86,6 +87,11 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  17.      private Matrix mMatrix;  
  18.      private Matrix mObjextMatrix;  
  19.    
  20. +    private boolean mNeedPlaySound = false;  
  21.      // The parent layout that includes only the focus indicator.  
  22.      private FocusIndicatorRotateLayout mFocusIndicatorRotateLayout;  
  23.      // The focus indicator view that holds the image resource.  
  24. @@ -228,6 +234,14 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  25.          mParameters = parameters;  
  26.          mFocusAreaSupported = (mParameters.getMaxNumFocusAreas() > 0 && isSupported(  
  27.                  Parameters.FOCUS_MODE_AUTO, mParameters.getSupportedFocusModes()));  
  28.   
  29. +        if (mFocusIndicatorRotateLayout != null) {  
  30. +            mFocusIndicatorRotateLayout.mCustomFocusSupported = mFocusAreaSupported;  
  31. +            mFocusIndicatorRotateLayout.setCustomListener(this);  
  32. +        }  
  33.          // mLockAeAwbNeeded = (mInitialParameters.isAutoExposureLockSupported()  
  34.          // ||  
  35.          // mInitialParameters.isAutoWhiteBalanceLockSupported());  
  36. @@ -427,9 +441,23 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  37.          }  
  38.          mListener.setFocusParameters();  
  39.          if (moving) {  
  40. +            if (!mFocusAreaSupported) {  
  41. +                Log.e("vanzo","mNeedPlaySound-->false");  
  42. +                mNeedPlaySound = false;  
  43. +            }  
  44.              mFocusIndicatorRotateLayout.showStart();  
  45.          } else {  
  46. +/* 
  47.              mFocusIndicatorRotateLayout.showSuccess(true); 
  48. + */  
  49. +            if (mFocusAreaSupported)  
  50. +                mFocusIndicatorRotateLayout.showSuccess(true);  
  51.          }  
  52.      }  
  53.    
  54. @@ -453,7 +481,11 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  55.          // Check if metering area or focus area is supported.  
  56.          if (!mFocusAreaSupported) {  
  57.              Log.i(TAG, "[onSingleTapUp] mFocusAreaSupported is false");  
  58.    
  59. +        //  return;  
  60.   
  61.   
  62.          }  
  63.          if (!mInitialized || mState == STATE_FOCUSING_SNAP_ON_FINISH || mState == STATE_UNKNOWN) {  
  64.              return;  
  65. @@ -528,6 +560,14 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  66.          // it can't be called twice when focusing.  
  67.          mListener.stopFaceDetection();  
  68.    
  69. +            if (!mFocusAreaSupported) {  
  70. +                Log.e("vanzo","mNeedPlaySound-->true");  
  71. +                mNeedPlaySound = true;  
  72. +            }  
  73.          // Set the focus area and metering area.  
  74.          mListener.setFocusParameters();  
  75.          Log.i(TAG, "onSingleTapUp,  mFocusAreaSupported " + mFocusAreaSupported);  
  76. @@ -573,7 +613,13 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  77.              getFrameview().resume();  
  78.          }  
  79.          mState = STATE_IDLE;  
  80. +/* 
  81.          updateFocusUI(); 
  82. + */  
  83. +        if (mFocusAreaSupported)  
  84. +            updateFocusUI();  
  85. +// End of Vanzo:tangshenghu  
  86.          mHandler.removeMessages(RESET_TOUCH_FOCUS);  
  87.      }  
  88.    
  89. @@ -968,4 +1014,13 @@ public class FocusManager implements CameraActivity.OnOrientationListener,  
  90.          return isSupported;  
  91.      }  
  92.    
  93. +    @Override  
  94. +    public void playFocusSound() {  
  95. +        if (mListener != null && mNeedPlaySound)  
  96. +            mListener.playSound(MediaActionSound.FOCUS_COMPLETE);  
  97. +    }  
  98.  }  

(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/actor/PhotoActor.java)

[java]  view plain  copy
  1.          // The next steps will be excuted only at the first time.  
  2.          mCameraActivity.getFrameManager().initializeFrameView(false);  
  3.          mIsInitialized = true;  
  4. +        mHandler.postDelayed(new Runnable() {  
  5. +            public void run() {  
  6. +            if(mCameraActivity==null||mCameraActivity.getParameters()==null){  
  7. +                return;  
  8. +             }  
  9. +            if (mCameraActivity.getParameters().getMaxNumFocusAreas() == 0)  
  10. +                mCameraActivity.getFocusManager().onAutoFocusMoving(true);  
  11. +            }  
  12. +        }, 1000);  
  13.      }  
  14.        
  15.      private void startPreview(boolean needStop) {  
  16. @@ -983,7 +996,13 @@ public class PhotoActor extends CameraActor implements FocusManager.Listener,  
  17.                
  18.              if (mModuleManager.onSingleTapUp(view, x, y)) {  
  19.                  Log.i(TAG, "[onSingleTapUp] module manager has handled it,return.");  
  20. +            //  return;  
  21. +                if (mCameraActivity.getCameraId() == 1)  
  22. +                    return;  
  23.              }  
  24.    
  25.              focusManager.onSingleTapUp(x, y);  

(mediatek/proprietary/packages/apps/Camera/src/com/android/camera/ui/FocusIndicatorRotateLayout.java)

[java]  view plain  copy
  1.      private Runnable mDisappear = new Disappear();  
  2.      private Runnable mEndAction = new EndAction();  
  3. +    private Runnable mShowAction = new ShowAction();  
  4. +    public boolean mCustomFocusSupported = true;  
  5. +    Listener mListener = null;  
  6. +    public interface Listener {  
  7. +        void playFocusSound();  
  8. +    }  
  9.      private static final int SCALING_UP_TIME = 1000;  
  10.      private static final int SCALING_DOWN_TIME = 200;  
  11.      private static final int DISAPPEAR_TIMEOUT = 200;  
  12. @@ -100,8 +110,20 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd  
  13.          Log.d(TAG, "showStart mState = " + mState);  
  14.          if (mState == STATE_IDLE) {  
  15.              setDrawable(R.drawable.ic_focus_focusing);  
  16. +/* 
  17.              animate().withLayer().setDuration(SCALING_UP_TIME).scaleX(1.5f).scaleY(1.5f); 
  18.              mState = STATE_FOCUSING; 
  19. + */  
  20. +            if (mCustomFocusSupported) {  
  21. +                animate().withLayer().setDuration(SCALING_UP_TIME).scaleX(1.5f).scaleY(1.5f);  
  22. +                mState = STATE_FOCUSING;  
  23. +            } else {  
  24. +                mState = STATE_FOCUSING;  
  25. +                animate().withLayer().setDuration(SCALING_UP_TIME)  
  26. +                        .scaleX(1.5f).scaleY(1.5f).withEndAction(mShowAction);  
  27. +            }  
  28.          }  
  29.      }  
  30.    
  31. @@ -113,6 +135,12 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd  
  32.              animate().withLayer().setDuration(SCALING_DOWN_TIME).scaleX(1f).scaleY(1f)  
  33.                      .withEndAction(timeout ? mEndAction : null);  
  34.              mState = STATE_FINISHING;  
  35. +            if (!mCustomFocusSupported && mListener != null)  
  36. +                mListener.playFocusSound();  
  37.          }  
  38.      }  
  39.    
  40. @@ -145,6 +173,17 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd  
  41.          }  
  42.      }  
  43.    
  44. +    private class ShowAction implements Runnable {  
  45. +        @Override  
  46. +        public void run() {  
  47. +            // Keep the focus indicator for some time.  
  48. +            showSuccess(true);  
  49. +        }  
  50. +    }  
  51.      private class Disappear implements Runnable {  
  52.          @Override  
  53.          public void run() {  
  54. @@ -175,4 +214,11 @@ public class FocusIndicatorRotateLayout extends RotateLayout implements FocusInd  
  55.          }  
  56.          return true;  
  57.      }  
  58. +    public void setCustomListener(Listener listener) {  
  59. +        mListener = listener;  
  60. +    }  

二:插卡开机时去掉通知栏中的读取sim卡联系人的提示消息
(packages/apps/Contacts/SimProcessor/src/com/mediatek/simprocessor/SimProcessorService.java)

[java]  view plain  copy
  1.          ExtensionManager.registerApplicationContext(getApplication());  
  2.          mProcessorManager = new SimProcessorManager(this, mListener);  
  3.    
  4. +/* 
  5.          Notification notification = new Notification(android.R.drawable.ic_dialog_alert, 
  6.                  ONGOING_NOTIFICATION, System.currentTimeMillis()); 
  7.          startForeground(ONGOING_NOTIFICATION_ID, notification); 
  8. +*/  
  9.      }  
  10.    
  11.      @Override  
  12. @@ -100,7 +102,7 @@ public class SimProcessorService extends Service {  
  13.      public void onDestroy() {  
  14.          super.onDestroy();  
  15.          Log.i(TAG, "[onDestroy]...");  
  16. -        stopForeground(true);  
  17. +//        stopForeground(true);  
  18.          System.exit(0);  
  19.      }  

三:更换默认锁屏壁纸
(frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java)

[java]  view plain  copy
  1. 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  
  2. index 9cf7063..d896704 100644  
  3. --- a/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java  
  4. +++ b/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java  
  5. @@ -51,6 +51,7 @@ import android.graphics.Rect;  
  6.  import android.graphics.drawable.BitmapDrawable;  
  7.  import android.graphics.drawable.ColorDrawable;  
  8.  import android.graphics.drawable.Drawable;  
  9. +import android.graphics.Bitmap;  
  10.  import android.inputmethodservice.InputMethodService;  
  11.  import android.media.AudioAttributes;  
  12.  import android.media.MediaMetadata;  
  13. @@ -176,6 +177,11 @@ import com.android.systemui.statusbar.stack.NotificationStackScrollLayout.OnChil  
  14.  import com.android.systemui.statusbar.stack.StackStateAnimator;  
  15.  import com.android.systemui.statusbar.stack.StackViewState;  
  16.  import com.android.systemui.volume.VolumeComponent;  
  17. +import android.app.WallpaperManager;  
  18. +import java.io.ByteArrayInputStream;  
  19. +import java.io.ByteArrayOutputStream;  
  20. +import java.io.IOException;  
  21. +import android.provider.Settings;  
  22.  /// M: BMW  
  23.  import com.mediatek.multiwindow.MultiWindowManager;  
  24.    
  25. @@ -749,6 +755,28 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,  
  26.    
  27.          mScreenPinningRequest = new ScreenPinningRequest(mContext);  
  28.          mFalsingManager = FalsingManager.getInstance(mContext);  
  29. +/*  
  30. + * TODO: replace this line with your comment 
  31. + */  
  32. +        if(Settings.System.getInt(mContext.getContentResolver(),"def_lock_wall_vanzo",0) != 1){  
  33. +            Settings.System.putInt(mContext.getContentResolver(),"def_lock_wall_vanzo" , 1);  
  34. +            WallpaperManager wallpaperManager = WallpaperManager.getInstance(mContext);  
  35. +            BitmapDrawable bitmapDrawable = (BitmapDrawable)mContext.getResources().getDrawable(R.drawable.default_lock_wallpaper);  
  36. +            Bitmap defaultLockWallpaper = bitmapDrawable.getBitmap();  
  37. +            ByteArrayOutputStream tmpOut = new ByteArrayOutputStream(2048);  
  38. +            if (defaultLockWallpaper.compress(Bitmap.CompressFormat.PNG, 100,tmpOut)) {  
  39. +                try {  
  40. +                    byte[] outByteArray = tmpOut.toByteArray();  
  41. +                    wallpaperManager.setStream(new ByteArrayInputStream(outByteArray),   
  42. +                            nulltrue, WallpaperManager.FLAG_LOCK);  
  43. +                } catch (IOException e) {  
  44. +                    Log.e(TAG, "IOException", e);  
  45. +                } catch (SecurityException e) {  
  46. +                    Log.w(TAG, "SecurityException", e);  
  47. +                }  
  48. +            }  
  49. +        }  
  50.      }  
  51.    
  52.      protected void createIconController() {  

四:未接来电或未读短信没有显示未读数量
(packages/providers/)
(ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java)

[java]  view plain  copy
  1. diff --git a/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java b/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java  
  2. index 70c56d6..0916739 100644  
  3. --- a/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java  
  4. +++ b/ContactsProvider/src/com/android/providers/contacts/DbModifierWithNotification.java  
  5. @@ -113,6 +113,15 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  6.              notifyCallLogChange();  
  7.          }  
  8.    
  9. +/* 
  10. + * launcher show unread call 
  11. + */  
  12. +        /** M: notify miss call & unread VVM count @{ */  
  13. +        if (rowId > 0) {  
  14. +            notifyNewCallsCount();  
  15. +        }  
  16. +  
  17.          return rowId;  
  18.      }  
  19.    
  20. @@ -131,6 +140,15 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  21.              notifyCallLogChange();  
  22.          }  
  23.    
  24. +/* 
  25. + * launcher show unread call 
  26. + */  
  27. +        /** M: notify miss call & unread VVM count @{ */  
  28. +        if (rowId > 0) {  
  29. +            notifyNewCallsCount();  
  30. +        }  
  31. +  
  32.          return rowId;  
  33.      }  
  34.    
  35. @@ -145,6 +163,17 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  36.          }  
  37.      }  
  38.    
  39. +/* 
  40. + * launcher show unread call 
  41. + */  
  42. +    /** 
  43. +     * M: notify launcher to display the count of missed call & VVM. 
  44. +     * */  
  45. +    private void notifyNewCallsCount() {  
  46. +        CallLogProviderEx.notifyNewCallsCount(mContext);  
  47. +    }  
  48. +  
  49.      private void notifyVoicemailChangeOnInsert(Uri notificationUri, Set<String> packagesModified) {  
  50.          if (mIsCallsTable) {  
  51.              notifyVoicemailChange(notificationUri, packagesModified,  
  52. @@ -183,6 +212,15 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  53.              notifyCallLogChange();  
  54.          }  
  55.    
  56. +/* 
  57. + * launcher show unread call 
  58. + */  
  59. +        /** M: notify miss call & unread VVM count @{ */  
  60. +        if (count > 0) {  
  61. +            notifyNewCallsCount();  
  62. +        }  
  63. +  
  64.          return count;  
  65.      }  
  66.    
  67. @@ -217,6 +255,15 @@ public class DbModifierWithNotification implements DatabaseModifier {  
  68.              notifyCallLogChange();  
  69.          }  
  70.    
  71. /* 
  72. + * launcher show unread call 
  73. + */  
  74. +        /** M: notify miss call & unread VVM count @{ */  
  75. +        if (count > 0) {  
  76. +            notifyNewCallsCount();  
  77. +        }  
  78. +  
  79.          return count;  
  80.      }  
(ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java)

[java]  view plain  copy
  1. diff --git a/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java b/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java  
  2. index 1f6aaa4..61b9913 100755  
  3. --- a/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java  
  4. +++ b/ContactsProvider/src/com/mediatek/providers/contacts/CallLogProviderEx.java  
  5. @@ -26,10 +26,15 @@ import android.content.ContentUris;  
  6.  import android.content.ContentValues;  
  7.  import android.content.Context;  
  8.  import android.content.UriMatcher;  
  9. +import android.content.ComponentName;  
  10. +import android.content.Intent;  
  11.  import android.database.Cursor;  
  12.  import android.database.DatabaseUtils;  
  13.  import android.database.sqlite.SQLiteDatabase;  
  14. +import android.database.sqlite.SQLiteException;  
  15.  import android.database.sqlite.SQLiteQueryBuilder;  
  16. +import android.database.sqlite.SQLiteStatement;  
  17. +import android.database.sqlite.SQLiteDiskIOException;  
  18.  import android.net.Uri;  
  19.  import android.os.UserHandle;  
  20.  import android.os.UserManager;  
  21. @@ -41,12 +46,16 @@ import android.telephony.PhoneNumberUtils;  
  22.  import android.text.TextUtils;  
  23.  import android.util.Log;  
  24.    
  25. +import com.android.providers.contacts.ContactsDatabaseHelper;  
  26. +import android.provider.Settings;  
  27.  import com.android.providers.contacts.CallLogDatabaseHelper;  
  28.  import com.android.providers.contacts.CallLogDatabaseHelper.Tables;  
  29.  import com.android.providers.contacts.ContactsProvider2;  
  30.  import com.android.providers.contacts.DatabaseModifier;  
  31.  import com.android.providers.contacts.DbModifierWithNotification;  
  32.  import com.android.providers.contacts.VoicemailPermissions;  
  33. +import com.android.providers.contacts.ContactsDatabaseHelper.DbProperties;  
  34. +import com.android.providers.contacts.util.SelectionBuilder;  
  35.  import com.android.providers.contacts.util.UserUtils;  
  36.  import com.mediatek.providers.contacts.CallLogSearchSupport;  
  37.  import com.mediatek.providers.contacts.ContactsProviderUtils;  
  38. @@ -87,6 +96,18 @@ public class CallLogProviderEx {  
  39.          mContext = context;  
  40.      }  
  41.    
  42. +    private interface LegacyConstants {  
  43. +        /** Table name used in the contacts DB.*/  
  44. +        String CALLS_LEGACY = "calls";  
  45. +  
  46. +        /** Table name used in the contacts DB.*/  
  47. +        String VOICEMAIL_STATUS_LEGACY = "voicemail_status";  
  48. +  
  49. +        /** Prop name used in the contacts DB.*/  
  50. +        String CALL_LOG_LAST_SYNCED_LEGACY = "call_log_last_synced";  
  51. +    }  
  52. +  
  53. +  
  54.      public static synchronized CallLogProviderEx getInstance(Context context) {  
  55.          if (sCallLogProviderEx == null) {  
  56.              sCallLogProviderEx = new CallLogProviderEx(context);  
  57. @@ -240,6 +261,73 @@ public class CallLogProviderEx {  
  58.                          .appendPath("call_log").build(), nullfalse);  
  59.      }  
  60.    
  61. +    // send new Calls broadcast to launcher to update unread icon  
  62. +    public static final void notifyNewCallsCount(Context context) {  
  63. +        SQLiteDatabase db = null;  
  64. +        Cursor c = null;  
  65. +        int newCallsCount = 0;  
  66. +/* 
  67. +        try { 
  68. +            Cursor cursor = context.getContentResolver().query(CallLog.Calls.CONTENT_URI, 
  69. +                    new String[] { Calls.TYPE }, " type=?", 
  70. +                    new String[] { Calls.MISSED_TYPE + ""}, "date desc"); 
  71. +            if (cursor != null) { 
  72. +                newCallsCount = cursor.getCount(); 
  73. +                cursor.close(); 
  74. +                android.util.Log.d("yjp", "    newCallsCount : " + newCallsCount); 
  75. +            }  
  76. +            android.util.Log.d("yjp", "    cursor  : " + cursor); 
  77. +        }catch (SecurityException e ) { 
  78. +            android.util.Log.d("yjp", "  also return "); 
  79. +        //    return ; 
  80. +        } 
  81. + */  
  82. +        try {  
  83. +            db = getDatabaseHelper(context).getWritableDatabase();  
  84. +  
  85. +            if (db == null || context == null) {  
  86. +                LogUtils.w(TAG, "[notifyNewCallsCount] Cannot notify with null db or context.");  
  87. +                return;  
  88. +            }  
  89. +            android.util.Log.d("yjp""    notifyNewCallsCount  db : " + db  + "\n   Tables.CALLS : " + Tables.CALLS);  
  90. +            db.beginTransaction();  
  91. +            c = db.rawQuery("SELECT count(*) FROM " + Tables.CALLS  
  92. +                    + " WHERE " + Calls.TYPE + " in (" + Calls.MISSED_TYPE  
  93. +                    + "," + Calls.VOICEMAIL_TYPE  
  94. +                    + ") AND " + Calls.NEW + "=1"null);  
  95. +            if (c != null && c.moveToFirst()) {  
  96. +                newCallsCount = c.getInt(0);  
  97. +            }  
  98. +        } catch (SQLiteException e) {  
  99. +            LogUtils.w(TAG, "[notifyNewCallsCount] SQLiteException:" + e);  
  100. +            return;  
  101. +        } finally {  
  102. +            if (c != null) {  
  103. +                c.close();  
  104. +            }  
  105. +            db.endTransaction();  
  106. +        }  
  107. +  
  108. +        LogUtils.i(TAG, "[notifyNewCallsCount] newCallsCount = " + newCallsCount);  
  109. +        //send count=0 to clear the unread icon  
  110. +        if (newCallsCount >= 0) {  
  111. +            Intent newIntent = new Intent(Intent.ACTION_UNREAD_CHANGED);  
  112. +            newIntent.putExtra(Intent.EXTRA_UNREAD_NUMBER, newCallsCount);  
  113. +            newIntent.putExtra(Intent.EXTRA_UNREAD_COMPONENT,  
  114. +                    new ComponentName(ConstantsUtils.CONTACTS_PACKAGE,  
  115. +                    ConstantsUtils.CONTACTS_DIALTACTS_ACTIVITY));  
  116. +            context.sendBroadcast(newIntent);  
  117. +            // use the public key CONTACTS_UNREAD_KEY that statement in Setting Provider.  
  118. +            Settings.System.putInt(context.getContentResolver(),  
  119. +                    "com_android_contacts_mtk_unread", Integer.valueOf(newCallsCount));  
  120. +        }  
  121. +    }  
  122. +  
  123. +    protected static CallLogDatabaseHelper getDatabaseHelper(final Context context) {  
  124. +        return CallLogDatabaseHelper.getInstance(context);  
  125. +    }  
  126. +  
  127.      /**  
  128.       * Returns a {@link DatabaseModifier} that takes care of sending necessary notifications  
  129.       * after the operation is performed.  

五:wifi热点名称自定义

(frameworks/)

[java]  view plain  copy
  1. diff --git a/opt/net/wifi/service/Android.mk b/opt/net/wifi/service/Android.mk  
  2. index d4becf8..e577516 100644  
  3. --- a/opt/net/wifi/service/Android.mk  
  4. +++ b/opt/net/wifi/service/Android.mk  
  5. @@ -39,6 +39,8 @@ LOCAL_SRC_FILES := \  
  6.    
  7.  LOCAL_MODULE := libwifi-hal  
  8.    
  9. +LOCAL_JAVA_LIBRARIES := bouncycastle conscrypt services telephony-common  
  10. +  
  11.  include $(BUILD_STATIC_LIBRARY)  
  12.    
  13.  # Make HAL stub library 2  
  14. 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  
  15. index a4cd27a..d56740b 100644  
  16. --- a/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java  
  17. +++ b/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java  
  18. @@ -29,7 +29,7 @@ import android.os.Handler;  
  19.  import android.os.Message;  
  20.  import android.os.Messenger;  
  21.  import android.util.Log;  
  22. -  
  23. +import android.text.TextUtils;  
  24.  import com.android.internal.util.AsyncChannel;  
  25.  import com.android.internal.R;  
  26.  import com.android.internal.util.State;  
  27. @@ -246,7 +246,14 @@ class WifiApConfigStore extends StateMachine {  
  28.         will keep the device secure after the update */  
  29.      private void setDefaultApConfiguration() {  
  30.          WifiConfiguration config = new WifiConfiguration();  
  31. -        IWifiFwkExt wifiFwkExt = MPlugin.createInstance(IWifiFwkExt.class.getName(), mContext);  
  32. +        int RandomNum = (int)(Math.random()*(9999-1000+1))+1000;  
  33. +        String tempSSID = "Kata L1_" + RandomNum;  
  34. +        Log.i("rmy""tempSSID="+tempSSID);  
  35. +        config.SSID = tempSSID;  
  36. +        if (TextUtils.isEmpty(config.SSID)) {  
  37. +            config.SSID = mContext.getString(R.string.wifi_tether_configure_ssid_default);  
  38. +        }  
  39. +        /*IWifiFwkExt wifiFwkExt = MPlugin.createInstance(IWifiFwkExt.class.getName(), mContext); 
  40.          if (SystemProperties.get("ro.mtk_bsp_package").equals("1")) { 
  41.              if (wifiFwkExt != null) { 
  42.                  config.SSID = wifiFwkExt.getApDefaultSsid(); 
  43. @@ -263,7 +270,7 @@ class WifiApConfigStore extends StateMachine { 
  44.                  config.SSID = config.SSID + random.nextInt(1000); 
  45.                  Log.d(TAG, "setDefaultApConfiguration, SSID:" + config.SSID); 
  46.              } 
  47. -        } 
  48. +        }*/  
  49.          config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);  
  50.          String randomUUID = UUID.randomUUID().toString();  
  51.          //first 12 chars from xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx  

六:camera中的GPS开关
(vendor/)

[java]  view plain  copy
  1. 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  
  2. index 2894994..e48f37e 100755  
  3. --- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java  
  4. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java  
  5. @@ -949,7 +949,7 @@ public class SettingUtils {  
  6.          }  
  7.          if (version == 2) {  
  8.              editor.putString(SettingConstants.KEY_RECORD_LOCATION,  
  9. -                    pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, false) ?  
  10. +                    pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, true) ?  
  11.                               RecordLocationPreference.VALUE_ON  
  12.                              : RecordLocationPreference.VALUE_NONE);  
  13.              version = 3;  
  14. 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  
  15. index cc6bbfd..be4fd74 100755  
  16. --- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java  
  17. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java  
  18. @@ -959,7 +959,7 @@ public class SettingCtrl {  
  19.          }  
  20.          if (version == 2) {  
  21.              editor.putString(SettingKeys.KEY_RECORD_LOCATION,  
  22. -                    pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, false)  
  23. +                    pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, true)  
  24.                      ? "on" : "none");  
  25.              version = 3;  
  26.          }  

七:设置 > 语言合输入法 > 个人字典中添加默认字符
(packages/apps/Settings/)

[java]  view plain  copy
  1. diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java  
  2. index a1cbbd3..e8f7507 100644  
  3. --- a/src/com/android/settings/SettingsActivity.java  
  4. +++ b/src/com/android/settings/SettingsActivity.java  
  5. @@ -149,6 +149,11 @@ import java.util.ArrayList;  
  6.  import java.util.List;  
  7.  import java.util.Map;  
  8.  import java.util.Set;  
  9. +import android.content.ContentResolver;  
  10. +import android.net.Uri;  
  11. +import android.provider.UserDictionary.Words;  
  12. +import android.provider.UserDictionary;  
  13. +import android.content.ContentValues;  
  14.    
  15.  /* Vanzo:tanglei on: Mon, 26 Jan 2015 16:35:50 +0800 
  16.   */  
  17. @@ -908,6 +913,36 @@ public class SettingsActivity extends Activity  
  18.          if(mDisplaySearch && !TextUtils.isEmpty(mSearchQuery)) {  
  19.              onQueryTextSubmit(mSearchQuery);  
  20.          }  
  21. +  
  22. +        if (android.provider.Settings.System.getInt(this.getContentResolver(),"first_write_contentvalues"0) == 0) {  
  23. +            ContentResolver resolver = getContentResolver();  
  24. +            int COLUMN_COUNT = 5;  
  25. +            ContentValues values = new ContentValues(COLUMN_COUNT);  
  26. +            values.put(UserDictionary.Words.WORD, "Kata");  
  27. +            values.put(UserDictionary.Words.SHORTCUT, "Kata");  
  28. +            values.put(UserDictionary.Words.FREQUENCY, 250);  
  29. +            Uri result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);  
  30. +  
  31. +            values = new ContentValues(COLUMN_COUNT);  
  32. +            values.put(UserDictionary.Words.WORD, "KataCloud");  
  33. +            values.put(UserDictionary.Words.SHORTCUT, "KataCloud");  
  34. +            values.put(UserDictionary.Words.FREQUENCY, 250);  
  35. +            result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);  
  36. +  
  37. +            values = new ContentValues(COLUMN_COUNT);  
  38. +            values.put(UserDictionary.Words.WORD, "128Online");  
  39. +            values.put(UserDictionary.Words.SHORTCUT, "128Online");  
  40. +            values.put(UserDictionary.Words.FREQUENCY, 250);  
  41. +            result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);  
  42. +  
  43. +            values = new ContentValues(COLUMN_COUNT);  
  44. +            values.put(UserDictionary.Words.WORD, "Owtel");  
  45. +            values.put(UserDictionary.Words.SHORTCUT, "Owtel");  
  46. +            values.put(UserDictionary.Words.FREQUENCY, 250);  
  47. +            result = resolver.insert(UserDictionary.Words.CONTENT_URI, values);  
  48. +  
  49. +            android.provider.Settings.System.putInt(this.getContentResolver(),"first_write_contentvalues"1);  
  50. +        }  
  51.      }  
  52.    
  53.      @Override  

八:图库中图片拉伸放大倍数

(packages/apps/Gallery2/)

[java]  view plain  copy
  1. diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java  
  2. index 07dc434..562b99b 100755  
  3. --- a/src/com/android/gallery3d/ui/PositionController.java  
  4. +++ b/src/com/android/gallery3d/ui/PositionController.java  
  5. @@ -90,7 +90,7 @@ public class PositionController {  
  6.    
  7.      // We try to scale up the image to fill the screen. But in order not to  
  8.      // scale too much for small icons, we limit the max up-scaling factor here.  
  9. -    private static final float SCALE_LIMIT = 4;  
  10. +    private static final float SCALE_LIMIT = 2.5f;  
  11.    
  12.      // For user's gestures, we give a temporary extra scaling range which goes  
  13.      // above or below the usual scaling limits.  

九:图库中双击图片放大倍数

(packages/apps/Gallery2)

[java]  view plain  copy
  1. diff --git a/src/com/android/gallery3d/ui/PositionController.java b/src/com/android/gallery3d/ui/PositionController.java  
  2. index 07dc434..562b99b 100755  
  3. --- a/src/com/android/gallery3d/ui/PositionController.java  
  4. +++ b/src/com/android/gallery3d/ui/PositionController.java  
  5. @@ -90,7 +90,7 @@ public class PositionController {  
  6.    
  7.      // We try to scale up the image to fill the screen. But in order not to  
  8.      // scale too much for small icons, we limit the max up-scaling factor here.  
  9. -    private static final float SCALE_LIMIT = 4;  
  10. +    private static final float SCALE_LIMIT = 2.5f;  
  11.    
  12.      // For user's gestures, we give a temporary extra scaling range which goes  
  13.      // 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/)

[java]  view plain  copy
  1. diff --git a/packages/SystemUpdate_for_80m/res/values/address.xml b/packages/SystemUpdate_for_80m/res/values/address.xml  
  2. index e891226..20261f7 100755  
  3. --- a/packages/SystemUpdate_for_80m/res/values/address.xml  
  4. +++ b/packages/SystemUpdate_for_80m/res/values/address.xml  
  5. @@ -1,9 +1,9 @@  
  6.  <?xml version="1.0" encoding="utf-8"?>  
  7.  <resources>  
  8. -    <string name="address_login" translatable="false">http://ota.ngmitalia.it/fota/download/login.php</string>  
  9. -    <string name="address_check_version" translatable="false">http://ota.ngmitalia.it/fota/download/checkversion.php</string>  
  10. -    <string name="address_download_full" translatable="false">http://ota.ngmitalia.it/fota/download/downloadfullota.php</string>  
  11. -    <string name="address_download_delta" translatable="false">http://ota.ngmitalia.it/fota/download/download.php</string>  
  12. +    <string name="address_login" translatable="false">客户提供</string>  
  13. +    <string name="address_check_version" translatable="false">客户提供</string>  
  14. +    <string name="address_download_full" translatable="false">客户提供</string>  
  15. +    <string name="address_download_delta" translatable="false">客户提供</string>  
  16.      <string name="address_update_result" translatable="false">updateResult</string>  
  17.      <string name="gms_load_flag" translatable="false">/system/etc/permissions/com.google.android.gms.releasenote.xml</string>      
  18.  </resources>  

4) 加入fota入口
(packages/apps/Settings/)

[java]  view plain  copy
  1. diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml  
  2. index 94e27ea..4e3a489 100644  
  3. --- a/res/values-zh-rCN/strings.xml  
  4. +++ b/res/values-zh-rCN/strings.xml  
  5. @@ -20,6 +20,7 @@  
  6.      <string name="no" msgid="6731231425810196216">"否"</string>  
  7.      <string name="create" msgid="3578857613172647409">"创建"</string>  
  8.      <string name="allow" msgid="3349662621170855910">"允许"</string>  
  9. +    <string name="system_update">系统升级</string>  
  10.      <string name="deny" msgid="6947806159746484865">"拒绝"</string>  
  11.      <string name="dlg_close" msgid="7471087791340790015">"关闭"</string>  
  12.      <string name="dlg_switch" msgid="6243971420240639064">"切换"</string>  
  13. diff --git a/res/values/strings.xml b/res/values/strings.xml  
  14. index ad5ca8c..202090e 100644  
  15. --- a/res/values/strings.xml  
  16. +++ b/res/values/strings.xml  
  17. @@ -29,7 +29,7 @@  
  18.      <string name="dlg_close">Close</string>  
  19.      <!-- Strings for Dialog switch button [CHAR LIMIT=20] -->  
  20.      <string name="dlg_switch">Switch</string>  
  21. -  
  22. +    <string name="system_update">System Update</string>  
  23.      <!-- Device Info --> <skip />  
  24.      <!-- Device Info screen. Used for a status item's value when the proper value is not known -->  
  25.      <string name="device_info_default">Unknown</string>  
  26. diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml  
  27. index 06d543a..f2dd846 100644  
  28. --- a/res/xml/device_info_settings.xml  
  29. +++ b/res/xml/device_info_settings.xml  
  30. @@ -65,6 +65,13 @@  
  31.          android:summary="@string/software_updates_more_summary" >  
  32.     </PreferenceScreen>  
  33.    
  34. +        <PreferenceScreen android:key="system_version"  
  35. +                android:title="@string/system_update">  
  36. +            <intent android:action="android.intent.action.MAIN"  
  37. +                    android:targetPackage="com.mediatek.systemupdate"  
  38. +                    android:targetClass="com.mediatek.systemupdate.MainEntry" />  
  39. +        </PreferenceScreen>  
  40. +  
  41.          <!-- Device status - launches activity -->  
  42.          <PreferenceScreen android:key="status_info"  
  43.                  android:title="@string/device_status"  


十一:otg做成5.1的样子,在filemanager中显示

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

[java]  view plain  copy
  1. diff --git a/base/services/core/java/com/android/server/MountService.java b/base/services/core/java/com/android/server/MountService.java  
  2.   2 index 7204af3..f38c4b0 100755  
  3.  --- a/base/services/core/java/com/android/server/MountService.java  
  4.  +++ b/base/services/core/java/com/android/server/MountService.java  
  5. @@ -1301,7 +1301,7 @@ class MountService extends IMountService.Stub  
  6.   
  7.               // Adoptable public disks are visible to apps, since they meet  
  8.               // public API requirement of being in a stable location.  
  9. -            if (vol.disk.isAdoptable() || vol.isPhoneStorage()) {  
  10. +            if (vol.disk.isAdoptable() || vol.isPhoneStorage() || vol.isUSBOTG()) {  
  11.                  vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;  
  12.              }  

十二:进入相机时亮度最大,退出还原

(vendor/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java)

[java]  view plain  copy
  1. 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  
  2. index 4f3234c..a68047a 100755  
  3. --- a/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java  
  4. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/CameraActivity.java  
  5. @@ -394,7 +394,14 @@ public class CameraActivity extends ActivityBase implements  
  6.          CameraPerformanceTracker.onEvent(TAG,  
  7.                  CameraPerformanceTracker.NAME_CAMERA_ON_RESUME,  
  8.                  CameraPerformanceTracker.ISEND);  
  9. +        setScreenBrightness(1.0f);  
  10.      }  
  11. +     private void setScreenBrightness(float value) {  
  12. +          WindowManager.LayoutParams params = this.getWindow().getAttributes();  
  13. +          params.screenBrightness = value;  
  14. +          this.getWindow().setAttributes(params);  
  15. +    }  
  16. +       
  17.    
  18.      /**  
  19.       * the result if CameraActivity permission check.  


十三:相机中的GPS默认开启

(vendor/)

[java]  view plain  copy
  1. 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  
  2. index 2894994..e48f37e 100755  
  3. --- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java  
  4. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java  
  5. @@ -949,7 +949,7 @@ public class SettingUtils {  
  6.          }  
  7.          if (version == 2) {  
  8.              editor.putString(SettingConstants.KEY_RECORD_LOCATION,  
  9. -                    pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, false) ?  
  10. +                    pref.getBoolean(SettingConstants.KEY_RECORD_LOCATION, true) ?  
  11.                               RecordLocationPreference.VALUE_ON  
  12.                              : RecordLocationPreference.VALUE_NONE);  
  13.              version = 3;  
  14. 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  
  15. index cc6bbfd..be4fd74 100755  
  16. --- a/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java  
  17. +++ b/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/v2/setting/SettingCtrl.java  
  18. @@ -959,7 +959,7 @@ public class SettingCtrl {  
  19.          }  
  20.          if (version == 2) {  
  21.              editor.putString(SettingKeys.KEY_RECORD_LOCATION,  
  22. -                    pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, false)  
  23. +                    pref.getBoolean(SettingKeys.KEY_RECORD_LOCATION, true)  
  24.                      ? "on" : "none");  
  25.              version = 3;  
  26.          }  


十四:开机动画完成后,闪半张壁纸

7.0 默认不滑动的壁纸宽不用X2

frameworks/

[java]  view plain  copy
  1. diff --git a/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java  
  2. index 33ec45a..c62e223 100644  
  3. --- a/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java  
  4. +++ b/base/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java  
  5. @@ -2003,9 +2003,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {  
  6.      private void ensureSaneWallpaperData(WallpaperData wallpaper) {  
  7.          // We always want to have some reasonable width hint.  
  8.          int baseSize = getMaximumSizeDimension();  
  9. +/* Vanzo:zhongyeqing on: Thu, 22 Jun 2017 15:43:08 +0800 
  10. + * TODO: replace this line with your comment 
  11.          if (wallpaper.width < baseSize) { 
  12.              wallpaper.width = baseSize; 
  13.          } 
  14. + */  
  15. +// End of Vanzo: zhongyeqing  
  16.          if (wallpaper.height < baseSize) {  
  17.              wallpaper.height = baseSize;  
  18.          }  

(packages/apps/Launcher3/)

[java]  view plain  copy
  1. diff --git a/WallpaperPicker/res/values/dimens.xml b/WallpaperPicker/res/values/dimens.xml  
  2. index 0447c6d..a1ff7b7 100755  
  3. --- a/WallpaperPicker/res/values/dimens.xml  
  4. +++ b/WallpaperPicker/res/values/dimens.xml  
  5. @@ -16,7 +16,7 @@  
  6.    
  7.  <resources>  
  8.  <!-- Wallpaper picker -->  
  9. -    <dimen name="wallpaperThumbnailWidth">106.5dp</dimen>  
  10. -    <dimen name="wallpaperThumbnailHeight">94.5dp</dimen>  
  11. +    <dimen name="wallpaperThumbnailWidth">48dp</dimen>  
  12. +    <dimen name="wallpaperThumbnailHeight">85dp</dimen>  
  13.      <dimen name="wallpaperItemIconSize">32dp</dimen>  
  14.  </resources>  
  15.   
  16. diff --git a/src/com/android/launcher3/util/WallpaperUtils.java b/src/com/android/launcher3/util/WallpaperUtils.java  
  17. index b9fccbc..6a78892 100755  
  18. --- a/src/com/android/launcher3/util/WallpaperUtils.java  
  19. +++ b/src/com/android/launcher3/util/WallpaperUtils.java  
  20. @@ -110,13 +110,15 @@ public final class WallpaperUtils {  
  21.    
  22.              // We need to ensure that there is enough extra space in the wallpaper  
  23.              // for the intended parallax effects  
  24. +            Point realSize = new Point();  
  25. +            windowManager.getDefaultDisplay().getRealSize(realSize);  
  26.              final int defaultWidth, defaultHeight;  
  27.              if (res.getConfiguration().smallestScreenWidthDp >= 720) {  
  28.                  defaultWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim));  
  29.                  defaultHeight = maxDim;  
  30.              } else {  
  31. -                defaultWidth = Math.max((int) (minDim * WALLPAPER_SCREENS_SPAN), maxDim);  
  32. -                defaultHeight = maxDim;  
  33. +                defaultWidth = realSize.x;  
  34. +                defaultHeight = realSize.y;  
  35.              }  
  36.              sDefaultWallpaperSize = new Point(defaultWidth, defaultHeight);  
  37.          }  


十五:7.0 默认 mtp

(frameworks/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java)

[java]  view plain  copy
  1. diff --git a/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java  
  2. index 9d3b655..4ac7646 100644  
  3. --- a/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java  
  4. +++ b/base/services/usb/java/com/android/server/usb/UsbDeviceManager.java  
  5. @@ -453,7 +453,7 @@ functions = addFunction(functions, UsbManager.USB_FUNCTION_ACM);  
  6.          private boolean mHostConnected;  
  7.          private boolean mSourcePower;  
  8.          private boolean mConfigured;  
  9. -        private boolean mUsbDataUnlocked;  
  10. +        private boolean mUsbDataUnlocked = true;  
  11.          private String mCurrentFunctions;  
  12.          private String mDefaultFunctions;  
  13.          private boolean mCurrentFunctionsApplied;  
  14. @@ -1361,7 +1361,7 @@ functions = addFunction(functions, UsbManager.USB_FUNCTION_ACM);  
  15.                      mUsbConfigured = mConfigured;  
  16.                      if (!mConnected) {  
  17.                          // When a disconnect occurs, relock access to sensitive user data  
  18. -                        mUsbDataUnlocked = false;  
  19. +                    //  mUsbDataUnlocked = false;  
  20.                      }  
  21.                      updateUsbNotification();  
  22.                      updateAdbNotification();  
  23. @@ -1370,7 +1370,7 @@ functions = addFunction(functions, UsbManager.USB_FUNCTION_ACM);  
  24.                          updateCurrentAccessory();  
  25.                      } else if (!mConnected) {  
  26.                          // restore defaults when USB is disconnected  
  27. -                        setEnabledFunctions(nullfalse);  
  28. +                  //    setEnabledFunctions(null, false);  
  29.                      }  
  30.                      if (mBootCompleted) {  
  31.                          updateUsbStateBroadcastIfNeeded();  

十六:7.0 电脑上显示的mtp名字

(frameworks/)

[java]  view plain  copy
  1. diff --git a/av/media/mtp/MtpServer.cpp b/av/media/mtp/MtpServer.cpp  
  2. index 9f5d3b7..2a219be 100755  
  3. --- a/av/media/mtp/MtpServer.cpp  
  4. +++ b/av/media/mtp/MtpServer.cpp  
  5. @@ -500,7 +500,13 @@ MtpResponseCode MtpServer::doGetDeviceInfo() {  
  6.      mData.putString(string);   // Manufacturer  
  7.    
  8.      property_get("ro.product.model", prop_value, "MTP Device");  
  9. +  
  10. +/* 
  11. + * TODO: replace this line with your comment 
  12.      string.set(prop_value); 
  13. + */  
  14. +    string.set("ADVAN S50H");  
  15. +// End of  
  16.      mData.putString(string);   // Model  
  17.      string.set("1.0");  
  18.      mData.putString(string);   // Device Version  
  19. diff --git a/base/media/java/android/mtp/MtpDatabase.java b/base/media/java/android/mtp/MtpDatabase.java  
  20. index 794b893..027395b 100755  
  21. --- a/base/media/java/android/mtp/MtpDatabase.java  
  22. +++ b/base/media/java/android/mtp/MtpDatabase.java  
  23. @@ -44,6 +44,7 @@ import java.io.IOException;  
  24.  import java.util.HashMap;  
  25.  import java.util.Locale;  
  26.  import java.util.concurrent.atomic.AtomicBoolean;  
  27. +import android.os.SystemProperties;  
  28.    
  29.  /**  
  30.   * {@hide}  
  31. @@ -851,18 +852,81 @@ public class MtpDatabase implements AutoCloseable {  
  32.    
  33.      private int getDeviceProperty(int property, long[] outIntValue, char[] outStringValue) {  
  34.          Log.d(TAG, "getDeviceProperty  property = 0x" + Integer.toHexString(property));  
  35. +        String value = "",deviceName;  
  36. +        int length = 0,lengthDeviceName = 0;  
  37.    
  38.          switch (property) {  
  39.              case MtpConstants.DEVICE_PROPERTY_SYNCHRONIZATION_PARTNER:  
  40. +                //Ainge  
  41. +                // writable string properties kept in shared preferences  
  42. +                value = mDeviceProperties.getString(Integer.toString(property), "");   
  43. +                length = value.length();  
  44. +                if (length > 255) {  
  45. +                    length = 255;   
  46. +                }      
  47. +                value.getChars(0, length, outStringValue, 0);  
  48. +                outStringValue[length] = 0;   
  49. +                /// M: Added for USB Develpment debug, more log for more debuging help @{  
  50. +                if(length > 0) {   
  51. +                    Log.d(TAG, "getDeviceProperty  property = " + Integer.toHexString(property));  
  52. +                    Log.d(TAG, "getDeviceProperty  value = " + value + ", length = " + length);  
  53. +                }      
  54. +                Log.d(TAG, "getDeviceProperty  length = " + length);  
  55. +                /// M: Added Modification for ALPS00278882 @{  
  56. +                // Return the device name for the PC display if the FriendlyName is empty!!  
  57. +                deviceName = "ADVAN S50H";  
  58. +                 
  59. +                lengthDeviceName = deviceName.length();  
  60. +                if (lengthDeviceName > 255) {  
  61. +                    lengthDeviceName = 255;   
  62. +                }      
  63. +                if(lengthDeviceName >0) {  
  64. +                    deviceName.getChars(0, lengthDeviceName, outStringValue, 0);  
  65. +                    outStringValue[lengthDeviceName] = 0;   
  66. +                    Log.d(TAG, "getDeviceProperty  deviceName = " + deviceName + ", lengthDeviceName = " + lengthDeviceName);  
  67. +                } else {  
  68. +                    Log.d(TAG, "getDeviceProperty  lengthDeviceName = " + lengthDeviceName);  
  69. +                }      
  70. +                /// M: @}  
  71. +                return MtpConstants.RESPONSE_OK;  
  72.              case MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME:  
  73.                  // writable string properties kept in shared preferences  
  74. -                String value = mDeviceProperties.getString(Integer.toString(property), "");  
  75. -                int length = value.length();  
  76. +                //String value = mDeviceProperties.getString(Integer.toString(property), "");  
  77. +                //int length = value.length();  
  78. +                value = mDeviceProperties.getString(Integer.toString(property), "");  
  79. +                length = value.length();  
  80.                  if (length > 255) {  
  81.                      length = 255;  
  82.                  }  
  83.                  value.getChars(0, length, outStringValue, 0);  
  84.                  outStringValue[length] = 0;  
  85. +                /// M: Added for USB Develpment debug, more log for more debuging help @{  
  86. +                if(length > 0) {  
  87. +                    Log.d(TAG, "getDeviceProperty  property = " + Integer.toHexString(property));  
  88. +                    Log.d(TAG, "getDeviceProperty  value = " + value + ", length = " + length);  
  89. +                }  
  90. +                else if(SystemProperties.get("ro.sys.usb.mtp.whql.enable").equals("0"))  
  91. +                {  
  92. +                    Log.d(TAG, "getDeviceProperty  length = " + length);  
  93. +                  /// M: Added Modification for ALPS00278882 @{  
  94. +                    if(property == MtpConstants.DEVICE_PROPERTY_DEVICE_FRIENDLY_NAME) {  
  95. +                        // Return the device name for the PC display if the FriendlyName is empty!!  
  96. +                        deviceName = "ADVAN S50H";  
  97. +                        lengthDeviceName = deviceName.length();  
  98. +                        if (lengthDeviceName > 255) {  
  99. +                            lengthDeviceName = 255;  
  100. +                        }  
  101. +                        if(lengthDeviceName >0) {  
  102. +                            deviceName.getChars(0, lengthDeviceName, outStringValue, 0);  
  103. +                            outStringValue[lengthDeviceName] = 0;  
  104. +                            Log.d(TAG, "getDeviceProperty  deviceName = " + deviceName + ", lengthDeviceName = " + lengthDeviceName);  
  105. +                        } else {  
  106. +                            Log.d(TAG, "getDeviceProperty  lengthDeviceName = " + lengthDeviceName);  
  107. +                        }  
  108. +                    }  
  109. +                    /// M: @}  
  110. +                }  
  111. +                /// M: @}  
  112.                  return MtpConstants.RESPONSE_OK;  
  113.    
  114.              case MtpConstants.DEVICE_PROPERTY_IMAGE_SIZE:  

十七:设置 > SIM卡应用 > 短信            删除总是询问

(packages/apps/Settings/)

(ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java)

[java]  view plain  copy
  1. diff --git a/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java b/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java  
  2.    index 38b192b..2ea8474 100644  
  3.    --- a/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java  
  4.    +++ b/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java  
  5.    @@ -29,7 +29,7 @@ public class DefaultRCSSettings implements IRCSSettings {  
  6.          */  
  7.         public boolean isNeedAskFirstItemForSms() {  
  8.            Log.d("@M_" + TAG, "isNeedAskFirstItemForSms");  
  9.   -        return true;  
  10.   +        return false;  
  11.        }  
  12.     
  13.        /**  

(src/com/android/settings/sim/SimDialogActivity.java)

[java]  view plain  copy
  1. @@ -619,13 +626,9 @@ public class SimDialogActivity extends Activity {  
  2.    
  3.            if (value < 1) {  
  4.                int length = subInfoList == null ? 0 : subInfoList.size();  
  5.   -            if (length == 1) {  
  6.                    subId = subInfoList.get(value).getSubscriptionId();  
  7.   -            } else {  
  8.   -                subId = DefaultSmsSimSettings.ASK_USER_SUB_ID;  
  9.   -            }  
  10.            } else if (value >= 1 && value < subInfoList.size() + 1) {  
  11.   -            subId = subInfoList.get(value - 1).getSubscriptionId();  
  12.   +            subId = subInfoList.get(value).getSubscriptionId();  
  13.            } else {  
  14.                /// M: for plug-in  
  15.                subId = mSimManagementExt.getDefaultSmsSubIdForAuto();  


十八:设置 > SIM卡应用 > 短信       默认SIM卡1

(packages/apps/Settings/)

(src/com/android/settings/sim/SimDialogActivity.java)

[java]  view plain  copy
  1. <span style="font-size:10px;">@@ -72,6 +72,7 @@ public class SimDialogActivity extends Activity {  
  2.        public static final int CALLS_PICK = 1;  
  3.        public static final int SMS_PICK = 2;  
  4.        public static final int PREFERRED_PICK = 3;  
  5.   +    public static final int DEFAULT_DATA_PICK = 4;  
  6.     
  7.        @Override  
  8.        protected void onCreate(Bundle savedInstanceState) {  
  9.   @@ -118,6 +119,9 @@ public class SimDialogActivity extends Activity {  
  10.                    /// @}  
  11.                    displayPreferredDialog(extras.getInt(PREFERRED_SIM));  
  12.                    break;  
  13.   +            case DEFAULT_DATA_PICK:  
  14.   +                setDefaultSmsSubId(this,extras.getInt(PREFERRED_SIM));  
  15.   +                break;  
  16.                default:  
  17.                    throw new IllegalArgumentException("Invalid dialog type " + dialogType + " sent.");  
  18.            }</span>  


(src/com/android/settings/sim/SimSelectNotification.java)

[java]  view plain  copy
  1. @@ -172,27 +174,43 @@ public class SimSelectNotification extends BroadcastReceiver {  
  2.               /// @}  
  3.    
  4.               // If there is only one subscription, ask if user wants to use if for everything  
  5.  +            Log.i("rmy""---------- one sim --------------");  
  6.               Intent newIntent = new Intent(context, SimDialogActivity.class);  
  7.               newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
  8.  -            newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.PREFERRED_PICK);  
  9.  -            newIntent.putExtra(SimDialogActivity.PREFERRED_SIM, sil.get(0).getSimSlotIndex());  
  10.  +            newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DEFAULT_DATA_PICK);  
  11.  +            Log.i("rmy""getSimSlotIndex() ="+ sil.get(0).getSimSlotIndex());  
  12.  +            Log.i("rmy""getSubscriptionId() = "+ sil.get(0).getSubscriptionId());  
  13.  +            newIntent.putExtra(SimDialogActivity.PREFERRED_SIM, sil.get(0).getSubscriptionId());  
  14.               context.startActivity(newIntent);  
  15.  +            setDefaultSmsSubId(context,sil.get(0).getSubscriptionId());  
  16.  +  
  17.               /// M: for [C2K OMH Warning]  
  18.               OmhEventHandler.getInstance(context).sendEmptyMessage(OmhEventHandler.SET_BUSY);  
  19.  -        } else if (!dataSelected ||  
  20.  -            /// M: Op01 open market request. @{  
  21.  -                SystemProperties.get("ro.cmcc_light_cust_support").equals("1")) {  
  22.  -            /// @}  
  23.  +            } else{  
  24.  +            Log.i("rmy""---------- two sim --------------");  
  25.               // If there are multiple, ensure they pick default data  
  26.  -            Intent newIntent = new Intent(context, SimDialogActivity.class);  
  27.  -            newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
  28.  -            newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DATA_PICK);  
  29.  -            context.startActivity(newIntent);  
  30.  -            /// M: for [C2K OMH Warning]  
  31.  -            OmhEventHandler.getInstance(context).sendEmptyMessage(OmhEventHandler.SET_BUSY);  
  32.  +            if (!dataSelected){  
  33.  +                Intent newIntent = new Intent(context, SimDialogActivity.class);  
  34.  +                newIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);  
  35.  +                newIntent.putExtra(SimDialogActivity.DIALOG_TYPE_KEY, SimDialogActivity.DEFAULT_DATA_PICK);  
  36.  +                newIntent.putExtra(SimDialogActivity.PREFERRED_SIM, sil.get(0).getSubscriptionId());  
  37.  +                context.startActivity(newIntent);  
  38.  +            }  
  39.  +  
  40.  +            if (!smsSelected){  
  41.  +                setDefaultSmsSubId(context,sil.get(0).getSubscriptionId());  
  42.  +            }  

猜你喜欢

转载自blog.csdn.net/zhangbijun1230/article/details/80821494