diff options
author | Aaron Whyte <awhyte@google.com> | 2014-03-28 23:03:56 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-03-28 23:03:56 +0000 |
commit | 23fd13de62762e98c32f2b7525f01f0bcdf416fd (patch) | |
tree | 09f8da79ec3777a7cf7551106476098a3d6a374f | |
parent | ec27a7caf3c26506013c49ce1bbe78559bc73b4a (diff) | |
parent | f10d0399bf5f519dff414a9d195a0eaacb37f9b7 (diff) | |
download | frameworks_base-23fd13de62762e98c32f2b7525f01f0bcdf416fd.zip frameworks_base-23fd13de62762e98c32f2b7525f01f0bcdf416fd.tar.gz frameworks_base-23fd13de62762e98c32f2b7525f01f0bcdf416fd.tar.bz2 |
am f10d0399: Made secure-adb\'s new-public-key activity configurable. Some devices do not have lockscreens themselves, so the plan is to have them do RPCs to companion devices that can have lockscreens, for allowing or rejecting unwhitelisted adb public keys.
* commit 'f10d0399bf5f519dff414a9d195a0eaacb37f9b7':
Made secure-adb's new-public-key activity configurable. Some devices do not have lockscreens themselves, so the plan is to have them do RPCs to companion devices that can have lockscreens, for allowing or rejecting unwhitelisted adb public keys.
-rw-r--r-- | core/res/res/values/config.xml | 7 | ||||
-rw-r--r-- | core/res/res/values/symbols.xml | 1 | ||||
-rw-r--r-- | services/usb/java/com/android/server/usb/UsbDebuggingManager.java | 21 |
3 files changed, 21 insertions, 8 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 5007f7a..45a2c80 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -1331,6 +1331,12 @@ Example: com.google.android.myapp/.resolver.MyResolverActivity --> <string name="config_customResolverActivity"></string> + <!-- Name of the activity that prompts the user to reject, accept, or whitelist + an adb host's public key, when an unwhitelisted host connects to the local adbd. + Can be customized for other product types --> + <string name="config_customAdbPublicKeyActivity" + >com.android.systemui/com.android.systemui.usb.UsbDebuggingActivity</string> + <!-- Apps that are authorized to access shared accounts, overridden by product overlays --> <string name="config_appsAuthorizedForSharedAccounts">;com.android.settings;</string> @@ -1413,4 +1419,5 @@ 1 - The device DOES have a permanent menu key; ignore autodetection. 2 - The device DOES NOT have a permanent menu key; ignore autodetection. --> <integer name="config_overrideHasPermanentMenuKey">0</integer> + </resources> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 093eb3b..323494a 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1625,6 +1625,7 @@ <java-symbol type="string" name="enable_explore_by_touch_warning_message" /> <java-symbol type="bool" name="config_powerDecoupleAutoSuspendModeFromDisplay" /> <java-symbol type="bool" name="config_powerDecoupleInteractiveModeFromDisplay" /> + <java-symbol type="string" name="config_customAdbPublicKeyActivity" /> <java-symbol type="layout" name="resolver_list" /> <java-symbol type="id" name="resolver_list" /> diff --git a/services/usb/java/com/android/server/usb/UsbDebuggingManager.java b/services/usb/java/com/android/server/usb/UsbDebuggingManager.java index ce953a4..f73d425 100644 --- a/services/usb/java/com/android/server/usb/UsbDebuggingManager.java +++ b/services/usb/java/com/android/server/usb/UsbDebuggingManager.java @@ -17,8 +17,10 @@ package com.android.server.usb; import android.content.ActivityNotFoundException; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; +import android.content.res.Resources; import android.net.LocalSocket; import android.net.LocalSocketAddress; import android.os.Handler; @@ -244,15 +246,18 @@ public class UsbDebuggingManager implements Runnable { } private void showConfirmationDialog(String key, String fingerprints) { - Intent dialogIntent = new Intent(); - - dialogIntent.setClassName("com.android.systemui", - "com.android.systemui.usb.UsbDebuggingActivity"); - dialogIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - dialogIntent.putExtra("key", key); - dialogIntent.putExtra("fingerprints", fingerprints); + Intent intent = new Intent(); + + ComponentName componentName = ComponentName.unflattenFromString( + Resources.getSystem().getString( + com.android.internal.R.string.config_customAdbPublicKeyActivity)); + intent.setClassName(componentName.getPackageName(), + componentName.getClassName()); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + intent.putExtra("key", key); + intent.putExtra("fingerprints", fingerprints); try { - mContext.startActivity(dialogIntent); + mContext.startActivity(intent); } catch (ActivityNotFoundException e) { Slog.e(TAG, "unable to start UsbDebuggingActivity"); } |