mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-29 22:24:51 +00:00 
			
		
		
		
	AndroidDevice: Add as_root flag to broadcast_media_mounted
				
					
				
			Allows the `MEDIA_MOUNTED` broadcast to be performed as root as this now requires elevated permission in android N.
This commit is contained in:
		| @@ -716,12 +716,13 @@ class AndroidDevice(BaseLinuxDevice):  # pylint: disable=W0223 | ||||
|         except KeyError: | ||||
|             return None | ||||
|  | ||||
|     def broadcast_media_mounted(self, dirpath): | ||||
|     def broadcast_media_mounted(self, dirpath, as_root=False): | ||||
|         """ | ||||
|         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) | ||||
|         command = 'am broadcast -a  android.intent.action.MEDIA_MOUNTED -d file://' | ||||
|         self.execute(command + dirpath, as_root=as_root) | ||||
|  | ||||
|  | ||||
|     # Internal methods: do not use outside of the class. | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user