Fix emergency dialer is unable to be shown in doze
After screen is light by notification due to ambient display feature,
the device is yet in doze, so that shows key guard in doze. When user
clicks the emergency option to launch emergency dialer, its window is
unable to be shown on lock screen.
To fix it, allow turning srceen on, so that window manager can wake up
power, hence, exit doze mode.
Bug: 68678302
Change-Id: I847b95bc281fc0d9ce889aa0d4eb649fc9efe8d9
diff --git a/src/com/android/phone/EmergencyDialer.java b/src/com/android/phone/EmergencyDialer.java
index 31e1958..157cf1d 100644
--- a/src/com/android/phone/EmergencyDialer.java
+++ b/src/com/android/phone/EmergencyDialer.java
@@ -183,14 +183,9 @@
super.onCreate(icicle);
// Allow this activity to be displayed in front of the keyguard / lockscreen.
- WindowManager.LayoutParams lp = getWindow().getAttributes();
- lp.flags |= WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
-
- // When no proximity sensor is available, use a shorter timeout.
- // TODO: Do we enable this for non proximity devices any more?
- // lp.userActivityTimeout = USER_ACTIVITY_TIMEOUT_WHEN_NO_PROX_SENSOR;
-
- getWindow().setAttributes(lp);
+ setShowWhenLocked(true);
+ // Allow turning screen on
+ setTurnScreenOn(true);
mColorExtractor = new ColorExtractor(this);
GradientColors lockScreenColors = mColorExtractor.getColors(WallpaperManager.FLAG_LOCK,