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

Commit 6982b3ad authored by Benson Huang's avatar Benson Huang Committed by Leo Wang
Browse files

[FM] FM radio "Plug in headphones" view will flash twice after plugging...

    [FM] FM radio "Plug in headphones" view will flash twice after plugging out headphones while searching

    First time launch FM and play a station -> Tap Radio
    Station button -> Plug out headphone while searching
    station -> Check the display, "Plug in headphones" view
    will flash twice.

    When plugging out earphone in Radio Station screen, it's
    no need to start animation to show no earphone view. Just
    show no earphone view.

    Bug 18780139

    Review: https://partner-android-review.git.corp.google.com/#/c/189538



    Signed-off-by: default avatarBenson Huang <benson.huang@mediatek.com>

Change-Id: I4cad7ca328f40057a14823db04d53868fe3867f3
parent dc76ad07
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -245,10 +245,18 @@ public class FmMainActivity extends Activity implements FmFavoriteEditDialog.Edi
                    boolean hasAntenna = bundle.getBoolean(FmListener.KEY_IS_SWITCH_ANTENNA);
                    // if receive headset plug out, need set headset mode on ui
                    if (hasAntenna) {
                        if (mIsActivityForeground) {
                            playMainAnimation();
                        } else {
                            changeToMainLayout();
                        }
                    } else {
                        mMenuItemHeadset.setIcon(R.drawable.btn_fm_headset_selector);
                        if (mIsActivityForeground) {
                            playNoHeadsetAnimation();
                        } else {
                            changeToNoHeadsetLayout();
                        }
                    }
                    break;

@@ -1144,10 +1152,6 @@ public class FmMainActivity extends Activity implements FmFavoriteEditDialog.Edi
            Log.e(TAG, "playMainAnimation, mService is null");
            return;
        }
        if (!mService.isActivityForeground()) {
            Log.e(TAG, "playMainAnimation, activity is background");
            return;
        }
        if (mMainLayout.isShown()) {
            Log.w(TAG, "playMainAnimation, main layout has already shown");
            return;
@@ -1171,10 +1175,6 @@ public class FmMainActivity extends Activity implements FmFavoriteEditDialog.Edi
            Log.e(TAG, "playNoHeadsetAnimation, mService is null");
            return;
        }
        if (!mService.isActivityForeground()) {
            Log.e(TAG, "playNoHeadsetAnimation, activity is background");
            return;
        }
        if (mNoHeadsetLayout.isShown()) {
            Log.w(TAG,"playNoHeadsetAnimation, no headset layout has already shown");
            return;