From 620b32b316fd4f1bab4eef55ec8802d14a55e7dd Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 23 Apr 2015 19:36:02 -0700 Subject: Package and storage movement callbacks. Since package and primary storage movement can take quite awhile, we want to have SystemUI surface progress and allow the Settings app to be torn down while the movement proceeds in the background. Movement requests now return a unique ID that identifies an ongoing operation, and interested parties can observe ongoing progress and final status. Internally, progress and status are overloaded so the values 0-100 are progress, and any values outside that range are terminal status. Add explicit constants for special-cased volume UUIDs, and change the APIs to accept VolumeInfo to reduce confusion. Internally the UUID value "null" means internal storage, and "primary_physical" means the current primary physical volume. These values are used for both package and primary storage movement destinations. Persist the current primary storage location in MountService metadata, since it can be moved over time. Surface disk scanned events with separate volume count so we can determine when it's partitioned successfully. Also send broadcast to support TvSettings launching into adoption flow. Bug: 19993667 Change-Id: Ic8a4034033c3cb3262023dba4a642efc6795af10 --- .../src/android/test/mock/MockPackageManager.java | 46 ++++++++++++++++++---- 1 file changed, 38 insertions(+), 8 deletions(-) (limited to 'test-runner/src') diff --git a/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/src/android/test/mock/MockPackageManager.java index 276b713..9efea0d 100644 --- a/test-runner/src/android/test/mock/MockPackageManager.java +++ b/test-runner/src/android/test/mock/MockPackageManager.java @@ -16,7 +16,6 @@ package android.test.mock; -import android.annotation.NonNull; import android.app.PackageInstallObserver; import android.content.ComponentName; import android.content.Intent; @@ -29,7 +28,6 @@ import android.content.pm.FeatureInfo; import android.content.pm.IPackageDataObserver; import android.content.pm.IPackageDeleteObserver; import android.content.pm.IPackageInstallObserver; -import android.content.pm.IPackageMoveObserver; import android.content.pm.IPackageStatsObserver; import android.content.pm.InstrumentationInfo; import android.content.pm.IntentFilterVerificationInfo; @@ -46,11 +44,14 @@ import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.pm.VerificationParams; import android.content.pm.VerifierDeviceIdentity; +import android.content.pm.PackageManager.MoveCallback; import android.content.res.Resources; import android.content.res.XmlResourceParser; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.net.Uri; +import android.os.Handler; +import android.os.ResultReceiver; import android.os.UserHandle; import android.os.storage.VolumeInfo; @@ -487,33 +488,62 @@ public class MockPackageManager extends PackageManager { throw new UnsupportedOperationException(); } + @Override + public String getInstallerPackageName(String packageName) { + throw new UnsupportedOperationException(); + } + /** {@hide} */ @Override - public void movePackage(String packageName, IPackageMoveObserver observer, int flags) { + public int getMoveStatus(int moveId) { throw new UnsupportedOperationException(); } /** {@hide} */ @Override - public void movePackageAndData(String packageName, String volumeUuid, - IPackageMoveObserver observer) { + public void registerMoveCallback(MoveCallback callback, Handler handler) { throw new UnsupportedOperationException(); } /** {@hide} */ @Override - public @NonNull VolumeInfo getApplicationCurrentVolume(ApplicationInfo app) { + public void unregisterMoveCallback(MoveCallback callback) { throw new UnsupportedOperationException(); } /** {@hide} */ @Override - public @NonNull List getApplicationCandidateVolumes(ApplicationInfo app) { + public int movePackage(String packageName, VolumeInfo vol) { throw new UnsupportedOperationException(); } + /** {@hide} */ @Override - public String getInstallerPackageName(String packageName) { + public VolumeInfo getPackageCurrentVolume(ApplicationInfo app) { + throw new UnsupportedOperationException(); + } + + /** {@hide} */ + @Override + public List getPackageCandidateVolumes(ApplicationInfo app) { + throw new UnsupportedOperationException(); + } + + /** {@hide} */ + @Override + public int movePrimaryStorage(VolumeInfo vol) { + throw new UnsupportedOperationException(); + } + + /** {@hide} */ + @Override + public VolumeInfo getPrimaryStorageCurrentVolume() { + throw new UnsupportedOperationException(); + } + + /** {@hide} */ + @Override + public List getPrimaryStorageCandidateVolumes() { throw new UnsupportedOperationException(); } -- cgit v1.1