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.
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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();
|
||||
Intent intent = 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);
|
||||
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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user