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

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

Fixed crashed due to empty ApiMetadata parameters (#3202)

parent 3ba21336
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -93,23 +93,23 @@ class LocationSharingReporterApiServiceImpl(
) : ILocationSharingReporterService.Stub(), LifecycleOwner {
    private val activePermissionRequestLock = Mutex()

    override fun uploadLocation(callback: ILocationUploadCallbacks, account: Account, request: LocationUploadRequest, apiMetadata: ApiMetadata) {
    override fun uploadLocation(callback: ILocationUploadCallbacks, account: Account, request: LocationUploadRequest, apiMetadata: ApiMetadata?) {
        Log.d(TAG, "Not yet implemented: uploadLocation called with account: ${account.name}")
    }

    override fun getReportingStatus(callback: ILocationReportingStatusCallbacks, account: Account, apiMetadata: ApiMetadata) {
    override fun getReportingStatus(callback: ILocationReportingStatusCallbacks, account: Account, apiMetadata: ApiMetadata?) {
        Log.d(TAG, "Not yet implemented: getReportingStatus called with account: ${account.name}")
    }

    override fun syncReportingStatus(callback: IStatusCallback, account: Account, apiMetadata: ApiMetadata) {
    override fun syncReportingStatus(callback: IStatusCallback, account: Account, apiMetadata: ApiMetadata?) {
        Log.d(TAG, "Not yet implemented: syncReportingStatus called with account: ${account.name}")
    }

    override fun periodicLocationUpload(callback: IStatusCallback, account: Account, request: PeriodicLocationUploadRequest, apiMetadata: ApiMetadata) {
    override fun periodicLocationUpload(callback: IStatusCallback, account: Account, request: PeriodicLocationUploadRequest, apiMetadata: ApiMetadata?) {
        Log.d(TAG, "Not yet implemented: periodicLocationUpload called with account: ${account.name}, request: $request")
    }

    override fun startLocationReporting(callback: IStatusCallback, account: Account, request: StartLocationReportingRequest, apiMetadata: ApiMetadata) {
    override fun startLocationReporting(callback: IStatusCallback, account: Account, request: StartLocationReportingRequest, apiMetadata: ApiMetadata?) {
        Log.d(TAG, "startLocationReporting called with account: ${account.name}, request: $request")
        try {
            validateGoogleAccount(account)
@@ -188,7 +188,7 @@ class LocationSharingReporterApiServiceImpl(
        context.startActivity(intent)
    }

    override fun stopLocationReporting(callback: IStatusCallback?, account: Account, request: StopLocationReportingRequest, apiMetadata: ApiMetadata) {
    override fun stopLocationReporting(callback: IStatusCallback?, account: Account, request: StopLocationReportingRequest, apiMetadata: ApiMetadata?) {
        Log.d(TAG, "stopLocationReporting called with account: ${account.name}, request: $request")

        lifecycleScope.launch(Dispatchers.IO) {
@@ -210,7 +210,7 @@ class LocationSharingReporterApiServiceImpl(
        }
    }

    override fun updateNoticeState(callback: IStatusCallback?, account: Account, request: NoticeAckedUpdateRequest, apiMetadata: ApiMetadata) {
    override fun updateNoticeState(callback: IStatusCallback?, account: Account, request: NoticeAckedUpdateRequest, apiMetadata: ApiMetadata?) {
        Log.d(TAG, "updateNoticeState called with account: ${account.name}, request: $request")
        try {
            callback?.onResult(Status.SUCCESS)
@@ -223,7 +223,7 @@ class LocationSharingReporterApiServiceImpl(
        }
    }

    override fun getReportingIssues(callback: ILocationReportingIssuesCallback, account: Account, apiMetadata: ApiMetadata) {
    override fun getReportingIssues(callback: ILocationReportingIssuesCallback, account: Account, apiMetadata: ApiMetadata?) {
        Log.d(TAG, "getReportingIssues called with account: ${account.name}")
        try {
            updateDeviceLocationSettingState(context)
+10 −10
Original line number Diff line number Diff line
@@ -131,12 +131,12 @@ class TapAndPayImpl(private val context: Context, private val packageName: Strin
        callbacks?.onSetSelectedTokenResponse(Status.SUCCESS)
    }

    override fun getAllCards(request: GetAllCardsRequest?, callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata) {
    override fun getAllCards(request: GetAllCardsRequest?, callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata?) {
        Log.d(TAG, "getAllCards()")
        callbacks.onGetAllCardsResponse(Status.SUCCESS, GetAllCardsResponse(emptyArray(), null, null, null, SparseArray(), ByteArray(0)))
    }

    override fun setActiveAccount(request: SetActiveAccountRequest?, callbacks: ITapAndPayServiceCallbacks?, metadata: ApiMetadata) {
    override fun setActiveAccount(request: SetActiveAccountRequest?, callbacks: ITapAndPayServiceCallbacks?, metadata: ApiMetadata?) {
        if (!isFirstParty) {
            callbacks?.onSetActiveAccountResponse(Status.INTERNAL_ERROR)
            return
@@ -147,7 +147,7 @@ class TapAndPayImpl(private val context: Context, private val packageName: Strin
        callbacks?.onSetActiveAccountResponse(Status.SUCCESS)
    }

    override fun getActiveAccount(request: GetActiveAccountRequest?, callbacks: ITapAndPayServiceCallbacks?, metadata: ApiMetadata) {
    override fun getActiveAccount(request: GetActiveAccountRequest?, callbacks: ITapAndPayServiceCallbacks?, metadata: ApiMetadata?) {
        if (!isFirstParty) {
            callbacks?.onGetActiveAccountResponse(Status.INTERNAL_ERROR, null)
            return
@@ -157,7 +157,7 @@ class TapAndPayImpl(private val context: Context, private val packageName: Strin
        callbacks?.onGetActiveAccountResponse(Status.SUCCESS, GetActiveAccountResponse(accountInfo))
    }

    override fun registerDataChangedListener(callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata) {
    override fun registerDataChangedListener(callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata?) {
        Log.d(TAG, "registerDataChangedListener()")
        callbacks.onStatus(Status.SUCCESS)
    }
@@ -171,12 +171,12 @@ class TapAndPayImpl(private val context: Context, private val packageName: Strin
        callbacks?.onIsDeviceUnlockedForPaymentResponse(Status.SUCCESS, true)
    }

    override fun getActiveWalletId(callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata) {
    override fun getActiveWalletId(callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata?) {
        Log.d(TAG, "getActiveWalletId: ")
        callbacks.onGetActiveWalletIdResponse(Status(TAP_AND_PAY_NO_ACTIVE_WALLET), "")
    }

    override fun getTokenStatus(tokenProvider: Int, issuerTokenId: String, callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata) {
    override fun getTokenStatus(tokenProvider: Int, issuerTokenId: String, callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata?) {
        Log.d(TAG, "getTokenStatus($tokenProvider, $issuerTokenId)")
        callbacks.onGetTokenStatusResponse(Status(TAP_AND_PAY_NO_ACTIVE_WALLET), null)
    }
@@ -191,7 +191,7 @@ class TapAndPayImpl(private val context: Context, private val packageName: Strin
        callbacks?.onHandleStatusPendingIntent(Status(CommonStatusCodes.RESOLUTION_REQUIRED, null, ), Bundle.EMPTY)
    }

    override fun getStableHardwareId(callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata) {
    override fun getStableHardwareId(callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata?) {
        Log.d(TAG, "getStableHardwareId()")
        callbacks.onGetStableHardwareIdResponse(Status.SUCCESS, "")
    }
@@ -206,12 +206,12 @@ class TapAndPayImpl(private val context: Context, private val packageName: Strin
        callbacks?.onGetSecurityParamsResponse(Status.SUCCESS, GetSecurityParamsResponse(isDeviceSecure, false, false, false))
    }

    override fun refreshSeCards(request: RefreshSeCardsRequest?, callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata) {
    override fun refreshSeCards(request: RefreshSeCardsRequest?, callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata?) {
        Log.d(TAG, "refreshSeCards()")
        callbacks.onRefreshSeCardsResponse(Status.SUCCESS, RefreshSeCardsResponse())
    }

    override fun listTokensDefault(callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata) {
    override fun listTokensDefault(callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata?) {
        listTokens(ListTokensRequest(), callbacks, metadata)
    }

@@ -234,7 +234,7 @@ class TapAndPayImpl(private val context: Context, private val packageName: Strin
        callbacks?.onStatus(Status.SUCCESS)
    }

    override fun listTokens(request: ListTokensRequest?, callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata) {
    override fun listTokens(request: ListTokensRequest?, callbacks: ITapAndPayServiceCallbacks, metadata: ApiMetadata?) {
        Log.d(TAG, "listTokens($request)")
        callbacks.onListTokensResponse(Status.SUCCESS, emptyArray())
    }