cmsdk: notify new listeners all registered custom tiles

If a new listener is created, then notified all custom tiles that was previously registered

Change-Id: I9e8d9a1fa84d54b00ea7fd8ed400e172f17f06cc
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
This commit is contained in:
Jorge Ruesga 2015-06-14 00:07:09 +02:00
parent 08a3470a78
commit 635f8f1657
1 changed files with 11 additions and 0 deletions

View File

@ -113,6 +113,17 @@ public class CMStatusBarManagerService extends SystemService {
final ComponentName component, final int userid) {
enforceBindCustomTileListener();
mCustomTileListeners.registerService(listener, component, userid);
// Notify registered tiles
try {
for (ExternalQuickSettingsRecord qsTile : mQSTileList) {
if (userid == UserHandle.USER_ALL || qsTile.getUserId() == userid) {
listener.onCustomTilePosted(new StatusBarCustomTileHolder(qsTile.sbTile));
}
}
} catch (RemoteException re) {
// Ignore
}
}
/**