Loading packages/SettingsLib/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1373,4 +1373,7 @@ <string name="cached_apps_freezer_enabled">Enabled</string> <!-- Developer setting dialog prompting the user to reboot after changing the app freezer setting [CHAR LIMIT=NONE]--> <string name="cached_apps_freezer_reboot_dialog_text">Your device must be rebooted for this change to apply. Reboot now or cancel.</string> <!-- A content description for work profile app [CHAR LIMIT=35] --> <string name="accessibility_work_profile_app_description">Work <xliff:g id="app_name" example="Camera">%s</xliff:g></string> </resources> packages/SettingsLib/src/com/android/settingslib/applications/AppUtils.java +15 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.hardware.usb.IUsbManager; import android.os.RemoteException; import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import android.util.Log; import com.android.settingslib.R; Loading Loading @@ -151,4 +152,17 @@ public class AppUtils { return false; } } /** * Returns a content description of an app name which distinguishes a personal app from a * work app for accessibility purpose. * If the app is in a work profile, then add a "work" prefix to the app name. */ public static String getAppContentDescription(Context context, String packageName, int userId) { final CharSequence appLabel = getApplicationLabel(context.getPackageManager(), packageName); return UserManager.get(context).isManagedProfile(userId) ? context.getString(R.string.accessibility_work_profile_app_description, appLabel) : appLabel.toString(); } } Loading
packages/SettingsLib/res/values/strings.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1373,4 +1373,7 @@ <string name="cached_apps_freezer_enabled">Enabled</string> <!-- Developer setting dialog prompting the user to reboot after changing the app freezer setting [CHAR LIMIT=NONE]--> <string name="cached_apps_freezer_reboot_dialog_text">Your device must be rebooted for this change to apply. Reboot now or cancel.</string> <!-- A content description for work profile app [CHAR LIMIT=35] --> <string name="accessibility_work_profile_app_description">Work <xliff:g id="app_name" example="Camera">%s</xliff:g></string> </resources>
packages/SettingsLib/src/com/android/settingslib/applications/AppUtils.java +15 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.hardware.usb.IUsbManager; import android.os.RemoteException; import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import android.util.Log; import com.android.settingslib.R; Loading Loading @@ -151,4 +152,17 @@ public class AppUtils { return false; } } /** * Returns a content description of an app name which distinguishes a personal app from a * work app for accessibility purpose. * If the app is in a work profile, then add a "work" prefix to the app name. */ public static String getAppContentDescription(Context context, String packageName, int userId) { final CharSequence appLabel = getApplicationLabel(context.getPackageManager(), packageName); return UserManager.get(context).isManagedProfile(userId) ? context.getString(R.string.accessibility_work_profile_app_description, appLabel) : appLabel.toString(); } }