From 0c89829720cb36d051b1d49384f5d91048145b30 Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Tue, 13 Sep 2022 21:42:51 +0000 Subject: [PATCH] Clean up some input interfaces Make NativeInputManagerService package-private and remove the @VisibleForTesting annotation, and update the annotation ordering in the methods of BatteryState and InputDevice. Bug: 245989146 Test: Build Change-Id: I6ea839fac8037c2dd77037aed0d05b0f92ea43e3 --- core/java/android/hardware/BatteryState.java | 6 ++++-- core/java/android/view/InputDevice.java | 6 ++++-- .../com/android/server/input/NativeInputManagerService.java | 5 +---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/core/java/android/hardware/BatteryState.java b/core/java/android/hardware/BatteryState.java index aa7535982452a..956fefca1f411 100644 --- a/core/java/android/hardware/BatteryState.java +++ b/core/java/android/hardware/BatteryState.java @@ -62,7 +62,8 @@ public abstract class BatteryState { * * @return the battery status. */ - public abstract @BatteryStatus int getStatus(); + @BatteryStatus + public abstract int getStatus(); /** * Get remaining battery capacity as float percentage [0.0f, 1.0f] of total capacity @@ -70,5 +71,6 @@ public abstract class BatteryState { * * @return the battery capacity. */ - public abstract @FloatRange(from = -1.0f, to = 1.0f) float getCapacity(); + @FloatRange(from = -1.0f, to = 1.0f) + public abstract float getCapacity(); } diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index 38911e07eb641..42c37fd97213f 100644 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java @@ -1072,7 +1072,8 @@ public final class InputDevice implements Parcelable { * * @return The lights manager associated with the device, never null. */ - public @NonNull LightsManager getLightsManager() { + @NonNull + public LightsManager getLightsManager() { if (mLightsManager == null) { mLightsManager = InputManager.getInstance().getInputDeviceLightsManager(mId); } @@ -1090,7 +1091,8 @@ public final class InputDevice implements Parcelable { * * @return The sensor manager service associated with the device, never null. */ - public @NonNull SensorManager getSensorManager() { + @NonNull + public SensorManager getSensorManager() { synchronized (mMotionRanges) { if (mSensorManager == null) { mSensorManager = InputManager.getInstance().getInputDeviceSensorManager(mId); diff --git a/services/core/java/com/android/server/input/NativeInputManagerService.java b/services/core/java/com/android/server/input/NativeInputManagerService.java index 6b568b74c4055..63c0a88bf4678 100644 --- a/services/core/java/com/android/server/input/NativeInputManagerService.java +++ b/services/core/java/com/android/server/input/NativeInputManagerService.java @@ -29,16 +29,13 @@ import android.view.InputEvent; import android.view.PointerIcon; import android.view.VerifiedInputEvent; -import com.android.internal.annotations.VisibleForTesting; - import java.util.List; /** * An interface for the native methods of InputManagerService. We use a public interface so that * this can be mocked for testing by Mockito. */ -@VisibleForTesting -public interface NativeInputManagerService { +interface NativeInputManagerService { void start();