diff options
Diffstat (limited to 'cm/lib')
-rw-r--r-- | cm/lib/java/org/cyanogenmod/platform/internal/CMStatusBarManagerService.java | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/cm/lib/java/org/cyanogenmod/platform/internal/CMStatusBarManagerService.java b/cm/lib/java/org/cyanogenmod/platform/internal/CMStatusBarManagerService.java index 88472a1..b640aaf 100644 --- a/cm/lib/java/org/cyanogenmod/platform/internal/CMStatusBarManagerService.java +++ b/cm/lib/java/org/cyanogenmod/platform/internal/CMStatusBarManagerService.java @@ -98,7 +98,7 @@ public class CMStatusBarManagerService extends SystemService { userId = ActivityManager.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, false, "cancelCustomTileWithTag", pkg); removeCustomTileWithTagInternal(Binder.getCallingUid(), - Binder.getCallingPid(), pkg, tag, id, userId); + Binder.getCallingPid(), pkg, tag, id, userId, null); } /** @@ -124,6 +124,29 @@ public class CMStatusBarManagerService extends SystemService { enforceBindCustomTileListener(); mCustomTileListeners.unregisterService(listener, userid); } + + /** + * Allow an ICustomTileListener to simulate clearing (dismissing) a single customTile. + * + * @param token The binder for the listener, to check that the caller is allowed + */ + @Override + public void removeCustomTileFromListener(ICustomTileListener token, String pkg, + String tag, int id) { + final int callingUid = Binder.getCallingUid(); + final int callingPid = Binder.getCallingPid(); + long identity = Binder.clearCallingIdentity(); + try { + synchronized (mQSTileList) { + final ManagedServices.ManagedServiceInfo info + = mCustomTileListeners.checkServiceTokenLocked(token); + removeCustomTileFromListenerLocked(info, callingUid, callingPid, + pkg, tag, id, info.userid); + } + } finally { + Binder.restoreCallingIdentity(identity); + } + } }; void createCustomTileWithTagInternal(final String pkg, final String opPkg, final int callingUid, @@ -281,8 +304,14 @@ public class CMStatusBarManagerService extends SystemService { || r.getUserId() == userId; } + private void removeCustomTileFromListenerLocked(ManagedServices.ManagedServiceInfo info, + int callingUid, int callingPid, String pkg, String tag, int id, int userId) { + removeCustomTileWithTagInternal(callingUid, callingPid, pkg, tag, id, userId, info); + } + void removeCustomTileWithTagInternal(final int callingUid, final int callingPid, - final String pkg, final String tag, final int id, final int userId) { + final String pkg, final String tag, final int id, final int userId, + final ManagedServices.ManagedServiceInfo listener) { mHandler.post(new Runnable() { @Override public void run() { |