Loading packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +52 −0 Original line number Diff line number Diff line Loading @@ -1468,6 +1468,58 @@ public abstract class BaseStatusBar extends SystemUI implements return new NotificationClicker(intent, notificationKey, forHun); } public void startPendingIntentDismissingKeyguard(final PendingIntent intent) { if (!isDeviceProvisioned()) return; final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing(); final boolean afterKeyguardGone = intent.isActivity() && PreviewInflater.wouldLaunchResolverActivity(mContext, intent.getIntent(), mCurrentUserId); dismissKeyguardThenExecute(new OnDismissAction() { public boolean onDismiss() { new Thread() { @Override public void run() { try { if (keyguardShowing && !afterKeyguardGone) { ActivityManagerNative.getDefault() .keyguardWaitingForActivityDrawn(); } // The intent we are sending is for the application, which // won't have permission to immediately start an activity after // the user switches to home. We know it is safe to do at this // point, so make sure new activity switches are now allowed. ActivityManagerNative.getDefault().resumeAppSwitches(); } catch (RemoteException e) { } try { intent.send(); } catch (PendingIntent.CanceledException e) { // the stack trace isn't very helpful here. // Just log the exception message. Log.w(TAG, "Sending intent failed: " + e); // TODO: Dismiss Keyguard. } if (intent.isActivity()) { overrideActivityPendingAppTransition(keyguardShowing && !afterKeyguardGone); } } }.start(); // close the shade if it was open animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */); visibilityChanged(false); return true; } }, afterKeyguardGone); } protected class NotificationClicker implements View.OnClickListener { private PendingIntent mIntent; private final String mNotificationKey; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; import android.app.PendingIntent; import android.content.Intent; /** Loading @@ -24,5 +25,6 @@ import android.content.Intent; * Keyguard. */ public interface ActivityStarter { void startPendingIntentDismissingKeyguard(PendingIntent intent); public void startActivity(Intent intent, boolean dismissShade); } packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.res.Resources; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java +2 −2 Original line number Diff line number Diff line Loading @@ -498,8 +498,8 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL startBatteryActivity(); } else if (v == mAlarmStatus && mNextAlarm != null) { PendingIntent showIntent = mNextAlarm.getShowIntent(); if (showIntent != null && showIntent.isActivity()) { mActivityStarter.startActivity(showIntent.getIntent(), true /* dismissShade */); if (showIntent != null) { mActivityStarter.startPendingIntentDismissingKeyguard(showIntent); } } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +52 −0 Original line number Diff line number Diff line Loading @@ -1468,6 +1468,58 @@ public abstract class BaseStatusBar extends SystemUI implements return new NotificationClicker(intent, notificationKey, forHun); } public void startPendingIntentDismissingKeyguard(final PendingIntent intent) { if (!isDeviceProvisioned()) return; final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing(); final boolean afterKeyguardGone = intent.isActivity() && PreviewInflater.wouldLaunchResolverActivity(mContext, intent.getIntent(), mCurrentUserId); dismissKeyguardThenExecute(new OnDismissAction() { public boolean onDismiss() { new Thread() { @Override public void run() { try { if (keyguardShowing && !afterKeyguardGone) { ActivityManagerNative.getDefault() .keyguardWaitingForActivityDrawn(); } // The intent we are sending is for the application, which // won't have permission to immediately start an activity after // the user switches to home. We know it is safe to do at this // point, so make sure new activity switches are now allowed. ActivityManagerNative.getDefault().resumeAppSwitches(); } catch (RemoteException e) { } try { intent.send(); } catch (PendingIntent.CanceledException e) { // the stack trace isn't very helpful here. // Just log the exception message. Log.w(TAG, "Sending intent failed: " + e); // TODO: Dismiss Keyguard. } if (intent.isActivity()) { overrideActivityPendingAppTransition(keyguardShowing && !afterKeyguardGone); } } }.start(); // close the shade if it was open animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL, true /* force */); visibilityChanged(false); return true; } }, afterKeyguardGone); } protected class NotificationClicker implements View.OnClickListener { private PendingIntent mIntent; private final String mNotificationKey; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java +2 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; import android.app.PendingIntent; import android.content.Intent; /** Loading @@ -24,5 +25,6 @@ import android.content.Intent; * Keyguard. */ public interface ActivityStarter { void startPendingIntentDismissingKeyguard(PendingIntent intent); public void startActivity(Intent intent, boolean dismissShade); }
packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.statusbar.phone; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.res.Resources; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java +2 −2 Original line number Diff line number Diff line Loading @@ -498,8 +498,8 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL startBatteryActivity(); } else if (v == mAlarmStatus && mNextAlarm != null) { PendingIntent showIntent = mNextAlarm.getShowIntent(); if (showIntent != null && showIntent.isActivity()) { mActivityStarter.startActivity(showIntent.getIntent(), true /* dismissShade */); if (showIntent != null) { mActivityStarter.startPendingIntentDismissingKeyguard(showIntent); } } } Loading