summaryrefslogtreecommitdiffstats
path: root/test-runner
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-04-23 19:36:02 -0700
committerJeff Sharkey <jsharkey@android.com>2015-04-23 20:32:17 -0700
commit620b32b316fd4f1bab4eef55ec8802d14a55e7dd (patch)
treeafedbccf5c135e8d19ba52db199316ab0932a277 /test-runner
parent61044cfd9c7f02d3806338a6b8f137f50e1b1e0f (diff)
downloadframeworks_base-620b32b316fd4f1bab4eef55ec8802d14a55e7dd.zip
frameworks_base-620b32b316fd4f1bab4eef55ec8802d14a55e7dd.tar.gz
frameworks_base-620b32b316fd4f1bab4eef55ec8802d14a55e7dd.tar.bz2
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
Diffstat (limited to 'test-runner')
-rw-r--r--test-runner/src/android/test/mock/MockPackageManager.java46
1 files changed, 38 insertions, 8 deletions
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<VolumeInfo> 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<VolumeInfo> 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<VolumeInfo> getPrimaryStorageCandidateVolumes() {
throw new UnsupportedOperationException();
}