Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 72285e56 authored by Tim Kilbourn's avatar Tim Kilbourn
Browse files

API review: Update hasMic to hasMicrophone.

Also make the SearchEvent constructor available for testing.

Bug: 21572283
Bug: 21572676
Change-Id: I35cfd88b45aeb97b6ccf83aeb46b0ecc4bbc0947
parent 2ea838d5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -34879,7 +34879,7 @@ package android.view {
    method public int getVendorId();
    method public android.os.Vibrator getVibrator();
    method public boolean[] hasKeys(int...);
    method public boolean hasMic();
    method public boolean hasMicrophone();
    method public boolean isVirtual();
    method public boolean supportsSource(int);
    method public void writeToParcel(android.os.Parcel, int);
@@ -35770,6 +35770,7 @@ package android.view {
  }
  public class SearchEvent {
    ctor public SearchEvent(android.view.InputDevice);
    method public android.view.InputDevice getInputDevice();
  }
+2 −1
Original line number Diff line number Diff line
@@ -37144,7 +37144,7 @@ package android.view {
    method public int getVendorId();
    method public android.os.Vibrator getVibrator();
    method public boolean[] hasKeys(int...);
    method public boolean hasMic();
    method public boolean hasMicrophone();
    method public boolean isVirtual();
    method public boolean supportsSource(int);
    method public void writeToParcel(android.os.Parcel, int);
@@ -38035,6 +38035,7 @@ package android.view {
  }
  public class SearchEvent {
    ctor public SearchEvent(android.view.InputDevice);
    method public android.view.InputDevice getInputDevice();
  }
+8 −8
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ public final class InputDevice implements Parcelable {
    private final int mKeyboardType;
    private final KeyCharacterMap mKeyCharacterMap;
    private final boolean mHasVibrator;
    private final boolean mHasMic;
    private final boolean mHasMicrophone;
    private final boolean mHasButtonUnderPad;
    private final ArrayList<MotionRange> mMotionRanges = new ArrayList<MotionRange>();

@@ -358,7 +358,7 @@ public final class InputDevice implements Parcelable {
    // Called by native code.
    private InputDevice(int id, int generation, int controllerNumber, String name, int vendorId,
            int productId, String descriptor, boolean isExternal, int sources, int keyboardType,
            KeyCharacterMap keyCharacterMap, boolean hasVibrator, boolean hasMic,
            KeyCharacterMap keyCharacterMap, boolean hasVibrator, boolean hasMicrophone,
            boolean hasButtonUnderPad) {
        mId = id;
        mGeneration = generation;
@@ -372,7 +372,7 @@ public final class InputDevice implements Parcelable {
        mKeyboardType = keyboardType;
        mKeyCharacterMap = keyCharacterMap;
        mHasVibrator = hasVibrator;
        mHasMic = hasMic;
        mHasMicrophone = hasMicrophone;
        mHasButtonUnderPad = hasButtonUnderPad;
        mIdentifier = new InputDeviceIdentifier(descriptor, vendorId, productId);
    }
@@ -390,7 +390,7 @@ public final class InputDevice implements Parcelable {
        mKeyboardType = in.readInt();
        mKeyCharacterMap = KeyCharacterMap.CREATOR.createFromParcel(in);
        mHasVibrator = in.readInt() != 0;
        mHasMic = in.readInt() != 0;
        mHasMicrophone = in.readInt() != 0;
        mHasButtonUnderPad = in.readInt() != 0;
        mIdentifier = new InputDeviceIdentifier(mDescriptor, mVendorId, mProductId);

@@ -723,8 +723,8 @@ public final class InputDevice implements Parcelable {
     * Reports whether the device has a built-in microphone.
     * @return Whether the device has a built-in microphone.
     */
    public boolean hasMic() {
        return mHasMic;
    public boolean hasMicrophone() {
        return mHasMicrophone;
    }

    /**
@@ -861,7 +861,7 @@ public final class InputDevice implements Parcelable {
        out.writeInt(mKeyboardType);
        mKeyCharacterMap.writeToParcel(out, flags);
        out.writeInt(mHasVibrator ? 1 : 0);
        out.writeInt(mHasMic ? 1 : 0);
        out.writeInt(mHasMicrophone ? 1 : 0);
        out.writeInt(mHasButtonUnderPad ? 1 : 0);

        final int numRanges = mMotionRanges.size();
@@ -907,7 +907,7 @@ public final class InputDevice implements Parcelable {

        description.append("  Has Vibrator: ").append(mHasVibrator).append("\n");

        description.append("  Has mic: ").append(mHasMic).append("\n");
        description.append("  Has mic: ").append(mHasMicrophone).append("\n");

        description.append("  Sources: 0x").append(Integer.toHexString(mSources)).append(" (");
        appendSourceDescriptionIfApplicable(description, SOURCE_KEYBOARD, "keyboard");
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ public class SearchEvent {

    private InputDevice mInputDevice;

    /** @hide */
    /** Create a new search event. */
    public SearchEvent(InputDevice inputDevice) {
        mInputDevice = inputDevice;
    }