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

Commit 5bc8e732 authored by satok's avatar satok
Browse files

Display the current ime and subtype name in the ongoing notification

Bug: 4903422
Change-Id: I3eaeb3decb75f687ad2af0d80340b819229c3ebe
parent 3263f02b
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -1127,13 +1127,21 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                mBackDisposition = backDisposition;
                mStatusBar.setImeWindowStatus(token, vis, backDisposition);
                final boolean iconVisibility = (vis & InputMethodService.IME_ACTIVE) != 0;
                if (iconVisibility && needsToShowImeSwitchOngoingNotification()) {
                final InputMethodInfo imi = mMethodMap.get(mCurMethodId);
                if (imi != null && iconVisibility && needsToShowImeSwitchOngoingNotification()) {
                    final PackageManager pm = mContext.getPackageManager();
                    final CharSequence label = mMethodMap.get(mCurMethodId).loadLabel(pm);
                    final CharSequence title = mRes.getText(
                            com.android.internal.R.string.select_input_method);
                    final CharSequence imiLabel = imi.loadLabel(pm);
                    final CharSequence summary = mCurrentSubtype != null
                            ? TextUtils.concat(mCurrentSubtype.getDisplayName(mContext,
                                        imi.getPackageName(), imi.getServiceInfo().applicationInfo),
                                                (TextUtils.isEmpty(imiLabel) ?
                                                        "" : " (" + imiLabel + ")"))
                            : imiLabel;

                    mImeSwitcherNotification.setLatestEventInfo(
                            mContext, title, label, mImeSwitchPendingIntent);
                            mContext, title, summary, mImeSwitchPendingIntent);
                    mNotificationManager.notify(
                            com.android.internal.R.string.select_input_method,
                            mImeSwitcherNotification);