diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index b7a6a142e7df2..36a1bb3a5d897 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -2718,15 +2718,8 @@
toggle
-
- Device controls
-
- Add controls for your connected devices
-
-
- Set up device controls
-
- Hold the Power button to access your controls
+
+ Home controls
Choose app to add controls
@@ -2755,7 +2748,7 @@
Controls
- Choose controls to access from the power menu
+ Choose controls to access from Quick Settings
Hold & drag to rearrange controls
@@ -2847,7 +2840,7 @@
In progress
- Hold Power button to see new controls
+ Open Quick Settings to see new controls
Add controls
diff --git a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsProviderSelectorActivity.kt b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsProviderSelectorActivity.kt
index cba3dabc4ff47..8ad5099dc42da 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/management/ControlsProviderSelectorActivity.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/management/ControlsProviderSelectorActivity.kt
@@ -55,8 +55,9 @@ class ControlsProviderSelectorActivity @Inject constructor(
companion object {
private const val TAG = "ControlsProviderSelectorActivity"
+ const val BACK_SHOULD_EXIT = "back_should_exit"
}
-
+ private var backShouldExit = false
private lateinit var recyclerView: RecyclerView
private val currentUserTracker = object : CurrentUserTracker(broadcastDispatcher) {
private val startingUser = listingController.currentUserId
@@ -102,13 +103,17 @@ class ControlsProviderSelectorActivity @Inject constructor(
}
}
requireViewById(R.id.done).visibility = View.GONE
+
+ backShouldExit = intent.getBooleanExtra(BACK_SHOULD_EXIT, false)
}
override fun onBackPressed() {
- val i = Intent().apply {
- component = ComponentName(applicationContext, ControlsActivity::class.java)
+ if (!backShouldExit) {
+ val i = Intent().apply {
+ component = ComponentName(applicationContext, ControlsActivity::class.java)
+ }
+ startActivity(i, ActivityOptions.makeSceneTransitionAnimation(this).toBundle())
}
- startActivity(i, ActivityOptions.makeSceneTransitionAnimation(this).toBundle())
animateExitAndFinish()
}
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt
index 26be98743eed9..c322f4549aca6 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt
@@ -217,22 +217,8 @@ class ControlsUiControllerImpl @Inject constructor (
}
private fun showInitialSetupView(items: List) {
- val inflater = LayoutInflater.from(context)
- inflater.inflate(R.layout.controls_no_favorites, parent, true)
-
- val viewGroup = parent.requireViewById(R.id.controls_no_favorites_group) as ViewGroup
- viewGroup.setOnClickListener { _: View -> startProviderSelectorActivity() }
-
- val subtitle = parent.requireViewById(R.id.controls_subtitle)
- subtitle.setText(context.resources.getString(R.string.quick_controls_subtitle))
-
- val iconRowGroup = parent.requireViewById(R.id.controls_icon_row) as ViewGroup
- items.forEach {
- val imageView = inflater.inflate(R.layout.controls_icon, viewGroup, false) as ImageView
- imageView.setContentDescription(it.getTitle())
- imageView.setImageDrawable(it.icon)
- iconRowGroup.addView(imageView)
- }
+ startProviderSelectorActivity()
+ onDismiss.run()
}
private fun startFavoritingActivity(si: StructureInfo) {
@@ -261,7 +247,9 @@ class ControlsUiControllerImpl @Inject constructor (
}
private fun startProviderSelectorActivity() {
- startActivity(Intent(activityContext, ControlsProviderSelectorActivity::class.java))
+ val i = Intent(activityContext, ControlsProviderSelectorActivity::class.java)
+ i.putExtra(ControlsProviderSelectorActivity.BACK_SHOULD_EXIT, true)
+ startActivity(i)
}
private fun startActivity(intent: Intent) {