summaryrefslogtreecommitdiffstats
path: root/services/usb
diff options
context:
space:
mode:
authorAaron Whyte <awhyte@google.com>2014-03-28 14:42:39 -0700
committerAaron Whyte <awhyte@google.com>2014-03-28 22:21:55 +0000
commitf10d0399bf5f519dff414a9d195a0eaacb37f9b7 (patch)
treed475011c58711f93279f9d86cde38b887680d8df /services/usb
parent5579ec33eb317a19ad80929169b2b329b147d98b (diff)
downloadframeworks_base-f10d0399bf5f519dff414a9d195a0eaacb37f9b7.zip
frameworks_base-f10d0399bf5f519dff414a9d195a0eaacb37f9b7.tar.gz
frameworks_base-f10d0399bf5f519dff414a9d195a0eaacb37f9b7.tar.bz2
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
Diffstat (limited to 'services/usb')
-rw-r--r--services/usb/java/com/android/server/usb/UsbDebuggingManager.java21
1 files changed, 13 insertions, 8 deletions
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");
}