From 420e341a361372e6e7c121da0f667b093fa90d4f Mon Sep 17 00:00:00 2001 From: Oreste Salerno Date: Wed, 20 May 2015 16:44:48 +0000 Subject: [PATCH] Do not add 'adb' to persist.sys.usb.config if already there The 'adb' configuration might have already been added by a device-specific Makefile, so add it only if it's not already there. Change-Id: I6f96645f44c96f6f827cc8c842a8b769f92be13a --- tools/post_process_props.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/post_process_props.py b/tools/post_process_props.py index fa6106f0d..9dcaadfd0 100755 --- a/tools/post_process_props.py +++ b/tools/post_process_props.py @@ -37,11 +37,12 @@ def mangle_default_prop(prop): # (this is for userdebug builds) if prop.get("ro.debuggable") == "1": val = prop.get("persist.sys.usb.config") - if val == "": - val = "adb" - else: - val = val + ",adb" - prop.put("persist.sys.usb.config", val) + if "adb" not in val: + if val == "": + val = "adb" + else: + val = val + ",adb" + prop.put("persist.sys.usb.config", val) # UsbDeviceManager expects a value here. If it doesn't get it, it will # default to "adb". That might not the right policy there, but it's better # to be explicit.