Merge "Clean up some input interfaces"

This commit is contained in:
Prabir Pradhan
2022-09-14 18:56:41 +00:00
committed by Android (Google) Code Review
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();