Skip to content

app engage service dummy #2858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
10 changes: 10 additions & 0 deletions vending-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@
</intent-filter>
</service>

<service
android:name="com.google.android.finsky.appcontentservice.engage.AppEngageServiceV2"
android:exported="true"
android:process=":background">
<intent-filter>
<action android:name="com.google.android.engage.BIND_APP_ENGAGE_SERVICE"/>
</intent-filter>
</service>


<service
android:name="com.android.vending.billing.InAppBillingService"
android:exported="true">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* SPDX-FileCopyrightText: 2025 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package com.google.android.engage.protocol;

import android.os.Bundle;
import com.google.android.engage.protocol.IAppEngageServicePublishClustersCallback;
import com.google.android.engage.protocol.IAppEngageServiceDeleteClustersCallback;
import com.google.android.engage.protocol.IAppEngageServiceAvailableCallback;
import com.google.android.engage.protocol.IAppEngageServicePublishStatusCallback;

interface IAppEngageService {
/**
* Publishes clusters of app engagement data.
*
* @param bundle Contains cluster data to be published
* @param callback Callback to receive results of the publish operation
*/
void publishClusters(in Bundle bundle, IAppEngageServicePublishClustersCallback callback);

/**
* Deletes previously published clusters of app engagement data.
*
* @param bundle Contains specifications about which clusters to delete
* @param callback Callback to receive results of the delete operation
*/
void deleteClusters(in Bundle bundle, IAppEngageServiceDeleteClustersCallback callback);

/**
* Checks if the App Engage Service is available for the calling application.
*
* @param bundle Contains parameters for the availability check
* @param callback Callback to receive availability status
*/
void isServiceAvailable(in Bundle bundle, IAppEngageServiceAvailableCallback callback);

/**
* Updates the publishing status for previously published clusters.
*
* @param bundle Contains status update information
* @param callback Callback to receive results of the status update operation
*/
void updatePublishStatus(in Bundle bundle, IAppEngageServicePublishStatusCallback callback);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2025 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package com.google.android.engage.protocol;

import android.os.Bundle;

/**
* Callback interface for isServiceAvailable operation.
* This callback is used to receive the availability status of the App Engage Service.
*/
interface IAppEngageServiceAvailableCallback {
/**
* Called with the service availability result.
*
* @param result Bundle containing availability information.
* The key "availability" contains a boolean indicating whether the service is available.
*/
void onResult(in Bundle result);
}
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.engage.protocol;

import android.os.Bundle;

/**
* Callback interface for deleteClusters operation.
* This callback is used to receive the result of a cluster deletion operation.
*/
interface IAppEngageServiceDeleteClustersCallback {
/**
* Called when the delete operation has completed.
*
* @param result Bundle containing the result of the delete operation
*/
void onResult(in Bundle result);
}
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.engage.protocol;

import android.os.Bundle;

/**
* Callback interface for publishClusters operation.
* This callback is used to receive the result of a cluster publishing operation.
*/
interface IAppEngageServicePublishClustersCallback {
/**
* Called when the publish operation has completed.
*
* @param result Bundle containing the result of the publish operation
*/
void onResult(in Bundle result);
}
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.engage.protocol;

import android.os.Bundle;

/**
* Callback interface for updatePublishStatus operation.
* This callback is used to receive the result of a status update operation.
*/
interface IAppEngageServicePublishStatusCallback {
/**
* Called when the status update operation has completed.
*
* @param result Bundle containing the result of the status update operation
*/
void onResult(in Bundle result);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* SPDX-FileCopyrightText: 2025 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package com.google.android.finsky.appcontentservice.engage

import android.content.Intent
import android.content.ServiceConnection
import android.os.IBinder
import android.util.Log
import androidx.lifecycle.LifecycleService

class AppEngageServiceV2 : LifecycleService() {
private val TAG = "AppEngageServiceV2"
override fun onCreate() {
super.onCreate()
Log.d(TAG, "onCreate: ")
}

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

override fun unbindService(conn: ServiceConnection) {
super.unbindService(conn)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.google.android.finsky.appcontentservice.engage

import android.os.Bundle
import android.util.Log
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import com.google.android.engage.protocol.IAppEngageService
import com.google.android.engage.protocol.IAppEngageServiceAvailableCallback
import com.google.android.engage.protocol.IAppEngageServiceDeleteClustersCallback
import com.google.android.engage.protocol.IAppEngageServicePublishClustersCallback
import com.google.android.engage.protocol.IAppEngageServicePublishStatusCallback

class AppEngageServiceV2Impl(override val lifecycle: Lifecycle) : IAppEngageService.Stub(), LifecycleOwner {
private val TAG = "AppEngageServiceV2Impl"
override fun publishClusters(bundle: Bundle?, callback: IAppEngageServicePublishClustersCallback?) {
Log.d(TAG, "publishClusters: ")
}

override fun deleteClusters(bundle: Bundle?, callback: IAppEngageServiceDeleteClustersCallback?) {
Log.d(TAG, "deleteClusters: ")
}

override fun isServiceAvailable(bundle: Bundle?, callback: IAppEngageServiceAvailableCallback?) {
Log.d(TAG, "isServiceAvailable: ")
val result = Bundle()
result.putBoolean("availability", false)
callback?.onResult(result)
}

override fun updatePublishStatus(bundle: Bundle?, callback: IAppEngageServicePublishStatusCallback?) {
Log.d(TAG, "updatePublishStatus: ")
}
}