diff options
14 files changed, 201 insertions, 67 deletions
diff --git a/api/current.txt b/api/current.txt index 3245c0a61dee..13b50876e958 100644 --- a/api/current.txt +++ b/api/current.txt @@ -34570,10 +34570,11 @@ package android.service.notification { method public int getSuppressedVisualEffects(); method public boolean isAmbient(); method public boolean matchesInterruptionFilter(); - field public static final int IMPORTANCE_DEFAULT = 2; // 0x2 - field public static final int IMPORTANCE_HIGH = 3; // 0x3 - field public static final int IMPORTANCE_LOW = 1; // 0x1 - field public static final int IMPORTANCE_MAX = 4; // 0x4 + field public static final int IMPORTANCE_DEFAULT = 3; // 0x3 + field public static final int IMPORTANCE_HIGH = 4; // 0x4 + field public static final int IMPORTANCE_LOW = 2; // 0x2 + field public static final int IMPORTANCE_MAX = 5; // 0x5 + field public static final int IMPORTANCE_MIN = 1; // 0x1 field public static final int IMPORTANCE_NONE = 0; // 0x0 field public static final int IMPORTANCE_UNSPECIFIED = -1000; // 0xfffffc18 } diff --git a/api/system-current.txt b/api/system-current.txt index 9a221016051d..125071daa400 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -37113,10 +37113,11 @@ package android.service.notification { method public int getSuppressedVisualEffects(); method public boolean isAmbient(); method public boolean matchesInterruptionFilter(); - field public static final int IMPORTANCE_DEFAULT = 2; // 0x2 - field public static final int IMPORTANCE_HIGH = 3; // 0x3 - field public static final int IMPORTANCE_LOW = 1; // 0x1 - field public static final int IMPORTANCE_MAX = 4; // 0x4 + field public static final int IMPORTANCE_DEFAULT = 3; // 0x3 + field public static final int IMPORTANCE_HIGH = 4; // 0x4 + field public static final int IMPORTANCE_LOW = 2; // 0x2 + field public static final int IMPORTANCE_MAX = 5; // 0x5 + field public static final int IMPORTANCE_MIN = 1; // 0x1 field public static final int IMPORTANCE_NONE = 0; // 0x0 field public static final int IMPORTANCE_UNSPECIFIED = -1000; // 0xfffffc18 } diff --git a/api/test-current.txt b/api/test-current.txt index 0b7914bd211d..af4fddbce7bd 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -34585,10 +34585,11 @@ package android.service.notification { method public int getSuppressedVisualEffects(); method public boolean isAmbient(); method public boolean matchesInterruptionFilter(); - field public static final int IMPORTANCE_DEFAULT = 2; // 0x2 - field public static final int IMPORTANCE_HIGH = 3; // 0x3 - field public static final int IMPORTANCE_LOW = 1; // 0x1 - field public static final int IMPORTANCE_MAX = 4; // 0x4 + field public static final int IMPORTANCE_DEFAULT = 3; // 0x3 + field public static final int IMPORTANCE_HIGH = 4; // 0x4 + field public static final int IMPORTANCE_LOW = 2; // 0x2 + field public static final int IMPORTANCE_MAX = 5; // 0x5 + field public static final int IMPORTANCE_MIN = 1; // 0x1 field public static final int IMPORTANCE_NONE = 0; // 0x0 field public static final int IMPORTANCE_UNSPECIFIED = -1000; // 0xfffffc18 } diff --git a/core/java/android/service/notification/NotificationListenerService.java b/core/java/android/service/notification/NotificationListenerService.java index 7b461b17329c..53c92bf6e7ce 100644 --- a/core/java/android/service/notification/NotificationListenerService.java +++ b/core/java/android/service/notification/NotificationListenerService.java @@ -929,26 +929,31 @@ public abstract class NotificationListenerService extends Service { public static final int IMPORTANCE_NONE = 0; /** - * Low notification importance: only shows in the shade, below the fold. + * Min notification importance: only shows in the shade, below the fold. */ - public static final int IMPORTANCE_LOW = 1; + public static final int IMPORTANCE_MIN = 1; /** - * Default notification importance: shows everywhere, but is not intrusive. + * Low notification importance: shows everywhere, but is not intrusive. */ - public static final int IMPORTANCE_DEFAULT = 2; + public static final int IMPORTANCE_LOW = 2; /** - * Higher notification importance: shows everywhere, makes noise, + * Default notification importance: shows everywhere, allowed to makes noise, * but does not visually intrude. */ - public static final int IMPORTANCE_HIGH = 3; + public static final int IMPORTANCE_DEFAULT = 3; /** - * Highest notification importance: shows everywhere, makes noise, - * and also visually intrudes. + * Higher notification importance: shows everywhere, allowed to makes noise and peek. */ - public static final int IMPORTANCE_MAX = 4; + public static final int IMPORTANCE_HIGH = 4; + + /** + * Highest notification importance: shows everywhere, allowed to makes noise, peek, and + * use full screen intents. + */ + public static final int IMPORTANCE_MAX = 5; private String mKey; private int mRank = -1; @@ -1041,7 +1046,7 @@ public abstract class NotificationListenerService extends Service { CharSequence explanation) { mKey = key; mRank = rank; - mIsAmbient = importance < IMPORTANCE_DEFAULT; + mIsAmbient = importance < IMPORTANCE_LOW; mMatchesInterruptionFilter = matchesInterruptionFilter; mVisibilityOverride = visibilityOverride; mSuppressedVisualEffects = suppressedVisualEffects; @@ -1058,6 +1063,8 @@ public abstract class NotificationListenerService extends Service { return "UNSPECIFIED"; case IMPORTANCE_NONE: return "NONE"; + case IMPORTANCE_MIN: + return "MIN"; case IMPORTANCE_LOW: return "LOW"; case IMPORTANCE_DEFAULT: diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 8bfd943dcedc..363b717b009c 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -1219,6 +1219,8 @@ <!-- Notification importance title, blocked status--> <string name="blocked_importance">Blocked</string> + <!-- Notification importance title, min status--> + <string name="min_importance">Min importance</string> <!-- Notification importance title, low status--> <string name="low_importance">Low importance</string> <!-- Notification importance title, normal status--> @@ -1231,17 +1233,20 @@ <!-- [CHAR LIMIT=100] Notification Importance slider: blocked importance level description --> <string name="notification_importance_blocked">Never show these notifications</string> + <!-- [CHAR LIMIT=100] Notification Importance slider: min importance level description --> + <string name="notification_importance_min">Silently show at the bottom of the notification list</string> + <!-- [CHAR LIMIT=100] Notification Importance slider: low importance level description --> - <string name="notification_importance_low">Silently show at the bottom of the notification list</string> + <string name="notification_importance_low">Silently show these notifications</string> <!-- [CHAR LIMIT=100] Notification Importance slider: normal importance level description --> - <string name="notification_importance_default">Silently show these notifications</string> + <string name="notification_importance_default">Allow these notification to make sounds</string> <!-- [CHAR LIMIT=100] Notification Importance slider: high importance level description --> - <string name="notification_importance_high">Show at the top of the notifications list and allow sound</string> + <string name="notification_importance_high">Peek onto the screen and allow sound and allow sound</string> <!-- [CHAR LIMIT=100] Notification Importance slider: max importance level description --> - <string name="notification_importance_max">Peek onto the screen and allow sound</string> + <string name="notification_importance_max">Show at the top of the notifications list, peek onto the screen and allow sound</string> <!-- Notification: Control panel: Label for button that launches notification settings. [CHAR LIMIT=NONE] --> <string name="notification_more_settings">More settings</string> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index cd0cd4a3983f..9bd645d79240 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -110,7 +110,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_MAX; +import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_HIGH; import static com.android.keyguard.KeyguardHostView.OnDismissAction; public abstract class BaseStatusBar extends SystemUI implements @@ -2215,25 +2215,25 @@ public abstract class BaseStatusBar extends SystemUI implements return false; } - if (sbn.getNotification().fullScreenIntent != null) { - if (mAccessibilityManager.isTouchExplorationEnabled()) { - if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey()); - return false; - } else { - return true; - } - } - if (isSnoozedPackage(sbn)) { if (DEBUG) Log.d(TAG, "No peeking: snoozed package: " + sbn.getKey()); return false; } - if (mNotificationData.getImportance(sbn.getKey()) < IMPORTANCE_MAX) { + if (mNotificationData.getImportance(sbn.getKey()) < IMPORTANCE_HIGH) { if (DEBUG) Log.d(TAG, "No peeking: unimportant notification: " + sbn.getKey()); return false; } + if (sbn.getNotification().fullScreenIntent != null) { + if (mAccessibilityManager.isTouchExplorationEnabled()) { + if (DEBUG) Log.d(TAG, "No peeking: accessible fullscreen: " + sbn.getKey()); + return false; + } else { + return true; + } + } + return true; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java index ccd0ad857bbe..e300614da268 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationData.java @@ -203,11 +203,11 @@ public class NotificationData { String mediaNotification = mEnvironment.getCurrentMediaNotificationKey(); - // PRIORITY_MIN media streams are allowed to drift to the bottom + // IMPORTANCE_MIN media streams are allowed to drift to the bottom final boolean aMedia = a.key.equals(mediaNotification) - && aImportance > Ranking.IMPORTANCE_LOW; + && aImportance > Ranking.IMPORTANCE_MIN; final boolean bMedia = b.key.equals(mediaNotification) - && bImportance > Ranking.IMPORTANCE_LOW; + && bImportance > Ranking.IMPORTANCE_MIN; boolean aSystemMax = aImportance >= Ranking.IMPORTANCE_MAX && isSystemNotification(na); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java index 4386c3b3379f..1c16bdc0d7bb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java @@ -183,7 +183,7 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab mContext.getColor(R.color.notification_guts_disabled_icon_tint)); } final int minProgress = systemApp ? - NotificationListenerService.Ranking.IMPORTANCE_LOW + NotificationListenerService.Ranking.IMPORTANCE_MIN : NotificationListenerService.Ranking.IMPORTANCE_NONE; mSeekBar.setMax(NotificationListenerService.Ranking.IMPORTANCE_MAX); mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @@ -216,6 +216,11 @@ public class NotificationGuts extends LinearLayout implements TunerService.Tunab R.string.notification_importance_blocked)); importanceTitle.setText(mContext.getString(R.string.blocked_importance)); break; + case NotificationListenerService.Ranking.IMPORTANCE_MIN: + importanceSummary.setText(mContext.getString( + R.string.notification_importance_min)); + importanceTitle.setText(mContext.getString(R.string.min_importance)); + break; case NotificationListenerService.Ranking.IMPORTANCE_LOW: importanceSummary.setText(mContext.getString( R.string.notification_importance_low)); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index ac714e737210..9b87a8adbeb6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1319,6 +1319,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, if (DEBUG) { Log.d(TAG, "No Fullscreen intent: suppressed by DND: " + notification.getKey()); } + } else if (mNotificationData.getImportance(notification.getKey()) + < NotificationListenerService.Ranking.IMPORTANCE_MAX) { + if (DEBUG) { + Log.d(TAG, "No Fullscreen intent: not important enough: " + + notification.getKey()); + } } else { // Stop screensaver if the notification has a full-screen intent. // (like an incoming phone call) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index c337c573ffb4..692e61092309 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -36,7 +36,7 @@ import static android.service.notification.NotificationListenerService.SUPPRESSE import static android.service.notification.NotificationListenerService.SUPPRESSED_EFFECT_SCREEN_ON; import static android.service.notification.NotificationListenerService.TRIM_FULL; import static android.service.notification.NotificationListenerService.TRIM_LIGHT; -import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_HIGH; +import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_DEFAULT; import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_NONE; import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT; import static org.xmlpull.v1.XmlPullParser.END_TAG; @@ -2524,7 +2524,7 @@ public class NotificationManagerService extends SystemService { final Notification notification = record.sbn.getNotification(); // Should this notification make noise, vibe, or use the LED? - final boolean aboveThreshold = record.getImportance() >= IMPORTANCE_HIGH; + final boolean aboveThreshold = record.getImportance() >= IMPORTANCE_DEFAULT; final boolean canInterrupt = aboveThreshold && !record.isIntercepted(); if (DBG || record.isIntercepted()) Slog.v(TAG, diff --git a/services/core/java/com/android/server/notification/NotificationRecord.java b/services/core/java/com/android/server/notification/NotificationRecord.java index 6c5685df503d..fd893fa081a5 100644 --- a/services/core/java/com/android/server/notification/NotificationRecord.java +++ b/services/core/java/com/android/server/notification/NotificationRecord.java @@ -15,6 +15,7 @@ */ package com.android.server.notification; +import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_MIN; import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED; import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_DEFAULT; import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_HIGH; @@ -33,6 +34,8 @@ import android.os.Build; import android.os.UserHandle; import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; +import android.util.Log; +import android.util.Slog; import com.android.internal.annotations.VisibleForTesting; import com.android.server.EventLogTags; @@ -55,6 +58,8 @@ import java.util.Objects; * {@hide} */ public final class NotificationRecord { + static final String TAG = "NotificationRecord"; + static final boolean DBG = Log.isLoggable(TAG, Log.DEBUG); final StatusBarNotification sbn; final int mOriginalFlags; private final Context mContext; @@ -123,6 +128,8 @@ public final class NotificationRecord { switch (n.priority) { case Notification.PRIORITY_MIN: + importance = IMPORTANCE_MIN; + break; case Notification.PRIORITY_LOW: importance = IMPORTANCE_LOW; break; @@ -143,25 +150,15 @@ public final class NotificationRecord { || n.sound != null || n.vibrate != null; stats.isNoisy = isNoisy; - if (!isNoisy && importance > IMPORTANCE_DEFAULT) { - importance = IMPORTANCE_DEFAULT; + + if (!isNoisy && importance > IMPORTANCE_LOW) { + importance = IMPORTANCE_LOW; } - try { - final ApplicationInfo applicationInfo = - mContext.getPackageManager().getApplicationInfoAsUser(sbn.getPackageName(), - 0, sbn.getUser().getIdentifier()); - if (applicationInfo.targetSdkVersion < Build.VERSION_CODES.N) { - if (isNoisy) { - if (importance >= IMPORTANCE_HIGH) { - importance = IMPORTANCE_MAX; - } else { - importance = IMPORTANCE_HIGH; - } - } + if (isNoisy) { + if (importance < IMPORTANCE_DEFAULT) { + importance = IMPORTANCE_DEFAULT; } - } catch (NameNotFoundException e) { - // oh well. } if (n.fullScreenIntent != null) { diff --git a/services/core/java/com/android/server/notification/NotificationUsageStats.java b/services/core/java/com/android/server/notification/NotificationUsageStats.java index 027285087de3..538f95146efc 100644 --- a/services/core/java/com/android/server/notification/NotificationUsageStats.java +++ b/services/core/java/com/android/server/notification/NotificationUsageStats.java @@ -597,8 +597,9 @@ public class NotificationUsageStats { private static class ImportanceHistogram { // TODO define these somewhere else - private static final int NUM_IMPORTANCES = 5; - private static final String[] IMPORTANCE_NAMES = {"none", "low", "default", "high", "max"}; + private static final int NUM_IMPORTANCES = 6; + private static final String[] IMPORTANCE_NAMES = + {"none", "min", "low", "default", "high", "max"}; private final Context mContext; private final String[] mCounterNames; private final String mPrefix; diff --git a/services/tests/servicestests/src/com/android/server/notification/RankingHelperTest.java b/services/tests/servicestests/src/com/android/server/notification/RankingHelperTest.java index f1fe3462432d..32501ad88789 100644 --- a/services/tests/servicestests/src/com/android/server/notification/RankingHelperTest.java +++ b/services/tests/servicestests/src/com/android/server/notification/RankingHelperTest.java @@ -15,12 +15,6 @@ */ package com.android.server.notification; -import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED; -import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_HIGH; -import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_LOW; -import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_MAX; -import static android.service.notification.NotificationListenerService.Ranking.IMPORTANCE_NONE; - import org.mockito.Mock; import org.mockito.MockitoAnnotations; diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index 9ac4dbfed65a..2a3f14340a39 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -86,6 +86,122 @@ public class NotificationTestList extends TestActivity } private Test[] mTests = new Test[] { + new Test("Min priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Min priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_MIN) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7000, n); + } + }, + new Test("Min priority, high pri flag") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Min priority, high pri flag") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_MIN) + .setFullScreenIntent(makeIntent2(), true) + .build(); + mNM.notify(7001, n); + } + }, + new Test("Low priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Low priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_LOW) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7002, n); + } + }, + new Test("Default priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Default priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_DEFAULT) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7004, n); + } + }, + new Test("High priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("High priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_HIGH) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7006, n); + } + }, + new Test("Max priority") { + public void run() + { + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Max priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_MAX) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7008, n); + } + }, + new Test("Max priority with delay") { + public void run() + { + try { + Thread.sleep(5000); + } catch (InterruptedException e) { + } + Notification n = new Notification.Builder(NotificationTestList.this) + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Max priority") + .setLights(0xff0000ff, 1, 0) + .setDefaults(Notification.DEFAULT_LIGHTS|Notification.DEFAULT_VIBRATE) + .setSound(Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + + getPackageName() + "/raw/ringer")) + .setPriority(Notification.PRIORITY_MAX) + .setFullScreenIntent(makeIntent2(), false) + .build(); + mNM.notify(7008, n); + } + }, new Test("Off") { public void run() { PowerManager pm = (PowerManager)NotificationTestList.this.getSystemService(Context.POWER_SERVICE); |