ECM notification is not displayed when the user is NOT the primary one
EmergencyCallbackModeService only runs under the primary user
and its notification is only sent to the primary user.
Now use NotificationManager.notifyAsUser with UserHandle.All
to display this important notification to all users.
Test: Manual test
Fix: 144979126
Change-Id: I20247d83646d0f7952951c15e1a6b4c3a6fee3db
diff --git a/src/com/android/phone/EmergencyCallbackModeService.java b/src/com/android/phone/EmergencyCallbackModeService.java
index 7e68255..ea89387 100644
--- a/src/com/android/phone/EmergencyCallbackModeService.java
+++ b/src/com/android/phone/EmergencyCallbackModeService.java
@@ -30,6 +30,7 @@
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
+import android.os.UserHandle;
import android.sysprop.TelephonyProperties;
import android.telephony.TelephonyManager;
import android.util.Log;
@@ -106,7 +107,8 @@
mPhone.unregisterForEcmTimerReset(mHandler);
// Cancel the notification and timer
- mNotificationManager.cancel(R.string.phone_in_ecm_notification_title);
+ mNotificationManager.cancelAsUser(null, R.string.phone_in_ecm_notification_title,
+ UserHandle.ALL);
mTimer.cancel();
}
}
@@ -213,7 +215,8 @@
builder.setChannelId(NotificationChannelController.CHANNEL_ID_ALERT);
// Show notification
- mNotificationManager.notify(R.string.phone_in_ecm_notification_title, builder.build());
+ mNotificationManager.notifyAsUser(null, R.string.phone_in_ecm_notification_title,
+ builder.build(), UserHandle.ALL);
}
/**