Skip to content
Merged
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
8 changes: 8 additions & 0 deletions vending-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,13 @@
android:name="com.google.android.finsky.services.PlayGearheadService"
android:exported="true" />

<service android:name="com.google.android.finsky.installservice.DevTriggeredUpdateService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.play.core.install.BIND_UPDATE_SERVICE"/>
</intent-filter>
</service>

</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

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

import com.google.android.play.core.appupdate.protocol.IAppUpdateServiceCallback;

interface IAppUpdateService {
oneway void requestUpdateInfo(String packageName, in Bundle bundle, in IAppUpdateServiceCallback callback) = 1;
oneway void completeUpdate(String packageName, in Bundle bundle, in IAppUpdateServiceCallback callback) = 2;
oneway void updateProgress(in Bundle bundle) = 3;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

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

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

package com.google.android.finsky.installservice

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.os.bundleOf
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleService
import com.google.android.play.core.appupdate.protocol.IAppUpdateService
import com.google.android.play.core.appupdate.protocol.IAppUpdateServiceCallback
import org.microg.gms.utils.warnOnTransactionIssues

private const val TAG = "TriggeredUpdateService"

class DevTriggeredUpdateService : LifecycleService() {

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

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

class DevTriggeredUpdateServiceImpl(private val context: Context, override val lifecycle: Lifecycle) : IAppUpdateService.Stub(), LifecycleOwner {

override fun requestUpdateInfo(packageName: String?, bundle: Bundle?, callback: IAppUpdateServiceCallback?) {
bundle?.keySet()
Log.d(TAG, "requestUpdateInfo: packageName: $packageName bundle: $bundle")
callback?.onUpdateResult(bundleOf("error.code" to 0))
}

override fun completeUpdate(packageName: String?, bundle: Bundle?, callback: IAppUpdateServiceCallback?) {
bundle?.keySet()
Log.d(TAG, "completeUpdate: packageName: $packageName bundle: $bundle")
callback?.onCompleteResult(bundleOf("error.code" to 0))
}

override fun updateProgress(bundle: Bundle?) {
Log.d(TAG, "updateProgress: bundle: $bundle")
}

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