Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5e24c39 authored by Evan Severson's avatar Evan Severson
Browse files

Finish SensorUse activity when dialog is dismissed

Bug: 199550934
Fixes: 206688513
Fixes: 204946898
Test: Manual, CtsSensorPrivacyTestCases
Change-Id: I0de460a075d9b84444832f5b1547c040e552bdf4
parent b5d35b01
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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)
    }
}
+6 −2
Original line number Diff line number Diff line
@@ -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()
    }
}