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

Commit 14d90a27 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make IMMS#updateStatusIcon() multi-user aware"

parents 9756b369 8a875de0
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -2957,19 +2957,17 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                    hideStatusBarIconLocked();
                } else if (packageName != null) {
                    if (DEBUG) Slog.d(TAG, "show a small icon for the input method");
                    CharSequence contentDescription = null;
                    final PackageManager userAwarePackageManager =
                            getPackageManagerForUser(mContext, mSettings.getCurrentUserId());
                    ApplicationInfo applicationInfo = null;
                    try {
                        // Use PackageManager to load label
                        final PackageManager packageManager = mContext.getPackageManager();
                        final ApplicationInfo applicationInfo = mIPackageManager
                                .getApplicationInfo(packageName, 0, mSettings.getCurrentUserId());
                        if (applicationInfo != null) {
                            contentDescription = packageManager
                                    .getApplicationLabel(applicationInfo);
                        }
                    } catch (RemoteException e) {
                        /* ignore */
                        applicationInfo = userAwarePackageManager.getApplicationInfo(packageName,
                                PackageManager.ApplicationInfoFlags.of(0));
                    } catch (PackageManager.NameNotFoundException e) {
                    }
                    final CharSequence contentDescription = applicationInfo != null
                            ? userAwarePackageManager.getApplicationLabel(applicationInfo)
                            : null;
                    if (mStatusBar != null) {
                        mStatusBar.setIcon(mSlotIme, packageName, iconId, 0,
                                contentDescription  != null