From ccf08d7c84621ced051c1c3b0f52efde10b94569 Mon Sep 17 00:00:00 2001 From: Kaori Katou Date: Tue, 26 May 2015 16:25:04 +0900 Subject: [PATCH] Dismiss keyguard when user button is tapped When multi-user is disabled and user button is tapped on the keyguard, the contact app is displayed behind the keyguard. The keyguard should be dismissed when the contact app is launched. Change-Id: I7daa0bec84b5172e78668cc71e51955f166ede0a (cherry picked from commit 0a334053298c988a816a754c4235ed3b01cc9cfc) --- .../systemui/statusbar/phone/KeyguardStatusBarView.java | 5 +++++ .../android/systemui/statusbar/phone/MultiUserSwitch.java | 6 +++--- .../android/systemui/statusbar/phone/PhoneStatusBar.java | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java index 7fbb176aa310b..74bd096aaff39 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java @@ -30,6 +30,7 @@ import android.widget.TextView; import com.android.systemui.BatteryMeterView; import com.android.systemui.Interpolators; import com.android.systemui.R; +import com.android.systemui.qs.QSPanel; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.KeyguardUserSwitcher; import com.android.systemui.statusbar.policy.UserInfoController; @@ -150,6 +151,10 @@ public class KeyguardStatusBarView extends RelativeLayout }); } + public void setQSPanel(QSPanel qsp) { + mMultiUserSwitch.setQsPanel(qsp); + } + @Override public void onBatteryLevelChanged(int level, boolean pluggedIn, boolean charging) { String percentage = NumberFormat.getPercentInstance().format((double) level / 100.0); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java index 54af684c3cd60..6698d13ab123c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java @@ -127,10 +127,10 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener mTmpInt2); } } else { - Intent intent = ContactsContract.QuickContact.composeQuickContactsIntent( - getContext(), v, ContactsContract.Profile.CONTENT_URI, - ContactsContract.QuickContact.MODE_LARGE, null); if (mQsPanel != null) { + Intent intent = ContactsContract.QuickContact.composeQuickContactsIntent( + getContext(), v, ContactsContract.Profile.CONTENT_URI, + ContactsContract.QuickContact.MODE_LARGE, null); mQsPanel.getHost().startActivityDismissingKeyguard(intent); } } 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 c8a2ec01d94ab..db75343df6fea 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -893,6 +893,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, qsContainer.setHost(qsh); mQSPanel = qsContainer.getQsPanel(); mQSPanel.setBrightnessMirror(mBrightnessMirrorController); + mKeyguardStatusBar.setQSPanel(mQSPanel); mHeader = qsContainer.getHeader(); initSignalCluster(mHeader); mHeader.setActivityStarter(PhoneStatusBar.this);