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

Commit 338f27ab authored by Paul McLean's avatar Paul McLean
Browse files

New policy for internal and wired device names.

For internal and unknowable wired devices, return the product name (i.e. "Nexus 7").
For connected devices with manufacturer-supplied product names, return those.
Change getName() to getProductName().

Bug: 20880296
Change-Id: I67ef3d4c73b3acab368b0879faa26fa9127c21bb
parent 20eec5bb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -14696,7 +14696,7 @@ package android.media {
    method public int[] getChannelMasks();
    method public int[] getFormats();
    method public int getId();
    method public java.lang.CharSequence getName();
    method public java.lang.CharSequence getProductName();
    method public int[] getSampleRates();
    method public int getType();
    method public boolean isSink();
+1 −1
Original line number Diff line number Diff line
@@ -15906,7 +15906,7 @@ package android.media {
    method public int[] getChannelMasks();
    method public int[] getFormats();
    method public int getId();
    method public java.lang.CharSequence getName();
    method public java.lang.CharSequence getProductName();
    method public int[] getSampleRates();
    method public int getType();
    method public boolean isSink();
+3 −2
Original line number Diff line number Diff line
@@ -121,8 +121,9 @@ public final class AudioDeviceInfo {
    /**
     * @return The human-readable name of the audio device.
     */
    public CharSequence getName() {
        return mPort.name();
    public CharSequence getProductName() {
        String portName = mPort.name();
        return portName.length() != 0 ? portName : android.os.Build.MODEL;
    }

    /**
+2 −2
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {

        Log.i(TAG, "MSG_NEW_DEVICE_STATE");
        Message msg = mHandler.obtainMessage(MSG_NEW_DEVICE_STATE, headsetState,
                mHeadsetState, newName);
                mHeadsetState, "");
        mHandler.sendMessage(msg);

        mHeadsetState = headsetState;