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

Commit cb5daff5 authored by yuemingw's avatar yuemingw
Browse files

Disable airplane mode quick settings when disallow_airplane_mode is set.

Bug: 67628870
Test: manual
Change-Id: I701c58c1e4c3749e49adf2b86c7da94c8dab38db
parent 0d64cd33
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.os.UserManager;
import android.provider.Settings;
import android.provider.Settings.Global;
import android.service.quicksettings.Tile;
@@ -82,6 +83,7 @@ public class AirplaneModeTile extends QSTileImpl<BooleanState> {

    @Override
    protected void handleUpdateState(BooleanState state, Object arg) {
        checkIfRestrictionEnforcedByAdminOnly(state, UserManager.DISALLOW_AIRPLANE_MODE);
        final int value = arg instanceof Integer ? (Integer)arg : mSetting.getValue();
        final boolean airplaneMode = value != 0;
        state.value = airplaneMode;