diff options
| author | Makoto Onuki <omakoto@google.com> | 2020-02-12 14:20:36 -0800 |
|---|---|---|
| committer | Makoto Onuki <omakoto@google.com> | 2020-02-24 22:22:13 +0000 |
| commit | 2d80ca09fc1ee076c69d709639b2c3da1a5bc312 (patch) | |
| tree | a22ff6c80368e9ac047861d9a4ea6618ef0a03f4 /core/java/android/app/ActivityThread.java | |
| parent | 85cbe43d48e36e459741d71c66c30efd4eced6fd (diff) | |
Squash same ApplicationInfo's in Parcel
ApplicationInfo now automatically tries to "squash" the same instances in a
Parcel.
NOTE: This CL still does *not* optimize the package manager APIs that return a
list. e.g. PM.queryContentProviders() still return duplicate AppInfo's.
We can optimize them by making ParcelableListSlice call "allowSquashing",
but that *could* have negative side effects, so I'm not doing it in this CL.
I think we can do that for S.
Bug: 148588589
Test: atest CtsContentTestCases # except for two preexsiting failures:
- android.content.pm.cts.PackageManagerTest#testGetIcon
- android.content.pm.cts.PackageManagerTest#testGetPreferredActivities
Test: Use the debugger and make sure bindApplication() is not receiving
duplicate AppInfo's in the provider list.
Change-Id: I3ba2c047a469169340c0f75c36bdfd394bc5d627
(cherry picked from commit 7d09275d700d3b7596da3a08f3a9594845cec7ab)
Diffstat (limited to 'core/java/android/app/ActivityThread.java')
| -rw-r--r-- | core/java/android/app/ActivityThread.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 92dd91a877a9..0ed5aec58924 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -68,6 +68,7 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ParceledListSlice; import android.content.pm.ProviderInfo; +import android.content.pm.ProviderInfoList; import android.content.pm.ServiceInfo; import android.content.res.AssetManager; import android.content.res.CompatibilityInfo; @@ -1011,8 +1012,9 @@ public final class ActivityThread extends ClientTransactionHandler { sendMessage(H.STOP_SERVICE, token); } + @Override public final void bindApplication(String processName, ApplicationInfo appInfo, - List<ProviderInfo> providers, ComponentName instrumentationName, + ProviderInfoList providerList, ComponentName instrumentationName, ProfilerInfo profilerInfo, Bundle instrumentationArgs, IInstrumentationWatcher instrumentationWatcher, IUiAutomationConnection instrumentationUiConnection, int debugMode, @@ -1052,7 +1054,7 @@ public final class ActivityThread extends ClientTransactionHandler { AppBindData data = new AppBindData(); data.processName = processName; data.appInfo = appInfo; - data.providers = providers; + data.providers = providerList.getList(); data.instrumentationName = instrumentationName; data.instrumentationArgs = instrumentationArgs; data.instrumentationWatcher = instrumentationWatcher; |
