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

Commit e1d8d046 authored by Evan Severson's avatar Evan Severson Committed by Android (Google) Code Review
Browse files

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

parents d8d54c9a d5e24c39
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()
    }
}