diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-04-24 16:10:32 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2015-04-24 18:01:45 -0700 |
commit | 275e3e43f2fba72fa99001cafa2a70e5478fc545 (patch) | |
tree | be196ff698ba222c410d0666d430fa0ec5aa5ae4 /core/java/android/os/storage/IMountService.java | |
parent | b423e300f77de90aea34321ef7f67882d4e526ed (diff) | |
download | frameworks_base-275e3e43f2fba72fa99001cafa2a70e5478fc545.zip frameworks_base-275e3e43f2fba72fa99001cafa2a70e5478fc545.tar.gz frameworks_base-275e3e43f2fba72fa99001cafa2a70e5478fc545.tar.bz2 |
Migrate primary external storage.
Wire up through MountService to call down into vold. Watch for
unsolicited events that report progress, including special value "82"
that signals that copy has finished. We use this value to persist
the volumeUuid in case of unexpected reboot, since it indicates the
new volume is ready.
Wire progress updates through existing callback pipeline.
Update the volume mounting code to match against the persisted UUID
when selecting the primary external storage.
Bug: 19993667
Change-Id: Id46957610fb43517bbfbc368f29b7d430664590d
Diffstat (limited to 'core/java/android/os/storage/IMountService.java')
-rw-r--r-- | core/java/android/os/storage/IMountService.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java index 0b1031c..16e0bf7 100644 --- a/core/java/android/os/storage/IMountService.java +++ b/core/java/android/os/storage/IMountService.java @@ -16,6 +16,7 @@ package android.os.storage; +import android.content.pm.IPackageMoveObserver; import android.os.Binder; import android.os.IBinder; import android.os.IInterface; @@ -1082,12 +1083,14 @@ public interface IMountService extends IInterface { } @Override - public void setPrimaryStorageUuid(String volumeUuid) throws RemoteException { + public void setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback) + throws RemoteException { Parcel _data = Parcel.obtain(); Parcel _reply = Parcel.obtain(); try { _data.writeInterfaceToken(DESCRIPTOR); _data.writeString(volumeUuid); + _data.writeStrongBinder((callback != null ? callback.asBinder() : null)); mRemote.transact(Stub.TRANSACTION_setPrimaryStorageUuid, _data, _reply, 0); _reply.readException(); } finally { @@ -1714,7 +1717,9 @@ public interface IMountService extends IInterface { case TRANSACTION_setPrimaryStorageUuid: { data.enforceInterface(DESCRIPTOR); String volumeUuid = data.readString(); - setPrimaryStorageUuid(volumeUuid); + IPackageMoveObserver listener = IPackageMoveObserver.Stub.asInterface( + data.readStrongBinder()); + setPrimaryStorageUuid(volumeUuid, listener); reply.writeNoException(); return true; } @@ -2020,5 +2025,6 @@ public interface IMountService extends IInterface { public void setVolumeUserFlags(String volId, int flags, int mask) throws RemoteException; public String getPrimaryStorageUuid() throws RemoteException; - public void setPrimaryStorageUuid(String volumeUuid) throws RemoteException; + public void setPrimaryStorageUuid(String volumeUuid, IPackageMoveObserver callback) + throws RemoteException; } |