Show app installer info even if it doesn't handle ACTION.APP_SHOW_INFO.
- Also fix an issue where we are showing the app name instead of it's installer name. Bug: 28301883 Change-Id: I392f7d01f5ec4d1ba5b5030e33ebe8260ff5aa31
This commit is contained in:
@@ -1124,5 +1124,18 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static CharSequence getApplicationLabel(Context context, String packageName) {
|
||||
try {
|
||||
final ApplicationInfo appInfo = context.getPackageManager().getApplicationInfo(
|
||||
packageName,
|
||||
PackageManager.MATCH_DISABLED_COMPONENTS
|
||||
| PackageManager.MATCH_UNINSTALLED_PACKAGES);
|
||||
return appInfo.loadLabel(context.getPackageManager());
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.w(TAG, "Unable to find info for package: " + packageName);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user