From aa0d23a98705a0c14a77e453e898fce2431349ff Mon Sep 17 00:00:00 2001 From: Guojing Yuan Date: Thu, 2 Feb 2023 23:30:16 +0000 Subject: [PATCH] Update CDM dialogs with ContextSync strings Fix: 267646302 Test: manually tested the dialogs Change-Id: Ie1c116a9c3ae69f32ed9090adf68f9e44991cc94 --- .../res/layout/list_item_permission.xml | 2 +- .../CompanionDeviceManager/res/values/strings.xml | 15 +++++++++------ .../CompanionDeviceActivity.java | 8 +++----- .../CompanionDeviceResources.java | 2 +- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/CompanionDeviceManager/res/layout/list_item_permission.xml b/packages/CompanionDeviceManager/res/layout/list_item_permission.xml index ab2d815063eb9..6c463e18ef114 100644 --- a/packages/CompanionDeviceManager/res/layout/list_item_permission.xml +++ b/packages/CompanionDeviceManager/res/layout/list_item_permission.xml @@ -22,7 +22,7 @@ android:orientation="horizontal" android:paddingStart="32dp" android:paddingEnd="32dp" - android:paddingBottom="14dp"> + android:paddingTop="12dp"> Companion Device Manager - Allow <strong>%1$s</strong> to access your <strong>%2$s</strong> + Allow <strong>%1$s</strong> to access <strong>%2$s</strong> @@ -31,10 +31,10 @@ Choose a %1$s to be managed by <strong>%2$s</strong> - The app is needed to manage your %1$s. %2$s will be allowed to interact with your notifications and access your Phone, SMS, Contacts, Calendar, Call logs and Nearby devices permissions. + The app is needed to manage your %1$s. %2$s will be allowed to sync info, like the name of someone calling, interact with your notifications and access your Phone, SMS, Contacts, Calendar, Call logs and Nearby devices permissions. - The app is needed to manage your %1$s. %2$s will be allowed to interact with these permissions: + The app is needed to manage your %1$s. %2$s will be allowed to sync info, like the name of someone calling, and access these permissions: @@ -43,10 +43,10 @@ glasses - This app is needed to manage your %1$s. %2$s will be allowed to interact with your notifications and access your Phone, SMS, Contacts, Microphone and Nearby devices permissions. + This app is needed to manage %1$s. %2$s will be allowed to interact with your notifications and access your Phone, SMS, Contacts, Microphone and Nearby devices permissions. - The app is needed to manage your %1$s. %2$s will be allowed to interact with these permissions: + The app is needed to manage %1$s. %2$s will be allowed to interact with these permissions: @@ -99,7 +99,10 @@ device - + This app will be able to sync info, like the name of someone calling, between your phone and %1$s. + + + This app will be able to sync info, like the name of someone calling, between your phone and the chosen device. diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java index c5ed5c9680a81..918f9c681c5a2 100644 --- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java +++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceActivity.java @@ -546,17 +546,16 @@ public class CompanionDeviceActivity extends FragmentActivity implements } if (deviceProfile == null) { - // Summary is not needed for null profile. - mSummary.setVisibility(View.GONE); + summary = getHtmlFromResources(this, SUMMARIES.get(null), deviceName); mConstraintList.setVisibility(View.GONE); } else { + summary = getHtmlFromResources(this, SUMMARIES.get(deviceProfile), + getString(PROFILES_NAME.get(deviceProfile)), appLabel); 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); @@ -586,7 +585,6 @@ public class CompanionDeviceActivity extends FragmentActivity implements if (deviceProfile == null) { summary = getHtmlFromResources(this, summaryResourceId); - mSummary.setVisibility(View.GONE); } else { summary = getHtmlFromResources(this, summaryResourceId, profileName, appLabel); } diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java index 6f5f4fe91c992..e3fd3545ca4b2 100644 --- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java +++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionDeviceResources.java @@ -88,7 +88,7 @@ final class CompanionDeviceResources { final Map 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); + map.put(null, R.string.summary_generic_single_device); SUMMARIES = unmodifiableMap(map); }