Skip to content

Commit

Permalink
Move things and add more details to appset
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in committed Feb 17, 2024
1 parent e55982b commit c5647c7
Show file tree
Hide file tree
Showing 13 changed files with 238 additions and 25 deletions.
56 changes: 56 additions & 0 deletions play-services-appset/core/build.gradle
Original file line number Diff line number Diff line change
@@ -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 changes: 16 additions & 0 deletions play-services-appset/core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-FileCopyrightText: 2024 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.appset.internal
package org.microg.gms.appset

import android.util.Log
import com.google.android.gms.appset.AppSetIdRequestParams
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
Expand Down Expand Up @@ -35,4 +37,4 @@ class AppSetServiceImpl : IAppSetService.Stub() {
Log.d(TAG, "AppSetServiceImp getAppSetIdInfo is called -> ${params?.toString()} ")
callback?.onAppSetInfo(Status.SUCCESS, null)
}
}
}
Original file line number Diff line number Diff line change
@@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* 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();
}
Original file line number Diff line number Diff line change
@@ -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 {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
12 changes: 3 additions & 9 deletions play-services-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -835,30 +835,24 @@
</intent-filter>
</service>

<service android:name="com.google.android.gms.pseudonymous.PseudonymousIdService" >
<service android:name="org.microg.gms.pseudonymous.PseudonymousIdService" >
<intent-filter>
<action android:name="com.google.android.gms.pseudonymous.service.START" />
</intent-filter>
</service>

<service android:name="com.google.android.gms.gass.internal.GassService">
<service android:name="org.microg.gms.gass.GassService">
<intent-filter>
<action android:name="com.google.android.gms.gass.START" />
</intent-filter>
</service>

<service android:name="com.google.android.gms.org.microg.gms.auth.account.data.AccountDataService">
<service android:name="org.microg.gms.auth.account.data.AccountDataService">
<intent-filter>
<action android:name="com.google.android.gms.auth.account.data.service.START" />
</intent-filter>
</service>

<service android:name="com.google.android.gms.appset.internal.AppSetService">
<intent-filter>
<action android:name="com.google.android.gms.appset.service.START" />
</intent-filter>
</service>

<service android:name=".semanticlocation.SemanticLocationService" android:exported="true">
<intent-filter>
<action android:name="com.google.android.gms.semanticlocation.service.START_ODLH" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-FileCopyrightText: 2024 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package com.google.android.gms.gass.internal
package org.microg.gms.gass

import android.os.Bundle
import android.util.Log
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.internal.GetServiceRequest
import com.google.android.gms.common.internal.IGmsCallbacks
import com.google.android.gms.gass.internal.GassRequestParcel
import com.google.android.gms.gass.internal.GassResponseParcel
import com.google.android.gms.gass.internal.IGassService
import org.microg.gms.BaseService
import org.microg.gms.common.GmsService

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* SPDX-FileCopyrightText: 2023 microG Project Team
* SPDX-FileCopyrightText: 2024 microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/

package com.google.android.gms.pseudonymous
package org.microg.gms.pseudonymous

import android.util.Log
import com.google.android.gms.common.Feature
Expand All @@ -12,6 +12,7 @@ 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 com.google.android.gms.pseudonymous.PseudonymousIdToken
import com.google.android.gms.pseudonymous.internal.IPseudonymousIdCallbacks
import com.google.android.gms.pseudonymous.internal.IPseudonymousIdService
import org.microg.gms.BaseService
Expand Down
19 changes: 10 additions & 9 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
def sublude(name) {
def projectName = ':' + name.substring(1).replace(':', '-')
include projectName
project(projectName).projectDir = file(name.substring(1).replace(':', '/'))
def projectName = ':' + name.substring(1).replace(':', '-')
include projectName
project(projectName).projectDir = file(name.substring(1).replace(':', '/'))
}

def localProperties = new Properties()
try {
var stream = new File(rootDir, 'local.properties').newDataInputStream()
localProperties.load(stream)
stream.close()
var stream = new File(rootDir, 'local.properties').newDataInputStream()
localProperties.load(stream)
stream.close()
} catch (ignored) {
// Ignore
// Ignore
}
def hasModule = (String name, boolean enabledByDefault) -> {
return localProperties.getProperty("modules." + name, enabledByDefault.toString()).toBoolean()
return localProperties.getProperty("modules." + name, enabledByDefault.toString()).toBoolean()
}

include ':fake-signature'
Expand Down Expand Up @@ -77,6 +77,7 @@ sublude ':play-services-ads:core'
sublude ':play-services-ads-identifier:core'
sublude ':play-services-ads-lite:core'
sublude ':play-services-appinvite:core'
sublude ':play-services-appset:core'
sublude ':play-services-auth-api-phone:core'
sublude ':play-services-base:core'
sublude ':play-services-base:core:package'
Expand Down Expand Up @@ -110,4 +111,4 @@ sublude ':play-services-wearable:core'
sublude ':firebase-auth:core'

include ':play-services-core:microg-ui-tools' // Legacy
include ':play-services-core'
include ':play-services-core'

0 comments on commit c5647c7

Please sign in to comment.