summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Evan Chen <evanxinchen@google.com> 2023-01-05 21:31:50 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-01-05 21:31:50 +0000
commit8eebb5afc384c78b3920e0693e821b947e14118f (patch)
tree4a34569b9cce9283826fa2ca8b5a6ced16ce1111
parentee73215654fd2151921a26a6f6e70244d21532aa (diff)
parent3379c7499a070729199c085ff3ddbc120256b9c0 (diff)
Merge changes from topic "bullet_mapping"
* changes: Add strings for bullet permissions Mapping device profiles and resourceIds
-rw-r--r--packages/CompanionDeviceManager/res/drawable-night/ic_permission_call_logs.xml28
-rw-r--r--packages/CompanionDeviceManager/res/drawable/helper_back_button.xml4
-rw-r--r--packages/CompanionDeviceManager/res/drawable/ic_permission_call_logs.xml28
-rw-r--r--packages/CompanionDeviceManager/res/values/strings.xml21
-rw-r--r--packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java122
-rw-r--r--packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java150
-rw-r--r--packages/CompanionDeviceManager/src/com/android/companiondevicemanager/PermissionListAdapter.java4
7 files changed, 262 insertions, 95 deletions
diff --git a/packages/CompanionDeviceManager/res/drawable-night/ic_permission_call_logs.xml b/packages/CompanionDeviceManager/res/drawable-night/ic_permission_call_logs.xml
new file mode 100644
index 000000000000..4db291a3d321
--- /dev/null
+++ b/packages/CompanionDeviceManager/res/drawable-night/ic_permission_call_logs.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:width="24dp"
+ android:height="24dp"
+ android:tint="@android:color/system_accent1_200">
+ <path android:pathData="M16.01 14.48L13.39 17.1C10.64 15.61 8.38 13.35 6.89 10.6L9.51 7.98C9.75 7.74 9.85 7.4 9.78 7.08L9.13 3.82C9.04 3.35 8.63 3.02 8.15 3.02L4 3.01c-0.56 0 -1.03 0.47 -1 1.03 0.17 2.91 1.04 5.63 2.43 8.01 1.57 2.69 3.81 4.93 6.5 6.5 2.38 1.39 5.1 2.26 8.01 2.43 0.56 0.03 1.03 -0.44 1.03 -1l0 -4.15c0 -0.48 -0.34 -0.89 -0.8 -0.98L16.91 14.2c-0.33 -0.06 -0.67 0.04 -0.9 0.28z"
+ android:fillColor="#ffffff" />
+ <path android:pathData="M12 8l10 0 0 -2 -10 0 0 2zm0 -4l10 0 0 -2 -10 0 0 2zm10 6l-10 0 0 2 10 0 0 -2z"
+ android:fillColor="#ffffff" />
+</vector> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/drawable/helper_back_button.xml b/packages/CompanionDeviceManager/res/drawable/helper_back_button.xml
index 6ce1f1263638..6ec63581df25 100644
--- a/packages/CompanionDeviceManager/res/drawable/helper_back_button.xml
+++ b/packages/CompanionDeviceManager/res/drawable/helper_back_button.xml
@@ -18,6 +18,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/system_accent1_100"/>
- <corners android:topLeftRadius="20dp" android:topRightRadius="20dp"
- android:bottomLeftRadius="20dp" android:bottomRightRadius="20dp"/>
+ <corners android:topLeftRadius="30dp" android:topRightRadius="30dp"
+ android:bottomLeftRadius="30dp" android:bottomRightRadius="30dp"/>
</shape> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/drawable/ic_permission_call_logs.xml b/packages/CompanionDeviceManager/res/drawable/ic_permission_call_logs.xml
new file mode 100644
index 000000000000..817d3a0863a2
--- /dev/null
+++ b/packages/CompanionDeviceManager/res/drawable/ic_permission_call_logs.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2022 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:width="24dp"
+ android:height="24dp"
+ android:tint="@android:color/system_accent1_600">
+ <path android:pathData="M16.01 14.48L13.39 17.1C10.64 15.61 8.38 13.35 6.89 10.6L9.51 7.98C9.75 7.74 9.85 7.4 9.78 7.08L9.13 3.82C9.04 3.35 8.63 3.02 8.15 3.02L4 3.01c-0.56 0 -1.03 0.47 -1 1.03 0.17 2.91 1.04 5.63 2.43 8.01 1.57 2.69 3.81 4.93 6.5 6.5 2.38 1.39 5.1 2.26 8.01 2.43 0.56 0.03 1.03 -0.44 1.03 -1l0 -4.15c0 -0.48 -0.34 -0.89 -0.8 -0.98L16.91 14.2c-0.33 -0.06 -0.67 0.04 -0.9 0.28z"
+ android:fillColor="#ffffff" />
+ <path android:pathData="M12 8l10 0 0 -2 -10 0 0 2zm0 -4l10 0 0 -2 -10 0 0 2zm10 6l-10 0 0 2 10 0 0 -2z"
+ android:fillColor="#ffffff" />
+</vector> \ No newline at end of file
diff --git a/packages/CompanionDeviceManager/res/values/strings.xml b/packages/CompanionDeviceManager/res/values/strings.xml
index 0764d9032c1b..c410d648e7ee 100644
--- a/packages/CompanionDeviceManager/res/values/strings.xml
+++ b/packages/CompanionDeviceManager/res/values/strings.xml
@@ -143,7 +143,10 @@
<!-- Microphone permission will be granted to corresponding profile [CHAR LIMIT=30] -->
<string name="permission_microphone">Microphone</string>
- <!-- Nearby devices permission will be granted of corresponding profile [CHAR LIMIT=30] -->
+ <!-- Call logs permission will be granted to the corresponding profile [CHAR LIMIT=30] -->
+ <string name="permission_call_logs">Call logs</string>
+
+ <!-- Nearby devices' permission will be granted of corresponding profile [CHAR LIMIT=30] -->
<string name="permission_nearby_devices">Nearby devices</string>
<!-- Storage permission will be granted of corresponding profile [CHAR LIMIT=30] -->
@@ -159,26 +162,26 @@
<string name="permission_nearby_device_streaming">Nearby Device Streaming</string>
<!-- Description of phone permission of corresponding profile [CHAR LIMIT=NONE] -->
- <string name="permission_phone_summary">Can access your phone number and network info. Required for making calls and VoIP, voicemail, call redirect, and editing call logs</string>
+ <string name="permission_phone_summary">Can make and manage phone calls</string>
+
+ <!-- Description of Call logs permission of corresponding profile [CHAR LIMIT=NONE] -->
+ <string name="permission_call_logs_summary">Can read and write phone call log</string>
<!-- Description of SMS permission of corresponding profile [CHAR LIMIT=NONE] -->
- <!-- TODO(b/253644212) Need the description for sms permission -->
- <string name="permission_sms_summary"></string>
+ <string name="permission_sms_summary">Can send and view SMS messages</string>
<!-- Description of contacts permission of corresponding profile [CHAR LIMIT=NONE] -->
- <string name="permission_contacts_summary">Can read, create, or edit our contact list, as well as access the list of all accounts used on your device</string>
+ <string name="permission_contacts_summary">Can access your contacts</string>
<!-- Description of calendar permission of corresponding profile [CHAR LIMIT=NONE] -->
- <!-- TODO(b/253644212) Need the description for calendar permission -->
- <string name="permission_calendar_summary"></string>
+ <string name="permission_calendar_summary">Can access your calendar</string>
<!-- Description of microphone permission of corresponding profile [CHAR LIMIT=NONE] -->
<!-- TODO(b/256140614) Need the description for microphone permission -->
<string name="permission_microphone_summary">Can record audio using the microphone</string>
<!-- Description of nearby devices' permission of corresponding profile [CHAR LIMIT=NONE] -->
- <!-- TODO(b/253644212) Need the description for nearby devices' permission -->
- <string name="permission_nearby_devices_summary"></string>
+ <string name="permission_nearby_devices_summary">Can find, connect to, and determine the relative position of nearby devices</string>
<!-- Description of notification permission of corresponding profile [CHAR LIMIT=NONE] -->
<string name="permission_notification_summary">Can read all notifications, including information like contacts, messages, and photos</string>
diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java
index 8d0a2c04ee2b..c5ed5c9680a8 100644
--- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java
+++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java
@@ -16,12 +16,6 @@
package com.android.companiondevicemanager;
-import static android.companion.AssociationRequest.DEVICE_PROFILE_APP_STREAMING;
-import static android.companion.AssociationRequest.DEVICE_PROFILE_AUTOMOTIVE_PROJECTION;
-import static android.companion.AssociationRequest.DEVICE_PROFILE_COMPUTER;
-import static android.companion.AssociationRequest.DEVICE_PROFILE_GLASSES;
-import static android.companion.AssociationRequest.DEVICE_PROFILE_NEARBY_DEVICE_STREAMING;
-import static android.companion.AssociationRequest.DEVICE_PROFILE_WATCH;
import static android.companion.CompanionDeviceManager.REASON_CANCELED;
import static android.companion.CompanionDeviceManager.REASON_DISCOVERY_TIMEOUT;
import static android.companion.CompanionDeviceManager.REASON_INTERNAL_ERROR;
@@ -33,16 +27,14 @@ import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTE
import static com.android.companiondevicemanager.CompanionDeviceDiscoveryService.DiscoveryState;
import static com.android.companiondevicemanager.CompanionDeviceDiscoveryService.DiscoveryState.FINISHED_TIMEOUT;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_APP_STREAMING;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_CALENDAR;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_CONTACTS;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_MICROPHONE;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_NEARBY_DEVICES;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_NEARBY_DEVICE_STREAMING;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_NOTIFICATION;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_PHONE;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_SMS;
-import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_STORAGE;
+import static com.android.companiondevicemanager.CompanionDeviceResources.MULTI_DEVICES_SUMMARIES;
+import static com.android.companiondevicemanager.CompanionDeviceResources.PERMISSION_TYPES;
+import static com.android.companiondevicemanager.CompanionDeviceResources.PROFILES_NAME;
+import static com.android.companiondevicemanager.CompanionDeviceResources.PROFILE_ICON;
+import static com.android.companiondevicemanager.CompanionDeviceResources.SUMMARIES;
+import static com.android.companiondevicemanager.CompanionDeviceResources.SUPPORTED_PROFILES;
+import static com.android.companiondevicemanager.CompanionDeviceResources.SUPPORTED_SELF_MANAGED_PROFILES;
+import static com.android.companiondevicemanager.CompanionDeviceResources.TITLES;
import static com.android.companiondevicemanager.Utils.getApplicationLabel;
import static com.android.companiondevicemanager.Utils.getHtmlFromResources;
import static com.android.companiondevicemanager.Utils.getIcon;
@@ -92,7 +84,6 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.List;
/**
@@ -470,6 +461,10 @@ public class CompanionDeviceActivity extends FragmentActivity implements
int nightModeFlags = getResources().getConfiguration().uiMode
& Configuration.UI_MODE_NIGHT_MASK;
+ if (!SUPPORTED_SELF_MANAGED_PROFILES.contains(deviceProfile)) {
+ throw new RuntimeException("Unsupported profile " + deviceProfile);
+ }
+
mPermissionTypes = new ArrayList<>();
try {
@@ -488,32 +483,8 @@ public class CompanionDeviceActivity extends FragmentActivity implements
return;
}
- // TODO(b/253644212): Add maps for profile -> title, summary, permissions
- switch (deviceProfile) {
- case DEVICE_PROFILE_APP_STREAMING:
- title = getHtmlFromResources(this, R.string.title_app_streaming, deviceName);
- mPermissionTypes.add(PERMISSION_APP_STREAMING);
- break;
-
- case DEVICE_PROFILE_AUTOMOTIVE_PROJECTION:
- title = getHtmlFromResources(
- this, R.string.title_automotive_projection, deviceName);
- break;
-
- case DEVICE_PROFILE_COMPUTER:
- title = getHtmlFromResources(this, R.string.title_computer, deviceName);
- mPermissionTypes.addAll(Arrays.asList(PERMISSION_NOTIFICATION, PERMISSION_STORAGE));
- break;
-
- case DEVICE_PROFILE_NEARBY_DEVICE_STREAMING:
- title = getHtmlFromResources(this, R.string.title_nearby_device_streaming,
- deviceName);
- mPermissionTypes.add(PERMISSION_NEARBY_DEVICE_STREAMING);
- break;
-
- default:
- throw new RuntimeException("Unsupported profile " + deviceProfile);
- }
+ title = getHtmlFromResources(this, TITLES.get(deviceProfile), deviceName);
+ mPermissionTypes.addAll(PERMISSION_TYPES.get(deviceProfile));
// Summary is not needed for selfManaged dialog.
mSummary.setVisibility(View.GONE);
@@ -566,46 +537,28 @@ public class CompanionDeviceActivity extends FragmentActivity implements
}
final String deviceName = mSelectedDevice.getDisplayName();
- final String profileName;
final Spanned title;
final Spanned summary;
final Drawable profileIcon;
+ if (!SUPPORTED_PROFILES.contains(deviceProfile)) {
+ throw new RuntimeException("Unsupported profile " + deviceProfile);
+ }
+
if (deviceProfile == null) {
- title = getHtmlFromResources(this, R.string.confirmation_title, appLabel, deviceName);
- summary = getHtmlFromResources(this, R.string.summary_generic);
- profileIcon = getIcon(this, R.drawable.ic_device_other);
// Summary is not needed for null profile.
mSummary.setVisibility(View.GONE);
mConstraintList.setVisibility(View.GONE);
- } else if (deviceProfile.equals(DEVICE_PROFILE_WATCH)) {
- profileName = getString(R.string.profile_name_watch);
- title = getHtmlFromResources(this, R.string.confirmation_title, appLabel, deviceName);
- summary = getHtmlFromResources(
- this, R.string.summary_watch_single_device, profileName, appLabel);
- profileIcon = getIcon(this, R.drawable.ic_watch);
-
- mPermissionTypes.addAll(Arrays.asList(
- PERMISSION_NOTIFICATION, PERMISSION_PHONE, PERMISSION_SMS, PERMISSION_CONTACTS,
- PERMISSION_CALENDAR, PERMISSION_NEARBY_DEVICES));
-
- setupPermissionList();
- } else if (deviceProfile.equals(DEVICE_PROFILE_GLASSES)) {
- profileName = getString(R.string.profile_name_glasses);
- title = getHtmlFromResources(this, R.string.confirmation_title, appLabel, deviceName);
- summary = getHtmlFromResources(
- this, R.string.summary_glasses_single_device, profileName, appLabel);
- profileIcon = getIcon(this, R.drawable.ic_glasses);
-
- mPermissionTypes.addAll(Arrays.asList(
- PERMISSION_NOTIFICATION, PERMISSION_PHONE, PERMISSION_SMS, PERMISSION_CONTACTS,
- PERMISSION_MICROPHONE, PERMISSION_NEARBY_DEVICES));
-
- setupPermissionList();
} else {
- throw new RuntimeException("Unsupported profile " + deviceProfile);
+ mPermissionTypes.addAll(PERMISSION_TYPES.get(deviceProfile));
+ setupPermissionList();
}
+ title = getHtmlFromResources(this, TITLES.get(deviceProfile), appLabel, deviceName);
+ summary = getHtmlFromResources(this, SUMMARIES.get(deviceProfile),
+ getString(PROFILES_NAME.get(deviceProfile)), appLabel);
+ profileIcon = getIcon(this, PROFILE_ICON.get(deviceProfile));
+
mTitle.setText(title);
mSummary.setText(summary);
mProfileIcon.setImageDrawable(profileIcon);
@@ -621,22 +574,23 @@ public class CompanionDeviceActivity extends FragmentActivity implements
final String profileName;
final Spanned summary;
final Drawable profileIcon;
+ final int summaryResourceId;
+
+ if (!SUPPORTED_PROFILES.contains(deviceProfile)) {
+ throw new RuntimeException("Unsupported profile " + deviceProfile);
+ }
+
+ profileName = getString(PROFILES_NAME.get(deviceProfile));
+ profileIcon = getIcon(this, PROFILE_ICON.get(deviceProfile));
+ summaryResourceId = MULTI_DEVICES_SUMMARIES.get(deviceProfile);
+
if (deviceProfile == null) {
- profileName = getString(R.string.profile_name_generic);
- summary = getHtmlFromResources(this, R.string.summary_generic);
- profileIcon = getIcon(this, R.drawable.ic_device_other);
+ summary = getHtmlFromResources(this, summaryResourceId);
mSummary.setVisibility(View.GONE);
- } else if (deviceProfile.equals(DEVICE_PROFILE_WATCH)) {
- profileName = getString(R.string.profile_name_watch);
- summary = getHtmlFromResources(this, R.string.summary_watch, profileName, appLabel);
- profileIcon = getIcon(this, R.drawable.ic_watch);
- } else if (deviceProfile.equals(DEVICE_PROFILE_GLASSES)) {
- profileName = getString(R.string.profile_name_glasses);
- summary = getHtmlFromResources(this, R.string.summary_glasses, profileName, appLabel);
- profileIcon = getIcon(this, R.drawable.ic_glasses);
} else {
- throw new RuntimeException("Unsupported profile " + deviceProfile);
+ summary = getHtmlFromResources(this, summaryResourceId, profileName, appLabel);
}
+
final Spanned title = getHtmlFromResources(
this, R.string.chooser_title, profileName, appLabel);
diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java
new file mode 100644
index 000000000000..6f5f4fe91c99
--- /dev/null
+++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java
@@ -0,0 +1,150 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.companiondevicemanager;
+
+import static android.companion.AssociationRequest.DEVICE_PROFILE_APP_STREAMING;
+import static android.companion.AssociationRequest.DEVICE_PROFILE_AUTOMOTIVE_PROJECTION;
+import static android.companion.AssociationRequest.DEVICE_PROFILE_COMPUTER;
+import static android.companion.AssociationRequest.DEVICE_PROFILE_GLASSES;
+import static android.companion.AssociationRequest.DEVICE_PROFILE_NEARBY_DEVICE_STREAMING;
+import static android.companion.AssociationRequest.DEVICE_PROFILE_WATCH;
+
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_APP_STREAMING;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_CALENDAR;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_CALL_LOGS;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_CONTACTS;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_MICROPHONE;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_NEARBY_DEVICES;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_NEARBY_DEVICE_STREAMING;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_NOTIFICATION;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_PHONE;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_SMS;
+import static com.android.companiondevicemanager.PermissionListAdapter.PERMISSION_STORAGE;
+
+import static java.util.Collections.unmodifiableMap;
+import static java.util.Collections.unmodifiableSet;
+
+import android.util.ArrayMap;
+import android.util.ArraySet;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * A class contains maps that have deviceProfile as the key and resourceId as the value
+ * for the corresponding profile.
+ */
+final class CompanionDeviceResources {
+ static final Map<String, Integer> TITLES;
+ static {
+ final Map<String, Integer> map = new ArrayMap<>();
+ map.put(DEVICE_PROFILE_APP_STREAMING, R.string.title_app_streaming);
+ map.put(DEVICE_PROFILE_AUTOMOTIVE_PROJECTION, R.string.title_automotive_projection);
+ map.put(DEVICE_PROFILE_COMPUTER, R.string.title_computer);
+ map.put(DEVICE_PROFILE_NEARBY_DEVICE_STREAMING, R.string.title_nearby_device_streaming);
+ map.put(DEVICE_PROFILE_WATCH, R.string.confirmation_title);
+ map.put(DEVICE_PROFILE_GLASSES, R.string.confirmation_title);
+ map.put(null, R.string.confirmation_title);
+
+ TITLES = unmodifiableMap(map);
+ }
+
+ static final Map<String, List<Integer>> PERMISSION_TYPES;
+ static {
+ final Map<String, List<Integer>> map = new ArrayMap<>();
+ map.put(DEVICE_PROFILE_APP_STREAMING, Arrays.asList(PERMISSION_APP_STREAMING));
+ map.put(DEVICE_PROFILE_COMPUTER, Arrays.asList(
+ PERMISSION_NOTIFICATION, PERMISSION_STORAGE));
+ map.put(DEVICE_PROFILE_NEARBY_DEVICE_STREAMING,
+ Arrays.asList(PERMISSION_NEARBY_DEVICE_STREAMING));
+ map.put(DEVICE_PROFILE_WATCH, Arrays.asList(PERMISSION_NOTIFICATION, PERMISSION_PHONE,
+ PERMISSION_CALL_LOGS, PERMISSION_SMS, PERMISSION_CONTACTS, PERMISSION_CALENDAR,
+ PERMISSION_NEARBY_DEVICES));
+ map.put(DEVICE_PROFILE_GLASSES, Arrays.asList(PERMISSION_NOTIFICATION, PERMISSION_PHONE,
+ PERMISSION_SMS, PERMISSION_CONTACTS, PERMISSION_MICROPHONE,
+ PERMISSION_NEARBY_DEVICES));
+
+ PERMISSION_TYPES = unmodifiableMap(map);
+ }
+
+ static final Map<String, Integer> SUMMARIES;
+ static {
+ final Map<String, Integer> map = new ArrayMap<>();
+ map.put(DEVICE_PROFILE_WATCH, R.string.summary_watch_single_device);
+ map.put(DEVICE_PROFILE_GLASSES, R.string.summary_glasses_single_device);
+ map.put(null, R.string.summary_generic);
+
+ SUMMARIES = unmodifiableMap(map);
+ }
+
+ static final Map<String, Integer> MULTI_DEVICES_SUMMARIES;
+ static {
+ final Map<String, Integer> map = new ArrayMap<>();
+ map.put(DEVICE_PROFILE_WATCH, R.string.summary_watch);
+ map.put(DEVICE_PROFILE_GLASSES, R.string.summary_glasses);
+ map.put(null, R.string.summary_generic);
+
+ MULTI_DEVICES_SUMMARIES = unmodifiableMap(map);
+ }
+
+ static final Map<String, Integer> PROFILES_NAME;
+ static {
+ final Map<String, Integer> map = new ArrayMap<>();
+ map.put(DEVICE_PROFILE_WATCH, R.string.profile_name_watch);
+ map.put(DEVICE_PROFILE_GLASSES, R.string.profile_name_glasses);
+ map.put(null, R.string.profile_name_generic);
+
+ PROFILES_NAME = unmodifiableMap(map);
+ }
+
+ static final Map<String, Integer> PROFILE_ICON;
+ static {
+ final Map<String, Integer> map = new ArrayMap<>();
+ map.put(DEVICE_PROFILE_WATCH, R.drawable.ic_watch);
+ map.put(DEVICE_PROFILE_GLASSES, R.drawable.ic_glasses);
+ map.put(null, R.drawable.ic_device_other);
+
+ PROFILE_ICON = unmodifiableMap(map);
+ }
+
+ static final Set<String> SUPPORTED_PROFILES;
+ static {
+ final Set<String> set = new ArraySet<>();
+ set.add(DEVICE_PROFILE_WATCH);
+ set.add(DEVICE_PROFILE_GLASSES);
+ set.add(null);
+
+ SUPPORTED_PROFILES = unmodifiableSet(set);
+ }
+
+
+ static final Set<String> SUPPORTED_SELF_MANAGED_PROFILES;
+ static {
+ final Set<String> set = new ArraySet<>();
+ set.add(DEVICE_PROFILE_APP_STREAMING);
+ set.add(DEVICE_PROFILE_COMPUTER);
+ set.add(DEVICE_PROFILE_AUTOMOTIVE_PROJECTION);
+ set.add(DEVICE_PROFILE_NEARBY_DEVICE_STREAMING);
+ set.add(null);
+
+ SUPPORTED_SELF_MANAGED_PROFILES = unmodifiableSet(set);
+ }
+
+
+}
diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/PermissionListAdapter.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/PermissionListAdapter.java
index 00c44d692782..556a05c55f88 100644
--- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/PermissionListAdapter.java
+++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/PermissionListAdapter.java
@@ -52,6 +52,7 @@ class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAdapter.V
static final int PERMISSION_NEARBY_DEVICES = 7;
static final int PERMISSION_NEARBY_DEVICE_STREAMING = 8;
static final int PERMISSION_MICROPHONE = 9;
+ static final int PERMISSION_CALL_LOGS = 10;
private static final Map<Integer, Integer> sTitleMap;
static {
@@ -66,6 +67,7 @@ class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAdapter.V
map.put(PERMISSION_NEARBY_DEVICES, R.string.permission_nearby_devices);
map.put(PERMISSION_NEARBY_DEVICE_STREAMING, R.string.permission_nearby_device_streaming);
map.put(PERMISSION_MICROPHONE, R.string.permission_microphone);
+ map.put(PERMISSION_CALL_LOGS, R.string.permission_call_logs);
sTitleMap = unmodifiableMap(map);
}
@@ -83,6 +85,7 @@ class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAdapter.V
map.put(PERMISSION_NEARBY_DEVICE_STREAMING,
R.string.permission_nearby_device_streaming_summary);
map.put(PERMISSION_MICROPHONE, R.string.permission_microphone_summary);
+ map.put(PERMISSION_CALL_LOGS, R.string.permission_call_logs_summary);
sSummaryMap = unmodifiableMap(map);
}
@@ -100,6 +103,7 @@ class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAdapter.V
map.put(PERMISSION_NEARBY_DEVICE_STREAMING,
R.drawable.ic_permission_nearby_device_streaming);
map.put(PERMISSION_MICROPHONE, R.drawable.ic_permission_microphone);
+ map.put(PERMISSION_CALL_LOGS, R.drawable.ic_permission_call_logs);
sIconMap = unmodifiableMap(map);
}