aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-04-28 17:51:12 -0700
committerAdnan Begovic <adnan@cyngn.com>2015-04-29 10:46:06 -0700
commitaa558ade9e3680f87d736303d92d1ce94961f414 (patch)
treef99325908e200ab31ae6d6e26420479bc683ad4c /src/java
parentaa8614e39b90c0d9cc2d86777d28c691773d9dae (diff)
downloadlineage-sdk-aa558ade9e3680f87d736303d92d1ce94961f414.tar.gz
lineage-sdk-aa558ade9e3680f87d736303d92d1ce94961f414.tar.bz2
lineage-sdk-aa558ade9e3680f87d736303d92d1ce94961f414.zip
CMSDK: Create means of removing tiles via listener interface.
Change-Id: I8934fe5c82963a3aba38ce5eec6e59e50a820d17
Diffstat (limited to 'src/java')
-rw-r--r--src/java/cyanogenmod/app/CustomTileListenerService.java33
-rw-r--r--src/java/cyanogenmod/app/ICMStatusBarManager.aidl1
2 files changed, 34 insertions, 0 deletions
diff --git a/src/java/cyanogenmod/app/CustomTileListenerService.java b/src/java/cyanogenmod/app/CustomTileListenerService.java
index 6c7dce05..1cd8d2de 100644
--- a/src/java/cyanogenmod/app/CustomTileListenerService.java
+++ b/src/java/cyanogenmod/app/CustomTileListenerService.java
@@ -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;
+ }
}
diff --git a/src/java/cyanogenmod/app/ICMStatusBarManager.aidl b/src/java/cyanogenmod/app/ICMStatusBarManager.aidl
index 439accec..88e28b0d 100644
--- a/src/java/cyanogenmod/app/ICMStatusBarManager.aidl
+++ b/src/java/cyanogenmod/app/ICMStatusBarManager.aidl
@@ -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);
}