[CDM] Add bullet to CDM UI for the microphone permission set
* add a new category for microphone in the bullet list of permission sets included by CDM profiles; * add the microphone bullet to the "glasses" CDM profile * microphone icon taken from fonts.google.com * summary to be replaced by the final version from UX Bug: 256140614 Test: atest CtsCompanionDeviceManagerCoreTestCases Test: atest CtsCompanionDeviceManagerNoCompanionServicesTestCases Test: atest CtsCompanionDeviceManagerUiAutomationTestCases Change-Id: Ibf8481939fc860cfcea0e0134f4a94878f4ff442 Signed-off-by: Claudiu Ghioc <claudiughioc@google.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<!--
|
||||
~ 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:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="@android:color/system_accent1_200">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12,14Q10.75,14 9.875,13.125Q9,12.25 9,11V5Q9,3.75 9.875,2.875Q10.75,2 12,2Q13.25,2 14.125,2.875Q15,3.75 15,5V11Q15,12.25 14.125,13.125Q13.25,14 12,14ZM12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8ZM11,21V17.925Q8.4,17.575 6.7,15.6Q5,13.625 5,11H7Q7,13.075 8.463,14.537Q9.925,16 12,16Q14.075,16 15.538,14.537Q17,13.075 17,11H19Q19,13.625 17.3,15.6Q15.6,17.575 13,17.925V21ZM12,12Q12.425,12 12.713,11.712Q13,11.425 13,11V5Q13,4.575 12.713,4.287Q12.425,4 12,4Q11.575,4 11.288,4.287Q11,4.575 11,5V11Q11,11.425 11.288,11.712Q11.575,12 12,12Z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!--
|
||||
~ 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:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="@android:color/system_accent1_600">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,14Q10.75,14 9.875,13.125Q9,12.25 9,11V5Q9,3.75 9.875,2.875Q10.75,2 12,2Q13.25,2 14.125,2.875Q15,3.75 15,5V11Q15,12.25 14.125,13.125Q13.25,14 12,14ZM12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8Q12,8 12,8ZM11,21V17.925Q8.4,17.575 6.7,15.6Q5,13.625 5,11H7Q7,13.075 8.463,14.537Q9.925,16 12,16Q14.075,16 15.538,14.537Q17,13.075 17,11H19Q19,13.625 17.3,15.6Q15.6,17.575 13,17.925V21ZM12,12Q12.425,12 12.713,11.712Q13,11.425 13,11V5Q13,4.575 12.713,4.287Q12.425,4 12,4Q11.575,4 11.288,4.287Q11,4.575 11,5V11Q11,11.425 11.288,11.712Q11.575,12 12,12Z"/>
|
||||
</vector>
|
||||
@@ -140,6 +140,9 @@
|
||||
<!-- Calendar permission will be granted of corresponding profile [CHAR LIMIT=30] -->
|
||||
<string name="permission_calendar">Calendar</string>
|
||||
|
||||
<!-- 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] -->
|
||||
<string name="permission_nearby_devices">Nearby devices</string>
|
||||
|
||||
@@ -169,6 +172,10 @@
|
||||
<!-- TODO(b/253644212) Need the description for calendar permission -->
|
||||
<string name="permission_calendar_summary"></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>
|
||||
|
||||
@@ -36,6 +36,7 @@ import static com.android.companiondevicemanager.CompanionDeviceDiscoveryService
|
||||
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;
|
||||
@@ -596,10 +597,9 @@ public class CompanionDeviceActivity extends FragmentActivity implements
|
||||
this, R.string.summary_glasses_single_device, profileName, appLabel);
|
||||
profileIcon = getIcon(this, R.drawable.ic_glasses);
|
||||
|
||||
// TODO (b/256140614): add PERMISSION_MICROPHONE
|
||||
mPermissionTypes.addAll(Arrays.asList(
|
||||
PERMISSION_PHONE, PERMISSION_SMS, PERMISSION_CONTACTS,
|
||||
PERMISSION_NEARBY_DEVICES));
|
||||
PERMISSION_MICROPHONE, PERMISSION_NEARBY_DEVICES));
|
||||
|
||||
setupPermissionList();
|
||||
} else {
|
||||
|
||||
@@ -51,6 +51,7 @@ class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAdapter.V
|
||||
static final int PERMISSION_CALENDAR = 6;
|
||||
static final int PERMISSION_NEARBY_DEVICES = 7;
|
||||
static final int PERMISSION_NEARBY_DEVICE_STREAMING = 8;
|
||||
static final int PERMISSION_MICROPHONE = 9;
|
||||
|
||||
private static final Map<Integer, Integer> sTitleMap;
|
||||
static {
|
||||
@@ -64,6 +65,7 @@ class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAdapter.V
|
||||
map.put(PERMISSION_CALENDAR, R.string.permission_calendar);
|
||||
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);
|
||||
sTitleMap = unmodifiableMap(map);
|
||||
}
|
||||
|
||||
@@ -80,6 +82,7 @@ class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAdapter.V
|
||||
map.put(PERMISSION_NEARBY_DEVICES, R.string.permission_nearby_devices_summary);
|
||||
map.put(PERMISSION_NEARBY_DEVICE_STREAMING,
|
||||
R.string.permission_nearby_device_streaming_summary);
|
||||
map.put(PERMISSION_MICROPHONE, R.string.permission_microphone_summary);
|
||||
sSummaryMap = unmodifiableMap(map);
|
||||
}
|
||||
|
||||
@@ -96,6 +99,7 @@ class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAdapter.V
|
||||
map.put(PERMISSION_NEARBY_DEVICES, R.drawable.ic_permission_nearby_devices);
|
||||
map.put(PERMISSION_NEARBY_DEVICE_STREAMING,
|
||||
R.drawable.ic_permission_nearby_device_streaming);
|
||||
map.put(PERMISSION_MICROPHONE, R.drawable.ic_permission_microphone);
|
||||
sIconMap = unmodifiableMap(map);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user