Merge "Finish SensorUse activity when dialog is dismissed" into sc-dev am: e1d8d04603

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16308034

Change-Id: I7518889657d9a47e758bdeff7b02aa3412421576
This commit is contained in:
Evan Severson
2021-12-07 20:58:36 +00:00
committed by Automerger Merge Worker
2 changed files with 10 additions and 3 deletions

View File

@@ -15,7 +15,8 @@ import com.android.systemui.statusbar.phone.SystemUIDialog
class SensorUseDialog(
context: Context,
val sensor: Int,
val clickListener: DialogInterface.OnClickListener
val clickListener: DialogInterface.OnClickListener,
val dismissListener: DialogInterface.OnDismissListener
) : SystemUIDialog(context) {
// TODO move to onCreate (b/200815309)
@@ -69,6 +70,8 @@ class SensorUseDialog(
context.getString(com.android.internal.R.string
.cancel), clickListener)
setOnDismissListener(dismissListener)
setCancelable(false)
}
}

View File

@@ -50,7 +50,7 @@ class SensorUseStartedActivity @Inject constructor(
private val keyguardStateController: KeyguardStateController,
private val keyguardDismissUtil: KeyguardDismissUtil,
@Background private val bgHandler: Handler
) : Activity(), DialogInterface.OnClickListener {
) : Activity(), DialogInterface.OnClickListener, DialogInterface.OnDismissListener {
companion object {
private val LOG_TAG = SensorUseStartedActivity::class.java.simpleName
@@ -120,7 +120,7 @@ class SensorUseStartedActivity @Inject constructor(
}
}
mDialog = SensorUseDialog(this, sensor, this)
mDialog = SensorUseDialog(this, sensor, this, this)
mDialog!!.show()
}
@@ -212,4 +212,8 @@ class SensorUseStartedActivity @Inject constructor(
.suppressSensorPrivacyReminders(sensor, suppressed)
}
}
override fun onDismiss(dialog: DialogInterface?) {
finish()
}
}