summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2011-05-04 08:57:07 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-05-04 08:57:07 -0700
commita2a8419db82ae40146bdfd215e3de3be39c7249c (patch)
tree7d40976cd68e10045c4dfae23dfae3c1f6702cb4 /core/java
parent60c768d41277e3b7d4988452e15694c7ad5a74d0 (diff)
parente3b498be0ae05367e9b84f4fac2ac5cf57a6b091 (diff)
downloadframeworks_base-a2a8419db82ae40146bdfd215e3de3be39c7249c.zip
frameworks_base-a2a8419db82ae40146bdfd215e3de3be39c7249c.tar.gz
frameworks_base-a2a8419db82ae40146bdfd215e3de3be39c7249c.tar.bz2
am e3b498be: DO NOT MERGE StorageManager: Add getVolumeList() and getVolumeState() methods
* commit 'e3b498be0ae05367e9b84f4fac2ac5cf57a6b091': DO NOT MERGE StorageManager: Add getVolumeList() and getVolumeState() methods
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/os/storage/IMountService.java29
-rw-r--r--core/java/android/os/storage/StorageManager.java26
2 files changed, 55 insertions, 0 deletions
diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java
index 4c83515..27da3c3 100644
--- a/core/java/android/os/storage/IMountService.java
+++ b/core/java/android/os/storage/IMountService.java
@@ -637,6 +637,22 @@ public interface IMountService extends IInterface {
}
return _result;
}
+
+ public String[] getVolumeList() throws RemoteException {
+ Parcel _data = Parcel.obtain();
+ Parcel _reply = Parcel.obtain();
+ String[] _result;
+ try {
+ _data.writeInterfaceToken(DESCRIPTOR);
+ mRemote.transact(Stub.TRANSACTION_getVolumeList, _data, _reply, 0);
+ _reply.readException();
+ _result = _reply.readStringArray();
+ } finally {
+ _reply.recycle();
+ _data.recycle();
+ }
+ return _result;
+ }
}
private static final String DESCRIPTOR = "IMountService";
@@ -699,6 +715,8 @@ public interface IMountService extends IInterface {
static final int TRANSACTION_changeEncryptionPassword = IBinder.FIRST_CALL_TRANSACTION + 28;
+ static final int TRANSACTION_getVolumeList = IBinder.FIRST_CALL_TRANSACTION + 29;
+
/**
* Cast an IBinder object into an IMountService interface, generating a
* proxy if needed.
@@ -1004,6 +1022,13 @@ public interface IMountService extends IInterface {
reply.writeInt(result);
return true;
}
+ case TRANSACTION_getVolumeList: {
+ data.enforceInterface(DESCRIPTOR);
+ String[] result = getVolumeList();
+ reply.writeNoException();
+ reply.writeStringArray(result);
+ return true;
+ }
}
return super.onTransact(code, data, reply, flags);
}
@@ -1179,4 +1204,8 @@ public interface IMountService extends IInterface {
*/
public int changeEncryptionPassword(String password) throws RemoteException;
+ /**
+ * Returns list of all mountable volumes.
+ */
+ public String[] getVolumeList() throws RemoteException;
}
diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java
index 73ac79f..234057b 100644
--- a/core/java/android/os/storage/StorageManager.java
+++ b/core/java/android/os/storage/StorageManager.java
@@ -527,4 +527,30 @@ public class StorageManager
return null;
}
+
+ /**
+ * Gets the state of a volume via its mountpoint.
+ * @hide
+ */
+ public String getVolumeState(String mountPoint) {
+ try {
+ return mMountService.getVolumeState(mountPoint);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to get volume state", e);
+ return null;
+ }
+ }
+
+ /**
+ * Returns list of all mountable volumes.
+ * @hide
+ */
+ public String[] getVolumeList() {
+ try {
+ return mMountService.getVolumeList();
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to get volume list", e);
+ return null;
+ }
+ }
}