am 2f04d16f: Merge "Plumbing for screen pinning request from sysui" into lmp-mr1-dev
* commit '2f04d16f16ea935895872efe4dfcff3366070e9c': Plumbing for screen pinning request from sysui
This commit is contained in:
@@ -42,5 +42,6 @@ oneway interface IStatusBar
|
||||
void toggleRecentApps();
|
||||
void preloadRecentApps();
|
||||
void cancelPreloadRecentApps();
|
||||
void showScreenPinningRequest();
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
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 class CommandQueue extends IStatusBar.Stub {
|
||||
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 class CommandQueue extends IStatusBar.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
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 @@ public class CommandQueue extends IStatusBar.Stub {
|
||||
case MSG_NOTIFICATION_LIGHT_PULSE:
|
||||
mCallbacks.notificationLightPulse((Integer) msg.obj, msg.arg1, msg.arg2);
|
||||
break;
|
||||
case MSG_SHOW_SCREEN_PIN_REQUEST:
|
||||
mCallbacks.showScreenPinningRequest();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4036,6 +4036,11 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
|
||||
notifyUiVisibilityChanged(mSystemUiVisibility);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showScreenPinningRequest() {
|
||||
// TODO: Show request.
|
||||
}
|
||||
|
||||
public boolean hasActiveNotifications() {
|
||||
return !mNotificationData.getActiveNotifications().isEmpty();
|
||||
}
|
||||
|
||||
@@ -178,4 +178,8 @@ public class TvStatusBar extends BaseStatusBar {
|
||||
@Override
|
||||
public void onActivationReset(ActivatableNotificationView view) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showScreenPinningRequest() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ import com.android.server.Watchdog;
|
||||
import com.android.server.am.ActivityStack.ActivityState;
|
||||
import com.android.server.firewall.IntentFirewall;
|
||||
import com.android.server.pm.UserManagerService;
|
||||
import com.android.server.statusbar.StatusBarManagerInternal;
|
||||
import com.android.server.wm.AppTransition;
|
||||
import com.android.server.wm.WindowManagerService;
|
||||
import com.google.android.collect.Lists;
|
||||
@@ -199,6 +200,7 @@ import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import dalvik.system.VMRuntime;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
@@ -1217,8 +1219,6 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
CompatModeDialog mCompatModeDialog;
|
||||
long mLastMemUsageReportTime = 0;
|
||||
|
||||
private LockToAppRequestDialog mLockToAppRequest;
|
||||
|
||||
/**
|
||||
* Flag whether the current user is a "monkey", i.e. whether
|
||||
* the UI is driven by a UI automation tool.
|
||||
@@ -1689,7 +1689,6 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
BatteryStats.HistoryItem.EVENT_USER_FOREGROUND_START,
|
||||
Integer.toString(msg.arg1), msg.arg1);
|
||||
mSystemServiceManager.switchUser(msg.arg1);
|
||||
mLockToAppRequest.clearPrompt();
|
||||
break;
|
||||
}
|
||||
case ENTER_ANIMATION_COMPLETE_MSG: {
|
||||
@@ -2162,8 +2161,6 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
}
|
||||
};
|
||||
|
||||
mLockToAppRequest = new LockToAppRequestDialog(mContext, this);
|
||||
|
||||
Watchdog.getInstance().addMonitor(this);
|
||||
Watchdog.getInstance().addThread(mHandler);
|
||||
}
|
||||
@@ -8684,13 +8681,11 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
}
|
||||
boolean isSystemInitiated = Binder.getCallingUid() == Process.SYSTEM_UID;
|
||||
if (!isSystemInitiated && !isLockTaskAuthorized(pkg)) {
|
||||
final TaskRecord taskRecord = task;
|
||||
mHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mLockToAppRequest.showLockTaskPrompt(taskRecord);
|
||||
}
|
||||
});
|
||||
StatusBarManagerInternal statusBarManager = LocalServices.getService(
|
||||
StatusBarManagerInternal.class);
|
||||
if (statusBarManager != null) {
|
||||
statusBarManager.showScreenPinningRequest();
|
||||
}
|
||||
return;
|
||||
}
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
@@ -8752,11 +8747,16 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
public void startLockTaskModeOnCurrent() throws RemoteException {
|
||||
enforceCallingPermission(android.Manifest.permission.MANAGE_ACTIVITY_STACKS,
|
||||
"startLockTaskModeOnCurrent");
|
||||
ActivityRecord r = null;
|
||||
synchronized (this) {
|
||||
r = mStackSupervisor.topRunningActivityLocked();
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
try {
|
||||
ActivityRecord r = null;
|
||||
synchronized (this) {
|
||||
r = mStackSupervisor.topRunningActivityLocked();
|
||||
}
|
||||
startLockTaskMode(r.task);
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
}
|
||||
startLockTaskMode(r.task);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,4 +23,5 @@ public interface StatusBarManagerInternal {
|
||||
void buzzBeepBlinked();
|
||||
void notificationLightPulse(int argb, int onMillis, int offMillis);
|
||||
void notificationLightOff();
|
||||
void showScreenPinningRequest();
|
||||
}
|
||||
|
||||
@@ -142,6 +142,16 @@ public class StatusBarManagerService extends IStatusBarService.Stub {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showScreenPinningRequest() {
|
||||
if (mBar != null) {
|
||||
try {
|
||||
mBar.showScreenPinningRequest();
|
||||
} catch (RemoteException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ================================================================================
|
||||
|
||||
Reference in New Issue
Block a user