diff options
| author | 2011-09-11 16:29:05 -0400 | |
|---|---|---|
| committer | 2011-09-11 16:30:03 -0400 | |
| commit | 92d331883ada42e49001853e266cda2d9c8631b8 (patch) | |
| tree | 2676ea41daeb2cfac5399b77c294347809395c8d | |
| parent | fd19906b50927834787403ca984f6fda93b53410 (diff) | |
Exit the keyguard when the user clicks a notification.
(This only works if the keyguard is not secure, but then
again, the user can't access the notification panel in that
case anyway.)
Bug: 5173952
Change-Id: I8a6081d26c52843822b381d8ebe0fae94a03bef9
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 5 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java | 6 |
2 files changed, 11 insertions, 0 deletions
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 ee9aa41104bb..3c84331fd709 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -20,6 +20,7 @@ import android.animation.ObjectAnimator; import android.app.ActivityManager; import android.app.ActivityManagerNative; import android.app.Dialog; +import android.app.KeyguardManager; import android.app.Notification; import android.app.PendingIntent; import android.app.StatusBarManager; @@ -1647,6 +1648,10 @@ public class PhoneStatusBar extends StatusBar { // the stack trace isn't very helpful here. Just log the exception message. Slog.w(TAG, "Sending contentIntent failed: " + e); } + + KeyguardManager kgm = + (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE); + if (kgm != null) kgm.exitKeyguardSecurely(null); } try { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 39011d37b2c9..3ace258324ed 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -24,6 +24,7 @@ import android.animation.LayoutTransition; import android.animation.ObjectAnimator; import android.app.ActivityManagerNative; import android.app.Dialog; +import android.app.KeyguardManager; import android.app.PendingIntent; import android.app.Notification; import android.app.StatusBarManager; @@ -1318,10 +1319,15 @@ public class TabletStatusBar extends StatusBar implements new Rect(pos[0], pos[1], pos[0]+v.getWidth(), pos[1]+v.getHeight())); try { mIntent.send(mContext, 0, overlay); + } catch (PendingIntent.CanceledException e) { // the stack trace isn't very helpful here. Just log the exception message. Slog.w(TAG, "Sending contentIntent failed: " + e); } + + KeyguardManager kgm = + (KeyguardManager) mContext.getSystemService(Context.KEYGUARD_SERVICE); + if (kgm != null) kgm.exitKeyguardSecurely(null); } try { |