Ignore lint for GET_UNINSTALLED_PACKAGES

Lint says that only GET_META_DATA and GET_SHARED_LIBRARY_FILES are allowed.
This contradicts Android's documentation where GET_UNINSTALLED_PACKAGES
is also allowed.

Fixes #605
This commit is contained in:
Dominik Schürmann 2016-05-13 00:31:24 +03:00
parent 768b3d7688
commit 0984a93133
2 changed files with 2 additions and 0 deletions

View File

@ -241,6 +241,7 @@ public class PrivilegedInstaller extends Installer {
throws InstallFailedException {
ApplicationInfo appInfo;
try {
//noinspection WrongConstant (lint is actually wrong here!)
appInfo = mPm.getApplicationInfo(packageName, PackageManager.GET_UNINSTALLED_PACKAGES);
} catch (PackageManager.NameNotFoundException e) {
Log.w(TAG, "Failed to get ApplicationInfo for uninstalling");

View File

@ -66,6 +66,7 @@ public class AppDiff {
// This is a little convoluted because we want to get all uninstalled
// apps, but this may include apps with just data, and if it is just
// data we still want to count it as "installed".
//noinspection WrongConstant (lint is actually wrong here!)
mInstalledAppInfo = mPm.getApplicationInfo(pkgName,
PackageManager.GET_UNINSTALLED_PACKAGES);
if ((mInstalledAppInfo.flags & ApplicationInfo.FLAG_INSTALLED) == 0) {