public class

CMStatusBarManager

extends Object
java.lang.Object
   ↳ cyanogenmod.app.CMStatusBarManager

Class Overview

The CMStatusBarManager allows you to publish and remove CustomTiles within the Quick Settings Panel.

Each of the publish methods takes an int id parameter and optionally a String tag parameter, which may be null. These parameters are used to form a pair (tag, id), or (null, id) if tag is unspecified. This pair identifies this custom tile from your app to the system, so that pair should be unique within your app. If you call one of the publish methods with a (tag, id) pair that is currently active and a new set of custom tile parameters, it will be updated. For example, if you pass a new custom tile icon, the old icon in the panel will be replaced with the new one. This is also the same tag and id you pass to the removeTile(int) or removeTile(String, int) method to clear this custom tile.

To get the instance of this class, utilize CMStatusBarManager#getInstance(Context context)

See Also

Summary

Public Methods
static CMStatusBarManager getInstance(Context context)
Get or create an instance of the CMStatusBarManager
void publishTile(String tag, int id, CustomTile customTile)
Post a custom tile to be shown in the status bar panel.
void publishTile(int id, CustomTile customTile)
Post a custom tile to be shown in the status bar panel.
void publishTileAsUser(String tag, int id, CustomTile customTile, UserHandle user)
Similar to publishTile(int, cyanogenmod.app.CustomTile), however lets you specify a UserHandle You will need the cyanogenmod.permission.PUBLISH_CUSTOM_TILE to utilize this functionality.
void removeTile(int id)
Remove a custom tile that's currently published to the StatusBarPanel.
void removeTile(String tag, int id)
Remove a custom tile that's currently published to the StatusBarPanel.
void removeTileAsUser(String tag, int id, UserHandle user)
Similar to removeTile(String, int) however lets you specific a UserHandle You will need the cyanogenmod.platform.PUBLISH_CUSTOM_TILE to utilize this functionality.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static CMStatusBarManager getInstance (Context context)

Added in API level 1

Get or create an instance of the CMStatusBarManager

public void publishTile (String tag, int id, CustomTile customTile)

Added in API level 1

Post a custom tile to be shown in the status bar panel. If a custom tile with the same tag and id has already been posted by your application and has not yet been removed, it will be replaced by the updated information. You will need the cyanogenmod.permission.PUBLISH_CUSTOM_TILE to utilize this functionality.

Parameters
tag A string identifier for this custom tile. May be null.
id An identifier for this custom tile. The pair (tag, id) must be unique within your application.
customTile A CustomTile object describing what to show the user. Must not be null.

public void publishTile (int id, CustomTile customTile)

Added in API level 1

Post a custom tile to be shown in the status bar panel. If a custom tile with the same id has already been posted by your application and has not yet been removed, it will be replaced by the updated information. You will need the cyanogenmod.permission.PUBLISH_CUSTOM_TILE to utilize this functionality.

Parameters
id An identifier for this customTile unique within your application.
customTile A CustomTile object describing what to show the user. Must not be null.

public void publishTileAsUser (String tag, int id, CustomTile customTile, UserHandle user)

Added in API level 1

Similar to publishTile(int, cyanogenmod.app.CustomTile), however lets you specify a UserHandle You will need the cyanogenmod.permission.PUBLISH_CUSTOM_TILE to utilize this functionality.

Parameters
tag A string identifier for this custom tile. May be null.
id An identifier for this custom tile. The pair (tag, id) must be unique within your application.
customTile A CustomTile object describing what to show the user. Must not be null.
user A user handle to publish the tile as.

public void removeTile (int id)

Added in API level 1

Remove a custom tile that's currently published to the StatusBarPanel. You will need the cyanogenmod.permission.PUBLISH_CUSTOM_TILE to utilize this functionality.

Parameters
id The identifier for the custom tile to be removed.

public void removeTile (String tag, int id)

Added in API level 1

Remove a custom tile that's currently published to the StatusBarPanel. You will need the cyanogenmod.platform.PUBLISH_CUSTOM_TILE to utilize this functionality.

Parameters
tag The string identifier for the custom tile to be removed.
id The identifier for the custom tile to be removed.

public void removeTileAsUser (String tag, int id, UserHandle user)

Added in API level 1

Similar to removeTile(String, int) however lets you specific a UserHandle You will need the cyanogenmod.platform.PUBLISH_CUSTOM_TILE to utilize this functionality.

Parameters
tag The string identifier for the custom tile to be removed.
id The identifier for the custom tile to be removed.
user The user handle to remove the tile from.