am 0aaec70b: am 29dbeab9: Update to use new unlock APIs, new wallpaper theme.
Merge commit '0aaec70ba2c2fcdd2734535f46cdc54efa91d730'
* commit '0aaec70ba2c2fcdd2734535f46cdc54efa91d730':
Update to use new unlock APIs, new wallpaper theme.
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 8cdaf55..8ee8ab6 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -34,8 +34,8 @@
<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
@@ -43,9 +43,9 @@
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" />
diff --git a/src/com/android/alarmclock/AlarmAlert.java b/src/com/android/alarmclock/AlarmAlert.java
index 71871d5..1543c03 100644
--- a/src/com/android/alarmclock/AlarmAlert.java
+++ b/src/com/android/alarmclock/AlarmAlert.java
@@ -78,9 +78,6 @@
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.
@@ -219,6 +216,13 @@
}
@Override
+ protected void onStop() {
+ super.onStop();
+ // Don't hang around.
+ finish();
+ }
+
+ @Override
public void onDestroy() {
super.onDestroy();
if (Log.LOGV) Log.v("AlarmAlert.onDestroy()");
diff --git a/src/com/android/alarmclock/AlarmAlertFullScreen.java b/src/com/android/alarmclock/AlarmAlertFullScreen.java
index 07d0d9c..714262a 100644
--- a/src/com/android/alarmclock/AlarmAlertFullScreen.java
+++ b/src/com/android/alarmclock/AlarmAlertFullScreen.java
@@ -16,10 +16,8 @@
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
@@ -27,17 +25,18 @@
* 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;
+ }
}