Loading packages/SystemUI/AndroidManifest.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -932,7 +932,7 @@ android:showForAllUsers="true" android:showForAllUsers="true" android:finishOnTaskLaunch="true" android:finishOnTaskLaunch="true" android:launchMode="singleInstance" android:launchMode="singleInstance" android:configChanges="screenLayout|keyboard|keyboardHidden|orientation" android:configChanges="screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|orientation" android:visibleToInstantApps="true"> android:visibleToInstantApps="true"> </activity> </activity> Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt +7 −3 Original line number Original line Diff line number Diff line Loading @@ -47,7 +47,8 @@ import javax.inject.Inject * destroyed on SCREEN_OFF events, due to issues with occluded activities over lockscreen as well as * destroyed on SCREEN_OFF events, due to issues with occluded activities over lockscreen as well as * user expectations for the activity to not continue running. * user expectations for the activity to not continue running. */ */ class ControlsActivity @Inject constructor( // Open for testing open class ControlsActivity @Inject constructor( private val uiController: ControlsUiController, private val uiController: ControlsUiController, private val broadcastDispatcher: BroadcastDispatcher, private val broadcastDispatcher: BroadcastDispatcher, private val dreamManager: IDreamManager, private val dreamManager: IDreamManager, Loading Loading @@ -98,8 +99,11 @@ class ControlsActivity @Inject constructor( override fun onConfigurationChanged(newConfig: Configuration) { override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) super.onConfigurationChanged(newConfig) if (lastConfiguration.diff(newConfig) and ActivityInfo.CONFIG_ORIENTATION != 0 ) { val interestingFlags = ActivityInfo.CONFIG_ORIENTATION or uiController.onOrientationChange() ActivityInfo.CONFIG_SCREEN_SIZE or ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE if (lastConfiguration.diff(newConfig) and interestingFlags != 0 ) { uiController.onSizeChange() } } lastConfiguration = newConfig lastConfiguration = newConfig } } Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiController.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -65,7 +65,7 @@ interface ControlsUiController { */ */ fun getPreferredSelectedItem(structures: List<StructureInfo>): SelectedItem fun getPreferredSelectedItem(structures: List<StructureInfo>): SelectedItem fun onOrientationChange() fun onSizeChange() } } sealed class SelectedItem { sealed class SelectedItem { Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -809,7 +809,7 @@ class ControlsUiControllerImpl @Inject constructor ( } } } } override fun onOrientationChange() { override fun onSizeChange() { selectionItem?.let { selectionItem?.let { when (selectedItem) { when (selectedItem) { is SelectedItem.StructureItem -> createListView(it) is SelectedItem.StructureItem -> createListView(it) Loading packages/SystemUI/tests/AndroidManifest.xml +5 −0 Original line number Original line Diff line number Diff line Loading @@ -108,6 +108,11 @@ android:excludeFromRecents="true" android:excludeFromRecents="true" /> /> <activity android:name="com.android.systemui.controls.ui.TestableControlsActivity" android:exported="false" android:excludeFromRecents="true" /> <activity android:name="com.android.systemui.screenshot.ScrollViewActivity" <activity android:name="com.android.systemui.screenshot.ScrollViewActivity" android:exported="false" /> android:exported="false" /> Loading Loading
packages/SystemUI/AndroidManifest.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -932,7 +932,7 @@ android:showForAllUsers="true" android:showForAllUsers="true" android:finishOnTaskLaunch="true" android:finishOnTaskLaunch="true" android:launchMode="singleInstance" android:launchMode="singleInstance" android:configChanges="screenLayout|keyboard|keyboardHidden|orientation" android:configChanges="screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|orientation" android:visibleToInstantApps="true"> android:visibleToInstantApps="true"> </activity> </activity> Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlsActivity.kt +7 −3 Original line number Original line Diff line number Diff line Loading @@ -47,7 +47,8 @@ import javax.inject.Inject * destroyed on SCREEN_OFF events, due to issues with occluded activities over lockscreen as well as * destroyed on SCREEN_OFF events, due to issues with occluded activities over lockscreen as well as * user expectations for the activity to not continue running. * user expectations for the activity to not continue running. */ */ class ControlsActivity @Inject constructor( // Open for testing open class ControlsActivity @Inject constructor( private val uiController: ControlsUiController, private val uiController: ControlsUiController, private val broadcastDispatcher: BroadcastDispatcher, private val broadcastDispatcher: BroadcastDispatcher, private val dreamManager: IDreamManager, private val dreamManager: IDreamManager, Loading Loading @@ -98,8 +99,11 @@ class ControlsActivity @Inject constructor( override fun onConfigurationChanged(newConfig: Configuration) { override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) super.onConfigurationChanged(newConfig) if (lastConfiguration.diff(newConfig) and ActivityInfo.CONFIG_ORIENTATION != 0 ) { val interestingFlags = ActivityInfo.CONFIG_ORIENTATION or uiController.onOrientationChange() ActivityInfo.CONFIG_SCREEN_SIZE or ActivityInfo.CONFIG_SMALLEST_SCREEN_SIZE if (lastConfiguration.diff(newConfig) and interestingFlags != 0 ) { uiController.onSizeChange() } } lastConfiguration = newConfig lastConfiguration = newConfig } } Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiController.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -65,7 +65,7 @@ interface ControlsUiController { */ */ fun getPreferredSelectedItem(structures: List<StructureInfo>): SelectedItem fun getPreferredSelectedItem(structures: List<StructureInfo>): SelectedItem fun onOrientationChange() fun onSizeChange() } } sealed class SelectedItem { sealed class SelectedItem { Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -809,7 +809,7 @@ class ControlsUiControllerImpl @Inject constructor ( } } } } override fun onOrientationChange() { override fun onSizeChange() { selectionItem?.let { selectionItem?.let { when (selectedItem) { when (selectedItem) { is SelectedItem.StructureItem -> createListView(it) is SelectedItem.StructureItem -> createListView(it) Loading
packages/SystemUI/tests/AndroidManifest.xml +5 −0 Original line number Original line Diff line number Diff line Loading @@ -108,6 +108,11 @@ android:excludeFromRecents="true" android:excludeFromRecents="true" /> /> <activity android:name="com.android.systemui.controls.ui.TestableControlsActivity" android:exported="false" android:excludeFromRecents="true" /> <activity android:name="com.android.systemui.screenshot.ScrollViewActivity" <activity android:name="com.android.systemui.screenshot.ScrollViewActivity" android:exported="false" /> android:exported="false" /> Loading