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

Commit d344c85f authored by Xiaowen Lei's avatar Xiaowen Lei
Browse files

Add debug log for Lockscreen notifySmartspaceEvent.

Example log, for tapping the next alarm on Lockscreen:
```
07-02 10:13:46.851 15556 15556 D LockscreenSmartspaceController: notifySmartspaceEvent: SmartspaceTargetEvent{mSmartspaceTarget=null, mSmartspaceActionId='nextAlarmId', mEventType=1}
```

Flag: EXEMPT add debug log only
Bug: 424292340
Test: Tap next alarm, observe debug log via `adb logcat`
Change-Id: I98adc3240b362494f31b940bd7b510f622ece9fc
parent e39f9c93
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.app.smartspace.SmartspaceConfig
import android.app.smartspace.SmartspaceManager
import android.app.smartspace.SmartspaceSession
import android.app.smartspace.SmartspaceTarget
import android.app.smartspace.SmartspaceTargetEvent
import android.content.ContentResolver
import android.content.Context
import android.content.Intent
@@ -506,14 +507,20 @@ constructor(
        statusBarStateController.addCallback(statusBarStateListener)
        bypassController.registerOnBypassStateChangedListener(bypassStateChangedListener)

        datePlugin?.setEventDispatcher { e -> session?.notifySmartspaceEvent(e) }
        weatherPlugin?.setEventDispatcher { e -> session?.notifySmartspaceEvent(e) }
        plugin?.setEventDispatcher { e -> session?.notifySmartspaceEvent(e) }
        datePlugin?.setEventDispatcher { e -> notifySmartspaceEvent(e) }
        weatherPlugin?.setEventDispatcher { e -> notifySmartspaceEvent(e) }
        plugin?.setEventDispatcher { e -> notifySmartspaceEvent(e) }

        updateBypassEnabled()
        reloadSmartspace()
    }

    /** Pushes a given SmartspaceTargetEvent to the SmartspaceSession. */
    private fun notifySmartspaceEvent(targetEvent: SmartspaceTargetEvent) {
        Log.d(TAG, "notifySmartspaceEvent: $targetEvent")
        session?.notifySmartspaceEvent(targetEvent)
    }

    /** Requests the smartspace session for an update. */
    fun requestSmartspaceUpdate() {
        session?.requestSmartspaceUpdate()