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

Commit 80e28b1d authored by Dmitry Dementyev's avatar Dmitry Dementyev
Browse files

Add userId param to AccountManagerService.getApplicationLabel.

Test: manual
Bug: 201517841
Change-Id: I983f6cbbdc01d608726838bb1376039b5136c7d0
parent 2a6a90ed
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;
        }