-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'microg:master' into patch-3
- Loading branch information
Showing
525 changed files
with
38,385 additions
and
3,901 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
android { | ||
compileSdkVersion androidCompileSdk | ||
buildToolsVersion "$androidBuildVersionTools" | ||
|
||
defaultConfig { | ||
versionName version | ||
minSdkVersion androidMinSdk | ||
targetSdkVersion androidTargetSdk | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
apply from: '../gradle/publish-android.gradle' | ||
|
||
description = 'microG implementation of play-services-ads-base' | ||
|
||
dependencies { | ||
api project(':play-services-basement') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ SPDX-FileCopyrightText: 2023 microG Project Team | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
<manifest package="com.google.android.gms.ads_base"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
android { | ||
compileSdkVersion androidCompileSdk | ||
buildToolsVersion "$androidBuildVersionTools" | ||
|
||
defaultConfig { | ||
versionName version | ||
minSdkVersion androidMinSdk | ||
targetSdkVersion androidTargetSdk | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_8 | ||
targetCompatibility JavaVersion.VERSION_1_8 | ||
} | ||
} | ||
|
||
apply from: '../gradle/publish-android.gradle' | ||
|
||
description = 'microG implementation of play-services-ads-identifier' | ||
|
||
dependencies { | ||
api project(':play-services-basement') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
|
||
dependencies { | ||
api project(':play-services-ads-identifier') | ||
implementation project(':play-services-base-core') | ||
} | ||
|
||
android { | ||
compileSdkVersion androidCompileSdk | ||
buildToolsVersion "$androidBuildVersionTools" | ||
|
||
defaultConfig { | ||
versionName version | ||
minSdkVersion androidMinSdk | ||
targetSdkVersion androidTargetSdk | ||
} | ||
|
||
sourceSets { | ||
main.java.srcDirs += 'src/main/kotlin' | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility = 1.8 | ||
targetCompatibility = 1.8 | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
play-services-ads-identifier/core/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ SPDX-FileCopyrightText: 2023 microG Project Team | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
<manifest package="org.microg.gms.ads.identifier" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<application> | ||
<service android:name=".AdvertisingIdService"> | ||
<intent-filter> | ||
<action android:name="com.google.android.gms.ads.identifier.service.START" /> | ||
<category android:name="android.intent.category.DEFAULT" /> | ||
</intent-filter> | ||
</service> | ||
</application> | ||
</manifest> |
34 changes: 34 additions & 0 deletions
34
...ads-identifier/core/src/main/kotlin/org/microg/gms/ads/identifier/AdvertisingIdService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 microG Project Team | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package org.microg.gms.ads.identifier | ||
|
||
import android.app.Service | ||
import android.content.Intent | ||
import android.os.IBinder | ||
import com.google.android.gms.ads.identifier.internal.IAdvertisingIdService | ||
|
||
class AdvertisingIdService : Service() { | ||
override fun onBind(intent: Intent): IBinder? { | ||
return AdvertisingIdServiceImpl().asBinder() | ||
} | ||
} | ||
|
||
class AdvertisingIdServiceImpl : IAdvertisingIdService.Stub() { | ||
override fun getAdvertisingId(): String { | ||
return "00000000-0000-0000-0000-000000000000" | ||
} | ||
|
||
override fun isAdTrackingLimited(defaultHint: Boolean): Boolean { | ||
return true | ||
} | ||
|
||
override fun generateAdvertisingId(packageName: String): String { | ||
return advertisingId // Ad tracking limited | ||
} | ||
|
||
override fun setAdTrackingLimited(packageName: String, limited: Boolean) { | ||
// Ignored, sorry :) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
~ SPDX-FileCopyrightText: 2023 microG Project Team | ||
~ SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
|
||
<manifest package="com.google.android.gms.ads.identifier"/> |
File renamed without changes.
80 changes: 80 additions & 0 deletions
80
...s-identifier/src/main/java/com/google/android/gms/ads/identifier/AdvertisingIdClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 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.ads.identifier; | ||
|
||
import android.app.Activity; | ||
import android.content.Context; | ||
import android.provider.Settings; | ||
import com.google.android.gms.common.GooglePlayServicesNotAvailableException; | ||
import com.google.android.gms.common.GooglePlayServicesRepairableException; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* Helper library for retrieval of advertising ID and related information such as the limit ad tracking setting. | ||
* <p> | ||
* It is intended that the advertising ID completely replace existing usage of other identifiers for ads purposes (such as use | ||
* of {@code ANDROID_ID} in {@link Settings.Secure}) when Google Play Services is available. Cases where Google Play Services is | ||
* unavailable are indicated by a {@link GooglePlayServicesNotAvailableException} being thrown by getAdvertisingIdInfo(). | ||
*/ | ||
public class AdvertisingIdClient { | ||
/** | ||
* Retrieves the user's advertising ID and limit ad tracking preference. | ||
* <p> | ||
* This method cannot be called in the main thread as it may block leading to ANRs. An {@code IllegalStateException} will be | ||
* thrown if this is called on the main thread. | ||
* | ||
* @param context Current {@link Context} (such as the current {@link Activity}). | ||
* @return AdvertisingIdClient.Info with user's advertising ID and limit ad tracking preference. | ||
* @throws IOException signaling connection to Google Play Services failed. | ||
* @throws IllegalStateException indicating this method was called on the main thread. | ||
* @throws GooglePlayServicesNotAvailableException indicating that Google Play is not installed on this device. | ||
* @throws GooglePlayServicesRepairableException indicating that there was a recoverable error connecting to Google Play Services. | ||
*/ | ||
public static Info getAdvertisingIdInfo(Context context) { | ||
// We don't actually implement this functionality, but always claim that ad tracking was limited by user preference | ||
return new Info("00000000-0000-0000-0000-000000000000", true); | ||
} | ||
|
||
/** | ||
* Includes both the advertising ID as well as the limit ad tracking setting. | ||
*/ | ||
public static class Info { | ||
private final String advertisingId; | ||
private final boolean limitAdTrackingEnabled; | ||
|
||
/** | ||
* Constructs an {@code Info} Object with the specified advertising Id and limit ad tracking setting. | ||
* | ||
* @param advertisingId The advertising ID. | ||
* @param limitAdTrackingEnabled The limit ad tracking setting. It is true if the user has limit ad tracking enabled. False, otherwise. | ||
*/ | ||
public Info(String advertisingId, boolean limitAdTrackingEnabled) { | ||
this.advertisingId = advertisingId; | ||
this.limitAdTrackingEnabled = limitAdTrackingEnabled; | ||
} | ||
|
||
/** | ||
* Retrieves the advertising ID. | ||
*/ | ||
public String getId() { | ||
return advertisingId; | ||
} | ||
|
||
/** | ||
* Retrieves whether the user has limit ad tracking enabled or not. | ||
* <p> | ||
* When the returned value is true, the returned value of {@link #getId()} will always be | ||
* {@code 00000000-0000-0000-0000-000000000000} starting with Android 12. | ||
*/ | ||
public boolean isLimitAdTrackingEnabled() { | ||
return limitAdTrackingEnabled; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ices-ads-identifier/src/main/java/com/google/android/gms/ads/identifier/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* 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. | ||
*/ | ||
/** | ||
* Contains classes relating to the Android Advertising ID (AAID). | ||
*/ | ||
package com.google.android.gms.ads.identifier; |
Oops, something went wrong.