android 8.1 MTK 方案修改记录

目录

    • Music播放音乐时锁屏不需要显示专辑封面
    • 默认日期
    • 文件分享列表去掉某个app入口
    • 手势双击power键无需打开相机
    • 通话时按power键挂机
    • SystemUI 下拉状态栏去掉第三方应用快捷选项
    • SystemUI 去掉关闭数据后状态栏显示X图标
    • SystemUI 锁屏界面12小时显示上下午
    • 12小时制,锁屏/状态栏增加A/PM显示
    • SystemUI 锁屏不要显示通知
    • SystemUI 下拉状态栏电池百分比跟随设置
    • 去掉关闭网络数据时的叉号
    • 信息-设置-通知-重要程度-中(不发出提示音),非锁屏界面下无提示通知框弹出
    • Camera设置去掉位置信息
    • 相机设置拍照预览默认4:3
    • Camera 屏蔽高温报警和连拍
    • 低电量不能开启手电筒
    • 摄像头默认缩放倍率
    • Settings去掉使用GPS提供时间选项
    • 切换语言后设置中的"勿扰偏好设置"菜单下的自动规则字符串不刷新
    • mtp模式连接电脑,手机存储空间修改
    • Mms 短信界面选项拨号直接呼出
    • 默认SIM卡短信设置去掉每次都询问
    • 低电量提示音
    • SELinux 默认permissive
    • 壁纸居中不要拉伸
    • 取消关机振动
    • 关机动画播放时长/关机时长/关机动画播放不全
    • 按键机方向键EditText焦点不释放问题
    • 灭屏状态下收到短信、蓝牙收到文件,屏幕亮屏
    • 去掉设置-应用和通知-查看全部23个应用-信息-应用通知-应用中的其他设置
    • 打开设置-存储中的默认存储器菜单及功能
    • 切换语言后设置中的"勿扰偏好设置"菜单下的自动规则字符串不刷新
    • 通话录音、FM录音默认存储跟随设置
    • 预置apk后开机未安装
    • 添加虚拟键振动功能
    • 主界面hotseat打开相机,底部有白线
    • 长按Home键 取消屏幕固定
    • 客制化BT,WiFi direct,WLAN热点名称
    • 文件默认显示内部存储设备

Music播放音乐时锁屏不需要显示专辑封面

