客製化-高

一、O1版原本短信時點亮屏幕java

vendor/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phoneandroid

diff --git a/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index 2478668d8..52f9b4165 100644
--- a/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/mediatek/proprietary/packages/apps/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -280,6 +280,7 @@ import com.freeme.util.FreemeOption;
 import com.freeme.content.FreemeIntent;
 //*/
 
+
 import com.freeme.systemui.notch.NotchStatusBar;
 import com.freeme.systemui.utils.NotchUtils;
 
@@ -300,6 +301,8 @@ public class StatusBar extends SystemUI implements DemoMode,
             SystemProperties.getBoolean("debug.force_remoteinput_history", false);
     private static boolean ENABLE_LOCK_SCREEN_ALLOW_REMOTE_INPUT = false;
 
+    private PowerManager.WakeLock mNotificationWakeLock;
+
     protected static final int MSG_SHOW_RECENT_APPS = 1019;
     protected static final int MSG_HIDE_RECENT_APPS = 1020;
     protected static final int MSG_TOGGLE_RECENTS_APPS = 1021;
@@ -424,6 +427,19 @@ public class StatusBar extends SystemUI implements DemoMode,
         FREEFORM_WINDOW_MANAGEMENT = freeformWindowManagement;
     }
 
+
+    private void screenWakeUp(Entry entry) {
+        if(mNotificationWakeLock == null){
+            mNotificationWakeLock = mPowerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, TAG);
+            mNotificationWakeLock.setReferenceCounted(false);
+        }
+        if (!mPowerManager.isScreenOn() && entry.key != null && entry.key.contains("com.google.android.apps.messaging")) {
+            mNotificationWakeLock.acquire(5000);
+            Log.d(TAG, "special app notification turn screen on");
+        }
+    }
+
+
     /**
      * The {@link StatusBarState} of the status bar.
      */
@@ -7368,6 +7384,7 @@ public class StatusBar extends SystemUI implements DemoMode,
         }
         // Add the expanded view and icon.
         mNotificationData.add(entry);
+       screenWakeUp(entry);
         updateNotifications();
     }
 
@@ -7539,6 +7556,7 @@ public class StatusBar extends SystemUI implements DemoMode,
         boolean alertAgain = alertAgain(entry, n);
 
         updateHeadsUp(key, entry, shouldPeek, alertAgain);
+       screenWakeUp(entry);
         updateNotifications();
 
         if (!notification.isClearable()) {
(END)
複製代碼
相關文章
相關標籤/搜索