diff options
| author | 2021-06-15 15:56:49 +0000 | |
|---|---|---|
| committer | 2021-06-15 15:56:49 +0000 | |
| commit | a3b91578ee5ec1977f4d3c12fb2b92c27d60170b (patch) | |
| tree | 413d891a77aad3abb36587a71d65dd61ddf1b21a | |
| parent | a00b2dab47300e40aa609423351c936133eb3b7d (diff) | |
| parent | 33a9b54f69725bdb605e3a5a50b2973a11ffb368 (diff) | |
Merge "Show chevron on ScreenRecordTile" into sc-dev
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tiles/ScreenRecordTile.java | 2 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ScreenRecordTileTest.java | 34 |
2 files changed, 36 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/ScreenRecordTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/ScreenRecordTile.java index 32a6c6c20504..24b9208d4ed1 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ScreenRecordTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ScreenRecordTile.java @@ -103,6 +103,8 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState> state.state = (isRecording || isStarting) ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE; state.label = mContext.getString(R.string.quick_settings_screen_record_label); state.icon = ResourceIcon.get(R.drawable.ic_screenrecord); + // Show expand icon when clicking will open a dialog + state.forceExpandIcon = state.state == Tile.STATE_INACTIVE; if (isRecording) { state.secondaryLabel = mContext.getString(R.string.quick_settings_screen_record_stop); diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ScreenRecordTileTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ScreenRecordTileTest.java index e4af21aa7cd4..3b4e863ed8bd 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ScreenRecordTileTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/qs/tiles/ScreenRecordTileTest.java @@ -19,6 +19,7 @@ package com.android.systemui.qs.tiles; import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertTrue; +import static org.junit.Assert.assertFalse; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -167,4 +168,37 @@ public class ScreenRecordTileTest extends SysuiTestCase { assertTrue(mTile.getState().contentDescription.toString().contains(mTile.getState().label)); } + + @Test + public void testForceExpandIcon_notRecordingNotStarting() { + when(mController.isStarting()).thenReturn(false); + when(mController.isRecording()).thenReturn(false); + + mTile.refreshState(); + mTestableLooper.processAllMessages(); + + assertTrue(mTile.getState().forceExpandIcon); + } + + @Test + public void testForceExpandIcon_recordingNotStarting() { + when(mController.isStarting()).thenReturn(false); + when(mController.isRecording()).thenReturn(true); + + mTile.refreshState(); + mTestableLooper.processAllMessages(); + + assertFalse(mTile.getState().forceExpandIcon); + } + + @Test + public void testForceExpandIcon_startingNotRecording() { + when(mController.isStarting()).thenReturn(true); + when(mController.isRecording()).thenReturn(false); + + mTile.refreshState(); + mTestableLooper.processAllMessages(); + + assertFalse(mTile.getState().forceExpandIcon); + } } |