summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hall Liu <hallliu@google.com> 2016-05-31 17:37:37 +0000
committer android-build-merger <android-build-merger@google.com> 2016-05-31 17:37:37 +0000
commit49459e4ee88dbaa342fb6add9af51ccbadc88d98 (patch)
treea4c28ed67f017affa1a67718e2bb110d18fa1416
parentf2ca8f9c508342eae262348f6752bcd53aff2b83 (diff)
parent8b655e0f57b071756e7d6a3547eeabe35885bcc9 (diff)
Merge "Disable app pinning when emergency call button pressed" into nyc-dev
am: 8b655e0f57 * commit '8b655e0f57b071756e7d6a3547eeabe35885bcc9': Disable app pinning when emergency call button pressed Change-Id: Ibe8d37716ad1630359b3ef08350f485b0d1177a7
-rw-r--r--packages/Keyguard/src/com/android/keyguard/EmergencyButton.java10
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java5
2 files changed, 15 insertions, 0 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
index 40c11cfcffc1..8d411453b5ae 100644
--- a/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
+++ b/packages/Keyguard/src/com/android/keyguard/EmergencyButton.java
@@ -16,15 +16,18 @@
package com.android.keyguard;
+import android.app.ActivityManagerNative;
import android.app.ActivityOptions;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.PowerManager;
+import android.os.RemoteException;
import android.os.SystemClock;
import android.os.UserHandle;
import android.telecom.TelecomManager;
import android.util.AttributeSet;
+import android.util.Slog;
import android.view.View;
import android.widget.Button;
@@ -47,6 +50,8 @@ public class EmergencyButton extends Button {
| Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS
| Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ private static final String LOG_TAG = "EmergencyButton";
+
KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() {
@Override
@@ -122,6 +127,11 @@ public class EmergencyButton extends Button {
// TODO: implement a shorter timeout once new PowerManager API is ready.
// should be the equivalent to the old userActivity(EMERGENCY_CALL_TIMEOUT)
mPowerManager.userActivity(SystemClock.uptimeMillis(), true);
+ try {
+ ActivityManagerNative.getDefault().stopSystemLockTaskMode();
+ } catch (RemoteException e) {
+ Slog.w(LOG_TAG, "Failed to stop app pinning");
+ }
if (isInCall()) {
resumeCall();
if (mEmergencyButtonCallback != null) {
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 3da22d6b55b5..e07243f18f8c 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -199,6 +199,7 @@ import android.provider.Settings;
import android.service.voice.IVoiceInteractionSession;
import android.service.voice.VoiceInteractionManagerInternal;
import android.service.voice.VoiceInteractionSession;
+import android.telecom.TelecomManager;
import android.text.format.DateUtils;
import android.text.format.Time;
import android.text.style.SuggestionSpan;
@@ -10167,6 +10168,10 @@ public final class ActivityManagerService extends ActivityManagerNative
mStackSupervisor.setLockTaskModeLocked(null, ActivityManager.LOCK_TASK_MODE_NONE,
"stopLockTask", true);
}
+ TelecomManager tm = (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE);
+ if (tm != null) {
+ tm.showInCallScreen(false);
+ }
} finally {
Binder.restoreCallingIdentity(ident);
}