Plumbing for screen pinning request from sysui

Removes lock-to-app request dialog from the AM.

Added a showScreenPinningRequest to IStatusBar to handle the
flow from app requesting lock task to showing the dialog.

This CL also allows startLockTaskOnCurrent (system|signature) to
start lock task directly.  (Note: this is the less locked version
that always allows exit through back + recents)

Bug: 16957435
Change-Id: I284918dd5989de6cb2767c2a717529eb5e9c6db4
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 9db875f..0b1b883 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -56,6 +56,7 @@
     private static final int MSG_BUZZ_BEEP_BLINKED          = 15 << MSG_SHIFT;
     private static final int MSG_NOTIFICATION_LIGHT_OFF     = 16 << MSG_SHIFT;
     private static final int MSG_NOTIFICATION_LIGHT_PULSE   = 17 << MSG_SHIFT;
+    private static final int MSG_SHOW_SCREEN_PIN_REQUEST    = 18 << MSG_SHIFT;
 
     public static final int FLAG_EXCLUDE_NONE = 0;
     public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -97,6 +98,7 @@
         public void buzzBeepBlinked();
         public void notificationLightOff();
         public void notificationLightPulse(int argb, int onMillis, int offMillis);
+        public void showScreenPinningRequest();
     }
 
     public CommandQueue(Callbacks callbacks, StatusBarIconList list) {
@@ -238,6 +240,12 @@
         }
     }
 
+    public void showScreenPinningRequest() {
+        synchronized (mList) {
+            mHandler.sendEmptyMessage(MSG_SHOW_SCREEN_PIN_REQUEST);
+        }
+    }
+
     private final class H extends Handler {
         public void handleMessage(Message msg) {
             final int what = msg.what & MSG_MASK;
@@ -317,6 +325,9 @@
                 case MSG_NOTIFICATION_LIGHT_PULSE:
                     mCallbacks.notificationLightPulse((Integer) msg.obj, msg.arg1, msg.arg2);
                     break;
+                case MSG_SHOW_SCREEN_PIN_REQUEST:
+                    mCallbacks.showScreenPinningRequest();
+                    break;
             }
         }
     }
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 84ebcdfb..0487ab1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -4032,6 +4032,11 @@
         notifyUiVisibilityChanged(mSystemUiVisibility);
     }
 
+    @Override
+    public void showScreenPinningRequest() {
+        // TODO: Show request.
+    }
+
     public boolean hasActiveNotifications() {
         return !mNotificationData.getActiveNotifications().isEmpty();
     }
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
index 1b6a9e1..08732e5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
@@ -178,4 +178,8 @@
     @Override
     public void onActivationReset(ActivatableNotificationView view) {
     }
+
+    @Override
+    public void showScreenPinningRequest() {
+    }
 }