当前位置:   article > 正文

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

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

  1. diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
  2. index 4a5f02d..6562f8e 100644
  3. --- a/overlay/frameworks/base/core/res/res/values/config.xml
  4. +++ b/overlay/frameworks/base/core/res/res/values/config.xml
  5. @@ -228,5 +228,6 @@
  6. <item>screenshot</item>
  7. <item>bugreport</item>
  8. </string-array>
  9. -
  10. + <!--BSPA-193784 enable notification led-->
  11. + <bool name="config_intrusiveNotificationLed">true</bool>
  12. </resources>
  13. diff --git a/overlay_gms/frameworks/base/core/res/res/values/config.xml b/overlay_gms/frameworks/base/core/res/res/values/config.xml
  14. index 200c934..1ddf702 100644
  15. --- a/overlay_gms/frameworks/base/core/res/res/values/config.xml
  16. +++ b/overlay_gms/frameworks/base/core/res/res/values/config.xml
  17. @@ -243,5 +243,6 @@
  18. <item>screenshot</item>
  19. <item>bugreport</item>
  20. </string-array>
  21. -
  22. + <!--BSPA-193784 enable notification led-->
  23. + <bool name="config_intrusiveNotificationLed">true</bool>
  24. </resources>

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

  1. diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
  2. index 93528d4..4028c2a 100644
  3. --- a/services/core/java/com/android/server/notification/NotificationManagerService.java
  4. +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
  5. @@ -1,6 +1,6 @@
  6. /*
  7. * Copyright (C) 2007 The Android Open Source Project
  8. - * Copyright (C) 2021 XXX Technologies Corporation and/or its affiliates.All rights reserved.
  9. + * Copyright (C) 2021-2022 XXX Technologies Corporation and/or its affiliates. All rights reserved
  10. *
  11. * Licensed under the Apache License, Version 2.0 (the "License");
  12. * you may not use this file except in compliance with the License.
  13. @@ -1576,7 +1576,8 @@
  14. cancelAllNotificationsInt(MY_UID, MY_PID, null, null, 0, 0, true, userHandle,
  15. REASON_PROFILE_TURNED_OFF, null);
  16. }
  17. - } else if (action.equals(Intent.ACTION_USER_PRESENT)) {
  18. + //BSPA-193784 not to turn off LED when user passes through lock screen
  19. + } else if (action.equals(Intent.ACTION_USER_PRESENT) && (!XXXUtils.isXXX().orElse(false))) {
  20. // turn off LED when user passes through lock screen
  21. if (mNotificationLight != null) {
  22. mNotificationLight.turnOff();
  23. @@ -7105,14 +7106,20 @@
  24. // Suppressed because it's a silent update
  25. final Notification notification = record.getNotification();
  26. if (record.isUpdate && (notification.flags & FLAG_ONLY_ALERT_ONCE) != 0) {
  27. - return false;
  28. + //BSPA-193784 not feedback 'false' if it is zebra's porject.
  29. + return XXXUtils.isXXX().orElse(false);
  30. }
  31. // Suppressed because another notification in its group handles alerting
  32. if (record.getSbn().isGroup() && record.getNotification().suppressAlertingDueToGrouping()) {
  33. return false;
  34. }
  35. // not if in call or the screen's on
  36. - if (isInCall() || mScreenOn) {
  37. + //BSPA-193784 The light can be on when the screen is on[XXX projcet].
  38. + if (XXXUtils.isXXX().orElse(false)) {
  39. + if (isInCall()) {
  40. + return true;
  41. + }
  42. + } else if (isInCall() || mScreenOn) {
  43. return false;
  44. }
  45. @@ -8336,8 +8343,15 @@
  46. }
  47. }
  48. - // Don't flash while we are in a call or screen is on
  49. - if (ledNotification == null || isInCall() || mScreenOn) {
  50. + // Don't flash while we are in a call
  51. + //BSPA-193784 The light can be on when the screen is on[xxx projcet].
  52. + boolean isXXXNotification = false;
  53. + if(ZebraUtils.isZebra().orElse(false)) {
  54. + isXXXNotification = (ledNotification == null || isInCall());
  55. + } else {
  56. + isXXXNotification = (ledNotification == null || isInCall() || mScreenOn);
  57. + }
  58. + if (isXXXNotification) {
  59. mNotificationLight.turnOff();
  60. } else {
  61. NotificationRecord.Light light = ledNotification.getLight();
  62. @@ -8345,6 +8359,9 @@
  63. // pulse repeatedly
  64. mNotificationLight.setFlashing(light.color, LogicalLight.LIGHT_FLASH_TIMED,
  65. light.onMs, light.offMs);
  66. + } else if (XXXUtils.isZebra().orElse(false) && light != null && !mNotificationPulseEnabled){
  67. + mNotificationLight.turnOff();
  68. + Log.d(TAG, "mNotificationLight.turnOff if Blink light is turned off : ");
  69. }
  70. }
  71. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/article/detail/46011
推荐阅读
相关标签
  

闽ICP备14008679号