Also don't allow the user to press back when in the full screen alarm.
Change-Id: Ic0c9658c75d3a2b3f49028f432fe226b1a0d8e9e
<activity android:name="AlarmAlert"
android:excludeFromRecents="true"
android:theme="@style/alarm_alert"
- android:launchMode="singleTask"
- android:taskAffinity=":AlarmAlert"
+ android:launchMode="singleInstance"
+ android:taskAffinity=""
android:configChanges="orientation|keyboardHidden|keyboard|navigation"/>
<!-- This activity is basically the same as AlarmAlert but with a more
with the wallpaper background. -->
<activity android:name="AlarmAlertFullScreen"
android:excludeFromRecents="true"
- android:theme="@android:style/Theme.NoTitleBar"
- android:launchMode="singleTask"
- android:taskAffinity=":AlarmAlert"
+ android:theme="@android:style/Theme.Wallpaper.NoTitleBar"
+ android:launchMode="singleInstance"
+ android:taskAffinity=""
android:configChanges="orientation|keyboardHidden|keyboard|navigation"/>
<activity android:name="ClockPicker" />
mVolumeBehavior = Integer.parseInt(vol);
requestWindowFeature(android.view.Window.FEATURE_NO_TITLE);
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
- | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
- | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
updateLayout();
// Register to get the alarm killed intent.
}
@Override
+ protected void onStop() {
+ super.onStop();
+ // Don't hang around.
+ finish();
+ }
+
+ @Override
public void onDestroy() {
super.onDestroy();
if (Log.LOGV) Log.v("AlarmAlert.onDestroy()");
package com.android.alarmclock;
-import android.graphics.drawable.BitmapDrawable;
-import android.view.View;
-import android.view.Gravity;
-import android.view.LayoutInflater;
+import android.os.Bundle;
+import android.view.WindowManager;
/**
* Full screen alarm alert: pops visible indicator and plays alarm tone. This
* background is the current wallpaper.
*/
public class AlarmAlertFullScreen extends AlarmAlert {
-
@Override
- final protected View inflateView(LayoutInflater inflater) {
- View v = inflater.inflate(R.layout.alarm_alert, null);
-
- // Display the wallpaper as the background.
- BitmapDrawable wallpaper = (BitmapDrawable) getWallpaper();
- wallpaper.setGravity(Gravity.CENTER);
- v.setBackgroundDrawable(wallpaper);
-
- return v;
+ 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
+ public void onBackPressed() {
+ // Don't allow back to dismiss.
+ return;
}
-
}