Device收到通知时,通知指示灯不闪烁的问题

Issue:

"
Reproduction Steps:

  1. Flash the latest product build and boot to system
  2. Send a skype call from DUT2 to DUT1, check DUT1 LED
  3. Wait for the alarm to ring on both UUTs and dismiss after alarm rings, check DUTs LED
  4. Add one event in calendar and wait it trigger out of downtime, check DUTs LED
  5. Send a test mail to DUT1 from DUT2, check DUT2 LED
  6. Start transferring files via Bluetooth, check DUTs LED
  7. Receive an unread message, check DUTs LED
  8. Notification LED doesn't work ==>Problem

"

Solution:

"Solution: Modify the default parameters so that the LED can blink."

1.overlay里新增字段:

device/zebra/common/overlay_gms/frameworks/base/core/res/res/values/config.xml

device/zebra/common/overlay/frameworks/base/core/res/res/values/config.xml

diff 复制代码
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 4a5f02d..6562f8e 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -228,5 +228,6 @@
         <item>screenshot</item>
         <item>bugreport</item>
     </string-array>
-
+    <!--BSPA-193784 enable notification led-->
+    <bool name="config_intrusiveNotificationLed">true</bool>
 </resources>
diff --git a/overlay_gms/frameworks/base/core/res/res/values/config.xml b/overlay_gms/frameworks/base/core/res/res/values/config.xml
index 200c934..1ddf702 100644
--- a/overlay_gms/frameworks/base/core/res/res/values/config.xml
+++ b/overlay_gms/frameworks/base/core/res/res/values/config.xml
@@ -243,5 +243,6 @@
         <item>screenshot</item>
         <item>bugreport</item>
     </string-array>
-
+    <!--BSPA-193784 enable notification led-->
+    <bool name="config_intrusiveNotificationLed">true</bool>
 </resources>

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

diff 复制代码
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 93528d4..4028c2a 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2007 The Android Open Source Project
- * Copyright (C) 2021 XXX Technologies Corporation and/or its affiliates.All rights reserved.
+ * Copyright (C) 2021-2022 XXX Technologies Corporation and/or its affiliates. All rights reserved
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1576,7 +1576,8 @@
                     cancelAllNotificationsInt(MY_UID, MY_PID, null, null, 0, 0, true, userHandle,
                             REASON_PROFILE_TURNED_OFF, null);
                 }
-            } else if (action.equals(Intent.ACTION_USER_PRESENT)) {
+                //BSPA-193784 not to turn off LED when user passes through lock screen
+            } else if (action.equals(Intent.ACTION_USER_PRESENT) && (!XXXUtils.isXXX().orElse(false))) {
                 // turn off LED when user passes through lock screen
                 if (mNotificationLight != null) {
                     mNotificationLight.turnOff();
@@ -7105,14 +7106,20 @@
         // Suppressed because it's a silent update
         final Notification notification = record.getNotification();
         if (record.isUpdate && (notification.flags & FLAG_ONLY_ALERT_ONCE) != 0) {
-            return false;
+            //BSPA-193784 not feedback 'false' if it is zebra's porject.
+            return XXXUtils.isXXX().orElse(false);
         }
         // Suppressed because another notification in its group handles alerting
         if (record.getSbn().isGroup() && record.getNotification().suppressAlertingDueToGrouping()) {
             return false;
         }
         // not if in call or the screen's on
-        if (isInCall() || mScreenOn) {
+        //BSPA-193784 The light can be on when the screen is on[XXX projcet].
+        if (XXXUtils.isXXX().orElse(false)) {
+            if (isInCall()) {
+                return true;
+            }
+        } else if (isInCall() || mScreenOn) {
             return false;
         }
 
@@ -8336,8 +8343,15 @@
             }
         }
 
-        // Don't flash while we are in a call or screen is on
-        if (ledNotification == null || isInCall() || mScreenOn) {
+        // Don't flash while we are in a call
+        //BSPA-193784 The light can be on when the screen is on[xxx projcet].
+        boolean isXXXNotification = false;
+        if(ZebraUtils.isZebra().orElse(false)) {
+            isXXXNotification = (ledNotification == null || isInCall());
+        } else {
+            isXXXNotification = (ledNotification == null || isInCall() || mScreenOn);
+        }
+        if (isXXXNotification) {
             mNotificationLight.turnOff();
         } else {
             NotificationRecord.Light light = ledNotification.getLight();
@@ -8345,6 +8359,9 @@
                 // pulse repeatedly
                 mNotificationLight.setFlashing(light.color, LogicalLight.LIGHT_FLASH_TIMED,
                         light.onMs, light.offMs);
+            } else if (XXXUtils.isZebra().orElse(false) && light != null && !mNotificationPulseEnabled){
+                mNotificationLight.turnOff();
+                Log.d(TAG, "mNotificationLight.turnOff if Blink light is turned off : ");
             }
         }
     }
相关推荐
顾北川_野4 分钟前
Android 不插SIM卡,手机不能拨打紧急电话;2g+gsm配置才支持112紧急拨号
android
百锦再1 小时前
Android Studio 中文字大小的单位详解
android·xml·java·ide·app·android studio
隐-梵1 小时前
Android studio前沿开发--利用socket服务器连接AI实现前后端交互(全站首发思路)
android·服务器·人工智能·后端·websocket·android studio·交互
鸿蒙布道师2 小时前
鸿蒙NEXT开发图片相关工具类(ArkTs)
android·ios·华为·harmonyos·arkts·鸿蒙系统·huawei
奔跑吧 android2 小时前
【android telecom 框架分析 01】【基本介绍 2】【BluetoothPhoneService为何没有源码实现】
android·telecom·phone·btphone
懋学的前端攻城狮2 小时前
Android一些基础-08-一个简单的通知
android·android studio
V少年2 小时前
深入浅出安卓协程
android
V少年2 小时前
深入浅出安卓App的启动流程
android
顾林海2 小时前
深度解析ConcurrentHashMap工作原理
android·java·面试
12472 小时前
震惊!Android开发竟这样获取View宽高?View.post()原理大揭秘
android