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

Unverified Commit ebf12341 authored by DaVinci9196's avatar DaVinci9196 Committed by GitHub
Browse files

Measurement: Make stub session id (#2946)

parent ec9d7817
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -26,6 +26,12 @@ class AppMeasurementDynamiteService : IAppMeasurementDynamiteService.Stub() {
    private fun returnBundle(receiver: IBundleReceiver?, bundle: Bundle?) = runCatching { receiver?.onBundle(bundle) }
    private fun returnResult(receiver: IBundleReceiver?, value: Any?) = returnBundle(receiver, bundleOf("r" to value))

    private fun generateSessionId(): Long {
        val min = 1_000_000_000L
        val max = 9_999_999_999L
        return (min..max).random()
    }

    private fun requireInitialized() {
        require(initialized) { "Attempting to perform action before initialize." }
    }
@@ -245,7 +251,7 @@ class AppMeasurementDynamiteService : IAppMeasurementDynamiteService.Stub() {

    override fun getSessionId(receiver: IBundleReceiver?) {
        Log.d(TAG, "Not yet implemented: getSessionId")
        returnBundle(receiver, null)
        returnResult(receiver, generateSessionId())
    }

    override fun setSgtmDebugInfo(intent: Intent?) {