Repo Created
This commit is contained in:
parent
eb305e2886
commit
a8c22c65db
4784 changed files with 329907 additions and 2 deletions
37
play-services-appset/build.gradle
Normal file
37
play-services-appset/build.gradle
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
android {
|
||||
namespace "com.google.android.gms.appset"
|
||||
|
||||
compileSdkVersion androidCompileSdk
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
buildFeatures {
|
||||
aidl = true
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
versionName version
|
||||
minSdkVersion androidMinSdk
|
||||
targetSdkVersion androidTargetSdk
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
}
|
||||
|
||||
description = 'microG implementation of play-services-appset'
|
||||
|
||||
dependencies {
|
||||
api project(':play-services-base')
|
||||
api project(':play-services-basement')
|
||||
|
||||
annotationProcessor project(':safe-parcel-processor')
|
||||
}
|
||||
56
play-services-appset/core/build.gradle
Normal file
56
play-services-appset/core/build.gradle
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'kotlin-android'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'signing'
|
||||
|
||||
dependencies {
|
||||
api project(':play-services-appset')
|
||||
|
||||
implementation project(':play-services-base-core')
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutineVersion"
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion"
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "org.microg.gms.appset.core"
|
||||
|
||||
compileSdkVersion androidCompileSdk
|
||||
buildToolsVersion "$androidBuildVersionTools"
|
||||
|
||||
defaultConfig {
|
||||
versionName version
|
||||
minSdkVersion androidMinSdk
|
||||
targetSdkVersion androidTargetSdk
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs = ['src/main/kotlin']
|
||||
}
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
disable 'MissingTranslation'
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = 1.8
|
||||
}
|
||||
}
|
||||
|
||||
// Nothing to publish yet
|
||||
//apply from: '../gradle/publish-android.gradle'
|
||||
|
||||
description = 'microG service implementation for play-services-appset'
|
||||
16
play-services-appset/core/src/main/AndroidManifest.xml
Normal file
16
play-services-appset/core/src/main/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application>
|
||||
|
||||
<service android:name="org.microg.gms.appset.AppSetService">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.appset.service.START" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package org.microg.gms.appset
|
||||
|
||||
import android.util.Log
|
||||
import com.google.android.gms.appset.AppSetIdInfo
|
||||
import com.google.android.gms.appset.AppSetIdRequestParams
|
||||
import com.google.android.gms.appset.AppSetInfoParcel
|
||||
import com.google.android.gms.appset.internal.IAppSetIdCallback
|
||||
import com.google.android.gms.appset.internal.IAppSetService
|
||||
import com.google.android.gms.common.ConnectionResult
|
||||
import com.google.android.gms.common.Feature
|
||||
import com.google.android.gms.common.api.Status
|
||||
import com.google.android.gms.common.internal.ConnectionInfo
|
||||
import com.google.android.gms.common.internal.GetServiceRequest
|
||||
import com.google.android.gms.common.internal.IGmsCallbacks
|
||||
import org.microg.gms.BaseService
|
||||
import org.microg.gms.common.GmsService
|
||||
import java.util.UUID
|
||||
|
||||
private const val TAG = "AppSetService"
|
||||
private val FEATURES = arrayOf(Feature("app_set_id", 1L))
|
||||
|
||||
class AppSetService : BaseService(TAG, GmsService.APP_SET) {
|
||||
|
||||
override fun handleServiceRequest(callback: IGmsCallbacks?, request: GetServiceRequest?, service: GmsService?) {
|
||||
callback?.onPostInitCompleteWithConnectionInfo(
|
||||
ConnectionResult.SUCCESS,
|
||||
AppSetServiceImpl().asBinder(),
|
||||
ConnectionInfo().apply { features = FEATURES }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
class AppSetServiceImpl : IAppSetService.Stub() {
|
||||
override fun getAppSetIdInfo(params: AppSetIdRequestParams?, callback: IAppSetIdCallback?) {
|
||||
Log.d(TAG, "AppSetServiceImp getAppSetIdInfo is called -> ${params?.toString()} ")
|
||||
callback?.onAppSetInfo(Status.SUCCESS, AppSetInfoParcel(UUID.randomUUID().toString(), AppSetIdInfo.SCOPE_APP))
|
||||
}
|
||||
}
|
||||
4
play-services-appset/src/main/AndroidManifest.xml
Normal file
4
play-services-appset/src/main/AndroidManifest.xml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.appset;
|
||||
|
||||
parcelable AppSetIdRequestParams;
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.appset;
|
||||
|
||||
parcelable AppSetInfoParcel;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.appset.internal;
|
||||
|
||||
import com.google.android.gms.appset.AppSetInfoParcel;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
|
||||
interface IAppSetIdCallback {
|
||||
void onAppSetInfo(in Status status, in AppSetInfoParcel info) = 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.appset.internal;
|
||||
|
||||
import com.google.android.gms.appset.AppSetIdRequestParams;
|
||||
import com.google.android.gms.appset.internal.IAppSetIdCallback;
|
||||
|
||||
interface IAppSetService {
|
||||
void getAppSetIdInfo(in AppSetIdRequestParams params, in IAppSetIdCallback callback) = 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.appset;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* Entry point of the app set APIs.
|
||||
*/
|
||||
public class AppSet {
|
||||
/**
|
||||
* Creates a new instance of {@link AppSetIdClient}.
|
||||
*/
|
||||
@NonNull
|
||||
public static AppSetIdClient getClient (Context context) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.appset;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
|
||||
/**
|
||||
* A client for interacting with the {@link AppSetIdInfo} API.
|
||||
*/
|
||||
public interface AppSetIdClient {
|
||||
/**
|
||||
* Gets the AppSetIdInfo asynchronously.
|
||||
*
|
||||
* @return a {@link Task} of the returned {@link AppSetIdInfo}.
|
||||
*/
|
||||
@NonNull
|
||||
Task<AppSetIdInfo> getAppSetIdInfo();
|
||||
}
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
|
||||
package com.google.android.gms.appset;
|
||||
|
||||
import androidx.annotation.IntDef;
|
||||
import org.microg.gms.common.Hide;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Contains information about app set ID.
|
||||
*/
|
||||
public class AppSetIdInfo {
|
||||
/**
|
||||
* The app set ID is scoped to the app.
|
||||
*/
|
||||
public static final int SCOPE_APP = 1;
|
||||
/**
|
||||
* The app set ID is scoped to a developer account on an app store. All apps from the same developer on a device will have
|
||||
* the same developer scoped app set ID.
|
||||
*/
|
||||
public static final int SCOPE_DEVELOPER = 2;
|
||||
|
||||
private final String id;
|
||||
private final @Scope int scope;
|
||||
|
||||
@Hide
|
||||
public AppSetIdInfo(String id, @Scope int scope) {
|
||||
this.id = id;
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the app set ID.
|
||||
*
|
||||
* @return the app set ID.
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link AppSetIdInfo.Scope} of the app set ID. Possible values include {@link #SCOPE_APP} and {@link #SCOPE_DEVELOPER}.
|
||||
*
|
||||
* @return the app set ID's {@link AppSetIdInfo.Scope}.
|
||||
*/
|
||||
public @Scope int getScope() {
|
||||
return scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allowed constants for {@link AppSetIdInfo#getScope()}.
|
||||
* <p>
|
||||
* Supported constants:
|
||||
* <ul>
|
||||
* <li>{@link #SCOPE_APP}</li>
|
||||
* <li>{@link #SCOPE_DEVELOPER}</li>
|
||||
* </ul>
|
||||
*/
|
||||
@Target({ElementType.TYPE_USE})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({SCOPE_APP, SCOPE_DEVELOPER})
|
||||
public @interface Scope {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.appset;
|
||||
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
|
||||
|
||||
import org.microg.gms.common.Hide;
|
||||
import org.microg.gms.utils.ToStringHelper;
|
||||
|
||||
@SafeParcelable.Class
|
||||
@Hide
|
||||
public class AppSetIdRequestParams extends AbstractSafeParcelable {
|
||||
@Field(1)
|
||||
public final String version;
|
||||
@Field(2)
|
||||
public final String clientAppPackageName;
|
||||
|
||||
@Constructor
|
||||
public AppSetIdRequestParams(@Param(1) String version, @Param(2) String clientAppPackageName) {
|
||||
this.version = version;
|
||||
this.clientAppPackageName = clientAppPackageName;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringHelper.name("AppSetIdRequestParams").field("version", version).field("clientAppPackageName", clientAppPackageName).end();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||
CREATOR.writeToParcel(this, dest, flags);
|
||||
}
|
||||
|
||||
public static final SafeParcelableCreatorAndWriter<AppSetIdRequestParams> CREATOR = findCreator(AppSetIdRequestParams.class);
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2023 microG Project Team
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package com.google.android.gms.appset;
|
||||
|
||||
import android.os.Parcel;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
|
||||
import com.google.android.gms.common.internal.safeparcel.SafeParcelableCreatorAndWriter;
|
||||
import org.microg.gms.common.Hide;
|
||||
|
||||
@SafeParcelable.Class
|
||||
@Hide
|
||||
public class AppSetInfoParcel extends AbstractSafeParcelable {
|
||||
@Field(1)
|
||||
public final String id;
|
||||
@Field(2)
|
||||
public final int scope;
|
||||
|
||||
@Constructor
|
||||
public AppSetInfoParcel(@Param(1) String id, @Param(2) int scope) {
|
||||
this.id = id;
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||
CREATOR.writeToParcel(this, dest, flags);
|
||||
}
|
||||
|
||||
public static final SafeParcelableCreatorAndWriter<AppSetInfoParcel> CREATOR = findCreator(AppSetInfoParcel.class);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 microG Project Team
|
||||
* SPDX-License-Identifier: CC-BY-4.0
|
||||
* Notice: Portions of this file are reproduced from work created and shared by Google and used
|
||||
* according to terms described in the Creative Commons 4.0 Attribution License.
|
||||
* See https://developers.google.com/readme/policies for details.
|
||||
*/
|
||||
/**
|
||||
* For analytics or fraud prevention use cases, on a given device you may
|
||||
need to correlate usage or actions across a set of apps owned by your organization.
|
||||
*/
|
||||
package com.google.android.gms.appset;
|
||||
Loading…
Add table
Add a link
Reference in a new issue