Loading core/java/android/os/storage/IMountService.java +29 −0 Original line number Diff line number Diff line Loading @@ -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"; Loading Loading @@ -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. Loading Loading @@ -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); } Loading Loading @@ -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; } core/java/android/os/storage/StorageManager.java +26 −0 Original line number Diff line number Diff line Loading @@ -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; } } } services/java/com/android/server/MountService.java +13 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; Loading Loading @@ -1733,6 +1734,18 @@ class MountService extends IMountService.Stub implements INativeDaemonConnectorC } } public String[] getVolumeList() { synchronized(mVolumeStates) { Set<String> volumes = mVolumeStates.keySet(); String[] result = new String[volumes.size()]; int i = 0; for (String volume : volumes) { result[i++] = volume; } return result; } } private void addObbStateLocked(ObbState obbState) throws RemoteException { final IBinder binder = obbState.getBinder(); List<ObbState> obbStates = mObbMounts.get(binder); Loading Loading
core/java/android/os/storage/IMountService.java +29 −0 Original line number Diff line number Diff line Loading @@ -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"; Loading Loading @@ -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. Loading Loading @@ -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); } Loading Loading @@ -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; }
core/java/android/os/storage/StorageManager.java +26 −0 Original line number Diff line number Diff line Loading @@ -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; } } }
services/java/com/android/server/MountService.java +13 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; Loading Loading @@ -1733,6 +1734,18 @@ class MountService extends IMountService.Stub implements INativeDaemonConnectorC } } public String[] getVolumeList() { synchronized(mVolumeStates) { Set<String> volumes = mVolumeStates.keySet(); String[] result = new String[volumes.size()]; int i = 0; for (String volume : volumes) { result[i++] = volume; } return result; } } private void addObbStateLocked(ObbState obbState) throws RemoteException { final IBinder binder = obbState.getBinder(); List<ObbState> obbStates = mObbMounts.get(binder); Loading