7

Hy everybody, I have a problem with Audio Manager on Huawei phones. I have an app, which can route the voice of calls to earpiece or loudspeaker from bluetooth headset during the call. It works fine on all of the phones except Huawei phones. I added all permissons what is needed. Anybody have similar situation?

<permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" android:protectionLevel="signature"/>
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
    <uses-permission android:name="android.permission.PROCESS_INCOMING_CALLS" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

This part of code does not do anything on Huawei. A tried try/catch, but no exception comes.

   private static void switch_to_earpiece () {
        m_amAudioManager = (AudioManager) fa.getSystemService(fa.AUDIO_SERVICE);
        m_amAudioManager.setMode(AudioManager.MODE_IN_CALL);
        m_amAudioManager.stopBluetoothSco();
        m_amAudioManager.setBluetoothScoOn(false);
        m_amAudioManager.setSpeakerphoneOn(false);
    }
opix
  • 71
  • 4

0 Answers0