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
This commit is contained in:
Prabir Pradhan
2022-09-13 21:42:51 +00:00
parent 4fb7c87f8b
commit 0c89829720
3 changed files with 9 additions and 8 deletions

View File

@@ -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();
}

View File

@@ -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);

View File

@@ -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();