diff options
| author | 2020-06-02 12:03:23 -0700 | |
|---|---|---|
| committer | 2020-06-02 12:03:23 -0700 | |
| commit | 50b8ca8fc0ef19eca958e93e01d8d173d0001765 (patch) | |
| tree | adf021e0c643610240522699aca3f21d1cf1d973 | |
| parent | 83e9ba45a4f874ecd81aeda3a4ff7964b1eba3ba (diff) | |
INSTALLER_V2 is a permanent permission protecting streaming APIs.
Bug: 152310230, 153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I457763d259622a0f4b26e831bf8a14e83d3d19eb
| -rw-r--r-- | core/res/AndroidManifest.xml | 3 | ||||
| -rw-r--r-- | services/core/java/com/android/server/pm/DataLoaderManagerService.java | 15 |
2 files changed, 3 insertions, 15 deletions
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index fd8460f9c478..464a47002b17 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -3656,7 +3656,8 @@ <p>The package installer v2 APIs are still a work in progress and we're currently validating they work in all scenarios. <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 --> <permission android:name="com.android.permission.USE_INSTALLER_V2" diff --git a/services/core/java/com/android/server/pm/DataLoaderManagerService.java b/services/core/java/com/android/server/pm/DataLoaderManagerService.java index 81ee7d9eeef7..52fdc7983636 100644 --- a/services/core/java/com/android/server/pm/DataLoaderManagerService.java +++ b/services/core/java/com/android/server/pm/DataLoaderManagerService.java @@ -21,7 +21,6 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; -import android.content.pm.ApplicationInfo; import android.content.pm.DataLoaderParamsParcel; import android.content.pm.IDataLoader; import android.content.pm.IDataLoaderManager; @@ -122,19 +121,7 @@ public class DataLoaderManagerService extends SystemService { ri.serviceInfo.packageName, ri.serviceInfo.name); // There should only be one matching provider inside the given package. // 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; - } catch (PackageManager.NameNotFoundException ex) { - Slog.w(TAG, - "Privileged data loader: " + resolved + " not found, skipping."); - } - + return resolved; } Slog.e(TAG, "Didn't find any matching data loader service provider."); return null; |