CMSDK: Create means of removing tiles via listener interface.
Change-Id: I8934fe5c82963a3aba38ce5eec6e59e50a820d17
This commit is contained in:
@@ -191,4 +191,37 @@ public class CustomTileListenerService extends Service {
|
||||
public void onListenerConnected() {
|
||||
// optional
|
||||
}
|
||||
|
||||
/**
|
||||
* Inform the {@link cyanogenmod.app.CMStatusBarManager} about dismissal of a single custom tile.
|
||||
* <p>
|
||||
* Use this if your listener has a user interface that allows the user to dismiss individual
|
||||
* custom tiles, similar to the behavior of Android's status bar and notification panel.
|
||||
* It should be called after the user dismisses a single custom tile using your UI;
|
||||
* upon being informed, the cmstatusbar manager will actually remove the custom tile
|
||||
* and you will get an {@link #onCustomTileRemoved(StatusBarPanelCustomTile)} callback.
|
||||
* <P>
|
||||
*
|
||||
* @param pkg Package of the notifying app.
|
||||
* @param tag Tag of the custom tile as specified by the notifying app
|
||||
* @param id ID of the notification as specified by the notifying app
|
||||
* <p>
|
||||
*/
|
||||
public final void removeCustomTile(String pkg, String tag, int id) {
|
||||
if (!isBound()) return;
|
||||
try {
|
||||
getStatusBarInterface().removeCustomTileFromListener(
|
||||
mWrapper, pkg, tag, id);
|
||||
} catch (android.os.RemoteException ex) {
|
||||
Log.v(TAG, "Unable to contact cmstautusbar manager", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isBound() {
|
||||
if (mWrapper == null) {
|
||||
Log.w(TAG, "CustomTile listener service not yet bound.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,4 +34,5 @@ interface ICMStatusBarManager {
|
||||
// You need the BIND_QUICK_SETTINGS_TILE_LISTENER permission
|
||||
void registerListener(in ICustomTileListener listener, in ComponentName component, int userid);
|
||||
void unregisterListener(in ICustomTileListener listener, int userid);
|
||||
void removeCustomTileFromListener(in ICustomTileListener listener, String pkg, String tag, int id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user