From b510b310527e11fe951a3842e470d8391ff8a759 Mon Sep 17 00:00:00 2001 From: John Richardson Date: Wed, 31 Aug 2016 10:18:34 +0100 Subject: [PATCH] Add broadcast_media_mounted method to android device New method to force a re-index of the mediaserver cache for the specified directory. Used in workloads that require external media files as dependencies. --- wlauto/common/android/device.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wlauto/common/android/device.py b/wlauto/common/android/device.py index f338cd90..2285cf4d 100644 --- a/wlauto/common/android/device.py +++ b/wlauto/common/android/device.py @@ -682,6 +682,13 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223 except KeyError: return None + def broadcast_media_mounted(self, dirpath): + """ + Force a re-index of the mediaserver cache for the specified directory. + """ + command = 'am broadcast -a android.intent.action.MEDIA_MOUNTED -d file://' + self.execute(command + dirpath) + # Internal methods: do not use outside of the class. def _update_build_properties(self, props):