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

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

Vending: Add InAppReviewService dummy (#2955)

parent 59825d9d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -284,5 +284,13 @@
            </intent-filter>
        </service>

        <service
            android:name="com.google.android.finsky.inappreviewservice.InAppReviewService"
            android:exported="true">
            <intent-filter>
                <action android:name="com.google.android.finsky.BIND_IN_APP_REVIEW_SERVICE"/>
            </intent-filter>
        </service>

    </application>
</manifest>
+12 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2025 microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package com.google.android.play.core.inappreview.protocol;

import com.google.android.play.core.inappreview.protocol.IInAppReviewServiceCallback;

interface IInAppReviewService {
    oneway void requestInAppReview(String packageName, in Bundle bundle, in IInAppReviewServiceCallback callback) = 1;
}
 No newline at end of file
+12 −0
Original line number Diff line number Diff line
/*
 * SPDX-FileCopyrightText: 2025 microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package com.google.android.play.core.inappreview.protocol;

import android.os.Bundle;

interface IInAppReviewServiceCallback {
    void onResult(in Bundle bundle);
}
 No newline at end of file
+44 −0
Original line number Diff line number Diff line
/**
 * SPDX-FileCopyrightText: 2025 microG Project Team
 * SPDX-License-Identifier: Apache-2.0
 */

package com.google.android.finsky.inappreviewservice

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.IBinder
import android.os.Parcel
import android.util.Log
import androidx.lifecycle.LifecycleService
import com.google.android.play.core.inappreview.protocol.IInAppReviewService
import com.google.android.play.core.inappreview.protocol.IInAppReviewServiceCallback
import org.microg.gms.utils.warnOnTransactionIssues

private const val TAG = "InAppReviewService"

class InAppReviewService : LifecycleService() {

    override fun onBind(intent: Intent): IBinder? {
        super.onBind(intent)
        Log.d(TAG, "onBind")
        return InAppReviewServiceImpl(this).asBinder()
    }

    override fun onUnbind(intent: Intent?): Boolean {
        Log.d(TAG, "onUnbind")
        return super.onUnbind(intent)
    }
}

class InAppReviewServiceImpl(val context: Context) : IInAppReviewService.Stub() {

    override fun requestInAppReview(packageName: String?, bundle: Bundle?, callback: IInAppReviewServiceCallback?) {
        bundle?.keySet()
        Log.d(TAG, "requestInAppReview: packageName: $packageName bundle:$bundle")
        callback?.onResult(Bundle.EMPTY)
    }

    override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int) = warnOnTransactionIssues(code, reply, flags, TAG) { super.onTransact(code, data, reply, flags) }
}
 No newline at end of file