InputMonitorCompat is no longer Parcelable
InputMonitorCompat is only instantiated directly now, so we can remove old code for passing it from SysUi through Parcelable. Test: compiles and runs locally Bug: 185266621 Change-Id: I54e394c1eb9c702beeb5bbfbae7a140c29530c33
This commit is contained in:
@@ -78,11 +78,6 @@ interface ISystemUiProxy {
|
||||
*/
|
||||
void startAssistant(in Bundle bundle) = 13;
|
||||
|
||||
/**
|
||||
* Creates a new gesture monitor
|
||||
*/
|
||||
Bundle monitorGestureInput(String name, int displayId) = 14;
|
||||
|
||||
/**
|
||||
* Notifies that the accessibility button in the system's navigation area has been clicked
|
||||
*/
|
||||
|
||||
@@ -16,10 +16,7 @@
|
||||
package com.android.systemui.shared.system;
|
||||
|
||||
import android.hardware.input.InputManager;
|
||||
import android.os.Bundle;
|
||||
import android.os.Looper;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.view.Choreographer;
|
||||
import android.view.InputMonitor;
|
||||
|
||||
@@ -29,9 +26,8 @@ import com.android.systemui.shared.system.InputChannelCompat.InputEventReceiver;
|
||||
/**
|
||||
* @see android.view.InputMonitor
|
||||
*/
|
||||
public class InputMonitorCompat implements Parcelable {
|
||||
public class InputMonitorCompat {
|
||||
private final InputMonitor mInputMonitor;
|
||||
private boolean mForReturn = false;
|
||||
|
||||
/**
|
||||
* Monitor input on the specified display for gestures.
|
||||
@@ -40,10 +36,6 @@ public class InputMonitorCompat implements Parcelable {
|
||||
mInputMonitor = InputManager.getInstance().monitorGestureInput(name, displayId);
|
||||
}
|
||||
|
||||
private InputMonitorCompat(InputMonitor monitor) {
|
||||
mInputMonitor = monitor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see InputMonitor#pilferPointers()
|
||||
*/
|
||||
@@ -66,48 +58,4 @@ public class InputMonitorCompat implements Parcelable {
|
||||
return new InputEventReceiver(mInputMonitor.getInputChannel(), looper, choreographer,
|
||||
listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the input monitor stored in a bundle
|
||||
*/
|
||||
public static InputMonitorCompat fromBundle(Bundle bundle, String key) {
|
||||
bundle.setClassLoader(InputMonitorCompat.class.getClassLoader());
|
||||
return (InputMonitorCompat) bundle.getParcelable(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the input monitor compat as the return value.
|
||||
*/
|
||||
public static InputMonitorCompat obtainReturnValue(InputMonitor monitor) {
|
||||
final InputMonitorCompat monitorCompat = new InputMonitorCompat(monitor);
|
||||
monitorCompat.mForReturn = true;
|
||||
return monitorCompat;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
mInputMonitor.writeToParcel(dest,
|
||||
mForReturn ? PARCELABLE_WRITE_RETURN_VALUE : flags);
|
||||
}
|
||||
|
||||
private InputMonitorCompat(Parcel in) {
|
||||
mInputMonitor = InputMonitor.CREATOR.createFromParcel(in);
|
||||
}
|
||||
|
||||
public static final Creator<InputMonitorCompat> CREATOR = new Creator<InputMonitorCompat>() {
|
||||
@Override
|
||||
public InputMonitorCompat createFromParcel(Parcel in) {
|
||||
return new InputMonitorCompat(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputMonitorCompat[] newArray(int size) {
|
||||
return new InputMonitorCompat[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,7 +38,6 @@ import java.util.StringJoiner;
|
||||
public class QuickStepContract {
|
||||
|
||||
public static final String KEY_EXTRA_SYSUI_PROXY = "extra_sysui_proxy";
|
||||
public static final String KEY_EXTRA_INPUT_MONITOR = "extra_input_monitor";
|
||||
public static final String KEY_EXTRA_WINDOW_CORNER_RADIUS = "extra_window_corner_radius";
|
||||
public static final String KEY_EXTRA_SUPPORTS_WINDOW_CORNERS = "extra_supports_window_corners";
|
||||
// See IPip.aidl
|
||||
|
||||
@@ -24,7 +24,6 @@ import static android.view.WindowManager.ScreenshotSource.SCREENSHOT_OVERVIEW;
|
||||
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON;
|
||||
|
||||
import static com.android.internal.accessibility.common.ShortcutConstants.CHOOSER_PACKAGE_NAME;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_INPUT_MONITOR;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_ONE_HANDED;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_PIP;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SHELL_SHELL_TRANSITIONS;
|
||||
@@ -62,7 +61,6 @@ import android.os.SystemClock;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.view.InputDevice;
|
||||
import android.view.InputMonitor;
|
||||
import android.view.KeyCharacterMap;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
@@ -89,7 +87,6 @@ import com.android.systemui.shared.recents.IOverviewProxy;
|
||||
import com.android.systemui.shared.recents.ISystemUiProxy;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||
import com.android.systemui.shared.system.InputMonitorCompat;
|
||||
import com.android.systemui.shared.system.QuickStepContract;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
@@ -357,24 +354,6 @@ public class OverviewProxyService extends CurrentUserTracker implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle monitorGestureInput(String name, int displayId) {
|
||||
if (!verifyCaller("monitorGestureInput")) {
|
||||
return null;
|
||||
}
|
||||
final long token = Binder.clearCallingIdentity();
|
||||
try {
|
||||
final InputMonitor monitor =
|
||||
InputManager.getInstance().monitorGestureInput(name, displayId);
|
||||
final Bundle result = new Bundle();
|
||||
result.putParcelable(KEY_EXTRA_INPUT_MONITOR,
|
||||
InputMonitorCompat.obtainReturnValue(monitor));
|
||||
return result;
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(token);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyAccessibilityButtonClicked(int displayId) {
|
||||
if (!verifyCaller("notifyAccessibilityButtonClicked")) {
|
||||
|
||||
Reference in New Issue
Block a user