Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a54d51b0 authored by Dmitry Dementyev's avatar Dmitry Dementyev Committed by Android (Google) Code Review
Browse files

Merge "Add userId param to AccountManagerService.getApplicationLabel."

parents 2622af08 80e28b1d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -3143,7 +3143,7 @@ public class AccountManagerService
                GrantCredentialsPermissionActivity.EXTRAS_AUTH_TOKEN_TYPE);
        final String titleAndSubtitle =
                mContext.getString(R.string.permission_request_notification_for_app_with_subtitle,
                getApplicationLabel(packageName), account.name);
                getApplicationLabel(packageName, userId), account.name);
        final int index = titleAndSubtitle.indexOf('\n');
        String title = titleAndSubtitle;
        String subtitle = "";
@@ -3169,10 +3169,10 @@ public class AccountManagerService
                account, authTokenType, uid), n, "android", user.getIdentifier());
    }

    private String getApplicationLabel(String packageName) {
    private String getApplicationLabel(String packageName, int userId) {
        try {
            return mPackageManager.getApplicationLabel(
                    mPackageManager.getApplicationInfo(packageName, 0)).toString();
                    mPackageManager.getApplicationInfoAsUser(packageName, 0, userId)).toString();
        } catch (PackageManager.NameNotFoundException e) {
            return packageName;
        }