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
4 changes: 4 additions & 0 deletions vending-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,9 @@
</intent-filter>
</receiver>

<service
android:name="com.google.android.finsky.services.PlayGearheadService"
android:exported="true" />

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

package com.google.android.finsky.services;

interface IPlayGearheadService {
Bundle isPackageInstalledByPlayCheck(in String pkgName);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.finsky.services

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.IBinder
import android.util.Log
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleService

private const val TAG = "PlayGearheadService"

class PlayGearheadService : LifecycleService() {

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

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

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

override fun isPackageInstalledByPlayCheck(pkgName: String?): Bundle {
Log.d(TAG, "isPackageInstalledByPlayCheck: pkgName: $pkgName")
return Bundle().apply { putBoolean("Finsky.IsValid", true) }
}
}