From d1f854d2c0def55634fccacaf7969781f720e91e Mon Sep 17 00:00:00 2001 From: Cliff Wu Date: Wed, 15 Jun 2022 16:05:05 +0800 Subject: [PATCH] Fix generic wrong strings to comply with the UX guideline - The generic error need to remove "Unavailable" in the header and only show body text. - The "Play Store" app needs to be added to the error for a specific app and it says "Play Store not available". - Dialer app uses generic alert dialog. Bug: 230048652 Test: Manual, atest FrameworksServicesTests:VirtualDeviceManagerServiceTest Change-Id: I8b56e2804c3204901a3551d3300ab8c0391e7260 --- .../app/BlockedAppStreamingActivity.java | 17 ++++++++++------ core/res/res/values/strings.xml | 20 ++++++++++--------- core/res/res/values/symbols.xml | 3 ++- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/core/java/com/android/internal/app/BlockedAppStreamingActivity.java b/core/java/com/android/internal/app/BlockedAppStreamingActivity.java index ca111a49235e4..7c248927be806 100644 --- a/core/java/com/android/internal/app/BlockedAppStreamingActivity.java +++ b/core/java/com/android/internal/app/BlockedAppStreamingActivity.java @@ -36,6 +36,7 @@ public class BlockedAppStreamingActivity extends AlertActivity { private static final String EXTRA_BLOCKED_ACTIVITY_INFO = PACKAGE_NAME + ".extra.BLOCKED_ACTIVITY_INFO"; private static final String EXTRA_STREAMED_DEVICE = PACKAGE_NAME + ".extra.STREAMED_DEVICE"; + private static final String BLOCKED_COMPONENT_PLAYSTORE = "com.android.vending"; private static final String BLOCKED_COMPONENT_SETTINGS = "com.android.settings"; @Override @@ -62,21 +63,25 @@ public class BlockedAppStreamingActivity extends AlertActivity { mAlertParams.mTitle = getString(R.string.app_streaming_blocked_title_for_permission_dialog); mAlertParams.mMessage = - getString(R.string.app_streaming_blocked_message_for_permission_dialog, - streamedDeviceName); + getString(R.string.app_streaming_blocked_message, streamedDeviceName); + } else if (TextUtils.equals(activityInfo.packageName, BLOCKED_COMPONENT_PLAYSTORE)) { + mAlertParams.mTitle = + getString(R.string.app_streaming_blocked_title_for_playstore_dialog); + mAlertParams.mMessage = + getString(R.string.app_streaming_blocked_message, streamedDeviceName); } else if (TextUtils.equals(activityInfo.packageName, BLOCKED_COMPONENT_SETTINGS)) { mAlertParams.mTitle = getString(R.string.app_streaming_blocked_title_for_settings_dialog); mAlertParams.mMessage = - getString(R.string.app_streaming_blocked_message, streamedDeviceName); + getString(R.string.app_streaming_blocked_message_for_settings_dialog, + streamedDeviceName); } else { - mAlertParams.mTitle = - getString(R.string.app_streaming_blocked_title, appLabel); + // No title required mAlertParams.mMessage = getString(R.string.app_streaming_blocked_message, streamedDeviceName); } } else { - mAlertParams.mTitle = getString(R.string.app_blocked_title); + // No title required mAlertParams.mMessage = getString(R.string.app_blocked_message, appLabel); } mAlertParams.mPositiveButtonText = getString(android.R.string.ok); diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index d5283852c2951..a3b05b57c3947 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -5479,6 +5479,8 @@ Continue on phone Microphone unavailable + + Play Store unavailable Android TV settings unavailable @@ -5486,23 +5488,23 @@ Phone settings unavailable - This can’t be accessed on your %1$s. Try on your Android TV device instead. + This can’t be accessed on your %1$s at this time. Try on your Android TV device instead. - This can’t be accessed on your %1$s. Try on your tablet instead. + This can’t be accessed on your %1$s at this time. Try on your tablet instead. - This can’t be accessed on your %1$s. Try on your phone instead. - - This can’t be accessed on your %1$s at this time. Try on your Android TV device instead. - - This can’t be accessed on your %1$s at this time. Try on your tablet instead. - - This can’t be accessed on your %1$s at this time. Try on your phone instead. + This can’t be accessed on your %1$s at this time. Try on your phone instead. This app is requesting additional security. Try on your Android TV device instead. This app is requesting additional security. Try on your tablet instead. This app is requesting additional security. Try on your phone instead. + + This can’t be accessed on your %1$s. Try on your Android TV device instead. + + This can’t be accessed on your %1$s. Try on your tablet instead. + + This can’t be accessed on your %1$s. Try on your phone instead. This app was built for an older version of Android and may not work properly. Try checking for updates, or contact the developer. diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index adff14a14871e..7d4188377be67 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3310,10 +3310,11 @@ + - +