summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/com/android/internal/notification/SystemNotificationChannels.java13
-rw-r--r--core/res/AndroidManifest.xml1
-rw-r--r--core/res/res/drawable-hdpi/ic_notification_ime_default.pngbin755 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/ic_notification_ime_default.pngbin642 -> 0 bytes
-rw-r--r--core/res/res/drawable-xhdpi/ic_notification_ime_default.pngbin1012 -> 0 bytes
-rw-r--r--core/res/res/drawable-xxhdpi/ic_notification_ime_default.pngbin1183 -> 0 bytes
-rw-r--r--core/res/res/values/strings.xml3
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--proto/src/system_messages.proto2
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java86
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodUtils.java10
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerInternal.java9
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java5
13 files changed, 6 insertions, 124 deletions
diff --git a/core/java/com/android/internal/notification/SystemNotificationChannels.java b/core/java/com/android/internal/notification/SystemNotificationChannels.java
index 681b46a01c8d..0489dc812ab6 100644
--- a/core/java/com/android/internal/notification/SystemNotificationChannels.java
+++ b/core/java/com/android/internal/notification/SystemNotificationChannels.java
@@ -35,7 +35,10 @@ import java.util.List;
// Manages the NotificationChannels used by the frameworks itself.
public class SystemNotificationChannels {
- public static String VIRTUAL_KEYBOARD = "VIRTUAL_KEYBOARD";
+ /**
+ * @deprecated Legacy system channel, which is no longer used,
+ */
+ @Deprecated public static String VIRTUAL_KEYBOARD = "VIRTUAL_KEYBOARD";
public static String PHYSICAL_KEYBOARD = "PHYSICAL_KEYBOARD";
public static String SECURITY = "SECURITY";
public static String CAR_MODE = "CAR_MODE";
@@ -72,13 +75,6 @@ public class SystemNotificationChannels {
public static void createAll(Context context) {
final NotificationManager nm = context.getSystemService(NotificationManager.class);
List<NotificationChannel> channelsList = new ArrayList<NotificationChannel>();
- final NotificationChannel keyboard = new NotificationChannel(
- VIRTUAL_KEYBOARD,
- context.getString(R.string.notification_channel_virtual_keyboard),
- NotificationManager.IMPORTANCE_LOW);
- keyboard.setBlockable(true);
- channelsList.add(keyboard);
-
final NotificationChannel physicalKeyboardChannel = new NotificationChannel(
PHYSICAL_KEYBOARD,
context.getString(R.string.notification_channel_physical_keyboard),
@@ -237,6 +233,7 @@ public class SystemNotificationChannels {
/** Remove notification channels which are no longer used */
public static void removeDeprecated(Context context) {
final NotificationManager nm = context.getSystemService(NotificationManager.class);
+ nm.deleteNotificationChannel(VIRTUAL_KEYBOARD);
nm.deleteNotificationChannel(DEVICE_ADMIN_DEPRECATED);
nm.deleteNotificationChannel(SYSTEM_CHANGES_DEPRECATED);
}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 1f23eb6a86d6..6ce31fc13f85 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -668,7 +668,6 @@
<protected-broadcast android:name="android.media.tv.action.PREVIEW_PROGRAM_BROWSABLE_DISABLED" />
<protected-broadcast android:name="android.media.tv.action.WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED" />
<protected-broadcast android:name="android.media.tv.action.CHANNEL_BROWSABLE_REQUESTED" />
- <protected-broadcast android:name="com.android.server.inputmethod.InputMethodManagerService.SHOW_INPUT_METHOD_PICKER" />
<!-- Time zone rules update intents fired by the system server -->
<protected-broadcast android:name="com.android.intent.action.timezone.RULES_UPDATE_OPERATION" />
diff --git a/core/res/res/drawable-hdpi/ic_notification_ime_default.png b/core/res/res/drawable-hdpi/ic_notification_ime_default.png
deleted file mode 100644
index 369c88d31707..000000000000
--- a/core/res/res/drawable-hdpi/ic_notification_ime_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/ic_notification_ime_default.png b/core/res/res/drawable-mdpi/ic_notification_ime_default.png
deleted file mode 100644
index 7d97eb575f2a..000000000000
--- a/core/res/res/drawable-mdpi/ic_notification_ime_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/ic_notification_ime_default.png b/core/res/res/drawable-xhdpi/ic_notification_ime_default.png
deleted file mode 100644
index 900801a4d3d7..000000000000
--- a/core/res/res/drawable-xhdpi/ic_notification_ime_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-xxhdpi/ic_notification_ime_default.png b/core/res/res/drawable-xxhdpi/ic_notification_ime_default.png
deleted file mode 100644
index 6c8222ec50b7..000000000000
--- a/core/res/res/drawable-xxhdpi/ic_notification_ime_default.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 5f9911358921..d0fca8b0a7bb 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -741,9 +741,6 @@
<!-- Text shown in place of notification contents when the notification is hidden on a secure lockscreen -->
<string name="notification_hidden_text">New notification</string>
- <!-- Text shown when viewing channel settings for notifications related to the virtual keyboard -->
- <string name="notification_channel_virtual_keyboard">Virtual keyboard</string>
-
<!-- Text shown when viewing channel settings for notifications related to the hardware keyboard -->
<string name="notification_channel_physical_keyboard">Physical keyboard</string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index b94d7990b394..fc55ed2fe443 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1992,7 +1992,6 @@
<java-symbol type="color" name="config_defaultNotificationColor" />
<java-symbol type="color" name="decor_view_status_guard" />
<java-symbol type="color" name="decor_view_status_guard_light" />
- <java-symbol type="drawable" name="ic_notification_ime_default" />
<java-symbol type="drawable" name="ic_menu_refresh" />
<java-symbol type="drawable" name="ic_settings" />
<java-symbol type="drawable" name="ic_voice_search" />
diff --git a/proto/src/system_messages.proto b/proto/src/system_messages.proto
index a94bfe281be1..12e722601e25 100644
--- a/proto/src/system_messages.proto
+++ b/proto/src/system_messages.proto
@@ -61,7 +61,7 @@ message SystemMessage {
// Notify the user that they should select an input method
// Package: android
- NOTE_SELECT_INPUT_METHOD = 8;
+ NOTE_SELECT_INPUT_METHOD = 8 [deprecated = true];
// Notify the user about limited functionality before decryption
// Package: android
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 76331fd6089c..76495b17c984 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -58,7 +58,6 @@ import android.Manifest;
import android.accessibilityservice.AccessibilityService;
import android.annotation.AnyThread;
import android.annotation.BinderThread;
-import android.annotation.ColorInt;
import android.annotation.DrawableRes;
import android.annotation.DurationMillisLong;
import android.annotation.EnforcePermission;
@@ -69,9 +68,6 @@ import android.annotation.UiThread;
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentProvider;
@@ -94,7 +90,6 @@ import android.inputmethodservice.InputMethodService;
import android.media.AudioManagerInternal;
import android.net.Uri;
import android.os.Binder;
-import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
import android.os.IBinder;
@@ -170,8 +165,6 @@ import com.android.internal.inputmethod.SoftInputShowHideReason;
import com.android.internal.inputmethod.StartInputFlags;
import com.android.internal.inputmethod.StartInputReason;
import com.android.internal.inputmethod.UnbindReason;
-import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
-import com.android.internal.notification.SystemNotificationChannels;
import com.android.internal.os.TransferPipe;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.ConcurrentUtils;
@@ -255,13 +248,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
private static final String HANDLER_THREAD_NAME = "android.imms";
/**
- * A protected broadcast intent action for internal use for {@link PendingIntent} in
- * the notification.
- */
- private static final String ACTION_SHOW_INPUT_METHOD_PICKER =
- "com.android.server.inputmethod.InputMethodManagerService.SHOW_INPUT_METHOD_PICKER";
-
- /**
* When set, {@link #startInputUncheckedLocked} will return
* {@link InputBindResult#NO_EDITOR} instead of starting an IME connection
* unless {@link StartInputFlags#IS_TEXT_EDITOR} is set. This behavior overrides
@@ -334,13 +320,8 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
@GuardedBy("ImfLock.class")
private int mDisplayIdToShowIme = INVALID_DISPLAY;
- // Ongoing notification
- private NotificationManager mNotificationManager;
@Nullable private StatusBarManagerInternal mStatusBarManagerInternal;
- private final Notification.Builder mImeSwitcherNotification;
- private final PendingIntent mImeSwitchPendingIntent;
private boolean mShowOngoingImeSwitcherForPhones;
- private boolean mNotificationShown;
@GuardedBy("ImfLock.class")
private final HandwritingModeController mHwController;
@GuardedBy("ImfLock.class")
@@ -1253,17 +1234,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
return;
} else if (Intent.ACTION_LOCALE_CHANGED.equals(action)) {
onActionLocaleChanged();
- } else if (ACTION_SHOW_INPUT_METHOD_PICKER.equals(action)) {
- // ACTION_SHOW_INPUT_METHOD_PICKER action is a protected-broadcast and it is
- // guaranteed to be send only from the system, so that there is no need for extra
- // security check such as
- // {@link #canShowInputMethodPickerLocked(IInputMethodClient)}.
- mHandler.obtainMessage(
- MSG_SHOW_IM_SUBTYPE_PICKER,
- // TODO(b/120076400): Design and implement IME switcher for heterogeneous
- // navbar configuration.
- InputMethodManager.SHOW_IM_PICKER_MODE_INCLUDE_AUXILIARY_SUBTYPES,
- DEFAULT_DISPLAY).sendToTarget();
} else {
Slog.w(TAG, "Unexpected intent " + intent);
}
@@ -1720,27 +1690,8 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
mSlotIme = mContext.getString(com.android.internal.R.string.status_bar_ime);
- Bundle extras = new Bundle();
- extras.putBoolean(Notification.EXTRA_ALLOW_DURING_SETUP, true);
- @ColorInt final int accentColor = mContext.getColor(
- com.android.internal.R.color.system_notification_accent_color);
- mImeSwitcherNotification =
- new Notification.Builder(mContext, SystemNotificationChannels.VIRTUAL_KEYBOARD)
- .setSmallIcon(com.android.internal.R.drawable.ic_notification_ime_default)
- .setWhen(0)
- .setOngoing(true)
- .addExtras(extras)
- .setCategory(Notification.CATEGORY_SYSTEM)
- .setColor(accentColor);
-
- Intent intent = new Intent(ACTION_SHOW_INPUT_METHOD_PICKER)
- .setPackage(mContext.getPackageName());
- mImeSwitchPendingIntent = PendingIntent.getBroadcast(mContext, 0, intent,
- PendingIntent.FLAG_IMMUTABLE);
-
mShowOngoingImeSwitcherForPhones = false;
- mNotificationShown = false;
final int userId = mActivityManagerInternal.getCurrentUserId();
mLastSwitchUserId = userId;
@@ -1939,7 +1890,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
final int currentUserId = mSettings.getCurrentUserId();
mSettings.switchCurrentUser(currentUserId,
!mUserManagerInternal.isUserUnlockingOrUnlocked(currentUserId));
- mNotificationManager = mContext.getSystemService(NotificationManager.class);
mStatusBarManagerInternal =
LocalServices.getService(StatusBarManagerInternal.class);
hideStatusBarIconLocked();
@@ -1977,7 +1927,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
broadcastFilterForSystemUser.addAction(Intent.ACTION_USER_ADDED);
broadcastFilterForSystemUser.addAction(Intent.ACTION_USER_REMOVED);
broadcastFilterForSystemUser.addAction(Intent.ACTION_LOCALE_CHANGED);
- broadcastFilterForSystemUser.addAction(ACTION_SHOW_INPUT_METHOD_PICKER);
mContext.registerReceiver(new ImmsBroadcastReceiverForSystemUser(),
broadcastFilterForSystemUser);
@@ -3159,41 +3108,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
mStatusBarManagerInternal.setImeWindowStatus(mCurTokenDisplayId,
getCurTokenLocked(), vis, backDisposition, needsToShowImeSwitcher);
}
- final InputMethodInfo imi = mMethodMap.get(getSelectedMethodIdLocked());
- if (imi != null && needsToShowImeSwitcher) {
- // Used to load label
- final CharSequence title = mRes.getText(
- com.android.internal.R.string.select_input_method);
- final int currentUserId = mSettings.getCurrentUserId();
- final Context userAwareContext = mContext.getUserId() == currentUserId
- ? mContext
- : mContext.createContextAsUser(UserHandle.of(currentUserId), 0 /* flags */);
- final CharSequence summary = InputMethodUtils.getImeAndSubtypeDisplayName(
- userAwareContext, imi, mCurrentSubtype);
- mImeSwitcherNotification.setContentTitle(title)
- .setContentText(summary)
- .setContentIntent(mImeSwitchPendingIntent);
- // TODO(b/120076400): Figure out what is the best behavior
- if ((mNotificationManager != null)
- && !mWindowManagerInternal.hasNavigationBar(DEFAULT_DISPLAY)) {
- if (DEBUG) {
- Slog.d(TAG, "--- show notification: label = " + summary);
- }
- mNotificationManager.notifyAsUser(null,
- SystemMessage.NOTE_SELECT_INPUT_METHOD,
- mImeSwitcherNotification.build(), UserHandle.ALL);
- mNotificationShown = true;
- }
- } else {
- if (mNotificationShown && mNotificationManager != null) {
- if (DEBUG) {
- Slog.d(TAG, "--- hide notification");
- }
- mNotificationManager.cancelAsUser(null,
- SystemMessage.NOTE_SELECT_INPUT_METHOD, UserHandle.ALL);
- mNotificationShown = false;
- }
- }
} finally {
Binder.restoreCallingIdentity(ident);
}
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodUtils.java b/services/core/java/com/android/server/inputmethod/InputMethodUtils.java
index c7ff8caf176b..ebf9237d61ea 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodUtils.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodUtils.java
@@ -179,16 +179,6 @@ final class InputMethodUtils {
}
}
- static CharSequence getImeAndSubtypeDisplayName(Context context, InputMethodInfo imi,
- InputMethodSubtype subtype) {
- final CharSequence imiLabel = imi.loadLabel(context.getPackageManager());
- return subtype != null
- ? TextUtils.concat(subtype.getDisplayName(context,
- imi.getPackageName(), imi.getServiceInfo().applicationInfo),
- (TextUtils.isEmpty(imiLabel) ? "" : " - " + imiLabel))
- : imiLabel;
- }
-
/**
* Returns true if a package name belongs to a UID.
*
diff --git a/services/core/java/com/android/server/wm/WindowManagerInternal.java b/services/core/java/com/android/server/wm/WindowManagerInternal.java
index 32feb6c98b24..c206a15503de 100644
--- a/services/core/java/com/android/server/wm/WindowManagerInternal.java
+++ b/services/core/java/com/android/server/wm/WindowManagerInternal.java
@@ -613,15 +613,6 @@ public abstract class WindowManagerInternal {
@NonNull IBinder imeTargetWindowToken);
/**
- * Returns the presence of a software navigation bar on the specified display.
- *
- * @param displayId the id of display to check if there is a software navigation bar.
- * @return {@code true} if there is a software navigation. {@code false} otherwise, including
- * the case when the specified display does not exist.
- */
- public abstract boolean hasNavigationBar(int displayId);
-
- /**
* Returns true when the hardware keyboard is available.
*/
public abstract boolean isHardKeyboardAvailable();
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index c17af3093e51..a5cd8a92003c 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -7917,11 +7917,6 @@ public class WindowManagerService extends IWindowManager.Stub
}
@Override
- public boolean hasNavigationBar(int displayId) {
- return WindowManagerService.this.hasNavigationBar(displayId);
- }
-
- @Override
public boolean isHardKeyboardAvailable() {
synchronized (mGlobalLock) {
return mHardKeyboardAvailable;