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

Commit 087238d4 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "framework:Thread synchronization for UI update"

parents 6c460b65 425980dd
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -855,8 +855,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
            if (!mHasTelephony) return;
            final boolean inAirplaneMode = serviceState.getState() == ServiceState.STATE_POWER_OFF;
            mAirplaneState = inAirplaneMode ? ToggleAction.State.On : ToggleAction.State.Off;
            mAirplaneModeOn.updateState(mAirplaneState);
            mAdapter.notifyDataSetChanged();
            mHandler.sendEmptyMessage(MESSAGE_REFRESH_AIRPLANEMODE);
        }
    };

@@ -879,6 +878,7 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
    private static final int MESSAGE_DISMISS = 0;
    private static final int MESSAGE_REFRESH = 1;
    private static final int MESSAGE_SHOW = 2;
    private static final int MESSAGE_REFRESH_AIRPLANEMODE = 3;
    private static final int DIALOG_DISMISS_DELAY = 300; // ms

    private Handler mHandler = new Handler() {
@@ -896,6 +896,10 @@ class GlobalActions implements DialogInterface.OnDismissListener, DialogInterfac
            case MESSAGE_SHOW:
                handleShow();
                break;
            case MESSAGE_REFRESH_AIRPLANEMODE:
                mAirplaneModeOn.updateState(mAirplaneState);
                mAdapter.notifyDataSetChanged();
                break;
            }
        }
    };