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

Commit 10937489 authored by Evan Severson's avatar Evan Severson Committed by Automerger Merge Worker
Browse files

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

Merge "Finish SensorUse activity when dialog is dismissed" into sc-dev am: e1d8d046 am: 2040013a

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

Change-Id: Icdc7371f08e75c45e93717adfb94693ffed5bfd3
parents fa378b00 2040013a
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()
    }
}