diff --git a/src/co/aospa/systemui/qs/tiles/BluetoothDialogTile.java b/src/co/aospa/systemui/qs/tiles/BluetoothDialogTile.java index 75c5f27..c8c47ec 100644 --- a/src/co/aospa/systemui/qs/tiles/BluetoothDialogTile.java +++ b/src/co/aospa/systemui/qs/tiles/BluetoothDialogTile.java @@ -40,6 +40,7 @@ import com.android.systemui.qs.QSHost; import com.android.systemui.qs.logging.QSLogger; import com.android.systemui.qs.tiles.BluetoothTile; import com.android.systemui.statusbar.policy.BluetoothController; +import com.android.systemui.statusbar.policy.KeyguardStateController; import co.aospa.systemui.qs.tiles.dialog.BluetoothDialogFactory; @@ -63,10 +64,11 @@ public class BluetoothDialogTile extends BluetoothTile { ActivityStarter activityStarter, QSLogger qsLogger, BluetoothController bluetoothController, - BluetoothDialogFactory bluetoothDialogFactory + BluetoothDialogFactory bluetoothDialogFactory, + KeyguardStateController keyguardStateController ) { super(host, backgroundLooper, mainHandler, falsingManager, metricsLogger, - statusBarStateController, activityStarter, qsLogger, bluetoothController); + statusBarStateController, activityStarter, qsLogger, bluetoothController, keyguardStateController); mHandler = mainHandler; mBluetoothDialogFactory = bluetoothDialogFactory; } @@ -79,7 +81,10 @@ public class BluetoothDialogTile extends BluetoothTile { } @Override - protected void handleClick(@Nullable View view) { + protected void handleClick(@Nullable View view, boolean keyguardShowing) { + if (checkKeyguard(view, keyguardShowing)) { + return; + } mHandler.post(() -> mBluetoothDialogFactory.create(true, view)); } } diff --git a/src/co/aospa/systemui/qs/tiles/CellularTile.java b/src/co/aospa/systemui/qs/tiles/CellularTile.java index 09320be..a70474d 100644 --- a/src/co/aospa/systemui/qs/tiles/CellularTile.java +++ b/src/co/aospa/systemui/qs/tiles/CellularTile.java @@ -54,6 +54,7 @@ import com.android.systemui.qs.QSHost; import com.android.systemui.qs.SignalTileView; import com.android.systemui.qs.logging.QSLogger; import com.android.systemui.qs.tileimpl.QSTileImpl; +import com.android.systemui.qs.tiles.SecureQSTile; import com.android.systemui.statusbar.connectivity.IconState; import com.android.systemui.statusbar.connectivity.MobileDataIndicators; import com.android.systemui.statusbar.connectivity.NetworkController; @@ -64,7 +65,7 @@ import com.android.systemui.statusbar.policy.KeyguardStateController; import javax.inject.Inject; /** Quick settings tile: Cellular **/ -public class CellularTile extends QSTileImpl { +public class CellularTile extends SecureQSTile { public static final String TILE_SPEC = "cell"; @@ -90,7 +91,7 @@ public class CellularTile extends QSTileImpl { ) { super(host, backgroundLooper, mainHandler, falsingManager, metricsLogger, - statusBarStateController, activityStarter, qsLogger); + statusBarStateController, activityStarter, qsLogger, keyguardStateController); mController = networkController; mKeyguard = keyguardStateController; mDataController = mController.getMobileDataController(); @@ -116,7 +117,11 @@ public class CellularTile extends QSTileImpl { } @Override - protected void handleClick(@Nullable View view) { + protected void handleClick(@Nullable View view, boolean keyguardShowing) { + if (checkKeyguard(view, keyguardShowing)) { + return; + } + if (getState().state == Tile.STATE_UNAVAILABLE) { return; } diff --git a/src/co/aospa/systemui/qs/tiles/WifiTile.java b/src/co/aospa/systemui/qs/tiles/WifiTile.java index 5ae42cb..e450a90 100644 --- a/src/co/aospa/systemui/qs/tiles/WifiTile.java +++ b/src/co/aospa/systemui/qs/tiles/WifiTile.java @@ -48,16 +48,18 @@ import com.android.systemui.qs.QSHost; import com.android.systemui.qs.logging.QSLogger; import com.android.systemui.qs.tileimpl.QSIconViewImpl; import com.android.systemui.qs.tileimpl.QSTileImpl; +import com.android.systemui.qs.tiles.SecureQSTile; import com.android.systemui.statusbar.connectivity.AccessPointController; import com.android.systemui.statusbar.connectivity.NetworkController; import com.android.systemui.statusbar.connectivity.SignalCallback; import com.android.systemui.statusbar.connectivity.WifiIcons; import com.android.systemui.statusbar.connectivity.WifiIndicators; +import com.android.systemui.statusbar.policy.KeyguardStateController; import javax.inject.Inject; /** Quick settings tile: Wifi **/ -public class WifiTile extends QSTileImpl { +public class WifiTile extends SecureQSTile { public static final String TILE_SPEC = "wifi"; @@ -81,10 +83,11 @@ public class WifiTile extends QSTileImpl { ActivityStarter activityStarter, QSLogger qsLogger, NetworkController networkController, - AccessPointController accessPointController + AccessPointController accessPointController, + KeyguardStateController keyguardStateController ) { super(host, backgroundLooper, mainHandler, falsingManager, metricsLogger, - statusBarStateController, activityStarter, qsLogger); + statusBarStateController, activityStarter, qsLogger, keyguardStateController); mController = networkController; mWifiController = accessPointController; mController.observe(getLifecycle(), mSignalCallback); @@ -107,7 +110,11 @@ public class WifiTile extends QSTileImpl { } @Override - protected void handleClick(@Nullable View view) { + protected void handleClick(@Nullable View view, boolean keyguardShowing) { + if (checkKeyguard(view, keyguardShowing)) { + return; + } + // Secondary clicks are header clicks, just toggle. mState.copyTo(mStateBeforeClick); boolean wifiEnabled = mState.value;