Loading packages/SystemUI/src/com/android/systemui/qs/tiles/FontScalingTile.kt +3 −4 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.qs.tiles import android.content.Intent import android.content.Intent import android.os.Handler import android.os.Handler import android.os.Looper import android.os.Looper import android.provider.Settings import android.view.View import android.view.View import com.android.internal.jank.InteractionJankMonitor import com.android.internal.jank.InteractionJankMonitor import com.android.internal.logging.MetricsLogger import com.android.internal.logging.MetricsLogger Loading Loading @@ -72,9 +73,7 @@ constructor( } } override fun newTileState(): QSTile.State { override fun newTileState(): QSTile.State { val state = QSTile.State() return QSTile.State() state.handlesLongClick = false return state } } override fun handleClick(view: View?) { override fun handleClick(view: View?) { Loading @@ -98,7 +97,7 @@ constructor( } } override fun getLongClickIntent(): Intent? { override fun getLongClickIntent(): Intent? { return null return Intent(Settings.ACTION_TEXT_READING_SETTINGS) } } override fun getTileLabel(): CharSequence { override fun getTileLabel(): CharSequence { Loading packages/SystemUI/tests/src/com/android/systemui/qs/tiles/FontScalingTileTest.kt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -15,7 +15,9 @@ */ */ package com.android.systemui.qs.tiles package com.android.systemui.qs.tiles import android.content.Intent import android.os.Handler import android.os.Handler import android.provider.Settings import android.testing.AndroidTestingRunner import android.testing.AndroidTestingRunner import android.testing.TestableLooper import android.testing.TestableLooper import android.view.View import android.view.View Loading Loading @@ -113,4 +115,11 @@ class FontScalingTileTest : SysuiTestCase() { verify(dialogLaunchAnimator).showFromView(any(), eq(view), nullable(), anyBoolean()) verify(dialogLaunchAnimator).showFromView(any(), eq(view), nullable(), anyBoolean()) } } @Test fun getLongClickIntent_getExpectedIntent() { val intent: Intent? = fontScalingTile.getLongClickIntent() assertThat(intent!!.action).isEqualTo(Settings.ACTION_TEXT_READING_SETTINGS) } } } Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/FontScalingTile.kt +3 −4 Original line number Original line Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.systemui.qs.tiles import android.content.Intent import android.content.Intent import android.os.Handler import android.os.Handler import android.os.Looper import android.os.Looper import android.provider.Settings import android.view.View import android.view.View import com.android.internal.jank.InteractionJankMonitor import com.android.internal.jank.InteractionJankMonitor import com.android.internal.logging.MetricsLogger import com.android.internal.logging.MetricsLogger Loading Loading @@ -72,9 +73,7 @@ constructor( } } override fun newTileState(): QSTile.State { override fun newTileState(): QSTile.State { val state = QSTile.State() return QSTile.State() state.handlesLongClick = false return state } } override fun handleClick(view: View?) { override fun handleClick(view: View?) { Loading @@ -98,7 +97,7 @@ constructor( } } override fun getLongClickIntent(): Intent? { override fun getLongClickIntent(): Intent? { return null return Intent(Settings.ACTION_TEXT_READING_SETTINGS) } } override fun getTileLabel(): CharSequence { override fun getTileLabel(): CharSequence { Loading
packages/SystemUI/tests/src/com/android/systemui/qs/tiles/FontScalingTileTest.kt +9 −0 Original line number Original line Diff line number Diff line Loading @@ -15,7 +15,9 @@ */ */ package com.android.systemui.qs.tiles package com.android.systemui.qs.tiles import android.content.Intent import android.os.Handler import android.os.Handler import android.provider.Settings import android.testing.AndroidTestingRunner import android.testing.AndroidTestingRunner import android.testing.TestableLooper import android.testing.TestableLooper import android.view.View import android.view.View Loading Loading @@ -113,4 +115,11 @@ class FontScalingTileTest : SysuiTestCase() { verify(dialogLaunchAnimator).showFromView(any(), eq(view), nullable(), anyBoolean()) verify(dialogLaunchAnimator).showFromView(any(), eq(view), nullable(), anyBoolean()) } } @Test fun getLongClickIntent_getExpectedIntent() { val intent: Intent? = fontScalingTile.getLongClickIntent() assertThat(intent!!.action).isEqualTo(Settings.ACTION_TEXT_READING_SETTINGS) } } }