Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions vending-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@
</intent-filter>
</service>

<activity
android:name="com.google.android.finsky.inappreviewdialog.InAppReviewActivity"
android:exported="false"
android:excludeFromRecents="true"
android:configChanges="orientation|keyboardHidden"
android:windowSoftInputMode="stateHidden"/>

<activity
android:name="org.microg.vending.installer.AppInstallActivity"
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ package com.google.android.play.core.inappreview.protocol;
import android.os.Bundle;

interface IInAppReviewServiceCallback {
void onResult(in Bundle bundle);
oneway void onResult(in Bundle bundle) = 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* SPDX-FileCopyrightText: 2025 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.finsky.inappreviewdialog

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

class InAppReviewActivity: AppCompatActivity() {
companion object {
const val CALLING_PACKAGE = "calling_package"
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setResult(RESULT_OK)
finish()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@

package com.google.android.finsky.inappreviewservice

import android.app.PendingIntent.FLAG_UPDATE_CURRENT
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.core.app.PendingIntentCompat
import androidx.lifecycle.LifecycleService
import com.google.android.finsky.inappreviewdialog.InAppReviewActivity
import com.google.android.play.core.inappreview.protocol.IInAppReviewService
import com.google.android.play.core.inappreview.protocol.IInAppReviewServiceCallback
import org.microg.gms.utils.warnOnTransactionIssues
Expand All @@ -35,9 +38,20 @@ class InAppReviewService : LifecycleService() {
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)
val pendingIntent = Intent(context, InAppReviewActivity::class.java).apply {
putExtra(InAppReviewActivity.CALLING_PACKAGE, packageName)
}.let {
PendingIntentCompat.getActivity(context, 0, it, FLAG_UPDATE_CURRENT, false)
}
val bundle = Bundle()
bundle.putBoolean("is_review_no_op", false)
bundle.putParcelable("confirmation_intent", pendingIntent)
try {
callback?.onResult(bundle)
} catch (e: Exception) {
Log.w(TAG, "Exception on in-app review service", e)
}
}

override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int) = warnOnTransactionIssues(code, reply, flags, TAG) { super.onTransact(code, data, reply, flags) }
Expand Down