Use perf.drop_caches in adb_utils
Change-Id: I307321a37936e836873fa2ce904a13bde55c47cd
diff --git a/tools/startup/adb_utils.py b/tools/startup/adb_utils.py
index 0a4ae59..13d4ee7 100755
--- a/tools/startup/adb_utils.py
+++ b/tools/startup/adb_utils.py
@@ -152,7 +152,10 @@
def drop_caches(device_id=None):
- cmd = create_adb_cmd(['shell', 'echo 3 > /proc/sys/vm/drop_caches'],
+ # On older devices this used to be achieved using:
+ # adb shell echo 3 > /proc/sys/vm/drop_caches
+ # This does not work on user devices, however.
+ cmd = create_adb_cmd(['shell', 'setprop', 'perf.drop_caches', '3'],
device_id)
subprocess.check_call(cmd, stdout=DEVNULL, stderr=DEVNULL)