Loading packages/SystemUI/src/com/android/systemui/qs/tiles/DeviceControlsTile.kt +5 −8 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.content.ComponentName import android.content.Intent import android.os.Handler import android.os.Looper import android.provider.Settings import android.service.quicksettings.Tile import android.view.View import com.android.internal.logging.MetricsLogger Loading Loading @@ -66,7 +65,6 @@ class DeviceControlsTile @Inject constructor( ) { private var hasControlsApps = AtomicBoolean(false) private val intent = Intent(Settings.ACTION_DEVICE_CONTROLS_SETTINGS) private val icon = ResourceIcon.get(R.drawable.ic_device_light) Loading @@ -91,13 +89,10 @@ class DeviceControlsTile @Inject constructor( override fun newTileState(): QSTile.State { return QSTile.State().also { it.state = Tile.STATE_UNAVAILABLE // Start unavailable matching `hasControlsApps` it.handlesLongClick = false } } override fun handleDestroy() { super.handleDestroy() } override fun handleClick(view: View?) { if (state.state == Tile.STATE_ACTIVE) { mUiHandler.post { Loading Loading @@ -138,10 +133,12 @@ class DeviceControlsTile @Inject constructor( return 0 } override fun getLongClickIntent(): Intent { return intent override fun getLongClickIntent(): Intent? { return null } override fun handleLongClick(view: View?) {} override fun getTileLabel(): CharSequence { return mContext.getText(R.string.quick_controls_title) } Loading packages/SystemUI/tests/src/com/android/systemui/qs/tiles/DeviceControlsTileTest.kt +6 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,12 @@ class DeviceControlsTileTest : SysuiTestCase() { @Test fun testLongClickIntent() { assertThat(tile.longClickIntent.action).isEqualTo(Settings.ACTION_DEVICE_CONTROLS_SETTINGS) assertThat(tile.longClickIntent).isNull() } @Test fun testDoesNotHandleLongClick() { assertThat(tile.state.handlesLongClick).isFalse() } @Test Loading Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/DeviceControlsTile.kt +5 −8 Original line number Diff line number Diff line Loading @@ -20,7 +20,6 @@ import android.content.ComponentName import android.content.Intent import android.os.Handler import android.os.Looper import android.provider.Settings import android.service.quicksettings.Tile import android.view.View import com.android.internal.logging.MetricsLogger Loading Loading @@ -66,7 +65,6 @@ class DeviceControlsTile @Inject constructor( ) { private var hasControlsApps = AtomicBoolean(false) private val intent = Intent(Settings.ACTION_DEVICE_CONTROLS_SETTINGS) private val icon = ResourceIcon.get(R.drawable.ic_device_light) Loading @@ -91,13 +89,10 @@ class DeviceControlsTile @Inject constructor( override fun newTileState(): QSTile.State { return QSTile.State().also { it.state = Tile.STATE_UNAVAILABLE // Start unavailable matching `hasControlsApps` it.handlesLongClick = false } } override fun handleDestroy() { super.handleDestroy() } override fun handleClick(view: View?) { if (state.state == Tile.STATE_ACTIVE) { mUiHandler.post { Loading Loading @@ -138,10 +133,12 @@ class DeviceControlsTile @Inject constructor( return 0 } override fun getLongClickIntent(): Intent { return intent override fun getLongClickIntent(): Intent? { return null } override fun handleLongClick(view: View?) {} override fun getTileLabel(): CharSequence { return mContext.getText(R.string.quick_controls_title) } Loading
packages/SystemUI/tests/src/com/android/systemui/qs/tiles/DeviceControlsTileTest.kt +6 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,12 @@ class DeviceControlsTileTest : SysuiTestCase() { @Test fun testLongClickIntent() { assertThat(tile.longClickIntent.action).isEqualTo(Settings.ACTION_DEVICE_CONTROLS_SETTINGS) assertThat(tile.longClickIntent).isNull() } @Test fun testDoesNotHandleLongClick() { assertThat(tile.state.handlesLongClick).isFalse() } @Test Loading