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

Commit 6846c4c2 authored by Pyuli Naithani's avatar Pyuli Naithani Committed by Automerger Merge Worker
Browse files

Merge "Add logs for sensor privacy enable dialog." into sc-dev am: 81f86238

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

Change-Id: I2a3a7289679ef27417c164867df4eccf962f2694
parents 78f358de 81f86238
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -38,6 +38,10 @@ import com.android.systemui.statusbar.phone.KeyguardDismissUtil
import com.android.systemui.statusbar.policy.IndividualSensorPrivacyController
import com.android.systemui.statusbar.policy.KeyguardStateController
import javax.inject.Inject
import com.android.internal.util.FrameworkStatsLog.PRIVACY_TOGGLE_DIALOG_INTERACTION
import com.android.internal.util.FrameworkStatsLog.PRIVACY_TOGGLE_DIALOG_INTERACTION__ACTION__ENABLE
import com.android.internal.util.FrameworkStatsLog.PRIVACY_TOGGLE_DIALOG_INTERACTION__ACTION__CANCEL
import com.android.internal.util.FrameworkStatsLog.write

/**
 * Dialog to be shown on top of apps that are attempting to use a sensor (e.g. microphone) which is
@@ -185,16 +189,25 @@ class SensorUseStartedActivity @Inject constructor(
                    keyguardDismissUtil.executeWhenUnlocked({
                        bgHandler.postDelayed({
                            disableSensorPrivacy()
                            write(PRIVACY_TOGGLE_DIALOG_INTERACTION,
                                    PRIVACY_TOGGLE_DIALOG_INTERACTION__ACTION__ENABLE,
                                    sensorUsePackageName)
                        }, UNLOCK_DELAY_MILLIS)

                        false
                    }, false, true)
                } else {
                    disableSensorPrivacy()
                    write(PRIVACY_TOGGLE_DIALOG_INTERACTION,
                            PRIVACY_TOGGLE_DIALOG_INTERACTION__ACTION__ENABLE,
                            sensorUsePackageName)
                }
            }
            BUTTON_NEGATIVE -> {
                unsuppressImmediately = false
                write(PRIVACY_TOGGLE_DIALOG_INTERACTION,
                        PRIVACY_TOGGLE_DIALOG_INTERACTION__ACTION__CANCEL,
                        sensorUsePackageName)
            }
        }