• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

Revisión4ce29f8179a5322e27fb8f4316059a497159f444 (tree)
Tiempo2015-10-28 02:38:34
AutorAdrian Roos <roosa@goog...>
CommiterThe Android Automerger

Log Message

DO NOT MERGE Send next alarm's show intent via PendingIntent

Bug: 23909438
Change-Id: I0bb277c8385b7936fbda03cd76f02248c4fc55de

Cambiar Resumen

Diferencia incremental

--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -1528,6 +1528,58 @@ public abstract class BaseStatusBar extends SystemUI implements
15281528 return new NotificationClicker(intent, notificationKey, forHun);
15291529 }
15301530
1531+ public void startPendingIntentDismissingKeyguard(final PendingIntent intent) {
1532+ if (!isDeviceProvisioned()) return;
1533+
1534+ final boolean keyguardShowing = mStatusBarKeyguardViewManager.isShowing();
1535+ final boolean afterKeyguardGone = intent.isActivity()
1536+ && PreviewInflater.wouldLaunchResolverActivity(mContext, intent.getIntent(),
1537+ mCurrentUserId);
1538+ dismissKeyguardThenExecute(new OnDismissAction() {
1539+ public boolean onDismiss() {
1540+ new Thread() {
1541+ @Override
1542+ public void run() {
1543+ try {
1544+ if (keyguardShowing && !afterKeyguardGone) {
1545+ ActivityManagerNative.getDefault()
1546+ .keyguardWaitingForActivityDrawn();
1547+ }
1548+
1549+ // The intent we are sending is for the application, which
1550+ // won't have permission to immediately start an activity after
1551+ // the user switches to home. We know it is safe to do at this
1552+ // point, so make sure new activity switches are now allowed.
1553+ ActivityManagerNative.getDefault().resumeAppSwitches();
1554+ } catch (RemoteException e) {
1555+ }
1556+
1557+ try {
1558+ intent.send();
1559+ } catch (PendingIntent.CanceledException e) {
1560+ // the stack trace isn't very helpful here.
1561+ // Just log the exception message.
1562+ Log.w(TAG, "Sending intent failed: " + e);
1563+
1564+ // TODO: Dismiss Keyguard.
1565+ }
1566+ if (intent.isActivity()) {
1567+ overrideActivityPendingAppTransition(keyguardShowing
1568+ && !afterKeyguardGone);
1569+ }
1570+ }
1571+ }.start();
1572+
1573+ // close the shade if it was open
1574+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL,
1575+ true /* force */);
1576+ visibilityChanged(false);
1577+
1578+ return true;
1579+ }
1580+ }, afterKeyguardGone);
1581+ }
1582+
15311583 protected class NotificationClicker implements View.OnClickListener {
15321584 private PendingIntent mIntent;
15331585 private final String mNotificationKey;
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ActivityStarter.java
@@ -16,6 +16,7 @@
1616
1717 package com.android.systemui.statusbar.phone;
1818
19+import android.app.PendingIntent;
1920 import android.content.Intent;
2021
2122 /**
@@ -24,5 +25,6 @@ import android.content.Intent;
2425 * Keyguard.
2526 */
2627 public interface ActivityStarter {
28+ void startPendingIntentDismissingKeyguard(PendingIntent intent);
2729 public void startActivity(Intent intent, boolean dismissShade);
2830 }
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
@@ -16,6 +16,7 @@
1616
1717 package com.android.systemui.statusbar.phone;
1818
19+import android.app.PendingIntent;
1920 import android.content.Context;
2021 import android.content.Intent;
2122 import android.content.res.Resources;
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
@@ -498,8 +498,8 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
498498 startBatteryActivity();
499499 } else if (v == mAlarmStatus && mNextAlarm != null) {
500500 PendingIntent showIntent = mNextAlarm.getShowIntent();
501- if (showIntent != null && showIntent.isActivity()) {
502- mActivityStarter.startActivity(showIntent.getIntent(), true /* dismissShade */);
501+ if (showIntent != null) {
502+ mActivityStarter.startPendingIntentDismissingKeyguard(showIntent);
503503 }
504504 }
505505 }