@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
ActivityManager.TaskDescription td = (ActivityManager.TaskDescription) args[1];
String label = td.getLabel();
Bitmap icon = td.getIcon();
// If the activity label/icon isn't specified, the application's label/icon is shown instead
// Android usually does that for us, but in this case we want info about the contained app, not VIrtualApp itself
if (label == null || icon == null) {
Application app = VClientImpl.get().getCurrentApplication();
if (app != null) {
try {
if (label == null) {
label = app.getApplicationInfo().loadLabel(app.getPackageManager()).toString();
}
if (icon == null) {
Drawable drawable = app.getApplicationInfo().loadIcon(app.getPackageManager());
if (drawable != null) {
icon = DrawableUtils.drawableToBitMap(drawable);
}
}
td = new ActivityManager.TaskDescription(label, icon, td.getPrimaryColor());
} catch (Throwable e) {
e.printStackTrace();
}
}
}
TaskDescriptionDelegate descriptionDelegate = VirtualCore.get().getTaskDescriptionDelegate();
if (descriptionDelegate != null) {
td = descriptionDelegate.getTaskDescription(td);
}
args[1] = td;
return method.invoke(who, args);
}
MethodProxies.java 文件源码
java
阅读 37
收藏 0
点赞 0
评论 0
项目:TPlayer
作者:
评论列表
文章目录