diff --git a/Android.mk b/Android.mk index 5416ad10..2f7c68b6 100644 --- a/Android.mk +++ b/Android.mk @@ -22,20 +22,20 @@ LOCAL_PACKAGE_NAME := GmsCore gmscore_root := $(LOCAL_PATH) gmscore_dir := play-services-core gmscore_out := $(TARGET_COMMON_OUT_ROOT)/obj/APPS/$(LOCAL_MODULE)_intermediates -gmscore_build := $(gmscore_root)/$(gmscore_dir)/build -gmscore_apk := build/outputs/apk/release/play-services-core-release-unsigned.apk +gmscore_build := $(gmscore_dir)/build +gmscore_apk := $(gmscore_build)/outputs/apk/release/play-services-core-release-unsigned.apk -$(gmscore_root)/$(gmscore_dir)/$(gmscore_apk): - rm -Rf $(gmscore_build) +$(gmscore_root)/$(gmscore_apk): + rm -Rf $(gmscore_root)/$(gmscore_build) mkdir -p $(ANDROID_BUILD_TOP)/$(gmscore_out) - ln -s $(ANDROID_BUILD_TOP)/$(gmscore_out) $(ANDROID_BUILD_TOP)/$(gmscore_build) + ln -s $(ANDROID_BUILD_TOP)/$(gmscore_out) $(ANDROID_BUILD_TOP)/$(gmscore_root)/$(gmscore_build) echo "sdk.dir=$(ANDROID_HOME)" > $(gmscore_root)/local.properties cd $(gmscore_root) && git submodule update --recursive --init cd $(gmscore_root)/$(gmscore_dir) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ../gradlew assembleRelease LOCAL_CERTIFICATE := platform -LOCAL_SRC_FILES := $(gmscore_dir)/$(gmscore_apk) +LOCAL_SRC_FILES := $(gmscore_apk) LOCAL_MODULE_CLASS := APPS LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) -include $(BUILD_PREBUILT) +include $(BUILD_PREBUILT) \ No newline at end of file diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt new file mode 100644 index 00000000..0e259d42 --- /dev/null +++ b/LICENSES/CC0-1.0.txt @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/build.gradle b/build.gradle index 65ee0b65..51afd3a0 100644 --- a/build.gradle +++ b/build.gradle @@ -4,31 +4,9 @@ */ buildscript { - ext.cronetVersion = '91.0.4472.120.1' - ext.safeParcelVersion = '1.7.0' - - ext.kotlinVersion = '1.4.32' - ext.coroutineVersion = '1.3.8' - - ext.annotationVersion = '1.2.0' - ext.appcompatVersion = '1.2.0' - ext.fragmentVersion = '1.3.0' - ext.lifecycleVersion = '2.3.1' - ext.mediarouterVersion = '1.2.2' - ext.navigationVersion = '2.3.5' - ext.preferenceVersion = '1.1.1' - ext.recyclerviewVersion = '1.1.0' - - ext.supportLibraryVersion = "28.0.0" - ext.wireVersion = '3.2.2' - - ext.androidBuildGradleVersion = "4.1.0" - - ext.androidBuildVersionTools = "30.0.2" - ext.androidMinSdk = 21 ext.androidTargetSdk = 29 - ext.androidCompileSdk = 30 + ext.androidCompileSdk = 31 repositories { jcenter() @@ -36,9 +14,9 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.0.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" - classpath "com.squareup.wire:wire-gradle-plugin:$wireVersion" + classpath 'com.android.tools.build:gradle:7.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" + classpath "com.squareup.wire:wire-gradle-plugin:3.2.2" } } @@ -46,8 +24,8 @@ allprojects { apply plugin: 'idea' group = 'org.microg.gms' - version = "0.2.22.212658" - ext.appVersionCode = 212658001 + version = "0.2.23.220217" + ext.appVersionCode = 220217001 ext.isReleaseVersion = false } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5f8423db..942d8725 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Sep 11 09:04:01 CEST 2021 +#Wed Jan 26 02:00:21 CET 2022 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fbd7c515..60cf9e8c 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,8 @@ -#!/usr/bin/env sh +#!/bin/sh +# SPDX-License-Identifier: Apache-2.0 # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +18,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,99 +122,112 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) -exec "$JAVACMD" "$@" + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" \ No newline at end of file diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle index 3eb582b8..a7e8a5c4 100644 --- a/play-services-api/build.gradle +++ b/play-services-api/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk diff --git a/play-services-api/src/main/aidl/com/google/android/gms/ads/AdManagerCreator.aidl b/play-services-api/src/main/aidl/com/google/android/gms/ads/AdManagerCreator.aidl new file mode 100644 index 00000000..7e07dd01 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/ads/AdManagerCreator.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.ads; + +interface AdManagerCreator { +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/ads/identifier/internal/IAdvertisingIdService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/ads/identifier/internal/IAdvertisingIdService.aidl new file mode 100644 index 00000000..5f4f5c1f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/ads/identifier/internal/IAdvertisingIdService.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.ads.identifier.internal; + +interface IAdvertisingIdService { + String getAdvertisingId() = 0; + boolean isAdTrackingLimited(boolean defaultHint) = 1; + String generateAdvertisingId(String packageName) = 2; + void setAdTrackingLimited(String packageName, boolean limited) = 3; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/internal/IAuthCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/internal/IAuthCallbacks.aidl new file mode 100644 index 00000000..ae8e79c5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/internal/IAuthCallbacks.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.auth.api.internal; + +import com.google.android.gms.auth.api.proxy.ProxyResponse; + +interface IAuthCallbacks { + void onProxyResponse(in ProxyResponse response) = 0; + void onSpatulaHeader(String spatulaHeader) = 1; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/internal/IAuthService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/internal/IAuthService.aidl new file mode 100644 index 00000000..a5f6a537 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/internal/IAuthService.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.auth.api.internal; + +import com.google.android.gms.auth.api.internal.IAuthCallbacks; +//import com.google.android.gms.auth.api.proxy.ProxyGrpcRequest; +import com.google.android.gms.auth.api.proxy.ProxyRequest; + +interface IAuthService { + void performProxyRequest(IAuthCallbacks callbacks, in ProxyRequest request) = 0; +// void performProxyGrpcRequest(IAuthCallback callbacks, in ProxyGrpcRequest request) = 1; + void getSpatulaHeader(IAuthCallbacks callbacks) = 2; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/proxy/ProxyRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/proxy/ProxyRequest.aidl new file mode 100644 index 00000000..fa5885f8 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/proxy/ProxyRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.proxy; + +parcelable ProxyRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/proxy/ProxyResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/proxy/ProxyResponse.aidl new file mode 100644 index 00000000..eae21f3c --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/proxy/ProxyResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.proxy; + +parcelable ProxyResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/appcert/IAppCertService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/appcert/IAppCertService.aidl new file mode 100644 index 00000000..ee7f7338 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/appcert/IAppCertService.aidl @@ -0,0 +1,6 @@ +package com.google.android.gms.auth.appcert; + +interface IAppCertService { + boolean fetchDeviceKey() = 0; + String getSpatulaHeader(String packageName) = 1; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/checkin/internal/ICheckinService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/checkin/internal/ICheckinService.aidl index 6ac61289..973de92f 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/checkin/internal/ICheckinService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/checkin/internal/ICheckinService.aidl @@ -2,4 +2,6 @@ package com.google.android.gms.checkin.internal; interface ICheckinService { String getDeviceDataVersionInfo(); + long getLastCheckinSuccessTime(); + String getLastSimOperator(); } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl index 31042db8..61e23cff 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl @@ -1,7 +1,13 @@ package com.google.android.gms.clearcut.internal; import com.google.android.gms.common.api.Status; +import com.google.android.gms.common.data.DataHolder; interface IClearcutLoggerCallbacks { - oneway void onStatus(in Status status) = 0; + oneway void onLogResult(in Status status) = 0; + oneway void onForceUploadResult(in Status status) = 1; + oneway void onStartCollectForDebugResult(in Status status, long l) = 2; + oneway void onStopCollectForDebugResult(in Status status) = 3; + oneway void onCollectForDebugExpiryTime(in Status status, long l) = 4; + oneway void onLogEventParcelables(in DataHolder data) = 6; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl index b2f1b2fd..018252e0 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl @@ -4,5 +4,11 @@ import com.google.android.gms.clearcut.internal.IClearcutLoggerCallbacks; import com.google.android.gms.clearcut.LogEventParcelable; interface IClearcutLoggerService { - void log(IClearcutLoggerCallbacks callbacks, in LogEventParcelable event) = 0; + oneway void log(IClearcutLoggerCallbacks callbacks, in LogEventParcelable event) = 0; + oneway void forceUpload(IClearcutLoggerCallbacks callbacks) = 1; + oneway void startCollectForDebug(IClearcutLoggerCallbacks callbacks) = 2; + oneway void stopCollectForDebug(IClearcutLoggerCallbacks callbacks) = 3; + oneway void getCollectForDebugExpiryTime(IClearcutLoggerCallbacks callbacks) = 4; + oneway void getLogEventParcelablesLegacy(IClearcutLoggerCallbacks callbacks) = 5; + oneway void getLogEventParcelables(IClearcutLoggerCallbacks callbacks) = 6; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/PlayLoggerContext.aidl b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/PlayLoggerContext.aidl new file mode 100644 index 00000000..e213b96c --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/PlayLoggerContext.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.clearcut.internal; + +parcelable PlayLoggerContext; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddEventListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddEventListenerRequest.aidl new file mode 100644 index 00000000..843b1e0a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddEventListenerRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable AddEventListenerRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddPermissionRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddPermissionRequest.aidl new file mode 100644 index 00000000..ba0f503d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AddPermissionRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable AddPermissionRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AuthorizeAccessRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AuthorizeAccessRequest.aidl new file mode 100644 index 00000000..70c19305 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/AuthorizeAccessRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable AuthorizeAccessRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CancelPendingActionsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CancelPendingActionsRequest.aidl new file mode 100644 index 00000000..30696de0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CancelPendingActionsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CancelPendingActionsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.aidl new file mode 100644 index 00000000..dfd43f74 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ChangeResourceParentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeSequenceNumber.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeSequenceNumber.aidl new file mode 100644 index 00000000..05f32cb3 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangeSequenceNumber.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ChangeSequenceNumber; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangesResponse.aidl new file mode 100644 index 00000000..b4107a0e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ChangesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ChangesResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.aidl new file mode 100644 index 00000000..eb7001c0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CheckResourceIdsExistRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.aidl new file mode 100644 index 00000000..b513f449 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CloseContentsAndUpdateMetadataRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsRequest.aidl new file mode 100644 index 00000000..43536051 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CloseContentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CloseContentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ContentsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ContentsResponse.aidl new file mode 100644 index 00000000..bf226dc0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ContentsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ContentsResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ControlProgressRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ControlProgressRequest.aidl new file mode 100644 index 00000000..7e330658 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ControlProgressRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ControlProgressRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateContentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateContentsRequest.aidl new file mode 100644 index 00000000..7c7452f7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateContentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CreateContentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.aidl new file mode 100644 index 00000000..300d82c6 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CreateFileIntentSenderRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileRequest.aidl new file mode 100644 index 00000000..be852bc5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFileRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CreateFileRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFolderRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFolderRequest.aidl new file mode 100644 index 00000000..a1b7c8f2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/CreateFolderRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable CreateFolderRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeleteResourceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeleteResourceRequest.aidl new file mode 100644 index 00000000..c8bbef83 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeleteResourceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DeleteResourceRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.aidl new file mode 100644 index 00000000..1b85028b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DeviceUsagePreferenceResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DisconnectRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DisconnectRequest.aidl new file mode 100644 index 00000000..22cf3ad1 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DisconnectRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DisconnectRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DownloadProgressResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DownloadProgressResponse.aidl new file mode 100644 index 00000000..d3ead69d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DownloadProgressResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DownloadProgressResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveIdResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveIdResponse.aidl new file mode 100644 index 00000000..4655cb3f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveIdResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DriveIdResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DrivePreferencesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DrivePreferencesResponse.aidl new file mode 100644 index 00000000..e14152f2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DrivePreferencesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DrivePreferencesResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveServiceResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveServiceResponse.aidl new file mode 100644 index 00000000..424c2cac --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/DriveServiceResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable DriveServiceResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/EventResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/EventResponse.aidl new file mode 100644 index 00000000..0f748bb9 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/EventResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable EventResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailRequest.aidl new file mode 100644 index 00000000..06b38bd8 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable FetchThumbnailRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailResponse.aidl new file mode 100644 index 00000000..022ffda3 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/FetchThumbnailResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable FetchThumbnailResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetChangesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetChangesRequest.aidl new file mode 100644 index 00000000..8992b053 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetChangesRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetChangesRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.aidl new file mode 100644 index 00000000..821aefb5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetDriveIdFromUniqueIdRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetMetadataRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetMetadataRequest.aidl new file mode 100644 index 00000000..9d1a31b9 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetMetadataRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetMetadataRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsRequest.aidl new file mode 100644 index 00000000..ae706840 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetPermissionsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsResponse.aidl new file mode 100644 index 00000000..845d8325 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/GetPermissionsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable GetPermissionsResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveService.aidl new file mode 100644 index 00000000..a1e2e085 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveService.aidl @@ -0,0 +1,95 @@ +package com.google.android.gms.drive.internal; + +import com.google.android.gms.drive.internal.DriveServiceResponse; +import com.google.android.gms.drive.internal.IDriveServiceCallbacks; +import com.google.android.gms.drive.internal.IEventCallback; + +import com.google.android.gms.drive.internal.AddEventListenerRequest; +import com.google.android.gms.drive.internal.AddPermissionRequest; +import com.google.android.gms.drive.internal.AuthorizeAccessRequest; +import com.google.android.gms.drive.internal.CancelPendingActionsRequest; +import com.google.android.gms.drive.internal.ChangeResourceParentsRequest; +import com.google.android.gms.drive.internal.CheckResourceIdsExistRequest; +import com.google.android.gms.drive.internal.CloseContentsAndUpdateMetadataRequest; +import com.google.android.gms.drive.internal.CloseContentsRequest; +import com.google.android.gms.drive.internal.ControlProgressRequest; +import com.google.android.gms.drive.internal.CreateContentsRequest; +import com.google.android.gms.drive.internal.CreateFileRequest; +import com.google.android.gms.drive.internal.CreateFileIntentSenderRequest; +import com.google.android.gms.drive.internal.CreateFolderRequest; +import com.google.android.gms.drive.internal.DeleteResourceRequest; +import com.google.android.gms.drive.internal.DisconnectRequest; +import com.google.android.gms.drive.internal.FetchThumbnailRequest; +import com.google.android.gms.drive.internal.GetChangesRequest; +import com.google.android.gms.drive.internal.GetDriveIdFromUniqueIdRequest; +import com.google.android.gms.drive.internal.GetMetadataRequest; +import com.google.android.gms.drive.internal.GetPermissionsRequest; +import com.google.android.gms.drive.internal.ListParentsRequest; +import com.google.android.gms.drive.internal.LoadRealtimeRequest; +import com.google.android.gms.drive.internal.OpenContentsRequest; +import com.google.android.gms.drive.internal.OpenFileIntentSenderRequest; +import com.google.android.gms.drive.internal.RealtimeDocumentSyncRequest; +import com.google.android.gms.drive.internal.RemoveEventListenerRequest; +import com.google.android.gms.drive.internal.RemovePermissionRequest; +import com.google.android.gms.drive.internal.SetDrivePreferencesRequest; +import com.google.android.gms.drive.internal.SetFileUploadPreferencesRequest; +import com.google.android.gms.drive.internal.SetResourceParentsRequest; +import com.google.android.gms.drive.internal.StreamContentsRequest; +import com.google.android.gms.drive.internal.TrashResourceRequest; +import com.google.android.gms.drive.internal.UnsubscribeResourceRequest; +import com.google.android.gms.drive.internal.UntrashResourceRequest; +import com.google.android.gms.drive.internal.UpdateMetadataRequest; +import com.google.android.gms.drive.internal.UpdatePermissionRequest; + +interface IDriveService { + void getMetadata(in GetMetadataRequest request, IDriveServiceCallbacks callbacks) = 0; + + void updateMetadata(in UpdateMetadataRequest request, IDriveServiceCallbacks callbacks) = 2; + void createContents(in CreateContentsRequest request, IDriveServiceCallbacks callbacks) = 3; + void createFile(in CreateFileRequest request, IDriveServiceCallbacks callbacks) = 4; + void createFolder(in CreateFolderRequest request, IDriveServiceCallbacks callbacks) = 5; + DriveServiceResponse openContents(in OpenContentsRequest request, IDriveServiceCallbacks callbacks) = 6; + void closeContents(in CloseContentsRequest request, IDriveServiceCallbacks callbacks) = 7; + void requestSync(IDriveServiceCallbacks callbacks) = 8; + IntentSender openFileIntentSender(in OpenFileIntentSenderRequest request) = 9; + IntentSender createFileIntentSender(in CreateFileIntentSenderRequest request) = 10; + void authorizeAccess(in AuthorizeAccessRequest request, IDriveServiceCallbacks callbacks) = 11; + void listParents(in ListParentsRequest request, IDriveServiceCallbacks callbacks) = 12; + void addEventListener(in AddEventListenerRequest request, IEventCallback callback, String unused, IDriveServiceCallbacks callbacks) = 13; + void removeEventListener(in RemoveEventListenerRequest request, IEventCallback callback, String unused, IDriveServiceCallbacks callbacks) = 14; + void disconnect(in DisconnectRequest request) = 15; + void trashResource(in TrashResourceRequest request, IDriveServiceCallbacks callbacks) = 16; + void closeContentsAndUpdateMetadata(in CloseContentsAndUpdateMetadataRequest request, IDriveServiceCallbacks callbacks) = 17; + + void deleteResource(in DeleteResourceRequest request, IDriveServiceCallbacks callbacks) = 23; + + void loadRealtime(in LoadRealtimeRequest request, IDriveServiceCallbacks callbacks) = 26; + void setResourceParents(in SetResourceParentsRequest request, IDriveServiceCallbacks callbacks) = 27; + void getDriveIdFromUniqueId(in GetDriveIdFromUniqueIdRequest request, IDriveServiceCallbacks callbacks) = 28; + void checkResourceIdsExist(in CheckResourceIdsExistRequest request, IDriveServiceCallbacks callbacks) = 29; + void completePendingAction(IDriveServiceCallbacks callbacks) = 30; + void getDrivePreferences(IDriveServiceCallbacks callbacks) = 31; + void setDrivePreferences(in SetDrivePreferencesRequest request, IDriveServiceCallbacks callbacks) = 32; + void realtimeDocumentSync(in RealtimeDocumentSyncRequest request, IDriveServiceCallbacks callbacks) = 33; + void getDeviceUsagePreferences(IDriveServiceCallbacks callbacks) = 34; + void setFileUploadPreferences(in SetFileUploadPreferencesRequest request, IDriveServiceCallbacks callbacks) = 35; + void cancelPendingActions(in CancelPendingActionsRequest request, IDriveServiceCallbacks callbacks) = 36; + void untrashResource(in UntrashResourceRequest request, IDriveServiceCallbacks callbacks) = 37; + + void isAutoBackupEnabled(IDriveServiceCallbacks callbacks) = 40; + void fetchThumbnail(in FetchThumbnailRequest request, IDriveServiceCallbacks callbacks) = 41; + + void getChanges(in GetChangesRequest request, IDriveServiceCallbacks callbacks) = 43; + + void unsubscribeResource(in UnsubscribeResourceRequest request, IDriveServiceCallbacks callbacks) = 45; + void getPermissions(in GetPermissionsRequest request, IDriveServiceCallbacks callbacks) = 46; + void addPermission(in AddPermissionRequest request, IDriveServiceCallbacks callbacks) = 47; + void updatePermission(in UpdatePermissionRequest request, IDriveServiceCallbacks callbacks) = 48; + void removePermission(in RemovePermissionRequest request, IDriveServiceCallbacks callbacks) = 49; + + void removeQueryResultListener(IEventCallback callback, IDriveServiceCallbacks callbacks) = 51; + void controlProgress(in ControlProgressRequest request, IDriveServiceCallbacks callbacks) = 52; + + void changeResourceParents(in ChangeResourceParentsRequest request, IDriveServiceCallbacks callbacks) = 54; + DriveServiceResponse streamContents(in StreamContentsRequest request, IDriveServiceCallbacks callbacks) = 55; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveServiceCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveServiceCallbacks.aidl new file mode 100644 index 00000000..6fa1b204 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IDriveServiceCallbacks.aidl @@ -0,0 +1,48 @@ +package com.google.android.gms.drive.internal; + +import com.google.android.gms.drive.internal.IRealtimeService; + +import com.google.android.gms.drive.internal.DownloadProgressResponse; +import com.google.android.gms.drive.internal.ListEntriesResponse; +import com.google.android.gms.drive.internal.DriveIdResponse; +import com.google.android.gms.drive.internal.MetadataResponse; +import com.google.android.gms.drive.internal.ContentsResponse; +import com.google.android.gms.drive.internal.ListParentsResponse; +import com.google.android.gms.drive.internal.SyncMoreResponse; +import com.google.android.gms.drive.internal.LoadRealtimeResponse; +import com.google.android.gms.drive.internal.ResourceIdSetResponse; +import com.google.android.gms.drive.internal.DrivePreferencesResponse; +import com.google.android.gms.drive.internal.DeviceUsagePreferenceResponse; +import com.google.android.gms.drive.internal.FetchThumbnailResponse; +import com.google.android.gms.drive.internal.ChangeSequenceNumber; +import com.google.android.gms.drive.internal.ChangesResponse; +import com.google.android.gms.drive.internal.GetPermissionsResponse; +import com.google.android.gms.drive.internal.StringListResponse; +import com.google.android.gms.drive.internal.StartStreamSession; + +import com.google.android.gms.common.api.Status; + +interface IDriveServiceCallbacks { + void onDownloadProgress(in DownloadProgressResponse response) = 0; + void onListEntries(in ListEntriesResponse response) = 1; + void onDriveId(in DriveIdResponse response) = 2; + void onMetadata(in MetadataResponse response) = 3; + void onContents(in ContentsResponse response) = 4; + void onStatus(in Status status) = 5; + void onSuccess() = 6; + void onListParents(in ListParentsResponse response) = 7; + void onSyncMore(in SyncMoreResponse response) = 8; + + void onLoadRealtime(in LoadRealtimeResponse response, IRealtimeService realtimeService) = 10; + void onResourceIdSet(in ResourceIdSetResponse response) = 11; + void onDrivePreferences(in DrivePreferencesResponse response) = 12; + void onDeviceUsagePreference(in DeviceUsagePreferenceResponse response) = 13; + void onBooleanAnswer(boolean bool) = 14; + void onFetchThumbnail(in FetchThumbnailResponse response) = 15; + void onChangeSequenceNumber(in ChangeSequenceNumber csn) = 16; + void onChanges(in ChangesResponse response) = 17; + + void onGetPermissions(in GetPermissionsResponse response) = 19; + void onStringList(in StringListResponse response) = 20; + void onStartStreamSession(in StartStreamSession response) = 21; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IEventCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IEventCallback.aidl new file mode 100644 index 00000000..e50999f1 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IEventCallback.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.drive.internal; + +import com.google.android.gms.drive.internal.EventResponse; + +interface IEventCallback { + void onEventResponse(in EventResponse response) = 0; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IRealtimeService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IRealtimeService.aidl new file mode 100644 index 00000000..14d7cf86 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/IRealtimeService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.drive.internal; + +interface IRealtimeService { + // TODO +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListEntriesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListEntriesResponse.aidl new file mode 100644 index 00000000..9a3c5ac9 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListEntriesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ListEntriesResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsRequest.aidl new file mode 100644 index 00000000..b2271a98 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ListParentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsResponse.aidl new file mode 100644 index 00000000..04ebc591 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ListParentsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ListParentsResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeRequest.aidl new file mode 100644 index 00000000..b3b80b5d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable LoadRealtimeRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeResponse.aidl new file mode 100644 index 00000000..3ebc2672 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/LoadRealtimeResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable LoadRealtimeResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/MetadataResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/MetadataResponse.aidl new file mode 100644 index 00000000..4bfd6f88 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/MetadataResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable MetadataResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenContentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenContentsRequest.aidl new file mode 100644 index 00000000..4fc8534f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenContentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable OpenContentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.aidl new file mode 100644 index 00000000..836ba532 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable OpenFileIntentSenderRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.aidl new file mode 100644 index 00000000..c922b2da --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable RealtimeDocumentSyncRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemoveEventListenerRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemoveEventListenerRequest.aidl new file mode 100644 index 00000000..e613b2e2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemoveEventListenerRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable RemoveEventListenerRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemovePermissionRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemovePermissionRequest.aidl new file mode 100644 index 00000000..5d2838c7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/RemovePermissionRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable RemovePermissionRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ResourceIdSetResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ResourceIdSetResponse.aidl new file mode 100644 index 00000000..64cd51fe --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/ResourceIdSetResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable ResourceIdSetResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.aidl new file mode 100644 index 00000000..76702969 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable SetDrivePreferencesRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.aidl new file mode 100644 index 00000000..0ceffc62 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable SetFileUploadPreferencesRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetResourceParentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetResourceParentsRequest.aidl new file mode 100644 index 00000000..43b9c116 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SetResourceParentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable SetResourceParentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StartStreamSession.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StartStreamSession.aidl new file mode 100644 index 00000000..538c61e4 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StartStreamSession.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable StartStreamSession; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StreamContentsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StreamContentsRequest.aidl new file mode 100644 index 00000000..2f20b495 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StreamContentsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable StreamContentsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StringListResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StringListResponse.aidl new file mode 100644 index 00000000..9099c4b6 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/StringListResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable StringListResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SyncMoreResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SyncMoreResponse.aidl new file mode 100644 index 00000000..ed495944 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/SyncMoreResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable SyncMoreResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/TrashResourceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/TrashResourceRequest.aidl new file mode 100644 index 00000000..42480778 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/TrashResourceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable TrashResourceRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.aidl new file mode 100644 index 00000000..a7fe04bc --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable UnsubscribeResourceRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UntrashResourceRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UntrashResourceRequest.aidl new file mode 100644 index 00000000..74fe7d32 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UntrashResourceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable UntrashResourceRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdateMetadataRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdateMetadataRequest.aidl new file mode 100644 index 00000000..98f7d547 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdateMetadataRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable UpdateMetadataRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdatePermissionRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdatePermissionRequest.aidl new file mode 100644 index 00000000..a866defd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/drive/internal/UpdatePermissionRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.drive.internal; + +parcelable UpdatePermissionRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/games/internal/IGamesCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/games/internal/IGamesCallbacks.aidl new file mode 100644 index 00000000..fa1349db --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/games/internal/IGamesCallbacks.aidl @@ -0,0 +1,47 @@ +package com.google.android.gms.games.internal; + +import com.google.android.gms.common.data.DataHolder; +import com.google.android.gms.games.multiplayer.realtime.RealTimeMessage; + +interface IGamesCallbacks { + void onAuthTokenLoaded(int statusCode, String authToken) = 5000; + void onAchievementsLoaded(in DataHolder data) = 5001; + void onAchievementUpdated(int statusCode, String achievementId) = 5002; + void onLeaderboardsLoaded(in DataHolder data) = 5003; + void onLeaderboardScoresLoaded(in DataHolder leaderboard, in DataHolder scores) = 5004; + void onScoreSubmitted(in DataHolder data) = 5005; + void onPlayersLoaded(in DataHolder data) = 5006; + void onExtendedPlayersLoaded(in DataHolder data) = 5007; + void onGamesLoaded(in DataHolder data) = 5008; + void onExtendedGamesLoaded(in DataHolder data) = 5009; + void onGameInstancesLoaded(in DataHolder data) = 5010; + void onGameplayAclLoaded(in DataHolder data) = 5011; + void onGameplayAclUpdated(int statusCode) = 5012; + void onFAclLoaded(in DataHolder data) = 5013; + void onFAclUpdated(int statusCode) = 5014; + void onSignOutComplete() = 5015; + void onInvitationsLoaded(in DataHolder data) = 5016; + void onRoomCreated(in DataHolder data) = 5017; + void onJoinedRoom(in DataHolder data) = 5018; + void onLeftRoom(int statusCode, String roomId) = 5019; + void onRoomConnecting(in DataHolder data) = 5020; + void onRoomAutoMatching(in DataHolder data) = 5021; + void onRoomConnected(in DataHolder data) = 5022; + void onConnectedToRoom(in DataHolder data) = 5023; + void onDisconnectedFromRoom(in DataHolder data) = 5024; + void onPeerInvitedToRoom(in DataHolder data, in String[] participantIds) = 5025; + void onPeerJoinedRoom(in DataHolder data, in String[] participantIds) = 5026; + void onPeerLeftRoom(in DataHolder data, in String[] participantIds) = 5027; + void onPeerDeclined(in DataHolder data, in String[] participantIds) = 5028; + void onPeerConnected(in DataHolder data, in String[] participantIds) = 5029; + void onPeerDisconnected(in DataHolder data, in String[] participantIds) = 5030; + void onRealTimeMessageReceived(in RealTimeMessage message) = 5031; + void onMessageSent(int statusCode, int messageId, String recipientParticipantId) = 5032; + void onGameMuteStatusChanged(int statusCode, String externalGameId, boolean isMuted) = 5033; + void onNotifyAclLoaded(in DataHolder data) = 5034; + void onNotifyAclUpdated(int statusCode) = 5035; + void onInvitationReceived(in DataHolder data) = 5036; + void onGameMuteStatusLoaded(in DataHolder data) = 5037; + void onContactSettingsLoaded(in DataHolder data) = 5038; + void onContactSettingsUpdated(int statusCode) = 5039; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/games/internal/IGamesService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/games/internal/IGamesService.aidl new file mode 100644 index 00000000..1f8e7b4e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/games/internal/IGamesService.aidl @@ -0,0 +1,80 @@ +package com.google.android.gms.games.internal; + +import android.net.Uri; +import android.os.Bundle; +import android.os.IBinder; +import com.google.android.gms.games.internal.IGamesCallbacks; +import com.google.android.gms.common.data.DataHolder; + +interface IGamesService { + void clientDisconnecting(long clientId) = 5000; + void signOut(IGamesCallbacks callbacks) = 5001; + String getAppId() = 5002; + Bundle getConnectionHint() = 5003; + void showWelcomePopup(IBinder windowToken, in Bundle extraArgs) = 5004; + void cancelPopups() = 5005; + String getCurrentAccountName() = 5006; + void loadGameplayAclInternal(IGamesCallbacks callbacks, String gameId) = 5007; + void updateGameplayAclInternal(IGamesCallbacks callbacks, String gameId, String aclData) = 5008; + void loadFAclInternal(IGamesCallbacks callbacks, String gameId) = 5009; + void updateFAclInternal(IGamesCallbacks callbacks, String gameId, boolean allCirclesVisible, in long[] circleIds) = 5010; + String getCurrentPlayerId() = 5011; + DataHolder getCurrentPlayer() = 5012; + void loadPlayer(IGamesCallbacks callbacks, String playerId) = 5013; + void loadInvitablePlayers(IGamesCallbacks callbacks, int pageSize, boolean expandCachedData, boolean forceReload) = 5014; + void submitScore(IGamesCallbacks callbacks, String leaderboardId, long score) = 5015; + void loadLeaderboards(IGamesCallbacks callbacks) = 5016; + void loadLeaderboard(IGamesCallbacks callbacks, String leaderboardId) = 5017; + void loadTopScores(IGamesCallbacks callbacks, String leaderboardId, int span, int leaderboardCollection, int maxResults, boolean forceReload) = 5018; + void loadPlayerCenteredScores(IGamesCallbacks callbacks, String leaderboardId, int span, int leaderboardCollection, int maxResults, boolean forceReload) = 5019; + void loadMoreScores(IGamesCallbacks callbacks, in Bundle previousheader, int maxResults, int pageDirection) = 5020; + void loadAchievements(IGamesCallbacks callbacks) = 5021; + void revealAchievement(IGamesCallbacks callbacks, String achievementId, IBinder windowToken, in Bundle extraArgs) = 5022; + void unlockAchievement(IGamesCallbacks callbacks, String achievementId, IBinder windowToken, in Bundle extraArgs) = 5023; + void incrementAchievement(IGamesCallbacks callbacks, String achievementId, int numSteps, IBinder windowToken, in Bundle extraArgs) = 5024; + void loadGame(IGamesCallbacks callbacks) = 5025; + void loadInvitations(IGamesCallbacks callbacks) = 5026; + void declineInvitation(String invitationId, int invitationType) = 5027; + void dismissInvitation(String invitationId, int invitationType) = 5028; + void createRoom(IGamesCallbacks callbacks, IBinder processBinder, int variant, in String[] invitedPlayerIds, in Bundle autoMatchCriteria, boolean enableSockets, long clientId) = 5029; + void joinRoom(IGamesCallbacks callbacks, IBinder processBinder, String matchId, boolean enableSockets, long clientId) = 5030; + void leaveRoom(IGamesCallbacks callbacks, String matchId) = 5031; + int sendReliableMessage(IGamesCallbacks callbacks, in byte[] messageData, String matchId, String recipientParticipantId) = 5032; + int sendUnreliableMessage(in byte[] messageData, String matchId, in String[] recipientParticipantIds) = 5033; + String createSocketConnection(String participantId) = 5034; + void clearNotifications(int notificationTypes) = 5035; + void loadLeaderboardsFirstParty(IGamesCallbacks callbacks, String gameId) = 5036; + void loadLeaderboardFirstParty(IGamesCallbacks callbacks, String gameId, String leaderboardId) = 5037; + void loadTopScoresFirstParty(IGamesCallbacks callbacks, String gameId, String leaderboardId, int span, int leaderboardCollection, int maxResults, boolean forceReload) = 5038; + void loadPlayerCenteredScoresFirstParty(IGamesCallbacks callbacks, String gameId, String leaderboardId, int span, int leaderboardCollection, int maxResults, boolean forceReload) = 5039; + void loadAchievementsFirstParty(IGamesCallbacks callbacks, String playerId, String gameId) = 5040; + void loadGameFirstParty(IGamesCallbacks callbacks, String gameId) = 5041; + void loadGameInstancesFirstParty(IGamesCallbacks callbacks, String gameId) = 5042; + void loadGameCollectionFirstParty(IGamesCallbacks callbacks, int pageSize, int collectionType, boolean expandCachedData, boolean forceReload) = 5043; + void loadRecentlyPlayedGamesFirstParty(IGamesCallbacks callbacks, String externalPlayerId, int pageSize, boolean expandCachedData, boolean forceReload) = 5044; + void loadInvitablePlayersFirstParty(IGamesCallbacks callbacks, int pageSize, boolean expandCachedData, boolean forceReload) = 5045; + void loadRecentPlayersFirstParty(IGamesCallbacks callbacks) = 5046; + void loadCircledPlayersFirstParty(IGamesCallbacks callbacks, int pageSize, boolean expandCachedData, boolean forceReload) = 5047; + void loadSuggestedPlayersFirstParty(IGamesCallbacks callbacks) = 5048; + void dismissPlayerSuggestionFirstParty(String playerIdToDismiss) = 5049; + void declineInvitationFirstParty(String gameId, String invitationId, int invitationType) = 5050; + void loadInvitationsFirstParty(IGamesCallbacks callbacks, String gameId) = 5051; + int registerWaitingRoomListenerRestricted(IGamesCallbacks callbacks, String roomId) = 5052; + void setGameMuteStatusInternal(IGamesCallbacks callbacks, String gameId, boolean muted) = 5053; + void clearNotificationsFirstParty(String gameId, int notificationTypes) = 5054; + void loadNotifyAclInternal(IGamesCallbacks callbacks) = 5055; + void updateNotifyAclInternal(IGamesCallbacks callbacks, String aclData) = 5056; + void registerInvitationListener(IGamesCallbacks callbacks, long clientId) = 5057; + void unregisterInvitationListener(long clientId) = 5058; + int unregisterWaitingRoomListenerRestricted(String roomId) = 5059; + void isGameMutedInternal(IGamesCallbacks callbacks, String gameId) = 5060; + void loadContactSettingsInternal(IGamesCallbacks callbacks) = 5061; + void updateContactSettingsInternal(IGamesCallbacks callbacks, boolean enableMobileNotifications) = 5062; + String getSelectedAccountForGameFirstParty(String gamePackageName) = 5063; + void updateSelectedAccountForGameFirstParty(String gamePackageName, String accountName) = 5064; + Uri getGamesContentUriRestricted(String gameId) = 5065; + boolean shouldUseNewPlayerNotificationsFirstParty() = 5066; + void setUseNewPlayerNotificationsFirstParty(boolean newPlayerStyle) = 5067; + void searchForPlayersFirstParty(IGamesCallbacks callbacks, String query, int pageSize, boolean expandCachedData, boolean forceReload) = 5500; + DataHolder getCurrentGame() = 5501; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/games/multiplayer/realtime/RealTimeMessage.aidl b/play-services-api/src/main/aidl/com/google/android/gms/games/multiplayer/realtime/RealTimeMessage.aidl new file mode 100644 index 00000000..ae48b227 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/games/multiplayer/realtime/RealTimeMessage.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.games.multiplayer.realtime; + +parcelable RealTimeMessage; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlaceDetectionService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlaceDetectionService.aidl new file mode 100644 index 00000000..39b0a53f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlaceDetectionService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.location.places.internal; + +interface IGooglePlaceDetectionService { + +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlacesService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlacesService.aidl new file mode 100644 index 00000000..854e921e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/places/internal/IGooglePlacesService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.location.places.internal; + +interface IGooglePlacesService { + +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl new file mode 100644 index 00000000..e2cf4afd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/GoogleMapOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps; + +parcelable GoogleMapOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl new file mode 100644 index 00000000..a8ea7626 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICameraUpdateFactoryDelegate.aidl @@ -0,0 +1,20 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.CameraPosition; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; + +interface ICameraUpdateFactoryDelegate { + IObjectWrapper zoomIn(); + IObjectWrapper zoomOut(); + IObjectWrapper scrollBy(float x, float y); + IObjectWrapper zoomTo(float zoom); + IObjectWrapper zoomBy(float zoomDelta); + IObjectWrapper zoomByWithFocus(float zoomDelta, int x, int y); + IObjectWrapper newCameraPosition(in CameraPosition cameraPosition); + IObjectWrapper newLatLng(in LatLng latLng); + IObjectWrapper newLatLngZoom(in LatLng latLng, float zoom); + IObjectWrapper newLatLngBounds(in LatLngBounds bounds, int padding); + IObjectWrapper newLatLngBoundsWithSize(in LatLngBounds bounds, int width, int height, int padding); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl new file mode 100644 index 00000000..0cc5938f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICancelableCallback.aidl @@ -0,0 +1,6 @@ +package com.google.android.gms.maps.internal; + +interface ICancelableCallback { + void onFinish(); + void onCancel(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl new file mode 100644 index 00000000..f10ab345 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ICreator.aidl @@ -0,0 +1,17 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.GoogleMapOptions; +import com.google.android.gms.maps.internal.IMapFragmentDelegate; +import com.google.android.gms.maps.internal.IMapViewDelegate; +import com.google.android.gms.maps.internal.ICameraUpdateFactoryDelegate; +import com.google.android.gms.maps.model.internal.IBitmapDescriptorFactoryDelegate; + +interface ICreator { + void init(IObjectWrapper resources); + IMapFragmentDelegate newMapFragmentDelegate(IObjectWrapper activity); + IMapViewDelegate newMapViewDelegate(IObjectWrapper context, in GoogleMapOptions options); + ICameraUpdateFactoryDelegate newCameraUpdateFactoryDelegate(); + IBitmapDescriptorFactoryDelegate newBitmapDescriptorFactoryDelegate(); + void initV2(IObjectWrapper resources, int flags); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl new file mode 100644 index 00000000..af44f1c5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl @@ -0,0 +1,144 @@ +package com.google.android.gms.maps.internal; + +import android.location.Location; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.CameraPosition; +import com.google.android.gms.maps.internal.ICancelableCallback; +import com.google.android.gms.maps.internal.ILocationSourceDelegate; +import com.google.android.gms.maps.internal.IUiSettingsDelegate; +import com.google.android.gms.maps.internal.IProjectionDelegate; +import com.google.android.gms.maps.internal.IOnCameraChangeListener; +import com.google.android.gms.maps.internal.IOnCameraIdleListener; +import com.google.android.gms.maps.internal.IOnCameraMoveCanceledListener; +import com.google.android.gms.maps.internal.IOnCameraMoveListener; +import com.google.android.gms.maps.internal.IOnCameraMoveStartedListener; +import com.google.android.gms.maps.internal.IOnMapClickListener; +import com.google.android.gms.maps.internal.IOnMapLongClickListener; +import com.google.android.gms.maps.internal.IOnMarkerClickListener; +import com.google.android.gms.maps.internal.IOnMarkerDragListener; +import com.google.android.gms.maps.internal.IOnInfoWindowClickListener; +import com.google.android.gms.maps.internal.IInfoWindowAdapter; +import com.google.android.gms.maps.internal.IOnMapLoadedCallback; +import com.google.android.gms.maps.internal.IOnMyLocationChangeListener; +import com.google.android.gms.maps.internal.IOnMyLocationButtonClickListener; +import com.google.android.gms.maps.internal.ISnapshotReadyCallback; +import com.google.android.gms.maps.model.CircleOptions; +import com.google.android.gms.maps.model.GroundOverlayOptions; +import com.google.android.gms.maps.model.LatLngBounds; +import com.google.android.gms.maps.model.MarkerOptions; +import com.google.android.gms.maps.model.MapStyleOptions; +import com.google.android.gms.maps.model.PolygonOptions; +import com.google.android.gms.maps.model.PolylineOptions; +import com.google.android.gms.maps.model.TileOverlayOptions; +import com.google.android.gms.maps.model.internal.IPolylineDelegate; +import com.google.android.gms.maps.model.internal.IPolygonDelegate; +import com.google.android.gms.maps.model.internal.IMarkerDelegate; +import com.google.android.gms.maps.model.internal.ICircleDelegate; +import com.google.android.gms.maps.model.internal.IGroundOverlayDelegate; +import com.google.android.gms.maps.model.internal.ITileOverlayDelegate; + +interface IGoogleMapDelegate { + CameraPosition getCameraPosition() = 0; + + float getMaxZoomLevel() = 1; + float getMinZoomLevel() = 2; + + void moveCamera(IObjectWrapper cameraUpdate) = 3; + void animateCamera(IObjectWrapper cameraUpdate) = 4; + void animateCameraWithCallback(IObjectWrapper cameraUpdate, ICancelableCallback callback) = 5; + void animateCameraWithDurationAndCallback(IObjectWrapper cameraUpdate, int duration, ICancelableCallback callback) = 6; + void stopAnimation() = 7; + + IPolylineDelegate addPolyline(in PolylineOptions options) = 8; + IPolygonDelegate addPolygon(in PolygonOptions options) = 9; + IMarkerDelegate addMarker(in MarkerOptions options) = 10; + IGroundOverlayDelegate addGroundOverlay(in GroundOverlayOptions options) = 11; + ITileOverlayDelegate addTileOverlay(in TileOverlayOptions options) = 12; + + void clear() = 13; + + int getMapType() = 14; + void setMapType(int type) = 15; + boolean isTrafficEnabled() = 16; + void setTrafficEnabled(boolean traffic) = 17; + boolean isIndoorEnabled() = 18; + void setIndoorEnabled(boolean indoor) = 19; + + boolean isMyLocationEnabled() = 20; + void setMyLocationEnabled(boolean myLocation) = 21; + Location getMyLocation() = 22; + void setLocationSource(ILocationSourceDelegate locationSource) = 23; + + IUiSettingsDelegate getUiSettings() = 24; + IProjectionDelegate getProjection() = 25; + + void setOnCameraChangeListener(IOnCameraChangeListener listener) = 26; + void setOnMapClickListener(IOnMapClickListener listener) = 27; + void setOnMapLongClickListener(IOnMapLongClickListener listener) = 28; + void setOnMarkerClickListener(IOnMarkerClickListener listener) = 29; + void setOnMarkerDragListener(IOnMarkerDragListener listener) = 30; + void setOnInfoWindowClickListener(IOnInfoWindowClickListener listener) = 31; + void setInfoWindowAdapter(IInfoWindowAdapter adapter) = 32; + + IObjectWrapper getTestingHelper() = 33; + + ICircleDelegate addCircle(in CircleOptions options) = 34; + + void setOnMyLocationChangeListener(IOnMyLocationChangeListener listener) = 35; + void setOnMyLocationButtonClickListener(IOnMyLocationButtonClickListener listener) = 36; + + void snapshot(ISnapshotReadyCallback callback, IObjectWrapper bitmap) = 37; + + void setPadding(int left, int top, int right, int bottom) = 38; + + boolean isBuildingsEnabled() = 39; + void setBuildingsEnabled(boolean buildings) = 40; + + void setOnMapLoadedCallback(IOnMapLoadedCallback callback) = 41; + + //IIndoorBuildingDelegate getFocusedBuilding() = 43; + //void setIndoorStateChangeListener(IOnIndoorStateChangeListener listener) = 44; + + void setWatermarkEnabled(boolean watermark) = 50; + + //void getMapAsync(IOnMapReadyCallback callback) = 52; + void onCreate(in Bundle savedInstanceState) = 53; + void onResume() = 54; + void onPause() = 55; + void onDestroy() = 56; + void onLowMemory() = 57; + boolean useViewLifecycleWhenInFragment() = 58; + void onSaveInstanceState(out Bundle outState) = 59; + + void setContentDescription(String desc) = 60; + + //void snapshotForTest(ISnapshotReadyCallback callback) = 70; + + //void setPoiClickListener(IOnPoiClickListener listener) = 79; + void onEnterAmbient(in Bundle bundle) = 80; + void onExitAmbient() = 81; + + //void setOnGroundOverlayClickListener(IOnGroundOverlayClickListener listener) = 82; + //void setInfoWindowLongClickListener(IOnInfoWindowLongClickListener listener) = 83; + //void setPolygonClickListener(IOnPolygonClickListener listener) = 84; + //void setInfoWindowCloseListener(IOnInfoWindowCloseListener listener) = 85; + //void setPolylineClickListener(IOnPolylineClickListener listener) = 86; + //void setCircleClickListener(IOnCircleClickListener listener) = 88; + + boolean setMapStyle(in MapStyleOptions options) = 90; + void setMinZoomPreference(float minZoom) = 91; + void setMaxZoomPreference(float maxZoom) = 92; + void resetMinMaxZoomPreference() = 93; + void setLatLngBoundsForCameraTarget(in LatLngBounds bounds) = 94; + + void setCameraMoveStartedListener(IOnCameraMoveStartedListener listener) = 95; + void setCameraMoveListener(IOnCameraMoveListener listener) = 96; + void setCameraMoveCanceledListener(IOnCameraMoveCanceledListener listener) = 97; + void setCameraIdleListener(IOnCameraIdleListener listener) = 98; + + void onStart() = 100; + void onStop() = 101; + + //void setOnMyLocationClickListener(IOnMyLocationClickListener listener) = 106; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl new file mode 100644 index 00000000..d11d71d4 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl @@ -0,0 +1,9 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.internal.IMarkerDelegate; + +interface IInfoWindowAdapter { + IObjectWrapper getInfoWindow(IMarkerDelegate marker); + IObjectWrapper getInfoContents(IMarkerDelegate marker); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl new file mode 100644 index 00000000..203ec69f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ILocationSourceDelegate.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +interface ILocationSourceDelegate { +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl new file mode 100644 index 00000000..c08c987b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapFragmentDelegate.aidl @@ -0,0 +1,27 @@ +package com.google.android.gms.maps.internal; + +import android.os.Bundle; + +import com.google.android.gms.maps.internal.IGoogleMapDelegate; +import com.google.android.gms.maps.internal.IOnMapReadyCallback; +import com.google.android.gms.maps.GoogleMapOptions; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IMapFragmentDelegate { + IGoogleMapDelegate getMap(); + void onInflate(IObjectWrapper activity, in GoogleMapOptions options, in Bundle savedInstanceState); + void onCreate(in Bundle savedInstanceState); + IObjectWrapper onCreateView(IObjectWrapper layoutInflater, IObjectWrapper container, in Bundle savedInstanceState); + void onResume(); + void onPause(); + void onDestroyView(); + void onDestroy(); + void onLowMemory(); + void onSaveInstanceState(inout Bundle outState); + boolean isReady(); + void getMapAsync(IOnMapReadyCallback callback); + void onEnterAmbient(in Bundle bundle); + void onExitAmbient(); + void onStart(); + void onStop(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl new file mode 100644 index 00000000..d22db6c6 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IMapViewDelegate.aidl @@ -0,0 +1,23 @@ +package com.google.android.gms.maps.internal; + +import android.os.Bundle; + +import com.google.android.gms.maps.internal.IGoogleMapDelegate; +import com.google.android.gms.maps.internal.IOnMapReadyCallback; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IMapViewDelegate { + IGoogleMapDelegate getMap(); + void onCreate(in Bundle savedInstanceState); + void onResume(); + void onPause(); + void onDestroy(); + void onLowMemory(); + void onSaveInstanceState(inout Bundle outState); + IObjectWrapper getView(); + void getMapAsync(IOnMapReadyCallback callback); + void onEnterAmbient(in Bundle bundle); + void onExitAmbient(); + void onStart(); + void onStop(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl new file mode 100644 index 00000000..8abd2929 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraChangeListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.CameraPosition; + +interface IOnCameraChangeListener { + void onCameraChange(in CameraPosition update); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraIdleListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraIdleListener.aidl new file mode 100644 index 00000000..caa686a8 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraIdleListener.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.maps.internal; + +interface IOnCameraIdleListener { + void onCameraIdle(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraMoveCanceledListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraMoveCanceledListener.aidl new file mode 100644 index 00000000..bb1494e8 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraMoveCanceledListener.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.maps.internal; + +interface IOnCameraMoveCanceledListener { + void onCameraMoveCanceled(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraMoveListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraMoveListener.aidl new file mode 100644 index 00000000..6b404d65 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraMoveListener.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.maps.internal; + +interface IOnCameraMoveListener { + void onCameraMove(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraMoveStartedListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraMoveStartedListener.aidl new file mode 100644 index 00000000..2a5f65d9 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnCameraMoveStartedListener.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.maps.internal; + +interface IOnCameraMoveStartedListener { + void onCameraMoveStarted(int i); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl new file mode 100644 index 00000000..7c396ce7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnInfoWindowClickListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.internal.IMarkerDelegate; + +interface IOnInfoWindowClickListener { + void onInfoWindowClick(IMarkerDelegate marker); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl new file mode 100644 index 00000000..6b3b2ec8 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapClickListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface IOnMapClickListener { + void onMapClick(in LatLng latLng); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl new file mode 100644 index 00000000..d3fc105d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLoadedCallback.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.maps.internal; + +interface IOnMapLoadedCallback { + void onMapLoaded(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl new file mode 100644 index 00000000..11201b2c --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapLongClickListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface IOnMapLongClickListener { + void onMapLongClick(in LatLng latLng); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapReadyCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapReadyCallback.aidl new file mode 100644 index 00000000..1e6760ef --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMapReadyCallback.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.internal.IGoogleMapDelegate; + +interface IOnMapReadyCallback { + void onMapReady(IGoogleMapDelegate map); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl new file mode 100644 index 00000000..94c4465d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerClickListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.internal.IMarkerDelegate; + +interface IOnMarkerClickListener { + boolean onMarkerClick(IMarkerDelegate marker); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl new file mode 100644 index 00000000..b4601a7a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMarkerDragListener.aidl @@ -0,0 +1,9 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.maps.model.internal.IMarkerDelegate; + +interface IOnMarkerDragListener { + void onMarkerDragStart(IMarkerDelegate marker) = 0; + void onMarkerDrag(IMarkerDelegate marker) = 1; + void onMarkerDragEnd(IMarkerDelegate marker) = 2; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl new file mode 100644 index 00000000..b10880dd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationButtonClickListener.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.internal; + +interface IOnMyLocationButtonClickListener { +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl new file mode 100644 index 00000000..35a6b6c2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IOnMyLocationChangeListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IOnMyLocationChangeListener { + void onMyLocationChanged(IObjectWrapper location); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl new file mode 100644 index 00000000..9b2da90b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IProjectionDelegate.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.VisibleRegion; + +interface IProjectionDelegate { + LatLng fromScreenLocation(IObjectWrapper obj); + IObjectWrapper toScreenLocation(in LatLng latLng); + VisibleRegion getVisibleRegion(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl new file mode 100644 index 00000000..f907e336 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/ISnapshotReadyCallback.aidl @@ -0,0 +1,9 @@ +package com.google.android.gms.maps.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import android.graphics.Bitmap; + +interface ISnapshotReadyCallback { + void onBitmapReady(in Bitmap bitmap); + void onBitmapWrappedReady(IObjectWrapper wrapper); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl new file mode 100644 index 00000000..12c78123 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IUiSettingsDelegate.aidl @@ -0,0 +1,25 @@ +package com.google.android.gms.maps.internal; + +interface IUiSettingsDelegate { + void setZoomControlsEnabled(boolean zoom); + void setCompassEnabled(boolean compass); + void setMyLocationButtonEnabled(boolean locationButton); + void setScrollGesturesEnabled(boolean scrollGestures); + void setZoomGesturesEnabled(boolean zoomGestures); + void setTiltGesturesEnabled(boolean tiltGestures); + void setRotateGesturesEnabled(boolean rotateGestures); + void setAllGesturesEnabled(boolean gestures); + boolean isZoomControlsEnabled(); + boolean isCompassEnabled(); + boolean isMyLocationButtonEnabled(); + boolean isScrollGesturesEnabled(); + boolean isZoomGesturesEnabled(); + boolean isTiltGesturesEnabled(); + boolean isRotateGesturesEnabled(); + void setIndoorLevelPickerEnabled(boolean indoorLevelPicker); + boolean isIndoorLevelPickerEnabled(); + void setMapToolbarEnabled(boolean mapToolbar); + boolean isMapToolbarEnabled(); + void setScrollGesturesEnabledDuringRotateOrZoom(boolean scrollDuringZoom); + boolean isScrollGesturesEnabledDuringRotateOrZoom(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl new file mode 100644 index 00000000..bb5ab701 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/CameraPosition.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable CameraPosition; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl new file mode 100644 index 00000000..33ae4542 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/CircleOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable CircleOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl new file mode 100644 index 00000000..5bdbefaf --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable GroundOverlayOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MapStyleOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MapStyleOptions.aidl new file mode 100644 index 00000000..04312ebf --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MapStyleOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable MapStyleOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl new file mode 100644 index 00000000..dc4abbcf --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable MarkerOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl new file mode 100644 index 00000000..adac82a0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolygonOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable PolygonOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl new file mode 100644 index 00000000..7c165891 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/PolylineOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable PolylineOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/Tile.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/Tile.aidl new file mode 100644 index 00000000..54f1872f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/Tile.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable Tile; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl new file mode 100644 index 00000000..85f5ac32 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/TileOverlayOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable TileOverlayOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl new file mode 100644 index 00000000..09d22101 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/VisibleRegion.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable VisibleRegion; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl new file mode 100644 index 00000000..dca49b60 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IBitmapDescriptorFactoryDelegate.aidl @@ -0,0 +1,14 @@ +package com.google.android.gms.maps.model.internal; + +import android.graphics.Bitmap; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IBitmapDescriptorFactoryDelegate { + IObjectWrapper fromResource(int resourceId); + IObjectWrapper fromAsset(String assetName); + IObjectWrapper fromFile(String fileName); + IObjectWrapper defaultMarker(); + IObjectWrapper defaultMarkerWithHue(float hue); + IObjectWrapper fromBitmap(in Bitmap bitmap); + IObjectWrapper fromPath(String absolutePath); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl new file mode 100644 index 00000000..719d8eab --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ICircleDelegate.aidl @@ -0,0 +1,24 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface ICircleDelegate { + void remove(); + String getId(); + void setCenter(in LatLng center); + LatLng getCenter(); + void setRadius(double radius); + double getRadius(); + void setStrokeWidth(float width); + float getStrokeWidth(); + void setStrokeColor(int color); + int getStrokeColor(); + void setFillColor(int color); + int getFillColor(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + boolean equalsRemote(ICircleDelegate other); + int hashCodeRemote(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl new file mode 100644 index 00000000..0a1a0632 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IGroundOverlayDelegate.aidl @@ -0,0 +1,29 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.LatLng; +import com.google.android.gms.maps.model.LatLngBounds; + +interface IGroundOverlayDelegate { + void remove(); + String getId(); + void setPosition(in LatLng pos); + LatLng getPosition(); + void setDimension(float dimension); + void setDimensions(float width, float height); + float getWidth(); + float getHeight(); + void setPositionFromBounds(in LatLngBounds bounds); + LatLngBounds getBounds(); + void setBearing(float bearing); + float getBearing(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + void setTransparency(float transparency); + float getTransparency(); + boolean equalsRemote(IGroundOverlayDelegate other); + int hashCodeRemote(); + void todo(IObjectWrapper obj); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl new file mode 100644 index 00000000..ca2d2603 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IMarkerDelegate.aidl @@ -0,0 +1,37 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.LatLng; + +interface IMarkerDelegate { + void remove(); + String getId(); + void setPosition(in LatLng pos); + LatLng getPosition(); + void setTitle(String title); + String getTitle(); + void setSnippet(String snippet); + String getSnippet(); + void setDraggable(boolean drag); + boolean isDraggable(); + void showInfoWindow(); + void hideInfoWindow(); + boolean isInfoWindowShown(); + void setVisible(boolean visible); + boolean isVisible(); + boolean equalsRemote(IMarkerDelegate other); + int hashCodeRemote(); + void setIcon(IObjectWrapper obj); + void setAnchor(float x, float y); + void setFlat(boolean flat); + boolean isFlat(); + void setRotation(float rotation); + float getRotation(); + void setInfoWindowAnchor(float x, float y); + void setAlpha(float alpha); + float getAlpha(); + void setZIndex(float zIndex); + float getZIndex(); + void setTag(IObjectWrapper obj); + IObjectWrapper getTag(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl new file mode 100644 index 00000000..67f0517b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolygonDelegate.aidl @@ -0,0 +1,27 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface IPolygonDelegate { + void remove(); + String getId(); + void setPoints(in List points); + List getPoints(); + void setHoles(in List holes); + List getHoles(); + void setStrokeWidth(float width); + float getStrokeWidth(); + void setStrokeColor(int color); + int getStrokeColor(); + void setFillColor(int color); + int getFillColor(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + void setGeodesic(boolean geod); + boolean isGeodesic(); + boolean equalsRemote(IPolygonDelegate other); + int hashCodeRemote(); + +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl new file mode 100644 index 00000000..ebbb336b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/IPolylineDelegate.aidl @@ -0,0 +1,22 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.maps.model.LatLng; + +interface IPolylineDelegate { + void remove(); + String getId(); + void setPoints(in List points); + List getPoints(); + void setWidth(float width); + float getWidth(); + void setColor(int color); + int getColor(); + void setZIndex(float zIndex); + float getZIndex(); + void setVisible(boolean visible); + boolean isVisible(); + void setGeodesic(boolean geod); + boolean isGeodesic(); + boolean equalsRemote(IPolylineDelegate other); + int hashCodeRemote(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl new file mode 100644 index 00000000..417cb024 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileOverlayDelegate.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.maps.model.internal; + +interface ITileOverlayDelegate { +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl new file mode 100644 index 00000000..d6dc516b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/internal/ITileProviderDelegate.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.maps.model.internal; + +import com.google.android.gms.maps.model.Tile; + +interface ITileProviderDelegate { + Tile getTile(int x, int y, int zoom); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IAppMeasurementDynamiteService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IAppMeasurementDynamiteService.aidl new file mode 100644 index 00000000..5df0a37f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IAppMeasurementDynamiteService.aidl @@ -0,0 +1,55 @@ +package com.google.android.gms.measurement.api.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.measurement.api.internal.IBundleReceiver; +import com.google.android.gms.measurement.api.internal.IEventHandlerProxy; +import com.google.android.gms.measurement.api.internal.IStringProvider; +import com.google.android.gms.measurement.api.internal.InitializationParams; + +interface IAppMeasurementDynamiteService { + void initialize(in IObjectWrapper context, in InitializationParams params, long timestamp) = 0; + void logEvent(String str, String str2, in Bundle bundle, boolean z, boolean z2, long timestamp) = 1; + void logEventAndBundle(String str, String str2, in Bundle bundle, IBundleReceiver receiver, long j) = 2; + void setUserProperty(String str, String str2, in IObjectWrapper obj, boolean z, long j) = 3; + void getUserProperties(String str, String str2, boolean z, IBundleReceiver receiver) = 4; + void getMaxUserProperties(String str, IBundleReceiver receiver) = 5; + void setUserId(String str, long j) = 6; + void setConditionalUserProperty(in Bundle bundle, long j) = 7; + void clearConditionalUserProperty(String str, String str2, in Bundle bundle) = 8; + void getConditionalUserProperties(String str, String str2, IBundleReceiver receiver) = 9; + void setMeasurementEnabled(boolean z, long j) = 10; + void resetAnalyticsData(long j) = 11; + void setMinimumSessionDuration(long j) = 12; + void setSessionTimeoutDuration(long j) = 13; + void setCurrentScreen(in IObjectWrapper obj, String str, String str2, long j) = 14; + void getCurrentScreenName(IBundleReceiver receiver) = 15; + void getCurrentScreenClass(IBundleReceiver receiver) = 16; + void setInstanceIdProvider(IStringProvider provider) = 17; + void getCachedAppInstanceId(IBundleReceiver receiver) = 18; + void getAppInstanceId(IBundleReceiver receiver) = 19; + void getGmpAppId(IBundleReceiver receiver) = 20; + void generateEventId(IBundleReceiver receiver) = 21; + void beginAdUnitExposure(String str, long j) = 22; + void endAdUnitExposure(String str, long j) = 23; + void onActivityStarted(in IObjectWrapper activity, long j) = 24; + void onActivityStopped(in IObjectWrapper activity, long j) = 25; + void onActivityCreated(in IObjectWrapper activity, in Bundle bundle, long j) = 26; + void onActivityDestroyed(in IObjectWrapper activity, long j) = 27; + void onActivityPaused(in IObjectWrapper activity, long j) = 28; + void onActivityResumed(in IObjectWrapper activity, long j) = 29; + void onActivitySaveInstanceState(in IObjectWrapper activity, IBundleReceiver receiver, long j) = 30; + void performAction(in Bundle bundle, IBundleReceiver receiver, long j) = 31; + void logHealthData(int i, String str, in IObjectWrapper obj, in IObjectWrapper obj2, in IObjectWrapper obj3) = 32; + void setEventInterceptor(IEventHandlerProxy proxy) = 33; + void registerOnMeasurementEventListener(IEventHandlerProxy proxy) = 34; + void unregisterOnMeasurementEventListener(IEventHandlerProxy proxy) = 35; + void initForTests(in Map map) = 36; + void getTestFlag(IBundleReceiver receiver, int i) = 37; + void setDataCollectionEnabled(boolean z) = 38; + void isDataCollectionEnabled(IBundleReceiver receiver) = 39; + + void setDefaultEventParameters(in Bundle bundle) = 41; + void setConsent(in Bundle bundle, long j) = 43; + void setConsentThirdParty(in Bundle bundle, long j) = 44; + void clearMeasurementEnabled(long j) = 42; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IBundleReceiver.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IBundleReceiver.aidl new file mode 100644 index 00000000..68d80ee8 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IBundleReceiver.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.measurement.api.internal; + +interface IBundleReceiver { + void onBundle(in Bundle bundle); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IEventHandlerProxy.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IEventHandlerProxy.aidl new file mode 100644 index 00000000..5325899b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IEventHandlerProxy.aidl @@ -0,0 +1,6 @@ +package com.google.android.gms.measurement.api.internal; + +interface IEventHandlerProxy { + void f1(String s1, String s2, in Bundle bundle, long j) = 0; + int f2() = 1; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IStringProvider.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IStringProvider.aidl new file mode 100644 index 00000000..2d8f9d17 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/IStringProvider.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.measurement.api.internal; + +interface IStringProvider { +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/InitializationParams.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/InitializationParams.aidl new file mode 100644 index 00000000..cce367c7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/measurement/api/internal/InitializationParams.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.measurement.api.internal; + +parcelable InitializationParams; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/IMeasurementService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/IMeasurementService.aidl index 8a99173a..1c78896a 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/IMeasurementService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/IMeasurementService.aidl @@ -3,23 +3,25 @@ package com.google.android.gms.measurement.internal; import com.google.android.gms.measurement.internal.AppMetadata; import com.google.android.gms.measurement.internal.ConditionalUserPropertyParcel; import com.google.android.gms.measurement.internal.EventParcel; +import com.google.android.gms.measurement.internal.UserAttributeParcel; interface IMeasurementService { - void f1(in EventParcel p0, in AppMetadata p1) = 0; -// void zza(UserAttributeParcel p0, AppMetadata p1) = 1; - void f4(in AppMetadata p0) = 3; -// void zza(EventParcel p0, String p1, String p2) = 4; -// void zzb(AppMetadata p0) = 5; -// List zza(AppMetadata p0, boolean p1) = 6; -// byte[] zza(EventParcel p0, String p1) = 8; + void f1(in EventParcel event, in AppMetadata app) = 0; + void f2(in UserAttributeParcel attribute, in AppMetadata app) = 1; + void f4(in AppMetadata app) = 3; +// void f5(in EventParcel p0, String p1, String p2) = 4; +// void f6(in AppMetadata p0) = 5; +// List f7(in AppMetadata p0, boolean p1) = 6; +// byte[] f9(in EventParcel p0, String p1) = 8; void f10(long p0, String p1, String p2, String p3) = 9; - String f11(in AppMetadata p0) = 10; - void f12(in ConditionalUserPropertyParcel p0, in AppMetadata p1) = 11; -// void zza(ConditionalUserPropertyParcel p0) = 12; -// List zza(String p0, String p1, boolean p2, AppMetadata p3) = 13; -// List zza(String p0, String p1, String p2, boolean p3) = 14; -// List zza(String p0, String p1, AppMetadata p2) = 15; -// List zza(String p0, String p1, String p2) = 16; -// void zzd(AppMetadata p0) = 17; -// void zza(Bundle p0, AppMetadata p1) = 18; + String f11(in AppMetadata app) = 10; + void f12(in ConditionalUserPropertyParcel property, in AppMetadata app) = 11; +// void f13(ConditionalUserPropertyParcel p0) = 12; +// List getUserProperties(String p0, String p1, boolean p2, in AppMetadata p3) = 13; +// List getUserPropertiesAs(String p0, String p1, String p2, boolean p3) = 14; +// List getConditionalUserProperties(String p0, String p1, in AppMetadata p2) = 15; +// List getCondtionalUserPropertiesAs(String p0, String p1, String p2) = 16; +// void f18(in AppMetadata p0) = 17; + void setDefaultEventParameters(in Bundle params, in AppMetadata app) = 18; +// void f20(in AppMetadata p0) = 19; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/phenotype/Configurations.aidl b/play-services-api/src/main/aidl/com/google/android/gms/phenotype/Configurations.aidl new file mode 100644 index 00000000..33ccf3d7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/phenotype/Configurations.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.phenotype; + +parcelable Configurations; diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/phenotype/internal/IPhenotypeCallbacks.aidl similarity index 67% rename from play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeCallbacks.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/phenotype/internal/IPhenotypeCallbacks.aidl index d7cb4bad..acda3c57 100644 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeCallbacks.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/phenotype/internal/IPhenotypeCallbacks.aidl @@ -1,7 +1,7 @@ -package com.mgoogle.android.gms.phenotype.internal; +package com.google.android.gms.phenotype.internal; import com.google.android.gms.common.api.Status; -import com.mgoogle.android.gms.phenotype.Configurations; +import com.google.android.gms.phenotype.Configurations; interface IPhenotypeCallbacks { oneway void onRegister(in Status status) = 0; diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/phenotype/internal/IPhenotypeService.aidl similarity index 50% rename from play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeService.aidl rename to play-services-api/src/main/aidl/com/google/android/gms/phenotype/internal/IPhenotypeService.aidl index e4099a1b..abba647d 100644 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/internal/IPhenotypeService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/phenotype/internal/IPhenotypeService.aidl @@ -1,8 +1,9 @@ -package com.mgoogle.android.gms.phenotype.internal; +package com.google.android.gms.phenotype.internal; -import com.mgoogle.android.gms.phenotype.internal.IPhenotypeCallbacks; +import com.google.android.gms.phenotype.internal.IPhenotypeCallbacks; interface IPhenotypeService { void register(IPhenotypeCallbacks callbacks, String p1, int p2, in String[] p3, in byte[] p4) = 0; + void register2(IPhenotypeCallbacks callbacks, String p1, int p2, in String[] p3, in int[] p4, in byte[] p5) = 1; void getConfigurationSnapshot(IPhenotypeCallbacks callbacks, String p1, String p2, String p3) = 10; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl index 86169b99..9bcdee44 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl @@ -1,8 +1,9 @@ package com.google.android.gms.playlog.internal; +import com.google.android.gms.clearcut.internal.PlayLoggerContext; import com.google.android.gms.playlog.internal.LogEvent; -import com.google.android.gms.playlog.internal.PlayLoggerContext; +// Deprecated interface IPlayLogService { void onEvent(String packageName, in PlayLoggerContext context, in LogEvent event) = 1; void onMultiEvent(String packageName, in PlayLoggerContext context, in List events) = 2; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/PlayLoggerContext.aidl b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/PlayLoggerContext.aidl deleted file mode 100644 index 9cc0e0e4..00000000 --- a/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/PlayLoggerContext.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.google.android.gms.playlog.internal; - -parcelable PlayLoggerContext; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl b/play-services-api/src/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl new file mode 100644 index 00000000..7e2121d2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/plus/internal/IPlusOneButtonCreator.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.plus.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IPlusOneButtonCreator { + IObjectWrapper create(IObjectWrapper context, int size, int annotation, String url, int activityRequestCode); + IObjectWrapper createForAccount(IObjectWrapper context, int size, int annotation, String url, String account); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/AccountState.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/AccountState.aidl new file mode 100644 index 00000000..24ae0ffd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/AccountState.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable AccountState; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/CreateReminderOptionsInternal.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/CreateReminderOptionsInternal.aidl new file mode 100644 index 00000000..142ddedf --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/CreateReminderOptionsInternal.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable CreateReminderOptionsInternal; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/LoadRemindersOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/LoadRemindersOptions.aidl new file mode 100644 index 00000000..ff418443 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/LoadRemindersOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable LoadRemindersOptions; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/ReindexDueDatesOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/ReindexDueDatesOptions.aidl new file mode 100644 index 00000000..55ac1beb --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/ReindexDueDatesOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable ReindexDueDatesOptions; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/UpdateRecurrenceOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/UpdateRecurrenceOptions.aidl new file mode 100644 index 00000000..79f91dec --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/UpdateRecurrenceOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders; + +parcelable UpdateRecurrenceOptions; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersCallbacks.aidl new file mode 100644 index 00000000..5e5506ee --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersCallbacks.aidl @@ -0,0 +1,17 @@ +package com.google.android.gms.reminders.internal; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.common.data.DataHolder; + +import com.google.android.gms.reminders.AccountState; + +interface IRemindersCallbacks { + void onDataHolder(in DataHolder data, in Status status) = 0; + void onStatus(in Status status) = 1; + void onNoStatus() = 2; + void onDataHolderNoStatus(in DataHolder data, in Status status) = 3; + void onBool(boolean b, in Status status) = 4; + void onString(in String s, in Status status) = 5; + void onAccountState(in AccountState accountState, in Status status) = 6; + void onAsyncDataHolder(in DataHolder data) = 7; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersListener.aidl new file mode 100644 index 00000000..2added91 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersListener.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.reminders.internal; + +interface IRemindersListener { + +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersService.aidl new file mode 100644 index 00000000..f9986484 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/internal/IRemindersService.aidl @@ -0,0 +1,37 @@ +package com.google.android.gms.reminders.internal; + +import com.google.android.gms.reminders.internal.IRemindersCallbacks; + +import com.google.android.gms.reminders.AccountState; +import com.google.android.gms.reminders.CreateReminderOptionsInternal; +import com.google.android.gms.reminders.LoadRemindersOptions; +import com.google.android.gms.reminders.ReindexDueDatesOptions; +import com.google.android.gms.reminders.UpdateRecurrenceOptions; +import com.google.android.gms.reminders.model.CustomizedSnoozePresetEntity; +import com.google.android.gms.reminders.model.TaskEntity; +import com.google.android.gms.reminders.model.TaskIdEntity; + +interface IRemindersService { + void loadReminders(IRemindersCallbacks callbacks, in LoadRemindersOptions options) = 0; + void addListener(IRemindersCallbacks callbacks) = 1; + void createReminder(IRemindersCallbacks callbacks, in TaskEntity task) = 2; + void updateReminder(IRemindersCallbacks callbacks, in TaskEntity task) = 3; + void deleteReminder(IRemindersCallbacks callbacks, in TaskIdEntity taskId) = 4; + void bumpReminder(IRemindersCallbacks callbacks, in TaskIdEntity taskId) = 5; + void hasUpcomingReminders(IRemindersCallbacks callbacks) = 6; + void createRecurrence(IRemindersCallbacks callbacks, in TaskEntity task) = 7; + void updateRecurrence(IRemindersCallbacks callbacks, String s1, in TaskEntity task, in UpdateRecurrenceOptions options) = 8; + void deleteRecurrence(IRemindersCallbacks callbacks, String s1, in UpdateRecurrenceOptions options) = 9; + void changeRecurrence(IRemindersCallbacks callbacks, String s1, in TaskEntity task, in UpdateRecurrenceOptions options) = 10; + void makeTaskRecurring(IRemindersCallbacks callbacks, in TaskEntity task) = 11; + void makeRecurrenceSingleInstance(IRemindersCallbacks callbacks, String s1, in TaskEntity task, in UpdateRecurrenceOptions options) = 12; + void clearListeners() = 13; + void batchUpdateReminders(IRemindersCallbacks callbacks, in List tasks) = 14; + void createReminderWithOptions(IRemindersCallbacks callbacks, in TaskEntity task, in CreateReminderOptionsInternal options) = 15; + void getCustomizedSnoozePreset(IRemindersCallbacks callbacks) = 16; + void setCustomizedSnoozePreset(IRemindersCallbacks callbacks, in CustomizedSnoozePresetEntity preset) = 17; + void setAccountState(IRemindersCallbacks callbacks, in AccountState accountState) = 18; + void getAccountState(IRemindersCallbacks callbacks) = 19; + void checkReindexDueDatesNeeded(IRemindersCallbacks callbacks, in ReindexDueDatesOptions options) = 20; + void reindexDueDates(IRemindersCallbacks callbacks, in ReindexDueDatesOptions options) = 21; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.aidl new file mode 100644 index 00000000..bbb90836 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders.model; + +parcelable CustomizedSnoozePresetEntity; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskEntity.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskEntity.aidl new file mode 100644 index 00000000..9a3883c2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskEntity.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders.model; + +parcelable TaskEntity; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskIdEntity.aidl b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskIdEntity.aidl new file mode 100644 index 00000000..a4c41481 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/reminders/model/TaskIdEntity.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.reminders.model; + +parcelable TaskIdEntity; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/UsageReportingOptInOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/UsageReportingOptInOptions.aidl new file mode 100644 index 00000000..a88060fb --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/UsageReportingOptInOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.usagereporting; + +parcelable UsageReportingOptInOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingCallbacks.aidl new file mode 100644 index 00000000..3e877c25 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingCallbacks.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.usagereporting.internal; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.usagereporting.UsageReportingOptInOptions; + +interface IUsageReportingCallbacks { + oneway void onOptInOptions(in Status status, in UsageReportingOptInOptions options) = 1; + oneway void onOptInOptionsSet(in Status status) = 2; + oneway void onOptInOptionsChangedListenerAdded(in Status status) = 3; + oneway void onOptInOptionsChangedListenerRemoved(in Status status) = 4; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingOptInOptionsChangedListener.aidl b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingOptInOptionsChangedListener.aidl new file mode 100644 index 00000000..8e9c2875 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingOptInOptionsChangedListener.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.usagereporting.internal; + +interface IUsageReportingOptInOptionsChangedListener { + oneway void onOptionsChanged() = 1; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingService.aidl new file mode 100644 index 00000000..46d6265d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/usagereporting/internal/IUsageReportingService.aidl @@ -0,0 +1,12 @@ +package com.google.android.gms.usagereporting.internal; + +import com.google.android.gms.usagereporting.internal.IUsageReportingCallbacks; +import com.google.android.gms.usagereporting.internal.IUsageReportingOptInOptionsChangedListener; +import com.google.android.gms.usagereporting.UsageReportingOptInOptions; + +interface IUsageReportingService { + oneway void getOptInOptions(IUsageReportingCallbacks callbacks) = 1; + oneway void setOptInOptions(in UsageReportingOptInOptions options, IUsageReportingCallbacks callbacks) = 2; + oneway void addOptInOptionsChangedListener(IUsageReportingOptInOptionsChangedListener listener, IUsageReportingCallbacks callbacks) = 3; + oneway void removeOptInOptionsChangedListener(IUsageReportingOptInOptionsChangedListener listener, IUsageReportingCallbacks callbacks) = 4; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wallet/IsReadyToPayRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wallet/IsReadyToPayRequest.aidl new file mode 100644 index 00000000..da1b0344 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wallet/IsReadyToPayRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.wallet; + +parcelable IsReadyToPayRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wallet/internal/IOwService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wallet/internal/IOwService.aidl new file mode 100644 index 00000000..ae55cffb --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wallet/internal/IOwService.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.wallet.internal; + +import com.google.android.gms.wallet.internal.IWalletServiceCallbacks; +import com.google.android.gms.wallet.IsReadyToPayRequest; + +interface IOwService { + void isReadyToPay(in IsReadyToPayRequest request, in Bundle args, IWalletServiceCallbacks callbacks) = 13; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/wallet/internal/IWalletServiceCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/wallet/internal/IWalletServiceCallbacks.aidl new file mode 100644 index 00000000..aae5209f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wallet/internal/IWalletServiceCallbacks.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.wallet.internal; + +import com.google.android.gms.common.api.Status; + +interface IWalletServiceCallbacks { + void onIsReadyToPayResponse(in Status status, boolean result, in Bundle args) = 8; +} diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/CompoundHashParcelable.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/CompoundHashParcelable.aidl new file mode 100644 index 00000000..689e5918 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/CompoundHashParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.firebase.database.connection.idl; + +parcelable CompoundHashParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/ConnectionConfig.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/ConnectionConfig.aidl new file mode 100644 index 00000000..d6c1fc31 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/ConnectionConfig.aidl @@ -0,0 +1,3 @@ +package com.google.firebase.database.connection.idl; + +parcelable ConnectionConfig; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IConnectionAuthTokenProvider.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IConnectionAuthTokenProvider.aidl new file mode 100644 index 00000000..447f9f4a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IConnectionAuthTokenProvider.aidl @@ -0,0 +1,7 @@ +package com.google.firebase.database.connection.idl; + +import com.google.firebase.database.connection.idl.IGetTokenCallback; + +interface IConnectionAuthTokenProvider { + void zero(boolean var1, IGetTokenCallback var2) = 0; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IGetTokenCallback.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IGetTokenCallback.aidl new file mode 100644 index 00000000..c4d45cdd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IGetTokenCallback.aidl @@ -0,0 +1,6 @@ +package com.google.firebase.database.connection.idl; + +interface IGetTokenCallback { + void zero(String s) = 0; + void onError(String s) = 1; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IListenHashProvider.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IListenHashProvider.aidl new file mode 100644 index 00000000..a5aaa187 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IListenHashProvider.aidl @@ -0,0 +1,11 @@ +package com.google.firebase.database.connection.idl; + +import com.google.firebase.database.connection.idl.CompoundHashParcelable; + +interface IListenHashProvider { + String zzPY() = 0; + + boolean zzPZ() = 1; + + CompoundHashParcelable zzQF() = 2; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnection.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnection.aidl new file mode 100644 index 00000000..21e00b1c --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnection.aidl @@ -0,0 +1,44 @@ +package com.google.firebase.database.connection.idl; + +import com.google.android.gms.dynamic.IObjectWrapper; + +import com.google.firebase.database.connection.idl.ConnectionConfig; +import com.google.firebase.database.connection.idl.IConnectionAuthTokenProvider; +import com.google.firebase.database.connection.idl.IListenHashProvider; +import com.google.firebase.database.connection.idl.IPersistentConnectionDelegate; +import com.google.firebase.database.connection.idl.IRequestResultCallback; + + +interface IPersistentConnection { + void setup(in ConnectionConfig var1, IConnectionAuthTokenProvider var2, IObjectWrapper var3, IPersistentConnectionDelegate var4) = 0; + + void initialize() = 1; + + void shutdown() = 2; + + void refreshAuthToken() = 3; + + void listen(in List var1, IObjectWrapper var2, IListenHashProvider var3, long var4, IRequestResultCallback var6) = 4; + + void unlisten(in List var1, IObjectWrapper var2) = 5; + + void purgeOutstandingWrites() = 6; + + void put(in List var1, IObjectWrapper var2, IRequestResultCallback var3) = 7; + + void compareAndPut(in List var1, IObjectWrapper var2, String var3, IRequestResultCallback var4) = 8; + + void merge(in List var1, IObjectWrapper var2, IRequestResultCallback var3) = 9; + + void onDisconnectPut(in List var1, IObjectWrapper var2, IRequestResultCallback var3) = 10; + + void onDisconnectMerge(in List var1, IObjectWrapper var2, IRequestResultCallback var3) = 11; + + void onDisconnectCancel(in List var1, IRequestResultCallback var2) = 12; + + void interrupt(String var1) = 13; + + void resume(String var1) = 14; + + boolean isInterrupted(String var1) = 15; +} diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnectionDelegate.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnectionDelegate.aidl new file mode 100644 index 00000000..9ae649d0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IPersistentConnectionDelegate.aidl @@ -0,0 +1,19 @@ +package com.google.firebase.database.connection.idl; + +import com.google.android.gms.dynamic.IObjectWrapper; + +import com.google.firebase.database.connection.idl.RangeParcelable; + +interface IPersistentConnectionDelegate { + void zero(in List var1, IObjectWrapper var2, boolean var3, long var4) = 0; + + void one(in List var1, in List var2, IObjectWrapper var3, long var4) = 1; + + void two() = 2; + + void onDisconnect() = 3; + + void four(boolean var1) = 4; + + void five(IObjectWrapper var1) = 5; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IRequestResultCallback.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IRequestResultCallback.aidl new file mode 100644 index 00000000..5806bc35 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/IRequestResultCallback.aidl @@ -0,0 +1,5 @@ +package com.google.firebase.database.connection.idl; + +interface IRequestResultCallback { + void zero(String var1, String var2) = 0; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/RangeParcelable.aidl b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/RangeParcelable.aidl new file mode 100644 index 00000000..08d6df18 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/database/connection/idl/RangeParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.firebase.database.connection.idl; + +parcelable RangeParcelable; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/Configurations.aidl b/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/Configurations.aidl deleted file mode 100644 index b6487fc3..00000000 --- a/play-services-api/src/main/aidl/com/mgoogle/android/gms/phenotype/Configurations.aidl +++ /dev/null @@ -1,3 +0,0 @@ -package com.mgoogle.android.gms.phenotype; - -parcelable Configurations; diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java index d9a19568..0485f3a2 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.java @@ -19,5 +19,5 @@ package com.google.android.gms.auth; import org.microg.safeparcel.AutoSafeParcelable; public class AccountChangeEvent extends AutoSafeParcelable { - public static Creator CREATOR = new AutoCreator<>(AccountChangeEvent.class); + public static Creator CREATOR = new AutoCreator(AccountChangeEvent.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java index 78a84c71..0d7f5cd8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java @@ -27,6 +27,6 @@ public class AccountChangeEventsRequest extends AutoSafeParcelable { @SafeParceled(3) private String s; - public static Creator CREATOR = new AutoCreator<>(AccountChangeEventsRequest.class); + public static Creator CREATOR = new AutoCreator(AccountChangeEventsRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java index df9e72e8..0bff57a8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java @@ -29,8 +29,8 @@ public class AccountChangeEventsResponse extends AutoSafeParcelable { private List events; public AccountChangeEventsResponse() { - events = new ArrayList<>(); + events = new ArrayList(); } - public static Creator CREATOR = new AutoCreator<>(AccountChangeEventsResponse.class); + public static Creator CREATOR = new AutoCreator(AccountChangeEventsResponse.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java b/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java index da762be9..3b7d45f5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java @@ -60,5 +60,5 @@ public class TokenData extends AutoSafeParcelable { this.scopes = null; } - public static final Creator CREATOR = new AutoCreator<>(TokenData.class); + public static final Creator CREATOR = new AutoCreator(TokenData.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java index cc761a4a..f0f63321 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.java @@ -18,7 +18,6 @@ import org.microg.safeparcel.SafeParceled; import java.util.Arrays; import java.util.List; import java.util.Locale; -import java.util.Objects; @PublicApi public class Credential extends AutoSafeParcelable { @@ -28,22 +27,16 @@ public class Credential extends AutoSafeParcelable { @Field(1) private String id; - @Field(2) private String name; - @Field(3) private Uri profilePictureUri; - @Field(value = 4, subClass = IdToken.class) private List tokens; - @Field(5) private String password; - @Field(6) private String accountType; - @Field(7) private String generatedPassword; @@ -132,19 +125,19 @@ public class Credential extends AutoSafeParcelable { @Override public boolean equals(Object o) { if (this == o) return true; - if (!(o instanceof Credential)) return false; + if (o == null || !(o instanceof Credential)) return false; Credential that = (Credential) o; - if (!Objects.equals(id, that.id)) return false; - if (!Objects.equals(name, that.name)) return false; - if (!Objects.equals(profilePictureUri, that.profilePictureUri)) + if (id != null ? !id.equals(that.id) : that.id != null) return false; + if (name != null ? !name.equals(that.name) : that.name != null) return false; + if (profilePictureUri != null ? !profilePictureUri.equals(that.profilePictureUri) : that.profilePictureUri != null) return false; - if (!Objects.equals(password, that.password)) + if (password != null ? !password.equals(that.password) : that.password != null) return false; - if (!Objects.equals(accountType, that.accountType)) + if (accountType != null ? !accountType.equals(that.accountType) : that.accountType != null) return false; - return Objects.equals(generatedPassword, that.generatedPassword); + return generatedPassword != null ? generatedPassword.equals(that.generatedPassword) : that.generatedPassword == null; } @@ -238,5 +231,5 @@ public class Credential extends AutoSafeParcelable { } } - public static final Creator CREATOR = new AutoCreator<>(Credential.class); + public static final Creator CREATOR = new AutoCreator(Credential.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java index 516e9ccc..e072efd0 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java @@ -20,10 +20,8 @@ public class CredentialPickerConfig extends AutoSafeParcelable { @Field(1) private boolean showAddAccountButton; - @Field(2) private boolean showCancelButton; - @Field(3) private boolean forNewAccount; @@ -60,7 +58,7 @@ public class CredentialPickerConfig extends AutoSafeParcelable { '}'; } - public static class Builder { + public class Builder { private boolean showAddAccountButton; private boolean showCancelButton; private boolean forNewAccount; @@ -94,5 +92,5 @@ public class CredentialPickerConfig extends AutoSafeParcelable { } } - public static final Creator CREATOR = new AutoCreator<>(CredentialPickerConfig.class); + public static final Creator CREATOR = new AutoCreator(CredentialPickerConfig.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java index d5cbf928..a1679445 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java @@ -22,13 +22,10 @@ public class CredentialRequest extends AutoSafeParcelable { @Field(1) private boolean passwordLoginSupported; - @Field(2) private String[] accountTypes; - @Field(3) private CredentialPickerConfig credentialPickerConfig; - @Field(4) private CredentialPickerConfig credentialHintPickerConfig; @@ -65,7 +62,7 @@ public class CredentialRequest extends AutoSafeParcelable { return passwordLoginSupported; } - public static final Creator CREATOR = new AutoCreator<>(CredentialRequest.class); + public static final Creator CREATOR = new AutoCreator(CredentialRequest.class); public static class Builder { private boolean passwordLoginSupported; diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/HintRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/HintRequest.java index 381c34fb..e6a4f1b8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/HintRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/HintRequest.java @@ -167,4 +167,4 @@ public class HintRequest extends AutoSafeParcelable { this.serverClientId = serverClientId; } } -} \ No newline at end of file +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java index 9da04ae7..4c3d1c05 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java @@ -46,5 +46,5 @@ public class IdToken extends AutoSafeParcelable { return id; } - public static final Creator CREATOR = new AutoCreator<>(IdToken.class); + public static final Creator CREATOR = new AutoCreator(IdToken.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdentityProviders.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdentityProviders.java index e3a83f5d..8cd24eed 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdentityProviders.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdentityProviders.java @@ -31,4 +31,4 @@ public final class IdentityProviders { public static String getIdentityProviderForAccount(Account account) { return null; } -} \ No newline at end of file +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java index e560ddc5..bd7ae6f2 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java @@ -19,5 +19,5 @@ package com.google.android.gms.auth.api.credentials.internal; import org.microg.safeparcel.AutoSafeParcelable; public class DeleteRequest extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(DeleteRequest.class); + public static final Creator CREATOR = new AutoCreator(DeleteRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java index 5fd6fcb7..3da7a72a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.java @@ -19,5 +19,5 @@ package com.google.android.gms.auth.api.credentials.internal; import org.microg.safeparcel.AutoSafeParcelable; public class GeneratePasswordRequest extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(GeneratePasswordRequest.class); + public static final Creator CREATOR = new AutoCreator(GeneratePasswordRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java index 24a9d92f..5ec25998 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.java @@ -19,5 +19,5 @@ package com.google.android.gms.auth.api.credentials.internal; import org.microg.safeparcel.AutoSafeParcelable; public class SaveRequest extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(SaveRequest.class); + public static final Creator CREATOR = new AutoCreator(SaveRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyRequest.java new file mode 100644 index 00000000..71270ebb --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyRequest.java @@ -0,0 +1,41 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.auth.api.proxy; + +import android.os.Bundle; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ProxyRequest extends AutoSafeParcelable { + public static final int HTTP_METHOD_GET = 0; + public static final int HTTP_METHOD_POST = 1; + public static final int HTTP_METHOD_PUT = 2; + public static final int HTTP_METHOD_DELETE = 3; + public static final int HTTP_METHOD_HEAD = 4; + public static final int HTTP_METHOD_OPTIONS = 5; + public static final int HTTP_METHOD_TRACE = 6; + public static final int HTTP_METHOD_PATCH = 7; + + @Field(1000) + private int versionCode = 2; + @Field(1) + public String url; + @Field(2) + public int httpMethod; + @Field(3) + public long timeoutMillis; + @Field(4) + public byte[] body; + @Field(5) + public Bundle headers; + + @Override + public String toString() { + return url; + } + + public static final Creator CREATOR = new AutoCreator<>(ProxyRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyResponse.java new file mode 100644 index 00000000..951210cb --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/proxy/ProxyResponse.java @@ -0,0 +1,30 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.auth.api.proxy; + +import android.app.PendingIntent; +import android.os.Bundle; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ProxyResponse extends AutoSafeParcelable { + public static final int STATUS_CODE_NO_CONNECTION = -1; + + @Field(1000) + private int versionCode = 1; + @Field(1) + public int gmsStatusCode; + @Field(2) + public PendingIntent recoveryAction; + @Field(3) + public int httpStatusCode; + @Field(4) + public Bundle headers; + @Field(5) + public byte[] body; + + public static final Creator CREATOR = new AutoCreator<>(ProxyResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java index 037427cb..6c73b4bc 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java @@ -42,5 +42,5 @@ public class AccountRecoveryGuidanceRequest extends AutoSafeParcelable { this.account = account; } - public static final Creator CREATOR = new AutoCreator<>(AccountRecoveryGuidanceRequest.class); + public static final Creator CREATOR = new AutoCreator(AccountRecoveryGuidanceRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java index 740b36f8..cd56eb1a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java @@ -42,5 +42,5 @@ public class AccountRemovalRequest extends AutoSafeParcelable { this.account = account; } - public static final Creator CREATOR = new AutoCreator<>(AccountRemovalRequest.class); + public static final Creator CREATOR = new AutoCreator(AccountRemovalRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java index 2b55b7cb..c7db433b 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java @@ -30,5 +30,5 @@ public class ConfirmCredentialsRequest extends AutoSafeParcelable { @SafeParceled(3) public CaptchaSolution captchaSolution; - public static final Creator CREATOR = new AutoCreator<>(ConfirmCredentialsRequest.class); + public static final Creator CREATOR = new AutoCreator(ConfirmCredentialsRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java index 20efadb4..4a200050 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java @@ -40,5 +40,5 @@ public class TokenRequest extends AutoSafeParcelable{ return new Account(accountName, accountType); } - public static final Creator CREATOR = new AutoCreator<>(TokenRequest.class); + public static final Creator CREATOR = new AutoCreator(TokenRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java index 9e1903dd..0091dee5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java @@ -39,5 +39,5 @@ public class ConfirmCredentialsWorkflowRequest extends AutoSafeParcelable { @SafeParceled(6) public AccountAuthenticatorResponse accountAuthenticatorResponse; - public static final Creator CREATOR = new AutoCreator<>(ConfirmCredentialsWorkflowRequest.class); + public static final Creator CREATOR = new AutoCreator(ConfirmCredentialsWorkflowRequest.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java index f8315516..4b57130d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.java @@ -34,5 +34,5 @@ public class AccountCredentials extends AutoSafeParcelable { return new Account(accountName, accountType); } - public static final Creator CREATOR = new AutoCreator<>(AccountCredentials.class); + public static final Creator CREATOR = new AutoCreator(AccountCredentials.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java index 8b63ab12..9e339e81 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java @@ -31,5 +31,5 @@ public class AppDescription extends AutoSafeParcelable { @SafeParceled(5) public String callingPkg; - public static final Creator CREATOR = new AutoCreator<>(AppDescription.class); + public static final Creator CREATOR = new AutoCreator(AppDescription.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java index 6fe2b279..9563798e 100644 --- a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java @@ -25,5 +25,5 @@ public class CaptchaSolution extends AutoSafeParcelable { @SafeParceled(1) private int versionCode = 1; - public static final Creator CREATOR = new AutoCreator<>(CaptchaSolution.class); + public static final Creator CREATOR = new AutoCreator(CaptchaSolution.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java b/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java index 1c3b00ec..0f193b9c 100644 --- a/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java +++ b/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java @@ -18,17 +18,17 @@ package com.google.android.gms.clearcut; import android.util.Base64; +import com.google.android.gms.clearcut.internal.LogVerifierResultParcelable; import com.google.android.gms.phenotype.ExperimentToken; import com.google.android.gms.phenotype.GenericDimension; -import com.google.android.gms.playlog.internal.PlayLoggerContext; +import com.google.android.gms.clearcut.internal.PlayLoggerContext; import org.microg.safeparcel.AutoSafeParcelable; -import org.microg.safeparcel.SafeParceled; import java.nio.ByteBuffer; import java.nio.CharBuffer; +import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; -import java.nio.charset.StandardCharsets; import java.util.Arrays; public class LogEventParcelable extends AutoSafeParcelable { @@ -62,6 +62,9 @@ public class LogEventParcelable extends AutoSafeParcelable { @Field(10) public final GenericDimension[] genericDimensions; + @Field(11) + public final LogVerifierResultParcelable logVerifierResult; + private LogEventParcelable() { context = null; bytes = null; @@ -71,6 +74,7 @@ public class LogEventParcelable extends AutoSafeParcelable { addPhenotypeExperimentTokens = false; experimentTokenParcelables = null; genericDimensions = null; + logVerifierResult = null; } public LogEventParcelable(PlayLoggerContext context, byte[] bytes, int[] testCodes, String[] mendelPackages, int[] experimentIds, byte[][] experimentTokens, boolean addPhenotypeExperimentTokens) { @@ -81,8 +85,9 @@ public class LogEventParcelable extends AutoSafeParcelable { this.experimentIds = experimentIds; this.experimentTokens = experimentTokens; this.addPhenotypeExperimentTokens = addPhenotypeExperimentTokens; - experimentTokenParcelables = null; - genericDimensions = null; + this.experimentTokenParcelables = null; + this.genericDimensions = null; + this.logVerifierResult = null; } @Override @@ -104,7 +109,7 @@ public class LogEventParcelable extends AutoSafeParcelable { private String getBytesAsString() { if (bytes == null) return "null"; try { - CharsetDecoder d = StandardCharsets.US_ASCII.newDecoder(); + CharsetDecoder d = Charset.forName("US-ASCII").newDecoder(); CharBuffer r = d.decode(ByteBuffer.wrap(bytes)); return r.toString(); } catch (Exception e) { @@ -112,5 +117,5 @@ public class LogEventParcelable extends AutoSafeParcelable { } } - public static final Creator CREATOR = new AutoCreator<>(LogEventParcelable.class); + public static final Creator CREATOR = new AutoCreator(LogEventParcelable.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/LogVerifierResultParcelable.java b/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/LogVerifierResultParcelable.java new file mode 100644 index 00000000..4b1fa834 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/LogVerifierResultParcelable.java @@ -0,0 +1,15 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.clearcut.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LogVerifierResultParcelable extends AutoSafeParcelable { + @Field(1) + public boolean b; + + public static final Creator CREATOR = new AutoCreator<>(LogVerifierResultParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java b/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/PlayLoggerContext.java similarity index 77% rename from play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java rename to play-services-api/src/main/java/com/google/android/gms/clearcut/internal/PlayLoggerContext.java index 9e595a9c..0827632d 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java +++ b/play-services-api/src/main/java/com/google/android/gms/clearcut/internal/PlayLoggerContext.java @@ -1,23 +1,11 @@ /* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 */ -package com.google.android.gms.playlog.internal; +package com.google.android.gms.clearcut.internal; import org.microg.safeparcel.AutoSafeParcelable; -import org.microg.safeparcel.SafeParceled; public class PlayLoggerContext extends AutoSafeParcelable { @@ -33,9 +21,6 @@ public class PlayLoggerContext extends AutoSafeParcelable { @Field(4) public final int logSource; - @Field(8) - public final String logSourceName; - @Field(5) public final String uploadAccount; @@ -45,6 +30,9 @@ public class PlayLoggerContext extends AutoSafeParcelable { @Field(7) public final boolean logAndroidId; + @Field(8) + public final String logSourceName; + @Field(9) public final boolean isAnonymous; @@ -57,13 +45,16 @@ public class PlayLoggerContext extends AutoSafeParcelable { @Field(12) public final boolean scrubMccMnc; + @Field(13) + public final Integer piiLevelset; + private PlayLoggerContext() { packageName = uploadAccount = logSourceName = loggingId = null; - qosTier = packageVersionCode = logSource = appMobileSpecId = -1; + qosTier = packageVersionCode = logSource = appMobileSpecId = piiLevelset = -1; isAnonymous = logAndroidId = scrubMccMnc = false; } - public PlayLoggerContext(String packageName, int packageVersionCode, int logSource, String logSourceName, String uploadAccount, String loggingId, boolean isAnonymous, int qosTier, boolean scrubMccMnc) { + public PlayLoggerContext(String packageName, int packageVersionCode, int logSource, String logSourceName, String uploadAccount, String loggingId, boolean isAnonymous, int qosTier, boolean scrubMccMnc, int piiLevelset) { this.packageName = packageName; this.packageVersionCode = packageVersionCode; this.logSource = logSource; @@ -75,6 +66,7 @@ public class PlayLoggerContext extends AutoSafeParcelable { this.qosTier = qosTier; this.appMobileSpecId = null; this.scrubMccMnc = scrubMccMnc; + this.piiLevelset = piiLevelset; } @Override @@ -89,9 +81,12 @@ public class PlayLoggerContext extends AutoSafeParcelable { sb.append(", logSourceName=").append(logSourceName); sb.append(", isAnonymous=").append(isAnonymous); sb.append(", qosTier=").append(qosTier); + sb.append(", appMobileSpecId=").append(appMobileSpecId); + sb.append(", scrubMccMnc=").append(scrubMccMnc); + sb.append(", piiLevelset=").append(piiLevelset); sb.append(']'); return sb.toString(); } public static Creator CREATOR = new AutoCreator(PlayLoggerContext.class); -} \ No newline at end of file +} diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/GoogleCertificatesQuery.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/GoogleCertificatesQuery.java index f47be78c..c8240279 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/internal/GoogleCertificatesQuery.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/GoogleCertificatesQuery.java @@ -71,5 +71,5 @@ public class GoogleCertificatesQuery extends AutoSafeParcelable { return certData; } - public static final Creator CREATOR = new AutoCreator<>(GoogleCertificatesQuery.class); + public static final Creator CREATOR = new AutoCreator(GoogleCertificatesQuery.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java index d32e668b..6f10959a 100644 --- a/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java +++ b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java @@ -20,5 +20,5 @@ import org.microg.safeparcel.AutoSafeParcelable; public class FavaDiagnosticsEntity extends AutoSafeParcelable { - public static final Creator CREATOR = new AutoCreator<>(FavaDiagnosticsEntity.class); + public static final Creator CREATOR = new AutoCreator(FavaDiagnosticsEntity.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddEventListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddEventListenerRequest.java new file mode 100644 index 00000000..bce9276b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddEventListenerRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AddEventListenerRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(AddEventListenerRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddPermissionRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddPermissionRequest.java new file mode 100644 index 00000000..559d52d3 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AddPermissionRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AddPermissionRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(AddPermissionRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/AuthorizeAccessRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AuthorizeAccessRequest.java new file mode 100644 index 00000000..b99fb5f8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/AuthorizeAccessRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AuthorizeAccessRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(AuthorizeAccessRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CancelPendingActionsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CancelPendingActionsRequest.java new file mode 100644 index 00000000..fb18670d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CancelPendingActionsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CancelPendingActionsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CancelPendingActionsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.java new file mode 100644 index 00000000..a7e4630a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeResourceParentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ChangeResourceParentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ChangeResourceParentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeSequenceNumber.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeSequenceNumber.java new file mode 100644 index 00000000..70892fac --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangeSequenceNumber.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ChangeSequenceNumber extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ChangeSequenceNumber.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangesResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangesResponse.java new file mode 100644 index 00000000..3a43cad4 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ChangesResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ChangesResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ChangesResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.java new file mode 100644 index 00000000..d892262f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CheckResourceIdsExistRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CheckResourceIdsExistRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CheckResourceIdsExistRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.java new file mode 100644 index 00000000..cb5e8e65 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsAndUpdateMetadataRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CloseContentsAndUpdateMetadataRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CloseContentsAndUpdateMetadataRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsRequest.java new file mode 100644 index 00000000..334c98d8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CloseContentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CloseContentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CloseContentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ContentsResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ContentsResponse.java new file mode 100644 index 00000000..f59029b8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ContentsResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ContentsResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ContentsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ControlProgressRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ControlProgressRequest.java new file mode 100644 index 00000000..2812eb27 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ControlProgressRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ControlProgressRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ControlProgressRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateContentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateContentsRequest.java new file mode 100644 index 00000000..46b5c419 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateContentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateContentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateContentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.java new file mode 100644 index 00000000..260283eb --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileIntentSenderRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateFileIntentSenderRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateFileIntentSenderRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileRequest.java new file mode 100644 index 00000000..0e914da0 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFileRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateFileRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateFileRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFolderRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFolderRequest.java new file mode 100644 index 00000000..b1e7e79c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/CreateFolderRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateFolderRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateFolderRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeleteResourceRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeleteResourceRequest.java new file mode 100644 index 00000000..562d7b37 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeleteResourceRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DeleteResourceRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DeleteResourceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.java new file mode 100644 index 00000000..c2aae15f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DeviceUsagePreferenceResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DeviceUsagePreferenceResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DeviceUsagePreferenceResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DisconnectRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DisconnectRequest.java new file mode 100644 index 00000000..abbebd38 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DisconnectRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DisconnectRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DisconnectRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DownloadProgressResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DownloadProgressResponse.java new file mode 100644 index 00000000..52d2a5ec --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DownloadProgressResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DownloadProgressResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DownloadProgressResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveIdResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveIdResponse.java new file mode 100644 index 00000000..7aaf7c63 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveIdResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DriveIdResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DriveIdResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DrivePreferencesResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DrivePreferencesResponse.java new file mode 100644 index 00000000..3a96d337 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DrivePreferencesResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DrivePreferencesResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DrivePreferencesResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveServiceResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveServiceResponse.java new file mode 100644 index 00000000..40cb34d5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/DriveServiceResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DriveServiceResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(DriveServiceResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/EventResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/EventResponse.java new file mode 100644 index 00000000..6e83957a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/EventResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class EventResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(EventResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailRequest.java new file mode 100644 index 00000000..5b8c5c14 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class FetchThumbnailRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(FetchThumbnailRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailResponse.java new file mode 100644 index 00000000..99499f52 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/FetchThumbnailResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class FetchThumbnailResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(FetchThumbnailResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetChangesRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetChangesRequest.java new file mode 100644 index 00000000..6d338d2e --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetChangesRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetChangesRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetChangesRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.java new file mode 100644 index 00000000..cb56b4f5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetDriveIdFromUniqueIdRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetDriveIdFromUniqueIdRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetDriveIdFromUniqueIdRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetMetadataRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetMetadataRequest.java new file mode 100644 index 00000000..8f0e8c4f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetMetadataRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetMetadataRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetMetadataRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsRequest.java new file mode 100644 index 00000000..d63fa651 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetPermissionsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetPermissionsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsResponse.java new file mode 100644 index 00000000..b407068a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/GetPermissionsResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetPermissionsResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetPermissionsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListEntriesResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListEntriesResponse.java new file mode 100644 index 00000000..a6413483 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListEntriesResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ListEntriesResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ListEntriesResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsRequest.java new file mode 100644 index 00000000..b417a604 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ListParentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ListParentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsResponse.java new file mode 100644 index 00000000..e0c532cd --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ListParentsResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ListParentsResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ListParentsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeRequest.java new file mode 100644 index 00000000..fd326195 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LoadRealtimeRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(LoadRealtimeRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeResponse.java new file mode 100644 index 00000000..8d6ec093 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/LoadRealtimeResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LoadRealtimeResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(LoadRealtimeResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/MetadataResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/MetadataResponse.java new file mode 100644 index 00000000..61e1e656 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/MetadataResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class MetadataResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(MetadataResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenContentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenContentsRequest.java new file mode 100644 index 00000000..478a8800 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenContentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class OpenContentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(OpenContentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.java new file mode 100644 index 00000000..de7df066 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/OpenFileIntentSenderRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class OpenFileIntentSenderRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(OpenFileIntentSenderRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.java new file mode 100644 index 00000000..e9d152f5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RealtimeDocumentSyncRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class RealtimeDocumentSyncRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(RealtimeDocumentSyncRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemoveEventListenerRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemoveEventListenerRequest.java new file mode 100644 index 00000000..3a0a03c2 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemoveEventListenerRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class RemoveEventListenerRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(RemoveEventListenerRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemovePermissionRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemovePermissionRequest.java new file mode 100644 index 00000000..8df27d1f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/RemovePermissionRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class RemovePermissionRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(RemovePermissionRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/ResourceIdSetResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ResourceIdSetResponse.java new file mode 100644 index 00000000..1db6cd07 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/ResourceIdSetResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ResourceIdSetResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ResourceIdSetResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.java new file mode 100644 index 00000000..44a1bad1 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetDrivePreferencesRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SetDrivePreferencesRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(SetDrivePreferencesRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.java new file mode 100644 index 00000000..cdb9827c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetFileUploadPreferencesRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SetFileUploadPreferencesRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(SetFileUploadPreferencesRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetResourceParentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetResourceParentsRequest.java new file mode 100644 index 00000000..084a1e7a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SetResourceParentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SetResourceParentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(SetResourceParentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/StartStreamSession.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StartStreamSession.java new file mode 100644 index 00000000..767de36d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StartStreamSession.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class StartStreamSession extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(StartStreamSession.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/StreamContentsRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StreamContentsRequest.java new file mode 100644 index 00000000..83c82274 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StreamContentsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class StreamContentsRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(StreamContentsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/StringListResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StringListResponse.java new file mode 100644 index 00000000..38728f08 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/StringListResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class StringListResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(StringListResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/SyncMoreResponse.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SyncMoreResponse.java new file mode 100644 index 00000000..aed23394 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/SyncMoreResponse.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SyncMoreResponse extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(SyncMoreResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/TrashResourceRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/TrashResourceRequest.java new file mode 100644 index 00000000..bfb8f7be --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/TrashResourceRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class TrashResourceRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(TrashResourceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.java new file mode 100644 index 00000000..61cfed64 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UnsubscribeResourceRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UnsubscribeResourceRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UnsubscribeResourceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/UntrashResourceRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UntrashResourceRequest.java new file mode 100644 index 00000000..cce6e6ae --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UntrashResourceRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UntrashResourceRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UntrashResourceRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdateMetadataRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdateMetadataRequest.java new file mode 100644 index 00000000..f71093f4 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdateMetadataRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UpdateMetadataRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UpdateMetadataRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdatePermissionRequest.java b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdatePermissionRequest.java new file mode 100644 index 00000000..61587e3a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/internal/UpdatePermissionRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UpdatePermissionRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UpdatePermissionRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java b/play-services-api/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java new file mode 100644 index 00000000..9752627e --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/drive/metadata/internal/MetadataBundle.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.drive.metadata.internal; + +public class MetadataBundle { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/fitness/data/DataPoint.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/DataPoint.java new file mode 100644 index 00000000..cc63ed7b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/fitness/data/DataPoint.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.fitness.data; + +public class DataPoint { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/fitness/data/Device.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Device.java new file mode 100644 index 00000000..9566ef23 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Device.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.fitness.data; + +public class Device { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/fitness/data/Field.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Field.java new file mode 100644 index 00000000..e0e56bb7 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Field.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.fitness.data; + +public class Field { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/fitness/data/Value.java b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Value.java new file mode 100644 index 00000000..fc1b706c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/fitness/data/Value.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.fitness.data; + +public class Value { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/games/multiplayer/realtime/RealTimeMessage.java b/play-services-api/src/main/java/com/google/android/gms/games/multiplayer/realtime/RealTimeMessage.java new file mode 100644 index 00000000..f6716de3 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/games/multiplayer/realtime/RealTimeMessage.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2013-2019 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.games.multiplayer.realtime; + +import android.os.Parcel; +import android.os.Parcelable; +import android.os.Parcelable.Creator; + +public final class RealTimeMessage implements Parcelable { + public static final int RELIABLE = 1; + public static final int UNRELIABLE = 0; + + private final String mSenderParticipantId; + private final byte[] mMessageData; + private final int mIsReliable; + + public RealTimeMessage(String senderParticipantId, byte[] messageData, int isReliable) { + this.mSenderParticipantId = senderParticipantId; + this.mMessageData = messageData.clone(); + this.mIsReliable = isReliable; + } + + private RealTimeMessage(Parcel parcel) { + this(parcel.readString(), parcel.createByteArray(), parcel.readInt()); + } + + public static final Creator CREATOR = new Creator() { + @Override + public RealTimeMessage createFromParcel(Parcel in) { + return new RealTimeMessage(in); + } + @Override + public RealTimeMessage[] newArray(int size) { + return new RealTimeMessage[size]; + } + }; + + public byte[] getMessageData() { + return this.mMessageData; + } + + public String getSenderParticipantId() { + return this.mSenderParticipantId; + } + + public boolean isReliable() { + return this.mIsReliable == RELIABLE; + } + + @Override + public void writeToParcel(Parcel parcel, int flag) { + parcel.writeString(this.mSenderParticipantId); + parcel.writeByteArray(this.mMessageData); + parcel.writeInt(this.mIsReliable); + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java new file mode 100644 index 00000000..405f31d1 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/GoogleMapOptions.java @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps; + +import com.google.android.gms.maps.model.CameraPosition; +import com.google.android.gms.maps.model.LatLngBounds; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public final class GoogleMapOptions extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private int zOrderOnTop; + @SafeParceled(3) + private boolean useViewLifecycleInFragment; + @SafeParceled(4) + private int mapType; + @SafeParceled(5) + private CameraPosition camera; + @SafeParceled(6) + private boolean zoomControlsEnabled; + @SafeParceled(7) + private boolean compassEnabled; + @SafeParceled(8) + private boolean scrollGesturesEnabled = true; + @SafeParceled(9) + private boolean zoomGesturesEnabled = true; + @SafeParceled(10) + private boolean tiltGesturesEnabled = true; + @SafeParceled(11) + private boolean rotateGesturesEnabled = true; + @SafeParceled(12) + private boolean liteMode = false; + @SafeParceled(14) + private boolean mapToobarEnabled = false; + @SafeParceled(15) + private boolean ambientEnabled = false; + @SafeParceled(16) + private float minZoom; + @SafeParceled(17) + private float maxZoom; + @SafeParceled(18) + private LatLngBounds boundsForCamera; + @SafeParceled(19) + private boolean scrollGesturesEnabledDuringRotateOrZoom = true; + + public GoogleMapOptions() { + } + + public Boolean getAmbientEnabled() { + return ambientEnabled; + } + + public CameraPosition getCamera() { + return camera; + } + + public Boolean getCompassEnabled() { + return compassEnabled; + } + + public LatLngBounds getLatLngBoundsForCameraTarget() { + return boundsForCamera; + } + + public Boolean getLiteMode() { + return liteMode; + } + + public Boolean getMapToolbarEnabled() { + return mapToobarEnabled; + } + + public int getMapType() { + return mapType; + } + + public Float getMaxZoomPreference() { + return maxZoom; + } + + public Float getMinZoomPreference() { + return minZoom; + } + + public Boolean getRotateGesturesEnabled() { + return rotateGesturesEnabled; + } + + public Boolean getScrollGesturesEnabled() { + return scrollGesturesEnabled; + } + + public Boolean getScrollGesturesEnabledDuringRotateOrZoom() { + return scrollGesturesEnabledDuringRotateOrZoom; + } + + public Boolean getTiltGesturesEnabled() { + return tiltGesturesEnabled; + } + + public Boolean getUseViewLifecycleInFragment() { + return useViewLifecycleInFragment; + } + + public Boolean getZOrderOnTop() { + return zOrderOnTop == 1; // TODO + } + + public Boolean getZoomControlsEnabled() { + return zoomControlsEnabled; + } + + public Boolean getZoomGesturesEnabled() { + return zoomGesturesEnabled; + } + + @Deprecated + public boolean isCompassEnabled() { + return compassEnabled; + } + + @Deprecated + public boolean isZoomControlsEnabled() { + return zoomControlsEnabled; + } + + @Deprecated + public boolean isScrollGesturesEnabled() { + return scrollGesturesEnabled; + } + + @Deprecated + public boolean isZoomGesturesEnabled() { + return zoomGesturesEnabled; + } + + @Deprecated + public boolean isTiltGesturesEnabled() { + return tiltGesturesEnabled; + } + + @Deprecated + public boolean isRotateGesturesEnabled() { + return rotateGesturesEnabled; + } + + + public static Creator CREATOR = new AutoCreator(GoogleMapOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java new file mode 100644 index 00000000..e59c7935 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/StreetViewPanoramaOptions.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps; + +public class StreetViewPanoramaOptions { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/internal/Point.java b/play-services-api/src/main/java/com/google/android/gms/maps/internal/Point.java new file mode 100644 index 00000000..9d31c133 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/internal/Point.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.internal; + +public class Point { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java new file mode 100644 index 00000000..881c8abb --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/BitmapDescriptor.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import com.google.android.gms.dynamic.IObjectWrapper; + +import org.microg.gms.common.PublicApi; + +/** + * Defines an image. For a marker, it can be used to set the image of the marker icon. For a ground + * overlay, it can be used to set the image to place on the surface of the earth. + */ +@PublicApi +public class BitmapDescriptor { + private final IObjectWrapper remoteObject; + + public BitmapDescriptor(IObjectWrapper remoteObject) { + this.remoteObject = remoteObject; + } + + public IObjectWrapper getRemoteObject() { + return remoteObject; + } +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java new file mode 100644 index 00000000..c6fbe415 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/CameraPosition.java @@ -0,0 +1,249 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.content.Context; +import android.util.AttributeSet; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +/** + * An immutable class that aggregates all camera position parameters. + */ +@PublicApi +public final class CameraPosition extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + /** + * The location that the camera is pointing at. + */ + @SafeParceled(2) + public final LatLng target; + /** + * Zoom level near the center of the screen. + * See {@link Builder#zoom(float)} for the definition of the camera's zoom level. + */ + @SafeParceled(3) + public final float zoom; + /** + * The angle, in degrees, of the camera angle from the nadir (directly facing the Earth). + * See {@link Builder#tilt(float)} for details of restrictions on the range of values. + */ + @SafeParceled(4) + public final float tilt; + /** + * Direction that the camera is pointing in, in degrees clockwise from north. + */ + @SafeParceled(5) + public final float bearing; + + /** + * This constructor is dirty setting the final fields to make the compiler happy. + * In fact, those are replaced by their real values later using SafeParcelUtil. + */ + private CameraPosition() { + target = null; + zoom = tilt = bearing = 0; + } + + /** + * Constructs a CameraPosition. + * + * @param target The target location to align with the center of the screen. + * @param zoom Zoom level at target. See {@link #zoom} for details of restrictions. + * @param tilt The camera angle, in degrees, from the nadir (directly down). See + * {@link #tilt} for details of restrictions. + * @param bearing Direction that the camera is pointing in, in degrees clockwise from north. + * This value will be normalized to be within 0 degrees inclusive and 360 + * degrees exclusive. + * @throws NullPointerException if {@code target} is {@code null} + * @throws IllegalArgumentException if {@code tilt} is outside range of {@code 0} to {@code 90} + * degrees inclusive + */ + public CameraPosition(LatLng target, float zoom, float tilt, float bearing) + throws NullPointerException, IllegalArgumentException { + if (target == null) { + throw new NullPointerException("null camera target"); + } + this.target = target; + this.zoom = zoom; + if (tilt < 0 || 90 < tilt) { + throw new IllegalArgumentException("Tilt needs to be between 0 and 90 inclusive"); + } + this.tilt = tilt; + if (bearing <= 0) { + bearing += 360; + } + this.bearing = bearing % 360; + } + + /** + * Creates a builder for a camera position. + */ + public static Builder builder() { + return new Builder(); + } + + /** + * Creates a builder for a camera position, initialized to a given position. + */ + public static Builder builder(CameraPosition camera) { + return new Builder(camera); + } + + /** + * Creates a CameraPostion from the attribute set + * + * @throws UnsupportedOperationException + */ + public static CameraPosition createFromAttributes(Context context, AttributeSet attrs) { + return null; // TODO + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; + + CameraPosition that = (CameraPosition) o; + + if (Float.compare(that.bearing, bearing) != 0) + return false; + if (Float.compare(that.tilt, tilt) != 0) + return false; + if (Float.compare(that.zoom, zoom) != 0) + return false; + if (!target.equals(that.target)) + return false; + + return true; + } + + /** + * Constructs a CameraPosition pointed for a particular target and zoom level. The resultant + * bearing is North, and the viewing angle is perpendicular to the Earth's surface. i.e., + * directly facing the Earth's surface, with the top of the screen pointing North. + * + * @param target The target location to align with the center of the screen. + * @param zoom Zoom level at target. See {@link Builder#zoom(float)} for details on the range + * the value will be clamped to. The larger the value the more zoomed in the + * camera is. + */ + public static final CameraPosition fromLatLngZoom(LatLng target, float zoom) { + return builder().target(target).zoom(zoom).build(); + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[] { target, zoom, tilt, bearing }); + } + + @Override + public String toString() { + return "CameraPosition{" + + "target=" + target + + ", zoom=" + zoom + + ", tilt=" + tilt + + ", bearing=" + bearing + + '}'; + } + + public static Creator CREATOR = new AutoCreator(CameraPosition.class); + + /** + * Builds camera position. + */ + public static final class Builder { + private LatLng target; + private float zoom; + private float tilt; + private float bearing; + + public Builder() { + } + + public Builder(CameraPosition previous) { + target = previous.target; + zoom = previous.zoom; + tilt = previous.tilt; + bearing = previous.bearing; + } + + /** + * Sets the direction that the camera is pointing in, in degrees clockwise from north. + */ + public Builder bearing(float bearing) { + this.bearing = bearing; + return this; + } + + /** + * Builds a {@link CameraPosition}. + */ + public CameraPosition build() { + return new CameraPosition(target, zoom, tilt, bearing); + } + + /** + * Sets the location that the camera is pointing at. + */ + public Builder target(LatLng target) { + this.target = target; + return this; + } + + /** + * Sets the angle, in degrees, of the camera from the nadir (directly facing the Earth). + * When changing the camera position for a map, this value is restricted depending on the + * zoom level of the camera. The restrictions are as follows: + *
    + *
  • For zoom levels less than 10 the maximum is 30.
  • + *
  • For zoom levels from 10 to 14 the maximum increases linearly from 30 to 45 (e.g. at + * zoom level 12, the maximum is 37.5).
  • + *
  • For zoom levels from 14 to 15.5 the maximum increases linearly from 45 to 67.5.
  • + *
  • For zoom levels greater than 15.5 the maximum is 67.5.
  • + *
+ * The minimum is always 0 (directly down). If you specify a value outside this range and try to move the camera to this camera position it will be clamped to these bounds. + */ + public Builder tilt(float tilt) { + this.tilt = tilt; + return this; + } + + /** + * Sets the zoom level of the camera. Zoom level is defined such that at zoom level 0, the + * whole world is approximately 256dp wide (assuming that the camera is not tilted). + * Increasing the zoom level by 1 doubles the width of the world on the screen. Hence at + * zoom level N, the width of the world is approximately 256 * 2 N dp, i.e., at zoom level + * 2, the whole world is approximately 1024dp wide. + *

+ * When changing the camera position for a map, the zoom level of the camera is restricted + * to a certain range depending on various factors including location, map type and map + * size. Note that the camera zoom need not be an integer value. + */ + public Builder zoom(float zoom) { + this.zoom = zoom; + return this; + } + } +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java new file mode 100644 index 00000000..9f611060 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/CircleOptions.java @@ -0,0 +1,221 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.graphics.Color; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Defines options for a Circle. + */ +@PublicApi +public class CircleOptions extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private LatLng center; + @SafeParceled(3) + private double radius = 0; + @SafeParceled(4) + private float strokeWidth = 10; + @SafeParceled(5) + private int strokeColor = Color.BLACK; + @SafeParceled(6) + private int fillColor = Color.TRANSPARENT; + @SafeParceled(7) + private float zIndex = 0; + @SafeParceled(8) + private boolean visible = true; + + /** + * Creates circle options. + */ + public CircleOptions() { + } + + /** + * Sets the center using a {@link LatLng}. + *

+ * The center must not be {@code null}. + *

+ * This method is mandatory because there is no default center. + * + * @param center The geographic center as a {@link LatLng}. + * @return this {@link CircleOptions} object + */ + public CircleOptions center(LatLng center) { + this.center = center; + return this; + } + + /** + * Sets the fill color. + *

+ * The fill color is the color inside the circle, in the integer format specified by + * {@link Color}. If TRANSPARENT is used then no fill is drawn. + *

+ * By default the fill color is transparent ({@code 0x00000000}). + * + * @param color color in the {@link Color} format + * @return this {@link CircleOptions} object + */ + public CircleOptions fillColor(int color) { + this.fillColor = color; + return this; + } + + /** + * Returns the center as a {@link LatLng}. + * + * @return The geographic center as a {@link LatLng}. + */ + public LatLng getCenter() { + return center; + } + + /** + * Returns the fill color. + * + * @return The color in the {@link Color} format. + */ + public int getFillColor() { + return fillColor; + } + + /** + * Returns the circle's radius, in meters. + * + * @return The radius in meters. + */ + public double getRadius() { + return radius; + } + + /** + * Returns the stroke color. + * + * @return The color in the {@link Color} format. + */ + public int getStrokeColor() { + return strokeColor; + } + + /** + * Returns the stroke width. + * + * @return The width in screen pixels. + */ + public float getStrokeWidth() { + return strokeWidth; + } + + /** + * Returns the zIndex. + * + * @return The zIndex value. + */ + public float getZIndex() { + return zIndex; + } + + /** + * Checks whether the circle is visible. + * + * @return {code true} if the circle is visible; {@code false} if it is invisible. + */ + public boolean isVisible() { + return visible; + } + + /** + * Sets the radius in meters. + *

+ * The radius must be zero or greater. The default radius is zero. + * + * @param radius radius in meters + * @return this {@link CircleOptions} object + */ + public CircleOptions radius(double radius) { + this.radius = radius; + return this; + } + + /** + * Sets the stroke color. + *

+ * The stroke color is the color of this circle's outline, in the integer format specified by + * {@link Color}. If TRANSPARENT is used then no outline is drawn. + *

+ * By default the stroke color is black ({@code 0xff000000}). + * + * @param color color in the {@link Color} format + * @return this {@link CircleOptions} object + */ + public CircleOptions strokeColor(int color) { + this.strokeColor = color; + return this; + } + + /** + * Sets the stroke width. + *

+ * The stroke width is the width (in screen pixels) of the circle's outline. It must be zero or + * greater. If it is zero then no outline is drawn. + *

+ * The default width is 10 pixels. + * + * @param width width in screen pixels + * @return this {@link CircleOptions} object + */ + public CircleOptions strokeWidth(float width) { + this.strokeWidth = width; + return this; + } + + /** + * Sets the visibility. + *

+ * If this circle is not visible then it is not drawn, but all other state is preserved. + * + * @param visible {@code false} to make this circle invisible + * @return this {@link CircleOptions} object + */ + public CircleOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + /** + * Sets the zIndex. + *

+ * Overlays (such as circles) with higher zIndices are drawn above those with lower indices. + *

+ * By default the zIndex is {@code 0.0}. + * + * @param zIndex zIndex value + * @return this {@link CircleOptions} object + */ + public CircleOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + + public static Creator CREATOR = new AutoCreator(CircleOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java new file mode 100644 index 00000000..b29afdf7 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -0,0 +1,341 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.os.IBinder; + +import com.google.android.gms.dynamic.ObjectWrapper; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Defines options for a ground overlay. + */ +@PublicApi +public class GroundOverlayOptions extends AutoSafeParcelable { + /** + * Flag for when no dimension is specified for the height. + */ + public static final float NO_DIMENSION = -1; + + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private IBinder image; + private BitmapDescriptor imageDescriptor; + @SafeParceled(3) + private LatLng location; + @SafeParceled(4) + private float width; + @SafeParceled(5) + private float height; + @SafeParceled(6) + private LatLngBounds bounds; + @SafeParceled(7) + private float bearing; + @SafeParceled(8) + private float zIndex; + @SafeParceled(9) + private boolean visible; + @SafeParceled(10) + private float transparency = 0; + @SafeParceled(11) + private float anchorU; + @SafeParceled(12) + private float anchorV; + + /** + * Creates a new set of ground overlay options. + */ + public GroundOverlayOptions() { + } + + /** + * Specifies the anchor to be at a particular point in the image. + *

+ * The anchor specifies the point in the image that aligns with the ground overlay's location. + *

+ * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0], where (0, 0) + * is the top-left corner of the image, and (1, 1) is the bottom-right corner. + * + * @param u u-coordinate of the anchor, as a ratio of the image width (in the range [0, 1]) + * @param v v-coordinate of the anchor, as a ratio of the image height (in the range [0, 1]) + * @return this {@link GroundOverlayOptions} object with a new anchor set. + */ + public GroundOverlayOptions anchor(float u, float v) { + this.anchorU = u; + this.anchorV = v; + return this; + } + + /** + * Specifies the bearing of the ground overlay in degrees clockwise from north. The rotation is + * performed about the anchor point. If not specified, the default is 0 (i.e., up on the image + * points north). + *

+ * If a ground overlay with position set using {@link #positionFromBounds(LatLngBounds)} is + * rotated, its size will preserved and it will no longer be guaranteed to fit inside the + * bounds. + * + * @param bearing the bearing in degrees clockwise from north. Values outside the range + * [0, 360) will be normalized. + * @return this {@link GroundOverlayOptions} object with a new bearing set. + */ + public GroundOverlayOptions bearing(float bearing) { + this.bearing = bearing; + return this; + } + + /** + * Horizontal distance, normalized to [0, 1], of the anchor from the left edge. + * + * @return the u value of the anchor. + */ + public float getAnchorU() { + return anchorU; + } + + /** + * Vertical distance, normalized to [0, 1], of the anchor from the top edge. + * + * @return the v value of the anchor. + */ + public float getAnchorV() { + return anchorV; + } + + /** + * Gets the bearing set for this options object. + * + * @return the bearing of the ground overlay. + */ + public float getBearing() { + return bearing; + } + + /** + * Gets the bounds set for this options object. + * + * @return the bounds of the ground overlay. This will be {@code null} if the position was set + * using {@link #position(LatLng, float)} or {@link #position(LatLng, float, float)} + */ + public LatLngBounds getBounds() { + return bounds; + } + + /** + * Gets the height set for this options object. + * + * @return the height of the ground overlay. + */ + public float getHeight() { + return height; + } + + /** + * Gets the image set for this options object. + * + * @return the image of the ground overlay. + */ + public BitmapDescriptor getImage() { + if (imageDescriptor == null && image != null) { + imageDescriptor = new BitmapDescriptor(ObjectWrapper.asInterface(image)); + } + return imageDescriptor; + } + + /** + * Gets the location set for this options object. + * + * @return the location to place the anchor of the ground overlay. This will be {@code null} + * if the position was set using {@link #positionFromBounds(LatLngBounds)}. + */ + public LatLng getLocation() { + return location; + } + + /** + * Gets the transparency set for this options object. + * + * @return the transparency of the ground overlay. + */ + public float getTransparency() { + return transparency; + } + + /** + * Gets the width set for this options object. + * + * @return the width of the ground overlay. + */ + public float getWidth() { + return width; + } + + /** + * Gets the zIndex set for this options object. + * + * @return the zIndex of the ground overlay. + */ + public float getZIndex() { + return zIndex; + } + + /** + * Specifies the image for this ground overlay. + *

+ * To load an image as a texture (which is used to draw the image on a map), it must be + * converted into an image with sides that are powers of two. This is so that a mipmap can be + * created in order to render the texture at various zoom levels - see + * Mipmap (Wikipedia) for details. Hence, to + * conserve memory by avoiding this conversion, it is advised that the dimensions of the image + * are powers of two. + * + * @param image the {@link BitmapDescriptor} to use for this ground overlay + * @return this {@link GroundOverlayOptions} object with a new image set. + */ + public GroundOverlayOptions image(BitmapDescriptor image) { + this.imageDescriptor = image; + this.image = imageDescriptor.getRemoteObject().asBinder(); + return this; + } + + /** + * Gets the visibility setting for this options object. + * + * @return {@code true} if the ground overlay is to be visible; {@code false} if it is not. + */ + public boolean isVisible() { + return visible; + } + + /** + * Specifies the position for this ground overlay using an anchor point (a {@link LatLng}), + * width and height (both in meters). When rendered, the image will be scaled to fit the + * dimensions specified (i.e., its proportions will not necessarily be preserved). + * + * @param location the location on the map {@code LatLng} to which the anchor point in the + * given image will remain fixed. The anchor will remain fixed to the position + * on the ground when transformations are applied (e.g., setDimensions, + * setBearing, etc.). + * @param width the width of the overlay (in meters) + * @param height the height of the overlay (in meters) + * @return this {@link GroundOverlayOptions} object with a new position set. + * @throws IllegalArgumentException if anchor is null + * @throws IllegalArgumentException if width or height are negative + * @throws IllegalStateException if the position was already set using + * {@link #positionFromBounds(LatLngBounds)} + */ + public GroundOverlayOptions position(LatLng location, float width, float height) + throws IllegalArgumentException, IllegalStateException { + position(location, width); + if (height < 0) + throw new IllegalArgumentException("height must not be negative"); + this.height = height; + return this; + } + + /** + * Specifies the position for this ground overlay using an anchor point (a {@link LatLng}) and + * the width (in meters). When rendered, the image will retain its proportions from the bitmap, + * i.e., the height will be calculated to preserve the original proportions of the image. + * + * @param location the location on the map {@link LatLng} to which the anchor point in the + * given image will remain fixed. The anchor will remain fixed to the position + * on the ground when transformations are applied (e.g., setDimensions, + * setBearing, etc.). + * @param width the width of the overlay (in meters). The height will be determined + * automatically based on the image proportions. + * @return this {@link GroundOverlayOptions} object with a new position set. + * @throws IllegalArgumentException if anchor is null + * @throws IllegalArgumentException if width is negative + * @throws IllegalStateException if the position was already set using + * {@link #positionFromBounds(LatLngBounds)} + */ + public GroundOverlayOptions position(LatLng location, float width) + throws IllegalArgumentException, IllegalStateException { + if (location == null) + throw new IllegalArgumentException("location must not be null"); + if (width < 0) + throw new IllegalArgumentException("width must not be negative"); + if (bounds != null) + throw new IllegalStateException("Position already set using positionFromBounds()"); + this.location = location; + this.width = width; + return this; + } + + /** + * Specifies the position for this ground overlay. When rendered, the image will be scaled to + * fit the bounds (i.e., its proportions will not necessarily be preserved). + * + * @param bounds a {@link LatLngBounds} in which to place the ground overlay + * @return this {@link GroundOverlayOptions} object with a new position set. + * @throws IllegalStateException if the position was already set using + * {@link #position(LatLng, float)} or + * {@link #position(LatLng, float, float)} + */ + public GroundOverlayOptions positionFromBounds(LatLngBounds bounds) + throws IllegalStateException { + if (location != null) + throw new IllegalStateException("Position already set using position()"); + this.bounds = bounds; + return this; + } + + /** + * Specifies the transparency of the ground overlay. The default transparency is {code 0} + * (opaque). + * + * @param transparency a float in the range {@code [0..1]} where {@code 0} means that the + * ground overlay is opaque and {code 1} means that the ground overlay is + * transparent + * @return this {@link GroundOverlayOptions} object with a new visibility setting. + * @throws IllegalArgumentException if the transparency is outside the range [0..1]. + */ + public GroundOverlayOptions transparency(float transparency) throws IllegalArgumentException { + if (transparency < 0 || transparency > 1) + throw new IllegalArgumentException("transparency must be in range [0..1]"); + this.transparency = transparency; + return this; + } + + /** + * Specifies the visibility for the ground overlay. The default visibility is {@code true}. + * + * @return this {@link GroundOverlayOptions} object with a new visibility setting. + */ + public GroundOverlayOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + /** + * Specifies the ground overlay's zIndex, i.e., the order in which it will be drawn. See the + * documentation at the top of this class for more information about zIndex. + * + * @return this {@link GroundOverlayOptions} object with a new zIndex set. + */ + public GroundOverlayOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + + public static Creator CREATOR = new AutoCreator(GroundOverlayOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/MapStyleOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/MapStyleOptions.java new file mode 100644 index 00000000..c2ebb01d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/MapStyleOptions.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2020 e Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.os.IBinder; +import com.google.android.gms.dynamic.ObjectWrapper; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +@PublicApi +public class MapStyleOptions extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private String json; + + public MapStyleOptions() { + } + + public MapStyleOptions (String json) { + this.json = json; + } + + public String getJson() { + return this.json; + } + + public static Creator CREATOR = new AutoCreator(MapStyleOptions.class); + +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java new file mode 100644 index 00000000..a950cd34 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java @@ -0,0 +1,341 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.os.IBinder; +import com.google.android.gms.dynamic.ObjectWrapper; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +@PublicApi +public class MarkerOptions extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private LatLng position; + @SafeParceled(3) + private String title; + @SafeParceled(4) + private String snippet; + /** + * This is a IBinder to the remote BitmapDescriptor created using BitmapDescriptorFactory + */ + @SafeParceled(5) + private IBinder iconBinder; + private BitmapDescriptor icon; + @SafeParceled(6) + private float anchorU = 0.5F; + @SafeParceled(7) + private float anchorV = 1F; + @SafeParceled(8) + private boolean draggable; + @SafeParceled(9) + private boolean visible; + @SafeParceled(10) + private boolean flat; + @SafeParceled(11) + private float rotation = 0F; + @SafeParceled(12) + private float infoWindowAnchorU = 0F; + @SafeParceled(13) + private float infoWindowAnchorV = 1F; + @SafeParceled(14) + private float alpha = 1F; + @SafeParceled(15) + private float zIndex = 0F; + + /** + * Creates a new set of marker options. + */ + public MarkerOptions() { + } + + /** + * Sets the alpha (opacity) of the marker. This is a value from 0 to 1, where 0 means the + * marker is completely transparent and 1 means the marker is completely opaque. + * + * @return the object for which the method was called, with the new alpha set. + */ + public MarkerOptions alpha(float alpha) { + this.alpha = alpha; + return this; + } + + /** + * Specifies the anchor to be at a particular point in the marker image. + *

+ * The anchor specifies the point in the icon image that is anchored to the marker's position + * on the Earth's surface. + *

+ * The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0], where (0, 0) + * is the top-left corner of the image, and (1, 1) is the bottom-right corner. The anchoring + * point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, + * obtained by scaling the then rounding. For example, in a 4 x 2 image, the anchor point + * (0.7, 0.6) resolves to the grid point at (3, 1). + * + * @param u u-coordinate of the anchor, as a ratio of the image width (in the range [0, 1]) + * @param v v-coordinate of the anchor, as a ratio of the image height (in the range [0, 1]) + * @return the object for which the method was called, with the new anchor set. + */ + public MarkerOptions anchor(float u, float v) { + this.anchorU = u; + this.anchorV = v; + return this; + } + + /** + * Sets the draggability for the marker. + * + * @return the object for which the method was called, with the new draggable state set. + */ + public MarkerOptions draggable(boolean draggable) { + this.draggable = draggable; + return this; + } + + /** + * Sets whether this marker should be flat against the map true or a billboard facing the + * camera false. If the marker is flat against the map, it will remain stuck to the map as the + * camera rotates and tilts but will still remain the same size as the camera zooms, unlike a + * GroundOverlay. If the marker is a billboard, it will always be drawn facing the camera + * and will rotate and tilt with the camera. The default value is false. + * + * @return the object for which the method was called, with the new flat state set. + */ + public MarkerOptions flat(boolean flat) { + this.flat = flat; + return this; + } + + /** + * Gets the alpha set for this MarkerOptions object. + * + * @return the alpha of the marker in the range [0, 1]. + */ + public float getAlpha() { + return alpha; + } + + /** + * Horizontal distance, normalized to [0, 1], of the anchor from the left edge. + * + * @return the u value of the anchor. + */ + public float getAnchorU() { + return anchorU; + } + + /** + * Vertical distance, normalized to [0, 1], of the anchor from the top edge. + * + * @return the v value of the anchor. + */ + public float getAnchorV() { + return anchorV; + } + + /** + * Gets the custom icon set for this MarkerOptions object. + * + * @return An {@link BitmapDescriptor} representing the custom icon, or {@code null} if no + * custom icon is set. + */ + public BitmapDescriptor getIcon() { + if (icon == null && iconBinder != null) { + icon = new BitmapDescriptor(ObjectWrapper.asInterface(iconBinder)); + } + return icon; + } + + /** + * Horizontal distance, normalized to [0, 1], of the info window anchor from the left edge. + * + * @return the u value of the info window anchor. + */ + public float getInfoWindowAnchorU() { + return infoWindowAnchorU; + } + + /** + * Vertical distance, normalized to [0, 1], of the info window anchor from the top edge. + * + * @return the v value of the info window anchor. + */ + public float getInfoWindowAnchorV() { + return infoWindowAnchorV; + } + + /** + * Returns the position set for this MarkerOptions object. + * + * @return A {@link LatLng} object specifying the marker's current position. + */ + public LatLng getPosition() { + return position; + } + + /** + * Gets the rotation set for this MarkerOptions object. + * + * @return the rotation of the marker in degrees clockwise from the default position. + */ + public float getRotation() { + return rotation; + } + + /** + * Gets the snippet set for this MarkerOptions object. + * + * @return A string containing the marker's snippet. + */ + public String getSnippet() { + return snippet; + } + + /** + * Gets the title set for this MarkerOptions object. + * + * @return A string containing the marker's title. + */ + public String getTitle() { + return title; + } + + /** + * Sets the icon for the marker. + * + * @param icon if null, the default marker is used. + * @return the object for which the method was called, with the new icon set. + */ + public MarkerOptions icon(BitmapDescriptor icon) { + this.icon = icon; + this.iconBinder = icon == null ? null : icon.getRemoteObject().asBinder(); + return this; + } + + /** + * Specifies the anchor point of the info window on the marker image. This is specified in the + * same coordinate system as the anchor. See {@link MarkerOptions#anchor(float, float)} for + * more details. The default is the top middle of the image. + * + * @param u u-coordinate of the info window anchor, as a ratio of the image width (in the range [0, 1]) + * @param v v-coordinate of the info window anchor, as a ratio of the image height (in the range [0, 1]) + * @return the object for which the method was called, with the new info window anchor set. + */ + public MarkerOptions infoWindowAnchor(float u, float v) { + this.infoWindowAnchorU = u; + this.infoWindowAnchorV = v; + return this; + } + + /** + * Gets the draggability setting for this MarkerOptions object. + * + * @return {@code true} if the marker is draggable; otherwise, returns {@code false}. + */ + public boolean isDraggable() { + return draggable; + } + + /** + * Gets the flat setting for this MarkerOptions object. + * + * @return {@code true} if the marker is flat against the map; {@code false} if the marker + * should face the camera. + */ + public boolean isFlat() { + return flat; + } + + /** + * Gets the visibility setting for this MarkerOptions object. + * + * @return {@code true} if the marker is visible; otherwise, returns {@code false}. + */ + public boolean isVisible() { + return visible; + } + + /** + * Sets the location for the marker. + * + * @return the object for which the method was called, with the new position set. + */ + public MarkerOptions position(LatLng position) { + this.position = position; + return this; + } + + /** + * Sets the rotation of the marker in degrees clockwise about the marker's anchor point. The + * axis of rotation is perpendicular to the marker. A rotation of 0 corresponds to the default + * position of the marker. When the marker is flat on the map, the default position is North + * aligned and the rotation is such that the marker always remains flat on the map. When the + * marker is a billboard, the default position is pointing up and the rotation is such that + * the marker is always facing the camera. The default value is 0. + * + * @return the object for which the method was called, with the new rotation set. + */ + public MarkerOptions rotation(float rotation) { + this.rotation = rotation; + return this; + } + + /** + * Sets the snippet for the marker. + * + * @return the object for which the method was called, with the new snippet set. + */ + public MarkerOptions snippet(String snippet) { + this.snippet = snippet; + return this; + } + + /** + * Sets the title for the marker. + * + * @return the object for which the method was called, with the new title set. + */ + public MarkerOptions title(String title) { + this.title = title; + return this; + } + + /** + * Sets the visibility for the marker. + * + * @return the object for which the method was called, with the new visibility state set. + */ + public MarkerOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + public MarkerOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + + public float getZIndex() { + return this.zIndex; + } + + public static Creator CREATOR = new AutoCreator(MarkerOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java new file mode 100644 index 00000000..94fca7e1 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolygonOptions.java @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.graphics.Color; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.ArrayList; +import java.util.List; + +/** + * Defines options for a polygon. + * TODO: Docs + */ +@PublicApi +public class PolygonOptions extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(value = 2, subClass = LatLng.class) + private List points = new ArrayList(); + @SafeParceled(value = 3, subClass = LatLng.class, useClassLoader = true) + private List> holes = new ArrayList>(); + @SafeParceled(4) + private float strokeWidth = 10; + @SafeParceled(5) + private int strokeColor = Color.BLACK; + @SafeParceled(6) + private int fillColor = Color.TRANSPARENT; + @SafeParceled(7) + private float zIndex = 0; + @SafeParceled(8) + private boolean visible = true; + @SafeParceled(9) + private boolean geodesic = false; + + /** + * Creates polygon options. + */ + public PolygonOptions() { + } + + public PolygonOptions add(LatLng point) { + points.add(point); + return this; + } + + public PolygonOptions add(LatLng... points) { + for (LatLng point : points) { + this.points.add(point); + } + return this; + } + + public PolygonOptions add(Iterable points) { + for (LatLng point : points) { + this.points.add(point); + } + return this; + } + + public PolygonOptions addHole(Iterable points) { + ArrayList hole = new ArrayList(); + for (LatLng point : points) { + hole.add(point); + } + holes.add(hole); + return this; + } + + public PolygonOptions fillColor(int color) { + this.fillColor = color; + return this; + } + + public PolygonOptions geodesic(boolean geodesic) { + this.geodesic = geodesic; + return this; + } + + public int getFillColor() { + return fillColor; + } + + public List> getHoles() { + return holes; + } + + public List getPoints() { + return points; + } + + public int getStrokeColor() { + return strokeColor; + } + + public float getStrokeWidth() { + return strokeWidth; + } + + public float getZIndex() { + return zIndex; + } + + public boolean isGeodesic() { + return geodesic; + } + + public boolean isVisible() { + return visible; + } + + public PolygonOptions strokeColor(int color) { + this.strokeColor = color; + return this; + } + + public PolygonOptions strokeWidth(float width) { + this.strokeWidth = width; + return this; + } + + public PolygonOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + public PolygonOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + + public static Creator CREATOR = new AutoCreator(PolygonOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java new file mode 100644 index 00000000..d9a9dc5b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/PolylineOptions.java @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.graphics.Color; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.ArrayList; +import java.util.List; + +/** + * Defines options for a polyline. + * TODO + */ +@PublicApi +public class PolylineOptions extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(value = 2, subClass = LatLng.class) + private List points = new ArrayList(); + @SafeParceled(3) + private float width = 10; + @SafeParceled(4) + private int color = Color.BLACK; + @SafeParceled(5) + private float zIndex = 0; + @SafeParceled(6) + private boolean visible = true; + @SafeParceled(7) + private boolean geodesic = false; + + public PolylineOptions() { + } + + public PolylineOptions add(LatLng point) { + points.add(point); + return this; + } + + public PolylineOptions add(LatLng... points) { + for (LatLng point : points) { + this.points.add(point); + } + return this; + } + + public PolylineOptions addAll(Iterable points) { + for (LatLng point : points) { + this.points.add(point); + } + return this; + } + + public PolylineOptions color(int color) { + this.color = color; + return this; + } + + public PolylineOptions geodesic(boolean geodesic) { + this.geodesic = geodesic; + return this; + } + + public int getColor() { + return color; + } + + public List getPoints() { + return points; + } + + public float getWidth() { + return width; + } + + public float getZIndex() { + return zIndex; + } + + public boolean isGeodesic() { + return geodesic; + } + + public boolean isVisible() { + return visible; + } + + public PolylineOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + public PolylineOptions width(float width) { + this.width = width; + return this; + } + + public PolylineOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + + public static Creator CREATOR = new AutoCreator(PolylineOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java new file mode 100644 index 00000000..2737de9d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaCamera.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import org.microg.gms.common.PublicApi; + +@PublicApi +public class StreetViewPanoramaCamera { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java new file mode 100644 index 00000000..2dfcbd03 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLink.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import org.microg.gms.common.PublicApi; + +@PublicApi +public class StreetViewPanoramaLink { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java new file mode 100644 index 00000000..b1254689 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaLocation.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import org.microg.gms.common.PublicApi; + +@PublicApi +public class StreetViewPanoramaLocation { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java new file mode 100644 index 00000000..fa7f657f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/StreetViewPanoramaOrientation.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import org.microg.gms.common.PublicApi; + +@PublicApi +public class StreetViewPanoramaOrientation { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java new file mode 100644 index 00000000..3f0deea5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/Tile.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Contains information about a Tile that is returned by a {@link TileProvider}. + * TODO SafeParceled + */ +@PublicApi +public class Tile extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + /** + * The width of the image encoded by {@link #data} in pixels. + */ + @SafeParceled(2) + public final int width; + /** + * The height of the image encoded by {@link #data} in pixels. + */ + @SafeParceled(3) + public final int height; + /** + * A byte array containing the image data. The image will be created from this data by calling + * {@link android.graphics.BitmapFactory#decodeByteArray(byte[], int, int)}. + */ + @SafeParceled(4) + public final byte[] data; + + private Tile() { + width = height = 0; + data = null; + } + + /** + * Constructs a {@link Tile}. + * + * @param width the width of the image in pixels + * @param height the height of the image in pixels + * @param data A byte array containing the image data. The image will be created from this + * data by calling + * {@link android.graphics.BitmapFactory#decodeByteArray(byte[], int, int)}. + */ + public Tile(int width, int height, byte[] data) { + this.width = width; + this.height = height; + this.data = data; + } + + public static Creator CREATOR = new AutoCreator(Tile.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java new file mode 100644 index 00000000..1fdffe36 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileOverlayOptions.java @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.os.IBinder; +import android.os.RemoteException; + +import com.google.android.gms.maps.model.internal.ITileProviderDelegate; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Defines options for a TileOverlay. + */ +@PublicApi +public class TileOverlayOptions extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + /** + * This is a IBinder to the {@link #tileProvider}, built using {@link ITileProviderDelegate}. + */ + @SafeParceled(2) + private IBinder tileProviderBinder; + private TileProvider tileProvider; + @SafeParceled(3) + private boolean visible = true; + @SafeParceled(4) + private float zIndex; + @SafeParceled(5) + private boolean fadeIn = true; + + /** + * Creates a new set of tile overlay options. + */ + public TileOverlayOptions() { + } + + /** + * Specifies whether the tiles should fade in. The default is {@code true}. + * + * @return this {@link TileOverlayOptions} object with a new fadeIn setting. + */ + public TileOverlayOptions fadeIn(boolean fadeIn) { + this.fadeIn = fadeIn; + return this; + } + + /** + * Gets whether the tiles should fade in. + * + * @return {@code true} if the tiles are to fade in; {@code false} if it is not. + */ + public boolean getFadeIn() { + return fadeIn; + } + + /** + * Gets the tile provider set for this {@link TileOverlayOptions} object. + * + * @return the {@link TileProvider} of the tile overlay. + */ + public TileProvider getTileProvider() { + return tileProvider; + } + + /** + * Gets the zIndex set for this {@link TileOverlayOptions} object. + * + * @return the zIndex of the tile overlay. + */ + public float getZIndex() { + return zIndex; + } + + /** + * Gets the visibility setting for this {@link TileOverlayOptions} object. + * + * @return {@code true} if the tile overlay is to be visible; {@code false} if it is not. + */ + public boolean isVisible() { + return visible; + } + + /** + * Specifies the tile provider to use for this tile overlay. + * + * @param tileProvider the {@link TileProvider} to use for this tile overlay. + * @return the object for which the method was called, with the new tile provider set. + */ + public TileOverlayOptions tileProvider(final TileProvider tileProvider) { + this.tileProvider = tileProvider; + this.tileProviderBinder = new ITileProviderDelegate.Stub() { + @Override + public Tile getTile(int x, int y, int zoom) throws RemoteException { + return tileProvider.getTile(x, y, zoom); + } + }; + return this; + } + + /** + * Specifies the visibility for the tile overlay. The default visibility is {@code true}. + * + * @return this {@link TileOverlayOptions} object with a new visibility setting. + */ + public TileOverlayOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + /** + * Specifies the tile overlay's zIndex, i.e., the order in which it will be drawn where + * overlays with larger values are drawn above those with lower values. See the documentation + * at the top of this class for more information about zIndex. + * + * @return this {@link TileOverlayOptions} object with a new zIndex set. + */ + public TileOverlayOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + + public static Creator CREATOR = new AutoCreator(TileOverlayOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/TileProvider.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileProvider.java new file mode 100644 index 00000000..9a1e930d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/TileProvider.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +/** + * An interface for a class that provides the tile images for a TileOverlay. For information about + * the tile coordinate system, see TileOverlay. + *

+ * Calls to methods in this interface might be made from multiple threads so implementations of + * this interface must be threadsafe. + */ +public interface TileProvider { + public static final Tile NO_TILE = new Tile(-1, -1, null); + + /** + * Returns the tile to be used for this tile coordinate. + * + * @param x The x coordinate of the tile. This will be in the range [0, 2^(zoom - 1)] inclusive. + * @param y The y coordinate of the tile. This will be in the range [0, 2^(zoom - 1)] inclusive. + * @param zoom The zoom level of the tile. + * @return the {@link Tile} to be used for this tile coordinate. If you do not wish to provide + * a tile for this tile coordinate, return {@link #NO_TILE}. If the tile could not be found at + * this point in time, return null and further requests might be made with an exponential + * backoff. + */ + public Tile getTile(int x, int y, int zoom); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java new file mode 100644 index 00000000..93c4d813 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/VisibleRegion.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +@PublicApi +public class VisibleRegion extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private LatLng nearLeft; + @SafeParceled(3) + private LatLng nearRight; + @SafeParceled(4) + private LatLng farLeft; + @SafeParceled(5) + private LatLng farRight; + @SafeParceled(6) + private LatLngBounds bounds; + + private VisibleRegion() { + } + + public VisibleRegion(int versionCode, LatLng nearLeft, LatLng nearRight, LatLng farLeft, + LatLng farRight, LatLngBounds bounds) { + this.versionCode = versionCode; + this.nearLeft = nearLeft; + this.nearRight = nearRight; + this.farLeft = farLeft; + this.farRight = farRight; + this.bounds = bounds; + } + + public VisibleRegion(LatLng nearLeft, LatLng nearRight, LatLng farLeft, LatLng farRight, + LatLngBounds bounds) { + this(1, nearLeft, nearRight, farLeft, farRight, bounds); + } + + /** + * This is assuming that the visible region matches the bounds, which means that it's a north + * orientated top view + */ + public VisibleRegion(LatLngBounds bounds) { + this(bounds.southwest, new LatLng(bounds.southwest.latitude, bounds.northeast.longitude), + new LatLng(bounds.northeast.latitude, bounds.southwest.longitude), bounds.northeast, + bounds); + } + + public static Creator CREATOR = new AutoCreator(VisibleRegion.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/package-info.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/package-info.java new file mode 100644 index 00000000..8c40c393 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Contains the Google Maps Android API model classes. + */ +package com.google.android.gms.maps.model; diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/api/internal/InitializationParams.java b/play-services-api/src/main/java/com/google/android/gms/measurement/api/internal/InitializationParams.java new file mode 100644 index 00000000..43d7ff75 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/measurement/api/internal/InitializationParams.java @@ -0,0 +1,45 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.measurement.api.internal; + +import android.os.Bundle; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class InitializationParams extends AutoSafeParcelable { + @Field(1) + public long field1; + @Field(2) + public long field2; + @Field(3) + public boolean field3; + @Field(4) + public String field4; + @Field(5) + public String field5; + @Field(6) + public String field6; + @Field(7) + public Bundle field7; + @Field(8) + public String field8; + + @Override + public String toString() { + return "InitializationParams{" + + "field1=" + field1 + + ", field2=" + field2 + + ", field3=" + field3 + + ", field4='" + field4 + '\'' + + ", field5='" + field5 + '\'' + + ", field6='" + field6 + '\'' + + ", field7=" + field7 + + ", field8='" + field8 + '\'' + + '}'; + } + + public static final Creator CREATOR = new AutoCreator<>(InitializationParams.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/AppMetadata.java b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/AppMetadata.java index be233570..9c7c3671 100644 --- a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/AppMetadata.java +++ b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/AppMetadata.java @@ -57,5 +57,9 @@ public class AppMetadata extends AutoSafeParcelable { @Field(25) private String field25; + public String toString() { + return "AppMetadata[" + packageName + "]"; + } + public static final Creator CREATOR = new AutoCreator<>(AppMetadata.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParams.java b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParams.java new file mode 100644 index 00000000..54de1394 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParams.java @@ -0,0 +1,17 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.measurement.internal; + +import android.os.Bundle; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class EventParams extends AutoSafeParcelable { + @Field(2) + public Bundle data; + + public static final Creator CREATOR = new AutoCreator<>(EventParams.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParcel.java b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParcel.java index 3ff7c796..7b5b6179 100644 --- a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParcel.java +++ b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/EventParcel.java @@ -8,5 +8,14 @@ package com.google.android.gms.measurement.internal; import org.microg.safeparcel.AutoSafeParcelable; public class EventParcel extends AutoSafeParcelable { + @Field(2) + public String name; + @Field(3) + public EventParams params; + @Field(4) + public String origin; + @Field(5) + public long timestamp; + public static final Creator CREATOR = new AutoCreator<>(EventParcel.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/UserAttributeParcel.java b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/UserAttributeParcel.java index 6070b923..d9c74663 100644 --- a/play-services-api/src/main/java/com/google/android/gms/measurement/internal/UserAttributeParcel.java +++ b/play-services-api/src/main/java/com/google/android/gms/measurement/internal/UserAttributeParcel.java @@ -8,5 +8,20 @@ package com.google.android.gms.measurement.internal; import org.microg.safeparcel.AutoSafeParcelable; public class UserAttributeParcel extends AutoSafeParcelable { + @Field(1) + public int field1; + @Field(2) + public String name; + @Field(3) + public long timestamp; + @Field(4) + public Long field4; + @Field(6) + public String field6; + @Field(7) + public String field7; + @Field(8) + public Double field8; + public static final Creator CREATOR = new AutoCreator<>(UserAttributeParcel.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java b/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java index 24b3872d..61180fd4 100644 --- a/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java +++ b/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java @@ -32,5 +32,5 @@ public class ParcelableLoadImageOptions extends AutoSafeParcelable { @SafeParceled(3) public boolean useLargePictureForCp2Images; - public static final Creator CREATOR = new AutoCreator<>(ParcelableLoadImageOptions.class); + public static final Creator CREATOR = new AutoCreator(ParcelableLoadImageOptions.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java index 103c572c..814a6574 100644 --- a/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java +++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.java @@ -36,5 +36,5 @@ public class AccountMetadata extends AutoSafeParcelable { @SafeParceled(5) public boolean hasFeature4 = true; - public static Creator CREATOR = new AutoCreator<>(AccountMetadata.class); + public static Creator CREATOR = new AutoCreator(AccountMetadata.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java b/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java index 3dbaba62..b03af386 100644 --- a/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java +++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java @@ -30,5 +30,5 @@ public class AvatarReference extends AutoSafeParcelable { @SafeParceled(2) public String location; - public static final Creator CREATOR = new AutoCreator<>(AvatarReference.class); + public static final Creator CREATOR = new AutoCreator(AvatarReference.class); } diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configuration.java b/play-services-api/src/main/java/com/google/android/gms/phenotype/Configuration.java similarity index 90% rename from play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configuration.java rename to play-services-api/src/main/java/com/google/android/gms/phenotype/Configuration.java index b51ab177..20bb9d4c 100644 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configuration.java +++ b/play-services-api/src/main/java/com/google/android/gms/phenotype/Configuration.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package com.mgoogle.android.gms.phenotype; +package com.google.android.gms.phenotype; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configurations.java b/play-services-api/src/main/java/com/google/android/gms/phenotype/Configurations.java similarity index 92% rename from play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configurations.java rename to play-services-api/src/main/java/com/google/android/gms/phenotype/Configurations.java index 8b032262..910b7008 100644 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Configurations.java +++ b/play-services-api/src/main/java/com/google/android/gms/phenotype/Configurations.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package com.mgoogle.android.gms.phenotype; +package com.google.android.gms.phenotype; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/ExperimentToken.java b/play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentToken.java similarity index 99% rename from play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/ExperimentToken.java rename to play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentToken.java index 16bb0a60..0d618f2f 100644 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/ExperimentToken.java +++ b/play-services-api/src/main/java/com/google/android/gms/phenotype/ExperimentToken.java @@ -9,4 +9,4 @@ import org.microg.safeparcel.AutoSafeParcelable; public class ExperimentToken extends AutoSafeParcelable { public static final Creator CREATOR = new AutoCreator<>(ExperimentToken.class); -} \ No newline at end of file +} diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Flag.java b/play-services-api/src/main/java/com/google/android/gms/phenotype/Flag.java similarity index 86% rename from play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Flag.java rename to play-services-api/src/main/java/com/google/android/gms/phenotype/Flag.java index aa6bba20..0c1fdc8a 100644 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/Flag.java +++ b/play-services-api/src/main/java/com/google/android/gms/phenotype/Flag.java @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -package com.mgoogle.android.gms.phenotype; +package com.google.android.gms.phenotype; import org.microg.safeparcel.AutoSafeParcelable; diff --git a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/GenericDimension.java b/play-services-api/src/main/java/com/google/android/gms/phenotype/GenericDimension.java similarity index 99% rename from play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/GenericDimension.java rename to play-services-api/src/main/java/com/google/android/gms/phenotype/GenericDimension.java index 3c95f744..f10f83c0 100644 --- a/play-services-api/src/main/java/com/mgoogle/android/gms/phenotype/GenericDimension.java +++ b/play-services-api/src/main/java/com/google/android/gms/phenotype/GenericDimension.java @@ -14,4 +14,4 @@ public class GenericDimension extends AutoSafeParcelable { public int b; public static final Creator CREATOR = new AutoCreator<>(GenericDimension.class); -} \ No newline at end of file +} diff --git a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java index 4fc0e62a..03ccbbc5 100644 --- a/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java @@ -21,6 +21,7 @@ import org.microg.safeparcel.SafeParceled; import java.util.Date; +@Deprecated public class LogEvent extends AutoSafeParcelable { @SafeParceled(1) @@ -50,5 +51,5 @@ public class LogEvent extends AutoSafeParcelable { '}'; } - public static Creator CREATOR = new AutoCreator<>(LogEvent.class); + public static Creator CREATOR = new AutoCreator(LogEvent.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java new file mode 100644 index 00000000..72d908e3 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusCommonExtras.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.plus.internal; + +public class PlusCommonExtras { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusSession.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusSession.java new file mode 100644 index 00000000..b5b3f8a0 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/PlusSession.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.plus.internal; + +public class PlusSession { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java new file mode 100644 index 00000000..aee4d0b6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsRequest.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.plus.internal.model.smart_profile; + +public class CardsRequest { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java new file mode 100644 index 00000000..bf6c9670 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/CardsResponse.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.plus.internal.model.smart_profile; + +public class CardsResponse { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java new file mode 100644 index 00000000..c45512d4 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesRequest.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.plus.internal.model.smart_profile; + +public class PeopleForProfilesRequest { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java new file mode 100644 index 00000000..4c108aa5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/plus/internal/model/smart_profile/PeopleForProfilesResponse.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.plus.internal.model.smart_profile; + +public class PeopleForProfilesResponse { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Comment.java b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Comment.java new file mode 100644 index 00000000..37a215c0 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Comment.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.plus.model.posts; + +public class Comment { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Post.java b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Post.java new file mode 100644 index 00000000..3b9c3466 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Post.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.plus.model.posts; + +public class Post { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Settings.java b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Settings.java new file mode 100644 index 00000000..a7045a3c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/plus/model/posts/Settings.java @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.plus.model.posts; + +public class Settings { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/AccountState.java b/play-services-api/src/main/java/com/google/android/gms/reminders/AccountState.java new file mode 100644 index 00000000..4ad0101f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/AccountState.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AccountState extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(AccountState.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/CreateReminderOptionsInternal.java b/play-services-api/src/main/java/com/google/android/gms/reminders/CreateReminderOptionsInternal.java new file mode 100644 index 00000000..cc0d81c6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/CreateReminderOptionsInternal.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CreateReminderOptionsInternal extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CreateReminderOptionsInternal.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/LoadRemindersOptions.java b/play-services-api/src/main/java/com/google/android/gms/reminders/LoadRemindersOptions.java new file mode 100644 index 00000000..fd69c55a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/LoadRemindersOptions.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LoadRemindersOptions extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(LoadRemindersOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/ReindexDueDatesOptions.java b/play-services-api/src/main/java/com/google/android/gms/reminders/ReindexDueDatesOptions.java new file mode 100644 index 00000000..e6a4eba3 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/ReindexDueDatesOptions.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ReindexDueDatesOptions extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ReindexDueDatesOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/UpdateRecurrenceOptions.java b/play-services-api/src/main/java/com/google/android/gms/reminders/UpdateRecurrenceOptions.java new file mode 100644 index 00000000..ae708746 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/UpdateRecurrenceOptions.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.reminders; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UpdateRecurrenceOptions extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(UpdateRecurrenceOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.java b/play-services-api/src/main/java/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.java new file mode 100644 index 00000000..29ee864e --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/model/CustomizedSnoozePresetEntity.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.reminders.model; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CustomizedSnoozePresetEntity extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(CustomizedSnoozePresetEntity.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskEntity.java b/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskEntity.java new file mode 100644 index 00000000..4062335a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskEntity.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.reminders.model; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class TaskEntity extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(TaskEntity.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskIdEntity.java b/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskIdEntity.java new file mode 100644 index 00000000..1816b1f3 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/reminders/model/TaskIdEntity.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.reminders.model; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class TaskIdEntity extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(TaskIdEntity.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/usagereporting/UsageReportingOptInOptions.java b/play-services-api/src/main/java/com/google/android/gms/usagereporting/UsageReportingOptInOptions.java new file mode 100644 index 00000000..0e7ec10b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/usagereporting/UsageReportingOptInOptions.java @@ -0,0 +1,15 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.usagereporting; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UsageReportingOptInOptions extends AutoSafeParcelable { + @Field(2) + public int optInUsageReporting; + + public static final Creator CREATOR = new AutoCreator<>(UsageReportingOptInOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayRequest.java b/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayRequest.java new file mode 100644 index 00000000..2f9fde8b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayRequest.java @@ -0,0 +1,161 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 AND 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. + */ + +package com.google.android.gms.wallet; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * A Parcelable request that can optionally be passed to {@link PaymentsClient#isReadyToPay(IsReadyToPayRequest)} to specify additional filtering criteria for determining if a user is considered ready to pay. + */ +@PublicApi +public class IsReadyToPayRequest extends AutoSafeParcelable { + @Field(value = 2, useDirectList = true) + private ArrayList allowedCardNetworks; + @Field(4) + private String unknown4; + @Field(5) + private String unknown5; + @Field(value = 6, useDirectList = true) + private ArrayList allowedPaymentMethods; + @Field(7) + private boolean existingPaymentMethodRequired; + @Field(8) + private String json; + + private IsReadyToPayRequest() { + } + + private IsReadyToPayRequest(String json) { + this.json = json; + } + + /** + * Constructs {@link IsReadyToPayRequest} from a JSON object serialized as a string. + *

+ * To convert back to a JSON object serialized as string use {@link #toJson()}. + *

+ * Note that you shouldn't rely on the values returned by getters in {@link IsReadyToPayRequest} as they will not be populated with the data set in the given JSON. + *

+ * For the expected format of this JSON, please see IsReadyToPayRequest object reference documentation. + */ + public static IsReadyToPayRequest fromJson(String isReadyToPayRequestJson) { + return new IsReadyToPayRequest(isReadyToPayRequestJson); + } + + /** + * @return a builder for constructing the {@link IsReadyToPayRequest} object. + * @deprecated Use the JSON request format instead, see {@link #fromJson(String)}. + */ + public static IsReadyToPayRequest.Builder newBuilder() { + return new IsReadyToPayRequest().new Builder(); + } + + /** + * Returns {@link IsReadyToPayRequest} in JSON format. + *

+ * Note that this will be {@code null} if this request was not constructed using {@link #fromJson(String)}. + *

+ * For the expected format of this JSON, please see IsReadyToPayRequest object reference documentation. + */ + public String toJson() { + return json; + } + + /** + * @return the {@link WalletConstants.CardNetwork} that will be used to filter the instruments deemed acceptable by {@link PaymentsClient#isReadyToPay(IsReadyToPayRequest)}. If not explicitly set, the default supported networks will be {@link WalletConstants#CARD_NETWORK_AMEX}, {@link WalletConstants#CARD_NETWORK_DISCOVER}, {@link WalletConstants#CARD_NETWORK_MASTERCARD}, and {@link WalletConstants#CARD_NETWORK_VISA}. + * @deprecated Use the JSON request format instead, see {@link #fromJson(String)}. + */ + public ArrayList getAllowedCardNetworks() { + return allowedCardNetworks; + } + + /** + * @return the supported payment credential types defined in {@link WalletConstants.PaymentMethod}, or {@code null} if no restrictions were specified. + * @deprecated Use the JSON request format instead, see {@link #fromJson(String)}. + */ + public ArrayList getAllowedPaymentMethods() { + return allowedPaymentMethods; + } + + /** + * @return whether or not IsReadyToPay will be determined by the user having an existing payment method that matches the other criteria specified in the IsReadyToPayRequest. + * @deprecated Use the JSON request format instead, see {@link #fromJson(String)}. + */ + public boolean isExistingPaymentMethodRequired() { + return existingPaymentMethodRequired; + } + + /** + * Builder for creating an {@link IsReadyToPayRequest}. + * + * @deprecated Use the JSON request format instead, see {@link #fromJson(String)}. + */ + public class Builder { + /** + * Adds a card network for cards allowed in the purchase. See {@link WalletConstants.CardNetwork} for available options. If not explicitly set via this or {@link #addAllowedCardNetworks(Collection)}, the default supported networks will be {@link WalletConstants#CARD_NETWORK_AMEX}, {@link WalletConstants#CARD_NETWORK_DISCOVER}, {@link WalletConstants#CARD_NETWORK_MASTERCARD}, and {@link WalletConstants#CARD_NETWORK_VISA}. + */ + public Builder addAllowedCardNetwork(int allowedCardNetwork) { + if (allowedCardNetworks == null) allowedCardNetworks = new ArrayList<>(); + allowedCardNetworks.add(allowedCardNetwork); + return this; + } + + /** + * Adds a collection of card networks for cards allowed in the purchase. See {@link WalletConstants.CardNetwork} for available options. If not explicitly set via this or {@link #addAllowedCardNetwork(int)}, the default supported networks will be {@link WalletConstants#CARD_NETWORK_AMEX}, {@link WalletConstants#CARD_NETWORK_DISCOVER}, {@link WalletConstants#CARD_NETWORK_MASTERCARD}, and {@link WalletConstants#CARD_NETWORK_VISA}. + */ + public Builder addAllowedCardNetworks(Collection allowedCardNetworks) { + if (IsReadyToPayRequest.this.allowedCardNetworks == null) + IsReadyToPayRequest.this.allowedCardNetworks = new ArrayList<>(); + IsReadyToPayRequest.this.allowedCardNetworks.addAll(allowedCardNetworks); + return this; + } + + /** + * Adds an allowed payment method. See {@link WalletConstants.PaymentMethod} for available options. If not explicitly set via this or {@link #addAllowedPaymentMethods(Collection)}, then the default allowed payment method will be {@link WalletConstants#PAYMENT_METHOD_TOKENIZED_CARD}. + */ + public Builder addAllowedPaymentMethod(int allowedPaymentMethod) { + if (allowedPaymentMethods == null) allowedPaymentMethods = new ArrayList<>(); + allowedPaymentMethods.add(allowedPaymentMethod); + return this; + } + + /** + * Adds a collection of allowed payment methods. See {@link WalletConstants.PaymentMethod} for available options. If not explicitly set via this or {@link #addAllowedPaymentMethod(int)}, then the default allowed payment method will be {@link WalletConstants#PAYMENT_METHOD_TOKENIZED_CARD}. + */ + public Builder addAllowedPaymentMethods(Collection allowedPaymentMethods) { + if (IsReadyToPayRequest.this.allowedPaymentMethods == null) + IsReadyToPayRequest.this.allowedPaymentMethods = new ArrayList<>(); + IsReadyToPayRequest.this.allowedPaymentMethods.addAll(allowedPaymentMethods); + return this; + } + + /** + * @return The actual {@link IsReadyToPayRequest} created using the data passed to the Builder object. + */ + public IsReadyToPayRequest build() { + return IsReadyToPayRequest.this; + } + + /** + * If set to true, then IsReadyToPay will only return true if the user has an existing payment method that matches the other criteria specified in the IsReadyToPayRequest. + *

+ * If you set this to true, make sure to call {@link PaymentsClient#isReadyToPay(IsReadyToPayRequest)} as early as possible in your flow as the call may take longer to resolve due to the extra check for an existing payment method. + */ + public Builder setExistingPaymentMethodRequired(boolean existingPaymentMethodRequired) { + IsReadyToPayRequest.this.existingPaymentMethodRequired = existingPaymentMethodRequired; + return this; + } + } + + public static final Creator CREATOR = new AutoCreator<>(IsReadyToPayRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayResponse.java b/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayResponse.java new file mode 100644 index 00000000..96b02404 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wallet/IsReadyToPayResponse.java @@ -0,0 +1,25 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.wallet; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class IsReadyToPayResponse extends AutoSafeParcelable { + @Field(1) + public boolean result; + @Field(2) + public String json; + + private IsReadyToPayResponse() { + } + + public IsReadyToPayResponse(boolean result, String json) { + this.result = result; + this.json = json; + } + + public static final Creator CREATOR = new AutoCreator<>(IsReadyToPayResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/wallet/WalletConstants.java b/play-services-api/src/main/java/com/google/android/gms/wallet/WalletConstants.java new file mode 100644 index 00000000..0e3e2056 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/wallet/WalletConstants.java @@ -0,0 +1,117 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 AND 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. + */ + +package com.google.android.gms.wallet; + +import org.microg.gms.common.PublicApi; + +/** + * Collection of constant values used by the ClientLibrary. + */ +@PublicApi +public class WalletConstants { + /** + * Credit card networks. Different APIs may support only a subset of these. + *

+ * Available options: + *

    + *
  • {@link #CARD_NETWORK_AMEX}
  • + *
  • {@link #CARD_NETWORK_DISCOVER}
  • + *
  • {@link #CARD_NETWORK_JCB}
  • + *
  • {@link #CARD_NETWORK_MASTERCARD}
  • + *
  • {@link #CARD_NETWORK_VISA}
  • + *
  • {@link #CARD_NETWORK_INTERAC}
  • + *
  • {@link #CARD_NETWORK_OTHER}
  • + *
+ * When used with Google Pay, the following networks use EMV cryptograms instead of 3DS cryptograms as part of the payment credentials: + *
    + *
  • {@link #CARD_NETWORK_INTERAC}
  • + *
+ */ + public @interface CardNetwork { + /** + * @deprecated Use {@link #CARD_NETWORK_AMEX} instead. + */ + int AMEX = 1; + /** + * @deprecated Use {@link #CARD_NETWORK_DISCOVER} instead. + */ + int DISCOVER = 2; + /** + * @deprecated Use {@link #CARD_NETWORK_JCB} instead. + */ + int JCB = 3; + /** + * @deprecated Use {@link #CARD_NETWORK_MASTERCARD} instead. + */ + int MASTERCARD = 4; + /** + * @deprecated Use {@link #CARD_NETWORK_VISA} instead. + */ + int VISA = 5; + /** + * @deprecated Use {@link #CARD_NETWORK_INTERAC} instead. + */ + int INTERAC = 6; + /** + * @deprecated Use {@link #CARD_NETWORK_OTHER} instead. + */ + int OTHER = 1000; + } + + /** + * The payment methods you support. + *

+ * Available options: + *

    + *
  • {@link #PAYMENT_METHOD_UNKNOWN}
  • + *
  • {@link #PAYMENT_METHOD_CARD}
  • + *
  • {@link #PAYMENT_METHOD_TOKENIZED_CARD}
  • + *
+ * Note {@link WalletConstants.PaymentMethod} is different from {@link PaymentMethodTokenizationType}, which identifies how you want to receive the returned payment credential. + */ + public @interface PaymentMethod { + } + + /** + * Payment method tokenization types. + *

+ * Available options: + *

    + *
  • {@link #PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY}
  • + *
  • {@link #PAYMENT_METHOD_TOKENIZATION_TYPE_NETWORK_TOKEN}
  • + *
  • {@link #PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT}
  • + *
+ * Integrator can configure {@link PaymentDataRequest} to tokenize the credit card selected by the buyer for a transaction using one of the tokenization types listed above. The token for the selected payment method can be retrieved by calling {@link PaymentData#getPaymentMethodToken()}. + */ + public @interface PaymentMethodTokenizationType { + } + + + public static final int CARD_CLASS_CREDIT = 1; + public static final int CARD_CLASS_DEBIT = 2; + public static final int CARD_CLASS_PREPAID = 3; + public static final int CARD_CLASS_UNKNOWN = 0; + + public static final int CARD_NETWORK_AMEX = 1; + public static final int CARD_NETWORK_DISCOVER = 2; + public static final int CARD_NETWORK_INTERAC = 6; + public static final int CARD_NETWORK_JCB = 3; + public static final int CARD_NETWORK_MASTERCARD = 4; + public static final int CARD_NETWORK_OTHER = 1000; + public static final int CARD_NETWORK_VISA = 5; + + public static final int PAYMENT_METHOD_CARD = 1; + public static final int PAYMENT_METHOD_TOKENIZED_CARD = 2; + public static final int PAYMENT_METHOD_UNKNOWN = 0; + + + public static final int PAYMENT_METHOD_TOKENIZATION_TYPE_DIRECT = 3; + public static final int PAYMENT_METHOD_TOKENIZATION_TYPE_NETWORK_TOKEN = 2; + public static final int PAYMENT_METHOD_TOKENIZATION_TYPE_PAYMENT_GATEWAY = 1; +} diff --git a/play-services-api/src/main/java/com/google/firebase/database/connection/idl/CompoundHashParcelable.java b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/CompoundHashParcelable.java new file mode 100644 index 00000000..4b72c85d --- /dev/null +++ b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/CompoundHashParcelable.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.firebase.database.connection.idl; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class CompoundHashParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(CompoundHashParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/firebase/database/connection/idl/ConnectionConfig.java b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/ConnectionConfig.java new file mode 100644 index 00000000..290467b2 --- /dev/null +++ b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/ConnectionConfig.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.firebase.database.connection.idl; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ConnectionConfig extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(ConnectionConfig.class); +} diff --git a/play-services-api/src/main/java/com/google/firebase/database/connection/idl/RangeParcelable.java b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/RangeParcelable.java new file mode 100644 index 00000000..cfd0fd7c --- /dev/null +++ b/play-services-api/src/main/java/com/google/firebase/database/connection/idl/RangeParcelable.java @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.firebase.database.connection.idl; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class RangeParcelable extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(RangeParcelable.class); +} diff --git a/play-services-api/src/main/java/org/microg/gms/maps/MapsConstants.java b/play-services-api/src/main/java/org/microg/gms/maps/MapsConstants.java new file mode 100644 index 00000000..301d0771 --- /dev/null +++ b/play-services-api/src/main/java/org/microg/gms/maps/MapsConstants.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.microg.gms.maps; + +public class MapsConstants { + /** + * No base map tiles. + */ + public static final int MAP_TYPE_NONE = 0; + /** + * Basic maps. + */ + public static final int MAP_TYPE_NORMAL = 1; + /** + * Satellite maps with no labels. + */ + public static final int MAP_TYPE_SATELLITE = 2; + /** + * Terrain maps. + */ + public static final int MAP_TYPE_TERRAIN = 3; + /** + * Satellite maps with a transparent layer of major streets. + */ + public static final int MAP_TYPE_HYBRID = 4; +} diff --git a/play-services-base-api/build.gradle b/play-services-base-api/build.gradle index 4f64f888..f4055b16 100644 --- a/play-services-base-api/build.gradle +++ b/play-services-base-api/build.gradle @@ -22,10 +22,11 @@ dependencies { android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" aidlPackageWhiteList "com/google/android/gms/common/data/DataHolder.aidl" aidlPackageWhiteList "com/google/android/gms/common/images/WebImage.aidl" + aidlPackageWhiteList "com/google/android/gms/common/api/internal/IStatusCallback.aidl" defaultConfig { minSdkVersion androidMinSdk diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle index 7c7f1b25..98181ef9 100644 --- a/play-services-base/build.gradle +++ b/play-services-base/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk @@ -32,12 +32,12 @@ android { } dependencies { - implementation 'com.google.android.gms:play-services-base:17.6.0' + implementation 'com.google.android.gms:play-services-base:18.0.1' api project(':play-services-basement') api project(':play-services-tasks') api project(':play-services-base-api') - implementation 'androidx.fragment:fragment:1.3.6' - implementation 'com.google.android.gms:play-services-base:17.6.0' + implementation 'androidx.fragment:fragment:1.4.0' + implementation 'com.google.android.gms:play-services-base:18.0.1' } \ No newline at end of file diff --git a/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java index 64ac6942..190bd992 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java +++ b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java @@ -110,7 +110,7 @@ public abstract class GmsClient implements ApiClient { @Override public synchronized boolean isConnected() { - return state == ConnectionState.CONNECTED || state == ConnectionState.PSEUDO_CONNECTED; + return (state == ConnectionState.CONNECTED && serviceInterface != null && serviceInterface.asBinder().isBinderAlive() ) || state == ConnectionState.PSEUDO_CONNECTED; } @Override diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiManager.java b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiManager.java index addad6a7..2d6cf257 100644 --- a/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiManager.java +++ b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiManager.java @@ -7,6 +7,7 @@ package org.microg.gms.common.api; import android.content.Context; import android.os.Bundle; +import android.os.DeadObjectException; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.Api; diff --git a/play-services-basement/build.gradle b/play-services-basement/build.gradle index ff0dabcc..674edc4c 100644 --- a/play-services-basement/build.gradle +++ b/play-services-basement/build.gradle @@ -20,13 +20,13 @@ apply plugin: 'kotlin-android' dependencies { api "org.microg:safe-parcel:1.7.0" - implementation "androidx.annotation:annotation:1.2.0" + implementation 'androidx.annotation:annotation:1.3.0' implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.32' } android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" aidlPackageWhiteList "com/google/android/gms/common/api/Status.aidl" aidlPackageWhiteList "com/google/android/gms/common/internal/ICancelToken.aidl" diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/Feature.java b/play-services-basement/src/main/java/com/google/android/gms/common/Feature.java new file mode 100644 index 00000000..0a5b0813 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/Feature.java @@ -0,0 +1,36 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.common; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class Feature extends AutoSafeParcelable { + @Field(1) + private String name; + @Field(2) + private int oldVersion; + @Field(3) + private long version = -1; + + private Feature() { + } + + public Feature(String name, long version) { + this.name = name; + this.version = version; + } + + public String getName() { + return name; + } + + public long getVersion() { + if (version == -1) return oldVersion; + return version; + } + + public static final Creator CREATOR = new AutoSafeParcelable.AutoCreator<>(Feature.class); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java index d7e6f9a5..25df584d 100644 --- a/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java @@ -32,11 +32,11 @@ import org.microg.safeparcel.SafeParceled; @PublicApi public final class Status extends AutoSafeParcelable implements Result { @PublicApi(exclude = true) - public static final Status INTERNAL_ERROR = new Status(CommonStatusCodes.INTERNAL_ERROR); + public static final Status INTERNAL_ERROR = new Status(CommonStatusCodes.INTERNAL_ERROR, "Internal error"); @PublicApi(exclude = true) - public static final Status CANCELED = new Status(CommonStatusCodes.CANCELED); + public static final Status CANCELED = new Status(CommonStatusCodes.CANCELED, "Cancelled"); @PublicApi(exclude = true) - public static final Status SUCCESS = new Status(CommonStatusCodes.SUCCESS); + public static final Status SUCCESS = new Status(CommonStatusCodes.SUCCESS, "Success"); @SafeParceled(1000) private int versionCode = 1; diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java b/play-services-basement/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java index d498328c..618b420f 100644 --- a/play-services-basement/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java +++ b/play-services-basement/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java @@ -20,6 +20,7 @@ import android.accounts.Account; import android.os.Bundle; import android.os.IBinder; +import com.google.android.gms.common.Feature; import com.google.android.gms.common.api.Scope; import org.microg.gms.common.Constants; @@ -29,36 +30,37 @@ import org.microg.safeparcel.SafeParceled; import java.util.Arrays; -import kotlin.Suppress; - -@SuppressWarnings("deprecation") public class GetServiceRequest extends AutoSafeParcelable { - @SafeParceled(1) - private int versionCode = 3; - - @SafeParceled(2) + @Field(1) + private int versionCode = 4; + @Field(2) public final int serviceId; - - @SafeParceled(3) + @Field(3) public int gmsVersion; - - @SafeParceled(4) + @Field(4) public String packageName; - - @SafeParceled(5) + @Field(5) public IBinder accountAccessor; - - @SafeParceled(6) + @Field(6) public Scope[] scopes; - - @SafeParceled(7) + @Field(7) public Bundle extras; - - @SafeParceled(8) + @Field(8) public Account account; - - @SafeParceled(9) - public long long1; + @Field(9) + private long field9; + @Field(10) + public Feature[] defaultFeatures; + @Field(11) + public Feature[] apiFeatures; + @Field(12) + private boolean field12; + @Field(13) + private int field13; + @Field(14) + private boolean field14; + @Field(15) + private String field15; private GetServiceRequest() { serviceId = -1; @@ -68,6 +70,7 @@ public class GetServiceRequest extends AutoSafeParcelable { public GetServiceRequest(int serviceId) { this.serviceId = serviceId; this.gmsVersion = Constants.GMS_VERSION_CODE; + this.field12 = true; } @Override @@ -82,5 +85,5 @@ public class GetServiceRequest extends AutoSafeParcelable { '}'; } - public static Creator CREATOR = new AutoCreator<>(GetServiceRequest.class); -} + public static Creator CREATOR = new AutoCreator(GetServiceRequest.class); +} \ No newline at end of file diff --git a/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java b/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java index 7eca86e3..d53dba37 100644 --- a/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java +++ b/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java @@ -19,36 +19,147 @@ package org.microg.gms.common; public enum GmsService { UNKNOWN(-2), ANY(-1), + GAMES(1, "com.google.android.gms.games.service.START"), + PLUS(2, "com.google.android.gms.plus.service.START", "com.google.android.gms.plus.service.internal.START"), + PANORAMA(3, "com.google.android.gms.panorama.service.START"), + WALLET(4, "com.google.android.gms.wallet.service.BIND"), PEOPLE(5, "com.google.android.gms.people.service.START"), + LOCATION(6), + APPSTATE(7, "com.google.android.gms.appstate.service.START"), + ADREQUEST(8, "com.google.android.gms.ads.service.START"), ACCOUNT(9, "com.google.android.gms.accounts.ACCOUNT_SERVICE"), CAST(10, "com.google.android.gms.cast.service.BIND_CAST_DEVICE_CONTROLLER_SERVICE"), + DRIVE(11, "com.google.android.gms.drive.ApiService.START"), ADDRESS(12, "com.google.android.gms.identity.service.BIND"), - AUTH(16, "com.google.android.gms.auth.service.START"), + CAR(13, "com.google.android.gms.car.service.START"), + WEARABLE(14, "com.google.android.gms.wearable.BIND"), + AUTH_PROXY(16, "com.google.android.gms.auth.service.START"), + FITNESS(17, "com.google.android.gms.fitness.GoogleFitnessService.START"), + REMINDERS(18, "com.google.android.gms.reminders.service.START"), LIGHTWEIGHT_INDEX(19, "com.google.android.gms.icing.LIGHTWEIGHT_INDEX_SERVICE"), + DEVICE_CONNECTION(20, "com.google.android.gms.deviceconnection.service.START"), INDEX(21, "com.google.android.gms.icing.INDEX_SERVICE"), LOCATION_REPORTING(22, "com.google.android.gms.location.reporting.service.START", "com.google.android.location.reporting.service.START"), LOCATION_MANAGER(23, "com.google.android.location.internal.GoogleLocationManagerService.START"), PLAY_LOG(24, "com.google.android.gms.playlog.service.START"), + LOCKBOX(26, "com.google.android.gms.lockbox.service.START"), CAST_MIRRORING(27, "com.google.android.gms.cast_mirroring.service.START"), + NETWORK_QUALITY(28, "com.google.android.gms.mdm.services.START"), + FEEDBACK(29, "com.google.android.gms.feedback.internal.IFeedbackService"), SEARCH_ADMINISTRATION(30), + PHOTO_AUTO_BACKUP(31, "com.google.android.gms.photos.autobackup.service.START"), SEARCH_QUERIES(32), SEARCH_GLOBAL(33), + UDC(35, "com.google.android.gms.udc.service.START"), SEARCH_CORPORA(36), + DEVICE_MANAGER(37, "com.google.android.gms.mdm.services.DeviceManagerApiService.START"), + PSEUDONYMOUS_ID(38, "com.google.android.gms.pseudonymous.service.START"), COMMON(39, "com.google.android.gms.common.service.START"), CLEARCUT_LOGGER(40, "com.google.android.gms.clearcut.service.START"), + USAGE_REPORTING(41, "com.google.android.gms.usagereporting.service.START"), + KIDS(42, "com.google.android.gms.kids.service.START"), + DOWNLOAD(43, "com.google.android.gms.common.download.START"), SIGN_IN(44, "com.google.android.gms.signin.service.START"), + SAFETY_NET_CLIENT(45, "com.google.android.gms.safetynet.service.START"), + GSERVICES(46, "com.google.android.gms.ads.gservice.START"), CONTEXT_MANAGER(47, "com.google.android.contextmanager.service.ContextManagerService.START"), + AUDIO_MODEM(48, "com.google.android.gms.audiomodem.service.AudioModemService.START"), + NEARBY_SHARING(49, "com.google.android.gms.nearby.sharing.service.NearbySharingService.START"), LIGHTWEIGHT_NETWORK_QUALITY(50, "com.google.android.gms.herrevad.services.LightweightNetworkQualityAndroidService.START"), - PHENOTYPE(51, "com.mgoogle.android.gms.phenotype.service.START"), + PHENOTYPE(51, "com.google.android.gms.phenotype.service.START"), + VOICE_UNLOCK(52, "com.google.android.gms.speech.service.START"), + NEARBY_CONNECTIONS(54, "com.google.android.gms.nearby.connection.service.START"), + FITNESS_SENSORS(55, "com.google.android.gms.fitness.SensorsApi"), + FITNESS_RECORDING(56, "com.google.android.gms.fitness.RecordingApi"), + FITNESS_HISTORY(57, "com.google.android.gms.fitness.HistoryApi"), + FITNESS_SESSIONS(58, "com.google.android.gms.fitness.SessionsApi"), + FITNESS_BLE(59, "com.google.android.gms.fitness.BleApi"), + FITNESS_CONFIG(60, "com.google.android.gms.fitness.ConfigApi"), + FITNESS_INTERNAL(61, "com.google.android.gms.fitness.InternalApi"), + NEARBY_MESSAGES(62, "com.google.android.gms.nearby.messages.service.NearbyMessagesService.START"), + HELP(63, "com.google.android.gms.googlehelp.service.GoogleHelpService.START"), + CONFIG(64, "com.google.android.gms.config.START"), GEODATA(65, "com.google.android.gms.location.places.GeoDataApi"), SEARCH_IME(66), PLACE_DETECTION(67, "com.google.android.gms.location.places.PlaceDetectionApi"), CREDENTIALS(68, "com.google.android.gms.auth.api.credentials.service.START"), + NEARBY_BOOTSTRAP(69, "com.google.android.gms.nearby.bootstrap.service.NearbyBootstrapService.START"), + PLUS_INTERNAL(70), + SOURCE_DEVICE(75, "com.google.android.gms.smartdevice.d2d.SourceDeviceService.START"), + TARGET_DEVICE(76, "com.google.android.gms.smartdevice.d2d.TargetDeviceService.START"), + APP_INVITE(77, "com.google.android.gms.appinvite.service.START"), + TAP_AND_PAY(79, "com.google.android.gms.tapandpay.service.BIND"), + CHROME_SYNC(80, "com.google.android.gms.chromesync.service.START"), + ACCOUNTS(81, "com.google.android.gms.smartdevice.setup.accounts.AccountsService.START"), + CAST_REMOTE_DISPLAY(83, "com.google.android.gms.cast.remote_display.service.START"), + TRUST_AGENT(85, "com.google.android.gms.trustagent.StateApi.START"), + AUTH_SIGN_IN(91, "com.google.android.gms.auth.api.signin.service.START"), MEASUREMENT(93, "com.google.android.gms.measurement.START"), + FREIGHTER(98, "com.google.android.gms.freighter.service.START"), + GUNS(110, "com.google.android.gms.notifications.service.START"), + BLE(111, "com.google.android.gms.beacon.internal.IBleService.START"), + FIREBASE_AUTH(112, "com.google.firebase.auth.api.gms.service.START"), + APP_INDEXING(113), GASS(116, "com.google.android.gms.gass.START"), + WORK_ACCOUNT(120), + INSTANT_APPS(121, "com.google.android.gms.instantapps.START"), + CAST_FIRSTPATY(122, "com.google.android.gms.cast.firstparty.START"), + AD_CACHE(123, "com.google.android.gms.ads.service.CACHE"), + CRYPT_AUTH(129, "com.google.android.gms.auth.cryptauth.cryptauthservice.START"), + DYNAMIC_LINKS(131, "com.google.firebase.dynamiclinks.service.START"), + FONTS(132, "com.google.android.gms.fonts.service.START"), + ROMANESCO(135, "com.google.android.gms.romanesco.service.START"), + TRAINER(139, "com.google.android.gms.learning.trainer.START"), + FIDO2_REGULAR(148, "com.google.android.gms.fido.fido2.regular.START"), + FIDO2_PRIVILEGED(149, "com.google.android.gms.fido.fido2.privileged.START"), + DATA_DOWNLOAD(152, "com.google.android.mdd.service.START"), + ACCOUNT_DATA(153, "com.google.android.gms.auth.account.data.service.START"), + CONSTELLATION(155, "com.google.android.gms.constellation.service.START"), + AUDIT(154, "com.google.android.gms.audit.service.START"), + SYSTEM_UPDATE(157, "com.google.android.gms.update.START_API_SERVICE"), + USER_LOCATION(163, "com.google.android.gms.userlocation.service.START"), + AD_HTTP(166, "com.google.android.gms.ads.service.HTTP"), + LANGUAGE_PROFILE(167, "com.google.android.gms.languageprofile.service.START"), + MDNS(168, "com.google.android.gms.mdns.service.START"), + FIDO2_ZEROPARTY(180, "com.google.android.gms.fido.fido2.zeroparty.START"), + G1_RESTORE(181, "com.google.android.gms.backup.G1_RESTORE"), + G1_BACKUP(182, "com.google.android.gms.backup.G1_BACKUP"), + PAYSE(188, "com.google.android.gms.payse.service.BIND"), + RCS(189, "com.google.android.gms.rcs.START"), + CARRIER_AUTH(191, "com.google.android.gms.carrierauth.service.START"), + SYSTEM_UPDATE_SINGLE_UESR(192, "com.google.android.gms.update.START_SINGLE_USER_API_SERVICE"), + APP_USAGE(193, "com.google.android.gms.appusage.service.START"), + NEARBY_SHARING_2(194, "com.google.android.gms.nearby.sharing.START_SERVICE"), + AD_CONSENT_LOOKUP(195, "com.google.android.gms.ads.service.CONSENT_LOOKUP"), + PHONE_INTERNAL(197, "com.google.android.gms.auth.api.phone.service.InternalService.START"), + PAY(198, "com.google.android.gms.pay.service.BIND"), + ASTERISM(199, "com.google.android.gms.asterism.service.START"), + MODULE_RESTORE(201, "com.google.android.gms.backup.GMS_MODULE_RESTORE"), FACS_CACHE(202, "com.google.android.gms.facs.cache.service.START"), + RECAPTCHA(205, "com.google.android.gms.recaptcha.service.START"), + CONTACT_SYNC(208, "com.google.android.gms.people.contactssync.service.START"), IDENTITY_SIGN_IN(212, "com.google.android.gms.auth.api.identity.service.signin.START"), + CREDENTIAL_STORE(214, "com.google.android.gms.fido.credentialstore.internal_service.START"), + EVENT_ATTESTATION(216, "com.google.android.gms.ads.identifier.service.EVENT_ATTESTATION"), + SCHEDULER(218, "com.google.android.gms.scheduler.ACTION_PROXY_SCHEDULE"), + AUTHORIZATION(219, "com.google.android.gms.auth.api.identity.service.authorization.START"), FACS_SYNC(220, "com.google.android.gms.facs.internal.service.START"), + AUTH_CONFIG_SYNC(221, "com.google.android.gms.auth.config.service.START"), + CREDENTIAL_SAVING(223, "com.google.android.gms.auth.api.identity.service.credentialsaving.START"), + GOOGLE_AUTH(224, "com.google.android.gms.auth.account.authapi.START"), + ENTERPRISE_LOADER(225, "com.google.android.gms.enterprise.loader.service.START"), + THUNDERBIRD(226, "com.google.android.gms.thunderbird.service.START"), + NEARBY_EXPOSURE(236, "com.google.android.gms.nearby.exposurenotification.START"), + GMS_COMPLIANCE(257, "com.google.android.gms.gmscompliance.service.START"), + FIDO_SOURCE_DEVICE(262, "com.google.android.gms.fido.sourcedevice.service.START"), + FAST_PAIR(265, "com.google.android.gms.nearby.fastpair.START"), + MATCHSTICK_LIGHTER(268, "com.google.android.gms.matchstick.lighter.service.START"), + FIDO_TARGET_DEVICE_INTERNAL(269, "com.google.android.gms.fido.targetdevice.internal_service.START"), + TELEMETRY(270, "com.google.android.gms.common.telemetry.service.START"), + SECOND_DEVICE_AUTH(275, "com.google.android.gms.setup.auth.SecondDeviceAuth.START"), + LOCATION_SHARING_REPORTER(277, "com.google.android.gms.locationsharingreporter.service.START"), + OCR(279, "com.google.android.gms.ocr.service.START"), + OCR_INTERNAL(281, "com.google.android.gms.ocr.service.internal.START"), ; public int SERVICE_ID; @@ -61,6 +172,11 @@ public enum GmsService { this.SECONDARY_ACTIONS = actions; } + public interface ADVERTISING_ID { + // Has no service id + String ACTION = "com.google.android.gms.ads.identifier.service.START"; + } + public static GmsService byServiceId(int serviceId) { for (GmsService service : values()) { if (service.SERVICE_ID == serviceId) return service; @@ -85,4 +201,4 @@ public enum GmsService { if (this != UNKNOWN) return toString(); return "UNKNOWN(" + serviceId + ")"; } -} +} \ No newline at end of file diff --git a/play-services-cast-api/build.gradle b/play-services-cast-api/build.gradle index af8fd50e..92e76c5e 100644 --- a/play-services-cast-api/build.gradle +++ b/play-services-cast-api/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" aidlPackageWhiteList "com/google/android/gms/cast/ApplicationMetadata.aidl" aidlPackageWhiteList "com/google/android/gms/cast/LaunchOptions.aidl" diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/RequestItem.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/RequestItem.aidl new file mode 100644 index 00000000..96c3751e --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/RequestItem.aidl @@ -0,0 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.cast; + +parcelable RequestItem; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/IBundleCallback.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/IBundleCallback.aidl new file mode 100644 index 00000000..15043379 --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/IBundleCallback.aidl @@ -0,0 +1,10 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.cast.internal; + +interface IBundleCallback { + oneway void onBundle(in Bundle bundle); +} diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastService.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastService.aidl new file mode 100644 index 00000000..7ee5c972 --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastService.aidl @@ -0,0 +1,18 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.cast.internal; + +import com.google.android.gms.common.api.internal.IStatusCallback; +import com.google.android.gms.cast.internal.IBundleCallback; +import com.google.android.gms.cast.RequestItem; + +interface ICastService { + oneway void broadcastPrecacheMessageLegacy(IStatusCallback callback, in String[] arg2, String precacheData) = 0; + oneway void broadcastPrecacheMessage(IStatusCallback callback, in String[] arg2, String precacheData, in List requestItems) = 1; + oneway void getCxLessStatus(IStatusCallback callback) = 3; + oneway void getFeatureFlags(IBundleCallback callback, in String[] flags) = 4; + oneway void getCastStatusCodeDictionary(IBundleCallback callback, in String[] dictionaries) = 5; +} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/RequestItem.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/RequestItem.java new file mode 100644 index 00000000..2d38c132 --- /dev/null +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/RequestItem.java @@ -0,0 +1,22 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.cast; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class RequestItem extends AutoSafeParcelable { + @Field(2) + public String url; + @Field(3) + public int protocolType; + @Field(4) + public int initialTime; + @Field(5) + public String hlsSegmentFormat; + + public static Creator CREATOR = new AutoCreator(RequestItem.class); +} diff --git a/play-services-cast-framework-api/build.gradle b/play-services-cast-framework-api/build.gradle index aa53beca..c9b8b637 100644 --- a/play-services-cast-framework-api/build.gradle +++ b/play-services-cast-framework-api/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk diff --git a/play-services-cast/build.gradle b/play-services-cast/build.gradle index 788618f5..dbdf42b0 100755 --- a/play-services-cast/build.gradle +++ b/play-services-cast/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk diff --git a/play-services-core-proto/src/main/proto/appcert.proto b/play-services-core-proto/src/main/proto/appcert.proto new file mode 100644 index 00000000..4ab1e5e7 --- /dev/null +++ b/play-services-core-proto/src/main/proto/appcert.proto @@ -0,0 +1,32 @@ +option java_package = "org.microg.gms.auth.appcert"; +option java_outer_classname = "AppCertProto"; + +message DeviceKeyRequest { + optional uint64 androidId = 2; + optional uint64 sessionId = 3; + message VersionInfo { + optional uint32 sdkVersion = 1; + optional uint32 gmsVersion = 2; + } + optional VersionInfo versionInfo = 4; + optional string token = 5; +} + +message DeviceKey { + optional uint64 keyId = 1; + optional uint64 deviceId = 3; + optional bytes macSecret = 4; + optional bytes keyCert = 5; +} + +message SpatulaHeaderProto { + message PackageInfo { + optional string packageName = 1; + optional string packageCertificateHash = 3; + } + optional PackageInfo packageInfo = 1; + optional bytes hmac = 2; + optional uint64 deviceId = 3; + optional uint64 keyId = 4; + optional bytes keyCert = 5; +} diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 84429485..70f64e5c 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -28,29 +28,31 @@ dependencies { implementation project(':play-services-core:microg-ui-tools') // deprecated implementation project(':play-services-api') implementation project(':play-services-cast-api') + implementation project(':play-services-tasks') // AndroidX UI - implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'androidx.mediarouter:mediarouter:1.2.5' - implementation "androidx.preference:preference-ktx:$preferenceVersion" + implementation "androidx.preference:preference-ktx:1.1.1" implementation "org.microg.gms:conscrypt-gmscore:2.5.1" - implementation "androidx.annotation:annotation:1.2.0" - implementation "androidx.lifecycle:lifecycle-service:2.3.1" + implementation 'androidx.annotation:annotation:1.3.0' + implementation 'androidx.lifecycle:lifecycle-service:2.4.0' // Navigation implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5' implementation 'androidx.navigation:navigation-ui-ktx:2.3.5' - implementation "androidx.lifecycle:lifecycle-service:2.3.1" - implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.32' + implementation 'androidx.lifecycle:lifecycle-service:2.4.0' + implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10' + implementation 'com.android.volley:volley:1.2.1' api project(':play-services-basement') } android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { versionName version diff --git a/play-services-core/microg-ui-tools/build.gradle b/play-services-core/microg-ui-tools/build.gradle index edb1b523..f77f77c9 100644 --- a/play-services-core/microg-ui-tools/build.gradle +++ b/play-services-core/microg-ui-tools/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk @@ -37,7 +37,7 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.3.1' - implementation "androidx.preference:preference:$preferenceVersion" + implementation 'androidx.appcompat:appcompat:1.4.1' + implementation "androidx.preference:preference:1.1.1" } diff --git a/play-services-core/microg-ui-tools/src/main/res/layout/switch_bar.xml b/play-services-core/microg-ui-tools/src/main/res/layout/switch_bar.xml index f8a6d55e..224fdf66 100644 --- a/play-services-core/microg-ui-tools/src/main/res/layout/switch_bar.xml +++ b/play-services-core/microg-ui-tools/src/main/res/layout/switch_bar.xml @@ -29,7 +29,7 @@ android:ellipsize="end" android:maxLines="2" android:text="@string/v7_preference_on" - android:theme="@style/TextAppearance.AppCompat.Title.Inverse"/> + android:textAppearance="@style/TextAppearance.AppCompat.Title.Inverse"/> + android:permissionGroup="android.permission-group.NETWORK" + android:protectionLevel="privileged|signature" /> + + + @@ -277,7 +284,7 @@ android:exported="true" /> @@ -285,12 +292,24 @@ - + + + + + + + + + + + + + @@ -299,12 +318,14 @@ + @@ -318,7 +339,7 @@ + android:exported="true" /> @@ -360,16 +382,19 @@ + android:process=":ui" + android:taskAffinity="org.microg.gms.settings" /> + android:process=":ui" + android:taskAffinity="org.microg.gms.settings" /> + android:process=":ui" + android:taskAffinity="org.microg.gms.settings"> @@ -411,7 +436,7 @@ @@ -467,17 +492,168 @@ + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/measurement/dynamite/ModuleDescriptor.java b/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/measurement/dynamite/ModuleDescriptor.java new file mode 100644 index 00000000..0c3f0bcd --- /dev/null +++ b/play-services-core/src/main/java/com/google/android/gms/dynamite/descriptors/com/google/android/gms/measurement/dynamite/ModuleDescriptor.java @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.dynamite.descriptors.com.google.android.gms.measurement.dynamite; + +public class ModuleDescriptor { + public static final String MODULE_ID = "com.google.android.gms.measurement.dynamite"; + public static final int MODULE_VERSION = 53; +} diff --git a/play-services-core/src/main/java/org/microg/gms/BaseService.java b/play-services-core/src/main/java/org/microg/gms/BaseService.java index 398c00ed..113b2466 100644 --- a/play-services-core/src/main/java/org/microg/gms/BaseService.java +++ b/play-services-core/src/main/java/org/microg/gms/BaseService.java @@ -30,16 +30,20 @@ import com.google.android.gms.common.internal.IGmsServiceBroker; import org.microg.gms.common.GmsService; +import java.io.FileDescriptor; +import java.io.PrintWriter; + import java.util.Arrays; import java.util.EnumSet; public abstract class BaseService extends LifecycleService { private final IGmsServiceBroker broker; + private final EnumSet services; protected final String TAG; public BaseService(String tag, GmsService supportedService, GmsService... supportedServices) { this.TAG = tag; - EnumSet services = EnumSet.of(supportedService); + services = EnumSet.of(supportedService); services.addAll(Arrays.asList(supportedServices)); broker = new AbstractGmsServiceBroker(services) { @Override @@ -62,5 +66,10 @@ public abstract class BaseService extends LifecycleService { return broker.asBinder(); } + @Override + protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) { + writer.println(TAG + " providing services " + services.toString()); + } + public abstract void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException; } diff --git a/play-services-core/src/main/java/org/microg/gms/auth/AuthManagerServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/auth/AuthManagerServiceImpl.java index 80ac29cf..6e8d30bd 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/AuthManagerServiceImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/AuthManagerServiceImpl.java @@ -20,6 +20,7 @@ import android.accounts.Account; import android.accounts.AccountManager; import android.accounts.AuthenticatorException; import android.accounts.OperationCanceledException; +import android.annotation.SuppressLint; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; @@ -180,6 +181,7 @@ public class AuthManagerServiceImpl extends IAuthManagerService.Stub { } @Override + @SuppressLint("MissingPermission") // Workaround bug in Android Linter public Bundle clearToken(String token, Bundle extras) { String packageName = extras.getString(KEY_ANDROID_PACKAGE_NAME); if (packageName == null) packageName = extras.getString(KEY_CLIENT_PACKAGE_NAME); diff --git a/play-services-core/src/main/java/org/microg/gms/auth/AuthRequest.java b/play-services-core/src/main/java/org/microg/gms/auth/AuthRequest.java index 8dda8e4c..aaea96c8 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/AuthRequest.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/AuthRequest.java @@ -19,10 +19,11 @@ package org.microg.gms.auth; import android.content.Context; import org.microg.gms.checkin.LastCheckinInfo; -import org.microg.gms.common.Build; +import org.microg.gms.profile.Build; import org.microg.gms.common.Constants; import org.microg.gms.common.HttpFormClient; import org.microg.gms.common.Utils; +import org.microg.gms.profile.ProfileManager; import java.io.IOException; import java.util.Locale; @@ -77,8 +78,6 @@ public class AuthRequest extends HttpFormClient.Request { public boolean getAccountId; @RequestContent("ACCESS_TOKEN") public boolean isAccessToken; - @RequestContent("droidguard_results") - public String droidguardResults; @RequestContent("has_permission") public boolean hasPermission; @RequestContent("add_account") @@ -91,10 +90,11 @@ public class AuthRequest extends HttpFormClient.Request { userAgent = String.format(USER_AGENT, deviceName, buildVersion); } - public AuthRequest build(Build build) { - sdkVersion = build.sdk; - deviceName = build.device; - buildVersion = build.id; + public AuthRequest build(Context context) { + ProfileManager.ensureInitialized(context); + sdkVersion = Build.VERSION.SDK_INT; + deviceName = Build.DEVICE; + buildVersion = Build.ID; return this; } @@ -111,7 +111,7 @@ public class AuthRequest extends HttpFormClient.Request { } public AuthRequest fromContext(Context context) { - build(Utils.getBuild(context)); + build(context); locale(Utils.getLocale(context)); androidIdHex = Long.toHexString(LastCheckinInfo.read(context).getAndroidId()); return this; @@ -186,11 +186,6 @@ public class AuthRequest extends HttpFormClient.Request { return this; } - public AuthRequest droidguardResults(String droidguardResults) { - this.droidguardResults = droidguardResults; - return this; - } - public AuthResponse getResponse() throws IOException { return HttpFormClient.request(SERVICE_URL, this, AuthResponse.class); } diff --git a/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java b/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java index 61224887..e30a196c 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/login/LoginActivity.java @@ -312,7 +312,6 @@ public class LoginActivity extends AssistantActivity { .token(oAuthToken).isAccessToken() .addAccount() .getAccountId() - .droidguardResults(null /*TODO*/) .getResponseAsync(new HttpFormClient.Callback() { @Override public void onResponse(AuthResponse response) { @@ -422,7 +421,7 @@ public class LoginActivity extends AssistantActivity { @JavascriptInterface public final void addAccount(String json) { - Log.d(TAG, "JSBridge: addAccount " + json); + Log.d(TAG, "JSBridge: addAccount"); } @JavascriptInterface @@ -458,7 +457,7 @@ public class LoginActivity extends AssistantActivity { @JavascriptInterface public final String getAndroidId() { long androidId = LastCheckinInfo.read(LoginActivity.this).getAndroidId(); - Log.d(TAG, "JSBridge: getAndroidId " + androidId); + Log.d(TAG, "JSBridge: getAndroidId"); if (androidId == 0 || androidId == -1) return null; return Long.toHexString(androidId); } @@ -520,7 +519,6 @@ public class LoginActivity extends AssistantActivity { @JavascriptInterface public final void hideKeyboard() { - Log.d(TAG, "JSBridge: hideKeyboard"); inputMethodManager.hideSoftInputFromWindow(webView.getWindowToken(), 0); } @@ -536,7 +534,7 @@ public class LoginActivity extends AssistantActivity { @JavascriptInterface public final void log(String s) { - Log.d(TAG, "JSBridge: log " + s); + Log.d(TAG, "JSBridge: log"); } @JavascriptInterface @@ -546,13 +544,12 @@ public class LoginActivity extends AssistantActivity { @JavascriptInterface public final void setAccountIdentifier(String accountIdentifier) { - Log.d(TAG, "JSBridge: setAccountIdentifier " + accountIdentifier); + Log.d(TAG, "JSBridge: setAccountIdentifier"); } @TargetApi(HONEYCOMB) @JavascriptInterface public final void setBackButtonEnabled(boolean backButtonEnabled) { - Log.d(TAG, "JSBridge: setBackButtonEnabled: " + backButtonEnabled); if (SDK_INT <= GINGERBREAD_MR1) return; int visibility = getWindow().getDecorView().getSystemUiVisibility(); if (backButtonEnabled) @@ -570,13 +567,11 @@ public class LoginActivity extends AssistantActivity { @JavascriptInterface public final void showKeyboard() { - Log.d(TAG, "JSBridge: showKeyboard"); inputMethodManager.showSoftInput(webView, SHOW_IMPLICIT); } @JavascriptInterface public final void showView() { - Log.d(TAG, "JSBridge: showView"); runOnUiThread(() -> webView.setVisibility(VISIBLE)); } diff --git a/play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java b/play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java index 2793663a..ea031218 100755 --- a/play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java +++ b/play-services-core/src/main/java/org/microg/gms/checkin/CheckinClient.java @@ -16,13 +16,14 @@ package org.microg.gms.checkin; +import android.content.Context; import android.util.Log; -import org.microg.gms.common.Build; import org.microg.gms.common.DeviceConfiguration; import org.microg.gms.common.DeviceIdentifier; import org.microg.gms.common.PhoneInfo; import org.microg.gms.common.Utils; +import org.microg.gms.profile.Build; import java.io.IOException; import java.io.InputStream; @@ -75,7 +76,7 @@ public class CheckinClient { return response; } - public static CheckinRequest makeRequest(Build build, DeviceConfiguration deviceConfiguration, + public static CheckinRequest makeRequest(Context context, DeviceConfiguration deviceConfiguration, DeviceIdentifier deviceIdent, PhoneInfo phoneInfo, LastCheckinInfo checkinInfo, Locale locale, List accounts, Boolean brandSpoof) { @@ -84,19 +85,19 @@ public class CheckinClient { .androidId(checkinInfo.getAndroidId()) .checkin(new CheckinRequest.Checkin.Builder() .build(new CheckinRequest.Checkin.Build.Builder() - .bootloader(brandSpoof ? "c2f2-0.2-5799621" : build.bootloader) - .brand(brandSpoof ? "google" : build.brand) + .bootloader(brandSpoof ? "c2f2-0.2-5799621" : Build.BOOTLOADER) + .brand(brandSpoof ? "google" : Build.BOOTLOADER) .clientId("android-google") - .device(brandSpoof ? "generic" : build.device) - .fingerprint(brandSpoof ? "google/coral/coral:10/QD1A.190821.007/5831595:user/release-keys" : build.fingerprint) - .hardware(brandSpoof ? "coral" : build.hardware) - .manufacturer(brandSpoof ? "Google" : build.manufacturer) - .model(brandSpoof ? "mainline" : build.model) + .device(brandSpoof ? "generic" : Build.DEVICE) + .fingerprint(brandSpoof ? "google/coral/coral:10/QD1A.190821.007/5831595:user/release-keys" : Build.FINGERPRINT) + .hardware(brandSpoof ? "coral" : Build.HARDWARE) + .manufacturer(brandSpoof ? "Google" : Build.MANUFACTURER) + .model(brandSpoof ? "mainline" : Build.MODEL) .otaInstalled(false) // TODO? - .product(brandSpoof ? "coral" : build.product) - .radio(brandSpoof ? "" : build.radio) - .sdkVersion(brandSpoof ? 29 : build.sdk) - .time(build.time / 1000) + .product(brandSpoof ? "coral" : Build.PRODUCT) + .radio(brandSpoof ? "" : Build.RADIO) + .sdkVersion(brandSpoof ? 29 : Build.VERSION.SDK_INT) + .time(Build.TIME / 1000) .build()) .cellOperator(phoneInfo.cellOperator) .event(Collections.singletonList(new CheckinRequest.Checkin.Event.Builder() @@ -135,7 +136,7 @@ public class CheckinClient { .loggingId(new Random().nextLong()) // TODO: static .meid(deviceIdent.meid) .otaCert(Collections.singletonList("71Q6Rn2DDZl1zPDVaaeEHItd")) - .serial(build.serial) + .serial(Build.SERIAL) .timeZone(TimeZone.getDefault().getID()) .userName((String) TODO) .userSerialNumber((Integer) TODO) diff --git a/play-services-core/src/main/java/org/microg/gms/checkin/CheckinManager.java b/play-services-core/src/main/java/org/microg/gms/checkin/CheckinManager.java index 9bed5db0..af7f407d 100755 --- a/play-services-core/src/main/java/org/microg/gms/checkin/CheckinManager.java +++ b/play-services-core/src/main/java/org/microg/gms/checkin/CheckinManager.java @@ -58,7 +58,7 @@ public class CheckinManager { accounts.add(new CheckinClient.Account(account.name, token)); } } - CheckinRequest request = CheckinClient.makeRequest(Utils.getBuild(context), + CheckinRequest request = CheckinClient.makeRequest(context, new DeviceConfiguration(context), Utils.getDeviceIdentifier(context), Utils.getPhoneInfo(context), info, Utils.getLocale(context), accounts, isSpoofingEnabled(context)); diff --git a/play-services-core/src/main/java/org/microg/gms/checkin/CheckinService.java b/play-services-core/src/main/java/org/microg/gms/checkin/CheckinService.java index 39f7ef70..52b94f0e 100755 --- a/play-services-core/src/main/java/org/microg/gms/checkin/CheckinService.java +++ b/play-services-core/src/main/java/org/microg/gms/checkin/CheckinService.java @@ -59,6 +59,16 @@ public class CheckinService extends IntentService { public String getDeviceDataVersionInfo() throws RemoteException { return LastCheckinInfo.read(CheckinService.this).getDeviceDataVersionInfo(); } + + @Override + public long getLastCheckinSuccessTime() throws RemoteException { + return LastCheckinInfo.read(CheckinService.this).getLastCheckin(); + } + + @Override + public String getLastSimOperator() throws RemoteException { + return null; + } }; public CheckinService() { diff --git a/play-services-core/src/main/java/org/microg/gms/checkin/TriggerReceiver.java b/play-services-core/src/main/java/org/microg/gms/checkin/TriggerReceiver.java index da7c90c3..5a51c6ed 100755 --- a/play-services-core/src/main/java/org/microg/gms/checkin/TriggerReceiver.java +++ b/play-services-core/src/main/java/org/microg/gms/checkin/TriggerReceiver.java @@ -55,14 +55,14 @@ public class TriggerReceiver extends WakefulBroadcastReceiver { subIntent.putExtra(EXTRA_FORCE_CHECKIN, force); startWakefulService(new ForegroundServiceContext(context), subIntent); } else if (SDK_INT >= 23) { - // no network, register a network callback to retry when we have internet - NetworkRequest networkRequest = new NetworkRequest.Builder() - .addCapability(NET_CAPABILITY_INTERNET) - .build(); - Intent i = new Intent(context, TriggerReceiver.class); - PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, i, FLAG_UPDATE_CURRENT); - cm.registerNetworkCallback(networkRequest, pendingIntent); - } + // no network, register a network callback to retry when we have internet + NetworkRequest networkRequest = new NetworkRequest.Builder() + .addCapability(NET_CAPABILITY_INTERNET) + .build(); + Intent i = new Intent(context, TriggerReceiver.class); + PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, i, FLAG_UPDATE_CURRENT); + cm.registerNetworkCallback(networkRequest, pendingIntent); + } } else { Log.d(TAG, "Ignoring " + intent + ": checkin is disabled"); } diff --git a/play-services-core/src/main/java/org/microg/gms/clearcut/ClearcutLoggerService.java b/play-services-core/src/main/java/org/microg/gms/clearcut/ClearcutLoggerService.java deleted file mode 100644 index 02203153..00000000 --- a/play-services-core/src/main/java/org/microg/gms/clearcut/ClearcutLoggerService.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.gms.clearcut; - -import android.os.RemoteException; - -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; - -public class ClearcutLoggerService extends BaseService { - private ClearcutLoggerServiceImpl clearcutService = new ClearcutLoggerServiceImpl(); - - public ClearcutLoggerService() { - super("GmsClearcutSvc", GmsService.CLEARCUT_LOGGER); - } - - @Override - public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { - callback.onPostInitComplete(0, clearcutService.asBinder(), null); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/clearcut/ClearcutLoggerServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/clearcut/ClearcutLoggerServiceImpl.java deleted file mode 100644 index fd1a1dac..00000000 --- a/play-services-core/src/main/java/org/microg/gms/clearcut/ClearcutLoggerServiceImpl.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.gms.clearcut; - -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.clearcut.LogEventParcelable; -import com.google.android.gms.clearcut.internal.IClearcutLoggerCallbacks; -import com.google.android.gms.clearcut.internal.IClearcutLoggerService; -import com.google.android.gms.common.api.Status; - -public class ClearcutLoggerServiceImpl extends IClearcutLoggerService.Stub { - private static final String TAG = "GmsClearcutLogSvcImpl"; - - @Override - public void log(IClearcutLoggerCallbacks callbacks, LogEventParcelable event) throws RemoteException { - // These logs are not really helpful for us, so let's just ignore it. - try { - callbacks.onStatus(Status.SUCCESS); - } catch (Exception ignored) { - } - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/common/Build.java b/play-services-core/src/main/java/org/microg/gms/common/Build.java deleted file mode 100644 index 423d90d5..00000000 --- a/play-services-core/src/main/java/org/microg/gms/common/Build.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.gms.common; - -import java.util.Locale; -import java.util.Random; - -public class Build { - public String fingerprint = android.os.Build.FINGERPRINT; - public String hardware = android.os.Build.HARDWARE; - public String brand = android.os.Build.BRAND; - public String radio = getRadio(); - public String bootloader = android.os.Build.BOOTLOADER; - public long time = android.os.Build.TIME; - public String device = android.os.Build.DEVICE; - public int sdk = android.os.Build.VERSION.SDK_INT; - public String model = android.os.Build.MODEL; - public String manufacturer = android.os.Build.MANUFACTURER; - public String product = android.os.Build.PRODUCT; - public String id = android.os.Build.ID; - public String serial = generateSerialNumber(); // TODO: static - - @SuppressWarnings("deprecation") - private static String getRadio() { - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH) { - return android.os.Build.getRadioVersion(); - } else { - return android.os.Build.RADIO; - } - } - - private String generateSerialNumber() { - String serial; - Random rand = new Random(); - StringBuilder serialBuilder = new StringBuilder("008741"); - for (int i = 0; i < 10; i++) - serialBuilder.append(Integer.toString(rand.nextInt(16), 16)); - serial = serialBuilder.toString(); - serial = serial.toUpperCase(Locale.US); - return serial; - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java b/play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java index 5404fe4e..c14514d1 100644 --- a/play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java +++ b/play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java @@ -130,6 +130,30 @@ public class PackageUtils { return null; } + @Nullable + public static byte[] firstSignatureDigestBytes(Context context, String packageName) { + return firstSignatureDigestBytes(context.getPackageManager(), packageName); + } + + @Nullable + public static byte[] firstSignatureDigestBytes(PackageManager packageManager, String packageName) { + final PackageInfo info; + try { + info = packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES); + } catch (PackageManager.NameNotFoundException e) { + return null; + } + if (info != null && info.signatures != null && info.signatures.length > 0) { + for (Signature sig : info.signatures) { + byte[] digest = sha1bytes(sig.toByteArray()); + if (digest != null) { + return digest; + } + } + } + return null; + } + @Nullable public static String getCallingPackage(Context context) { int callingUid = Binder.getCallingUid(), callingPid = Binder.getCallingPid(); @@ -140,11 +164,36 @@ public class PackageUtils { return packageName; } + public static byte[] sha1bytes(byte[] bytes) { + MessageDigest md; + try { + md = MessageDigest.getInstance("SHA1"); + } catch (final NoSuchAlgorithmException e) { + return null; + } + if (md != null) { + return md.digest(bytes); + } + return null; + } + @Nullable public static String getAndCheckCallingPackage(Context context, String suggestedPackageName) { return getAndCheckCallingPackage(context, suggestedPackageName, 0); } + @Nullable + public static String getAndCheckCallingPackageOrExtendedAccess(Context context, String suggestedPackageName) { + try { + return getAndCheckCallingPackage(context, suggestedPackageName, 0); + } catch (Exception e) { + if (callerHasExtendedAccess(context)) { + return suggestedPackageName; + } + throw e; + } + } + @Nullable public static String getAndCheckCallingPackage(Context context, int suggestedCallerUid) { return getAndCheckCallingPackage(context, null, suggestedCallerUid); diff --git a/play-services-core/src/main/java/org/microg/gms/common/Utils.java b/play-services-core/src/main/java/org/microg/gms/common/Utils.java index e13700a5..44d87815 100644 --- a/play-services-core/src/main/java/org/microg/gms/common/Utils.java +++ b/play-services-core/src/main/java/org/microg/gms/common/Utils.java @@ -32,10 +32,6 @@ public class Utils { return Locale.getDefault(); // TODO } - public static Build getBuild(Context context) { - return new Build(); - } - public static DeviceIdentifier getDeviceIdentifier(Context context) { return new DeviceIdentifier(); } diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsInputStream.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsInputStream.java index 75374e50..2e7f2b36 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/McsInputStream.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsInputStream.java @@ -56,7 +56,7 @@ public class McsInputStream extends Thread implements Closeable { private int streamId = 0; private long lastMsgTime = 0; - private boolean closed = false; + private volatile boolean closed = false; public McsInputStream(InputStream is, Handler mainHandler) { this(is, mainHandler, false); @@ -82,7 +82,11 @@ public class McsInputStream extends Thread implements Closeable { } } } catch (IOException e) { - mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_INPUT_ERROR, e)); + if (closed) { + Log.d(TAG, "We were closed already. Ignoring IOException"); + } else { + mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_INPUT_ERROR, e)); + } } try { is.close(); @@ -119,7 +123,7 @@ public class McsInputStream extends Thread implements Closeable { Log.d(TAG, "Reading from MCS version: " + version); initialized = true; } catch (IOException e) { - Log.w(TAG, e); + Log.w(TAG, "Error reading version", e); } } } diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsOutputStream.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsOutputStream.java index a4867b6d..5448adef 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/McsOutputStream.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsOutputStream.java @@ -41,10 +41,10 @@ public class McsOutputStream extends Thread implements Handler.Callback, Closeab private int version = MCS_VERSION_CODE; private int streamId = 0; - private Handler mainHandler; + private final Handler mainHandler; private Handler myHandler; - private boolean closed = false; + private volatile boolean closed = false; public McsOutputStream(OutputStream os, Handler mainHandler) { this(os, mainHandler, false); @@ -78,7 +78,11 @@ public class McsOutputStream extends Thread implements Handler.Callback, Closeab writeInternal((Message) msg.obj, msg.arg1); mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_OUTPUT_DONE, msg.arg1, msg.arg2, msg.obj)); } catch (IOException e) { - mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_OUTPUT_ERROR, e)); + if (closed) { + Log.d(TAG, "We were closed already. Ignoring IOException"); + } else { + mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_OUTPUT_ERROR, e)); + } } return true; case MSG_TEARDOWN: diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java index 7ecfe1a5..58151bf7 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/McsService.java @@ -26,6 +26,7 @@ import android.content.pm.PackageManager; import android.content.pm.PermissionInfo; import android.content.pm.ResolveInfo; import android.net.ConnectivityManager; +import android.net.NetworkInfo; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -62,6 +63,7 @@ import java.io.Closeable; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.net.Socket; +import java.net.SocketException; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -121,11 +123,15 @@ public class McsService extends Service implements Handler.Callback { public static final int SERVICE_PORT = 5228; private static final int WAKELOCK_TIMEOUT = 5000; + // On bad mobile network a ping can take >60s, so we wait for an ACK for 90s + private static final int HEARTBEAT_ACK_AFTER_PING_TIMEOUT_MS = 90000; + private static long lastHeartbeatPingElapsedRealtime = -1; private static long lastHeartbeatAckElapsedRealtime = -1; private static long lastIncomingNetworkRealtime = 0; private static long startTimestamp = 0; public static String activeNetworkPref = null; + private boolean wasTornDown = false; private AtomicInteger nextMessageId = new AtomicInteger(0x1000000); private static Socket sslSocket; @@ -223,6 +229,7 @@ public class McsService extends Service implements Handler.Callback { @Override public void onDestroy() { + Log.d(TAG, "onDestroy"); alarmManager.cancel(heartbeatIntent); closeAll(); database.close(); @@ -240,14 +247,20 @@ public class McsService extends Service implements Handler.Callback { logd(null, "Connection is not enabled or dead."); return false; } - // consider connection to be dead if we did not receive an ack within twice the heartbeat interval + // consider connection to be dead if we did not receive an ack within 90s to our ping int heartbeatMs = GcmPrefs.get(context).getHeartbeatMsFor(activeNetworkPref); + // if disabled for active network, heartbeatMs will be -1 if (heartbeatMs < 0) { closeAll(); - } else if (SystemClock.elapsedRealtime() - lastHeartbeatAckElapsedRealtime > 2 * heartbeatMs) { - logd(null, "No heartbeat for " + (SystemClock.elapsedRealtime() - lastHeartbeatAckElapsedRealtime) / 1000 + " seconds, connection assumed to be dead after " + 2 * heartbeatMs / 1000 + " seconds"); - GcmPrefs.get(context).learnTimeout(context, activeNetworkPref); return false; + } else { + boolean noAckReceived = lastHeartbeatAckElapsedRealtime < lastHeartbeatPingElapsedRealtime; + long timeSinceLastPing = SystemClock.elapsedRealtime() - lastHeartbeatPingElapsedRealtime; + if (noAckReceived && timeSinceLastPing > HEARTBEAT_ACK_AFTER_PING_TIMEOUT_MS) { + logd(null, "No heartbeat for " + timeSinceLastPing / 1000 + "s, connection assumed to be dead after 90s"); + GcmPrefs.get(context).learnTimeout(context, activeNetworkPref); + return false; + } } return true; } @@ -431,11 +444,14 @@ public class McsService extends Service implements Handler.Callback { try { closeAll(); ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); - activeNetworkPref = GcmPrefs.get(this).getNetworkPrefForInfo(cm.getActiveNetworkInfo()); - if (!GcmPrefs.get(this).isEnabledFor(cm.getActiveNetworkInfo())) { + NetworkInfo activeNetworkInfo = cm.getActiveNetworkInfo(); + activeNetworkPref = GcmPrefs.get(this).getNetworkPrefForInfo(activeNetworkInfo); + if (!GcmPrefs.get(this).isEnabledFor(activeNetworkInfo)) { + logd(this, "Don't connect, because disabled for " + activeNetworkInfo.getTypeName()); scheduleReconnect(this); return; } + wasTornDown = false; logd(this, "Starting MCS connection..."); Socket socket = new Socket(SERVICE_HOST, SERVICE_PORT); @@ -448,6 +464,7 @@ public class McsService extends Service implements Handler.Callback { outputStream.start(); startTimestamp = System.currentTimeMillis(); + lastHeartbeatPingElapsedRealtime = SystemClock.elapsedRealtime(); lastHeartbeatAckElapsedRealtime = SystemClock.elapsedRealtime(); lastIncomingNetworkRealtime = SystemClock.elapsedRealtime(); scheduleHeartbeat(this); @@ -633,6 +650,12 @@ public class McsService extends Service implements Handler.Callback { case MSG_INPUT_ERROR: case MSG_OUTPUT_ERROR: logd(this, "I/O error: " + msg.obj); + if (msg.obj instanceof SocketException) { + SocketException e = (SocketException) msg.obj; + if ("Connection reset".equals(e.getMessage())) { + GcmPrefs.get(this).learnTimeout(this, activeNetworkPref); + } + } rootHandler.sendMessage(rootHandler.obtainMessage(MSG_TEARDOWN, msg.obj)); return true; case MSG_TEARDOWN: @@ -653,6 +676,7 @@ public class McsService extends Service implements Handler.Callback { ping.last_stream_id_received(inputStream.getStreamId()); } send(MCS_HEARTBEAT_PING_TAG, ping.build()); + lastHeartbeatPingElapsedRealtime = SystemClock.elapsedRealtime(); scheduleHeartbeat(this); } else { logd(this, "Ignoring heartbeat, not connected!"); @@ -683,7 +707,7 @@ public class McsService extends Service implements Handler.Callback { handleOutputDone(msg); return true; } - Log.w(TAG, "Unknown message: " + msg); + Log.w(TAG, "Unknown message (" + msg.what + "): " + msg); return false; } @@ -717,6 +741,7 @@ public class McsService extends Service implements Handler.Callback { resetCurrentDelay(); lastIncomingNetworkRealtime = SystemClock.elapsedRealtime(); } catch (Exception e) { + Log.w(TAG, "Exception when handling input: " + message, e); rootHandler.sendMessage(rootHandler.obtainMessage(MSG_TEARDOWN, e)); } } @@ -731,6 +756,7 @@ public class McsService extends Service implements Handler.Callback { } private static void closeAll() { + logd(null, "Closing all sockets..."); tryClose(inputStream); tryClose(outputStream); if (sslSocket != null) { @@ -742,6 +768,14 @@ public class McsService extends Service implements Handler.Callback { } private void handleTeardown(android.os.Message msg) { + if (wasTornDown) { + // This can get called multiple times from different places via MSG_TEARDOWN + // this causes the reconnect delay to increase with each call to scheduleReconnect(), + // increasing the time we are disconnected. + logd(this, "Was torn down already, not doing it again"); + return; + } + wasTornDown = true; closeAll(); scheduleReconnect(this); diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/PushRegisterManager.java b/play-services-core/src/main/java/org/microg/gms/gcm/PushRegisterManager.java index 7dab2ca8..56f0e7da 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/PushRegisterManager.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/PushRegisterManager.java @@ -41,7 +41,7 @@ public class PushRegisterManager { RegisterResponse response = new RegisterResponse(); try { response = new RegisterRequest() - .build(Utils.getBuild(context)) + .build(context) .sender(sender) .info(info) .checkin(LastCheckinInfo.read(context)) diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/RegisterRequest.java b/play-services-core/src/main/java/org/microg/gms/gcm/RegisterRequest.java index 43f04028..79c29c2c 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/RegisterRequest.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/RegisterRequest.java @@ -16,12 +16,15 @@ package org.microg.gms.gcm; +import android.content.Context; + import android.os.Bundle; import android.text.TextUtils; import org.microg.gms.checkin.LastCheckinInfo; -import org.microg.gms.common.Build; import org.microg.gms.common.HttpFormClient; +import org.microg.gms.profile.Build; +import org.microg.gms.profile.ProfileManager; import java.io.IOException; import java.util.LinkedHashMap; @@ -103,9 +106,10 @@ public class RegisterRequest extends HttpFormClient.Request { return this; } - public RegisterRequest build(Build build) { - deviceName = build.device; - buildVersion = build.id; + public RegisterRequest build(Context context) { + ProfileManager.ensureInitialized(context); + deviceName = Build.DEVICE; + buildVersion = Build.ID; return this; } diff --git a/play-services-core/src/main/java/org/microg/gms/gcm/TriggerReceiver.java b/play-services-core/src/main/java/org/microg/gms/gcm/TriggerReceiver.java index 3be427c3..c3a79d58 100644 --- a/play-services-core/src/main/java/org/microg/gms/gcm/TriggerReceiver.java +++ b/play-services-core/src/main/java/org/microg/gms/gcm/TriggerReceiver.java @@ -25,6 +25,7 @@ import android.util.Log; import androidx.legacy.content.WakefulBroadcastReceiver; +import org.microg.gms.checkin.CheckinPrefs; import org.microg.gms.checkin.LastCheckinInfo; import org.microg.gms.common.ForegroundServiceContext; @@ -67,6 +68,14 @@ public class TriggerReceiver extends WakefulBroadcastReceiver { if (LastCheckinInfo.read(context).getAndroidId() == 0) { Log.d(TAG, "Ignoring " + intent + ": need to checkin first."); + if (CheckinPrefs.isEnabled(context)) { + // Do a check-in if we are not actually checked in, + // but should be, e.g. cleared app data + Log.d(TAG, "Requesting check-in..."); + String action = "android.server.checkin.CHECKIN"; + Class clazz = org.microg.gms.checkin.TriggerReceiver.class; + context.sendBroadcast(new Intent(action, null, context, clazz)); + } return; } diff --git a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java index 5742cb49..4d11fb0d 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java +++ b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java @@ -22,8 +22,12 @@ import android.content.Context; import android.location.Location; import android.location.LocationManager; import android.os.Binder; +import android.os.Handler; +import android.os.Looper; import android.os.RemoteException; +import android.util.Log; +import com.google.android.gms.common.api.Status; import com.google.android.gms.location.ILocationListener; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.internal.FusedLocationProviderResult; @@ -32,6 +36,7 @@ import com.google.android.gms.location.internal.LocationRequestUpdateData; import org.microg.gms.common.PackageUtils; import org.microg.gms.common.Utils; +import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; @@ -40,17 +45,26 @@ import static android.Manifest.permission.ACCESS_FINE_LOCATION; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.location.LocationManager.GPS_PROVIDER; import static com.google.android.gms.location.LocationRequest.PRIORITY_HIGH_ACCURACY; +import static com.google.android.gms.location.LocationRequest.PRIORITY_NO_POWER; + +import androidx.lifecycle.Lifecycle; public class GoogleLocationManager implements LocationChangeListener { + private static final String TAG = "LocationManager"; + private static final String MOCK_PROVIDER = "mock"; + private static final long VERIFY_CURRENT_REQUESTS_INTERVAL_MS = 5000; // 5 seconds private static final long SWITCH_ON_FRESHNESS_CLIFF_MS = 30000; // 30 seconds private static final String ACCESS_MOCK_LOCATION = "android.permission.ACCESS_MOCK_LOCATION"; private final Context context; + private final Handler handler; + private final Runnable verifyCurrentRequestsRunnable = this::verifyCurrentRequests; private final RealLocationProvider gpsProvider; private final MockLocationProvider mockProvider; private final List currentRequests = new ArrayList(); - public GoogleLocationManager(Context context) { + public GoogleLocationManager(Context context, Lifecycle lifecycle) { + long callingIdentity = Binder.clearCallingIdentity(); this.context = context; LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); if (Utils.hasSelfPermissionOrNotify(context, Manifest.permission.ACCESS_FINE_LOCATION)) { @@ -59,6 +73,12 @@ public class GoogleLocationManager implements LocationChangeListener { this.gpsProvider = null; } mockProvider = new MockLocationProvider(this); + handler = new Handler(Looper.getMainLooper()); + Binder.restoreCallingIdentity(callingIdentity); + } + + public void invokeOnceReady(Runnable runnable) { + } public Location getLastLocation(String packageName) { @@ -68,23 +88,6 @@ public class GoogleLocationManager implements LocationChangeListener { public Location getLocation(boolean gpsPermission, boolean networkPermission) { if (mockProvider.getLocation() != null) return mockProvider.getLocation(); - if (gpsPermission) { - Location network = null; - Location gps = gpsProvider == null ? null : gpsProvider.getLastLocation(); - if (network == null) - return gps; - if (gps == null) - return network; - if (gps.getTime() > network.getTime() - SWITCH_ON_FRESHNESS_CLIFF_MS) - return gps; - return network; - } else if (networkPermission) { - Location network = null; - if (network != null && network.getExtras() != null && network.getExtras().getParcelable("no_gps_location") instanceof Location) { - network = network.getExtras().getParcelable("no_gps_location"); - } - return network; - } return null; } @@ -109,14 +112,20 @@ public class GoogleLocationManager implements LocationChangeListener { } } if (old != null) { + Log.d(TAG, "Removing replaced location request: " + old); currentRequests.remove(old); } currentRequests.add(request); if (gpsProvider != null && request.hasFinePermission() && request.locationRequest.getPriority() == PRIORITY_HIGH_ACCURACY) { + Log.d(TAG, "Registering request with high accuracy location provider"); gpsProvider.addRequest(request); } else if (gpsProvider != null && old != null) { + Log.d(TAG, "Unregistering request with high accuracy location provider"); gpsProvider.removeRequest(old); + } else { + Log.w(TAG, "Not providing high accuracy location: missing permission"); } + handler.postDelayed(this::onLocationChanged, request.locationRequest.getFastestInterval()); } public void requestLocationUpdates(LocationRequest request, ILocationListener listener, String packageName) { @@ -151,25 +160,41 @@ public class GoogleLocationManager implements LocationChangeListener { } public void updateLocationRequest(LocationRequestUpdateData data) { - String packageName = PackageUtils.getCallingPackage(context); - if (data.pendingIntent != null) - packageName = PackageUtils.packageFromPendingIntent(data.pendingIntent); - if (data.opCode == LocationRequestUpdateData.REQUEST_UPDATES) { - requestLocationUpdates(new LocationRequestHelper(context, packageName, Binder.getCallingUid(), data)); - } else if (data.opCode == LocationRequestUpdateData.REMOVE_UPDATES) { - for (int i = 0; i < currentRequests.size(); i++) { - if (currentRequests.get(i).respondsTo(data.listener) - || currentRequests.get(i).respondsTo(data.pendingIntent) - || currentRequests.get(i).respondsTo(data.callback)) { - removeLocationUpdates(currentRequests.get(i)); - i--; + try { + Log.d(TAG, "updateLocationRequest: " + data); + String packageName = PackageUtils.getCallingPackage(context); + if (data.pendingIntent != null) + packageName = PackageUtils.packageFromPendingIntent(data.pendingIntent); + Log.d(TAG, "Using source package: " + packageName); + if (data.opCode == LocationRequestUpdateData.REQUEST_UPDATES) { + requestLocationUpdates(new LocationRequestHelper(context, packageName, Binder.getCallingUid(), data)); + } else if (data.opCode == LocationRequestUpdateData.REMOVE_UPDATES) { + for (int i = 0; i < currentRequests.size(); i++) { + if (currentRequests.get(i).respondsTo(data.listener) + || currentRequests.get(i).respondsTo(data.pendingIntent) + || currentRequests.get(i).respondsTo(data.callback)) { + removeLocationUpdates(currentRequests.get(i)); + i--; + } } } - } - if (data.fusedLocationProviderCallback != null) { - try { - data.fusedLocationProviderCallback.onFusedLocationProviderResult(FusedLocationProviderResult.SUCCESS); - } catch (RemoteException ignored) { + Log.d(TAG, "Updated current requests, verifying"); + verifyCurrentRequests(); + if (data.fusedLocationProviderCallback != null) { + try { + Log.d(TAG, "Send success result to " + packageName); + data.fusedLocationProviderCallback.onFusedLocationProviderResult(FusedLocationProviderResult.SUCCESS); + } catch (RemoteException ignored) { + } + } + } catch (Exception e) { + Log.w(TAG, "Exception in updateLocationRequest", e); + if (data.fusedLocationProviderCallback != null) { + try { + Log.d(TAG, "Send internal error result"); + data.fusedLocationProviderCallback.onFusedLocationProviderResult(FusedLocationProviderResult.create(Status.INTERNAL_ERROR)); + } catch (RemoteException ignored) { + } } } } @@ -186,6 +211,22 @@ public class GoogleLocationManager implements LocationChangeListener { mockProvider.setLocation(mockLocation); } + private void verifyCurrentRequests() { + handler.removeCallbacks(verifyCurrentRequestsRunnable); + try { + for (int i = 0; i < currentRequests.size(); i++) { + LocationRequestHelper request = currentRequests.get(i); + if (!request.isActive()) { + removeLocationUpdates(request); + i--; + } + } + } catch (Exception e) { + Log.w(TAG, e); + } + handler.postDelayed(verifyCurrentRequestsRunnable, VERIFY_CURRENT_REQUESTS_INTERVAL_MS); + } + @Override public void onLocationChanged() { for (int i = 0; i < currentRequests.size(); i++) { @@ -196,4 +237,12 @@ public class GoogleLocationManager implements LocationChangeListener { } } } + + public void dump(PrintWriter writer) { + if (gpsProvider != null) gpsProvider.dump(writer); + writer.println(currentRequests.size() + " requests:"); + for (LocationRequestHelper request : currentRequests) { + writer.println(" " + request.id + " package=" + request.packageName + " interval=" + request.locationRequest.getInterval() + " smallestDisplacement=" + request.locationRequest.getSmallestDisplacement()); + } + } } diff --git a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerService.java b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerService.java index e2906b1c..1c8d951f 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerService.java +++ b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerService.java @@ -19,21 +19,30 @@ package org.microg.gms.location; import android.os.RemoteException; import android.util.Log; +import com.google.android.gms.common.Feature; 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.io.FileDescriptor; +import java.io.PrintWriter; + public class GoogleLocationManagerService extends BaseService { - private GoogleLocationManagerServiceImpl impl = new GoogleLocationManagerServiceImpl(this); + private GoogleLocationManagerServiceImpl impl = new GoogleLocationManagerServiceImpl(this, getLifecycle()); public GoogleLocationManagerService() { - super("GmsLocManagerSvc", GmsService.LOCATION_MANAGER, GmsService.GEODATA, GmsService.PLACE_DETECTION); + super("LocationManager", GmsService.LOCATION_MANAGER, GmsService.GEODATA, GmsService.PLACE_DETECTION); } @Override public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { } + + @Override + protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) { + impl.getLocationManager().dump(writer); + } } diff --git a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java index 31ac74a3..8169a4c7 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java @@ -20,12 +20,19 @@ import android.app.PendingIntent; import android.content.Context; import android.location.Location; import android.os.Binder; +import android.os.Handler; import android.os.IBinder; +import android.os.Looper; import android.os.Parcel; import android.os.RemoteException; import android.util.Log; +import androidx.annotation.NonNull; +import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleOwner; + import com.google.android.gms.common.api.Status; +import com.google.android.gms.common.api.internal.IStatusCallback; import com.google.android.gms.location.ActivityRecognitionResult; import com.google.android.gms.location.GeofencingRequest; import com.google.android.gms.location.GestureRequest; @@ -35,6 +42,7 @@ import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationSettingsRequest; import com.google.android.gms.location.LocationSettingsResult; import com.google.android.gms.location.LocationSettingsStates; +import com.google.android.gms.location.internal.DeviceOrientationRequestUpdateData; import com.google.android.gms.location.internal.IGeofencerCallbacks; import com.google.android.gms.location.internal.IGoogleLocationManagerService; import com.google.android.gms.location.internal.ISettingsCallbacks; @@ -58,19 +66,31 @@ import org.microg.gms.common.PackageUtils; import java.util.Arrays; import java.util.List; -public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerService.Stub { +public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerService.Stub implements LifecycleOwner { private static final String TAG = "GmsLocManagerSvcImpl"; private final Context context; + private final Lifecycle lifecycle; private GoogleLocationManager locationManager; - public GoogleLocationManagerServiceImpl(Context context) { + public GoogleLocationManagerServiceImpl(Context context, Lifecycle lifecycle) { this.context = context; + this.lifecycle = lifecycle; } - private GoogleLocationManager getLocationManager() { + @NonNull + @Override + public Lifecycle getLifecycle() { + return lifecycle; + } + + public void invokeOnceReady(Runnable runnable) { + getLocationManager().invokeOnceReady(runnable); + } + + public synchronized GoogleLocationManager getLocationManager() { if (locationManager == null) - locationManager = new GoogleLocationManager(context); + locationManager = new GoogleLocationManager(context, lifecycle); return locationManager; } @@ -119,18 +139,6 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ return null; } - @Override - public Status iglms65(PendingIntent pendingIntent) throws RemoteException { - Log.d(TAG, "iglms65"); - return null; - } - - @Override - public Status iglms66(PendingIntent pendingIntent) throws RemoteException { - Log.d(TAG, "iglms66"); - return null; - } - @Override public Status requestGestureUpdates(GestureRequest request, PendingIntent pendingIntent) throws RemoteException { Log.d(TAG, "requestGestureUpdates"); @@ -195,6 +203,11 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ getLocationManager().setMockLocation(mockLocation); } + @Override + public void injectLocation(Location mockLocation, int injectionType) throws RemoteException { + Log.d(TAG, "injectLocation[" + injectionType + "]: " + mockLocation); + } + @Override public void iglms14(LatLngBounds var1, int var2, PlaceFilter var3, PlacesParams var4, IPlacesCallbacks var5) throws RemoteException { @@ -246,13 +259,14 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ } @Override - public void iglms25(PlaceReport var1, PlacesParams var2) throws RemoteException { - Log.d(TAG, "iglms25: " + var1); + public Location getLastLocationWith(String s) throws RemoteException { + Log.d(TAG, "getLastLocationWith: " + s); + return getLastLocation(); } @Override - public void iglms26(Location var1, int var2) throws RemoteException { - Log.d(TAG, "iglms26: " + var1); + public void iglms25(PlaceReport var1, PlacesParams var2) throws RemoteException { + Log.d(TAG, "iglms25: " + var1); } @Override @@ -262,6 +276,11 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ return new LocationAvailability(); } + @Override + public void removeSleepSegmentUpdates(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { + Log.d(TAG, "removeSleepSegmentUpdates"); + } + @Override public void iglms42(String var1, PlacesParams var2, IPlacesCallbacks var3) throws RemoteException { @@ -307,7 +326,29 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ public void requestLocationSettingsDialog(LocationSettingsRequest settingsRequest, ISettingsCallbacks callback, String packageName) throws RemoteException { Log.d(TAG, "requestLocationSettingsDialog: " + settingsRequest); PackageUtils.getAndCheckCallingPackage(context, packageName); - callback.onLocationSettingsResult(new LocationSettingsResult(new LocationSettingsStates(true, true, false, true, true, false), Status.SUCCESS)); + (new Handler(Looper.getMainLooper())).post(() -> { + try { + callback.onLocationSettingsResult(new LocationSettingsResult(new LocationSettingsStates(true, true, true, true, true, true), Status.SUCCESS)); + } catch (RemoteException e) { + Log.w(TAG, e); + } + }); + } + + @Override + public void removeActivityTransitionUpdates(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { + Log.d(TAG, "removeActivityTransitionUpdates"); + } + + @Override + public void updateDeviceOrientationRequest(DeviceOrientationRequestUpdateData request) throws RemoteException { + Log.d(TAG, "updateDeviceOrientationRequest: " + request); + } + + @Override + public boolean setActivityRecognitionMode(int mode) throws RemoteException { + Log.d(TAG, "setActivityRecognitionMode: " + mode); + return false; } @Override @@ -348,6 +389,37 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ Log.d(TAG, "iglms58: " + var1); } + @Override + public void iglms65(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { + Log.d(TAG, "iglms65"); + } + + @Override + public void iglms66(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { + Log.d(TAG, "iglms66"); + } + + @Override + public void iglms68(PendingIntent pendingIntent, IStatusCallback callback) throws RemoteException { + Log.d(TAG, "iglms68"); + } + + @Override + public void iglms71(IStatusCallback callback) throws RemoteException { + Log.d(TAG, "iglms71"); + } + + @Override + public void iglms76(PendingIntent pendingIntent) throws RemoteException { + Log.d(TAG, "iglms76"); + } + + @Override + public int iglms78() throws RemoteException { + Log.d(TAG, "iglms78"); + return 0; + } + @Override public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { if (super.onTransact(code, data, reply, flags)) return true; diff --git a/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java b/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java index 24daa598..6fdae8d6 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java +++ b/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java @@ -35,6 +35,7 @@ import com.google.android.gms.location.LocationResult; import com.google.android.gms.location.internal.LocationRequestUpdateData; import java.util.Arrays; +import java.util.UUID; import static android.Manifest.permission.ACCESS_COARSE_LOCATION; import static android.Manifest.permission.ACCESS_FINE_LOCATION; @@ -51,6 +52,7 @@ public class LocationRequestHelper { public ILocationListener listener; public PendingIntent pendingIntent; public ILocationCallback callback; + public String id = UUID.randomUUID().toString(); private Location lastReport; private int numReports = 0; @@ -84,17 +86,41 @@ public class LocationRequestHelper { this.callback = data.callback; } + public boolean isActive() { + if (!hasCoarsePermission()) return false; + if (listener != null) { + try { + return listener.asBinder().isBinderAlive(); + } catch (Exception e) { + return false; + } + } else if (pendingIntent != null) { + return true; + } else if (callback != null) { + try { + return callback.asBinder().isBinderAlive(); + } catch (Exception e) { + return false; + } + } else { + return false; + } + } + /** * @return whether to continue sending reports to this {@link LocationRequestHelper} */ public boolean report(Location location) { if (location == null) return true; - if (!hasCoarsePermission()) return false; + if (!isActive()) return false; if (lastReport != null) { + if (location.equals(lastReport)) { + return true; + } if (location.getTime() - lastReport.getTime() < locationRequest.getFastestInterval()) { return true; } - if (location.distanceTo(lastReport) < locationRequest.getSmallestDesplacement()) { + if (location.distanceTo(lastReport) < locationRequest.getSmallestDisplacement()) { return true; } } diff --git a/play-services-core/src/main/java/org/microg/gms/location/RealLocationProvider.java b/play-services-core/src/main/java/org/microg/gms/location/RealLocationProvider.java index 98e1947a..cb4fd496 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/RealLocationProvider.java +++ b/play-services-core/src/main/java/org/microg/gms/location/RealLocationProvider.java @@ -23,6 +23,7 @@ import android.os.Bundle; import android.os.Looper; import android.util.Log; +import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; @@ -44,7 +45,12 @@ public class RealLocationProvider { private LocationListener listener = new LocationListener() { @Override public void onLocationChanged(Location location) { - lastLocation = location; + lastLocation = new Location(location); + try { + lastLocation.getExtras().keySet(); // call to unparcel() + } catch (Exception e) { + // Sometimes we need to define the correct ClassLoader before unparcel(). Ignore those. + } changeListener.onLocationChanged(); } @@ -121,7 +127,7 @@ public class RealLocationProvider { StringBuilder sb = new StringBuilder(); for (LocationRequestHelper request : requests) { minTime = Math.min(request.locationRequest.getInterval(), minTime); - minDistance = Math.min(request.locationRequest.getSmallestDesplacement(), minDistance); + minDistance = Math.min(request.locationRequest.getSmallestDisplacement(), minDistance); if (sb.length() != 0) sb.append(", "); sb.append(request.packageName).append(":").append(request.locationRequest.getInterval()).append("ms"); } @@ -146,4 +152,16 @@ public class RealLocationProvider { connectedMinDistance = minDistance; } } + + public void dump(PrintWriter writer) { + if (writer != null) { + writer.println(name + " provider:"); + writer.println(" last location: " + lastLocation); + writer.println(" active: " + connected.get()); + if (connected.get()) { + writer.println(" interval: " + connectedMinTime); + writer.println(" distance: " + connectedMinDistance); + } + } + } } diff --git a/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java index c091cbde..f369f84e 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java @@ -17,6 +17,7 @@ package org.microg.gms.location; import android.accounts.Account; +import android.os.Parcel; import android.os.RemoteException; import android.util.Log; @@ -58,4 +59,15 @@ public class ReportingServiceImpl extends IReportingService.Stub { Log.d(TAG, "reportDeviceAtPlace"); return 0; } + + + @Override + public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { + if (super.onTransact(code, data, reply, flags)) { + return true; + } + + Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); + return false; + } } diff --git a/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementBrokerService.java b/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementBrokerService.java deleted file mode 100644 index 4cd9a0f8..00000000 --- a/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementBrokerService.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2018 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.gms.measurement; - -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.common.api.CommonStatusCodes; -import com.google.android.gms.common.api.Status; -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; - -public class MeasurementBrokerService extends BaseService { - public MeasurementBrokerService() { - super("GmsMeasureBrokerSvc", GmsService.MEASUREMENT); - } - - @Override - public void handleServiceRequest(IGmsCallbacks callback, GetServiceRequest request, GmsService service) throws RemoteException { - callback.onPostInitComplete(CommonStatusCodes.SUCCESS, new MeasurementServiceImpl().asBinder(), null); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementServiceImpl.java deleted file mode 100644 index b6fbb62b..00000000 --- a/play-services-core/src/main/java/org/microg/gms/measurement/MeasurementServiceImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2018 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.microg.gms.measurement; - -import android.os.Parcel; -import android.os.RemoteException; -import android.util.Log; - -import com.google.android.gms.measurement.internal.AppMetadata; -import com.google.android.gms.measurement.internal.ConditionalUserPropertyParcel; -import com.google.android.gms.measurement.internal.EventParcel; -import com.google.android.gms.measurement.internal.IMeasurementService; - -public class MeasurementServiceImpl extends IMeasurementService.Stub { - private static final String TAG = "GmsMeasureSvcImpl"; - - @Override - public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { - if (super.onTransact(code, data, reply, flags)) return true; - Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); - return false; - } - - @Override - public void f1(EventParcel p0, AppMetadata p1) throws RemoteException { - Log.d(TAG, "f1: " + p1.packageName); - } - - @Override - public void f4(AppMetadata p0) throws RemoteException { - Log.d(TAG, "f4: " + p0.packageName); - } - - @Override - public void f10(long p0, String p1, String p2, String p3) throws RemoteException { - Log.d(TAG, "f10: " + p1); - } - - @Override - public String f11(AppMetadata p0) throws RemoteException { - Log.d(TAG, "f11: " + p0.packageName); - return null; - } - - @Override - public void f12(ConditionalUserPropertyParcel p0, AppMetadata p1) throws RemoteException { - Log.d(TAG, "f12: " + p1.packageName); - } -} diff --git a/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogService.java b/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogService.java index 28015345..f86cd109 100644 --- a/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogService.java +++ b/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogService.java @@ -24,6 +24,7 @@ import com.google.android.gms.common.internal.IGmsCallbacks; import org.microg.gms.BaseService; import org.microg.gms.common.GmsService; +@Deprecated public class PlayLogService extends BaseService { private PlayLogServiceImpl playLogService = new PlayLogServiceImpl(); diff --git a/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogServiceImpl.java index ddf82e44..62996728 100644 --- a/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogServiceImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/playlog/PlayLogServiceImpl.java @@ -22,10 +22,11 @@ import android.util.Log; import com.google.android.gms.playlog.internal.IPlayLogService; import com.google.android.gms.playlog.internal.LogEvent; -import com.google.android.gms.playlog.internal.PlayLoggerContext; +import com.google.android.gms.clearcut.internal.PlayLoggerContext; import java.util.List; +@Deprecated public class PlayLogServiceImpl extends IPlayLogService.Stub { private static final String TAG = "GmsPlayLogSvcImpl"; diff --git a/play-services-core/src/main/kotlin/com/google/android/gms/measurement/internal/AppMeasurementDynamiteService.kt b/play-services-core/src/main/kotlin/com/google/android/gms/measurement/internal/AppMeasurementDynamiteService.kt new file mode 100644 index 00000000..a0f3373c --- /dev/null +++ b/play-services-core/src/main/kotlin/com/google/android/gms/measurement/internal/AppMeasurementDynamiteService.kt @@ -0,0 +1,198 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package com.google.android.gms.measurement.internal + +import android.os.Bundle +import android.os.Parcelable +import android.util.Log +import com.google.android.gms.dynamic.IObjectWrapper +import com.google.android.gms.measurement.api.internal.* + +private const val TAG = "AppMeasurementService" + +class AppMeasurementDynamiteService : IAppMeasurementDynamiteService.Stub() { + override fun initialize(context: IObjectWrapper?, params: InitializationParams?, timestamp: Long) { + Log.d(TAG, "Not yet implemented: initialize") + } + + override fun logEvent(str: String?, str2: String?, bundle: Bundle?, z: Boolean, z2: Boolean, timestamp: Long) { + Log.d(TAG, "Not yet implemented: logEvent") + } + + override fun logEventAndBundle(str: String?, str2: String?, bundle: Bundle?, receiver: IBundleReceiver?, j: Long) { + Log.d(TAG, "Not yet implemented: logEventAndBundle") + receiver?.onBundle(Bundle().apply { putByteArray("r", ByteArray(0)) }) + } + + override fun setUserProperty(str: String?, str2: String?, obj: IObjectWrapper?, z: Boolean, j: Long) { + Log.d(TAG, "Not yet implemented: setUserProperty") + } + + override fun getUserProperties(str: String?, str2: String?, z: Boolean, receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: getUserProperties") + receiver?.onBundle(Bundle()) + } + + override fun getMaxUserProperties(str: String?, receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: getMaxUserProperties") + receiver?.onBundle(Bundle().apply { putInt("r", 25) }) + } + + override fun setUserId(str: String?, j: Long) { + Log.d(TAG, "Not yet implemented: setUserId") + } + + override fun setConditionalUserProperty(bundle: Bundle?, j: Long) { + Log.d(TAG, "Not yet implemented: setConditionalUserProperty") + } + + override fun clearConditionalUserProperty(str: String?, str2: String?, bundle: Bundle?) { + Log.d(TAG, "Not yet implemented: clearConditionalUserProperty") + } + + override fun getConditionalUserProperties(str: String?, str2: String?, receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: getConditionalUserProperties") + receiver?.onBundle(Bundle().apply { putParcelableArrayList("r", arrayListOf()) }) + } + + override fun setMeasurementEnabled(z: Boolean, j: Long) { + Log.d(TAG, "Not yet implemented: setMeasurementEnabled") + } + + override fun resetAnalyticsData(j: Long) { + Log.d(TAG, "Not yet implemented: resetAnalyticsData") + } + + override fun setMinimumSessionDuration(j: Long) { + Log.d(TAG, "Not yet implemented: setMinimumSessionDuration") + } + + override fun setSessionTimeoutDuration(j: Long) { + Log.d(TAG, "Not yet implemented: setSessionTimeoutDuration") + } + + override fun setCurrentScreen(obj: IObjectWrapper?, str: String?, str2: String?, j: Long) { + Log.d(TAG, "Not yet implemented: setCurrentScreen") + } + + override fun getCurrentScreenName(receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: getCurrentScreenName") + } + + override fun getCurrentScreenClass(receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: getCurrentScreenClass") + } + + override fun setInstanceIdProvider(provider: IStringProvider?) { + Log.d(TAG, "Not yet implemented: setInstanceIdProvider") + } + + override fun getCachedAppInstanceId(receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: getCachedAppInstanceId") + } + + override fun getAppInstanceId(receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: getAppInstanceId") + } + + override fun getGmpAppId(receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: getGmpAppId") + } + + override fun generateEventId(receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: generateEventId") + } + + override fun beginAdUnitExposure(str: String?, j: Long) { + Log.d(TAG, "Not yet implemented: beginAdUnitExposure") + } + + override fun endAdUnitExposure(str: String?, j: Long) { + Log.d(TAG, "Not yet implemented: endAdUnitExposure") + } + + override fun onActivityStarted(activity: IObjectWrapper?, j: Long) { + Log.d(TAG, "Not yet implemented: onActivityStarted") + } + + override fun onActivityStopped(activity: IObjectWrapper?, j: Long) { + Log.d(TAG, "Not yet implemented: onActivityStopped") + } + + override fun onActivityCreated(activity: IObjectWrapper?, bundle: Bundle?, j: Long) { + Log.d(TAG, "Not yet implemented: onActivityCreated") + } + + override fun onActivityDestroyed(activity: IObjectWrapper?, j: Long) { + Log.d(TAG, "Not yet implemented: onActivityDestroyed") + } + + override fun onActivityPaused(activity: IObjectWrapper?, j: Long) { + Log.d(TAG, "Not yet implemented: onActivityPaused") + } + + override fun onActivityResumed(activity: IObjectWrapper?, j: Long) { + Log.d(TAG, "Not yet implemented: onActivityResumed") + } + + override fun onActivitySaveInstanceState(activity: IObjectWrapper?, receiver: IBundleReceiver?, j: Long) { + Log.d(TAG, "Not yet implemented: onActivitySaveInstanceState") + receiver?.onBundle(Bundle()) + } + + override fun performAction(bundle: Bundle?, receiver: IBundleReceiver?, j: Long) { + Log.d(TAG, "Not yet implemented: performAction") + } + + override fun logHealthData(i: Int, str: String?, obj: IObjectWrapper?, obj2: IObjectWrapper?, obj3: IObjectWrapper?) { + Log.d(TAG, "Not yet implemented: logHealthData") + } + + override fun setEventInterceptor(proxy: IEventHandlerProxy?) { + Log.d(TAG, "Not yet implemented: setEventInterceptor") + } + + override fun registerOnMeasurementEventListener(proxy: IEventHandlerProxy?) { + Log.d(TAG, "Not yet implemented: registerOnMeasurementEventListener") + } + + override fun unregisterOnMeasurementEventListener(proxy: IEventHandlerProxy?) { + Log.d(TAG, "Not yet implemented: unregisterOnMeasurementEventListener") + } + + override fun initForTests(map: MutableMap?) { + Log.d(TAG, "Not yet implemented: initForTests") + } + + override fun getTestFlag(receiver: IBundleReceiver?, i: Int) { + Log.d(TAG, "Not yet implemented: getTestFlag") + } + + override fun setDataCollectionEnabled(z: Boolean) { + Log.d(TAG, "Not yet implemented: setDataCollectionEnabled") + } + + override fun isDataCollectionEnabled(receiver: IBundleReceiver?) { + Log.d(TAG, "Not yet implemented: isDataCollectionEnabled") + receiver?.onBundle(Bundle().apply { putBoolean("r", false) }) + } + + override fun setDefaultEventParameters(bundle: Bundle?) { + Log.d(TAG, "Not yet implemented: setDefaultEventParameters") + } + + override fun setConsent(bundle: Bundle?, j: Long) { + Log.d(TAG, "Not yet implemented: setConsent") + } + + override fun setConsentThirdParty(bundle: Bundle?, j: Long) { + Log.d(TAG, "Not yet implemented: setConsentThirdParty") + } + + override fun clearMeasurementEnabled(j: Long) { + Log.d(TAG, "Not yet implemented: clearMeasurementEnabled") + } + +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertManager.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertManager.kt new file mode 100644 index 00000000..2c09bfde --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertManager.kt @@ -0,0 +1,157 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.auth.appcert + +import android.content.Context +import android.database.Cursor +import android.os.SystemClock +import android.util.Base64 +import android.util.Log +import com.android.volley.NetworkResponse +import com.android.volley.Request +import com.android.volley.Response +import com.android.volley.VolleyError +import com.android.volley.toolbox.Volley +import com.mgoogle.android.gms.BuildConfig +import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.runBlocking +import kotlinx.coroutines.sync.Mutex +import kotlinx.coroutines.sync.withLock +import okio.ByteString.Companion.of +import org.microg.gms.checkin.LastCheckinInfo +import org.microg.gms.common.Constants +import org.microg.gms.common.PackageUtils +import org.microg.gms.gcm.GcmConstants +import org.microg.gms.gcm.GcmDatabase +import org.microg.gms.gcm.RegisterRequest +import org.microg.gms.gcm.completeRegisterRequest +import org.microg.gms.profile.Build +import org.microg.gms.profile.ProfileManager +import org.microg.mgms.settings.SettingsContract.CheckIn +import org.microg.mgms.settings.SettingsContract.getSettings +import javax.crypto.Mac +import javax.crypto.spec.SecretKeySpec +import kotlin.random.Random + +class AppCertManager(private val context: Context) { + private val queue = Volley.newRequestQueue(context) + + suspend fun fetchDeviceKey(): Boolean { + ProfileManager.ensureInitialized(context) + deviceKeyLock.withLock { + try { + val elapsedRealtime = SystemClock.elapsedRealtime() + if (elapsedRealtime - deviceKeyCacheTime < DEVICE_KEY_TIMEOUT) { + return deviceKey != null + } + Log.w(TAG, "DeviceKeys for app certifications are experimental") + deviceKeyCacheTime = elapsedRealtime + val lastCheckinInfo = LastCheckinInfo.read(context) + val androidId = lastCheckinInfo.androidId + val sessionId = Random.nextLong() + val token = completeRegisterRequest(context, GcmDatabase(context), RegisterRequest().build(context) + .checkin(lastCheckinInfo) + .app("com.google.android.gms", Constants.GMS_PACKAGE_SIGNATURE_SHA1, BuildConfig.VERSION_CODE) + .sender(REGISTER_SENDER) + .extraParam("subscription", REGISTER_SUBSCIPTION) + .extraParam("X-subscription", REGISTER_SUBSCIPTION) + .extraParam("subtype", REGISTER_SUBTYPE) + .extraParam("X-subtype", REGISTER_SUBTYPE) + .extraParam("scope", REGISTER_SCOPE)) + .getString(GcmConstants.EXTRA_REGISTRATION_ID) + val request = DeviceKeyRequest( + androidId = lastCheckinInfo.androidId, + sessionId = sessionId, + versionInfo = DeviceKeyRequest.VersionInfo(Build.VERSION.SDK_INT, BuildConfig.VERSION_CODE), + token = token + ) + Log.d(TAG, "Request: ${request.toString().chunked(128).joinToString("\n")}") + val deferredResponse = CompletableDeferred() + queue.add(object : Request(Method.POST, "https://android.googleapis.com/auth/devicekey", null) { + override fun getBody(): ByteArray = request.encode() + + override fun getBodyContentType(): String = "application/octet-stream" + + override fun parseNetworkResponse(response: NetworkResponse): Response { + return if (response.statusCode == 200) { + Response.success(response.data, null) + } else { + Response.success(null, null) + } + } + + override fun deliverError(error: VolleyError) { + Log.d(TAG, "Error: ${Base64.encodeToString(error.networkResponse.data, 2)}") + deferredResponse.complete(null) + } + + override fun deliverResponse(response: ByteArray?) { + deferredResponse.complete(response) + } + + override fun getHeaders(): Map { + return mapOf( + "User-Agent" to "GoogleAuth/1.4 (${Build.DEVICE} ${Build.ID}); gzip", + "content-type" to "application/octet-stream", + "app" to "com.google.android.gms", + "device" to androidId.toString(16) + ) + } + }) + val deviceKeyBytes = deferredResponse.await() ?: return false + deviceKey = DeviceKey.ADAPTER.decode(deviceKeyBytes) + Log.d(TAG, "Response: $deviceKey") + return true + } catch (e: Exception) { + Log.w(TAG, e) + return false + } + } + } + + suspend fun getSpatulaHeader(packageName: String): String? { + val deviceKey = deviceKey ?: if (fetchDeviceKey()) deviceKey else null + val packageCertificateHash = Base64.encodeToString(PackageUtils.firstSignatureDigestBytes(context, packageName), Base64.NO_WRAP) + val proto = if (deviceKey != null) { + val macSecret = deviceKey.macSecret?.toByteArray() + if (macSecret == null) { + Log.w(TAG, "Invalid device key: $deviceKey") + return null + } + val mac = Mac.getInstance("HMACSHA256") + mac.init(SecretKeySpec(macSecret, "HMACSHA256")) + val hmac = mac.doFinal("$packageName$packageCertificateHash".toByteArray()) + SpatulaHeaderProto( + packageInfo = SpatulaHeaderProto.PackageInfo(packageName, packageCertificateHash), + hmac = of(*hmac), + deviceId = deviceKey.deviceId, + keyId = deviceKey.keyId, + keyCert = deviceKey.keyCert ?: of() + ) + } else { + Log.d(TAG, "Using fallback spatula header based on Android ID") + val androidId = getSettings(context, CheckIn.getContentUri(context), arrayOf(CheckIn.ANDROID_ID, CheckIn.SECURITY_TOKEN)) { cursor: Cursor -> cursor.getLong(0) } + SpatulaHeaderProto( + packageInfo = SpatulaHeaderProto.PackageInfo(packageName, packageCertificateHash), + deviceId = androidId + ) + } + Log.d(TAG, "Spatula Header: $proto") + return Base64.encodeToString(proto.encode(), Base64.NO_WRAP) + } + + companion object { + private const val TAG = "AppCertManager" + private const val DEVICE_KEY_TIMEOUT = 60 * 60 * 1000L + private const val REGISTER_SENDER = "745476177629" + private const val REGISTER_SUBTYPE = "745476177629" + private const val REGISTER_SUBSCIPTION = "745476177629" + private const val REGISTER_SCOPE = "DeviceKeyRequest" + private val deviceKeyLock = Mutex() + private var deviceKey: DeviceKey? = null + private var deviceKeyCacheTime = 0L + } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertService.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertService.kt new file mode 100644 index 00000000..e73017e2 --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/appcert/AppCertService.kt @@ -0,0 +1,42 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.auth.appcert + +import android.app.Service +import android.content.Context +import android.content.Intent +import android.os.IBinder +import android.os.Parcel +import android.util.Log +import com.google.android.gms.auth.appcert.IAppCertService +import kotlinx.coroutines.runBlocking +import org.microg.gms.common.PackageUtils +import org.microg.gms.utils.warnOnTransactionIssues + +private const val TAG = "AppCertService" + +class AppCertService : Service() { + override fun onBind(intent: Intent): IBinder { + Log.d(TAG, "onBind: $intent") + return AppCertServiceImpl(this).asBinder() + } +} + +class AppCertServiceImpl(private val context: Context) : IAppCertService.Stub() { + private val manager = AppCertManager(context) + + override fun fetchDeviceKey(): Boolean { + PackageUtils.assertExtendedAccess(context) + return runBlocking { manager.fetchDeviceKey() } + } + + override fun getSpatulaHeader(packageName: String): String? { + PackageUtils.assertExtendedAccess(context) + return runBlocking { manager.getSpatulaHeader(packageName) } + } + + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialPickerActivity.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/credentials/CredentialPickerActivity.kt similarity index 93% rename from play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialPickerActivity.kt rename to play-services-core/src/main/kotlin/org/microg/gms/auth/credentials/CredentialPickerActivity.kt index ee7d332f..ba1e9c4f 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialPickerActivity.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/credentials/CredentialPickerActivity.kt @@ -1,9 +1,9 @@ /* - * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-FileCopyrightText: 2022 microG Project Team * SPDX-License-Identifier: Apache-2.0 */ -package org.microg.gms.auth +package org.microg.gms.auth.credentials import android.app.Activity import android.os.Bundle @@ -35,4 +35,4 @@ class CredentialPickerActivity : Activity() { Log.d("GmsCredentialPicker", "Not implemented. callingPackage=$callingPackage, logSessionId=$logSessionId, credentialsRequest=$credentialRequest, hintRequest=$hintRequest") finish() } -} \ No newline at end of file +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/credentials/CredentialsService.kt similarity index 81% rename from play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt rename to play-services-core/src/main/kotlin/org/microg/gms/auth/credentials/CredentialsService.kt index e50c5e9e..adc0370b 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/auth/CredentialsService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/credentials/CredentialsService.kt @@ -1,11 +1,12 @@ /* - * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-FileCopyrightText: 2022 microG Project Team * SPDX-License-Identifier: Apache-2.0 */ -package org.microg.gms.auth +package org.microg.gms.auth.credentials import android.os.Bundle +import android.os.Parcel import android.util.Log import com.google.android.gms.auth.api.credentials.CredentialRequest import com.google.android.gms.auth.api.credentials.internal.* @@ -15,8 +16,9 @@ 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 org.microg.gms.utils.warnOnTransactionIssues -const val TAG = "GmsCredentials" +private const val TAG = "CredentialService" class CredentialsService : BaseService(TAG, GmsService.CREDENTIALS) { override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { @@ -50,4 +52,5 @@ class CredentialsServiceImpl : ICredentialsService.Stub() { callbacks.onStatus(Status.SUCCESS) } -} \ No newline at end of file + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/auth/proxy/AuthProxyService.kt b/play-services-core/src/main/kotlin/org/microg/gms/auth/proxy/AuthProxyService.kt new file mode 100644 index 00000000..e1cedd59 --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/auth/proxy/AuthProxyService.kt @@ -0,0 +1,63 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.auth.proxy + +import android.content.Context +import android.os.Bundle +import android.os.Parcel +import android.util.Log +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.lifecycleScope +import com.google.android.gms.auth.api.internal.IAuthCallbacks +import com.google.android.gms.auth.api.internal.IAuthService +import com.google.android.gms.auth.api.proxy.ProxyRequest +import com.google.android.gms.auth.api.proxy.ProxyResponse +import com.google.android.gms.common.api.CommonStatusCodes +import com.google.android.gms.common.internal.GetServiceRequest +import com.google.android.gms.common.internal.IGmsCallbacks +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import org.microg.gms.BaseService +import org.microg.gms.auth.appcert.AppCertManager +import org.microg.gms.common.GmsService +import org.microg.gms.common.PackageUtils +import org.microg.gms.utils.warnOnTransactionIssues + +private const val TAG = "AuthProxyService" + +class AuthProxyService : BaseService(TAG, GmsService.AUTH_PROXY) { + override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { + val packageName = PackageUtils.getAndCheckCallingPackage(this, request.packageName) + ?: throw IllegalArgumentException("Missing package name") + val consumerPackageName = request.extras.getString("consumerPkg") + if (consumerPackageName != null) PackageUtils.assertExtendedAccess(this) + val serviceImpl = AuthServiceImpl(this, lifecycle, consumerPackageName ?: packageName) + callback.onPostInitComplete(CommonStatusCodes.SUCCESS, serviceImpl, Bundle()) + } +} + +class AuthServiceImpl(private val context: Context, private val lifecycle: Lifecycle, private val packageName: String) : IAuthService.Stub(), LifecycleOwner { + override fun performProxyRequest(callbacks: IAuthCallbacks, request: ProxyRequest) { + Log.d(TAG, "performProxyRequest($packageName, $request)") + lifecycleScope.launchWhenStarted { + callbacks.onProxyResponse(ProxyResponse().apply { gmsStatusCode = CommonStatusCodes.CANCELED }) + } + } + + override fun getSpatulaHeader(callbacks: IAuthCallbacks) { + Log.d(TAG, "getSpatulaHeader($packageName)") + lifecycleScope.launchWhenStarted { + val result = withContext(Dispatchers.IO) { AppCertManager(context).getSpatulaHeader(packageName) } + Log.d(TAG, "Result: $result") + callbacks.onSpatulaHeader(result) + } + } + + override fun getLifecycle(): Lifecycle = lifecycle + + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt b/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt new file mode 100644 index 00000000..afe0dc7f --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/clearcut/ClearcutLoggerService.kt @@ -0,0 +1,80 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package org.microg.gms.clearcut + +import android.os.Parcel +import android.os.RemoteException +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.lifecycleScope +import com.google.android.gms.clearcut.LogEventParcelable +import com.google.android.gms.clearcut.internal.IClearcutLoggerCallbacks +import com.google.android.gms.clearcut.internal.IClearcutLoggerService +import com.google.android.gms.common.api.CommonStatusCodes +import com.google.android.gms.common.api.Status +import com.google.android.gms.common.data.DataHolder +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 org.microg.gms.utils.warnOnTransactionIssues + +private const val TAG = "ClearcutLoggerService" +private const val COLLECT_FOR_DEBUG_DURATION = 24L * 60 * 60 * 1000 + +class ClearcutLoggerService : BaseService(TAG, GmsService.CLEARCUT_LOGGER) { + override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { + callback.onPostInitComplete(0, ClearcutLoggerServiceImpl(lifecycle), null) + } +} + +class ClearcutLoggerServiceImpl(private val lifecycle: Lifecycle) : IClearcutLoggerService.Stub(), LifecycleOwner { + private var collectForDebugExpiryTime: Long = 0 + + override fun log(callbacks: IClearcutLoggerCallbacks, event: LogEventParcelable) { + lifecycleScope.launchWhenStarted { + callbacks.onLogResult(Status.SUCCESS) + } + } + + override fun forceUpload(callbacks: IClearcutLoggerCallbacks) { + lifecycleScope.launchWhenStarted { + callbacks.onLogResult(Status.SUCCESS) + } + } + + override fun startCollectForDebug(callbacks: IClearcutLoggerCallbacks) { + lifecycleScope.launchWhenStarted { + collectForDebugExpiryTime = System.currentTimeMillis() + COLLECT_FOR_DEBUG_DURATION + callbacks.onStartCollectForDebugResult(Status.SUCCESS, collectForDebugExpiryTime) + } + } + + override fun stopCollectForDebug(callbacks: IClearcutLoggerCallbacks) { + lifecycleScope.launchWhenStarted { + callbacks.onStopCollectForDebugResult(Status.SUCCESS) + } + } + + override fun getCollectForDebugExpiryTime(callbacks: IClearcutLoggerCallbacks) { + lifecycleScope.launchWhenStarted { + callbacks.onCollectForDebugExpiryTime(Status.SUCCESS, collectForDebugExpiryTime) + } + } + + override fun getLogEventParcelablesLegacy(callbacks: IClearcutLoggerCallbacks) { + getLogEventParcelables(callbacks) + } + + override fun getLogEventParcelables(callbacks: IClearcutLoggerCallbacks) { + lifecycleScope.launchWhenStarted { + callbacks.onLogEventParcelables(DataHolder.empty(CommonStatusCodes.SUCCESS)) + } + } + + override fun getLifecycle(): Lifecycle = lifecycle + + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/fonts/FontsProvider.kt b/play-services-core/src/main/kotlin/org/microg/gms/fonts/FontsProvider.kt index a15180c5..2ccf28d0 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/fonts/FontsProvider.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/fonts/FontsProvider.kt @@ -35,7 +35,7 @@ class FontsProvider : ContentProvider() { selectionArgs: Array?, sortOrder: String? ): Cursor { - Log.e(TAG, "query: $uri ${projection?.toList()} $selection") + Log.e(TAG, "query: $uri ${projection?.toList()} $selection ${selectionArgs?.joinToString(prefix = "[", postfix = "]")}") val cursor = MatrixCursor(COLUMNS) // We could also return an empty cursor here, but some apps have been reported to crash // when their expected font is not returned by Google's font provider. diff --git a/play-services-core/src/main/kotlin/org/microg/gms/gcm/GcmPrefs.kt b/play-services-core/src/main/kotlin/org/microg/gms/gcm/GcmPrefs.kt index 356ebac4..9494e39c 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/gcm/GcmPrefs.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/gcm/GcmPrefs.kt @@ -118,13 +118,16 @@ data class GcmPrefs( Log.d("GmsGcmPrefs", "learnTimeout: $pref") when (pref) { PREF_NETWORK_MOBILE, PREF_NETWORK_ROAMING -> setSettings(context, Gcm.getContentUri(context)) { - put(Gcm.LEARNT_MOBILE, (learntMobileInterval * 0.95).toInt()) + val newInterval = (learntMobileInterval * 0.95).toInt() + put(Gcm.LEARNT_MOBILE, newInterval) } PREF_NETWORK_WIFI -> setSettings(context, Gcm.getContentUri(context)) { - put(Gcm.LEARNT_WIFI, (learntWifiInterval * 0.95).toInt()) + val newInterval = (learntMobileInterval * 0.95).toInt() + put(Gcm.LEARNT_WIFI, newInterval) } else -> setSettings(context, Gcm.getContentUri(context)) { - put(Gcm.LEARNT_OTHER, (learntOtherInterval * 0.95).toInt()) + val newInterval = (learntMobileInterval * 0.95).toInt() + put(Gcm.LEARNT_OTHER, newInterval) } } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt b/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt index 01c41379..29922173 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/gcm/PushRegisterService.kt @@ -132,7 +132,7 @@ class PushRegisterService : LifecycleService() { Log.d(TAG, "register[req]: " + intent.toString() + " extras=" + intent.extras) val bundle = completeRegisterRequest(this, database, RegisterRequest() - .build(Utils.getBuild(this)) + .build(this) .sender(intent.getStringExtra(EXTRA_SENDER)) .checkin(LastCheckinInfo.read(this)) .app(packageName) @@ -148,7 +148,7 @@ class PushRegisterService : LifecycleService() { val packageName = intent.appPackageName ?: throw RuntimeException("No package provided") Log.d(TAG, "unregister[req]: " + intent.toString() + " extras=" + intent.extras) val bundle = completeRegisterRequest(this, database, RegisterRequest() - .build(Utils.getBuild(this)) + .build(this) .sender(intent.getStringExtra(EXTRA_SENDER)) .checkin(LastCheckinInfo.read(this)) .app(packageName) @@ -298,7 +298,7 @@ internal class PushRegisterHandler(private val context: Context, private val dat if (!delete) ensureAppRegistrationAllowed(context, database, packageName) val bundle = completeRegisterRequest(context, database, RegisterRequest() - .build(Utils.getBuild(context)) + .build(context) .sender(sender) .checkin(LastCheckinInfo.read(context)) .app(packageName) diff --git a/play-services-core/src/main/kotlin/org/microg/gms/measurement/MeasurementService.kt b/play-services-core/src/main/kotlin/org/microg/gms/measurement/MeasurementService.kt new file mode 100644 index 00000000..7f0a0afe --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/measurement/MeasurementService.kt @@ -0,0 +1,58 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.measurement + +import android.os.Bundle +import android.os.Parcel +import android.util.Log +import com.google.android.gms.common.api.CommonStatusCodes +import com.google.android.gms.common.internal.GetServiceRequest +import com.google.android.gms.common.internal.IGmsCallbacks +import com.google.android.gms.measurement.internal.* +import org.microg.gms.BaseService +import org.microg.gms.common.GmsService +import org.microg.gms.utils.warnOnTransactionIssues + +private const val TAG = "MeasurementService" + +class MeasurementService : BaseService(TAG, GmsService.MEASUREMENT) { + override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { + callback.onPostInitComplete(CommonStatusCodes.SUCCESS, MeasurementServiceImpl(), Bundle()) + } +} + +class MeasurementServiceImpl : IMeasurementService.Stub() { + override fun f1(event: EventParcel, app: AppMetadata) { + Log.d(TAG, "f1($event) for $app") + } + + override fun f2(attribute: UserAttributeParcel?, app: AppMetadata) { + Log.d(TAG, "f2($attribute) for $app") + } + + override fun f4(app: AppMetadata) { + Log.d(TAG, "f4() for $app") + } + + override fun f10(p0: Long, p1: String?, p2: String?, p3: String?) { + Log.d(TAG, "f10($p0, $p1, $p2, $p3)") + } + + override fun f11(app: AppMetadata): String? { + Log.d(TAG, "f11() for $app") + return null + } + + override fun f12(property: ConditionalUserPropertyParcel, app: AppMetadata) { + Log.d(TAG, "f12($property) for $app") + } + + override fun setDefaultEventParameters(params: Bundle, app: AppMetadata) { + Log.d(TAG, "setDefaultEventParameters($params) for $app") + } + + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt b/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt index caf317a5..ec83c681 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/phenotype/PhenotypeService.kt @@ -2,7 +2,6 @@ * SPDX-FileCopyrightText: 2020, microG Project Team * SPDX-License-Identifier: Apache-2.0 */ -@file:Suppress("DEPRECATION") package org.microg.gms.phenotype @@ -11,11 +10,12 @@ import android.util.Log import com.google.android.gms.common.api.Status import com.google.android.gms.common.internal.GetServiceRequest import com.google.android.gms.common.internal.IGmsCallbacks -import com.mgoogle.android.gms.phenotype.Configurations -import com.mgoogle.android.gms.phenotype.internal.IPhenotypeCallbacks -import com.mgoogle.android.gms.phenotype.internal.IPhenotypeService +import com.google.android.gms.phenotype.Configurations +import com.google.android.gms.phenotype.internal.IPhenotypeCallbacks +import com.google.android.gms.phenotype.internal.IPhenotypeService import org.microg.gms.BaseService import org.microg.gms.common.GmsService +import org.microg.gms.utils.warnOnTransactionIssues private const val TAG = "GmsPhenotypeSvc" @@ -27,7 +27,12 @@ class PhenotypeService : BaseService(TAG, GmsService.PHENOTYPE) { class PhenotypeServiceImpl : IPhenotypeService.Stub() { override fun register(callbacks: IPhenotypeCallbacks, p1: String?, p2: Int, p3: Array?, p4: ByteArray?) { - Log.d(TAG, "register($p1, $p2, ${p3?.contentToString()}, $p4)") + Log.d(TAG, "register($p1, $p2, $p3, $p4)") + callbacks.onRegister(Status.SUCCESS) + } + + override fun register2(callbacks: IPhenotypeCallbacks, p1: String?, p2: Int, p3: Array?, p4: IntArray?, p5: ByteArray?) { + Log.d(TAG, "register2($p1, $p2, $p3, $p4, $p5)") callbacks.onRegister(Status.SUCCESS) } @@ -38,9 +43,5 @@ class PhenotypeServiceImpl : IPhenotypeService.Stub() { }) } - override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean { - if (super.onTransact(code, data, reply, flags)) return true - Log.d(TAG, "onTransact [unknown]: $code, $data, $flags") - return false - } + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/profile/Build.kt b/play-services-core/src/main/kotlin/org/microg/gms/profile/Build.kt new file mode 100644 index 00000000..c13a4d5a --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/profile/Build.kt @@ -0,0 +1,97 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.profile + +import android.annotation.TargetApi +import android.content.Context +import android.os.Build +import kotlin.random.Random + +object Build { + @JvmField + var BOARD: String? = null + + @JvmField + var BOOTLOADER: String? = null + + @JvmField + var BRAND: String? = null + + @JvmField + var CPU_ABI: String? = null + + @JvmField + var CPU_ABI2: String? = null + + @JvmField + @TargetApi(21) + var SUPPORTED_ABIS: Array = emptyArray() + + @JvmField + var DEVICE: String? = null + + @JvmField + var DISPLAY: String? = null + + @JvmField + var FINGERPRINT: String? = null + + @JvmField + var HARDWARE: String? = null + + @JvmField + var HOST: String? = null + + @JvmField + var ID: String? = null + + @JvmField + var MANUFACTURER: String? = null + + @JvmField + var MODEL: String? = null + + @JvmField + var PRODUCT: String? = null + + @JvmField + var RADIO: String? = null + + @JvmField + var SERIAL: String? = null + + @JvmField + var TAGS: String? = null + + @JvmField + var TIME: Long = 0L + + @JvmField + var TYPE: String? = null + + @JvmField + var USER: String? = null + + object VERSION { + @JvmField + var CODENAME: String? = null + + @JvmField + var INCREMENTAL: String? = null + + @JvmField + var RELEASE: String? = null + + @JvmField + var SDK: String? = null + + @JvmField + var SDK_INT: Int = 0 + + @JvmField + var SECURITY_PATCH: String? = null + } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/profile/ProfileManager.kt b/play-services-core/src/main/kotlin/org/microg/gms/profile/ProfileManager.kt new file mode 100644 index 00000000..5a815a04 --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/profile/ProfileManager.kt @@ -0,0 +1,328 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.profile + +import android.annotation.SuppressLint +import android.content.Context +import android.content.res.XmlResourceParser +import android.util.Log +import org.microg.mgms.settings.SettingsContract +import org.microg.mgms.settings.SettingsContract.Profile +import org.microg.gms.utils.FileXmlResourceParser +import org.xmlpull.v1.XmlPullParser +import java.io.File +import java.util.* +import kotlin.random.Random + +object ProfileManager { + private const val TAG = "ProfileManager" + const val PROFILE_REAL = "real" + const val PROFILE_AUTO = "auto" + const val PROFILE_NATIVE = "native" + const val PROFILE_USER = "user" + const val PROFILE_SYSTEM = "system" + + private var activeProfile: String? = null + + private fun getUserProfileFile(context: Context): File = File(context.filesDir, "device_profile.xml") + private fun getSystemProfileFile(): File = File("/system/etc/microg_device_profile.xml") + private fun getProfileResId(context: Context, profile: String) = context.resources.getIdentifier("${context.packageName}:xml/profile_$profile".lowercase(Locale.US), null, null) + + fun getConfiguredProfile(context: Context): String = SettingsContract.getSettings(context, Profile.getContentUri(context), arrayOf(Profile.PROFILE)) { it.getString(0) } ?: PROFILE_AUTO + + fun getAutoProfile(context: Context): String { + if (hasProfile(context, PROFILE_SYSTEM) && isAutoProfile(context, PROFILE_SYSTEM)) return PROFILE_SYSTEM + val profile = "${android.os.Build.PRODUCT}_${android.os.Build.VERSION.SDK_INT}" + if (hasProfile(context, profile) && isAutoProfile(context, profile)) return profile + return PROFILE_NATIVE + } + + fun hasProfile(context: Context, profile: String): Boolean = when (profile) { + PROFILE_AUTO -> hasProfile(context, getAutoProfile(context)) + PROFILE_NATIVE, PROFILE_REAL -> true + PROFILE_USER -> getUserProfileFile(context).exists() + PROFILE_SYSTEM -> getSystemProfileFile().exists() + else -> getProfileResId(context, profile) != 0 + } + + private fun getProfileXml(context: Context, profile: String): XmlResourceParser? = kotlin.runCatching { + when (profile) { + PROFILE_AUTO -> getProfileXml(context, getAutoProfile(context)) + PROFILE_NATIVE, PROFILE_REAL -> null + PROFILE_USER -> FileXmlResourceParser(getUserProfileFile(context)) + PROFILE_SYSTEM -> FileXmlResourceParser(getSystemProfileFile()) + else -> { + val profileResId = getProfileResId(context, profile) + if (profileResId == 0) return@runCatching null + context.resources.getXml(profileResId) + } + } + }.getOrNull() + + fun isAutoProfile(context: Context, profile: String): Boolean = kotlin.runCatching { + when (profile) { + PROFILE_AUTO -> false + PROFILE_REAL -> false + PROFILE_NATIVE -> true + else -> getProfileXml(context, profile)?.use { + var next = it.next() + while (next != XmlPullParser.END_DOCUMENT) { + when (next) { + XmlPullParser.START_TAG -> when (it.name) { + "profile" -> { + return@use it.getAttributeBooleanValue(null, "auto", false) + } + } + } + next = it.next() + } + } == true + } + }.getOrDefault(false) + + private fun getProfileData(context: Context, profile: String, realData: Map): Map { + try { + if (profile in listOf(PROFILE_REAL, PROFILE_NATIVE)) return realData + val profileResId = getProfileResId(context, profile) + if (profileResId == 0) return realData + val resultData = mutableMapOf() + resultData.putAll(realData) + getProfileXml(context, profile)?.use { + var next = it.next() + while (next != XmlPullParser.END_DOCUMENT) { + when (next) { + XmlPullParser.START_TAG -> when (it.name) { + "data" -> { + val key = it.getAttributeValue(null, "key") + val value = it.getAttributeValue(null, "value") + resultData[key] = value + Log.d(TAG, "Overwrite from profile: $key = $value") + } + } + } + next = it.next() + } + } + return resultData + } catch (e: Exception) { + Log.w(TAG, e) + return realData + } + } + + private fun getProfile(context: Context) = getConfiguredProfile(context).let { if (it != PROFILE_AUTO) it else getAutoProfile(context) } + private fun getSerialFromSettings(context: Context): String? = SettingsContract.getSettings(context, Profile.getContentUri(context), arrayOf(Profile.SERIAL)) { it.getString(0) } + private fun saveSerial(context: Context, serial: String) = SettingsContract.setSettings(context, Profile.getContentUri(context)) { put(Profile.SERIAL, serial) } + + private fun randomSerial(template: String, prefixLength: Int = (template.length / 2).coerceAtMost(6)): String { + val serial = StringBuilder() + template.forEachIndexed { index, c -> + serial.append(when { + index < prefixLength -> c + c.isDigit() -> '0' + Random.nextInt(10) + c.isLowerCase() && c <= 'f' -> 'a' + Random.nextInt(6) + c.isLowerCase() -> 'a' + Random.nextInt(26) + c.isUpperCase() && c <= 'F' -> 'A' + Random.nextInt(6) + c.isUpperCase() -> 'A' + Random.nextInt(26) + else -> c + }) + } + return serial.toString() + } + + @SuppressLint("MissingPermission") + private fun getProfileSerialTemplate(context: Context, profile: String): String { + // Native + if (profile in listOf(PROFILE_REAL, PROFILE_NATIVE)) { + var candidate = try { + if (android.os.Build.VERSION.SDK_INT >= 26) { + android.os.Build.getSerial() + } else { + android.os.Build.SERIAL + } + } catch (e: Exception) { + android.os.Build.SERIAL + } + if (candidate != android.os.Build.UNKNOWN) return candidate + } + + // From profile + try { + getProfileXml(context, profile)?.use { + var next = it.next() + while (next != XmlPullParser.END_DOCUMENT) { + when (next) { + XmlPullParser.START_TAG -> when (it.name) { + "serial" -> return it.getAttributeValue(null, "template") + } + } + next = it.next() + } + } + } catch (e: Exception) { + Log.w(TAG, e) + } + + // Fallback + return randomSerial("008741A0B2C4D6E8") + } + + @SuppressLint("MissingPermission") + fun getSerial(context: Context, profile: String = getProfile(context), local: Boolean = false): String { + if (!local) getSerialFromSettings(context)?.let { return it } + val serialTemplate = getProfileSerialTemplate(context, profile) + val serial = when { + profile == PROFILE_REAL && serialTemplate != android.os.Build.UNKNOWN -> serialTemplate + else -> randomSerial(serialTemplate) + } + if (!local) saveSerial(context, serial) + return serial + } + + private fun getRealData(): Map = mutableMapOf( + "Build.BOARD" to android.os.Build.BOARD, + "Build.BOOTLOADER" to android.os.Build.BOOTLOADER, + "Build.BRAND" to android.os.Build.BRAND, + "Build.CPU_ABI" to android.os.Build.CPU_ABI, + "Build.CPU_ABI2" to android.os.Build.CPU_ABI2, + "Build.DEVICE" to android.os.Build.DEVICE, + "Build.DISPLAY" to android.os.Build.DISPLAY, + "Build.FINGERPRINT" to android.os.Build.FINGERPRINT, + "Build.HARDWARE" to android.os.Build.HARDWARE, + "Build.HOST" to android.os.Build.HOST, + "Build.ID" to android.os.Build.ID, + "Build.MANUFACTURER" to android.os.Build.MANUFACTURER, + "Build.MODEL" to android.os.Build.MODEL, + "Build.PRODUCT" to android.os.Build.PRODUCT, + "Build.RADIO" to android.os.Build.RADIO, + "Build.SERIAL" to android.os.Build.SERIAL, + "Build.TAGS" to android.os.Build.TAGS, + "Build.TIME" to android.os.Build.TIME.toString(), + "Build.TYPE" to android.os.Build.TYPE, + "Build.USER" to android.os.Build.USER, + "Build.VERSION.CODENAME" to android.os.Build.VERSION.CODENAME, + "Build.VERSION.INCREMENTAL" to android.os.Build.VERSION.INCREMENTAL, + "Build.VERSION.RELEASE" to android.os.Build.VERSION.RELEASE, + "Build.VERSION.SDK" to android.os.Build.VERSION.SDK, + "Build.VERSION.SDK_INT" to android.os.Build.VERSION.SDK_INT.toString() + ).apply { + if (android.os.Build.VERSION.SDK_INT >= 21) { + put("Build.SUPPORTED_ABIS", android.os.Build.SUPPORTED_ABIS.joinToString(",")) + } + if (android.os.Build.VERSION.SDK_INT >= 23) { + put("Build.VERSION.SECURITY_PATCH", android.os.Build.VERSION.SECURITY_PATCH) + } + } + + private fun applyProfileData(profileData: Map) { + fun applyStringField(key: String, valueSetter: (String) -> Unit) = profileData[key]?.let { valueSetter(it) } + fun applyIntField(key: String, valueSetter: (Int) -> Unit) = profileData[key]?.toIntOrNull()?.let { valueSetter(it) } + fun applyLongField(key: String, valueSetter: (Long) -> Unit) = profileData[key]?.toLongOrNull()?.let { valueSetter(it) } + + applyStringField("Build.BOARD") { Build.BOARD = it } + applyStringField("Build.BOOTLOADER") { Build.BOOTLOADER = it } + applyStringField("Build.BRAND") { Build.BRAND = it } + applyStringField("Build.CPU_ABI") { Build.CPU_ABI = it } + applyStringField("Build.CPU_ABI2") { Build.CPU_ABI2 = it } + applyStringField("Build.DEVICE") { Build.DEVICE = it } + applyStringField("Build.DISPLAY") { Build.DISPLAY = it } + applyStringField("Build.FINGERPRINT") { Build.FINGERPRINT = it } + applyStringField("Build.HARDWARE") { Build.HARDWARE = it } + applyStringField("Build.HOST") { Build.HOST = it } + applyStringField("Build.ID") { Build.ID = it } + applyStringField("Build.MANUFACTURER") { Build.MANUFACTURER = it } + applyStringField("Build.MODEL") { Build.MODEL = it } + applyStringField("Build.PRODUCT") { Build.PRODUCT = it } + applyStringField("Build.RADIO") { Build.RADIO = it } + applyStringField("Build.SERIAL") { Build.SERIAL = it } + applyStringField("Build.TAGS") { Build.TAGS = it } + applyLongField("Build.TIME") { Build.TIME = it } + applyStringField("Build.TYPE") { Build.TYPE = it } + applyStringField("Build.USER") { Build.USER = it } + applyStringField("Build.VERSION.CODENAME") { Build.VERSION.CODENAME = it } + applyStringField("Build.VERSION.INCREMENTAL") { Build.VERSION.INCREMENTAL = it } + applyStringField("Build.VERSION.RELEASE") { Build.VERSION.RELEASE = it } + applyStringField("Build.VERSION.SDK") { Build.VERSION.SDK = it } + applyIntField("Build.VERSION.SDK_INT") { Build.VERSION.SDK_INT = it } + if (android.os.Build.VERSION.SDK_INT >= 21) { + Build.SUPPORTED_ABIS = profileData["Build.SUPPORTED_ABIS"]?.split(",")?.toTypedArray() ?: emptyArray() + } else { + Build.SUPPORTED_ABIS = emptyArray() + } + if (android.os.Build.VERSION.SDK_INT >= 23) { + Build.VERSION.SECURITY_PATCH = profileData["Build.VERSION.SECURITY_PATCH"] + } else { + Build.VERSION.SECURITY_PATCH = null + } + } + + private fun applyProfile(context: Context, profile: String, serial: String = getSerial(context, profile)) { + val profileData = getProfileData(context, profile, getRealData()) + if (Log.isLoggable(TAG, Log.VERBOSE)) { + for ((key, value) in profileData) { + Log.v(TAG, "") + } + } + applyProfileData(profileData) + Build.SERIAL = serial + Log.d(TAG, "Using Serial ${Build.SERIAL}") + activeProfile = profile + } + + fun getProfileName(context: Context, profile: String): String? = getProfileName { getProfileXml(context, profile) } + + private fun getProfileName(parserCreator: () -> XmlResourceParser?): String? = parserCreator()?.use { + var next = it.next() + while (next != XmlPullParser.END_DOCUMENT) { + when (next) { + XmlPullParser.START_TAG -> when (it.name) { + "profile" -> { + return@use it.getAttributeValue(null, "name") + } + } + } + next = it.next() + } + null + } + + fun setProfile(context: Context, profile: String?) { + val changed = getProfile(context) != profile + val newProfile = profile ?: PROFILE_AUTO + val newSerial = if (changed) getSerial(context, newProfile, true) else getSerial(context) + SettingsContract.setSettings(context, Profile.getContentUri(context)) { + put(Profile.PROFILE, newProfile) + if (changed) put(Profile.SERIAL, newSerial) + } + if (changed && activeProfile != null) applyProfile(context, newProfile, newSerial) + } + + fun importUserProfile(context: Context, file: File): Boolean { + val profileName = getProfileName { FileXmlResourceParser(file) } ?: return false + try { + Log.d(TAG, "Importing user profile '$profileName'") + file.copyTo(getUserProfileFile(context)) + if (activeProfile == PROFILE_USER) applyProfile(context, PROFILE_USER) + return true + } catch (e: Exception) { + Log.w(TAG, e) + return false + } + } + + @JvmStatic + fun ensureInitialized(context: Context) { + synchronized(this) { + try { + val profile = getProfile(context) + if (activeProfile == profile) return + applyProfile(context, profile) + } catch (e: Exception) { + Log.w(TAG, e) + } + } + } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt b/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt index 2cb32302..abf92a67 100755 --- a/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/provision/ProvisionService.kt @@ -26,7 +26,7 @@ class ProvisionService : LifecycleService() { super.onStartCommand(intent, flags, startId) lifecycleScope.launchWhenStarted { intent?.extras?.let { - val s = it.keySet().joinToString(", ") { key -> "$key = ${it[key]}" } + val s = it.keySet().map { key -> "$key = ${it[key]}" }.joinToString(", ") Log.d(TAG, "Provisioning: $s") } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/udc/FacsCacheService.kt b/play-services-core/src/main/kotlin/org/microg/gms/udc/FacsCacheService.kt index c12b37bf..c48e0e81 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/udc/FacsCacheService.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/udc/FacsCacheService.kt @@ -5,6 +5,7 @@ package org.microg.gms.udc +import android.os.Parcel import android.util.Log import com.google.android.gms.common.api.Status import com.google.android.gms.common.internal.GetServiceRequest @@ -14,6 +15,7 @@ import com.google.android.gms.facs.cache.internal.IFacsCacheCallbacks import com.google.android.gms.facs.cache.internal.IFacsCacheService import org.microg.gms.BaseService import org.microg.gms.common.GmsService +import org.microg.gms.utils.warnOnTransactionIssues private const val TAG = "GmsFacsCache" @@ -49,4 +51,5 @@ class FacsCacheServiceImpl : IFacsCacheService.Stub() { callbacks.onWriteDeviceLevelSettingsResult(Status.CANCELED) } + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/AppIconPreference.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/AppIconPreference.kt index 97bcca1d..4d53f241 100755 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/AppIconPreference.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/AppIconPreference.kt @@ -6,15 +6,21 @@ package org.microg.gms.ui import android.content.Context +import android.util.AttributeSet import android.util.DisplayMetrics import android.widget.ImageView import androidx.preference.Preference import androidx.preference.PreferenceViewHolder -class AppIconPreference(context: Context) : Preference(context) { - override fun onBindViewHolder(holder: PreferenceViewHolder?) { +class AppIconPreference : Preference { + constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) + constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) + constructor(context: Context) : super(context) + + override fun onBindViewHolder(holder: PreferenceViewHolder) { super.onBindViewHolder(holder) - val icon = holder?.findViewById(android.R.id.icon) + val icon = holder.findViewById(android.R.id.icon) if (icon is ImageView) { icon.adjustViewBounds = true icon.scaleType = ImageView.ScaleType.CENTER_INSIDE diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/Constants.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/Constants.kt index a316804f..f2525b2c 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/Constants.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/Constants.kt @@ -5,4 +5,4 @@ package org.microg.gms.ui -const val TAG = "GmsUi" \ No newline at end of file +const val TAG = "GmsUi" diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationFragment.kt index 232298f8..17887575 100755 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationFragment.kt @@ -31,10 +31,11 @@ class DeviceRegistrationFragment : Fragment(R.layout.device_registration_fragmen } fun setEnabled(newStatus: Boolean) { + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { - val info = getCheckinServiceInfo(requireContext()) + val info = getCheckinServiceInfo(appContext) val newConfiguration = info.configuration.copy(enabled = newStatus) - setCheckinServiceConfiguration(requireContext(), newConfiguration) + setCheckinServiceConfiguration(appContext, newConfiguration) displayServiceInfo(info.copy(configuration = newConfiguration)) } } @@ -46,8 +47,9 @@ class DeviceRegistrationFragment : Fragment(R.layout.device_registration_fragmen override fun onResume() { super.onResume() + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { - displayServiceInfo(getCheckinServiceInfo(requireContext())) + displayServiceInfo(getCheckinServiceInfo(appContext)) } } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt index 9e37b9b7..526a9714 100755 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt @@ -2,35 +2,125 @@ * SPDX-FileCopyrightText: 2020, microG Project Team * SPDX-License-Identifier: Apache-2.0 */ -@file:Suppress("DEPRECATION") package org.microg.gms.ui +import android.net.Uri import android.os.Bundle import android.os.Handler import android.text.format.DateUtils +import android.util.Log +import androidx.activity.result.ActivityResultLauncher +import androidx.activity.result.contract.ActivityResultContracts import androidx.lifecycle.lifecycleScope +import androidx.preference.ListPreference import androidx.preference.Preference import androidx.preference.PreferenceCategory import androidx.preference.PreferenceFragmentCompat import com.mgoogle.android.gms.R import org.microg.gms.checkin.getCheckinServiceInfo +import org.microg.gms.profile.ProfileManager +import org.microg.gms.profile.ProfileManager.PROFILE_AUTO +import org.microg.gms.profile.ProfileManager.PROFILE_NATIVE +import org.microg.gms.profile.ProfileManager.PROFILE_REAL +import org.microg.gms.profile.ProfileManager.PROFILE_SYSTEM +import org.microg.gms.profile.ProfileManager.PROFILE_USER +import java.io.File +import java.io.FileOutputStream class DeviceRegistrationPreferencesFragment : PreferenceFragmentCompat() { + private lateinit var deviceProfile: ListPreference + private lateinit var importProfile: Preference + private lateinit var serial: Preference private lateinit var statusCategory: PreferenceCategory private lateinit var status: Preference private lateinit var androidId: Preference private val handler = Handler() private val updateRunnable = Runnable { updateStatus() } + private lateinit var profileFileImport: ActivityResultLauncher + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + profileFileImport = registerForActivityResult(ActivityResultContracts.GetContent(), this::onFileSelected) + } + + private fun onFileSelected(uri: Uri?) { + if (uri == null) return + try { + val context = requireContext() + val file = File.createTempFile("profile_", ".xml", context.cacheDir) + context.contentResolver.openInputStream(uri)?.use { inputStream -> + FileOutputStream(file).use { inputStream.copyTo(it) } + } + val success = ProfileManager.importUserProfile(context, file) + file.delete() + if (success && ProfileManager.isAutoProfile(context, PROFILE_USER)) { + ProfileManager.setProfile(context, PROFILE_USER) + } + updateStatus() + } catch (e: Exception) { + Log.w(TAG, e) + } + } override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { addPreferencesFromResource(R.xml.preferences_device_registration) } override fun onBindPreferences() { + deviceProfile = preferenceScreen.findPreference("pref_device_profile") ?: deviceProfile + importProfile = preferenceScreen.findPreference("pref_device_profile_import") ?: importProfile + serial = preferenceScreen.findPreference("pref_device_serial") ?: serial statusCategory = preferenceScreen.findPreference("prefcat_device_registration_status") ?: statusCategory status = preferenceScreen.findPreference("pref_device_registration_status") ?: status androidId = preferenceScreen.findPreference("pref_device_registration_android_id") ?: androidId + + deviceProfile.setOnPreferenceChangeListener { _, newValue -> + ProfileManager.setProfile(requireContext(), newValue as String? ?: PROFILE_AUTO) + updateStatus() + true + } + importProfile.setOnPreferenceClickListener { + profileFileImport.launch("text/xml") + true + } + } + + private fun configureProfilePreference() { + val context = requireContext() + val configuredProfile = ProfileManager.getConfiguredProfile(context) + val autoProfile = ProfileManager.getAutoProfile(context) + val autoProfileName = when (autoProfile) { + PROFILE_NATIVE -> getString(R.string.profile_name_native) + PROFILE_REAL -> getString(R.string.profile_name_real) + else -> ProfileManager.getProfileName(context, autoProfile) + } + val profiles = + mutableListOf(PROFILE_AUTO, PROFILE_NATIVE, PROFILE_REAL) + val profileNames = mutableListOf(getString(R.string.profile_name_auto, autoProfileName), getString(R.string.profile_name_native), getString(R.string.profile_name_real)) + if (ProfileManager.hasProfile(context, PROFILE_SYSTEM)) { + profiles.add(PROFILE_SYSTEM) + profileNames.add(getString(R.string.profile_name_system, ProfileManager.getProfileName(context, PROFILE_SYSTEM))) + } + if (ProfileManager.hasProfile(context, PROFILE_USER)) { + profiles.add(PROFILE_USER) + profileNames.add(getString(R.string.profile_name_user, ProfileManager.getProfileName(context, PROFILE_USER))) + } + for (profile in R.xml::class.java.declaredFields.map { it.name } + .filter { it.startsWith("profile_") } + .map { it.substring(8) } + .sorted()) { + val profileName = ProfileManager.getProfileName(context, profile) + if (profileName != null) { + profiles.add(profile) + profileNames.add(profileName) + } + } + deviceProfile.entryValues = profiles.toTypedArray() + deviceProfile.entries = profileNames.toTypedArray() + deviceProfile.value = configuredProfile + deviceProfile.summary = + profiles.indexOf(configuredProfile).takeIf { it >= 0 }?.let { profileNames[it] } ?: "Unknown" } override fun onResume() { @@ -44,12 +134,19 @@ class DeviceRegistrationPreferencesFragment : PreferenceFragmentCompat() { } private fun updateStatus() { + handler.removeCallbacks(updateRunnable) handler.postDelayed(updateRunnable, UPDATE_INTERVAL) + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { - val serviceInfo = getCheckinServiceInfo(requireContext()) + configureProfilePreference() + serial.summary = ProfileManager.getSerial(appContext) + val serviceInfo = getCheckinServiceInfo(appContext) statusCategory.isVisible = serviceInfo.configuration.enabled if (serviceInfo.lastCheckin > 0) { - status.summary = getString(R.string.checkin_last_registration, DateUtils.getRelativeTimeSpanString(serviceInfo.lastCheckin, System.currentTimeMillis(), 0)) + status.summary = getString( + R.string.checkin_last_registration, + DateUtils.getRelativeTimeSpanString(serviceInfo.lastCheckin, System.currentTimeMillis(), 0) + ) androidId.isVisible = true androidId.summary = serviceInfo.androidId.toString(16) } else { diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAdvancedFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAdvancedFragment.kt index 5c300d98..50bc9012 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAdvancedFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAdvancedFragment.kt @@ -30,36 +30,40 @@ class PushNotificationAdvancedFragment : PreferenceFragmentCompat() { networkOther = preferenceScreen.findPreference(GcmPrefs.PREF_NETWORK_OTHER) ?: networkOther networkMobile.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue -> + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { (newValue as? String)?.toIntOrNull()?.let { - setGcmServiceConfiguration(requireContext(), getGcmServiceInfo(requireContext()).configuration.copy(mobile = it)) + setGcmServiceConfiguration(requireContext(), getGcmServiceInfo(appContext).configuration.copy(mobile = it)) } updateContent() } true } networkWifi.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue -> + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { (newValue as? String)?.toIntOrNull()?.let { - setGcmServiceConfiguration(requireContext(), getGcmServiceInfo(requireContext()).configuration.copy(wifi = it)) + setGcmServiceConfiguration(appContext, getGcmServiceInfo(requireContext()).configuration.copy(wifi = it)) } updateContent() } true } networkRoaming.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue -> + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { (newValue as? String)?.toIntOrNull()?.let { - setGcmServiceConfiguration(requireContext(), getGcmServiceInfo(requireContext()).configuration.copy(roaming = it)) + setGcmServiceConfiguration(appContext, getGcmServiceInfo(requireContext()).configuration.copy(roaming = it)) } updateContent() } true } networkOther.onPreferenceChangeListener = Preference.OnPreferenceChangeListener { _, newValue -> + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { (newValue as? String)?.toIntOrNull()?.let { - setGcmServiceConfiguration(requireContext(), getGcmServiceInfo(requireContext()).configuration.copy(other = it)) + setGcmServiceConfiguration(appContext, getGcmServiceInfo(requireContext()).configuration.copy(other = it)) } updateContent() } @@ -73,8 +77,9 @@ class PushNotificationAdvancedFragment : PreferenceFragmentCompat() { } private fun updateContent() { + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { - val serviceInfo = getGcmServiceInfo(requireContext()) + val serviceInfo = getGcmServiceInfo(appContext) networkMobile.value = serviceInfo.configuration.mobile.toString() networkMobile.summary = getSummaryString(serviceInfo.configuration.mobile, serviceInfo.learntMobileInterval) networkWifi.value = serviceInfo.configuration.wifi.toString() diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAllAppsFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAllAppsFragment.kt index c202444d..da3210e4 100755 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAllAppsFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAllAppsFragment.kt @@ -52,8 +52,8 @@ class PushNotificationAllAppsFragment : PreferenceFragmentCompat() { } private fun updateContent() { + val context = requireContext() lifecycleScope.launchWhenResumed { - val context = requireContext() val apps = withContext(Dispatchers.IO) { val res = database.appList.map { app -> app to context.packageManager.getApplicationInfoIfExists(app.packageName) @@ -75,7 +75,7 @@ class PushNotificationAllAppsFragment : PreferenceFragmentCompat() { pref.key = "pref_push_app_" + app.packageName pref to (database.getRegistrationsByApp(app.packageName)) }.sortedBy { - it.first.title.toString().toLowerCase() + it.first.title.toString().lowercase() }.mapIndexed { idx, pair -> pair.first.order = idx pair diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppFragment.kt index 567bfe28..f83a5e5d 100755 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationAppFragment.kt @@ -46,12 +46,13 @@ class PushNotificationAppFragment : Fragment(R.layout.push_notification_fragment override fun onResume() { super.onResume() + val context = requireContext() lifecycleScope.launchWhenResumed { - val pm = requireContext().packageManager + val pm = context.packageManager val applicationInfo = pm.getApplicationInfoIfExists(packageName) binding.appName = applicationInfo?.loadLabel(pm)?.toString() ?: packageName binding.appIcon = applicationInfo?.loadIcon(pm) - ?: AppCompatResources.getDrawable(requireContext(), android.R.mipmap.sym_def_app_icon) + ?: AppCompatResources.getDrawable(context, android.R.mipmap.sym_def_app_icon) } } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationFragment.kt index 773578fa..8c906e03 100755 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/PushNotificationFragment.kt @@ -31,10 +31,11 @@ class PushNotificationFragment : Fragment(R.layout.push_notification_fragment) { } fun setEnabled(newStatus: Boolean) { + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { - val info = getGcmServiceInfo(requireContext()) + val info = getGcmServiceInfo(appContext) val newConfiguration = info.configuration.copy(enabled = newStatus) - setGcmServiceConfiguration(requireContext(), newConfiguration) + setGcmServiceConfiguration(appContext, newConfiguration) displayServiceInfo(info.copy(configuration = newConfiguration)) } } @@ -45,9 +46,10 @@ class PushNotificationFragment : Fragment(R.layout.push_notification_fragment) { override fun onResume() { super.onResume() + val appContext = requireContext().applicationContext lifecycleScope.launchWhenResumed { - displayServiceInfo(getGcmServiceInfo(requireContext())) - binding.checkinEnabled = getCheckinServiceInfo(requireContext()).configuration.enabled + displayServiceInfo(getGcmServiceInfo(appContext)) + binding.checkinEnabled = getCheckinServiceInfo(appContext).configuration.enabled } } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt index 92b0d0ed..317e83e1 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/SettingsFragment.kt @@ -6,8 +6,8 @@ package org.microg.gms.ui import android.content.ComponentName +import android.content.Context import android.content.pm.PackageManager -import android.content.Intent import android.os.Bundle import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController @@ -16,11 +16,9 @@ import androidx.preference.SwitchPreferenceCompat import com.google.android.gms.cast.media.CastMediaRouteProviderService import com.mgoogle.android.gms.R import org.microg.gms.checkin.CheckinClient -import org.microg.gms.checkin.getCheckinServiceInfo +import org.microg.gms.checkin.CheckinPrefs import org.microg.gms.gcm.GcmDatabase -import org.microg.gms.gcm.McsConstants.ACTION_RECONNECT import org.microg.gms.gcm.McsService -import org.microg.gms.gcm.TriggerReceiver import org.microg.gms.gcm.getGcmServiceInfo import org.microg.mgms.settings.SettingsContract import org.microg.tools.ui.ResourceSettingsFragment @@ -72,28 +70,24 @@ class SettingsFragment : ResourceSettingsFragment() { override fun onResume() { super.onResume() + val context = requireContext() lifecycleScope.launchWhenResumed { - updateDetails() + updateDetails(context) } } - private suspend fun updateDetails() { - val context = requireContext() + private suspend fun updateDetails(context: Context) { val gcmServiceInfo = getGcmServiceInfo(context) if (gcmServiceInfo.configuration.enabled) { val database = GcmDatabase(context) val regCount = database.registrationList.size - // check if we are connected as we should be and re-connect if not - if (!gcmServiceInfo.connected) { - context.sendBroadcast(Intent(ACTION_RECONNECT, null, context, TriggerReceiver::class.java)) - } database.close() findPreference(PREF_GCM)?.setSummary(context.getResources().getString(R.string.service_status_enabled_short) + " - " + resources.getQuantityString(R.plurals.gcm_registered_apps_counter, regCount, regCount)) } else { findPreference(PREF_GCM)?.setSummary(R.string.service_status_disabled_short) } - findPreference(PREF_CHECKIN)?.setSummary(if (getCheckinServiceInfo(context).configuration.enabled) R.string.service_status_enabled_short else R.string.service_status_disabled_short) + findPreference(PREF_CHECKIN)?.setSummary(if (CheckinPrefs.isEnabled(context)) R.string.service_status_enabled_short else R.string.service_status_disabled_short) } companion object { diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/TextPreference.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/TextPreference.kt new file mode 100644 index 00000000..4bb9123a --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/TextPreference.kt @@ -0,0 +1,35 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.ui + +import android.content.Context +import android.util.AttributeSet +import android.util.TypedValue +import android.view.Gravity +import android.view.ViewGroup.LayoutParams.MATCH_PARENT +import android.widget.LinearLayout +import android.widget.TextView +import androidx.preference.Preference +import androidx.preference.PreferenceViewHolder + +class TextPreference : Preference { + constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) + constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) + constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) + constructor(context: Context) : super(context) + + + override fun onBindViewHolder(holder: PreferenceViewHolder?) { + super.onBindViewHolder(holder) + val iconFrame = holder?.findViewById(androidx.preference.R.id.icon_frame) + iconFrame?.layoutParams?.height = MATCH_PARENT + (iconFrame as? LinearLayout)?.gravity = Gravity.TOP or Gravity.START + val pad = (context.resources.displayMetrics.densityDpi/160f * 20).toInt() + iconFrame?.setPadding(0, pad, 0, pad) + val textView = holder?.findViewById(android.R.id.summary) as? TextView + textView?.maxLines = Int.MAX_VALUE + } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/Utils.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/Utils.kt index 5cfd2bfa..ca5e64a7 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/Utils.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/Utils.kt @@ -13,8 +13,14 @@ import android.os.Build import android.os.Bundle import android.provider.Settings import android.util.Log +import android.util.TypedValue +import android.view.View +import androidx.annotation.AttrRes +import androidx.annotation.ColorInt import androidx.annotation.IdRes import androidx.annotation.RequiresApi +import androidx.core.content.ContextCompat +import androidx.databinding.BindingAdapter import androidx.navigation.NavController import androidx.navigation.navOptions import androidx.navigation.ui.R @@ -42,20 +48,37 @@ fun NavController.navigate(context: Context, @IdRes resId: Int, args: Bundle? = @RequiresApi(Build.VERSION_CODES.M) fun Context.hideIcon(hide: Boolean) { packageManager.setComponentEnabledSetting( - ComponentName.createRelative(this, "org.microg.gms.ui.SettingsActivityLauncher"), - when (hide) { - true -> PackageManager.COMPONENT_ENABLED_STATE_DISABLED - false -> PackageManager.COMPONENT_ENABLED_STATE_ENABLED - }, - PackageManager.DONT_KILL_APP + ComponentName.createRelative(this, "org.microg.gms.ui.SettingsActivityLauncher"), + when (hide) { + true -> PackageManager.COMPONENT_ENABLED_STATE_DISABLED + false -> PackageManager.COMPONENT_ENABLED_STATE_ENABLED + }, + PackageManager.DONT_KILL_APP ) } val Context.systemAnimationsEnabled: Boolean get() { - - val duration: Float = Settings.Global.getFloat(contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE, 1f) - val transition: Float = Settings.Global.getFloat(contentResolver, Settings.Global.TRANSITION_ANIMATION_SCALE, 1f) - + val duration: Float + val transition: Float + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + duration = Settings.Global.getFloat(contentResolver, Settings.Global.ANIMATOR_DURATION_SCALE, 1f) + transition = Settings.Global.getFloat(contentResolver, Settings.Global.TRANSITION_ANIMATION_SCALE, 1f) + } else { + duration = Settings.System.getFloat(contentResolver, Settings.System.ANIMATOR_DURATION_SCALE, 1f) + transition = Settings.System.getFloat(contentResolver, Settings.System.TRANSITION_ANIMATION_SCALE, 1f) + } return duration != 0f && transition != 0f - } \ No newline at end of file + } + + +@ColorInt +fun Context.resolveColor(@AttrRes resid: Int): Int? { + val typedValue = TypedValue() + if (!theme.resolveAttribute(resid, typedValue, true)) return null + val colorRes = if (typedValue.resourceId != 0) typedValue.resourceId else typedValue.data + return ContextCompat.getColor(this, colorRes) +} + +@BindingAdapter("app:backgroundColorAttr") +fun View.setBackgroundColorAttribute(@AttrRes resId: Int) = context.resolveColor(resId)?.let { setBackgroundColor(it) } diff --git a/play-services-core/src/main/kotlin/org/microg/gms/usagereporting/UsageReportingService.kt b/play-services-core/src/main/kotlin/org/microg/gms/usagereporting/UsageReportingService.kt new file mode 100644 index 00000000..86831b2e --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/usagereporting/UsageReportingService.kt @@ -0,0 +1,53 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.usagereporting + +import android.os.Bundle +import android.os.Parcel +import android.util.Log +import com.google.android.gms.common.api.CommonStatusCodes +import com.google.android.gms.common.api.Status +import com.google.android.gms.common.internal.GetServiceRequest +import com.google.android.gms.common.internal.IGmsCallbacks +import com.google.android.gms.usagereporting.UsageReportingOptInOptions +import com.google.android.gms.usagereporting.internal.IUsageReportingCallbacks +import com.google.android.gms.usagereporting.internal.IUsageReportingOptInOptionsChangedListener +import com.google.android.gms.usagereporting.internal.IUsageReportingService +import org.microg.gms.BaseService +import org.microg.gms.common.GmsService +import org.microg.gms.utils.warnOnTransactionIssues + +private const val TAG = "UsageReportingService" + +class UsageReportingService : BaseService(TAG, GmsService.USAGE_REPORTING) { + override fun handleServiceRequest(callback: IGmsCallbacks, request: GetServiceRequest, service: GmsService) { + callback.onPostInitComplete(CommonStatusCodes.SUCCESS, UsageReportingServiceImpl(), Bundle()) + } +} + +class UsageReportingServiceImpl : IUsageReportingService.Stub() { + override fun getOptInOptions(callbacks: IUsageReportingCallbacks) { + // Don't log to prevent log spam + callbacks.onOptInOptions(Status.SUCCESS, UsageReportingOptInOptions().apply { optInUsageReporting = 2 }) + } + + override fun setOptInOptions(options: UsageReportingOptInOptions, callbacks: IUsageReportingCallbacks) { + Log.d(TAG, "setOptInOptions($options)") + callbacks.onOptInOptionsSet(Status.SUCCESS) + } + + override fun addOptInOptionsChangedListener(listener: IUsageReportingOptInOptionsChangedListener, callbacks: IUsageReportingCallbacks) { + Log.d(TAG, "addOptInOptionsChangedListener($listener)") + callbacks.onOptInOptionsChangedListenerAdded(Status.SUCCESS) + } + + override fun removeOptInOptionsChangedListener(listener: IUsageReportingOptInOptionsChangedListener, callbacks: IUsageReportingCallbacks) { + Log.d(TAG, "removeOptInOptionsChangedListener($listener)") + callbacks.onOptInOptionsChangedListenerRemoved(Status.SUCCESS) + } + + override fun onTransact(code: Int, data: Parcel, reply: Parcel?, flags: Int): Boolean = warnOnTransactionIssues(code, reply, flags) { super.onTransact(code, data, reply, flags) } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/utils/BinderUtils.kt b/play-services-core/src/main/kotlin/org/microg/gms/utils/BinderUtils.kt index 56a9737e..79e8ff8f 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/utils/BinderUtils.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/utils/BinderUtils.kt @@ -6,16 +6,19 @@ package org.microg.gms.utils import android.os.Binder +import android.os.IBinder import android.os.Parcel import android.util.Log -fun warnOnTransactionIssues(tag: String, code: Int, reply: Parcel?, flags: Int, base: () -> Boolean): Boolean { +private const val TAG = "BinderUtils" + +fun IBinder.warnOnTransactionIssues(code: Int, reply: Parcel?, flags: Int, base: () -> Boolean): Boolean { if (base.invoke()) { if ((flags and Binder.FLAG_ONEWAY) > 0 && (reply?.dataSize() ?: 0) > 0) { - Log.w(tag, "onTransact[$code] is oneway, but returned data") + Log.w(TAG, "Method $code in $interfaceDescriptor is oneway, but returned data") } return true } - Log.w(tag, "onTransact[$code] is not processed.") + Log.w(TAG, "Unknown method $code in $interfaceDescriptor, skipping") return (flags and Binder.FLAG_ONEWAY) > 0 // Don't return false on oneway transaction to suppress warning -} \ No newline at end of file +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/utils/FileXmlResourceParser.kt b/play-services-core/src/main/kotlin/org/microg/gms/utils/FileXmlResourceParser.kt new file mode 100644 index 00000000..689d0f46 --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/utils/FileXmlResourceParser.kt @@ -0,0 +1,127 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.utils + +import android.content.res.XmlResourceParser +import android.util.Xml +import org.xmlpull.v1.XmlPullParser +import java.io.Closeable +import java.io.File +import java.io.FileReader +import java.io.Reader + +class FileXmlResourceParser(private val reader: Reader, private val parser: XmlPullParser = Xml.newPullParser()) : + XmlResourceParser, + XmlPullParser by parser, + Closeable by reader { + constructor(file: File) : this(FileReader(file)) + + init { + parser.setInput(reader) + } + + override fun getAttributeNameResource(index: Int): Int { + return 0 + } + + override fun getAttributeListValue( + namespace: String?, attribute: String?, + options: Array?, defaultValue: Int + ): Int { + val s = getAttributeValue(namespace, attribute) + return s?.toInt() ?: defaultValue + } + + override fun getAttributeBooleanValue( + namespace: String?, attribute: String?, + defaultValue: Boolean + ): Boolean { + + val s = getAttributeValue(namespace, attribute) + return s?.toBooleanStrictOrNull() ?: defaultValue + } + + override fun getAttributeResourceValue( + namespace: String?, attribute: String?, + defaultValue: Int + ): Int { + val s = getAttributeValue(namespace, attribute) + return s?.toInt() ?: defaultValue + } + + override fun getAttributeIntValue( + namespace: String?, attribute: String?, + defaultValue: Int + ): Int { + val s = getAttributeValue(namespace, attribute) + return s?.toInt() ?: defaultValue + } + + override fun getAttributeUnsignedIntValue( + namespace: String?, attribute: String?, + defaultValue: Int + ): Int { + val s = getAttributeValue(namespace, attribute) + return s?.toInt() ?: defaultValue + } + + override fun getAttributeFloatValue( + namespace: String?, attribute: String?, + defaultValue: Float + ): Float { + val s = getAttributeValue(namespace, attribute) + return s?.toFloat() ?: defaultValue + } + + override fun getAttributeListValue( + index: Int, + options: Array?, defaultValue: Int + ): Int { + val s = getAttributeValue(index) + return s?.toInt() ?: defaultValue + } + + override fun getAttributeBooleanValue(index: Int, defaultValue: Boolean): Boolean { + val s = getAttributeValue(index) + return s?.toBooleanStrictOrNull() ?: defaultValue + } + + override fun getAttributeResourceValue(index: Int, defaultValue: Int): Int { + val s = getAttributeValue(index) + return s?.toInt() ?: defaultValue + } + + override fun getAttributeIntValue(index: Int, defaultValue: Int): Int { + val s = getAttributeValue(index) + return s?.toInt() ?: defaultValue + } + + override fun getAttributeUnsignedIntValue(index: Int, defaultValue: Int): Int { + val s = getAttributeValue(index) + return s?.toInt() ?: defaultValue + } + + override fun getAttributeFloatValue(index: Int, defaultValue: Float): Float { + val s = getAttributeValue(index) + return s?.toFloat() ?: defaultValue + } + + override fun getIdAttribute(): String? { + return getAttributeValue(null, "id") + } + + override fun getClassAttribute(): String? { + return getAttributeValue(null, "class") + } + + override fun getIdAttributeResourceValue(defaultValue: Int): Int { + return getAttributeResourceValue(null, "id", defaultValue) + } + + override fun getStyleAttribute(): Int { + return getAttributeResourceValue(null, "style", 0) + } +} diff --git a/play-services-core/src/main/kotlin/org/microg/gms/utils/PackageManagerWrapper.kt b/play-services-core/src/main/kotlin/org/microg/gms/utils/PackageManagerWrapper.kt new file mode 100644 index 00000000..58e87c43 --- /dev/null +++ b/play-services-core/src/main/kotlin/org/microg/gms/utils/PackageManagerWrapper.kt @@ -0,0 +1,529 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ +package org.microg.gms.utils + +import android.annotation.TargetApi +import android.content.ComponentName +import android.content.Intent +import android.content.IntentFilter +import android.content.pm.* +import android.content.res.Resources +import android.content.res.XmlResourceParser +import android.graphics.Rect +import android.graphics.drawable.Drawable +import android.os.Bundle +import android.os.UserHandle +import androidx.annotation.RequiresApi + +open class PackageManagerWrapper(private val wrapped: PackageManager) : PackageManager() { + override fun getPackageInfo(packageName: String, flags: Int): PackageInfo { + return wrapped.getPackageInfo(packageName, flags) + } + + @TargetApi(26) + override fun getPackageInfo(versionedPackage: VersionedPackage, flags: Int): PackageInfo { + return wrapped.getPackageInfo(versionedPackage, flags) + } + + override fun currentToCanonicalPackageNames(packageNames: Array): Array { + return wrapped.currentToCanonicalPackageNames(packageNames) + } + + override fun canonicalToCurrentPackageNames(packageNames: Array): Array { + return wrapped.canonicalToCurrentPackageNames(packageNames) + } + + override fun getLaunchIntentForPackage(packageName: String): Intent? { + return wrapped.getLaunchIntentForPackage(packageName) + } + + @TargetApi(21) + override fun getLeanbackLaunchIntentForPackage(packageName: String): Intent? { + return wrapped.getLeanbackLaunchIntentForPackage(packageName) + } + + override fun getPackageGids(packageName: String): IntArray { + return wrapped.getPackageGids(packageName) + } + + @TargetApi(24) + override fun getPackageGids(packageName: String, flags: Int): IntArray { + return wrapped.getPackageGids(packageName, flags) + } + + @TargetApi(24) + override fun getPackageUid(packageName: String, flags: Int): Int { + return wrapped.getPackageUid(packageName, flags) + } + + override fun getPermissionInfo(permName: String, flags: Int): PermissionInfo { + return wrapped.getPermissionInfo(permName, flags) + } + + override fun queryPermissionsByGroup(permissionGroup: String?, flags: Int): MutableList { + return wrapped.queryPermissionsByGroup(permissionGroup, flags) + } + + override fun getPermissionGroupInfo(permName: String, flags: Int): PermissionGroupInfo { + return wrapped.getPermissionGroupInfo(permName, flags) + } + + override fun getAllPermissionGroups(flags: Int): MutableList { + return wrapped.getAllPermissionGroups(flags) + } + + override fun getApplicationInfo(packageName: String, flags: Int): ApplicationInfo { + return wrapped.getApplicationInfo(packageName, flags) + } + + override fun getActivityInfo(component: ComponentName, flags: Int): ActivityInfo { + return wrapped.getActivityInfo(component, flags) + } + + override fun getReceiverInfo(component: ComponentName, flags: Int): ActivityInfo { + return wrapped.getReceiverInfo(component, flags) + } + + override fun getServiceInfo(component: ComponentName, flags: Int): ServiceInfo { + return wrapped.getServiceInfo(component, flags) + } + + override fun getProviderInfo(component: ComponentName, flags: Int): ProviderInfo { + return wrapped.getProviderInfo(component, flags) + } + + @RequiresApi(29) + override fun getInstalledModules(flags: Int): MutableList { + return wrapped.getInstalledModules(flags) + } + + override fun getInstalledPackages(flags: Int): MutableList { + return wrapped.getInstalledPackages(flags) + } + + @TargetApi(18) + override fun getPackagesHoldingPermissions(permissions: Array, flags: Int): MutableList { + return wrapped.getPackagesHoldingPermissions(permissions, flags) + } + + override fun checkPermission(permName: String, packageName: String): Int { + return wrapped.checkPermission(permName, packageName) + } + + @TargetApi(23) + override fun isPermissionRevokedByPolicy(permName: String, packageName: String): Boolean { + return wrapped.isPermissionRevokedByPolicy(permName, packageName) + } + + override fun addPermission(info: PermissionInfo): Boolean { + return wrapped.addPermission(info) + } + + override fun addPermissionAsync(info: PermissionInfo): Boolean { + return wrapped.addPermissionAsync(info) + } + + override fun removePermission(permName: String) { + return wrapped.removePermission(permName) + } + + override fun checkSignatures(packageName1: String, packageName2: String): Int { + return wrapped.checkSignatures(packageName1, packageName2) + } + + override fun checkSignatures(uid1: Int, uid2: Int): Int { + return wrapped.checkSignatures(uid1, uid2) + } + + override fun getPackagesForUid(uid: Int): Array? { + return wrapped.getPackagesForUid(uid) + } + + override fun getNameForUid(uid: Int): String? { + return wrapped.getNameForUid(uid) + } + + override fun getInstalledApplications(flags: Int): MutableList { + return wrapped.getInstalledApplications(flags) + } + + @TargetApi(26) + override fun isInstantApp(): Boolean { + return wrapped.isInstantApp + } + + @TargetApi(26) + override fun isInstantApp(packageName: String): Boolean { + return wrapped.isInstantApp(packageName) + } + + @TargetApi(26) + override fun getInstantAppCookieMaxBytes(): Int { + return wrapped.instantAppCookieMaxBytes + } + + @TargetApi(26) + override fun getInstantAppCookie(): ByteArray { + return wrapped.instantAppCookie + } + + @TargetApi(26) + override fun clearInstantAppCookie() { + return wrapped.clearInstantAppCookie() + } + + @TargetApi(26) + override fun updateInstantAppCookie(cookie: ByteArray?) { + return wrapped.updateInstantAppCookie(cookie) + } + + @TargetApi(26) + override fun getSystemSharedLibraryNames(): Array? { + return wrapped.systemSharedLibraryNames + } + + @TargetApi(26) + override fun getSharedLibraries(flags: Int): MutableList { + return wrapped.getSharedLibraries(flags) + } + + @TargetApi(26) + override fun getChangedPackages(sequenceNumber: Int): ChangedPackages? { + return wrapped.getChangedPackages(sequenceNumber) + } + + override fun getSystemAvailableFeatures(): Array { + return wrapped.systemAvailableFeatures + } + + override fun hasSystemFeature(featureName: String): Boolean { + return wrapped.hasSystemFeature(featureName) + } + + @TargetApi(24) + override fun hasSystemFeature(featureName: String, version: Int): Boolean { + return wrapped.hasSystemFeature(featureName, version) + } + + override fun resolveActivity(intent: Intent, flags: Int): ResolveInfo? { + return wrapped.resolveActivity(intent, flags) + } + + override fun queryIntentActivities(intent: Intent, flags: Int): MutableList { + return wrapped.queryIntentActivities(intent, flags) + } + + override fun queryIntentActivityOptions(caller: ComponentName?, specifics: Array?, intent: Intent, flags: Int): MutableList { + return wrapped.queryIntentActivityOptions(caller, specifics, intent, flags) + } + + override fun queryBroadcastReceivers(intent: Intent, flags: Int): MutableList { + return wrapped.queryBroadcastReceivers(intent, flags) + } + + override fun resolveService(intent: Intent, flags: Int): ResolveInfo? { + return wrapped.resolveService(intent, flags) + } + + override fun queryIntentServices(intent: Intent, flags: Int): MutableList { + return wrapped.queryIntentServices(intent, flags) + } + + @TargetApi(19) + override fun queryIntentContentProviders(intent: Intent, flags: Int): MutableList { + return wrapped.queryIntentContentProviders(intent, flags) + } + + override fun resolveContentProvider(authority: String, flags: Int): ProviderInfo? { + return wrapped.resolveContentProvider(authority, flags) + } + + override fun queryContentProviders(processName: String?, uid: Int, flags: Int): MutableList { + return wrapped.queryContentProviders(processName, uid, flags) + } + + override fun getInstrumentationInfo(className: ComponentName, flags: Int): InstrumentationInfo { + return wrapped.getInstrumentationInfo(className, flags) + } + + override fun queryInstrumentation(targetPackage: String, flags: Int): MutableList { + return wrapped.queryInstrumentation(targetPackage, flags) + } + + override fun getDrawable(packageName: String, resid: Int, appInfo: ApplicationInfo?): Drawable? { + return wrapped.getDrawable(packageName, resid, appInfo) + } + + override fun getActivityIcon(activityName: ComponentName): Drawable { + return wrapped.getActivityIcon(activityName) + } + + override fun getActivityIcon(intent: Intent): Drawable { + return wrapped.getActivityIcon(intent) + } + + @TargetApi(20) + override fun getActivityBanner(activityName: ComponentName): Drawable? { + return wrapped.getActivityBanner(activityName) + } + + @TargetApi(20) + override fun getActivityBanner(intent: Intent): Drawable? { + return wrapped.getActivityBanner(intent) + } + + override fun getDefaultActivityIcon(): Drawable { + return wrapped.defaultActivityIcon + } + + override fun getApplicationIcon(info: ApplicationInfo): Drawable { + return wrapped.getApplicationIcon(info) + } + + override fun getApplicationIcon(packageName: String): Drawable { + return wrapped.getApplicationIcon(packageName) + } + + @TargetApi(20) + override fun getApplicationBanner(info: ApplicationInfo): Drawable? { + return wrapped.getApplicationBanner(info) + } + + @TargetApi(20) + override fun getApplicationBanner(packageName: String): Drawable? { + return wrapped.getApplicationBanner(packageName) + } + + override fun getActivityLogo(activityName: ComponentName): Drawable? { + return wrapped.getActivityLogo(activityName) + } + + override fun getActivityLogo(intent: Intent): Drawable? { + return wrapped.getActivityLogo(intent) + } + + override fun getApplicationLogo(info: ApplicationInfo): Drawable? { + return wrapped.getApplicationLogo(info) + } + + override fun getApplicationLogo(packageName: String): Drawable? { + return wrapped.getApplicationLogo(packageName) + } + + @TargetApi(21) + override fun getUserBadgedIcon(drawable: Drawable, user: UserHandle): Drawable { + return wrapped.getUserBadgedIcon(drawable, user) + } + + @TargetApi(21) + override fun getUserBadgedDrawableForDensity(drawable: Drawable, user: UserHandle, badgeLocation: Rect?, badgeDensity: Int): Drawable { + return wrapped.getUserBadgedDrawableForDensity(drawable, user, badgeLocation, badgeDensity) + } + + @TargetApi(21) + override fun getUserBadgedLabel(label: CharSequence, user: UserHandle): CharSequence { + return wrapped.getUserBadgedLabel(label, user) + } + + override fun getText(packageName: String, resid: Int, appInfo: ApplicationInfo?): CharSequence? { + return wrapped.getText(packageName, resid, appInfo) + } + + override fun getXml(packageName: String, resid: Int, appInfo: ApplicationInfo?): XmlResourceParser? { + return wrapped.getXml(packageName, resid, appInfo) + } + + override fun getApplicationLabel(info: ApplicationInfo): CharSequence { + return wrapped.getApplicationLabel(info) + } + + override fun getResourcesForActivity(activityName: ComponentName): Resources { + return wrapped.getResourcesForActivity(activityName) + } + + override fun getResourcesForApplication(app: ApplicationInfo): Resources { + return wrapped.getResourcesForApplication(app) + } + + override fun getResourcesForApplication(packageName: String): Resources { + return wrapped.getResourcesForApplication(packageName) + } + + override fun verifyPendingInstall(id: Int, verificationCode: Int) { + return wrapped.verifyPendingInstall(id, verificationCode) + } + + @TargetApi(17) + override fun extendVerificationTimeout(id: Int, verificationCodeAtTimeout: Int, millisecondsToDelay: Long) { + return wrapped.extendVerificationTimeout(id, verificationCodeAtTimeout, millisecondsToDelay) + } + + override fun setInstallerPackageName(targetPackage: String, installerPackageName: String?) { + return wrapped.setInstallerPackageName(targetPackage, installerPackageName) + } + + override fun getInstallerPackageName(packageName: String): String? { + return wrapped.getInstallerPackageName(packageName) + } + + override fun addPackageToPreferred(packageName: String) { + return wrapped.addPackageToPreferred(packageName) + } + + override fun removePackageFromPreferred(packageName: String) { + return wrapped.removePackageFromPreferred(packageName) + } + + override fun getPreferredPackages(flags: Int): MutableList { + return wrapped.getPreferredPackages(flags) + } + + override fun addPreferredActivity(filter: IntentFilter, match: Int, set: Array?, activity: ComponentName) { + return wrapped.addPreferredActivity(filter, match, set, activity) + } + + override fun clearPackagePreferredActivities(packageName: String) { + return wrapped.clearPackagePreferredActivities(packageName) + } + + override fun getPreferredActivities(outFilters: MutableList, outActivities: MutableList, packageName: String?): Int { + return wrapped.getPreferredActivities(outFilters, outActivities, packageName) + } + + override fun setComponentEnabledSetting(componentName: ComponentName, newState: Int, flags: Int) { + return wrapped.setComponentEnabledSetting(componentName, newState, flags) + } + + override fun getComponentEnabledSetting(componentName: ComponentName): Int { + return wrapped.getComponentEnabledSetting(componentName) + } + + override fun setApplicationEnabledSetting(packageName: String, newState: Int, flags: Int) { + return wrapped.setApplicationEnabledSetting(packageName, newState, flags) + } + + override fun getApplicationEnabledSetting(packageName: String): Int { + return wrapped.getApplicationEnabledSetting(packageName) + } + + override fun isSafeMode(): Boolean { + return wrapped.isSafeMode + } + + @TargetApi(26) + override fun setApplicationCategoryHint(packageName: String, categoryHint: Int) { + return wrapped.setApplicationCategoryHint(packageName, categoryHint) + } + + @TargetApi(21) + override fun getPackageInstaller(): PackageInstaller { + return wrapped.packageInstaller + } + + @TargetApi(26) + override fun canRequestPackageInstalls(): Boolean { + return wrapped.canRequestPackageInstalls() + } + + + @TargetApi(29) + override fun addWhitelistedRestrictedPermission(packageName: String, permName: String, whitelistFlags: Int): Boolean { + return wrapped.addWhitelistedRestrictedPermission(packageName, permName, whitelistFlags) + } + + @TargetApi(30) + override fun getBackgroundPermissionOptionLabel(): CharSequence { + return wrapped.getBackgroundPermissionOptionLabel() + } + + @TargetApi(30) + override fun getInstallSourceInfo(packageName: String): InstallSourceInfo { + return wrapped.getInstallSourceInfo(packageName) + } + + @TargetApi(30) + override fun getMimeGroup(mimeGroup: String): MutableSet { + return wrapped.getMimeGroup(mimeGroup) + } + + @TargetApi(29) + override fun getModuleInfo(packageName: String, flags: Int): ModuleInfo { + return wrapped.getModuleInfo(packageName, flags) + } + + override fun getPackageArchiveInfo(archiveFilePath: String, flags: Int): PackageInfo? { + return wrapped.getPackageArchiveInfo(archiveFilePath, flags) + } + + @TargetApi(28) + override fun getSuspendedPackageAppExtras(): Bundle? { + return wrapped.suspendedPackageAppExtras + } + + @TargetApi(29) + override fun getSyntheticAppDetailsActivityEnabled(packageName: String): Boolean { + return wrapped.getSyntheticAppDetailsActivityEnabled(packageName) + } + + @TargetApi(29) + override fun getWhitelistedRestrictedPermissions(packageName: String, whitelistFlag: Int): MutableSet { + return wrapped.getWhitelistedRestrictedPermissions(packageName, whitelistFlag) + } + + @TargetApi(28) + override fun hasSigningCertificate(packageName: String, certificate: ByteArray, type: Int): Boolean { + return wrapped.hasSigningCertificate(packageName, certificate, type) + } + + @TargetApi(28) + override fun hasSigningCertificate(uid: Int, certificate: ByteArray, type: Int): Boolean { + return wrapped.hasSigningCertificate(uid, certificate, type) + } + + @TargetApi(30) + override fun isAutoRevokeWhitelisted(): Boolean { + return wrapped.isAutoRevokeWhitelisted + } + + @TargetApi(30) + override fun isAutoRevokeWhitelisted(packageName: String): Boolean { + return wrapped.isAutoRevokeWhitelisted(packageName) + } + + @TargetApi(30) + override fun isDefaultApplicationIcon(drawable: Drawable): Boolean { + return wrapped.isDefaultApplicationIcon(drawable) + } + + @TargetApi(29) + override fun isDeviceUpgrading(): Boolean { + return wrapped.isDeviceUpgrading + } + + @TargetApi(28) + override fun isPackageSuspended(): Boolean { + return wrapped.isPackageSuspended + } + + @TargetApi(29) + override fun isPackageSuspended(packageName: String): Boolean { + return wrapped.isPackageSuspended(packageName) + } + + @TargetApi(29) + override fun removeWhitelistedRestrictedPermission(packageName: String, permName: String, whitelistFlags: Int): Boolean { + return wrapped.removeWhitelistedRestrictedPermission(packageName, permName, whitelistFlags) + } + + @TargetApi(30) + override fun setAutoRevokeWhitelisted(packageName: String, whitelisted: Boolean): Boolean { + return wrapped.setAutoRevokeWhitelisted(packageName, whitelisted) + } + + @TargetApi(30) + override fun setMimeGroup(mimeGroup: String, mimeTypes: MutableSet) { + return wrapped.setMimeGroup(mimeGroup, mimeTypes) + } +} diff --git a/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsContract.kt b/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsContract.kt index 84a7c321..841b47a0 100644 --- a/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsContract.kt +++ b/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsContract.kt @@ -88,6 +88,20 @@ object SettingsContract { ) } + object Profile { + private const val id = "profile" + fun getContentUri(context: Context) = Uri.withAppendedPath(getAuthorityUri(context), id) + fun getContentType(context: Context) = "vnd.android.cursor.item/vnd.${getAuthority(context)}.$id" + + const val PROFILE = "device_profile" + const val SERIAL = "device_profile_serial" + + val PROJECTION = arrayOf( + PROFILE, + SERIAL + ) + } + private fun withoutCallingIdentity(f: () -> T): T { val identity = Binder.clearCallingIdentity() try { @@ -97,6 +111,7 @@ object SettingsContract { } } + @JvmStatic fun getSettings(context: Context, uri: Uri, projection: Array?, f: (Cursor) -> T): T = withoutCallingIdentity { context.contentResolver.query(uri, projection, null, null, null).use { c -> require(c != null) { "Cursor for query $uri ${projection?.toList()} was null" } @@ -105,6 +120,7 @@ object SettingsContract { } } + @JvmStatic fun setSettings(context: Context, uri: Uri, v: ContentValues.() -> Unit) = withoutCallingIdentity { val values = ContentValues().apply { v.invoke(this) } val affected = context.contentResolver.update(uri, values, null, null) diff --git a/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt b/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt index b5731eb2..a41dc07b 100644 --- a/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt +++ b/play-services-core/src/main/kotlin/org/microg/mgms/settings/SettingsProvider.kt @@ -17,6 +17,7 @@ import android.net.Uri import android.preference.PreferenceManager import org.microg.gms.common.PackageUtils.warnIfNotMainProcess import org.microg.gms.gcm.GcmPrefs +import org.microg.mgms.settings.SettingsContract.Profile import org.microg.mgms.settings.SettingsContract.Auth import org.microg.mgms.settings.SettingsContract.CheckIn import org.microg.mgms.settings.SettingsContract.Gcm @@ -61,6 +62,7 @@ class SettingsProvider : ContentProvider() { CheckIn.getContentUri(context!!) -> queryCheckIn(projection ?: CheckIn.PROJECTION) Gcm.getContentUri(context!!) -> queryGcm(projection ?: Gcm.PROJECTION) Auth.getContentUri(context!!) -> queryAuth(projection ?: Auth.PROJECTION) + Profile.getContentUri(context!!) -> queryProfile(projection ?: Profile.PROJECTION) else -> null } @@ -76,6 +78,7 @@ class SettingsProvider : ContentProvider() { CheckIn.getContentUri(context!!) -> updateCheckIn(values) Gcm.getContentUri(context!!) -> updateGcm(values) Auth.getContentUri(context!!) -> updateAuth(values) + Profile.getContentUri(context!!) -> updateProfile(values) else -> return 0 } return 1 @@ -214,9 +217,30 @@ class SettingsProvider : ContentProvider() { editor.apply() } + private fun queryProfile(p: Array): Cursor = MatrixCursor(p).addRow(p) { key -> + when (key) { + Profile.PROFILE -> getSettingsString(key, "auto") + Profile.SERIAL -> getSettingsString(key) + else -> throw IllegalArgumentException("Unknown key: $key") + } + } + + private fun updateProfile(values: ContentValues) { + if (values.size() == 0) return + val editor = preferences.edit() + values.valueSet().forEach { (key, value) -> + when (key) { + Profile.PROFILE -> editor.putString(key, value as String?) + Profile.SERIAL -> editor.putString(key, value as String?) + else -> throw IllegalArgumentException("Unknown key: $key") + } + } + editor.apply() + } + private fun MatrixCursor.addRow( p: Array, - valueGetter: (String) -> Any + valueGetter: (String) -> Any? ): MatrixCursor { val row = newRow() for (key in p) row.add(valueGetter.invoke(key)) @@ -241,7 +265,16 @@ class SettingsProvider : ContentProvider() { * @return the current setting as [Int], because [ContentProvider] does not support [Boolean]. */ private fun getSettingsBoolean(key: String, def: Boolean): Int { - val default = systemDefaultPreferences?.getBoolean(key, def) ?: def - return if (preferences.getBoolean(key, default)) 1 else 0 + return listOf(preferences, systemDefaultPreferences).getBooleanAsInt(key, def) } + + private fun getSettingsString(key: String, def: String? = null): String? = listOf(preferences, systemDefaultPreferences).getString(key, def) + private fun getSettingsInt(key: String, def: Int): Int = listOf(preferences, systemDefaultPreferences).getInt(key, def) + private fun getSettingsLong(key: String, def: Long): Long = listOf(preferences, systemDefaultPreferences).getLong(key, def) + + private fun List.getString(key: String, def: String?): String? = foldRight(def) { preferences, defValue -> preferences?.getString(key, defValue) ?: defValue } + private fun List.getInt(key: String, def: Int): Int = foldRight(def) { preferences, defValue -> preferences?.getInt(key, defValue) ?: defValue } + private fun List.getLong(key: String, def: Long): Long = foldRight(def) { preferences, defValue -> preferences?.getLong(key, defValue) ?: defValue } + private fun List.getBoolean(key: String, def: Boolean): Boolean = foldRight(def) { preferences, defValue -> preferences?.getBoolean(key, defValue) ?: defValue } + private fun List.getBooleanAsInt(key: String, def: Boolean): Int = if (getBoolean(key, def)) 1 else 0 } diff --git a/play-services-core/src/main/res/drawable/circle_shape_background.xml b/play-services-core/src/main/res/drawable/circle_shape_background.xml deleted file mode 100644 index 9cc09263..00000000 --- a/play-services-core/src/main/res/drawable/circle_shape_background.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - \ No newline at end of file diff --git a/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index 7353dbd1..00000000 --- a/play-services-core/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/play-services-core/src/main/res/mipmap-hdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-hdpi/ic_launcher_round.png deleted file mode 100644 index a6c6fb8a..00000000 Binary files a/play-services-core/src/main/res/mipmap-hdpi/ic_launcher_round.png and /dev/null differ diff --git a/play-services-core/src/main/res/mipmap-mdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-mdpi/ic_launcher_round.png deleted file mode 100644 index 41b90dae..00000000 Binary files a/play-services-core/src/main/res/mipmap-mdpi/ic_launcher_round.png and /dev/null differ diff --git a/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher_round.png deleted file mode 100644 index e70c0582..00000000 Binary files a/play-services-core/src/main/res/mipmap-xhdpi/ic_launcher_round.png and /dev/null differ diff --git a/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png deleted file mode 100644 index 03cec2d8..00000000 Binary files a/play-services-core/src/main/res/mipmap-xxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png deleted file mode 100644 index 092eadd7..00000000 Binary files a/play-services-core/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png and /dev/null differ diff --git a/play-services-core/src/main/res/values-cs/strings.xml b/play-services-core/src/main/res/values-cs/strings.xml index 43a9ee9e..6434a8a1 100644 --- a/play-services-core/src/main/res/values-cs/strings.xml +++ b/play-services-core/src/main/res/values-cs/strings.xml @@ -26,9 +26,6 @@ Klepnutím zde přejděte do nastavení a zakažte optimalizaci baterie pro aplikaci Vanced microG. Po provedení této akce a restartu zařízení toto oznámení zmizí Počkejte chviličku… - Pokud budete pokračovat, povolíte této aplikaci a společnosti Google využívat vaše informace v souladu s jejich příslušnými podmínkami služby a zásadami ochrany osobních údajů. - Aplikace %1$s by chtěla: - Aplikace %1$s by chtěla použít: Google Account Manager Promiňte… "Aplikace na vašem zařízení se pokouší přihlásit se k účtu Google. @@ -47,10 +44,6 @@ Zkuste to později." "Vaše zařízení právě kontaktuje Google za účelem uložení informací do vašeho účtu. Tato akce může trvat několik minut." - Povolit - Zamítnout - Je vyžadováno ověření - Aplikace %1$s pro přístup k vašemu účtu Google vyžaduje vaše ověření. poslouchat interní stavová vysílání poslouchat zprávy C2DM @@ -82,10 +75,6 @@ Tato akce může trvat několik minut." Neregistrováno Naposledy registrováno: %1$s - Optimalizace baterie jsou povoleny - Máte povolenou funkci Cloud Messaging, ale zároveň máte aktivní i optimalizace baterie pro microG Services Core. Aby vám mohla být doručována push oznámení, je potřeba optimalizace baterie zakázat. - Zakázat optimalizace - Předvolby účtu Osobní informace a soukromí Přihlášení a zabezpečení @@ -128,7 +117,6 @@ Tato akce může trvat několik minut." Připojeno: %1$s Povolit registraci - Povolit aplikaci {appName} registraci pro příjem push oznámení? Povolit aplikaci registraci pro příjem push oznámení. Spouštět aplikaci pro přijímání push zpráv Spouštět aplikaci na pozadí, aby mohla přijímat příchozí push zprávy. diff --git a/play-services-core/src/main/res/values-es/strings.xml b/play-services-core/src/main/res/values-es/strings.xml index cf50650e..eb1a176b 100644 --- a/play-services-core/src/main/res/values-es/strings.xml +++ b/play-services-core/src/main/res/values-es/strings.xml @@ -26,9 +26,6 @@ Toque aqui y deshabilita la optimización de batería para vanced microG, luego reinicie el dispositivo para cerrar esta notificación Solo un momento… - Al continuar, permites que esta app y Google usen tu información de acuerdo con sus respectivos términos de servicio y políticas de privacidad. - %1$s Le gustaria que: - %1$s Le gustaria usar: Administrador de Cuentas Google Disculpa… "Una app en tu dispositivo esta intentando iniciar sesión a una cuenta de Google. @@ -47,10 +44,6 @@ Vuelva a intentar en un rato." "Tu dispositivo esta contactando a Google para guardar información en tu cuenta. Esto puede tardar unos minutos." - Permitir - Denegar - Autenticación requerida - %1$s requiere tu autorización para acceder a tu cuenta de Google. escuchar transmisiones de estatus interno escuchar mensajes de C2DM @@ -82,10 +75,6 @@ Esto puede tardar unos minutos." No registrado Ultimo registro: %1$s - Optimizaciones de bateria habilitadas - Has habilitado Cloud Messaging pero tienes las optimizacion de bateria activada para los servicios de microG. Para que lleguen las notificaciones deberás deshabilitar la optimización de batería para microG. - Deshabilitar optimizaciones - Preferencias de Cuenta Informacion personal & privacidad Inició de Sesión y Seguridad @@ -128,7 +117,6 @@ Esto puede tardar unos minutos." Conectado desde %1$s Permitir registro - Permita que {appName} se registre para notificaciones push? Permita la app para registrarse para notificaciones push. Iniciar app en un mensaje push Iniciar app en segundo plano para recibir mensajes push entrantes. diff --git a/play-services-core/src/main/res/values-in/strings.xml b/play-services-core/src/main/res/values-in/strings.xml index d3163eb4..63f0aabb 100644 --- a/play-services-core/src/main/res/values-in/strings.xml +++ b/play-services-core/src/main/res/values-in/strings.xml @@ -26,9 +26,6 @@ Ketuk di sini dan nonaktifkan pengoptimalan baterai untuk microG, lalu reboot perangkat untuk menghapus notifikasi ini. Tunggu sebentar… - Dengan melanjutkan, anda mengizinkan aplikasi ini dan Google untuk menggunakan informasi anda sesuai dengan persyaratan layanan masing-masing dan kebijakan privasi. - %1$s ingin: - %1$s ingin menggunakan: Pengelola akun Google Maaf… "Sebuah aplikasi di perangkat anda mencoba untuk masuk ke akun Google. @@ -47,10 +44,6 @@ Coba lagi nanti." "Perangkat anda sedang menghubungkan ke Google untuk menyimpan informasi ke akun anda. Ini bisa berlangsung beberapa menit." - Izinkan - Tolak - Autentikasi dibutuhkan - %1$s membutuhkan autentikasi anda untuk mengakses akun Google anda. mendengarkan ke siaran internal langsung kirim ke pesan C2DM @@ -82,10 +75,6 @@ Ini bisa berlangsung beberapa menit." Tidak diregistrasi Registrasi terakhir: %1$s - Optimisasi baterai diaktifkan - Anda mengaktifkan Cloud Messaging namun mengaktifkan optimisasi baterai untuk layanan utama microG. Untuk mendapatkan notifikasi push anda harus menonaktifkan optimisasi baterai. - Nonaktifkan optimisasi - Preferensi akun Informasi pribadi & privasi Masuk & keamanan @@ -126,7 +115,6 @@ Ini bisa berlangsung beberapa menit." Terhubung sejak %1$s Izinkan registrasi - Izinkan {appName} untuk mendaftar pemberitahuan push? Izinkan aplikasi untuk meregistrasi untuk notifikasi push. Mulai aplikasi dalam pesan push Mulai aplikasi saat di background untuk menerima pesan push yang akan datang. diff --git a/play-services-core/src/main/res/values-it/strings.xml b/play-services-core/src/main/res/values-it/strings.xml index faaf7b72..9a4f8e0a 100755 --- a/play-services-core/src/main/res/values-it/strings.xml +++ b/play-services-core/src/main/res/values-it/strings.xml @@ -26,9 +26,6 @@ Tocca qui per disattivare l\'ottimizzazione della batteria per microG, poi riavvia il dispositivo per rimuovere questa notifica. Solo un secondo… - Continuando, consentirai a quest\'app e a Google di utilizzare le tue informazioni in conformità con i rispettivi termini di servizio e politiche sulla riservatezza. - %1$s vorrebbe: - %1$s vorrebbe utilizzare: Gestore Account Google Ci scusiamo… "Un'app sul tuo dispositivo sta tentando di accedere a un account Google. @@ -47,10 +44,6 @@ Riprova più tardi." "Il tuo dispositivo sta tentando di contattare Google per salvare le informazioni sul tuo account. Questo potrà richiedere un paio di minuti" - Consenti - Nega - Autenticazione richiesta - %1$s richiede a tua autorizzazione per accedere al tuo account Google. ascolta le trasmissioni di stato interne ascolta i messaggi C2DM @@ -82,10 +75,6 @@ Questo potrà richiedere un paio di minuti" Non registrato Ultima registrazione: %1$s - Ottimizzazione batteria attivata - Hai attivato l\'opzione Messaggistica Cloud ma i Servizi Vanced microG risultano al momento limitati dall\'ottimizzazione energetica di sistema. Se desideri ricevere le notifiche push, escludi i microG da questa ottimizzazione. - Disattiva ottimizzazione - Preferenze account Info personali e privacy Accesso e sicurezza @@ -126,7 +115,6 @@ Questo potrà richiedere un paio di minuti" Connesso %1$s Consenti registrazione - Consentire a {appName} di registrarsi per ricevere notifiche push? Consenti all\'app di registrarsi per ricevere notifiche push. Esegui app su messaggio push Esegui l\'app in secondo piano per ricevere i messaggi push in arrivo. @@ -137,4 +125,14 @@ Questo potrà richiedere un paio di minuti" Reti utilizzate per le notifiche push Attiva questa opzione in caso di voci duplicate nel menù di trasmissione + Profilo dispositivo + Seleziona profilo + Nativo + Reale + Personalizzato: %s + Automatico: %s + Sistema: %s + Importa profilo personalizzato + Importa profilo dispositivo da file + Seriale diff --git a/play-services-core/src/main/res/values-ru/strings.xml b/play-services-core/src/main/res/values-ru/strings.xml index 93be7343..25151d51 100644 --- a/play-services-core/src/main/res/values-ru/strings.xml +++ b/play-services-core/src/main/res/values-ru/strings.xml @@ -26,9 +26,6 @@ Нажмите здесь, чтобы отключить режим энергосбережения для microG. Затем перезагрузите устройство, чтобы отключить уведомление. Секундочку… - Продолжая, вы разрешаете этому приложению и Google использовать вашу информацию в соответствии с их соответствующими условиями использования и политикой конфиденциальности. - %1$s требует разрешение на: - %1$s хочет использовать: Настройки аккаунта Google Извините… "Это приложение на вашем устройстве пытается подключиться к вашему аккаунту Google. @@ -47,10 +44,6 @@ "Ваше устройство получает данные авторизации от Google. Это может занять несколько минут." - Разрешить - Отклонить - Необходима авторизация - %1$s требует вас авторизироваться в аккаунт Google. прослушивать внутренние сообщения о состоянии прослушивать C2DM сообщения @@ -82,10 +75,6 @@ Не зарегистрирован Последняя регистрация: %1$s - Включена экономия заряда батареи - Вы включили Cloud Messaging, но не отключили экономию заряда батареи для Vanced microG. Для корректной работы уведомлений вам нужно отключить экономию заряда батареи. - Отключить экономию - Настройки аккаунта Конфиденциальность Вход и безопастность @@ -128,7 +117,6 @@ Соединено: %1$s Разрешать авторизацию - Разрешить приложению {appName} регистрацию для push-уведомлений. Разрешить приложению регистрацию для push-уведомлений. Запуск приложения при уведомлении Запуск приложения в фоне для получения уведомлений. diff --git a/play-services-core/src/main/res/values/colors.xml b/play-services-core/src/main/res/values/colors.xml index 74ecc07a..cc8263b2 100755 --- a/play-services-core/src/main/res/values/colors.xml +++ b/play-services-core/src/main/res/values/colors.xml @@ -19,5 +19,4 @@ #ff3367d6 #ffFFAB40 - #88CCCCCC diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml index 030ec7bd..29c2759b 100755 --- a/play-services-core/src/main/res/values/strings.xml +++ b/play-services-core/src/main/res/values/strings.xml @@ -16,7 +16,6 @@ --> - Vanced microG Settings Setup Vanced microG. @@ -26,9 +25,6 @@ Tap here to disable battery optimization for vanced microG, then restart the device to remove this notification Just a sec… - By continuing, you allow this app and Google to use your information in accordance with their respective terms of service and privacy policies. - %1$s would like to: - %1$s would like to use: Google Account Manager Sorry… "An app on your device is trying to sign in to a Google account. @@ -47,10 +43,6 @@ Try again later." "Your device is contacting Google to save information to your account. This can take a couple of minutes." - Allow - Deny - Authentication required - %1$s requires your authorization to access your Google account. listen to internal status broadcasts listen to C2DM messages @@ -82,10 +74,6 @@ This can take a couple of minutes." Not registered Last registration: %1$s - Battery optimizations enabled - You enabled Cloud Messaging but have battery optimizations active for microG Services Core. For push notifications to arrive you should disable battery optimizations. - Disable optimization - Account preferences Personal info & privacy Sign-in & security @@ -128,7 +116,6 @@ This can take a couple of minutes."
Connected since %1$s Allow registration - Allow {appName} to register for push notifications? Allow the app to register for push notifications. Start app on push message Start the app while in background to receive the incoming push messages. @@ -139,4 +126,14 @@ This can take a couple of minutes."
Networks to use for push notifications Enable this if you see duplicates in your casting menu + Device profile + Select profile + Native + Real + Custom: %s + Automatic: %s + System: %s + Import custom profile + Import device profile from file + Serial diff --git a/play-services-core/src/main/res/values/themes.xml b/play-services-core/src/main/res/values/themes.xml index da313b25..191b4777 100755 --- a/play-services-core/src/main/res/values/themes.xml +++ b/play-services-core/src/main/res/values/themes.xml @@ -26,13 +26,4 @@ false - - - diff --git a/play-services-core/src/main/res/xml/preferences_device_registration.xml b/play-services-core/src/main/res/xml/preferences_device_registration.xml index d245d19c..ecd4b469 100755 --- a/play-services-core/src/main/res/xml/preferences_device_registration.xml +++ b/play-services-core/src/main/res/xml/preferences_device_registration.xml @@ -6,22 +6,40 @@ + + + + + - diff --git a/play-services-cronet-core/build.gradle b/play-services-cronet-core/build.gradle index c734e569..65a20e04 100644 --- a/play-services-cronet-core/build.gradle +++ b/play-services-cronet-core/build.gradle @@ -13,13 +13,13 @@ dependencies { // Need to find a better way to disable AOT for Cronet. Could be by packaging cronet as it's own apk that is // embedded in the main APK but only loaded at runtime so that the AOT compiler has no way to become active. // implementation("org.microg:cronet-api:$cronetVersion") - implementation("org.microg:cronet-common:$cronetVersion") - implementation("org.microg:cronet-native:$cronetVersion") + implementation("org.microg:cronet-common:91.0.4472.120.1") + implementation("org.microg:cronet-native:91.0.4472.120.1") } android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk diff --git a/play-services-iid-api/build.gradle b/play-services-iid-api/build.gradle index 98613334..9a497d27 100644 --- a/play-services-iid-api/build.gradle +++ b/play-services-iid-api/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk diff --git a/play-services-location-api/build.gradle b/play-services-location-api/build.gradle index 5066a8dd..f16d2c33 100644 --- a/play-services-location-api/build.gradle +++ b/play-services-location-api/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk diff --git a/play-services-location-api/gradle.properties b/play-services-location-api/gradle.properties index cb75f79e..de0a3085 100644 --- a/play-services-location-api/gradle.properties +++ b/play-services-location-api/gradle.properties @@ -30,4 +30,5 @@ POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt POM_LICENCE_DIST=repo POM_DEVELOPER_ID=mar-v-in -POM_DEVELOPER_NAME=Marvin W \ No newline at end of file +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-location-api/src/main/aidl/com/google/android/gms/location/DeviceOrientation.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/DeviceOrientation.aidl new file mode 100644 index 00000000..3055c41b --- /dev/null +++ b/play-services-location-api/src/main/aidl/com/google/android/gms/location/DeviceOrientation.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable DeviceOrientation; diff --git a/play-services-location-api/src/main/aidl/com/google/android/gms/location/IDeviceOrientationListener.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/IDeviceOrientationListener.aidl new file mode 100644 index 00000000..e3d3e6f0 --- /dev/null +++ b/play-services-location-api/src/main/aidl/com/google/android/gms/location/IDeviceOrientationListener.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.location; + +import com.google.android.gms.location.DeviceOrientation; + +interface IDeviceOrientationListener { + void onDeviceOrientationChanged(in DeviceOrientation deviceOrientation); +} diff --git a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.aidl new file mode 100644 index 00000000..e92b0f0d --- /dev/null +++ b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.internal; + +parcelable DeviceOrientationRequestUpdateData; diff --git a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl index 8e78a899..19f9be10 100644 --- a/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl +++ b/play-services-location-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl @@ -5,8 +5,10 @@ import android.location.Location; import android.os.Bundle; import com.google.android.gms.common.api.Status; +import com.google.android.gms.common.api.internal.IStatusCallback; import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.internal.IPlacesCallbacks; +import com.google.android.gms.location.internal.DeviceOrientationRequestUpdateData; import com.google.android.gms.location.internal.ISettingsCallbacks; import com.google.android.gms.location.internal.LocationRequestInternal; import com.google.android.gms.location.internal.LocationRequestUpdateData; @@ -36,17 +38,19 @@ interface IGoogleLocationManagerService { void removeGeofencesByIntent(in PendingIntent pendingIntent, IGeofencerCallbacks callbacks, String packageName) = 1; void removeGeofencesById(in String[] geofenceRequestIds, IGeofencerCallbacks callbacks, String packageName) = 2; void removeAllGeofences(IGeofencerCallbacks callbacks, String packageName) = 3; +// void removeGeofences(in RemoveGeofencingRequest request, IGeofencerCallbacks callback) = 73; void requestActivityUpdates(long detectionIntervalMillis, boolean alwaysTrue, in PendingIntent callbackIntent) = 4; void removeActivityUpdates(in PendingIntent callbackIntent) = 5; ActivityRecognitionResult getLastActivity(String packageName) = 63; - Status iglms65(in PendingIntent pendingIntent) = 64; - Status iglms66(in PendingIntent pendingIntent) = 65; Status requestGestureUpdates(in GestureRequest request, in PendingIntent pendingIntent) = 59; Status iglms61(in PendingIntent pendingIntent) = 60; Location getLastLocation() = 6; + Location getLastLocationWithPackage(String packageName) = 20; + Location getLastLocationWith(String s) = 79; + void requestLocationUpdatesWithListener(in LocationRequest request, ILocationListener listener) = 7; void requestLocationUpdatesWithPackage(in LocationRequest request, ILocationListener listener, String packageName) = 19; void requestLocationUpdatesWithIntent(in LocationRequest request, in PendingIntent callbackIntent) = 8; @@ -55,34 +59,55 @@ interface IGoogleLocationManagerService { void removeLocationUpdatesWithListener(ILocationListener listener) = 9; void removeLocationUpdatesWithIntent(in PendingIntent callbackIntent) = 10; void updateLocationRequest(in LocationRequestUpdateData locationRequestUpdateData) = 58; - //void flushLocations(IFusedLocationProviderCallback callback = 66; +// void flushLocations(IFusedLocationProviderCallback callback) = 66; void setMockMode(boolean mockMode) = 11; void setMockLocation(in Location mockLocation) = 12; + void injectLocation(in Location mockLocation, int injectionType) = 25; - Location getLastLocationWithPackage(String packageName) = 20; - void iglms26(in Location var1, int var2) = 25; LocationAvailability getLocationAvailabilityWithPackage(String packageName) = 33; - IBinder iglms51() = 50; +// void requestSleepSegmentUpdates(in PendingIntent pendingIntent, in SleepSegmentRequest request, IStatusCallback callback) = 78; + void removeSleepSegmentUpdates(in PendingIntent pendingIntent, IStatusCallback callback) = 68; + void requestLocationSettingsDialog(in LocationSettingsRequest settingsRequest, ISettingsCallbacks callback, String packageName) = 62; +// void requestActivityTransitionUpdates(in ActivityTransitionRequest request, in PendingIntent pendingIntent, IStatusCallback callback) = 71; + void removeActivityTransitionUpdates(in PendingIntent pendingIntent, IStatusCallback callback) = 72; + + void updateDeviceOrientationRequest(in DeviceOrientationRequestUpdateData request) = 74; + + boolean setActivityRecognitionMode(int mode) = 76; + void iglms14(in LatLngBounds var1, int var2, in PlaceFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 13; void iglms15(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 14; void iglms16(in LatLng var1, in PlaceFilter var2, in PlacesParams var3, IPlacesCallbacks var4) = 15; void iglms17(in PlaceFilter var1, in PlacesParams var2, IPlacesCallbacks var3) = 16; void iglms18(in PlaceRequest var1, in PlacesParams var2, in PendingIntent var3) = 17; void iglms19(in PlacesParams var1, in PendingIntent var2) = 18; + void iglms25(in PlaceReport var1, in PlacesParams var2) = 24; + void iglms42(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 41; + void iglms46(in UserAddedPlace var1, in PlacesParams var2, IPlacesCallbacks var3) = 45; void iglms47(in LatLngBounds var1, int var2, String var3, in PlaceFilter var4, in PlacesParams var5, IPlacesCallbacks var6) = 46; void iglms48(in NearbyAlertRequest var1, in PlacesParams var2, in PendingIntent var3) = 47; void iglms49(in PlacesParams var1, in PendingIntent var2) = 48; void iglms50(in UserDataType var1, in LatLngBounds var2, in List var3, in PlacesParams var4, IPlacesCallbacks var5) = 49; + IBinder iglms51() = 50; + IBinder iglms54() = 53; void iglms55(String var1, in LatLngBounds var2, in AutocompleteFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 54; + void iglms58(in List var1, in PlacesParams var2, IPlacesCallbacks var3) = 57; - //void updateDeviceOrientationRequest(in DeviceOrientationRequestUpdateData request) = 74; + void iglms65(in PendingIntent pendingIntent, IStatusCallback callback) = 64; + void iglms66(in PendingIntent pendingIntent, IStatusCallback callback) = 65; + + void iglms68(in PendingIntent pendingIntent, IStatusCallback callback) = 67; +// void iglms70(in ActivityRecognitionRequest request, in PendingIntent pendingIntent, IStatusCallback callback) = 69; + void iglms71(IStatusCallback callback) = 70; + void iglms76(in PendingIntent pendingIntent) = 75; + int iglms78() = 77; } diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientation.java b/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientation.java new file mode 100644 index 00000000..61373df0 --- /dev/null +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientation.java @@ -0,0 +1,118 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +import java.util.Arrays; + +public class DeviceOrientation extends AutoSafeParcelable { + @Field(1) + private float[] attitude = new float[4]; + @Field(2) + private int attitudeConfidence = -1; + @Field(3) + private int magConfidence = -1; + @Field(4) + private float headingDegrees = Float.NaN; + @Field(5) + private float headingErrorDegrees = Float.NaN; + @Field(6) + private long elapsedRealtimeNanos = 0; + @Field(7) + private byte flags = 0; + @Field(8) + private float conservativeHeadingErrorVonMisesKappa = Float.NaN; + + public float[] getAttitude() { + if ((flags & 0x10) != 0) return attitude; + return new float[4]; + } + + public void setAttitude(float[] attitude) { + if (attitude.length != 4) throw new IllegalArgumentException(); + this.attitude = attitude; + flags = (byte) (flags | 0x10); + } + + public int getAttitudeConfidence() { + if ((flags & 0x1) != 0) return attitudeConfidence; + return -1; + } + + public void setAttitudeConfidence(int attitudeConfidence) { + this.attitudeConfidence = attitudeConfidence; + flags = (byte) (flags | 0x1); + } + + public int getMagConfidence() { + if ((flags & 0x2) != 0) return magConfidence; + return -1; + } + + public void setMagConfidence(int magConfidence) { + this.magConfidence = magConfidence; + flags = (byte) (flags | 0x2); + } + + public float getHeadingDegrees() { + if ((flags & 0x4) != 0) return headingDegrees; + return Float.NaN; + } + + public void setHeadingDegrees(float headingDegrees) { + this.headingDegrees = headingDegrees; + flags = (byte) (flags | 0x4); + } + + public float getHeadingErrorDegrees() { + if ((flags & 0x8) != 0) return headingErrorDegrees; + return Float.NaN; + } + + public void setHeadingErrorDegrees(float headingErrorDegrees) { + this.headingErrorDegrees = headingErrorDegrees; + flags = (byte) (flags | 0x8); + } + + public float getConservativeHeadingErrorVonMisesKappa() { + if ((flags & 0x20) != 0) return conservativeHeadingErrorVonMisesKappa; + return Float.NaN; + } + + public void setConservativeHeadingErrorVonMisesKappa(float conservativeHeadingErrorVonMisesKappa) { + this.conservativeHeadingErrorVonMisesKappa = conservativeHeadingErrorVonMisesKappa; + flags = (byte) (flags | 0x20); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("DeviceOrientation{"); + if ((flags & 0x10) != 0) + sb.append("attitude=").append(Arrays.toString(attitude)); + if ((flags & 0x1) != 0) + sb.append(", attitudeConfidence=").append(attitudeConfidence); + if ((flags & 0x2) != 0) + sb.append(", magConfidence=").append(magConfidence); + if ((flags & 0x4) != 0) + sb.append(", headingDegrees=").append(headingDegrees); + if ((flags & 0x8) != 0) + sb.append(", headingErrorDegrees=").append(headingErrorDegrees); + return "DeviceOrientation{" + + "attitude=" + Arrays.toString(attitude) + + ", attitudeConfidence=" + attitudeConfidence + + ", magConfidence=" + magConfidence + + ", headingDegrees=" + headingDegrees + + ", headingErrorDegrees=" + headingErrorDegrees + + ", elapsedRealtimeNanos=" + elapsedRealtimeNanos + + ", flags=" + flags + + ", conservativeHeadingErrorVonMisesKappa=" + conservativeHeadingErrorVonMisesKappa + + '}'; + } + + public static final Creator CREATOR = new AutoCreator(DeviceOrientation.class); +} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientationRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientationRequest.java new file mode 100644 index 00000000..14ce93c1 --- /dev/null +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/DeviceOrientationRequest.java @@ -0,0 +1,39 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.location; + +import android.os.SystemClock; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DeviceOrientationRequest extends AutoSafeParcelable { + @Field(1) + public boolean shouldUseMag; + @Field(2) + public long minimumSamplingPeriodMs; + @Field(3) + public float smallesAngleChangeRadians; + @Field(4) + public long expirationTime; + @Field(5) + public int numUpdates; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Request[shouldUseMag=").append(shouldUseMag); + sb.append(" minimumSamplingPeriod=").append(minimumSamplingPeriodMs).append("ms"); + sb.append(" smallesAngleChange=").append(smallesAngleChangeRadians).append("rad"); + if (expirationTime != Long.MAX_VALUE) + sb.append(" expireIn=").append(SystemClock.elapsedRealtime() - expirationTime).append("ms"); + if (numUpdates != Integer.MAX_VALUE) + sb.append(" num=").append(numUpdates); + sb.append("]"); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(DeviceOrientationRequest.class); +} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingEvent.java b/play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingEvent.java index 3c014f94..82b3a107 100644 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingEvent.java +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/GeofencingEvent.java @@ -33,7 +33,6 @@ import java.util.List; * A geofence triggering event generated when a geofence transition happens. * An error happens after geofences are registered and being monitored. */ -@SuppressWarnings("unchecked") @PublicApi public class GeofencingEvent { @PublicApi(exclude = true) diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationRequest.java index 15d159e8..085886c0 100644 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationRequest.java +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationRequest.java @@ -17,8 +17,8 @@ package com.google.android.gms.location; import android.os.SystemClock; + import org.microg.safeparcel.AutoSafeParcelable; -import org.microg.safeparcel.SafeParceled; import java.util.Arrays; @@ -101,24 +101,26 @@ public class LocationRequest extends AutoSafeParcelable { */ public static final int PRIORITY_NO_POWER = 105; - @SafeParceled(1000) + @Field(1000) private int versionCode = 1; - @SafeParceled(1) + @Field(1) private int priority; - @SafeParceled(2) + @Field(2) private long interval; - @SafeParceled(3) + @Field(3) private long fastestInterval; - @SafeParceled(4) + @Field(4) private boolean explicitFastestInterval; - @SafeParceled(5) + @Field(5) private long expirationTime; - @SafeParceled(6) + @Field(6) private int numUpdates; - @SafeParceled(7) - private float smallestDesplacement; - @SafeParceled(8) + @Field(7) + private float smallestDisplacement; + @Field(8) private long maxWaitTime; + @Field(9) + private boolean waitForAccurateLocation; public LocationRequest() { this.priority = PRIORITY_BALANCED_POWER_ACCURACY; @@ -127,7 +129,7 @@ public class LocationRequest extends AutoSafeParcelable { this.explicitFastestInterval = false; this.expirationTime = Long.MAX_VALUE; this.numUpdates = Integer.MAX_VALUE; - this.smallestDesplacement = 0; + this.smallestDisplacement = 0; this.maxWaitTime = 0; } @@ -176,6 +178,17 @@ public class LocationRequest extends AutoSafeParcelable { return interval; } + /** + * Gets the maximum wait time in milliseconds for location updates. If the wait time is smaller than the interval + * requested with {@link #setInterval(long)}, then the interval will be used instead. + * + * @return maximum wait time in milliseconds, inexact + * @see #setMaxWaitTime(long) + */ + public long getMaxWaitTime() { + return maxWaitTime; + } + /** * Get the number of updates requested. *

@@ -204,8 +217,8 @@ public class LocationRequest extends AutoSafeParcelable { * * @return minimum displacement between location updates in meters */ - public float getSmallestDesplacement() { - return smallestDesplacement; + public float getSmallestDisplacement() { + return smallestDisplacement; } @Override @@ -231,7 +244,7 @@ public class LocationRequest extends AutoSafeParcelable { return false; if (priority != that.priority) return false; - if (Float.compare(that.smallestDesplacement, smallestDesplacement) != 0) + if (Float.compare(that.smallestDisplacement, smallestDisplacement) != 0) return false; return true; @@ -240,11 +253,28 @@ public class LocationRequest extends AutoSafeParcelable { @Override public int hashCode() { return Arrays.hashCode( - new Object[] { priority, interval, fastestInterval, explicitFastestInterval, - explicitFastestInterval, numUpdates, smallestDesplacement, maxWaitTime + new Object[]{priority, interval, fastestInterval, explicitFastestInterval, + explicitFastestInterval, numUpdates, smallestDisplacement, maxWaitTime }); } + /** + * Returns whether or not the fastest interval was explicitly specified for the location request. + * + * @return True if the fastest interval was explicitly set for the location request; false otherwise + */ + public boolean isFastestIntervalExplicitlySet() { + return explicitFastestInterval; + } + + /** + * Returns whether the location services will wait a few seconds initially for accurate locations, if accurate + * locations cannot be computed on the device for {@link #PRIORITY_HIGH_ACCURACY} requests. + */ + public boolean isWaitForAccurateLocation() { + return waitForAccurateLocation; + } + /** * Set the duration of this request, in milliseconds. *

@@ -312,6 +342,7 @@ public class LocationRequest extends AutoSafeParcelable { if (millis < 0) throw new IllegalArgumentException("interval must not be negative"); fastestInterval = millis; + explicitFastestInterval = true; return this; } @@ -348,6 +379,27 @@ public class LocationRequest extends AutoSafeParcelable { return this; } + /** + * Sets the maximum wait time in milliseconds for location updates. + *

+ * If you pass a value at least 2x larger than the interval specified with {@link #setInterval(long)}, then + * location delivery may be delayed and multiple locations can be delivered at once. Locations are determined at + * the {@link #setInterval(long)} rate, but can be delivered in batch after the interval you set in this method. + * This can consume less battery and give more accurate locations, depending on the device's hardware capabilities. + * You should set this value to be as large as possible for your needs if you don't need immediate location + * delivery. + * + * @param millis desired maximum wait time in millisecond, inexact + * @return the same object, so that setters can be chained + * @throws IllegalArgumentException if the interval is less than zero + */ + public LocationRequest setMaxWaitTime(long millis) throws IllegalArgumentException { + if (millis < 0) + throw new IllegalArgumentException("interval must not be negative"); + maxWaitTime = millis; + return this; + } + /** * Set the number of location updates. *

@@ -417,22 +469,58 @@ public class LocationRequest extends AutoSafeParcelable { public LocationRequest setSmallestDisplacement(float smallestDisplacementMeters) { if (smallestDisplacementMeters < 0) throw new IllegalArgumentException("smallestDisplacementMeters must not be negative"); - this.smallestDesplacement = smallestDisplacementMeters; + this.smallestDisplacement = smallestDisplacementMeters; return this; } + /** + * Sets whether the client wants the locations services to wait a few seconds for accurate locations initially, + * when accurate locations could not be computed on the device immediately after {@link #PRIORITY_HIGH_ACCURACY} + * request is made. By default the location services will wait for accurate locations. + *

+ * Note that this only applies to clients with {@link #PRIORITY_HIGH_ACCURACY} requests. + *

+ * Also note this only applies to the initial locations computed right after the location request is added. The + * following inaccurate locations may still be delivered to the clients without delay. + */ + public LocationRequest setWaitForAccurateLocation(boolean waitForAccurateLocation) { + this.waitForAccurateLocation = waitForAccurateLocation; + return this; + } + + private static String priorityToString(int priority) { + switch (priority) { + case PRIORITY_HIGH_ACCURACY: + return "PRIORITY_HIGH_ACCURACY"; + case PRIORITY_BALANCED_POWER_ACCURACY: + return "PRIORITY_BALANCED_POWER_ACCURACY"; + case PRIORITY_LOW_POWER: + return "PRIORITY_LOW_POWER"; + case PRIORITY_NO_POWER: + return "PRIORITY_NO_POWER"; + default: + return "???"; + } + } + @Override public String toString() { - return "LocationRequest{" + - "priority=" + priority + - ", interval=" + interval + - ", fastestInterval=" + fastestInterval + - ", explicitFastestInterval=" + explicitFastestInterval + - ", expirationTime=" + expirationTime + - ", numUpdates=" + numUpdates + - ", smallestDesplacement=" + smallestDesplacement + - ", maxWaitTime=" + maxWaitTime + - '}'; + StringBuilder sb = new StringBuilder(); + sb.append("Request["); + sb.append(priorityToString(priority)); + if (priority != PRIORITY_NO_POWER) + sb.append(" requested=").append(interval).append("ms"); + sb.append(" fastest=").append(fastestInterval).append("ms"); + if (maxWaitTime > interval) + sb.append(" maxWait=").append(maxWaitTime).append("ms"); + if (smallestDisplacement > 0) + sb.append(" smallestDisplacement=").append(smallestDisplacement).append("m"); + if (expirationTime != Long.MAX_VALUE) + sb.append(" expireIn=").append(SystemClock.elapsedRealtime() - expirationTime).append("ms"); + if (numUpdates != Integer.MAX_VALUE) + sb.append(" num=").append(numUpdates); + sb.append("]"); + return sb.toString(); } public static final Creator CREATOR = new AutoCreator(LocationRequest.class); diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsConfiguration.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsConfiguration.java new file mode 100644 index 00000000..29dabea9 --- /dev/null +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsConfiguration.java @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LocationSettingsConfiguration extends AutoSafeParcelable { + @Field(1) + public String justificationText; + @Field(2) + public String experimentId; + @Field(5) + public String titleText; + + public static final Creator CREATOR = new AutoCreator<>(LocationSettingsConfiguration.class); +} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java index 517ab1c8..f77a392e 100644 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java @@ -1,17 +1,6 @@ /* - * Copyright (C) 2013-2017 microG Project Team - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-FileCopyrightText: 2015, microG Project Team + * SPDX-License-Identifier: Apache-2.0 */ package com.google.android.gms.location; @@ -26,27 +15,33 @@ import java.util.List; @PublicApi public class LocationSettingsRequest extends AutoSafeParcelable { - @SafeParceled(1000) + @Field(1000) private int versionCode = 2; - @SafeParceled(value = 1, subClass = LocationRequest.class) + @Field(value = 1, subClass = LocationRequest.class) @PublicApi(exclude = true) public List requests; - @SafeParceled(2) + @Field(2) @PublicApi(exclude = true) public boolean alwaysShow; + @Field(3) @PublicApi(exclude = true) public boolean needBle; + @Field(5) + @PublicApi(exclude = true) + public LocationSettingsConfiguration configuration; + private LocationSettingsRequest() { } - private LocationSettingsRequest(List requests, boolean alwaysShow, boolean needBle) { + private LocationSettingsRequest(List requests, boolean alwaysShow, boolean needBle, LocationSettingsConfiguration configuration) { this.requests = requests; this.alwaysShow = alwaysShow; this.needBle = needBle; + this.configuration = configuration; } /** @@ -79,7 +74,7 @@ public class LocationSettingsRequest extends AutoSafeParcelable { * Creates a LocationSettingsRequest that can be used with SettingsApi. */ public LocationSettingsRequest build() { - return new LocationSettingsRequest(requests, alwaysShow, needBle); + return new LocationSettingsRequest(requests, alwaysShow, needBle, null); } /** diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestInternal.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestInternal.java new file mode 100644 index 00000000..5b66feaa --- /dev/null +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestInternal.java @@ -0,0 +1,35 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.location.internal; + +import com.google.android.gms.location.DeviceOrientationRequest; + +import org.microg.safeparcel.AutoSafeParcelable; + +import java.util.List; + +public class DeviceOrientationRequestInternal extends AutoSafeParcelable { + + @Field(1) + public DeviceOrientationRequest request; + + @Field(value = 2, subClass = ClientIdentity.class) + public List clients; + + @Field(3) + public String tag; + + @Override + public String toString() { + return "DeviceOrientationRequestInternal{" + + "request=" + request + + ", clients=" + clients + + ", tag='" + tag + '\'' + + '}'; + } + + public static final Creator CREATOR = new AutoCreator(DeviceOrientationRequestInternal.class); +} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.java new file mode 100644 index 00000000..5a2e759e --- /dev/null +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/DeviceOrientationRequestUpdateData.java @@ -0,0 +1,39 @@ +/* + * SPDX-FileCopyrightText: 2022 microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.location.internal; + +import com.google.android.gms.location.IDeviceOrientationListener; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DeviceOrientationRequestUpdateData extends AutoSafeParcelable { + public static final int REQUEST_UPDATES = 1; + public static final int REMOVE_UPDATES = 2; + + @Field(1) + public int opCode; + + @Field(2) + public DeviceOrientationRequestInternal request; + + @Field(3) + public IDeviceOrientationListener listener; + + @Field(4) + public IFusedLocationProviderCallback fusedLocationProviderCallback; + + @Override + public String toString() { + return "DeviceOrientationRequestUpdateData{" + + "opCode=" + opCode + + ", request=" + request + + ", listener=" + (listener != null ? listener.asBinder() : null) + + ", fusedLocationProviderCallback=" + (fusedLocationProviderCallback != null ? fusedLocationProviderCallback.asBinder() : null) + + '}'; + } + + public static final Creator CREATOR = new AutoCreator(DeviceOrientationRequestUpdateData.class); +} diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java index dd70d96a..ee2e09a6 100644 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java @@ -25,39 +25,48 @@ import java.util.List; public class LocationRequestInternal extends AutoSafeParcelable { - @SafeParceled(1000) + @Field(1000) private int versionCode = 1; - @SafeParceled(1) + @Field(1) public LocationRequest request; - @SafeParceled(2) + @Field(2) @Deprecated public boolean requestNlpDebugInfo; - @SafeParceled(3) + @Field(3) @Deprecated public boolean restorePendingIntentListeners; - @SafeParceled(4) + @Field(4) @Deprecated public boolean triggerUpdate; - @SafeParceled(value = 5, subClass = ClientIdentity.class) + @Field(value = 5, subClass = ClientIdentity.class) public List clients; - @SafeParceled(6) + @Field(6) public String tag; - @SafeParceled(7) + @Field(7) public boolean hideFromAppOps; - @SafeParceled(8) + @Field(8) public boolean forceCoarseLocation; - @SafeParceled(9) + @Field(9) public boolean exemptFromThrottle; - @SafeParceled(10) + @Field(10) public String moduleId; + @Field(11) + public boolean locationSettingsIgnored; + + @Field(12) + public boolean inaccurateLocationsDelayed; + + @Field(13) + public String contextAttributeTag; + @Override public String toString() { return "LocationRequestInternal{" + @@ -71,6 +80,9 @@ public class LocationRequestInternal extends AutoSafeParcelable { ", forceCoarseLocation=" + forceCoarseLocation + ", exemptFromThrottle=" + exemptFromThrottle + ", moduleId=" + moduleId + + ", locationSettingsIgnored=" + locationSettingsIgnored + + ", inaccurateLocationsDelayed=" + inaccurateLocationsDelayed + + ", contextAttributeTag=" + contextAttributeTag + '}'; } diff --git a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java index f364e16a..6da81cc3 100644 --- a/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java +++ b/play-services-location-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java @@ -30,25 +30,25 @@ public class LocationRequestUpdateData extends AutoSafeParcelable { public static final int REQUEST_UPDATES = 1; public static final int REMOVE_UPDATES = 2; - @Field(1000) + @SafeParceled(1000) private int versionCode; - @Field(1) + @SafeParceled(1) public int opCode; - @Field(2) + @SafeParceled(2) public LocationRequestInternal request; - @Field(3) + @SafeParceled(3) public ILocationListener listener; - @Field(4) + @SafeParceled(4) public PendingIntent pendingIntent; - @Field(5) + @SafeParceled(5) public ILocationCallback callback; - @Field(6) + @SafeParceled(6) public IFusedLocationProviderCallback fusedLocationProviderCallback; @Override diff --git a/play-services-location/build.gradle b/play-services-location/build.gradle index 3c1b7047..4e439ddd 100644 --- a/play-services-location/build.gradle +++ b/play-services-location/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk @@ -35,5 +35,5 @@ dependencies { api project(':play-services-base') api project(':play-services-location-api') - implementation 'androidx.annotation:annotation:1.2.0' + implementation 'androidx.annotation:annotation:1.3.0' } \ No newline at end of file diff --git a/play-services-location/gradle.properties b/play-services-location/gradle.properties index 0b02e4ed..bfc9b4b2 100644 --- a/play-services-location/gradle.properties +++ b/play-services-location/gradle.properties @@ -30,4 +30,5 @@ POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt POM_LICENCE_DIST=repo POM_DEVELOPER_ID=mar-v-in -POM_DEVELOPER_NAME=Marvin W \ No newline at end of file +POM_DEVELOPER_NAME=Marvin W + diff --git a/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java b/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java index 17a017d9..78e0cd50 100644 --- a/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java +++ b/play-services-location/src/main/java/org/microg/gms/location/NativeLocationClientImpl.java @@ -135,7 +135,7 @@ public class NativeLocationClientImpl { i.putExtras(bundle); pendingCount.put(pendingIntent, request.getNumUpdates()); nativePendingMap.put(pendingIntent, PendingIntent.getActivity(context, 0, i, 0)); - locationManager.requestLocationUpdates(request.getInterval(), request.getSmallestDesplacement(), + locationManager.requestLocationUpdates(request.getInterval(), request.getSmallestDisplacement(), makeNativeCriteria(request), nativePendingMap.get(pendingIntent)); } @@ -147,7 +147,7 @@ public class NativeLocationClientImpl { } nativeListenerMap.put(listener, new NativeListener(listener, request.getNumUpdates())); locationManager.requestLocationUpdates(request.getInterval(), - request.getSmallestDesplacement(), makeNativeCriteria(request), + request.getSmallestDisplacement(), makeNativeCriteria(request), nativeListenerMap.get(listener), looper); } diff --git a/play-services-tasks/build.gradle b/play-services-tasks/build.gradle index 271759f8..f4000187 100644 --- a/play-services-tasks/build.gradle +++ b/play-services-tasks/build.gradle @@ -4,16 +4,23 @@ */ apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +apply plugin: 'maven-publish' +apply plugin: 'signing' android { compileSdkVersion androidCompileSdk - buildToolsVersion "$androidBuildVersionTools" + buildToolsVersion "30.0.3" defaultConfig { minSdkVersion androidMinSdk targetSdkVersion androidTargetSdk } + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + compileOptions { sourceCompatibility = 1.8 targetCompatibility = 1.8 @@ -22,4 +29,8 @@ android { dependencies { api project(':play-services-basement') + + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0" + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0" } \ No newline at end of file diff --git a/play-services-tasks/src/main/kotlin/com/google/android/gms/tasks/Tasks.kt b/play-services-tasks/src/main/kotlin/com/google/android/gms/tasks/Tasks.kt new file mode 100644 index 00000000..d002f7f9 --- /dev/null +++ b/play-services-tasks/src/main/kotlin/com/google/android/gms/tasks/Tasks.kt @@ -0,0 +1,153 @@ +/* + * SPDX-FileCopyrightText: 2016, JetBrains s.r.o. + * SPDX-FileCopyrightText: 2021, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.tasks + +import com.google.android.gms.tasks.* +import kotlinx.coroutines.* +import kotlin.coroutines.* + +/** + * Converts this deferred to the instance of [Task]. + * If deferred is cancelled then resulting task will be cancelled as well. + */ +@kotlinx.coroutines.ExperimentalCoroutinesApi +fun Deferred.asTask(): Task { + val cancellation = CancellationTokenSource() + val source = TaskCompletionSource(cancellation.token) + + invokeOnCompletion callback@{ + if (it is CancellationException) { + cancellation.cancel() + return@callback + } + + val t = getCompletionExceptionOrNull() + if (t == null) { + source.setResult(getCompleted()) + } else { + source.setException(t as? Exception ?: RuntimeExecutionException(t)) + } + } + + return source.task +} + +/** + * Converts this task to an instance of [Deferred]. + * If task is cancelled then resulting deferred will be cancelled as well. + * However, the opposite is not true: if the deferred is cancelled, the [Task] will not be cancelled. + * For bi-directional cancellation, an overload that accepts [CancellationTokenSource] can be used. + */ +fun Task.asDeferred(): Deferred = asDeferredImpl(null) + +/** + * Converts this task to an instance of [Deferred] with a [CancellationTokenSource] to control cancellation. + * The cancellation of this function is bi-directional: + * * If the given task is cancelled, the resulting deferred will be cancelled. + * * If the resulting deferred is cancelled, the provided [cancellationTokenSource] will be cancelled. + * + * Providing a [CancellationTokenSource] that is unrelated to the receiving [Task] is not supported and + * leads to an unspecified behaviour. + */ +@ExperimentalCoroutinesApi // Since 1.5.1, tentatively until 1.6.0 +fun Task.asDeferred(cancellationTokenSource: CancellationTokenSource): Deferred = + asDeferredImpl(cancellationTokenSource) + +private fun Task.asDeferredImpl(cancellationTokenSource: CancellationTokenSource?): Deferred { + val deferred = CompletableDeferred() + if (isComplete) { + val e = exception + if (e == null) { + if (isCanceled) { + deferred.cancel() + } else { + @Suppress("UNCHECKED_CAST") + deferred.complete(result as T) + } + } else { + deferred.completeExceptionally(e) + } + } else { + addOnCompleteListener { + val e = it.exception + if (e == null) { + @Suppress("UNCHECKED_CAST") + if (it.isCanceled) deferred.cancel() else deferred.complete(it.result as T) + } else { + deferred.completeExceptionally(e) + } + } + } + + if (cancellationTokenSource != null) { + deferred.invokeOnCompletion { + cancellationTokenSource.cancel() + } + } + // Prevent casting to CompletableDeferred and manual completion. + return object : Deferred by deferred {} +} + +/** + * Awaits the completion of the task without blocking a thread. + * + * This suspending function is cancellable. + * If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function + * stops waiting for the completion stage and immediately resumes with [CancellationException]. + * + * For bi-directional cancellation, an overload that accepts [CancellationTokenSource] can be used. + */ +suspend fun Task.await(): T = awaitImpl(null) + +/** + * Awaits the completion of the task that is linked to the given [CancellationTokenSource] to control cancellation. + * + * This suspending function is cancellable and cancellation is bi-directional: + * * If the [Job] of the current coroutine is cancelled or completed while this suspending function is waiting, this function + * cancels the [cancellationTokenSource] and throws a [CancellationException]. + * * If the task is cancelled, then this function will throw a [CancellationException]. + * + * Providing a [CancellationTokenSource] that is unrelated to the receiving [Task] is not supported and + * leads to an unspecified behaviour. + */ +@ExperimentalCoroutinesApi // Since 1.5.1, tentatively until 1.6.0 +suspend fun Task.await(cancellationTokenSource: CancellationTokenSource): T = awaitImpl(cancellationTokenSource) + +private suspend fun Task.awaitImpl(cancellationTokenSource: CancellationTokenSource?): T { + // fast path + if (isComplete) { + val e = exception + return if (e == null) { + if (isCanceled) { + throw CancellationException("Task $this was cancelled normally.") + } else { + @Suppress("UNCHECKED_CAST") + result as T + } + } else { + throw e + } + } + + return suspendCancellableCoroutine { cont -> + addOnCompleteListener { + val e = it.exception + if (e == null) { + @Suppress("UNCHECKED_CAST") + if (it.isCanceled) cont.cancel() else cont.resume(it.result as T) + } else { + cont.resumeWithException(e) + } + } + + if (cancellationTokenSource != null) { + cont.invokeOnCancellation { + cancellationTokenSource.cancel() + } + } + } +} diff --git a/settings.gradle b/settings.gradle index 9ce0de99..089ba776 100644 --- a/settings.gradle +++ b/settings.gradle @@ -19,4 +19,4 @@ include ':play-services-core' include ':play-services-base' include ':play-services-cast' -include ':play-services-location' +include ':play-services-location' \ No newline at end of file