use of com.android.systemui.statusbar.phone.StatusBarIconController in project platform_frameworks_base by android.
the class TileServices method updateStatusIcon.
@Override
public void updateStatusIcon(IBinder token, Icon icon, String contentDescription) {
CustomTile customTile = getTileForToken(token);
if (customTile != null) {
verifyCaller(customTile);
try {
ComponentName componentName = customTile.getComponent();
String packageName = componentName.getPackageName();
UserHandle userHandle = getCallingUserHandle();
PackageInfo info = mContext.getPackageManager().getPackageInfoAsUser(packageName, 0, userHandle.getIdentifier());
if (info.applicationInfo.isSystemApp()) {
final StatusBarIcon statusIcon = icon != null ? new StatusBarIcon(userHandle, packageName, icon, 0, 0, contentDescription) : null;
mMainHandler.post(new Runnable() {
@Override
public void run() {
StatusBarIconController iconController = mHost.getIconController();
iconController.setIcon(componentName.getClassName(), statusIcon);
iconController.setExternalIcon(componentName.getClassName());
}
});
}
} catch (PackageManager.NameNotFoundException e) {
}
}
}
use of com.android.systemui.statusbar.phone.StatusBarIconController in project android_frameworks_base by AOSPA.
the class TileServices method updateStatusIcon.
@Override
public void updateStatusIcon(IBinder token, Icon icon, String contentDescription) {
CustomTile customTile = getTileForToken(token);
if (customTile != null) {
verifyCaller(customTile);
try {
ComponentName componentName = customTile.getComponent();
String packageName = componentName.getPackageName();
UserHandle userHandle = getCallingUserHandle();
PackageInfo info = mContext.getPackageManager().getPackageInfoAsUser(packageName, 0, userHandle.getIdentifier());
if (info.applicationInfo.isSystemApp()) {
final StatusBarIcon statusIcon = icon != null ? new StatusBarIcon(userHandle, packageName, icon, 0, 0, contentDescription) : null;
mMainHandler.post(new Runnable() {
@Override
public void run() {
StatusBarIconController iconController = mHost.getIconController();
iconController.setIcon(componentName.getClassName(), statusIcon);
iconController.setExternalIcon(componentName.getClassName());
}
});
}
} catch (PackageManager.NameNotFoundException e) {
}
}
}
use of com.android.systemui.statusbar.phone.StatusBarIconController in project android_frameworks_base by ResurrectionRemix.
the class TileServices method updateStatusIcon.
@Override
public void updateStatusIcon(IBinder token, Icon icon, String contentDescription) {
CustomTile customTile = getTileForToken(token);
if (customTile != null) {
verifyCaller(customTile);
try {
ComponentName componentName = customTile.getComponent();
String packageName = componentName.getPackageName();
UserHandle userHandle = getCallingUserHandle();
PackageInfo info = mContext.getPackageManager().getPackageInfoAsUser(packageName, 0, userHandle.getIdentifier());
if (info.applicationInfo.isSystemApp()) {
final StatusBarIcon statusIcon = icon != null ? new StatusBarIcon(userHandle, packageName, icon, 0, 0, contentDescription) : null;
mMainHandler.post(new Runnable() {
@Override
public void run() {
StatusBarIconController iconController = mHost.getIconController();
iconController.setIcon(componentName.getClassName(), statusIcon);
iconController.setExternalIcon(componentName.getClassName());
}
});
}
} catch (PackageManager.NameNotFoundException e) {
}
}
}
use of com.android.systemui.statusbar.phone.StatusBarIconController in project android_frameworks_base by DirtyUnicorns.
the class TileServices method updateStatusIcon.
@Override
public void updateStatusIcon(IBinder token, Icon icon, String contentDescription) {
CustomTile customTile = getTileForToken(token);
if (customTile != null) {
verifyCaller(customTile);
try {
ComponentName componentName = customTile.getComponent();
String packageName = componentName.getPackageName();
UserHandle userHandle = getCallingUserHandle();
PackageInfo info = mContext.getPackageManager().getPackageInfoAsUser(packageName, 0, userHandle.getIdentifier());
if (info.applicationInfo.isSystemApp()) {
final StatusBarIcon statusIcon = icon != null ? new StatusBarIcon(userHandle, packageName, icon, 0, 0, contentDescription) : null;
mMainHandler.post(new Runnable() {
@Override
public void run() {
StatusBarIconController iconController = mHost.getIconController();
iconController.setIcon(componentName.getClassName(), statusIcon);
iconController.setExternalIcon(componentName.getClassName());
}
});
}
} catch (PackageManager.NameNotFoundException e) {
}
}
}
use of com.android.systemui.statusbar.phone.StatusBarIconController in project android_frameworks_base by crdroidandroid.
the class TileServices method updateStatusIcon.
@Override
public void updateStatusIcon(IBinder token, Icon icon, String contentDescription) {
CustomTile customTile = getTileForToken(token);
if (customTile != null) {
verifyCaller(customTile);
try {
ComponentName componentName = customTile.getComponent();
String packageName = componentName.getPackageName();
UserHandle userHandle = getCallingUserHandle();
PackageInfo info = mContext.getPackageManager().getPackageInfoAsUser(packageName, 0, userHandle.getIdentifier());
if (info.applicationInfo.isSystemApp()) {
final StatusBarIcon statusIcon = icon != null ? new StatusBarIcon(userHandle, packageName, icon, 0, 0, contentDescription) : null;
mMainHandler.post(new Runnable() {
@Override
public void run() {
StatusBarIconController iconController = mHost.getIconController();
iconController.setIcon(componentName.getClassName(), statusIcon);
iconController.setExternalIcon(componentName.getClassName());
}
});
}
} catch (PackageManager.NameNotFoundException e) {
}
}
}
Aggregations