summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2014-10-15 17:15:53 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-15 17:15:53 +0000
commit5a4a37794af994bbac1396a4b276f0ce0f14deed (patch)
treeedcd6c289668f411897859ae7cf3ca91c01318a6
parent50be41c29f2321148d5e48c8ee3a93bdae68c54e (diff)
parente6ba73e07b16b413f57a06218e55b4fcd8d98f21 (diff)
downloadframeworks_base-5a4a37794af994bbac1396a4b276f0ce0f14deed.zip
frameworks_base-5a4a37794af994bbac1396a4b276f0ce0f14deed.tar.gz
frameworks_base-5a4a37794af994bbac1396a4b276f0ce0f14deed.tar.bz2
am e6ba73e0: am fbfd900a: am 2df76285: am 203ed4db: am 88a6ed54: Merge "Reduce PackageInstaller Binder memory pressure." into lmp-dev
* commit 'e6ba73e07b16b413f57a06218e55b4fcd8d98f21': Reduce PackageInstaller Binder memory pressure.
-rw-r--r--core/java/android/content/pm/IPackageInstaller.aidl5
-rw-r--r--core/java/android/content/pm/PackageInstaller.java4
-rw-r--r--services/core/java/com/android/server/pm/PackageInstallerService.java9
3 files changed, 10 insertions, 8 deletions
diff --git a/core/java/android/content/pm/IPackageInstaller.aidl b/core/java/android/content/pm/IPackageInstaller.aidl
index 6daefc8..ba62cd6 100644
--- a/core/java/android/content/pm/IPackageInstaller.aidl
+++ b/core/java/android/content/pm/IPackageInstaller.aidl
@@ -20,6 +20,7 @@ import android.content.pm.IPackageDeleteObserver2;
import android.content.pm.IPackageInstallerCallback;
import android.content.pm.IPackageInstallerSession;
import android.content.pm.PackageInstaller;
+import android.content.pm.ParceledListSlice;
import android.content.IntentSender;
import android.graphics.Bitmap;
@@ -37,8 +38,8 @@ interface IPackageInstaller {
PackageInstaller.SessionInfo getSessionInfo(int sessionId);
- List<PackageInstaller.SessionInfo> getAllSessions(int userId);
- List<PackageInstaller.SessionInfo> getMySessions(String installerPackageName, int userId);
+ ParceledListSlice getAllSessions(int userId);
+ ParceledListSlice getMySessions(String installerPackageName, int userId);
void registerCallback(IPackageInstallerCallback callback, int userId);
void unregisterCallback(IPackageInstallerCallback callback);
diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java
index f249c5f..80efd0b 100644
--- a/core/java/android/content/pm/PackageInstaller.java
+++ b/core/java/android/content/pm/PackageInstaller.java
@@ -399,7 +399,7 @@ public class PackageInstaller {
}
try {
- return mInstaller.getAllSessions(mUserId);
+ return mInstaller.getAllSessions(mUserId).getList();
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
}
@@ -410,7 +410,7 @@ public class PackageInstaller {
*/
public @NonNull List<SessionInfo> getMySessions() {
try {
- return mInstaller.getMySessions(mInstallerPackageName, mUserId);
+ return mInstaller.getMySessions(mInstallerPackageName, mUserId).getList();
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
}
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java
index 9db3fba..2150e9a 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerService.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerService.java
@@ -45,6 +45,7 @@ import android.content.pm.PackageInstaller;
import android.content.pm.PackageInstaller.SessionInfo;
import android.content.pm.PackageInstaller.SessionParams;
import android.content.pm.PackageManager;
+import android.content.pm.ParceledListSlice;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
@@ -714,7 +715,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub {
}
@Override
- public List<SessionInfo> getAllSessions(int userId) {
+ public ParceledListSlice<SessionInfo> getAllSessions(int userId) {
mPm.enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "getAllSessions");
final List<SessionInfo> result = new ArrayList<>();
@@ -726,11 +727,11 @@ public class PackageInstallerService extends IPackageInstaller.Stub {
}
}
}
- return result;
+ return new ParceledListSlice<>(result);
}
@Override
- public List<SessionInfo> getMySessions(String installerPackageName, int userId) {
+ public ParceledListSlice<SessionInfo> getMySessions(String installerPackageName, int userId) {
mPm.enforceCrossUserPermission(Binder.getCallingUid(), userId, true, false, "getMySessions");
mAppOps.checkPackage(Binder.getCallingUid(), installerPackageName);
@@ -744,7 +745,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub {
}
}
}
- return result;
+ return new ParceledListSlice<>(result);
}
@Override