summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorMaunik Shah <mshah@codeaurora.org>2013-08-15 17:07:59 +0530
committerSteve Kondik <steve@cyngn.com>2015-11-01 05:06:18 -0800
commitd361e53a08ab7a7812bf5298c25191c851f973b8 (patch)
tree6abff10033f355c2ae140012f9a14a70b762ad3e /media
parent90efbf8b187474285ebacdc632f3930956e2b183 (diff)
downloadframeworks_base-d361e53a08ab7a7812bf5298c25191c851f973b8.zip
frameworks_base-d361e53a08ab7a7812bf5298c25191c851f973b8.tar.gz
frameworks_base-d361e53a08ab7a7812bf5298c25191c851f973b8.tar.bz2
Screenshots info is not updated when device is plugged in MTP mode
When device is connected as MTP mode and user opens folder /sdcard/Pictures/Screenshots/ in windows system and captures new screenshot, image information is always shown as 0 KB Issue: https://code.google.com/p/android/issues/detail?id=56204 Change-Id: I46f3d72d275e164e40e305a3b5aafe685e6905f2
Diffstat (limited to 'media')
-rw-r--r--media/java/android/mtp/MtpServer.java5
-rw-r--r--media/jni/android_mtp_MtpServer.cpp13
2 files changed, 18 insertions, 0 deletions
diff --git a/media/java/android/mtp/MtpServer.java b/media/java/android/mtp/MtpServer.java
index 3814630..e830afd 100644
--- a/media/java/android/mtp/MtpServer.java
+++ b/media/java/android/mtp/MtpServer.java
@@ -56,6 +56,10 @@ public class MtpServer implements Runnable {
native_send_device_property_changed(property);
}
+ public void sendObjectUpdated(int handle) {
+ native_send_object_updated(handle);
+ }
+
public void addStorage(MtpStorage storage) {
native_add_storage(storage);
}
@@ -70,6 +74,7 @@ public class MtpServer implements Runnable {
private native final void native_send_object_added(int handle);
private native final void native_send_object_removed(int handle);
private native final void native_send_device_property_changed(int property);
+ private native final void native_send_object_updated(int handle);
private native final void native_add_storage(MtpStorage storage);
private native final void native_remove_storage(int storageId);
}
diff --git a/media/jni/android_mtp_MtpServer.cpp b/media/jni/android_mtp_MtpServer.cpp
index 2ce2a90..b481b46 100644
--- a/media/jni/android_mtp_MtpServer.cpp
+++ b/media/jni/android_mtp_MtpServer.cpp
@@ -130,6 +130,18 @@ android_mtp_MtpServer_send_device_property_changed(JNIEnv *env, jobject thiz, ji
}
static void
+android_mtp_MtpServer_send_object_updated(JNIEnv *env, jobject thiz, jint handle)
+{
+ Mutex::Autolock autoLock(sMutex);
+
+ MtpServer* server = getMtpServer(env, thiz);
+ if (server)
+ server->sendObjectUpdated(handle);
+ else
+ ALOGE("server is null in send_object_updated");
+}
+
+static void
android_mtp_MtpServer_add_storage(JNIEnv *env, jobject thiz, jobject jstorage)
{
Mutex::Autolock autoLock(sMutex);
@@ -188,6 +200,7 @@ static JNINativeMethod gMethods[] = {
{"native_send_object_removed", "(I)V", (void *)android_mtp_MtpServer_send_object_removed},
{"native_send_device_property_changed", "(I)V",
(void *)android_mtp_MtpServer_send_device_property_changed},
+ {"native_send_object_updated", "(I)V", (void *)android_mtp_MtpServer_send_object_updated},
{"native_add_storage", "(Landroid/mtp/MtpStorage;)V",
(void *)android_mtp_MtpServer_add_storage},
{"native_remove_storage", "(I)V", (void *)android_mtp_MtpServer_remove_storage},