From d967f4664f40f9a4c5262a44b19df9bbdf457d8a Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 24 Mar 2011 08:12:30 -0700 Subject: DO NOT MERGE StorageManager: Add getVolumeList() and getVolumeState() methods Change-Id: I43d5c1730b340f1288b58012234b38f801001b71 Signed-off-by: Mike Lockwood --- core/java/android/os/storage/IMountService.java | 29 ++++++++++++++++++++++++ core/java/android/os/storage/StorageManager.java | 26 +++++++++++++++++++++ 2 files changed, 55 insertions(+) (limited to 'core') 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; + } + } } -- cgit v1.1 From 7ae938be1b4fb8938f0f438cfd611cd9ed0da513 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Tue, 5 Apr 2011 10:21:27 -0400 Subject: DO NOT MERGE MTP and media provider support for multiple storage devices: - MTP support for multiple storage units - Add storage_id column to media database for MTP storage ID - Add framework resource for defining mount points and user visible descriptions for multiple volumes - Clean up locking in MtpServer JNI code Change-Id: Ide6d47bd9aa1698ed2a13d695613e03f2a9b29e3 Signed-off-by: Mike Lockwood --- core/java/android/provider/MediaStore.java | 7 +++++++ core/res/res/values/config.xml | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'core') diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java index b59421e..c9b2f97 100644 --- a/core/java/android/provider/MediaStore.java +++ b/core/java/android/provider/MediaStore.java @@ -344,6 +344,13 @@ public final class MediaStore { */ public interface FileColumns extends MediaColumns { /** + * The MTP storage ID of the file + *

Type: INTEGER

+ * @hide + */ + public static final String STORAGE_ID = "storage_id"; + + /** * The MTP format code of the file *

Type: INTEGER

* @hide diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index e46eecc..27c7a4d 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -109,6 +109,23 @@ removable. --> true + + + "/mnt/sdcard" + + + + + "SD card" + + + + -- cgit v1.1 From a8f6a0d90cd4aee6dd148b23598eb8c8cafdf53c Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Thu, 7 Apr 2011 17:13:18 -0700 Subject: DO NOT MERGE: Don't send pause again when coming back from full screen When we enter full screen, the inline video has been paused. When we re-play in the inline mode, we don't need to paused the previous video, which is the full screen one. bug:4259109 Change-Id: I577edf43563116b0d1a9266d741e6a8aabbca779 --- core/java/android/webkit/HTML5VideoViewProxy.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java index 060c0bb..d1b8cfc 100644 --- a/core/java/android/webkit/HTML5VideoViewProxy.java +++ b/core/java/android/webkit/HTML5VideoViewProxy.java @@ -184,7 +184,9 @@ class HTML5VideoViewProxy extends Handler // we need to pause the old one and re-create a new media player // inside the HTML5VideoView. if (mHTML5VideoView != null) { - mHTML5VideoView.pauseAndDispatch(mCurrentProxy); + if (!backFromFullScreenMode) { + mHTML5VideoView.pauseAndDispatch(mCurrentProxy); + } // release the media player to avoid finalize error mHTML5VideoView.release(); } -- cgit v1.1 From c351f52a4a40155444e956824dd738d7a41678d9 Mon Sep 17 00:00:00 2001 From: Irfan Sheriff Date: Wed, 4 May 2011 14:16:44 -0700 Subject: DO NOT MERGE Handle GET_POWER failures Return a failure when GET_POWER returns a non-conforming format Bug: 4380317 Change-Id: Ie723c424ab07774f2be2594aa5deeaa5cd5ac280 --- core/jni/android_net_wifi_Wifi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/jni/android_net_wifi_Wifi.cpp b/core/jni/android_net_wifi_Wifi.cpp index 667ba75..4e363bf 100644 --- a/core/jni/android_net_wifi_Wifi.cpp +++ b/core/jni/android_net_wifi_Wifi.cpp @@ -459,7 +459,9 @@ static jint android_net_wifi_getPowerModeCommand(JNIEnv* env, jobject clazz) } // reply comes back in the form "powermode = XX" where XX is the // number we're interested in. - sscanf(reply, "%*s = %u", &power); + if (sscanf(reply, "%*s = %u", &power) != 1) { + return (jint)-1; + } return (jint)power; } -- cgit v1.1