...and can't see Dismiss and Snooze button if the device is on dock
Change-Id: Ib76b54f0a65930e142a3da1e1152f70d7f3ad3c7
Explanation: only the fullscreen alarm activity had the flags set to turn on
the screen and dismiss the lock screen. The app picks whether to show
that one or the non-fullscreen one based on whether device is currently
locked, which is correct, but with the introduction of docks, locked
!= screen off. In particular, the desk dock keeps the keyguard dismissed
while the device is in it.
The fix is to just set these flags for both alert activities. That seems
generally right for many reasons.
mVolumeBehavior = Integer.parseInt(vol);
requestWindowFeature(android.view.Window.FEATURE_NO_TITLE);
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
+ | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
+ | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
+ | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
updateLayout();
// Register to get the alarm killed intent.
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
- | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
- | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
- | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
}
@Override