Update strings for mini-resolver views

The strings will no longer be shared with the mini-resolver
for apps vs browser versions.

Test: Manually
Bug: 273907884
Change-Id: Ie61b7d4965ec5abe46a820d2dcca362b1e34ad34
This commit is contained in:
Anthony Alridge
2023-05-04 14:37:30 +00:00
parent be2d9c4580
commit 909ade51cb
4 changed files with 15 additions and 6 deletions

View File

@@ -1857,6 +1857,13 @@ public final class DevicePolicyResources {
public static final String MINIRESOLVER_OPEN_IN_PERSONAL =
PREFIX + "MINIRESOLVER_OPEN_IN_PERSONAL";
/**
* Title for a dialog shown when the user has no apps capable of handling an intent
* in the personal profile, and must choose whether to open the intent in a
* cross-profile app in the work profile, or cancel. Accepts the app name as a param.
*/
public static final String MINIRESOLVER_OPEN_WORK = PREFIX + "MINIRESOLVER_OPEN_WORK";
public static final String MINIRESOLVER_USE_WORK_BROWSER =
PREFIX + "MINIRESOLVER_OPEN_IN_PERSONAL";

View File

@@ -19,7 +19,7 @@ package com.android.internal.app;
import static android.Manifest.permission.INTERACT_ACROSS_USERS;
import static android.app.admin.DevicePolicyResources.Strings.Core.FORWARD_INTENT_TO_PERSONAL;
import static android.app.admin.DevicePolicyResources.Strings.Core.FORWARD_INTENT_TO_WORK;
import static android.app.admin.DevicePolicyResources.Strings.Core.MINIRESOLVER_OPEN_IN_WORK;
import static android.app.admin.DevicePolicyResources.Strings.Core.MINIRESOLVER_OPEN_WORK;
import static android.content.pm.PackageManager.MATCH_DEFAULT_ONLY;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
@@ -227,8 +227,8 @@ public class IntentForwarderActivity extends Activity {
private String getOpenInWorkMessage(CharSequence targetLabel) {
return getSystemService(DevicePolicyManager.class).getResources().getString(
MINIRESOLVER_OPEN_IN_WORK,
() -> getString(R.string.miniresolver_open_in_work, targetLabel),
MINIRESOLVER_OPEN_WORK,
() -> getString(R.string.miniresolver_open_work, targetLabel),
targetLabel);
}

View File

@@ -5912,11 +5912,12 @@
<!-- Error message. This text lets the user know that their current personal apps don't support the specific content. [CHAR LIMIT=NONE] -->
<string name="resolver_no_personal_apps_available">No personal apps</string>
<!-- Dialog title. User must choose to open content in a cross-profile app or cancel. [CHAR LIMIT=NONE] -->
<string name="miniresolver_open_work">Open work <xliff:g id="app" example="YouTube">%s</xliff:g>?</string>
<!-- Dialog title. User must choose between opening content in a cross-profile app or same-profile browser. [CHAR LIMIT=NONE] -->
<string name="miniresolver_open_in_personal">Open personal <xliff:g id="app" example="YouTube">%s</xliff:g></string>
<string name="miniresolver_open_in_personal">Open in personal <xliff:g id="app" example="YouTube">%s</xliff:g>?</string>
<!-- Dialog title. User must choose between opening content in a cross-profile app or same-profile browser. [CHAR LIMIT=NONE] -->
<string name="miniresolver_open_in_work">Open work <xliff:g id="app" example="YouTube">%s</xliff:g></string>
<string name="miniresolver_open_in_work">Open in work <xliff:g id="app" example="YouTube">%s</xliff:g>?</string>
<!-- Button option. Open the link in the personal browser. [CHAR LIMIT=NONE] -->
<string name="miniresolver_use_personal_browser">Use personal browser</string>
<!-- Button option. Open the link in the work browser. [CHAR LIMIT=NONE] -->

View File

@@ -1575,6 +1575,7 @@
<java-symbol type="id" name="open_cross_profile" />
<java-symbol type="string" name="miniresolver_open_in_personal" />
<java-symbol type="string" name="miniresolver_open_in_work" />
<java-symbol type="string" name="miniresolver_open_work" />
<java-symbol type="string" name="miniresolver_use_personal_browser" />
<java-symbol type="string" name="miniresolver_use_work_browser" />
<java-symbol type="id" name="button_open" />