Rename pointer-related members to be more specific.

mIcon / mIconType weren't specific enough to be immediately related to
pointer icons. Rename them just to make that connection more obvious.

Bug: 254277939
Test: simple IDE-assisted refactor
Change-Id: Iffe3dd9a7bc2a8166ec411ff6b2f9c8c4d74738d
This commit is contained in:
Michael Wright
2022-10-22 01:09:59 +01:00
parent 002f60d745
commit 4a18c3e9b1

View File

@@ -303,9 +303,9 @@ public class InputManagerService extends IInputManager.Stub
private final AdditionalDisplayInputProperties mCurrentDisplayProperties =
new AdditionalDisplayInputProperties();
@GuardedBy("mAdditionalDisplayInputPropertiesLock")
private int mIconType = PointerIcon.TYPE_NOT_SPECIFIED;
private int mPointerIconType = PointerIcon.TYPE_NOT_SPECIFIED;
@GuardedBy("mAdditionalDisplayInputPropertiesLock")
private PointerIcon mIcon;
private PointerIcon mPointerIcon;
// Holds all the registered gesture monitors that are implemented as spy windows. The spy
// windows are mapped by their InputChannel tokens.
@@ -2326,12 +2326,12 @@ public class InputManagerService extends IInputManager.Stub
throw new IllegalArgumentException("Use setCustomPointerIcon to set custom pointers");
}
synchronized (mAdditionalDisplayInputPropertiesLock) {
mIcon = null;
mIconType = iconType;
mPointerIcon = null;
mPointerIconType = iconType;
if (!mCurrentDisplayProperties.pointerIconVisible) return;
mNative.setPointerIconType(mIconType);
mNative.setPointerIconType(mPointerIconType);
}
}
@@ -2340,12 +2340,12 @@ public class InputManagerService extends IInputManager.Stub
public void setCustomPointerIcon(PointerIcon icon) {
Objects.requireNonNull(icon);
synchronized (mAdditionalDisplayInputPropertiesLock) {
mIconType = PointerIcon.TYPE_CUSTOM;
mIcon = icon;
mPointerIconType = PointerIcon.TYPE_CUSTOM;
mPointerIcon = icon;
if (!mCurrentDisplayProperties.pointerIconVisible) return;
mNative.setCustomPointerIcon(mIcon);
mNative.setCustomPointerIcon(mPointerIcon);
}
}
@@ -3846,11 +3846,11 @@ public class InputManagerService extends IInputManager.Stub
if (properties.pointerIconVisible != mCurrentDisplayProperties.pointerIconVisible) {
mCurrentDisplayProperties.pointerIconVisible = properties.pointerIconVisible;
if (properties.pointerIconVisible) {
if (mIconType == PointerIcon.TYPE_CUSTOM) {
Objects.requireNonNull(mIcon);
mNative.setCustomPointerIcon(mIcon);
if (mPointerIconType == PointerIcon.TYPE_CUSTOM) {
Objects.requireNonNull(mPointerIcon);
mNative.setCustomPointerIcon(mPointerIcon);
} else {
mNative.setPointerIconType(mIconType);
mNative.setPointerIconType(mPointerIconType);
}
} else {
mNative.setPointerIconType(PointerIcon.TYPE_NULL);