am e9eb58c9: Merge "Add InputDevice#supportsSource(int)." into klp-modular-dev
* commit 'e9eb58c9a0f48f1ea3afa60f01cfab1f539e5d8e': Add InputDevice#supportsSource(int).
This commit is contained in:
@@ -26687,6 +26687,7 @@ package android.view {
|
|||||||
method public android.os.Vibrator getVibrator();
|
method public android.os.Vibrator getVibrator();
|
||||||
method public boolean[] hasKeys(int...);
|
method public boolean[] hasKeys(int...);
|
||||||
method public boolean isVirtual();
|
method public boolean isVirtual();
|
||||||
|
method public boolean supportsSource(int);
|
||||||
method public void writeToParcel(android.os.Parcel, int);
|
method public void writeToParcel(android.os.Parcel, int);
|
||||||
field public static final android.os.Parcelable.Creator CREATOR;
|
field public static final android.os.Parcelable.Creator CREATOR;
|
||||||
field public static final int KEYBOARD_TYPE_ALPHABETIC = 2; // 0x2
|
field public static final int KEYBOARD_TYPE_ALPHABETIC = 2; // 0x2
|
||||||
|
|||||||
@@ -578,6 +578,18 @@ public final class InputDevice implements Parcelable {
|
|||||||
return mSources;
|
return mSources;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines whether the input device supports the given source or sources.
|
||||||
|
*
|
||||||
|
* @param source The input source or sources to check against. This can be a generic device
|
||||||
|
* type such as {@link InputDevice#SOURCE_MOUSE}, a more generic device class, such as
|
||||||
|
* {@link InputDevice#SOURCE_CLASS_POINTER}, or a combination of sources bitwise ORed together.
|
||||||
|
* @return Whether the device can produce all of the given sources.
|
||||||
|
*/
|
||||||
|
public boolean supportsSource(int source) {
|
||||||
|
return (mSources & source) == source;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the keyboard type.
|
* Gets the keyboard type.
|
||||||
* @return The keyboard type.
|
* @return The keyboard type.
|
||||||
|
|||||||
Reference in New Issue
Block a user