<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic AudioDeviceInfo Bug Report in XZ Series</title>
    <link>https://community.sony.com.mk/t5/xz-series/audiodeviceinfo-bug-report/m-p/3622312#M45268</link>
    <description>&lt;P&gt;I've tested my device XZ.&lt;/P&gt;&lt;P&gt;Sony XZ have some problem in dectecting audio source.&lt;/P&gt;&lt;P&gt;My test code is below&lt;/P&gt;&lt;P&gt;audioDeviceInfo.getType() is&amp;nbsp;always return 1&lt;/P&gt;&lt;P&gt;(see the reference. that means "TYPE_BUILTIN_EARPIECE")&lt;/P&gt;&lt;PRE&gt; for (int i = 0; i &amp;lt;devices.length; i++)  {
                AudioDeviceInfo device = devices[i];
                Log.d("csl", "isHeadsetOn:　device type　"+device.getType());
 }&lt;/PRE&gt;&lt;P&gt;So, Mabe you should check your firmware.&lt;/P&gt;&lt;P&gt;In normal case,&lt;/P&gt;&lt;P&gt;when we plug&amp;nbsp;in a earphone, it should return 4 (TYPE_WIRED_HEADPHONES)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when we plug &amp;nbsp;in a headset(earphone with microphone), it should return 3 (TYPE_WIRED_HEADSET&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when we&amp;nbsp;connect with Bluetooth,&amp;nbsp;&amp;nbsp;it should return 7 or 8 (TYPE_BLUETOOTH_SCO / TYPE_BLUETOOTH_A2DP )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when we don't plug&amp;nbsp;in anything, it should return 2 (TYPE_BUILTIN_SPEAKER)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;By the way,&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;I guess the situation is same in XZ2 / XZ3....&lt;/P&gt;&lt;P&gt;Those are your&amp;nbsp;Flagship models.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a little funny there are some problem in your&amp;nbsp;&lt;SPAN&gt;Flagship&amp;nbsp;models.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;They should be best!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There are so many user reports since 2015 say that&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Microphone is not working when set the speaker on"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(That means the other guy couldn't listen my voice)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;App programers have to reset the speaker automatically so that the microphone could be normal.&lt;/P&gt;&lt;P&gt;I guess that there are also some problem in your&amp;nbsp;"AudioRecord" firmware.&lt;/P&gt;&lt;P&gt;Try to take a good look at your audio-related firmware from beginning to end.&lt;/P&gt;&lt;PRE&gt;  AudioManager am = (AudioManager) self.getSystemService(Context.AUDIO_SERVICE);
                    if (am != null) {
                        am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
                        am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
                        am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
                        am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
                    }&lt;/PRE&gt;&lt;P&gt;Reference&lt;/P&gt;&lt;P&gt;1. Android&amp;nbsp; official site&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.android.com/reference/android/media/AudioDeviceInfo" target="_self" rel="nofollow noopener noreferrer"&gt;https://developer.android.com/reference/android/media/AudioDeviceInfo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2.. Android&amp;nbsp; AudioDeviceInfo class&lt;/P&gt;&lt;PRE&gt; /**
     * A device type describing the attached earphone speaker.
     */
    public static final int TYPE_BUILTIN_EARPIECE = 1;
    /**
     * A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built
     * in a device.
     */
    public static final int TYPE_BUILTIN_SPEAKER  = 2;
    /**
     * A device type describing a headset, which is the combination of a headphones and microphone.
     */
    public static final int TYPE_WIRED_HEADSET    = 3;
    /**
     * A device type describing a pair of wired headphones.
     */
    public static final int TYPE_WIRED_HEADPHONES = 4;
    /**
     * A device type describing an analog line-level connection.
     */&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Dec 2018 09:23:35 GMT</pubDate>
    <dc:creator>ChangSung</dc:creator>
    <dc:date>2018-12-20T09:23:35Z</dc:date>
    <item>
      <title>AudioDeviceInfo Bug Report</title>
      <link>https://community.sony.com.mk/t5/xz-series/audiodeviceinfo-bug-report/m-p/3622312#M45268</link>
      <description>&lt;P&gt;I've tested my device XZ.&lt;/P&gt;&lt;P&gt;Sony XZ have some problem in dectecting audio source.&lt;/P&gt;&lt;P&gt;My test code is below&lt;/P&gt;&lt;P&gt;audioDeviceInfo.getType() is&amp;nbsp;always return 1&lt;/P&gt;&lt;P&gt;(see the reference. that means "TYPE_BUILTIN_EARPIECE")&lt;/P&gt;&lt;PRE&gt; for (int i = 0; i &amp;lt;devices.length; i++)  {
                AudioDeviceInfo device = devices[i];
                Log.d("csl", "isHeadsetOn:　device type　"+device.getType());
 }&lt;/PRE&gt;&lt;P&gt;So, Mabe you should check your firmware.&lt;/P&gt;&lt;P&gt;In normal case,&lt;/P&gt;&lt;P&gt;when we plug&amp;nbsp;in a earphone, it should return 4 (TYPE_WIRED_HEADPHONES)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when we plug &amp;nbsp;in a headset(earphone with microphone), it should return 3 (TYPE_WIRED_HEADSET&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when we&amp;nbsp;connect with Bluetooth,&amp;nbsp;&amp;nbsp;it should return 7 or 8 (TYPE_BLUETOOTH_SCO / TYPE_BLUETOOTH_A2DP )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;when we don't plug&amp;nbsp;in anything, it should return 2 (TYPE_BUILTIN_SPEAKER)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;By the way,&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;P&gt;I guess the situation is same in XZ2 / XZ3....&lt;/P&gt;&lt;P&gt;Those are your&amp;nbsp;Flagship models.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a little funny there are some problem in your&amp;nbsp;&lt;SPAN&gt;Flagship&amp;nbsp;models.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;They should be best!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There are so many user reports since 2015 say that&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Microphone is not working when set the speaker on"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(That means the other guy couldn't listen my voice)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;App programers have to reset the speaker automatically so that the microphone could be normal.&lt;/P&gt;&lt;P&gt;I guess that there are also some problem in your&amp;nbsp;"AudioRecord" firmware.&lt;/P&gt;&lt;P&gt;Try to take a good look at your audio-related firmware from beginning to end.&lt;/P&gt;&lt;PRE&gt;  AudioManager am = (AudioManager) self.getSystemService(Context.AUDIO_SERVICE);
                    if (am != null) {
                        am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
                        am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
                        am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
                        am.setSpeakerphoneOn(!am.isSpeakerphoneOn());
                    }&lt;/PRE&gt;&lt;P&gt;Reference&lt;/P&gt;&lt;P&gt;1. Android&amp;nbsp; official site&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.android.com/reference/android/media/AudioDeviceInfo" target="_self" rel="nofollow noopener noreferrer"&gt;https://developer.android.com/reference/android/media/AudioDeviceInfo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2.. Android&amp;nbsp; AudioDeviceInfo class&lt;/P&gt;&lt;PRE&gt; /**
     * A device type describing the attached earphone speaker.
     */
    public static final int TYPE_BUILTIN_EARPIECE = 1;
    /**
     * A device type describing the speaker system (i.e. a mono speaker or stereo speakers) built
     * in a device.
     */
    public static final int TYPE_BUILTIN_SPEAKER  = 2;
    /**
     * A device type describing a headset, which is the combination of a headphones and microphone.
     */
    public static final int TYPE_WIRED_HEADSET    = 3;
    /**
     * A device type describing a pair of wired headphones.
     */
    public static final int TYPE_WIRED_HEADPHONES = 4;
    /**
     * A device type describing an analog line-level connection.
     */&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Dec 2018 09:23:35 GMT</pubDate>
      <guid>https://community.sony.com.mk/t5/xz-series/audiodeviceinfo-bug-report/m-p/3622312#M45268</guid>
      <dc:creator>ChangSung</dc:creator>
      <dc:date>2018-12-20T09:23:35Z</dc:date>
    </item>
  </channel>
</rss>

