Merge "INSTALLER_V2 is a permanent permission protecting streaming APIs." into rvc-dev

This commit is contained in:
Alex Buynytskyy
2020-06-03 18:06:42 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 15 deletions

View File

@@ -3656,7 +3656,8 @@
<p>The package installer v2 APIs are still a work in progress and we're <p>The package installer v2 APIs are still a work in progress and we're
currently validating they work in all scenarios. currently validating they work in all scenarios.
<p>Not for use by third-party applications. <p>Not for use by third-party applications.
TODO(b/152310230): remove this permission once the APIs are confirmed to be sufficient. TODO(b/152310230): use this permission to protect only Incremental installations
once the APIs are confirmed to be sufficient.
@hide @hide
--> -->
<permission android:name="com.android.permission.USE_INSTALLER_V2" <permission android:name="com.android.permission.USE_INSTALLER_V2"

View File

@@ -21,7 +21,6 @@ import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.ServiceConnection; import android.content.ServiceConnection;
import android.content.pm.ApplicationInfo;
import android.content.pm.DataLoaderParamsParcel; import android.content.pm.DataLoaderParamsParcel;
import android.content.pm.IDataLoader; import android.content.pm.IDataLoader;
import android.content.pm.IDataLoaderManager; import android.content.pm.IDataLoaderManager;
@@ -122,19 +121,7 @@ public class DataLoaderManagerService extends SystemService {
ri.serviceInfo.packageName, ri.serviceInfo.name); ri.serviceInfo.packageName, ri.serviceInfo.name);
// There should only be one matching provider inside the given package. // There should only be one matching provider inside the given package.
// If there's more than one, return the first one found. // If there's more than one, return the first one found.
try {
ApplicationInfo ai = pm.getApplicationInfo(resolved.getPackageName(), 0);
if (!ai.isPrivilegedApp()) {
Slog.w(TAG,
"Data loader: " + resolved + " is not a privileged app, skipping.");
continue;
}
return resolved; return resolved;
} catch (PackageManager.NameNotFoundException ex) {
Slog.w(TAG,
"Privileged data loader: " + resolved + " not found, skipping.");
}
} }
Slog.e(TAG, "Didn't find any matching data loader service provider."); Slog.e(TAG, "Didn't find any matching data loader service provider.");
return null; return null;