summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/recents/misc
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2014-07-11 17:06:48 -0700
committerWinson Chung <winsonc@google.com>2014-07-12 00:10:11 +0000
commit1f24c7e37bc794057a156a730c7e4b53b01212ed (patch)
tree1eae4ff0f6768431d2f11986a7f5e1f1f48e5794 /packages/SystemUI/src/com/android/systemui/recents/misc
parent5aa5f4943264c5fc28cff618958e92bd6d232460 (diff)
downloadframeworks_base-1f24c7e37bc794057a156a730c7e4b53b01212ed.zip
frameworks_base-1f24c7e37bc794057a156a730c7e4b53b01212ed.tar.gz
frameworks_base-1f24c7e37bc794057a156a730c7e4b53b01212ed.tar.bz2
Initial changes to support lock-to-app on the foremost task. (Bug 16221876)
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/recents/misc')
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
index 05c0f58..b8beda6f 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
@@ -17,8 +17,10 @@
package com.android.systemui.recents.misc;
import android.app.ActivityManager;
+import android.app.ActivityManagerNative;
import android.app.ActivityOptions;
import android.app.AppGlobals;
+import android.app.IActivityManager;
import android.app.SearchManager;
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetManager;
@@ -66,6 +68,7 @@ public class SystemServicesProxy {
final static String TAG = "SystemServicesProxy";
ActivityManager mAm;
+ IActivityManager mIam;
AppWidgetManager mAwm;
PackageManager mPm;
IPackageManager mIpm;
@@ -83,6 +86,7 @@ public class SystemServicesProxy {
/** Private constructor */
public SystemServicesProxy(Context context) {
mAm = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+ mIam = ActivityManagerNative.getDefault();
mAwm = AppWidgetManager.getInstance(context);
mPm = context.getPackageManager();
mUm = (UserManager) context.getSystemService(Context.USER_SERVICE);
@@ -407,6 +411,17 @@ public class SystemServicesProxy {
}
/**
+ * Locks the current task.
+ */
+ public void lockCurrentTask() {
+ if (mIam == null) return;
+
+ try {
+ mIam.startLockTaskModeOnCurrent();
+ } catch (RemoteException e) {}
+ }
+
+ /**
* Takes a screenshot of the current surface.
*/
public Bitmap takeScreenshot() {