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

Commit c1d2761c authored by André Rivotti Casimiro's avatar André Rivotti Casimiro Committed by Brint E. Kriebel
Browse files

improve audio startup performace

Create the needed audio patches as soon as possible, executing the visual
transition only after they are created.

Change-Id: Ic4ac4bb146836cb17ff144652b8f2d0f8dd612a9
(cherry picked from commit a67c9fcf)
Ticket: CRAB-38
parent 944e0277
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -270,12 +270,12 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan
            } else if (Intent.ACTION_HEADSET_PLUG.equals(action)) {
                // switch antenna should not impact audio focus status
                mValueHeadSetPlug = (intent.getIntExtra("state", -1) == HEADSET_PLUG_IN) ? 0 : 1;
                switchAntennaAsync(mValueHeadSetPlug);

                // Avoid Service is killed,and receive headset plug in
                // broadcast again
                if (!mIsServiceInited) {
                    Log.d(TAG, "onReceive, mIsServiceInited is false");
                    switchAntennaAsync(mValueHeadSetPlug);
                    return;
                }
                /*
@@ -305,6 +305,8 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan
                    bundle.putBoolean(FmListener.KEY_IS_SPEAKER_MODE, false);
                    notifyActivityStateChanged(bundle);
                }

                switchAntennaAsync(mValueHeadSetPlug);
            }
        }
    }