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

Commit ab363e83 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "QS: Unavailable cleanup"

parents cf08edf4 e2f05d23
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.graphics.drawable.RippleDrawable;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.service.quicksettings.Tile;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
@@ -110,7 +111,6 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {

    public void init(OnClickListener click, OnClickListener secondaryClick,
            OnLongClickListener longClick) {
        setClickable(true);
        setOnClickListener(click);
        setOnLongClickListener(longClick);
    }
@@ -148,6 +148,7 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
    }

    protected void handleStateChanged(QSTile.State state) {
        setClickable(state.state != Tile.STATE_UNAVAILABLE);
        mIcon.setIcon(state);
        setContentDescription(state.contentDescription);
        mAccessibilityClass = state.expandedAccessibilityClassName;
@@ -156,6 +157,12 @@ public class QSTileBaseView extends com.android.systemui.plugins.qs.QSTileView {
        }
    }

    @Override
    public void setClickable(boolean clickable) {
        super.setClickable(clickable);
        setBackground(clickable ? mRipple : null);
    }

    @Override
    public int getDetailY() {
        return getTop() + getHeight() / 2;
+2 −1
Original line number Diff line number Diff line
@@ -137,7 +137,8 @@ public class CellularTile extends QSTileImpl<SignalState> {
        state.expandedAccessibilityClassName = Switch.class.getName();
        state.value = mDataController.isMobileDataSupported()
                && mDataController.isMobileDataEnabled();
        state.state = state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
        state.state = cb.airplaneModeEnabled ? Tile.STATE_UNAVAILABLE
                : state.value ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
    }

    @Override