+++ b/vendor/mediatek/proprietary/packages/apps/Music/src/com/android/music/MediaPlaybackService.java
@@ -4103,7 +4103,7 @@ public class MediaPlaybackService extends Service {
                 ed.putString(MediaMetadataRetriever.METADATA_KEY_ALBUMARTIST, getArtistName());
                 ed.putLong(MediaMetadataRetriever.METADATA_KEY_DURATION, duration());
                 if (bm != null) {
-                    ed.putBitmap(MetadataEditor.BITMAP_KEY_ARTWORK, bm);
+                    //ed.putBitmap(MetadataEditor.BITMAP_KEY_ARTWORK, bm);mh.mmi
                 }
                 ed.apply();
                 /// 2. update notification album art

默认日期

+++ b/vendor/mediatek/proprietary/bootable/bootloader/preloader/custom/k37mv1_bsp_512/inc/cust_rtc.h
-#define RTC_DEFAULT_YEA                2022
-#define RTC_DEFAULT_MTH                12
+#define RTC_DEFAULT_YEA                2023
+#define RTC_DEFAULT_MTH                1

文件分享列表去掉某个app入口

+++ b/frameworks/base/core/java/com/android/internal/app/ResolverActivity.java
@@ -1428,6 +1428,12 @@ public class ResolverActivity extends Activity {
             // So far we only support a single other profile at a time.
             // The first one we see gets special treatment.
             for (ResolvedComponentInfo info : currentResolveList) {
+                               //android.util.Log.d("mh.mmi", "info.getResolveInfoAt(0):"+info.getResolveInfoAt(0).toString()+" intent:"+info.getIntentAt(0).getAction());
+                               if (info.getResolveInfoAt(0).activityInfo.packageName.equals("xxx.xxx.xxx")
+                                               && info.getIntentAt(0).getAction().equals("android.intent.action.SEND")) {
+                                       currentResolveList.remove(info);
+                                       break;
+                               }
                 if (info.getResolveInfoAt(0).targetUserId != UserHandle.USER_CURRENT) {
                     mOtherProfile = new DisplayResolveInfo(info.getIntentAt(0),

手势双击power键无需打开相机

+++ b/frameworks/base/core/res/res/values/config.xml
-    <bool name="config_cameraDoubleTapPowerGestureEnabled">true</bool>
+    <bool name="config_cameraDoubleTapPowerGestureEnabled">false</bool>

通话时按power键挂机

+++ b/frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -2373,7 +2373,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                     UserHandle.USER_CURRENT);
                     mIncallPowerBehavior = Settings.Secure.getIntForUser(resolver,
                     Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR,
-                    Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT,
+                    Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_HANGUP,
                     UserHandle.USER_CURRENT);

SystemUI 下拉状态栏去掉第三方应用快捷选项

+++ b/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java
@@ -72,7 +72,7 @@ public class TileQueryHelper {
         final Handler qsHandler = new Handler((Looper) Dependency.get(Dependency.BG_LOOPER));
         final Handler mainHandler = new Handler(Looper.getMainLooper());
         addStockTiles(mainHandler, qsHandler);
-        addPackageTiles(mainHandler, qsHandler);
+        //addPackageTiles(mainHandler, qsHandler);mh.mmi

SystemUI 去掉关闭数据后状态栏显示X图标

+++ b/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java
@@ -44,7 +44,7 @@ class TelephonyIcons {
     static final int ICON_4G_PLUS = R.drawable.stat_sys_data_fully_connected_4g_plus;
     static final int ICON_1X = R.drawable.stat_sys_data_fully_connected_1x;
 
-    static final int ICON_DATA_DISABLED = R.drawable.stat_sys_data_disabled;
+    static final int ICON_DATA_DISABLED = -1;//R.drawable.stat_sys_data_disabled;

SystemUI 锁屏界面12小时显示上下午

+++ b/vendor/mediatek/proprietary/packages/apps/SystemUI/res-keyguard/layout/keyguard_status_view.xml
@@ -51,6 +51,14 @@
                 android:format12Hour="@string/keyguard_widget_12_hours_format"
                 android:format24Hour="@string/keyguard_widget_24_hours_format"
                 android:layout_marginBottom="@dimen/bottom_text_spacing_digital" />
+                <TextClock
+                      android:id="@+id/apm"
+                      android:layout_width="wrap_content"
+                      android:layout_height="wrap_content"
+                      android:layout_alignBaseline="@id/clock_view"
+                      android:singleLine="true"
+                      android:format12Hour="a"
+                      android:format24Hour=""/>
             

12小时制,锁屏/状态栏增加A/PM显示

锁屏:vendor/mediatek/proprietary/packages/apps/SystemUI/res-keyguard/values/strings.xml

-    <string name="keyguard_widget_12_hours_format" translatable="false">h:mm</string>
+    <string name="keyguard_widget_12_hours_format" translatable="false">aa</string>
vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/keyguard/KeyguardStatusView.java

@@ -308,9 +308,9 @@ public class KeyguardStatusView extends GridLayout {
             clockView12 = DateFormat.getBestDateTimePattern(locale, clockView12Skel);
             // CLDR insists on adding an AM/PM indicator even though it wasn't in the skeleton
             // format.  The following code removes the AM/PM indicator if we didn't want it.
-            if (!clockView12Skel.contains("a")) {
+            /* meng if (!clockView12Skel.contains("a")) {
                 clockView12 = clockView12.replaceAll("a", "").trim();
-            }
+            }*/
 
             clockView24 = DateFormat.getBestDateTimePattern(locale, clockView24Skel);
状态栏:vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java

@@ -108,8 +108,9 @@ public class Clock extends TextView implements DemoMode, Tunable, CommandQueue.C
         try {
             mSystemUIFactoryBase = OpSystemUICustomizationFactoryBase.getOpFactory(context);
             mStatusBarExt = mSystemUIFactoryBase.makeSystemUIStatusBar(context);
-            mAmPmStyle = mStatusBarExt.getClockAmPmStyle(a.getInt(R.styleable.Clock_amPmStyle,
-                    AM_PM_STYLE_GONE));
+            //mAmPmStyle = mStatusBarExt.getClockAmPmStyle(a.getInt(R.styleable.Clock_amPmStyle,
+            //        AM_PM_STYLE_GONE));
+                       mAmPmStyle = AM_PM_STYLE_NORMAL;
             mShowDark = a.getBoolean(R.styleable.Clock_showDark, true);
         } finally {
             a.recycle();

SystemUI 锁屏不要显示通知

+++ b/vendor/mediatek/proprietary/packages/apps/SettingsProvider/res/values/defaults.xml
@@ -159,7 +159,7 @@
     <integer name="def_wifi_scan_always_available">0integer>
 
     
-    <integer name="def_lock_screen_show_notifications">1integer>
+    <integer name="def_lock_screen_show_notifications">0integer>

SystemUI 下拉状态栏电池百分比跟随设置

+++ b/vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/BatteryMeterView.java
@@ -252,7 +252,7 @@ public class BatteryMeterView extends LinearLayout implements
     private void updateShowPercent() {
         final boolean showing = mBatteryPercentView != null;
         if (0 != Settings.System.getIntForUser(getContext().getContentResolver(),
-                SHOW_BATTERY_PERCENT, 0, mUser) || mForceShowPercent) {
+                SHOW_BATTERY_PERCENT, 0, mUser) /*mh.mmi || mForceShowPercent*/) {
             if (!showing) {

去掉关闭网络数据时的叉号

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/policy/TelephonyIcons.java

-    static final int ICON_DATA_DISABLED = R.drawable.stat_sys_data_disabled;
+    static final int ICON_DATA_DISABLED = -1/**R.drawable.stat_sys_data_disabled**/;
 
-    static final int QS_ICON_DATA_DISABLED = R.drawable.ic_qs_data_disabled;
+    static final int QS_ICON_DATA_DISABLED = -1/**R.drawable.ic_qs_data_disabled**/;

信息-设置-通知-重要程度-中(不发出提示音),非锁屏界面下无提示通知框弹出

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
method:shouldPeek

@@ -7578,8 +7578,8 @@ private PowerManager.WakeLock mNotificationWakeLock;
         }
 
         // Allow peeking for DEFAULT notifications only if we're on Ambient Display.
-        int importanceLevel = isDozing() ? NotificationManager.IMPORTANCE_DEFAULT
-                : NotificationManager.IMPORTANCE_HIGH;
+        int importanceLevel = NotificationManager.IMPORTANCE_LOW/*devin.20180510   isDozing() ? NotificationManager.IMPORTANCE_DEFAULT
+                : NotificationManager.IMPORTANCE_HIGH;*/
         if (mNotificationData.getImportance(sbn.getKey()) < importanceLevel) {
             if (true/**DEBUG*/) Log.d(TAG, "No peeking: unimportant notification: " + sbn.getKey());
             return false;

Camera设置去掉位置信息

+++ b/vendor/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingConstants.java
@@ -340,7 +340,7 @@ public class SettingConstants {
         ROW_SETTING_DUAL_CAMERA_MODE,
         ROW_SETTING_SHUTTER_SOUND, //common
         ROW_SETTING_AF,
-        ROW_SETTING_RECORD_LOCATION, //common
+        //ROW_SETTING_RECORD_LOCATION, //common

相机设置拍照预览默认4:3

vendor/mediatek/proprietary/packages/apps/Camera/src/com/android/camera/bridge/CameraDeviceExt.java

@@ -190,7 +190,8 @@ public class CameraDeviceExt implements ICameraDeviceExt {
                     mParametersExt);
             if (supportedRatios != null && supportedRatios.size() > 0) {
                 SharedPreferences.Editor editor = mPreferences.edit();
-                String ratioString = supportedRatios.get(supportedRatios.size() - 1);
+                //String ratioString = supportedRatios.get(supportedRatios.size() - 1);
+                               String ratioString = supportedRatios.get(0);//devin.2018420
       editor.putString(SettingConstants.KEY_PICTURE_RATIO, ratioString);
                 editor.apply();
                 pictureRatio = ratioString;
vendor/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/setting/SettingUtils.java

@@ -259,7 +259,8 @@ public class SettingUtils {
         String ratioString = null;
         if (supportedRatios != null && supportedRatios.size() > 0) {
             SharedPreferences.Editor editor = sharedPreferences.edit();
-            ratioString = supportedRatios.get(supportedRatios.size() - 1);
+            //ratioString = supportedRatios.get(supportedRatios.size() - 1);
+                       ratioString = supportedRatios.get(0);//devin.20180420
             editor.putString(SettingConstants.KEY_PICTURE_RATIO, ratioString);
             editor.apply();

Camera 屏蔽高温报警和连拍

vendor/mediatek/proprietary/packages/apps/Camera/src/com/mediatek/camera/AdditionManager.java

@@ -78,12 +78,12 @@ public class AdditionManager {
         mIContinuousShotAddition = new ContinuousShot(cameraContext);
         mDistanceInfo = new DistanceInfo(cameraContext);
         mRemoteCameraAddition = new RemoteCameraAddition(cameraContext);
-        mNormalAddition.add(new ThermalThrottle(cameraContext));
+       // mNormalAddition.add(new ThermalThrottle(cameraContext));
         mPhotoAddtion.add(new Asd(cameraContext));
-        mPhotoAddtion.add(mIContinuousShotAddition);
+        //mPhotoAddtion.add(mIContinuousShotAddition);
         mNormalAddition.add(mDistanceInfo);
         mPhotoAddtion.add(mRemoteCameraAddition);
-        mDenoiseAddition.add(mIContinuousShotAddition);
+       // mDenoiseAddition.add(mIContinuousShotAddition);
     }

低电量不能开启手电筒

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/policy/FlashlightControllerImpl.java

+import android.os.BatteryManager;
+import android.widget.Toast;



     public void setFlashlight(boolean enabled) {

+		 //mh.20180424
+        BatteryManager batteryManager=(BatteryManager)mContext.getSystemService(mContext.BATTERY_SERVICE);
+        int counter = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER);
+        int averge = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_AVERAGE);
+        int current_now = batteryManager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW);
+        Log.d(TAG,"FlashlightControllerImpl::setFlashlight...counter:"+counter+", averge:"+averge+", current_now:"+current_now); 
+
+        boolean enoughtBatteryLevel = counter >= 3;
+        if(!enoughtBatteryLevel){
+              Toast.makeText(mContext, "low battery level", 3000).show();
+        }
+        
+        enabled = enabled&enoughtBatteryLevel;

         boolean pendingError = false;
         synchronized (this) {
             if (mCameraId == null) return;

摄像头默认缩放倍率

+++ b/vendor/mediatek/proprietary/custom/mt6735/hal/D2/sendepfeature/gc030a_mipi_sub_raw/config.ftbl.gc030a_mipi_sub_raw.h
@@ -248,7 +248,7 @@ FTABLE_SCENE_INDEP()
             ITEM_AS_DEFAULT_("0"),  //Zoom Index
             ITEM_AS_USER_LIST_(
                 //Zoom Ratio
                 //mh.20230407 scale default set 3x.
-                "100", "114", "132", "151", "174", 
+                /*"100", "114", */"132", "151", "174", 
                 "200", "229", "263", "303", "348", 
                 "400", 
             )

Settings去掉使用GPS提供时间选项

+++ b/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/DateTimeSettings.java
@@ -84,7 +84,7 @@ public class DateTimeSettings extends DashboardFragment implements
     public void onAttach(Context context) {
         /// M: add for auto GPS time @{
         mLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);
-        isGPSSupport = (mLocationManager.getProvider(LocationManager.GPS_PROVIDER) != null);
+        isGPSSupport = false;//(mLocationManager.getProvider(LocationManager.GPS_PROVIDER) != null);
         /// @}

切换语言后设置中的"勿扰偏好设置"菜单下的自动规则字符串不刷新

+++ frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java

@@ -818,8 +818,9 @@ public class NotificationManagerService extends SystemService {
         @Override
         public void onReceive(Context context, Intent intent) {
             if (Intent.ACTION_LOCALE_CHANGED.equals(intent.getAction())) {
-                mZenModeHelper.updateDefaultZenRules();
+                //mZenModeHelper.updateDefaultZenRules();      devin.2018419
                 mRankingHelper.onLocaleChanged(context, ActivityManager.getCurrentUser());
+                               mZenModeHelper = new ZenModeHelper(getContext(), mHandler.getLooper(), mConditionProviders);//devin.2018419
             }
         }
     };

mtp模式连接电脑,手机存储空间修改

+++ b/frameworks/av/media/mtp/MtpStorage.cpp
@@ -68,6 +68,11 @@ uint64_t MtpStorage::getMaxCapacity() {
             return -1;
         mMaxCapacity = (uint64_t)stat.f_blocks * (uint64_t)stat.f_bsize;
     }
+       ///mh.mmi add
+       if(!mRemovable){
+               mMaxCapacity = (uint64_t)32*1024*1024*1024;             
+       }
+       ///mh.end
     return mMaxCapacity;

Mms 短信界面选项拨号直接呼出

+++ b/vendor/mediatek/proprietary/packages/apps/Mms/src/com/android/mms/ui/ComposeMessageActivity.java
@@ -4814,7 +4814,7 @@ public class ComposeMessageActivity extends Activity
                 dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
                 dialIntent.putExtra("com.android.phone.extra.video", true);
             } else {
-                dialIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + number));
+                dialIntent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
             }

默认SIM卡短信设置去掉每次都询问

+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/ext/src/com/mediatek/settings/ext/DefaultRCSSettings.java

     public boolean isNeedAskFirstItemForSms() {
         Log.d("@M_" + TAG, "isNeedAskFirstItemForSms");
-        return true;
+        return false;///mh.20180523 default=true
     }
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/sim/SimDialogActivity.java

    private int getPickSmsDefaultSub(final List<SubscriptionInfo> subInfoList,
            int value) {
        int subId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
        if (value < 1) {
            int length = subInfoList == null ? 0 : subInfoList.size();
+           //if (length == 1) {mh.20180528
                subId = subInfoList.get(value).getSubscriptionId();
+           //} else {
+           //    subId = MtkDefaultSmsSimSettings.ASK_USER_SUB_ID;
+           //}
        } else if (value >= 1 && value < subInfoList.size() + 1) {
            subId = subInfoList.get(value).getSubscriptionId();
        }
        subId = mRCSExt.getDefaultSmsClickContentExt(subInfoList, value, subId);
        Log.d(TAG, "getPickSmsDefaultSub, value: " + value + ", subId: " + subId);
        return subId;
    }

低电量提示音

+++ b/frameworks/base/data/sounds/AudioPackageGo.mk
@@ -49,3 +49,4 @@ PRODUCT_COPY_FILES += \
     $(LOCAL_PATH)/effects/ogg/camera_click.ogg:system/media/audio/ui/camera_click.ogg \
     $(LOCAL_PATH)/effects/ogg/camera_click_48k.ogg:system/media/audio/ui/camera_click_48k.ogg \
     $(LOCAL_PATH)/effects/ogg/camera_focus.ogg:system/media/audio/ui/camera_focus.ogg \
+       $(LOCAL_PATH)/effects/ogg/LowBattery.ogg:system/media/audio/ui/LowBattery.ogg \

SELinux 默认permissive

+++ b/system/core/init/init.cpp
@@ -586,6 +586,7 @@ static selinux_enforcing_status selinux_status_from_cmdline() {
 
 static bool selinux_is_enforcing(void)
 {
+       return false;//mh.add
     if (ALLOW_PERMISSIVE_SELINUX) {
         return selinux_status_from_cmdline() == SELINUX_ENFORCING;
     }

壁纸居中不要拉伸

+++ b/vendor/mediatek/proprietary/packages/apps/WallpaperPicker/src/com/android/wallpaperpicker/WallpaperUtils.java
@@ -137,7 +137,7 @@ public final class WallpaperUtils {
 
             // We need to ensure that there is enough extra space in the wallpaper
             // for the intended parallax effects
-            final int defaultWidth, defaultHeight;
+            int defaultWidth, defaultHeight;
             if (res.getConfiguration().smallestScreenWidthDp >= 720) {
                 defaultWidth = (int) (maxDim * wallpaperTravelToScreenWidthRatio(maxDim, minDim));
                 defaultHeight = maxDim;
@@ -145,6 +145,8 @@ public final class WallpaperUtils {
                 defaultWidth = Math.max((int) (minDim * WALLPAPER_SCREENS_SPAN), maxDim);
                 defaultHeight = maxDim;
             }
+				 //mh.mmi
+                defaultWidth = realSize.x;
+                defaultHeight = realSize.y;
             sDefaultWallpaperSize = new Point(defaultWidth, defaultHeight);

取消关机振动

+++ b/frameworks/base/services/core/java/com/android/server/power/ShutdownThread.java
@@ -88,7 +88,7 @@ public class ShutdownThread extends Thread {
     private static final int MOUNT_SERVICE_STOP_PERCENT = 20;
 
     // length of vibration before shutting down
-    private static final int SHUTDOWN_VIBRATE_MS = 500;
+    private static final int SHUTDOWN_VIBRATE_MS = 0;

关机动画播放时长/关机时长/关机动画播放不全

vendor/mediatek/proprietary/frameworks/base/services/core/java/com/mediatek/server/MtkShutdownThread.java
method:showCustomizedShutdownAnimation

-    private static final int MIN_SHUTDOWN_ANIMATION_PLAY_TIME = 5 * 1000;
+    private static final int MIN_SHUTDOWN_ANIMATION_PLAY_TIME = 10 * 1000;//mh.20180510



         beginAnimationTime = 0;
         boolean mShutOffAnimation = configShutdownAnimation(context);
-        int screenTurnOffTime = getScreenTurnOffTime(context);
+        int screenTurnOffTime = MIN_SHUTDOWN_ANIMATION_PLAY_TIME;//getScreenTurnOffTime(context);mh.20180510
         synchronized (mEnableAnimatingSync) {
             if (mEnableAnimating) {
                 if (mShutOffAnimation) {

按键机方向键EditText焦点不释放问题

+++ b/frameworks/base/core/java/android/widget/TextView.java
@@ -7374,10 +7374,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
             // Consume arrows from keyboard devices to prevent focus leaving the editor.
             // DPAD/JOY devices (Gamepads, TV remotes) often lack a TAB key so allow those
             // to move focus with arrows.
-            if (event.getSource() == InputDevice.SOURCE_KEYBOARD
+            /*if (event.getSource() == InputDevice.SOURCE_KEYBOARD
                     && isDirectionalNavigationKey(keyCode)) {
                 return KEY_EVENT_HANDLED;
-            }
+            }*/ //mh.mmi

灭屏状态下收到短信、蓝牙收到文件,屏幕亮屏

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java

+private PowerManager.WakeLock mNotificationWakeLock;


     public void onAsyncInflationFinished(Entry entry) {
         mPendingNotifications.remove(entry.key);
         // If there was an async task started after the removal, we don't want to add it back to
         // the list, otherwise we might get leaks.
         boolean isNew = mNotificationData.get(entry.key) == null;
+               //mh.20180424
+               mNotificationWakeLock = mPowerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP
+                   | PowerManager.ON_AFTER_RELEASE, TAG);
+               //end
+               mNotificationWakeLock.setReferenceCounted(false);
         if (isNew && !entry.row.isRemoved()) {


    protected void addNotificationViews(Entry entry) {
        if (entry == null) {
            return;
        }
        // Add the expanded view and icon.
        mNotificationData.add(entry);
        Log.d(TAG, "packgename:"+entry.key);
+        //mh.20180424
+        if (!mPowerManager.isScreenOn() && entry.key != null && (entry.key.contains("com.google.android.apps.messaging")
+             || entry.key.contains("com.android.bluetooth"))){
+            mNotificationWakeLock.acquire(5000);
+            Log.d(TAG, "special app notification turn screen on");
+        }
+        //end
        updateNotifications();
    }


    public void updateNotification(StatusBarNotification notification, RankingMap ranking)
            throws InflationException {
......
        if (entry == null) {
            return;
        }
        
        mNotificationData.add(entry);
+        //mh.20180424
+        if (!mPowerManager.isScreenOn() && entry.key != null && (entry.key.contains("com.google.android.apps.messaging") 
+                    || entry.key.contains("com.android.bluetooth"))){
+            mNotificationWakeLock.acquire(5000);
+            Log.d(TAG, "special app notification turn screen on");
+        }
+        //end
        mHeadsUpEntriesToRemoveOnSwitch.remove(entry);
        mRemoteInputEntriesToRemoveOnCollapse.remove(entry);
......

去掉设置-应用和通知-查看全部23个应用-信息-应用通知-应用中的其他设置

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/notification/NotificationSettingsBase.java

     protected void addAppLinkPref() {
-        if (mAppRow.settingsIntent != null && mAppLink == null) {
+               Log.i("joyatel","pkg:"+mAppRow.pkg);
+        if (mAppRow.settingsIntent != null && mAppLink == null && !mAppRow.pkg.equals("com.google.android.apps.messaging")/*mh.20180507*/) {
             addPreferencesFromResource(R.xml.inapp_notification_settings);
             mAppLink = (Preference) findPreference(KEY_APP_LINK);

打开设置-存储中的默认存储器菜单及功能

vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/mediatek/settings/deviceinfo/StorageSettingsExts.java

@@ -57,13 +57,14 @@ public class StorageSettingsExts {
         mDiskCategory = (PreferenceCategory) mRoot
                 .findPreference(KEY_DEFAULT_WRITE_DISK);
 
-        if (!FeatureOption.MTK_DEFAULT_WRITE_DISK || FeatureOption.MTK_A1_FEATURE) {
+        if (FeatureOption.MTK_DEFAULT_WRITE_DISK || FeatureOption.MTK_A1_FEATURE) {
             mRoot.removePreference(mDiskCategory);
         }
     }
 
     private void updateDefaultWriteDiskCategory() {
-        if (!FeatureOption.MTK_DEFAULT_WRITE_DISK || FeatureOption.MTK_A1_FEATURE) {
+               Log.i("mh","MTK_A1_FEATURE:"+FeatureOption.MTK_A1_FEATURE);
+        if (FeatureOption.MTK_DEFAULT_WRITE_DISK || FeatureOption.MTK_A1_FEATURE) {
             return;
         }
vendor/mediatek/proprietary/frameworks/base/core/java/com/mediatek/storage/StorageManagerEx.java

@@ -101,8 +101,15 @@ public class StorageManagerEx {
         boolean supportMultiUsers = false;
 
         // Modifications for O1.BSP+ as default path feature is not supported.
-        path = Environment.getExternalStorageDirectory().getAbsolutePath();
+               //mh.20180424
+       // path = Environment.getExternalStorageDirectory().getAbsolutePath();
+          path = SystemProperties.get(PROP_SD_DEFAULT_PATH);
+          Log.i(TAG,"path1:"+path);
+          if(path.equals("")){
+                  path = Environment.getExternalStorageDirectory().getAbsolutePath();
+          }
         Log.i(TAG, " Default path taken as primary storage, path=" + path);
+               //mh.20180424
         // Modifications complete for O1.BSP+.
         return path;

切换语言后设置中的"勿扰偏好设置"菜单下的自动规则字符串不刷新

frameworks/base/services/core/java/com/android/server/notification/NotificationManagerService.java

@@ -818,8 +818,9 @@ public class NotificationManagerService extends SystemService {
         @Override
         public void onReceive(Context context, Intent intent) {
             if (Intent.ACTION_LOCALE_CHANGED.equals(intent.getAction())) {
-                mZenModeHelper.updateDefaultZenRules();
+                //mZenModeHelper.updateDefaultZenRules();      devin.2018419
                 mRankingHelper.onLocaleChanged(context, ActivityManager.getCurrentUser());
+                               mZenModeHelper = new ZenModeHelper(getContext(), mHandler.getLooper(), mConditionProviders);//devin.2018419
             }
         }
     };

通话录音、FM录音默认存储跟随设置

vendor/mediatek/proprietary/packages/apps/FMRadio/src/com/android/fmradio/FmUtils.java

+import com.mediatek.storage.StorageManagerEx;


@@ -201,7 +202,8 @@ public class FmUtils {
      * @return The phone storage path
      */
     public static String getDefaultStoragePath() {
-        return Environment.getExternalStorageDirectory().getPath();
+       // return Environment.getExternalStorageDirectory().getPath();
+          return StorageManagerEx.getDefaultPath(); //mh.20180424
     }

vendor/mediatek/proprietary/packages/services/CallRecorderService/src/com/mediatek/callrecorder/Recorder.java

@@ -116,8 +116,8 @@ public abstract class Recorder implements OnErrorListener {
 
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
         String prefix = dateFormat.format(new Date());
-        //File sampleDir = new File(StorageManagerEx.getDefaultPath());
-        File sampleDir = Environment.getExternalStorageDirectory();
+        File sampleDir = new File(StorageManagerEx.getDefaultPath());//devin.20180424
+        //File sampleDir = Environment.getExternalStorageDirectory();

预置apk后开机未安装

+++ a/vendor/mediatek/proprietary/packages/3rd-party/Huoshan/Android.mk

+LOCAL_PATH := $(call my-dir)
+
+$(shell mkdir -p $(TARGET_OUT_VENDOR)/operator/app/douyinhuoshanban19.0.0)
+$(shell cp $(LOCAL_PATH)/douyinhuoshanban19.0.0.apk $(TARGET_OUT_VENDOR)/operator/app/douyinhuoshanban19.0.0)

+++ b/vendor/mediatek/proprietary/frameworks/base/services/core/java/com/mediatek/server/pm/PmsExtImpl.java

@@ -284,6 +286,10 @@ public class PmsExtImpl extends PmsExt {
                     Slog.d(TAG, "New added operator app by OTA:" + pkg.packageName);
                     return false;
                 }
+                ///mh.20230321
+                if(pkg.packageName.equals("com.ss.android.ugc.live")) {
+                    Slog.d(TAG, "mh.log douyin do not skip.");
+                    return false;
+                }
+ 				 ///mh.end
             }
            Slog.d(TAG, "Skip scanning uninstalled sys package " + pkg.packageName);
            return true;

添加虚拟键振动功能

frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java

@@ -6097,7 +6097,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
         }
 
         boolean useHapticFeedback = down
-                && (policyFlags & WindowManagerPolicy.FLAG_VIRTUAL) != 0
+               // && (policyFlags & WindowManagerPolicy.FLAG_VIRTUAL) != 0
                 && event.getRepeatCount() == 0;

主界面hotseat打开相机,底部有白线

+++ packages/apps/Launcher3/src/com/android/launcher3/Launcher.java
@@ -2672,6 +2672,7 @@ public class Launcher extends BaseActivity
         // private contract between launcher and may be ignored in the future).
         boolean useLaunchAnimation = (v != null) &&
                 !intent.hasExtra(INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION);
+        useLaunchAnimation = false; //andy
         Bundle optsBundle = useLaunchAnimation ? getActivityLaunchOptions(v) : null;
 
         UserHandle user = item == null ? null : item.user;

长按Home键 取消屏幕固定

frameworks/base/core/res/res/values/strings.xml

-    <string name="lock_to_app_toast">To unpin this screen, touch &amp; hold Back and Overview
-        buttons</string>
+    <string name="lock_to_app_toast">To unpin this screen, touch &amp; hold Home buttons</string>
vendor/mediatek/proprietary/packages/apps/SystemUI/res/values/strings.xml

-    <string name="screen_pinning_description">This keeps it in view until you unpin. Touch &amp; hold Back and Overview to unpin.</string>
+    <string name="screen_pinning_description">This keeps it in view until you unpin. Touch &amp; hold Home to unpin.</string>
frameworks/base/services/core/java/com/android/server/policy/PhoneWindowManager.java

+import android.app.IActivityManager;
+import android.view.accessibility.AccessibilityManager;
+import android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener;
+import android.app.ActivityManagerNative;


+    private void onLongPressBackMenu(){
+            IActivityManager activityManager = ActivityManagerNative.getDefault();
+            boolean touchExplorationEnabled = mAccessibilityManager.isTouchExplorationEnabled();
+            try {
+                boolean inLockTaskMode = activityManager.isInLockTaskMode();
+                Log.d("joyatel","onLongPressBackMenu......inLockTaskMode:"+inLockTaskMode+", touchExplorationEnabled:"+touchExplorationEnabled);
+                if (inLockTaskMode && !touchExplorationEnabled) {
+                     activityManager.stopLockTaskMode();
+                }
+
+
+            } catch (RemoteException e) {
+                Log.d(TAG, "Unable to reach activity manager", e);
+            }    
+
+                   
+    }


@@ -3488,6 +3511,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
             } else if ((event.getFlags() & KeyEvent.FLAG_LONG_PRESS) != 0) {
                 if (!keyguardOn) {
                     handleLongPressOnHome(event.getDeviceId());
+                    onLongPressBackMenu();
                 }
             }

客制化BT,WiFi direct,WLAN热点名称

BT:device/generic/common/bluetooth/bdroid_buildcfg.h

-#define BTM_DEF_LOCAL_NAME   "Android Bluedroid"
+#define BTM_DEF_LOCAL_NAME   "Vox_5S"
WiFi direct:vendor/mediatek/proprietary/packages/apps/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

@@ -2659,6 +2659,8 @@ class DatabaseHelper extends SQLiteOpenHelper {
             loadSetting(stmt, Settings.Global.ENHANCED_4G_MODE_ENABLED,
                     ImsConfig.FeatureValueConstants.ON);
 
+            loadSetting(stmt, Settings.Global.WIFI_P2P_DEVICE_NAME,"Vox_5S");
+
             /// M: Load MTK added Global providers before Android M.
             mUtils.loadCustomGlobalSettings(stmt);
WLAN热点:frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiApConfigStore.java

@@ -207,8 +207,9 @@ public class WifiApConfigStore {
      */
     private WifiConfiguration getDefaultApConfiguration() {
         WifiConfiguration config = new WifiConfiguration();
-        config.SSID = mContext.getResources().getString(
-                R.string.wifi_tether_configure_ssid_default) + "_" + getRandomIntForDefaultSsid();
+        //config.SSID = mContext.getResources().getString(
+         //       R.string.wifi_tether_configure_ssid_default) + "_" + getRandomIntForDefaultSsid();
+        config.SSID = "Vox_5S";
         config.allowedKeyManagement.set(KeyMgmt.WPA2_PSK);
         String randomUUID = UUID.randomUUID().toString();
         //first 12 chars from xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

文件默认显示内部存储设备

     public static boolean mustShowDeviceRoot(Intent intent) {
         /// M: Discussed with QA, this option should always be shown
-        return false;
+        return true;//devin.20180423
         //return intent.getBooleanExtra(DocumentsContract.EXTRA_SHOW_ADVANCED, false);
     }

你可能感兴趣的:(android客制,android,java,开发语言)