From f10d0399bf5f519dff414a9d195a0eaacb37f9b7 Mon Sep 17 00:00:00 2001 From: Aaron Whyte Date: Fri, 28 Mar 2014 14:42:39 -0700 Subject: 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. Change-Id: I6f7504313074e6748c0bd467a29ac3a311036f4d --- .../com/android/server/usb/UsbDebuggingManager.java | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'services/usb/java/com') 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"); } -- cgit v1.1