diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 53ff74d8..00000000 --- a/.gitmodules +++ /dev/null @@ -1,15 +0,0 @@ -[submodule "extern/UnifiedNlp"] - path = extern/UnifiedNlp - url = https://github.com/microg/android_packages_apps_UnifiedNlp.git -[submodule "extern/GmsApi"] - path = extern/GmsApi - url = https://github.com/microg/android_external_GmsApi.git -[submodule "extern/Wearable"] - path = extern/Wearable - url = https://github.com/microg/android_external_Wearable.git -[submodule "extern/GmsLib"] - path = extern/GmsLib - url = https://github.com/microg/android_external_GmsLib.git -[submodule "extern/RemoteDroidGuard"] - path = extern/RemoteDroidGuard - url = https://github.com/microg/android_packages_apps_RemoteDroidGuard.git diff --git a/.travis.yml b/.travis.yml index 87ad538a..daf99eeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ android: components: - tools - platform-tools - - build-tools-29.0.2 - - android-27 - - android-28 + - build-tools-29.0.3 + - android-29 - extra-android-m2repository diff --git a/build.gradle b/build.gradle index b6ffdcde..d9efd03d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,63 +1,110 @@ /* - * Copyright 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. + * SPDX-FileCopyrightText: 2013, microG Project Team + * SPDX-License-Identifier: Apache-2.0 */ buildscript { - ext.kotlin_version = '1.3.21' + ext.nlpVersion = '2.0-alpha1' + ext.remoteDroidGuardVersion = '0.1.1' + ext.safeParcelVersion = '1.6.0' + ext.wearableVersion = '0.1.1' + + ext.kotlinVersion = '1.3.72' + ext.coroutineVersion = '1.3.7' + + ext.annotationVersion = '1.1.0' + ext.appcompatVersion = '1.1.0' + ext.fragmentVersion = '1.2.5' + ext.lifecycleVersion = '2.2.0' + ext.mediarouterVersion = '1.1.0' + ext.multidexVersion = '2.0.1' + ext.navigationVersion = '2.3.0' + ext.preferenceVersion = '1.1.1' + ext.recyclerviewVersion = '1.1.0' + + ext.supportLibraryVersion = "28.0.0" + ext.slf4jVersion = "1.7.25" + + ext.androidBuildGradleVersion = "3.6.3" + + ext.androidBuildVersionTools = "29.0.3" + + ext.androidMinSdk = 14 + ext.androidTargetSdk = 29 + ext.androidCompileSdk = 29 + repositories { jcenter() google() } + dependencies { - classpath 'com.android.tools.build:gradle:3.5.1' - classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "com.android.tools.build:gradle:$androidBuildGradleVersion" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" } } +def execResult(...args) { + def stdout = new ByteArrayOutputStream() + exec { + commandLine args + standardOutput = stdout + } + return stdout.toString().trim() +} + +def gmsVersion = "19.4.20" +def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', '')) +def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').substring(1) +def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD")) +def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').split(' ')[0] +def gitDirty = execResult('git', 'status', '--porcelain').size() > 0 +def ourVersionBase = gitVersionBase.substring(0, gitVersionBase.lastIndexOf('.')) +def ourVersionMinor = Integer.parseInt(ourVersionBase.substring(ourVersionBase.lastIndexOf('.') + 1)) +def ourVersionCode = gmsVersionCode * 1000 + ourVersionMinor * 2 + (gitCommitCount > 0 || gitDirty ? 1 : 0) +def ourVersionName = "$ourVersionBase.$gmsVersionCode" + (gitCommitCount > 0 && !gitDirty ? "-$gitCommitCount" : "") + (gitDirty ? "-dirty" : "") + (gitCommitCount > 0 && !gitDirty ? " ($gitCommitId)" : "") +logger.lifecycle('Starting build for version {} ({})...', ourVersionName, ourVersionCode) + +@Deprecated +String getMyVersionName() { + return ourVersionName +} + +@Deprecated +int getMyVersionCode() { + return ourVersionCode +} + + allprojects { apply plugin: 'idea' - ext.androidBuildVersionTools = "29.0.2" - ext.supportLibraryVersion = "28.0.0" + + group = 'org.microg.gms' + version = ourVersionName + ext.appVersionCode = ourVersionCode ext.isReleaseVersion = false - ext.slf4jVersion = "1.7.25" } -def androidCompileSdk() { return 28 } +@Deprecated +def androidCompileSdk() { return androidCompileSdk } -def androidTargetSdk() { return 29 } +@Deprecated +def androidTargetSdk() { return androidTargetSdk } -def androidMinSdk() { return 14 } +@Deprecated +def androidMinSdk() { return androidMinSdk } +@Deprecated def versionCode() { - def stdout = new ByteArrayOutputStream() - exec { commandLine 'git', 'rev-list', '--count', "HEAD"; standardOutput = stdout } - return Integer.parseInt(stdout.toString().trim()) + return ourVersionCode } +@Deprecated def versionName() { - def stdout = new ByteArrayOutputStream() - if (rootProject.file("gradlew").exists()) - exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } - else // automatic build system, don't tag dirty - exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } - return stdout.toString().trim().substring(1) + return ourVersionName } subprojects { - group = 'org.microg' repositories { jcenter() google() diff --git a/extern/GmsApi b/extern/GmsApi deleted file mode 160000 index 2a43448e..00000000 --- a/extern/GmsApi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2a43448e49dc0aec0d6c53c8a27dd58245fdaba6 diff --git a/extern/GmsLib b/extern/GmsLib deleted file mode 160000 index 15cd4491..00000000 --- a/extern/GmsLib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 15cd4491bcca57d627796b35b69bdf8c97564792 diff --git a/extern/UnifiedNlp b/extern/UnifiedNlp deleted file mode 160000 index 82479b79..00000000 --- a/extern/UnifiedNlp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 82479b79c76353f532e0c6edd0d1dee8d49c48f4 diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..5bac8ac5 --- /dev/null +++ b/gradle.properties @@ -0,0 +1 @@ +android.useAndroidX=true diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d757f3d3..21a8fe40 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip diff --git a/microg-ui-tools b/microg-ui-tools deleted file mode 120000 index d6e8b594..00000000 --- a/microg-ui-tools +++ /dev/null @@ -1 +0,0 @@ -extern/UnifiedNlp/microg-ui-tools/ \ No newline at end of file diff --git a/play-services-api b/play-services-api deleted file mode 120000 index ce1f09ca..00000000 --- a/play-services-api +++ /dev/null @@ -1 +0,0 @@ -extern/GmsApi/play-services-api \ No newline at end of file diff --git a/play-services-api/build.gradle b/play-services-api/build.gradle new file mode 100644 index 00000000..44c2d884 --- /dev/null +++ b/play-services-api/build.gradle @@ -0,0 +1,42 @@ +/* + * Copyright 2013-2015 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. + */ + +apply plugin: 'com.android.library' + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} + +dependencies { + api project(':play-services-basement') + api project(':play-services-cast-api') + api project(':play-services-cast-framework-api') + api project(':play-services-iid-api') + api project(':play-services-location-api') + api project(':play-services-wearable-api') +} diff --git a/play-services-api/gradle.properties b/play-services-api/gradle.properties new file mode 100644 index 00000000..221fda84 --- /dev/null +++ b/play-services-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Internal API +POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +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 + diff --git a/play-services-api/src/main/AndroidManifest.xml b/play-services-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..d4a4d07a --- /dev/null +++ b/play-services-api/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + diff --git a/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl new file mode 100644 index 00000000..75a949b8 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/auth/IAuthManagerService.aidl @@ -0,0 +1,14 @@ +package com.google.android.auth; + +import android.os.Bundle; +import android.accounts.Account; + +import com.google.android.gms.auth.AccountChangeEventsResponse; +import com.google.android.gms.auth.AccountChangeEventsRequest; + +interface IAuthManagerService { + Bundle getToken(String accountName, String scope, in Bundle extras) = 0; + Bundle clearToken(String token, in Bundle extras) = 1; + AccountChangeEventsResponse getChangeEvents(in AccountChangeEventsRequest request) = 2; + Bundle getTokenWithAccount(in Account account, String scope, in Bundle extras) = 4; +} 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/appdatasearch/CorpusStatus.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl new file mode 100644 index 00000000..f893aef8 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/CorpusStatus.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable CorpusStatus; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdate.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdate.aidl new file mode 100644 index 00000000..c7f5e432 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdate.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable PIMEUpdate; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdateResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdateResponse.aidl new file mode 100644 index 00000000..0ae6e4bc --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/PIMEUpdateResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable PIMEUpdateResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/RequestIndexingSpecification.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/RequestIndexingSpecification.aidl new file mode 100644 index 00000000..a0a785c1 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/RequestIndexingSpecification.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable RequestIndexingSpecification; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl new file mode 100644 index 00000000..0b3c47ff --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestSpecification.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable SuggestSpecification; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl new file mode 100644 index 00000000..57d2d63b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/SuggestionResults.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable SuggestionResults; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl new file mode 100644 index 00000000..b52e3d4f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/UsageInfo.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.appdatasearch; + +parcelable UsageInfo; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl new file mode 100644 index 00000000..ebc204c7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/IAppDataSearch.aidl @@ -0,0 +1,14 @@ +package com.google.android.gms.appdatasearch.internal; + +import com.google.android.gms.appdatasearch.CorpusStatus; +import com.google.android.gms.appdatasearch.PIMEUpdateResponse; +import com.google.android.gms.appdatasearch.RequestIndexingSpecification; +import com.google.android.gms.appdatasearch.SuggestionResults; +import com.google.android.gms.appdatasearch.SuggestSpecification; + +interface IAppDataSearch { + SuggestionResults getSuggestions(String var1, String packageName, in String[] accounts, int maxNum, in SuggestSpecification specs) = 1; + boolean requestIndexing(String packageName, String accountName, long l, in RequestIndexingSpecification specs) = 3; + CorpusStatus getStatus(String packageName, String accountName) = 4; + PIMEUpdateResponse requestPIMEUpdate(String s1, String s2, int i, in byte[] bs) = 34; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl new file mode 100644 index 00000000..77e618ac --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearch.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.appdatasearch.internal; + +import com.google.android.gms.appdatasearch.internal.ILightweightAppDataSearchCallbacks; +import com.google.android.gms.appdatasearch.UsageInfo; + +interface ILightweightAppDataSearch { + void view(ILightweightAppDataSearchCallbacks callbacks, String packageName, in UsageInfo[] usageInfos); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl new file mode 100644 index 00000000..338a1427 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/appdatasearch/internal/ILightweightAppDataSearchCallbacks.aidl @@ -0,0 +1,4 @@ +package com.google.android.gms.appdatasearch.internal; + +interface ILightweightAppDataSearchCallbacks { +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl new file mode 100644 index 00000000..206b1a9d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth; + +parcelable AccountChangeEventsRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl new file mode 100644 index 00000000..832e5859 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/AccountChangeEventsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth; + +parcelable AccountChangeEventsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/Credential.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/Credential.aidl new file mode 100644 index 00000000..82536b93 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/Credential.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials; + +parcelable Credential; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/CredentialRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/CredentialRequest.aidl new file mode 100644 index 00000000..d000f32e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/CredentialRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials; + +parcelable CredentialRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.aidl new file mode 100644 index 00000000..7fa0d4ab --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials.internal; + +parcelable DeleteRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.aidl new file mode 100644 index 00000000..814f68da --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials.internal; + +parcelable GeneratePasswordRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsCallbacks.aidl new file mode 100644 index 00000000..da248c33 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsCallbacks.aidl @@ -0,0 +1,10 @@ +package com.google.android.gms.auth.api.credentials.internal; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.auth.api.credentials.Credential; + +interface ICredentialsCallbacks { + void onStatusAndCredential(in Status status, in Credential credential) = 0; + void onStatus(in Status status) = 1; + void onStatusAndString(in Status status, String string) = 2; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsService.aidl new file mode 100644 index 00000000..89c6c7e2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/ICredentialsService.aidl @@ -0,0 +1,15 @@ +package com.google.android.gms.auth.api.credentials.internal; + +import com.google.android.gms.auth.api.credentials.CredentialRequest; +import com.google.android.gms.auth.api.credentials.internal.ICredentialsCallbacks; +import com.google.android.gms.auth.api.credentials.internal.DeleteRequest; +import com.google.android.gms.auth.api.credentials.internal.GeneratePasswordRequest; +import com.google.android.gms.auth.api.credentials.internal.SaveRequest; + +interface ICredentialsService { + void request(ICredentialsCallbacks callbacks, in CredentialRequest request) = 0; + void save(ICredentialsCallbacks callbacks, in SaveRequest request) = 1; + void delete(ICredentialsCallbacks callbacks, in DeleteRequest request) = 2; + void disableAutoSignIn(ICredentialsCallbacks callbacks) = 3; + void generatePassword(ICredentialsCallbacks callbacks, in GeneratePasswordRequest request) = 4; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/SaveRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/SaveRequest.aidl new file mode 100644 index 00000000..b5bcb593 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/auth/api/credentials/internal/SaveRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.auth.api.credentials.internal; + +parcelable SaveRequest; \ No newline at end of file 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 new file mode 100644 index 00000000..6ac61289 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/checkin/internal/ICheckinService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.checkin.internal; + +interface ICheckinService { + String getDeviceDataVersionInfo(); +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/clearcut/LogEventParcelable.aidl b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/LogEventParcelable.aidl new file mode 100644 index 00000000..25041d4d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/LogEventParcelable.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.clearcut; + +parcelable LogEventParcelable; 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 new file mode 100644 index 00000000..58e796ef --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerCallbacks.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.clearcut.internal; + +import com.google.android.gms.common.api.Status; + +interface IClearcutLoggerCallbacks { + void onStatus(in Status status) = 0; +} 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 new file mode 100644 index 00000000..b2f1b2fd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/clearcut/internal/IClearcutLoggerService.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.clearcut.internal; + +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; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GoogleCertificatesQuery.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GoogleCertificatesQuery.aidl new file mode 100644 index 00000000..ae02e068 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/GoogleCertificatesQuery.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.internal; + +parcelable GoogleCertificatesQuery; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ICertData.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ICertData.aidl new file mode 100644 index 00000000..19839d7d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ICertData.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.common.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ICertData { + IObjectWrapper getWrappedBytes(); + int remoteHashCode(); +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl new file mode 100644 index 00000000..da539f32 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/IGoogleCertificatesApi.aidl @@ -0,0 +1,12 @@ +package com.google.android.gms.common.internal; + +import com.google.android.gms.common.internal.GoogleCertificatesQuery; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IGoogleCertificatesApi { + IObjectWrapper getGoogleCertficates(); + IObjectWrapper getGoogleReleaseCertificates(); + boolean isGoogleReleaseSigned(String packageName, IObjectWrapper certData); + boolean isGoogleSigned(String packageName, IObjectWrapper certData); + boolean isGoogleOrPlatformSigned(in GoogleCertificatesQuery query, IObjectWrapper packageManager); +} \ No newline at end of file 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/dynamite/IDynamiteLoader.aidl b/play-services-api/src/main/aidl/com/google/android/gms/dynamite/IDynamiteLoader.aidl new file mode 100644 index 00000000..8cb2be99 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/dynamite/IDynamiteLoader.aidl @@ -0,0 +1,10 @@ +package com.google.android.gms.dynamite; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IDynamiteLoader { + int getModuleVersion(IObjectWrapper context, String moduleId) = 0; + int getModuleVersion2(IObjectWrapper context, String moduleId, boolean updateConfigIfRequired) = 2; + + IObjectWrapper createModuleContext(IObjectWrapper context, String moduleId, int minVersion) = 1; +} \ No newline at end of file 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/http/IGoogleHttpService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl new file mode 100644 index 00000000..58ea0ba5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/http/IGoogleHttpService.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.http; + +import android.os.Bundle; + +interface IGoogleHttpService { + Bundle checkUrl(String url); +} 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..b8866644 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl @@ -0,0 +1,143 @@ +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.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/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/internal/IMeasurementService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/IMeasurementService.aidl new file mode 100644 index 00000000..692d414a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/measurement/internal/IMeasurementService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.measurement.internal; + +interface IMeasurementService { + +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl new file mode 100644 index 00000000..75db9fae --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleCallbacks.aidl @@ -0,0 +1,12 @@ +package com.google.android.gms.people.internal; + +import android.os.Bundle; +import android.os.ParcelFileDescriptor; + +import com.google.android.gms.common.data.DataHolder; + +interface IPeopleCallbacks { + void onDataHolder(int code, in Bundle resolution, in DataHolder holder) = 1; + void onDataHolders(int code, in Bundle resolution, in DataHolder[] holders) = 3; + void onParcelFileDescriptor(int code, in Bundle resolution, in ParcelFileDescriptor fileDescriptor, in Bundle extras) = 4; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl new file mode 100644 index 00000000..62ae1478 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/people/internal/IPeopleService.aidl @@ -0,0 +1,44 @@ +package com.google.android.gms.people.internal; + +import android.os.Bundle; + +import com.google.android.gms.people.internal.IPeopleCallbacks; +import com.google.android.gms.common.server.FavaDiagnosticsEntity; +import com.google.android.gms.common.internal.ICancelToken; + +interface IPeopleService { + // void loadOwners1(IPeopleCallbacks var1, boolean var2, boolean var3, String var4, String var5); + // void loadCirclesOld(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6); + // void loadPeopleOld(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, int var6, boolean var7, long var8); + // void loadAvatarLegacy(IPeopleCallbacks var1, String var2, int var3, int var4); + // void loadContactImageLegacy(IPeopleCallbacks var1, long var2, boolean var4); + // void blockPerson(IPeopleCallbacks var1, String var2, String var3, String var4, boolean var5); + // Bundle syncRawContact(in Uri var1); + // void loadPeopleForAggregation8(IPeopleCallbacks var1, String var2, String var3, String var4, boolean var5, int var6); + // void setSyncToContactsSettings(IPeopleCallbacks var1, String var2, boolean var3, in String[] var4); + + // Bundle startSync(String var1, String var2); + // void requestSync(IPeopleCallbacks var1, String var2, String var3, in Uri var4); + // void updatePersonCirclesOld(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, in List var6); + // boolean isSyncToContactsEnabled(); + // Bundle requestSyncOld(String var1, String var2); + // void setAvatar(IPeopleCallbacks var1, String var2, String var3, in Uri var4, boolean var5); + // void loadCircles(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6, boolean var7); + // Bundle requestSyncOld19(String var1, String var2, long var3); + // void loadPeople20(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, int var6, boolean var7, long var8, String var10, int var11); + // void loadPeopleLive(IPeopleCallbacks var1, String var2, String var3, String var4, int var5, String var6); + // void updatePersonCircles(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5, in List var6, in FavaDiagnosticsEntity var7); + // void loadRemoteImageLegacy(IPeopleCallbacks var1, String var2); + // void loadContactsGaiaIds24(IPeopleCallbacks var1, String var2, String var3); + // Bundle requestSyncOld25(String var1, String var2, long var3, boolean var5); + // void addCircle(IPeopleCallbacks var1, String var2, String var3, String var4, String var5); + // void addPeopleToCircle(IPeopleCallbacks var1, String var2, String var3, String var4, in List var5); + + Bundle registerDataChangedListener(IPeopleCallbacks callbacks, boolean register, String var3, String var4, int scopes) = 10; + void loadCircles(IPeopleCallbacks callbacks, String account, String pageGaiaId, String circleId, int type, String var6, boolean var7) = 18; + Bundle requestSync(String account, String var2, long var3, boolean var5, boolean var6) = 204; + void loadOwners(IPeopleCallbacks callbacks, boolean var2, boolean var3, String account, String var5, int sortOrder) = 304; + void loadPeopleForAggregation(IPeopleCallbacks callbacks, String account, String var3, String filter, int var5, boolean var6, int var7, int var8, String var9, boolean var10, int var11, int var12) = 401; + ICancelToken loadOwnerAvatar(IPeopleCallbacks callbacks, String account, String pageId, int size, int flags) = 504; + ICancelToken loadAutocompleteList(IPeopleCallbacks callbacks, String account, String pageId, boolean directorySearch, String var5, String query, int autocompleteType, int var8, int numberOfResults, boolean var10) = 506; +} 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 new file mode 100644 index 00000000..86169b99 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/IPlayLogService.aidl @@ -0,0 +1,9 @@ +package com.google.android.gms.playlog.internal; + +import com.google.android.gms.playlog.internal.LogEvent; +import com.google.android.gms.playlog.internal.PlayLoggerContext; + +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/LogEvent.aidl b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/LogEvent.aidl new file mode 100644 index 00000000..6e7bed53 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/LogEvent.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.playlog.internal; + +parcelable LogEvent; 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 new file mode 100644 index 00000000..9cc0e0e4 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/playlog/internal/PlayLoggerContext.aidl @@ -0,0 +1,3 @@ +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/safetynet/AttestationData.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/AttestationData.aidl new file mode 100644 index 00000000..f1e056b4 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/AttestationData.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.safetynet; + +parcelable AttestationData; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/safetynet/HarmfulAppsData.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/HarmfulAppsData.aidl new file mode 100644 index 00000000..9e5456b0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/HarmfulAppsData.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.safetynet; + +parcelable HarmfulAppsData; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/safetynet/SafeBrowsingData.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/SafeBrowsingData.aidl new file mode 100644 index 00000000..5b18294d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/SafeBrowsingData.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.safetynet; + +parcelable SafeBrowsingData; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetCallbacks.aidl new file mode 100644 index 00000000..fe57be6d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetCallbacks.aidl @@ -0,0 +1,14 @@ +package com.google.android.gms.safetynet.internal; + +import com.google.android.gms.common.api.Status; +import com.google.android.gms.safetynet.AttestationData; +import com.google.android.gms.safetynet.HarmfulAppsData; +import com.google.android.gms.safetynet.SafeBrowsingData; + +interface ISafetyNetCallbacks { + void onAttestationData(in Status status, in AttestationData attestationData) = 0; + void onString(String s) = 1; + void onSafeBrowsingData(in Status status, in SafeBrowsingData safeBrowsingData) = 2; + void onBoolean(in Status status, boolean b) = 3; + void onHarmfulAppsData(in Status status, in List harmfulAppsData) = 4; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetService.aidl new file mode 100644 index 00000000..7dfc749b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/safetynet/internal/ISafetyNetService.aidl @@ -0,0 +1,12 @@ +package com.google.android.gms.safetynet.internal; + +import com.google.android.gms.safetynet.internal.ISafetyNetCallbacks; + +interface ISafetyNetService { + void attest(ISafetyNetCallbacks callbacks, in byte[] nonce) = 0; + void attestWithApiKey(ISafetyNetCallbacks callbacks, in byte[] nonce, String apiKey) = 6; + void getSharedUuid(ISafetyNetCallbacks callbacks) = 1; + void lookupUri(ISafetyNetCallbacks callbacks, String s1, in int[] threatTypes, int i, String s2) = 2; + void init(ISafetyNetCallbacks callbacks) = 3; + void getHarmfulAppsList(ISafetyNetCallbacks callbacks) = 4; +} \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/administration/internal/ISearchAdministrationService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/administration/internal/ISearchAdministrationService.aidl new file mode 100644 index 00000000..404544c2 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/administration/internal/ISearchAdministrationService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.search.administration.internal; + +interface ISearchAdministrationService { + +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/ClearCorpusRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/ClearCorpusRequest.aidl new file mode 100644 index 00000000..9f718934 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/ClearCorpusRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable ClearCorpusRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusInfoRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusInfoRequest.aidl new file mode 100644 index 00000000..11b0a4dc --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusInfoRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable GetCorpusInfoRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusRequest.aidl new file mode 100644 index 00000000..b2e549d7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable GetCorpusStatusRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusResponse.aidl new file mode 100644 index 00000000..a837a7db --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/GetCorpusStatusResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable GetCorpusStatusResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingRequest.aidl new file mode 100644 index 00000000..ad68ef35 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable RequestIndexingRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingResponse.aidl new file mode 100644 index 00000000..7aaa548c --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/RequestIndexingResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.corpora; + +parcelable RequestIndexingResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaCallbacks.aidl new file mode 100644 index 00000000..863b016f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaCallbacks.aidl @@ -0,0 +1,9 @@ +package com.google.android.gms.search.corpora.internal; + +import com.google.android.gms.search.corpora.RequestIndexingResponse; +import com.google.android.gms.search.corpora.GetCorpusStatusResponse; + +interface ISearchCorporaCallbacks { + void onRequestIndexing(in RequestIndexingResponse response) = 1; + void onGetCorpusStatus(in GetCorpusStatusResponse response) = 3; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl new file mode 100644 index 00000000..fe2073c0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/corpora/internal/ISearchCorporaService.aidl @@ -0,0 +1,14 @@ +package com.google.android.gms.search.corpora.internal; + +import com.google.android.gms.search.corpora.ClearCorpusRequest; +import com.google.android.gms.search.corpora.GetCorpusStatusRequest; +import com.google.android.gms.search.corpora.GetCorpusInfoRequest; +import com.google.android.gms.search.corpora.RequestIndexingRequest; +import com.google.android.gms.search.corpora.internal.ISearchCorporaCallbacks; + +interface ISearchCorporaService { + void requestIndexing(in RequestIndexingRequest request, ISearchCorporaCallbacks callbacks) = 1; + void clearCorpus(in ClearCorpusRequest request, ISearchCorporaCallbacks callbacks) = 2; + void getCorpusStatus(in GetCorpusStatusRequest request, ISearchCorporaCallbacks callbacks) = 3; + void getCorpusInfo(in GetCorpusInfoRequest request, ISearchCorporaCallbacks callbacks) = 4; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.aidl new file mode 100644 index 00000000..426cbe47 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetCurrentExperimentIdsRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.aidl new file mode 100644 index 00000000..8fdb4567 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetCurrentExperimentIdsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.aidl new file mode 100644 index 00000000..986ab4db --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetGlobalSearchSourcesRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.aidl new file mode 100644 index 00000000..86d52a13 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetGlobalSearchSourcesResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.aidl new file mode 100644 index 00000000..8d7382ed --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetPendingExperimentIdsRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.aidl new file mode 100644 index 00000000..ca99ad5f --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable GetPendingExperimentIdsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsRequest.aidl new file mode 100644 index 00000000..2bd4d8b3 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable SetExperimentIdsRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsResponse.aidl new file mode 100644 index 00000000..ff552760 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetExperimentIdsResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable SetExperimentIdsResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.aidl new file mode 100644 index 00000000..79cbb179 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable SetIncludeInGlobalSearchRequest; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.aidl new file mode 100644 index 00000000..a5f2d6d0 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.global; + +parcelable SetIncludeInGlobalSearchResponse; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminCallbacks.aidl new file mode 100644 index 00000000..b08d9530 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminCallbacks.aidl @@ -0,0 +1,16 @@ +package com.google.android.gms.search.global.internal; + +import com.google.android.gms.search.global.GetCurrentExperimentIdsResponse; +import com.google.android.gms.search.global.GetGlobalSearchSourcesResponse; +import com.google.android.gms.search.global.GetPendingExperimentIdsResponse; +import com.google.android.gms.search.global.SetExperimentIdsResponse; +import com.google.android.gms.search.global.SetIncludeInGlobalSearchResponse; + +interface IGlobalSearchAdminCallbacks { + void onGetGlobalSearchSourcesResponse(in GetGlobalSearchSourcesResponse request) = 1; + void onSetExperimentIdsResponse(in SetExperimentIdsResponse response) = 2; + void onGetCurrentExperimentIdsResponse(in GetCurrentExperimentIdsResponse response) = 3; + void onGetPendingExperimentIdsResponse(in GetPendingExperimentIdsResponse response) = 4; + + void onSetIncludeInGlobalSearchResponse(in SetIncludeInGlobalSearchResponse response) = 7; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl new file mode 100644 index 00000000..95bc32a7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/global/internal/IGlobalSearchAdminService.aidl @@ -0,0 +1,17 @@ +package com.google.android.gms.search.global.internal; + +import com.google.android.gms.search.global.GetCurrentExperimentIdsRequest; +import com.google.android.gms.search.global.GetGlobalSearchSourcesRequest; +import com.google.android.gms.search.global.GetPendingExperimentIdsRequest; +import com.google.android.gms.search.global.SetExperimentIdsRequest; +import com.google.android.gms.search.global.SetIncludeInGlobalSearchRequest; +import com.google.android.gms.search.global.internal.IGlobalSearchAdminCallbacks; + +interface IGlobalSearchAdminService { + void getGlobalSearchSources(in GetGlobalSearchSourcesRequest request, IGlobalSearchAdminCallbacks callbacks) = 1; + void setExperimentIds(in SetExperimentIdsRequest request, IGlobalSearchAdminCallbacks callbacks) = 2; + void getCurrentExperimentIds(in GetCurrentExperimentIdsRequest request, IGlobalSearchAdminCallbacks callbacks) = 3; + void getPendingExperimentIds(in GetPendingExperimentIdsRequest request, IGlobalSearchAdminCallbacks callbacks) = 4; + + void setIncludeInGlobalSearch(in SetIncludeInGlobalSearchRequest request, IGlobalSearchAdminCallbacks callbacks) = 7; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryRequest.aidl new file mode 100644 index 00000000..1986e95d --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.queries; + +parcelable QueryRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryResponse.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryResponse.aidl new file mode 100644 index 00000000..97047253 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/QueryResponse.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.search.queries; + +parcelable QueryResponse; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesCallbacks.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesCallbacks.aidl new file mode 100644 index 00000000..8bcb891e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesCallbacks.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.search.queries.internal; + +import com.google.android.gms.search.queries.QueryResponse; + +interface ISearchQueriesCallbacks { + void onQuery(in QueryResponse response) = 1; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesService.aidl new file mode 100644 index 00000000..091cdae5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/search/queries/internal/ISearchQueriesService.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.search.queries.internal; + +import com.google.android.gms.search.queries.QueryRequest; +import com.google.android.gms.search.queries.internal.ISearchQueriesCallbacks; + +interface ISearchQueriesService { + void query(in QueryRequest request, ISearchQueriesCallbacks callbacks) = 1; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl new file mode 100644 index 00000000..622b0ba7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/tapandpay/internal/ITapAndPayService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.tapandpay.internal; + +interface ITapAndPayService { + +} 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..d9cb9209 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/wallet/internal/IOwService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.wallet.internal; + +interface IOwService { + +} diff --git a/play-services-api/src/main/aidl/com/google/firebase/auth/api/internal/IFirebaseAuthService.aidl b/play-services-api/src/main/aidl/com/google/firebase/auth/api/internal/IFirebaseAuthService.aidl new file mode 100644 index 00000000..6269896b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/firebase/auth/api/internal/IFirebaseAuthService.aidl @@ -0,0 +1,5 @@ +package com.google.firebase.auth.api.internal; + +interface IFirebaseAuthService { + +} \ No newline at end of file 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/java/com/google/android/gms/appdatasearch/CorpusStatus.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java new file mode 100644 index 00000000..5c71ea0c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/CorpusStatus.java @@ -0,0 +1,46 @@ +/* + * 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.appdatasearch; + +import android.os.Bundle; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class CorpusStatus extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode; + @SafeParceled(1) + public boolean found; + @SafeParceled(2) + public long lastIndexedSeqno; + @SafeParceled(3) + public long lastCommittedSeqno; + @SafeParceled(4) + public long committedNumDocuments; + @SafeParceled(5) + public Bundle counters; + @SafeParceled(6) + public String g; + + public CorpusStatus() { + versionCode = 2; + } + + public static final Creator CREATOR = new AutoCreator(CorpusStatus.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java new file mode 100644 index 00000000..2f8a596f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdate.java @@ -0,0 +1,24 @@ +/* + * 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class PIMEUpdate extends AutoSafeParcelable { + + public static final Creator CREATOR = new AutoCreator(PIMEUpdate.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java new file mode 100644 index 00000000..d542f48f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/PIMEUpdateResponse.java @@ -0,0 +1,42 @@ +/* + * 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class PIMEUpdateResponse extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode; + + @SafeParceled(1) + private String b; + + @SafeParceled(2) + public final byte[] bytes; + + @SafeParceled(3) + public final PIMEUpdate[] updates; + + public PIMEUpdateResponse() { + versionCode = 1; + this.bytes = null; + this.updates = new PIMEUpdate[0]; + } + + public static final Creator CREATOR = new AutoCreator(PIMEUpdateResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java new file mode 100644 index 00000000..1be52c8f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/QuerySpecification.java @@ -0,0 +1,72 @@ +/* + * 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; + +public class QuerySpecification extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 2; + @SafeParceled(1) + public final boolean b; + //@SafeParceled(value = 2, subType = "TODO") + public final List c; + //@SafeParceled(value = 3, subType = "TODO") + public final List d; + @SafeParceled(4) + public final boolean e; + @SafeParceled(5) + public final int f; + @SafeParceled(6) + public final int g; + @SafeParceled(7) + public final boolean h; + @SafeParceled(8) + public final int i; + + private QuerySpecification() { + b = false; + c = null; + d = null; + e = false; + f = 0; + g = 0; + h = false; + i = 0; + } + + @Override + public String toString() { + return "QuerySpecification{" + + "versionCode=" + versionCode + + ", b=" + b + + ", c=" + c + + ", d=" + d + + ", e=" + e + + ", f=" + f + + ", g=" + g + + ", h=" + h + + ", i=" + i + + '}'; + } + + public static final Creator CREATOR = new AutoCreator(QuerySpecification.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java new file mode 100644 index 00000000..720f773c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/RequestIndexingSpecification.java @@ -0,0 +1,28 @@ +/* + * 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class RequestIndexingSpecification extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode; + + public static final Creator CREATOR = new AutoCreator(RequestIndexingSpecification.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java new file mode 100644 index 00000000..fec25f00 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SearchResults.java @@ -0,0 +1,27 @@ +/* + * 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SearchResults extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 2; + + public static Creator CREATOR = new AutoCreator(SearchResults.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java new file mode 100644 index 00000000..0f80a053 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestSpecification.java @@ -0,0 +1,31 @@ +/* + * 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SuggestSpecification extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode; + + public SuggestSpecification() { + versionCode = 2; + } + + public static final Creator CREATOR = new AutoCreator(SuggestSpecification.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java new file mode 100644 index 00000000..f616d51d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/SuggestionResults.java @@ -0,0 +1,54 @@ +/* + * 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SuggestionResults extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode; + @SafeParceled(1) + public final String errorMessage; + + @SafeParceled(2) + public final String[] s1; + @SafeParceled(3) + public final String[] s2; + + private SuggestionResults() { + versionCode = 2; + errorMessage = null; + s1 = s2 = null; + } + + public SuggestionResults(String errorMessage) { + versionCode = 2; + this.errorMessage = errorMessage; + this.s1 = null; + this.s2 = null; + } + + public SuggestionResults(String[] s1, String[] s2) { + versionCode = 2; + this.errorMessage = null; + this.s1 = s1; + this.s2 = s2; + } + + public static final Creator CREATOR = new AutoCreator(SuggestionResults.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java new file mode 100644 index 00000000..a2f0f9e7 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/appdatasearch/UsageInfo.java @@ -0,0 +1,24 @@ +/* + * 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.appdatasearch; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class UsageInfo extends AutoSafeParcelable { + + public static Creator CREATOR = new AutoCreator(UsageInfo.class); +} 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 new file mode 100644 index 00000000..0485f3a2 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEvent.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.auth; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AccountChangeEvent extends AutoSafeParcelable { + 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 new file mode 100644 index 00000000..0d7f5cd8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsRequest.java @@ -0,0 +1,32 @@ +/* + * 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.auth; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AccountChangeEventsRequest extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private int i; + @SafeParceled(3) + private String s; + + 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 new file mode 100644 index 00000000..0bff57a8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/AccountChangeEventsResponse.java @@ -0,0 +1,36 @@ +/* + * 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.auth; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.ArrayList; +import java.util.List; + +public class AccountChangeEventsResponse extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(value = 2, subClass = AccountChangeEvent.class) + private List events; + + public AccountChangeEventsResponse() { + events = new ArrayList(); + } + + 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 new file mode 100644 index 00000000..3b7d45f5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/TokenData.java @@ -0,0 +1,64 @@ +/* + * 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.auth; + +import com.google.android.gms.common.api.Scope; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; + +public class TokenData extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + public final String token; + + @SafeParceled(3) + public final Long expiry; + + @SafeParceled(5) + public final boolean isOAuth; + + @SafeParceled(value = 6, subClass = Scope.class) + public final List scopes; + + public TokenData() { + token = null; + expiry = null; + isOAuth = false; + scopes = null; + } + + public TokenData(String token, Long expiry, boolean isOAuth, List scopes) { + this.token = token; + this.expiry = expiry; + this.isOAuth = isOAuth; + this.scopes = scopes; + } + + public TokenData(String token, Long expiry) { + this.token = token; + this.expiry = expiry; + this.isOAuth = false; + this.scopes = null; + } + + 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 new file mode 100644 index 00000000..13ee988e --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/Credential.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.auth.api.credentials; + +import android.net.Uri; +import android.text.TextUtils; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; +import java.util.List; +import java.util.Locale; + +@PublicApi +public class Credential extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private String id; + + @SafeParceled(2) + private String name; + + @SafeParceled(3) + private Uri profilePictureUri; + + @SafeParceled(value = 4, subClass = IdToken.class) + private List tokens; + + @SafeParceled(5) + private String password; + + @SafeParceled(6) + private String accountType; + + @SafeParceled(7) + private String generatedPassword; + + private Credential() { + } + + /** + * Returns the type of federated identity account used to sign in the user. While this may be + * any string, it is strongly recommended that values from {@link com.google.android.gms.auth.api.credentials.IdentityProviders} + * are used, which are the login domains for common identity providers. + * + * @return A string identifying the federated identity provider associated with this account, + * typically in the form of the identity provider's login domain. null will be returned if the + * credential is a password credential. + */ + public String getAccountType() { + return accountType; + } + + /** + * Returns the generated password for an account hint. + */ + public String getGeneratedPassword() { + return generatedPassword; + } + + /** + * Returns the credential identifier, typically an email address or user name, though it may + * also be some encoded unique identifier for a federated identity account. + */ + public String getId() { + return id; + } + + /** + * Returns the ID tokens that assert the identity of the user, if available. ID tokens provide + * a secure mechanism to verify that the user owns the identity asserted by the credential. + *

+ * This is useful for account hints, where the ID token can replace the need to separately + * verify that the user owns their claimed email address - with a valid ID token, it is not + * necessary to send an account activation link to the address, simplifying the account + * creation process for the user. + *

+ * A signed ID token is returned automatically for credential hints when the credential ID is a + * Google account that is authenticated on the device. This ID token can be sent along with + * your application's account creation operation, where the signature can be verified. + */ + public List getIdTokens() { + return tokens; + } + + /** + * Returns the display name of the credential, if available. Typically, the display name will + * be the name of the user, or some other string which the user can easily recognize and + * distinguish from other accounts they may have. + */ + public String getName() { + return name; + } + + /** + * Returns the password used to sign in the user. + */ + public String getPassword() { + return password; + } + + /** + * Returns the URL to an image of the user, if available. + */ + public Uri getProfilePictureUri() { + return profilePictureUri; + } + + @PublicApi(exclude = true) + public String getAsString() { + if (TextUtils.isEmpty(accountType)) { + return id.toLowerCase(Locale.US) + "|"; + } else { + Uri uri = Uri.parse(accountType); + return id.toLowerCase(Locale.US) + "|" + (TextUtils.isEmpty(uri.getScheme()) ? "" : uri.getScheme().toLowerCase(Locale.US)) + "://" + + (TextUtils.isEmpty(uri.getHost()) ? "unknown" : uri.getHost().toLowerCase(Locale.US)) + ":" + uri.getPort(); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || !(o instanceof Credential)) return false; + + Credential that = (Credential) o; + + 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 (password != null ? !password.equals(that.password) : that.password != null) + return false; + if (accountType != null ? !accountType.equals(that.accountType) : that.accountType != null) + return false; + return generatedPassword != null ? generatedPassword.equals(that.generatedPassword) : that.generatedPassword == null; + + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[]{id, name, profilePictureUri, password, accountType, generatedPassword}); + } + + public static class Builder { + private String id; + private String name; + private Uri profilePictureUri; + private String password; + private String accountType; + + @PublicApi(exclude = true) + public List tokens; + @PublicApi(exclude = true) + private String generatedPassword; + + public Builder(String id) { + this.id = id; + } + + /** + * Copies the information stored in an existing credential, in order to allow that information to be modified. + * + * @param credential the existing credential + */ + public Builder(Credential credential) { + this.id = credential.id; + this.name = credential.name; + this.profilePictureUri = credential.profilePictureUri; + this.password = credential.password; + this.accountType = credential.accountType; + this.tokens = credential.tokens; + this.generatedPassword = credential.generatedPassword; + } + + public Credential build() { + Credential credential = new Credential(); + credential.id = id; + credential.name = name; + credential.profilePictureUri = profilePictureUri; + credential.password = password; + credential.accountType = accountType; + credential.tokens = tokens; + credential.generatedPassword = generatedPassword; + return credential; + } + + /** + * Specifies the account type for a federated credential. The value should be set to + * identity provider's login domain, such as "https://accounts.google.com" for Google + * accounts. The login domains for common identity providers are listed in {@link IdentityProviders}. + * + * @param accountType The type of the account. Typically, one of the values in {@link IdentityProviders}. + */ + public Builder setAccountType(String accountType) { + this.accountType = accountType; + return this; + } + + /** + * Sets the display name for the credential, which should be easy for the user to recognize + * as associated to the credential, and distinguishable from other credentials they may + * have. This string will be displayed more prominently than, or instead of, the account ID + * whenever available. In most cases, the name of the user is sufficient. + */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** + * Sets the password for the credential. Either the password or the account type must be + * set for a credential, but not both. + */ + public Builder setPassword(String password) { + this.password = password; + return this; + } + + /** + * Sets a profile picture associated with the credential, typically a picture the user has + * selected to represent the account. + */ + public Builder setProfilePictureUri(Uri profilePictureUri) { + this.profilePictureUri = profilePictureUri; + return this; + } + } + + 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 new file mode 100644 index 00000000..67d66c05 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialPickerConfig.java @@ -0,0 +1,92 @@ +/* + * 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.auth.api.credentials; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class CredentialPickerConfig extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private boolean showAddAccountButton; + + @SafeParceled(2) + private boolean showCancelButton; + + @SafeParceled(3) + private boolean forNewAccount; + + private CredentialPickerConfig() { + } + + public CredentialPickerConfig(boolean showAddAccountButton, boolean showCancelButton, boolean forNewAccount) { + this.showAddAccountButton = showAddAccountButton; + this.showCancelButton = showCancelButton; + this.forNewAccount = forNewAccount; + } + + public boolean isForNewAccount() { + return forNewAccount; + } + + public boolean shouldShowAddAccountButton() { + return showAddAccountButton; + } + + public boolean shouldShowCancelButton() { + return showCancelButton; + } + + public class Builder { + private boolean showAddAccountButton; + private boolean showCancelButton; + private boolean forNewAccount; + + public CredentialPickerConfig build() { + return new CredentialPickerConfig(showAddAccountButton, showCancelButton, forNewAccount); + } + + /** + * Sets whether the hint request is for a new account sign-up flow. + */ + public Builder setForNewAccount(boolean forNewAccount) { + this.forNewAccount = forNewAccount; + return this; + } + + /** + * Sets whether the add account button should be shown in credential picker dialog. + */ + public Builder setShowAddAccountButton(boolean showAddAccountButton) { + this.showAddAccountButton = showAddAccountButton; + return this; + } + + /** + * Sets whether the cancel button should be shown in credential picker dialog. + */ + public Builder setShowCancelButton(boolean showCancelButton) { + this.showCancelButton = showCancelButton; + return this; + } + } + + 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 new file mode 100644 index 00000000..80819c71 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/CredentialRequest.java @@ -0,0 +1,75 @@ +/* + * 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.auth.api.credentials; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Parameters for requesting a Credential, via Auth.CredentialsApi.request(). Instances can be + * created using CredentialRequest.Builder. + */ +public class CredentialRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private boolean passwordLoginSupported; + + @SafeParceled(2) + private String[] accountTypes; + + @SafeParceled(3) + private CredentialPickerConfig credentialPickerConfig; + + @SafeParceled(4) + private CredentialPickerConfig credentialHintPickerConfig; + + public CredentialRequest(boolean passwordLoginSupported, String[] accountTypes, CredentialPickerConfig credentialPickerConfig, CredentialPickerConfig credentialHintPickerConfig) { + this.passwordLoginSupported = passwordLoginSupported; + this.accountTypes = accountTypes; + this.credentialPickerConfig = credentialPickerConfig; + this.credentialHintPickerConfig = credentialHintPickerConfig; + } + + public String[] getAccountTypes() { + return accountTypes; + } + + public CredentialPickerConfig getCredentialHintPickerConfig() { + return credentialHintPickerConfig; + } + + public CredentialPickerConfig getCredentialPickerConfig() { + return credentialPickerConfig; + } + + /** + * @deprecated Use {@link #isPasswordLoginSupported()} + */ + @Deprecated + public boolean getSupportsPasswordLogin() { + return isPasswordLoginSupported(); + } + + public boolean isPasswordLoginSupported() { + return passwordLoginSupported; + } + + public static final Creator CREATOR = new AutoCreator(CredentialRequest.class); +} 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 new file mode 100644 index 00000000..2ef78f95 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/IdToken.java @@ -0,0 +1,58 @@ +/* + * 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.auth.api.credentials; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +@PublicApi +public class IdToken extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private String accountType; + + @SafeParceled(2) + private String id; + + private IdToken() { + } + + public IdToken(String accountType, String id) { + this.accountType = accountType; + this.id = id; + } + + /** + * Returns {@code AccountManager} account type for the token. + */ + public String getAccountType() { + return accountType; + } + + /** + * Returns the ID token, formatted according to the rules defined by the account type. + */ + public String getIdToken() { + return id; + } + + 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/internal/DeleteRequest.java b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.java new file mode 100644 index 00000000..bd7ae6f2 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/DeleteRequest.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.auth.api.credentials.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class DeleteRequest extends AutoSafeParcelable { + 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 new file mode 100644 index 00000000..3da7a72a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/GeneratePasswordRequest.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.auth.api.credentials.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GeneratePasswordRequest extends AutoSafeParcelable { + 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 new file mode 100644 index 00000000..5ec25998 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/api/credentials/internal/SaveRequest.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.auth.api.credentials.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class SaveRequest extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(SaveRequest.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 new file mode 100644 index 00000000..6c73b4bc --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRecoveryGuidanceRequest.java @@ -0,0 +1,46 @@ +/* + * 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.auth.firstparty.dataservice; + +import android.accounts.Account; + +import org.microg.gms.auth.AuthConstants; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AccountRecoveryGuidanceRequest extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + @Deprecated + public final String accountName; + @SafeParceled(3) + public final Account account; + + public AccountRecoveryGuidanceRequest(String accountName) { + this.accountName = accountName; + this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE); + } + + public AccountRecoveryGuidanceRequest(Account account) { + this.accountName = account.name; + this.account = account; + } + + 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 new file mode 100644 index 00000000..cd56eb1a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/AccountRemovalRequest.java @@ -0,0 +1,46 @@ +/* + * 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.auth.firstparty.dataservice; + +import android.accounts.Account; + +import org.microg.gms.auth.AuthConstants; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AccountRemovalRequest extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + @Deprecated + public final String accountName; + @SafeParceled(3) + public final Account account; + + public AccountRemovalRequest(String accountName) { + this.accountName = accountName; + this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE); + } + + public AccountRemovalRequest(Account account) { + this.accountName = account.name; + this.account = account; + } + + 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 new file mode 100644 index 00000000..c7db433b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/ConfirmCredentialsRequest.java @@ -0,0 +1,34 @@ +/* + * 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.auth.firstparty.dataservice; + +import com.google.android.gms.auth.firstparty.shared.AccountCredentials; +import com.google.android.gms.auth.firstparty.shared.CaptchaSolution; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ConfirmCredentialsRequest extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public AccountCredentials accountCredentials; + @SafeParceled(3) + public CaptchaSolution captchaSolution; + + 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 new file mode 100644 index 00000000..4a200050 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenRequest.java @@ -0,0 +1,44 @@ +/* + * 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.auth.firstparty.dataservice; + +import android.accounts.Account; +import android.os.Bundle; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +// TODO +public class TokenRequest extends AutoSafeParcelable{ + + @SafeParceled(1) + private int versionCode = 4; + @SafeParceled(3) + public String accountName; + @SafeParceled(4) + public Bundle extras; + @SafeParceled(9) + public String consent; + @SafeParceled(15) + public String accountType; + + public Account getAccount() { + return new Account(accountName, accountType); + } + + public static final Creator CREATOR = new AutoCreator(TokenRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.java new file mode 100644 index 00000000..999e9a96 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/dataservice/TokenResponse.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.auth.firstparty.dataservice; + +public class TokenResponse { +} 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 new file mode 100644 index 00000000..0091dee5 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/delegate/ConfirmCredentialsWorkflowRequest.java @@ -0,0 +1,43 @@ +/* + * 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.auth.firstparty.delegate; + +import android.accounts.Account; +import android.accounts.AccountAuthenticatorResponse; +import android.os.Bundle; + +import com.google.android.gms.auth.firstparty.shared.AppDescription; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ConfirmCredentialsWorkflowRequest extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 3; + @SafeParceled(2) + public String accountName; + @SafeParceled(3) + public AppDescription appDescription; + @SafeParceled(4) + public Bundle extras; + @SafeParceled(5) + public Account account; + @SafeParceled(6) + public AccountAuthenticatorResponse accountAuthenticatorResponse; + + public static final Creator CREATOR = new AutoCreator(ConfirmCredentialsWorkflowRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.java new file mode 100644 index 00000000..139bf29b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/proximity/data/Permit.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.auth.firstparty.proximity.data; + +public class Permit { +} 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 new file mode 100644 index 00000000..4b57130d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AccountCredentials.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.auth.firstparty.shared; + +import android.accounts.Account; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +// TODO +public class AccountCredentials extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 2; + @SafeParceled(3) + public String accountName; + @SafeParceled(9) + public String accountType; + + public Account getAccount() { + return new Account(accountName, accountType); + } + + 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 new file mode 100644 index 00000000..9e339e81 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/AppDescription.java @@ -0,0 +1,35 @@ +/* + * 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.auth.firstparty.shared; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AppDescription extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public int callingUid; + @SafeParceled(3) + public String sessiondId; + @SafeParceled(4) + public String sessiondSig; + @SafeParceled(5) + public String callingPkg; + + 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 new file mode 100644 index 00000000..9563798e --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/auth/firstparty/shared/CaptchaSolution.java @@ -0,0 +1,29 @@ +/* + * 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.auth.firstparty.shared; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +// TODO +public class CaptchaSolution extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + + 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 new file mode 100644 index 00000000..81042a97 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/clearcut/LogEventParcelable.java @@ -0,0 +1,104 @@ +/* + * 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.clearcut; + +import android.util.Base64; + +import com.google.android.gms.playlog.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.util.Arrays; + +public class LogEventParcelable extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + public final PlayLoggerContext context; + + @SafeParceled(3) + public final byte[] bytes; + + @SafeParceled(4) + public final int[] testCodes; + + @SafeParceled(5) + public final String[] mendelPackages; + + @SafeParceled(6) + public final int[] experimentIds; + + @SafeParceled(7) + public final byte[][] experimentTokens; + + @SafeParceled(8) + public final boolean addPhenotypeExperimentTokens; + + private LogEventParcelable() { + context = null; + bytes = null; + testCodes = experimentIds = null; + mendelPackages = null; + experimentTokens = null; + addPhenotypeExperimentTokens = false; + } + + public LogEventParcelable(PlayLoggerContext context, byte[] bytes, int[] testCodes, String[] mendelPackages, int[] experimentIds, byte[][] experimentTokens, boolean addPhenotypeExperimentTokens) { + this.context = context; + this.bytes = bytes; + this.testCodes = testCodes; + this.mendelPackages = mendelPackages; + this.experimentIds = experimentIds; + this.experimentTokens = experimentTokens; + this.addPhenotypeExperimentTokens = addPhenotypeExperimentTokens; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("LogEventParcelable[") + .append(versionCode).append(", ").append(context) + .append(", LogEventBytes: ").append(getBytesAsString()); + if (testCodes != null) sb.append(", TestCodes: ").append(Arrays.toString(testCodes)); + if (mendelPackages != null) + sb.append(", MendelPackages: ").append(Arrays.toString(mendelPackages)); + if (experimentIds != null) + sb.append(", ExperimentIds: ").append(Arrays.toString(experimentIds)); + if (experimentTokens != null) + sb.append(", ExperimentTokens: ").append(Arrays.toString(experimentTokens)); + return sb.append(", AddPhenotypeExperimentTokens: ").append(addPhenotypeExperimentTokens) + .append(']').toString(); + } + + private String getBytesAsString() { + if (bytes == null) return "null"; + try { + CharsetDecoder d = Charset.forName("US-ASCII").newDecoder(); + CharBuffer r = d.decode(ByteBuffer.wrap(bytes)); + return r.toString(); + } catch (Exception e) { + return Base64.encodeToString(bytes, Base64.NO_WRAP); + } + } + + public static final Creator CREATOR = new AutoCreator(LogEventParcelable.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/common/internal/CertData.java b/play-services-api/src/main/java/com/google/android/gms/common/internal/CertData.java new file mode 100644 index 00000000..826d1c37 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/CertData.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 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.common.internal; + +import android.os.RemoteException; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.dynamic.ObjectWrapper; + +import java.util.Arrays; + +public class CertData extends ICertData.Stub { + private final byte[] bytes; + private final int hashCode; + + public CertData(byte[] bytes) { + this.bytes = bytes; + if (bytes.length < 25) throw new RuntimeException("CertData to small"); + hashCode = Arrays.hashCode(Arrays.copyOfRange(bytes, 0, 25)); + } + + @Override + public int hashCode() { + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof ICertData)) return false; + ICertData cert = (ICertData) obj; + try { + if (cert.remoteHashCode() != hashCode()) return false; + return Arrays.equals(ObjectWrapper.unwrapTyped(cert.getWrappedBytes(), byte[].class), getBytes()); + } catch (RemoteException e) { + return false; + } + } + + public byte[] getBytes() { + return bytes; + } + + @Override + public IObjectWrapper getWrappedBytes() throws RemoteException { + return ObjectWrapper.wrap(getBytes()); + } + + @Override + public int remoteHashCode() throws RemoteException { + return hashCode(); + } +} 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 new file mode 100644 index 00000000..c8240279 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/common/internal/GoogleCertificatesQuery.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 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.common.internal; + +import android.os.IBinder; +import android.os.RemoteException; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.dynamic.ObjectWrapper; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GoogleCertificatesQuery extends AutoSafeParcelable { + @SafeParceled(1) + private String packageName; + @SafeParceled(2) + private IBinder certDataBinder; + private CertData certData; + @SafeParceled(3) + private boolean allowNonRelease; + + public String getPackageName() { + return packageName; + } + + public CertData getCertData() { + if (certData == null && certDataBinder != null) { + ICertData iCertData = null; + if (certDataBinder instanceof CertData) { + certData = (CertData) certDataBinder; + } else if (certDataBinder instanceof IObjectWrapper) { + certData = ObjectWrapper.unwrapTyped((IObjectWrapper) certDataBinder, CertData.class); + if (certData == null) { + byte[] bytes = ObjectWrapper.unwrapTyped((IObjectWrapper) certDataBinder, byte[].class); + if (bytes != null) { + certData = new CertData(bytes); + } + } + if (certData == null) { + iCertData = ObjectWrapper.unwrapTyped((IObjectWrapper) certDataBinder, ICertData.class); + } + } else if (certDataBinder instanceof ICertData) { + iCertData = (ICertData) certDataBinder; + } + if (iCertData != null) { + try { + byte[] bytes = ObjectWrapper.unwrapTyped(iCertData.getWrappedBytes(), byte[].class); + if (bytes != null) { + certData = new CertData(bytes); + } + } catch (RemoteException e) { + // Ignore + } + } + } + return certData; + } + + public static final Creator CREATOR = new AutoCreator(GoogleCertificatesQuery.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/identity/accounts/api/AccountData.java b/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.java new file mode 100644 index 00000000..d909cbf3 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/identity/accounts/api/AccountData.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.identity.accounts.api; + +public class AccountData { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.java new file mode 100644 index 00000000..b9770e36 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/CountrySpecification.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.identity.intents.model; + +public class CountrySpecification { +} diff --git a/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.java new file mode 100644 index 00000000..aa3959f2 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/identity/intents/model/UserAddress.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.identity.intents.model; + +public class UserAddress { +} 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/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/people/internal/ParcelableLoadImageOptions.java b/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java new file mode 100644 index 00000000..61180fd4 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/people/internal/ParcelableLoadImageOptions.java @@ -0,0 +1,36 @@ +/* + * 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.people.internal; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ParcelableLoadImageOptions extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public int imageSize; + + @SafeParceled(2) + public int avatarOptions; + + @SafeParceled(3) + public boolean useLargePictureForCp2Images; + + 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 new file mode 100644 index 00000000..814a6574 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AccountMetadata.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 com.google.android.gms.people.model; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AccountMetadata extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 2; + + @SafeParceled(2) + public boolean hasGooglePlus = true; + + @SafeParceled(3) + public boolean hasFeature2 = true; + + @SafeParceled(4) + public boolean hasFeature3 = true; + + @SafeParceled(5) + public boolean hasFeature4 = true; + + 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 new file mode 100644 index 00000000..b03af386 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/people/model/AvatarReference.java @@ -0,0 +1,34 @@ +/* + * 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.people.model; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AvatarReference extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode; + + @SafeParceled(1) + public int source; + + @SafeParceled(2) + public String location; + + public static final Creator CREATOR = new AutoCreator(AvatarReference.class); +} 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 new file mode 100644 index 00000000..791c19b8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/LogEvent.java @@ -0,0 +1,54 @@ +/* + * 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.playlog.internal; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Date; + +public class LogEvent extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + public final long eventTime; + + @SafeParceled(3) + public final String tag; + + @SafeParceled(4) + public final byte[] data; + + private LogEvent() { + eventTime = -1; + tag = null; + data = null; + } + + @Override + public String toString() { + return "LogEvent{" + + "eventTime=" + new Date(eventTime) + + ", tag='" + tag + '\'' + + ", data=" + (data == null ? "null" : ('\'' + new String(data) + '\'')) + + '}'; + } + + public static Creator CREATOR = new AutoCreator(LogEvent.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/playlog/internal/PlayLoggerContext.java new file mode 100644 index 00000000..ca31fb9b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/playlog/internal/PlayLoggerContext.java @@ -0,0 +1,101 @@ +/* + * 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.playlog.internal; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class PlayLoggerContext extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + public final String packageName; + + @SafeParceled(3) + public final int packageVersionCode; + + @SafeParceled(4) + public final int logSource; + + @SafeParceled(5) + public final String uploadAccount; + + @SafeParceled(6) + public final int loggingId; + + @SafeParceled(7) + public final boolean logAndroidId; + + @SafeParceled(8) + public final String logSourceName; + + @SafeParceled(9) + public final boolean isAnonymous; + + @SafeParceled(10) + public final int qosTier; + + private PlayLoggerContext() { + packageName = uploadAccount = logSourceName = null; + qosTier = packageVersionCode = logSource = loggingId = -1; + isAnonymous = logAndroidId = false; + } + + public PlayLoggerContext(String packageName, int packageVersionCode, int logSource, String uploadAccount, int loggingId, boolean logAndroidId) { + this.packageName = packageName; + this.packageVersionCode = packageVersionCode; + this.logSource = logSource; + this.logSourceName = null; + this.uploadAccount = uploadAccount; + this.loggingId = loggingId; + this.logAndroidId = logAndroidId; + this.isAnonymous = false; + this.qosTier = 0; + } + + public PlayLoggerContext(String packageName, int packageVersionCode, int logSource, String logSourceName, String uploadAccount, int loggingId, boolean isAnonymous, int qosTier) { + this.packageName = packageName; + this.packageVersionCode = packageVersionCode; + this.logSource = logSource; + this.logSourceName = logSourceName; + this.uploadAccount = uploadAccount; + this.loggingId = loggingId; + this.logAndroidId = !isAnonymous; + this.isAnonymous = isAnonymous; + this.qosTier = qosTier; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("PlayLoggerContext[").append(versionCode); + sb.append(", package=").append(packageName); + sb.append(", packageVersionCode=").append(packageVersionCode); + sb.append(", logSource=").append(logSource); + sb.append(", uploadAccount=").append(uploadAccount); + sb.append(", loggingId=").append(loggingId); + sb.append(", logAndroidId=").append(logAndroidId); + sb.append(", logSourceName=").append(logSourceName); + sb.append(", isAnonymous=").append(isAnonymous); + sb.append(", qosTier=").append(qosTier); + sb.append(']'); + return sb.toString(); + } + + public static Creator CREATOR = new AutoCreator(PlayLoggerContext.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/safetynet/AttestationData.java b/play-services-api/src/main/java/com/google/android/gms/safetynet/AttestationData.java new file mode 100644 index 00000000..4f127291 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/safetynet/AttestationData.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.safetynet; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class AttestationData extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private final String jwsResult; + + private AttestationData() { + jwsResult = null; + } + + public AttestationData(String jwsResult) { + this.jwsResult = jwsResult; + } + + public String getJwsResult() { + return jwsResult; + } + + public static final Creator CREATOR = new AutoCreator(AttestationData.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/safetynet/HarmfulAppsData.java b/play-services-api/src/main/java/com/google/android/gms/safetynet/HarmfulAppsData.java new file mode 100644 index 00000000..7ac285fe --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/safetynet/HarmfulAppsData.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.safetynet; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class HarmfulAppsData extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(HarmfulAppsData.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/safetynet/SafeBrowsingData.java b/play-services-api/src/main/java/com/google/android/gms/safetynet/SafeBrowsingData.java new file mode 100644 index 00000000..80fc8c5c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/safetynet/SafeBrowsingData.java @@ -0,0 +1,33 @@ +/* + * 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.safetynet; + +import com.google.android.gms.common.data.DataHolder; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SafeBrowsingData extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private String status; + @SafeParceled(3) + private DataHolder data; + + public static final Creator CREATOR = new AutoCreator(SafeBrowsingData.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.java new file mode 100644 index 00000000..8e91b869 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/ClearCorpusRequest.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.search.corpora; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ClearCorpusRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ClearCorpusRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.java new file mode 100644 index 00000000..2da15091 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusInfoRequest.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.search.corpora; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GetCorpusInfoRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(GetCorpusInfoRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java new file mode 100644 index 00000000..051a5332 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusRequest.java @@ -0,0 +1,48 @@ +/* + * 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.search.corpora; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetCorpusStatusRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final String packageName; + + @SafeParceled(2) + public final String corpus; + + private GetCorpusStatusRequest() { + packageName = null; + corpus = null; + } + + @Override + public String toString() { + return "GetCorpusStatusRequest{" + + "versionCode=" + versionCode + + ", packageName='" + packageName + '\'' + + ", corpus='" + corpus + '\'' + + '}'; + } + + public static Creator CREATOR = new AutoCreator(GetCorpusStatusRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java new file mode 100644 index 00000000..2611d67e --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/GetCorpusStatusResponse.java @@ -0,0 +1,47 @@ +/* + * 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.search.corpora; + +import com.google.android.gms.appdatasearch.CorpusStatus; +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetCorpusStatusResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final CorpusStatus corpusStatus; + + private GetCorpusStatusResponse() { + status = null; + corpusStatus = null; + } + + public GetCorpusStatusResponse(Status status, CorpusStatus corpusStatus) { + this.status = status; + this.corpusStatus = corpusStatus; + } + + public static Creator CREATOR = new AutoCreator(GetCorpusStatusResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java new file mode 100644 index 00000000..4fa3396b --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingRequest.java @@ -0,0 +1,53 @@ +/* + * 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.search.corpora; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class RequestIndexingRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final String packageName; + + @SafeParceled(2) + public final String corpus; + + @SafeParceled(3) + public final long sequenceNumber; + + private RequestIndexingRequest() { + packageName = null; + corpus = null; + sequenceNumber = 0; + } + + @Override + public String toString() { + return "RequestIndexingRequest{" + + "versionCode=" + versionCode + + ", packageName='" + packageName + '\'' + + ", corpus='" + corpus + '\'' + + ", sequenceNumber=" + sequenceNumber + + '}'; + } + + public static Creator CREATOR = new AutoCreator(RequestIndexingRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java new file mode 100644 index 00000000..cf25d6a7 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/corpora/RequestIndexingResponse.java @@ -0,0 +1,46 @@ +/* + * 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.search.corpora; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class RequestIndexingResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final boolean scheduledIndexing; + + private RequestIndexingResponse() { + status = null; + scheduledIndexing = false; + } + + public RequestIndexingResponse(Status status, boolean scheduledIndexing) { + this.status = status; + this.scheduledIndexing = scheduledIndexing; + } + + public static Creator CREATOR = new AutoCreator(RequestIndexingResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.java new file mode 100644 index 00000000..6cc364e9 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsRequest.java @@ -0,0 +1,28 @@ +/* + * 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetCurrentExperimentIdsRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + public static final Creator CREATOR = new AutoCreator(GetCurrentExperimentIdsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.java new file mode 100644 index 00000000..6fa3ef70 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetCurrentExperimentIdsResponse.java @@ -0,0 +1,57 @@ +/* + * 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.search.global; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class GetCurrentExperimentIdsResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final int[] experimentIds; + + private GetCurrentExperimentIdsResponse() { + status = null; + experimentIds = null; + } + + public GetCurrentExperimentIdsResponse(Status status, int[] experimentIds) { + this.status = status; + this.experimentIds = experimentIds; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("GetCurrentExperimentIdsResponse{"); + sb.append("status=").append(status); + sb.append(", experimentIds=").append(Arrays.toString(experimentIds)); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(GetCurrentExperimentIdsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.java new file mode 100644 index 00000000..6c062611 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesRequest.java @@ -0,0 +1,39 @@ +/* + * 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetGlobalSearchSourcesRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public boolean bool; + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("GetGlobalSearchSourcesRequest{"); + sb.append("bool=").append(bool); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(GetGlobalSearchSourcesRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.java new file mode 100644 index 00000000..3aa8e3b2 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetGlobalSearchSourcesResponse.java @@ -0,0 +1,59 @@ +/* + * 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.search.global; + +import android.os.Parcelable; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class GetGlobalSearchSourcesResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final Parcelable[] sources; + + private GetGlobalSearchSourcesResponse() { + status = null; + sources = null; + } + + public GetGlobalSearchSourcesResponse(Status status, Parcelable[] sources) { + this.status = status; + this.sources = sources; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("GetGlobalSearchSourcesResponse{"); + sb.append("status=").append(status); + sb.append(", sources=").append(Arrays.toString(sources)); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(GetGlobalSearchSourcesResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.java new file mode 100644 index 00000000..3df0a0cc --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsRequest.java @@ -0,0 +1,28 @@ +/* + * 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class GetPendingExperimentIdsRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + public static final Creator CREATOR = new AutoCreator(GetPendingExperimentIdsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.java new file mode 100644 index 00000000..cd98184a --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/GetPendingExperimentIdsResponse.java @@ -0,0 +1,57 @@ +/* + * 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.search.global; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class GetPendingExperimentIdsResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final int[] experimentIds; + + private GetPendingExperimentIdsResponse() { + status = null; + experimentIds = null; + } + + public GetPendingExperimentIdsResponse(Status status, int[] experimentIds) { + this.status = status; + this.experimentIds = experimentIds; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("GetPendingExperimentIdsResponse{"); + sb.append("status=").append(status); + sb.append(", experimentIds=").append(Arrays.toString(experimentIds)); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(GetPendingExperimentIdsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsRequest.java new file mode 100644 index 00000000..dd6982f2 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsRequest.java @@ -0,0 +1,45 @@ +/* + * 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class SetExperimentIdsRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public byte[] experimentIds; + + @SafeParceled(2) + public boolean enable; + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("SetExperimentIdsRequest{"); + sb.append("experimentIds=").append(Arrays.toString(experimentIds)); + sb.append(", enable=").append(enable); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(SetExperimentIdsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsResponse.java new file mode 100644 index 00000000..17fb679f --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/SetExperimentIdsResponse.java @@ -0,0 +1,49 @@ +/* + * 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.search.global; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SetExperimentIdsResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + private SetExperimentIdsResponse() { + status = null; + } + + public SetExperimentIdsResponse(Status status) { + this.status = status; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("SetExperimentIdsResponse{"); + sb.append("status=").append(status); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(SetExperimentIdsResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.java new file mode 100644 index 00000000..4e4fe7b6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchRequest.java @@ -0,0 +1,47 @@ +/* + * 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.search.global; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SetIncludeInGlobalSearchRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public String packageName; + + @SafeParceled(2) + public String source; + + @SafeParceled(3) + public boolean enabled; + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("SetIncludeInGlobalSearchRequest{"); + sb.append("packageName='").append(packageName).append('\''); + sb.append(", source='").append(source).append('\''); + sb.append(", enabled=").append(enabled); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(SetIncludeInGlobalSearchRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.java new file mode 100644 index 00000000..c9671038 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/global/SetIncludeInGlobalSearchResponse.java @@ -0,0 +1,49 @@ +/* + * 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.search.global; + +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class SetIncludeInGlobalSearchResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + private SetIncludeInGlobalSearchResponse() { + status = null; + } + + public SetIncludeInGlobalSearchResponse(Status status) { + this.status = status; + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("SetIncludeInGlobalSearchResponse{"); + sb.append("status=").append(status); + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(SetIncludeInGlobalSearchResponse.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java new file mode 100644 index 00000000..b3f42a21 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryRequest.java @@ -0,0 +1,57 @@ +/* + * 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.search.queries; + +import com.google.android.gms.appdatasearch.QuerySpecification; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class QueryRequest extends AutoSafeParcelable { + + @SafeParceled(1000) + public int versionCode = 1; + @SafeParceled(1) + public String searchString; + @SafeParceled(2) + public String packageName; + @SafeParceled(3) + public String[] corpora; + @SafeParceled(4) + public int d; + @SafeParceled(5) + public int e; + @SafeParceled(6) + public QuerySpecification spec; + + @Override + public String toString() { + return "QueryRequest{" + + "versionCode=" + versionCode + + ", searchString='" + searchString + '\'' + + ", packageName='" + packageName + '\'' + + ", corpora=" + Arrays.toString(corpora) + + ", d=" + d + + ", e=" + e + + ", spec=" + spec + + '}'; + } + + public static Creator CREATOR = new AutoCreator(QueryRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java new file mode 100644 index 00000000..a3f1ce55 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/search/queries/QueryResponse.java @@ -0,0 +1,47 @@ +/* + * 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.search.queries; + +import com.google.android.gms.appdatasearch.SearchResults; +import com.google.android.gms.common.api.Status; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class QueryResponse extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public final Status status; + + @SafeParceled(2) + public final SearchResults results; + + private QueryResponse() { + status = null; + results = null; + } + + public QueryResponse(Status status, SearchResults results) { + this.status = status; + this.results = results; + } + + public static Creator CREATOR = new AutoCreator(QueryResponse.class); +} 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 b/play-services-base deleted file mode 120000 index 972776e9..00000000 --- a/play-services-base +++ /dev/null @@ -1 +0,0 @@ -extern/GmsLib/play-services-base \ No newline at end of file diff --git a/play-services-base-core/build.gradle b/play-services-base-core/build.gradle new file mode 100644 index 00000000..a534bc64 --- /dev/null +++ b/play-services-base-core/build.gradle @@ -0,0 +1,28 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +apply plugin: 'com.android.library' + +dependencies { + api project(':play-services-basement') + + implementation "androidx.annotation:annotation:$annotationVersion" +} + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} diff --git a/play-services-base-core/src/main/AndroidManifest.xml b/play-services-base-core/src/main/AndroidManifest.xml new file mode 100644 index 00000000..13255d7c --- /dev/null +++ b/play-services-base-core/src/main/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/play-services-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java b/play-services-base-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java rename to play-services-base-core/src/main/java/org/microg/gms/AbstractGmsServiceBroker.java diff --git a/play-services-core/src/main/java/org/microg/gms/BaseService.java b/play-services-base-core/src/main/java/org/microg/gms/BaseService.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/BaseService.java rename to play-services-base-core/src/main/java/org/microg/gms/BaseService.java diff --git a/play-services-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java b/play-services-base-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java similarity index 95% rename from play-services-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java rename to play-services-base-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java index f700437e..b0dbea65 100644 --- a/play-services-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java +++ b/play-services-base-core/src/main/java/org/microg/gms/ChimeraSpoofProvider.java @@ -21,10 +21,11 @@ import android.content.ContentValues; import android.database.Cursor; import android.database.MatrixCursor; import android.net.Uri; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; import android.util.Log; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + public class ChimeraSpoofProvider extends ContentProvider { private static final String TAG = "GmsChimeraSpoof"; private static final String[] COLUMNS = new String[]{"version", "apkPath", "loaderPath", "apkDescStr"}; diff --git a/play-services-core/src/main/java/org/microg/gms/DummyService.java b/play-services-base-core/src/main/java/org/microg/gms/DummyService.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/DummyService.java rename to play-services-base-core/src/main/java/org/microg/gms/DummyService.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/Build.java b/play-services-base-core/src/main/java/org/microg/gms/common/Build.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/Build.java rename to play-services-base-core/src/main/java/org/microg/gms/common/Build.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java b/play-services-base-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java rename to play-services-base-core/src/main/java/org/microg/gms/common/DeviceConfiguration.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java b/play-services-base-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java rename to play-services-base-core/src/main/java/org/microg/gms/common/DeviceIdentifier.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java b/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java similarity index 96% rename from play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java rename to play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java index f2fc2026..50c3445f 100644 --- a/play-services-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java +++ b/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java @@ -11,10 +11,9 @@ import android.content.ContextWrapper; import android.content.Intent; import android.os.Build; import android.os.PowerManager; -import android.support.annotation.RequiresApi; import android.util.Log; -import com.google.android.gms.R; +import androidx.annotation.RequiresApi; import java.util.List; @@ -74,7 +73,7 @@ public class ForegroundServiceContext extends ContextWrapper { return new Notification.Builder(context, channel.getId()) .setOngoing(true) .setContentTitle("Running in background") - .setSmallIcon(R.drawable.gcm_bell) + //.setSmallIcon(R.drawable.gcm_bell) .build(); } } diff --git a/play-services-core/src/main/java/org/microg/gms/common/HttpFormClient.java b/play-services-base-core/src/main/java/org/microg/gms/common/HttpFormClient.java similarity index 91% rename from play-services-core/src/main/java/org/microg/gms/common/HttpFormClient.java rename to play-services-base-core/src/main/java/org/microg/gms/common/HttpFormClient.java index 73115992..8aee1df7 100644 --- a/play-services-core/src/main/java/org/microg/gms/common/HttpFormClient.java +++ b/play-services-base-core/src/main/java/org/microg/gms/common/HttpFormClient.java @@ -46,6 +46,13 @@ public class HttpFormClient { try { field.setAccessible(true); Object objVal = field.get(request); + if (field.isAnnotationPresent(RequestContentDynamic.class)) { + Map contentParams = (Map) objVal; + for (Map.Entry param : contentParams.entrySet()) { + appendParam(content, param.getKey(), param.getValue()); + } + continue; + } String value = objVal != null ? String.valueOf(objVal) : null; Boolean boolVal = null; if (field.getType().equals(boolean.class)) { @@ -65,9 +72,7 @@ public class HttpFormClient { value = valueFromBoolVal(value, boolVal, annotation.truePresent(), annotation.falsePresent()); if (value != null || annotation.nullPresent()) { for (String key : annotation.value()) { - if (content.length() > 0) - content.append("&"); - content.append(Uri.encode(key)).append("=").append(Uri.encode(String.valueOf(value))); + appendParam(content, key, value); } } } @@ -109,6 +114,12 @@ public class HttpFormClient { } } + private static void appendParam(StringBuilder content, String key, String value) { + if (content.length() > 0) + content.append("&"); + content.append(Uri.encode(key)).append("=").append(Uri.encode(String.valueOf(value))); + } + private static T parseResponse(Class tClass, HttpURLConnection connection, String result) throws IOException { Map> headerFields = connection.getHeaderFields(); T response; @@ -227,6 +238,11 @@ public class HttpFormClient { public boolean nullPresent() default false; } + @Retention(RetentionPolicy.RUNTIME) + @Target(ElementType.FIELD) + public @interface RequestContentDynamic { + } + @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) public @interface ResponseField { diff --git a/play-services-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java b/play-services-base-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java similarity index 99% rename from play-services-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java rename to play-services-base-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java index bde71702..b453ee6e 100644 --- a/play-services-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java +++ b/play-services-base-core/src/main/java/org/microg/gms/common/MultiListenerProxy.java @@ -17,9 +17,10 @@ package org.microg.gms.common; import android.os.IInterface; -import android.support.annotation.NonNull; import android.util.Log; +import androidx.annotation.NonNull; + import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; diff --git a/play-services-core/src/main/java/org/microg/gms/common/NonCancelToken.java b/play-services-base-core/src/main/java/org/microg/gms/common/NonCancelToken.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/NonCancelToken.java rename to play-services-base-core/src/main/java/org/microg/gms/common/NonCancelToken.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java b/play-services-base-core/src/main/java/org/microg/gms/common/PackageUtils.java similarity index 95% rename from play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java rename to play-services-base-core/src/main/java/org/microg/gms/common/PackageUtils.java index 6ca24440..9f1f2cc8 100644 --- a/play-services-core/src/main/java/org/microg/gms/common/PackageUtils.java +++ b/play-services-base-core/src/main/java/org/microg/gms/common/PackageUtils.java @@ -23,9 +23,8 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.Signature; import android.os.Binder; -import android.support.annotation.Nullable; -import com.google.android.gms.Manifest; +import androidx.annotation.Nullable; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -100,7 +99,7 @@ public class PackageUtils { return true; } } - return context.checkCallingPermission(Manifest.permission.EXTENDED_ACCESS) == PackageManager.PERMISSION_GRANTED; + return context.checkCallingPermission("org.microg.gms.EXTENDED_ACCESS") == PackageManager.PERMISSION_GRANTED; } public static void checkPackageUid(Context context, String packageName, int callingUid) { @@ -195,6 +194,7 @@ public class PackageUtils { } @Nullable + @Deprecated public static String packageFromProcessId(Context context, int pid) { ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); if (manager == null) return null; @@ -202,7 +202,9 @@ public class PackageUtils { List runningAppProcesses = manager.getRunningAppProcesses(); if (runningAppProcesses != null) { for (ActivityManager.RunningAppProcessInfo processInfo : runningAppProcesses) { - if (processInfo.pid == pid) return processInfo.processName; + if (processInfo.pid == pid && processInfo.pkgList.length == 1) { + return processInfo.pkgList[0]; + } } } return null; @@ -262,4 +264,12 @@ public class PackageUtils { return null; } } + + public static int targetSdkVersion(Context context, String packageName) { + try { + return context.getPackageManager().getApplicationInfo(packageName, 0).targetSdkVersion; + } catch (PackageManager.NameNotFoundException e) { + return -1; + } + } } diff --git a/play-services-core/src/main/java/org/microg/gms/common/PhoneInfo.java b/play-services-base-core/src/main/java/org/microg/gms/common/PhoneInfo.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/PhoneInfo.java rename to play-services-base-core/src/main/java/org/microg/gms/common/PhoneInfo.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java b/play-services-base-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java similarity index 100% rename from play-services-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java rename to play-services-base-core/src/main/java/org/microg/gms/common/RemoteListenerProxy.java diff --git a/play-services-core/src/main/java/org/microg/gms/common/Utils.java b/play-services-base-core/src/main/java/org/microg/gms/common/Utils.java similarity index 79% rename from play-services-core/src/main/java/org/microg/gms/common/Utils.java rename to play-services-base-core/src/main/java/org/microg/gms/common/Utils.java index 0bd1e9e8..c965a444 100644 --- a/play-services-core/src/main/java/org/microg/gms/common/Utils.java +++ b/play-services-base-core/src/main/java/org/microg/gms/common/Utils.java @@ -17,14 +17,9 @@ package org.microg.gms.common; import android.content.Context; -import android.support.v4.content.ContextCompat; import android.util.Log; import android.widget.Toast; -import com.google.android.gms.R; - -import org.microg.gms.checkin.LastCheckinInfo; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -33,9 +28,6 @@ import java.util.Locale; import static android.content.pm.PackageManager.PERMISSION_GRANTED; public class Utils { - public static String getAndroidIdHex(Context context) { - return Long.toHexString(LastCheckinInfo.read(context).androidId); - } public static Locale getLocale(Context context) { return Locale.getDefault(); // TODO @@ -55,10 +47,10 @@ public class Utils { public static boolean hasSelfPermissionOrNotify(Context context, String permission) { if (context.checkCallingOrSelfPermission(permission) != PERMISSION_GRANTED) { + Log.w("GmsUtils", "Lacking permission to " + permission + " for pid:" + android.os.Process.myPid() + " uid:" + android.os.Process.myUid()); try { - Toast.makeText(context, context.getString(R.string.lacking_permission_toast, permission), Toast.LENGTH_SHORT).show(); + //TODO: Toast.makeText(context, context.getString(R.string.lacking_permission_toast, permission), Toast.LENGTH_SHORT).show(); } catch (RuntimeException e) { - Log.w("GmsUtils", "Lacking permission to " + permission + " for pid:" + android.os.Process.myPid() + " uid:" + android.os.Process.myUid()); } return false; } diff --git a/play-services-base/build.gradle b/play-services-base/build.gradle new file mode 100644 index 00000000..7bdaad9f --- /dev/null +++ b/play-services-base/build.gradle @@ -0,0 +1,40 @@ +/* + * Copyright 2013-2015 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. + */ + +apply plugin: 'com.android.library' + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} + +dependencies { + api project(':play-services-basement') + api project(':play-services-tasks') + + implementation "androidx.fragment:fragment:$fragmentVersion" +} diff --git a/play-services-base/gradle.properties b/play-services-base/gradle.properties new file mode 100644 index 00000000..b31a23e5 --- /dev/null +++ b/play-services-base/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Library Base +POM_DESCRIPTION=Base classes used by all Play Services Library modules + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +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 + diff --git a/play-services-base/src/main/AndroidManifest.xml b/play-services-base/src/main/AndroidManifest.xml new file mode 100644 index 00000000..559a33ba --- /dev/null +++ b/play-services-base/src/main/AndroidManifest.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java b/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java new file mode 100644 index 00000000..0439619e --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/GoogleApiAvailability.java @@ -0,0 +1,290 @@ +/* + * 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.common; + +import android.app.Activity; +import android.app.Dialog; +import android.app.PendingIntent; +import android.content.Context; +import android.content.DialogInterface; +import android.os.Bundle; +import androidx.fragment.app.FragmentActivity; +import android.util.Log; + +import com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener; +import com.google.android.gms.tasks.Task; +import com.google.android.gms.tasks.Tasks; + +import org.microg.gms.common.Constants; +import org.microg.gms.common.PublicApi; + +import static com.google.android.gms.common.ConnectionResult.INTERNAL_ERROR; +import static com.google.android.gms.common.ConnectionResult.INVALID_ACCOUNT; +import static com.google.android.gms.common.ConnectionResult.NETWORK_ERROR; +import static com.google.android.gms.common.ConnectionResult.RESOLUTION_REQUIRED; +import static com.google.android.gms.common.ConnectionResult.SERVICE_DISABLED; +import static com.google.android.gms.common.ConnectionResult.SERVICE_INVALID; +import static com.google.android.gms.common.ConnectionResult.SERVICE_MISSING; +import static com.google.android.gms.common.ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED; +import static com.google.android.gms.common.ConnectionResult.SIGN_IN_REQUIRED; +import static com.google.android.gms.common.ConnectionResult.SUCCESS; + +@PublicApi +public class GoogleApiAvailability { + private static final String TAG = "GmsApiAvailability"; + + /** + * Package name for Google Play services. + */ + public static final String GOOGLE_PLAY_SERVICES_PACKAGE = Constants.GMS_PACKAGE_NAME; + + /** + * Google Play services client library version (declared in library's AndroidManifest.xml android:versionCode). + */ + public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = Constants.MAX_REFERENCE_VERSION; + + private static GoogleApiAvailability instance; + + private GoogleApiAvailability() { + } + + /** + * Returns the singleton instance of GoogleApiAvailability. + */ + public static GoogleApiAvailability getInstance() { + if (instance == null) { + synchronized (GoogleApiAvailability.class) { + if (instance == null) { + instance = new GoogleApiAvailability(); + } + } + } + return instance; + } + + + /** + * Returns a dialog to address the provided errorCode. The returned dialog displays a localized + * message about the error and upon user confirmation (by tapping on dialog) will direct them + * to the Play Store if Google Play services is out of date or missing, or to system settings + * if Google Play services is disabled on the device. + * + * @param activity parent activity for creating the dialog, also used for identifying language to display dialog in. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + */ + public Dialog getErrorDialog(Activity activity, int errorCode, int requestCode) { + return getErrorDialog(activity, errorCode, requestCode, null); + } + + /** + * Returns a dialog to address the provided errorCode. The returned dialog displays a localized + * message about the error and upon user confirmation (by tapping on dialog) will direct them + * to the Play Store if Google Play services is out of date or missing, or to system settings + * if Google Play services is disabled on the device. + * + * @param activity parent activity for creating the dialog, also used for identifying language to display dialog in. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + * @param cancelListener The {@link DialogInterface.OnCancelListener} to invoke if the dialog is canceled. + */ + public Dialog getErrorDialog(Activity activity, int errorCode, int requestCode, DialogInterface.OnCancelListener cancelListener) { + // TODO + return null; + } + + /** + * Returns a PendingIntent to address the provided connection failure. + *

+ * If {@link ConnectionResult#hasResolution()} is true, then {@link ConnectionResult#getResolution()} + * will be returned. Otherwise, the returned PendingIntent will direct the user to either the + * Play Store if Google Play services is out of date or missing, or system settings if Google + * Play services is disabled on the device. + * + * @param context parent context for creating the PendingIntent. + * @param result the connection failure. If successful or the error is not resolvable by the user, null is returned. + */ + public PendingIntent getErrorResolutionPendingIntent(Context context, ConnectionResult result) { + if (result.hasResolution()) { + return result.getResolution(); + } + return getErrorResolutionPendingIntent(context, result.getErrorCode(), 0); + } + + /** + * Returns a PendingIntent to address the provided errorCode. It will direct the user to either + * the Play Store if Google Play services is out of date or missing, or system settings if + * Google Play services is disabled on the device. + * + * @param context parent context for creating the PendingIntent. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + */ + public PendingIntent getErrorResolutionPendingIntent(Context context, int errorCode, int requestCode) { + // TODO + return null; + } + + /** + * Returns a human-readable string of the error code returned from {@link #isGooglePlayServicesAvailable(Context)}. + */ + public final String getErrorString(int errorCode) { + return ConnectionResult.getStatusString(errorCode); + } + + /** + * Verifies that Google Play services is installed and enabled on this device, and that the + * version installed on this device is no older than the one required by this client. + * + * @return status code indicating whether there was an error. Can be one of following in + * {@link ConnectionResult}: SUCCESS, SERVICE_MISSING, SERVICE_UPDATING, + * SERVICE_VERSION_UPDATE_REQUIRED, SERVICE_DISABLED, SERVICE_INVALID + */ + public int isGooglePlayServicesAvailable(Context context) { + Log.d(TAG, "As we can't know right now if the later desired feature is available, " + + "we just pretend it to be."); + return SUCCESS; + } + + /** + * Determines whether an error can be resolved via user action. If true, proceed by calling + * {@link #getErrorDialog(Activity, int, int)} and showing the dialog. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)}, or + * returned to your application via {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} + * @return true if the error is resolvable with {@link #getErrorDialog(Activity, int, int)} + */ + public final boolean isUserResolvableError(int errorCode) { + switch (errorCode) { + case SERVICE_MISSING: + case SERVICE_VERSION_UPDATE_REQUIRED: + case SERVICE_DISABLED: + case SERVICE_INVALID: + return true; + case SIGN_IN_REQUIRED: + case INVALID_ACCOUNT: + case RESOLUTION_REQUIRED: + case NETWORK_ERROR: + case INTERNAL_ERROR: + default: + return false; + } + } + + /** + * Attempts to make Google Play services available on this device. If Play Services is already + * available, the returned {@link Task} may complete immediately. + *

+ * If it is necessary to display UI in order to complete this request (e.g. sending the user + * to the Google Play store) the passed {@link Activity} will be used to display this UI. + *

+ * It is recommended to call this method from {@link Activity#onCreate(Bundle)}. + * If the passed {@link Activity} completes before the returned {@link Task} completes, the + * Task will fail with a {@link java.util.concurrent.CancellationException}. + *

+ * This method must be called from the main thread. + * + * @return A {@link Task}. If this Task completes without throwing an exception, Play Services + * is available on this device. + */ + public Task makeGooglePlayServicesAvailable(Activity activity) { + int status = isGooglePlayServicesAvailable(activity); + if (status == SUCCESS) { + return Tasks.forResult(null); + } + // TODO + return Tasks.forResult(null); + } + + /** + * Displays a DialogFragment for an error code returned by {@link #isGooglePlayServicesAvailable(Context)}. + * + * @param activity parent activity for creating the dialog, also used for identifying language to display dialog in. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + * @return true if the dialog is shown, false otherwise + * @throws RuntimeException if API level is below 11 and activity is not a {@link FragmentActivity}. + * @see ErrorDialogFragment + * @see SupportErrorDialogFragmet + */ + public boolean showErrorDialogFragment(Activity activity, int errorCode, int requestCode) { + return showErrorDialogFragment(activity, errorCode, requestCode, null); + } + + /** + * Displays a DialogFragment for an error code returned by {@link #isGooglePlayServicesAvailable(Context)}. + * + * @param activity parent activity for creating the dialog, also used for identifying language to display dialog in. + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param requestCode The requestCode given when calling startActivityForResult. + * @param cancelListener The {@link DialogInterface.OnCancelListener} to invoke if the dialog is canceled. + * @return true if the dialog is shown, false otherwise + * @throws RuntimeException if API level is below 11 and activity is not a {@link FragmentActivity}. + * @see ErrorDialogFragment + * @see SupportErrorDialogFragmet + */ + public boolean showErrorDialogFragment(Activity activity, int errorCode, int requestCode, DialogInterface.OnCancelListener cancelListener) { + Dialog dialog = getErrorDialog(activity, errorCode, requestCode, cancelListener); + if (dialog == null) { + return false; + } else { + // TODO + return false; + } + } + + /** + * Displays a notification for an error code returned from + * {@link #isGooglePlayServicesAvailable(Context)}, if it is resolvable by the user. + *

+ * This method is similar to {@link #getErrorDialog(int, android.app.Activity, int)}, but is + * provided for background tasks that cannot or should not display dialogs. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param context used for identifying language to display dialog in as well as accessing the + * {@link android.app.NotificationManager}. + */ + public void showErrorNotification(Context context, int errorCode) { + if (errorCode == RESOLUTION_REQUIRED) { + Log.e(TAG, "showErrorNotification(context, errorCode) is called for RESOLUTION_REQUIRED when showErrorNotification(context, result) should be called"); + } + + if (isUserResolvableError(errorCode)) { + GooglePlayServicesUtil.showErrorNotification(errorCode, context); + } + } + + /** + * Displays a notification for a connection failure, if it is resolvable by the user. + * + * @param context The calling context used to display the notification. + * @param result The connection failure. If successful or the error is not resolvable by the + * user, no notification is shown. + */ + public void showErrorNotification(Context context, ConnectionResult result) { + PendingIntent pendingIntent = getErrorResolutionPendingIntent(context, result); + if (pendingIntent != null) { + // TODO + } + } +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java new file mode 100644 index 00000000..a5642fdd --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesClient.java @@ -0,0 +1,56 @@ +/* + * 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.common; + +import android.os.Bundle; + +@Deprecated +public interface GooglePlayServicesClient { + void connect(); + + void disconnect(); + + boolean isConnected(); + + boolean isConnecting(); + + void registerConnectionCallbacks(ConnectionCallbacks listener); + + boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener); + + void unregisterConnectionCallbacks(ConnectionCallbacks listener); + + void registerConnectionFailedListener(OnConnectionFailedListener listener); + + boolean isConnectionFailedListenerRegistered(OnConnectionFailedListener listener); + + void unregisterConnectionFailedListener(OnConnectionFailedListener listener); + + @Deprecated + interface OnConnectionFailedListener { + + void onConnectionFailed(ConnectionResult result); + } + + @Deprecated + interface ConnectionCallbacks { + + void onConnected(Bundle connectionHint); + + void onDisconnected(); + } +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java new file mode 100644 index 00000000..5fb995b5 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/GooglePlayServicesUtil.java @@ -0,0 +1,235 @@ +/* + * 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.common; + +import android.app.Activity; +import android.app.Dialog; +import android.app.Fragment; +import android.app.PendingIntent; +import android.content.Context; +import android.content.DialogInterface; +import android.content.pm.PackageManager; +import android.content.res.Resources; +import android.util.Log; + +import org.microg.gms.common.Constants; +import org.microg.gms.common.PublicApi; + +/** + * Utility class for verifying that the Google Play services APK is available and up-to-date on + * this device. The same checks are performed if one uses {@link AdvertisingIdClient} or + * {@link GoogleAuthUtil} to connect to the service. + *

+ * TODO: methods :) + */ +@PublicApi +public class GooglePlayServicesUtil { + private static final String TAG = "GooglePlayServicesUtil"; + + public static final String GMS_ERROR_DIALOG = "GooglePlayServicesErrorDialog"; + + /** + * Package name for Google Play services. + */ + @Deprecated + public static final String GOOGLE_PLAY_SERVICES_PACKAGE = Constants.GMS_PACKAGE_NAME; + + /** + * Google Play services client library version (declared in library's AndroidManifest.xml android:versionCode). + */ + @Deprecated + public static final int GOOGLE_PLAY_SERVICES_VERSION_CODE = Constants.MAX_REFERENCE_VERSION; + + /** + * Package name for Google Play Store. + */ + public static final String GOOGLE_PLAY_STORE_PACKAGE = "com.android.vending"; + + /** + * Returns a dialog to address the provided errorCode. The returned dialog displays a localized + * message about the error and upon user confirmation (by tapping on dialog) will direct them + * to the Play Store if Google Play services is out of date or missing, or to system settings + * if Google Play services is disabled on the device. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent activity for creating the dialog, also used for identifying + * language to display dialog in. + * @param requestCode The requestCode given when calling startActivityForResult. + */ + @Deprecated + public static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode) { + return getErrorDialog(errorCode, activity, requestCode, null); + } + + /** + * Returns a dialog to address the provided errorCode. The returned dialog displays a localized + * message about the error and upon user confirmation (by tapping on dialog) will direct them + * to the Play Store if Google Play services is out of date or missing, or to system settings + * if Google Play services is disabled on the device. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent activity for creating the dialog, also used for identifying + * language to display dialog in. + * @param requestCode The requestCode given when calling startActivityForResult. + * @param cancelListener The {@link DialogInterface.OnCancelListener} to invoke if the dialog + * is canceled. + */ + @Deprecated + public static Dialog getErrorDialog(int errorCode, Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener) { + return GoogleApiAvailability.getInstance().getErrorDialog(activity, errorCode, requestCode, cancelListener); + } + + /** + * Returns a PendingIntent to address the provided errorCode. It will direct them to one of the + * following places to either the Play Store if Google Play services is out of date or missing, + * or system settings if Google Play services is disabled on the device. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent context for creating the PendingIntent. + * @param requestCode The requestCode given when calling startActivityForResult. + */ + @Deprecated + public static PendingIntent getErrorPendingIntent(int errorCode, Activity activity, + int requestCode) { + return null; // TODO + } + + /** + * Returns a human-readable string of the error code returned from {@link #isGooglePlayServicesAvailable(Context)}. + */ + @Deprecated + public static String getErrorString(int errorCode) { + return null; // TODO + } + + /** + * Returns the open source software license information for the Google Play services + * application, or null if Google Play services is not available on this device. + */ + @Deprecated + public static String getOpenSourceSoftwareLicenseInfo(Context context) { + return null; // TODO + } + + /** + * This gets the Context object of the Buddy APK. This loads the Buddy APK code from the Buddy + * APK into memory. This returned context can be used to create classes and obtain resources + * defined in the Buddy APK. + * + * @return The Context object of the Buddy APK or null if the Buddy APK is not installed on the device. + */ + public static Context getRemoteContext(Context context) { + return null; // TODO + } + + /** + * This gets the Resources object of the Buddy APK. + * + * @return The Resources object of the Buddy APK or null if the Buddy APK is not installed on the device. + */ + public static Resources getRemoteResources(Context context) { + return null; // TODO + } + + /** + * Verifies that Google Play services is installed and enabled on this device, and that the + * version installed on this device is no older than the one required by this client. + * + * @return status code indicating whether there was an error. Can be one of following in + * {@link ConnectionResult}: SUCCESS, SERVICE_MISSING, SERVICE_VERSION_UPDATE_REQUIRED, + * SERVICE_DISABLED, SERVICE_INVALID + */ + @Deprecated + public static int isGooglePlayServicesAvailable(Context context) { + Log.d(TAG, "As we can't know right now if the later desired feature is available, " + + "we just pretend it to be."); + return ConnectionResult.SUCCESS; + } + + @Deprecated + public static boolean isGoogleSignedUid(PackageManager packageManager, int uid) { + return false; // TODO + } + + /** + * Determines whether an error is user-recoverable. If true, proceed by calling + * {@link #getErrorDialog(int, Activity, int)} and showing the dialog. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)}, or + * returned to your application via {@link com.google.android.gms.common.api.GoogleApiClient.OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} + * @return true if the error is recoverable with {@link #getErrorDialog(int, Activity, int)} + */ + @Deprecated + public static boolean isUserRecoverableError(int errorCode) { + return false; // TODO + } + + /** + * Display a DialogFragment for an error code returned by {@link #isGooglePlayServicesAvailable(Context)}. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent activity for creating the dialog, also used for identifying + * language to display dialog in. + * @param requestCode The requestCode given when calling startActivityForResult. + * @return true if the dialog is shown, false otherwise + * @throws RuntimeException if API level is below 11 and activity is not a {@link android.support.v4.app.FragmentActivity}. + */ + @Deprecated + public static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode) { + return showErrorDialogFragment(errorCode, activity, requestCode, null); + } + + @Deprecated + public static boolean showErrorDialogFragment(int errorCode, Activity activity, Fragment fragment, int requestCode, DialogInterface.OnCancelListener cancelListener) { + return false; // TODO + } + + /** + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param activity parent activity for creating the dialog, also used for identifying + * language to display dialog in. + * @param requestCode The requestCode given when calling startActivityForResult. + * @param cancelListener The {@link DialogInterface.OnCancelListener} to invoke if the dialog + * is canceled. + * @return true if the dialog is shown, false otherwise. + * @throws RuntimeException if API level is below 11 and activity is not a {@link android.support.v4.app.FragmentActivity}. + */ + @Deprecated + public static boolean showErrorDialogFragment(int errorCode, Activity activity, int requestCode, DialogInterface.OnCancelListener cancelListener) { + return showErrorDialogFragment(errorCode, activity, null, requestCode, cancelListener); + } + + /** + * Displays a notification relevant to the provided error code. This method is similar to + * {@link #getErrorDialog(int, android.app.Activity, int)}, but is provided for background + * tasks that cannot or shouldn't display dialogs. + * + * @param errorCode error code returned by {@link #isGooglePlayServicesAvailable(Context)} call. + * If errorCode is {@link ConnectionResult#SUCCESS} then null is returned. + * @param context used for identifying language to display dialog in as well as accessing the + * {@link android.app.NotificationManager}. + */ + @Deprecated + public static void showErrorNotification(int errorCode, Context context) { + // TODO + } +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/AccountInfo.java b/play-services-base/src/main/java/com/google/android/gms/common/api/AccountInfo.java new file mode 100644 index 00000000..94c11015 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/AccountInfo.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.common.api; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class AccountInfo extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(AccountInfo.class); +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java new file mode 100644 index 00000000..610da966 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java @@ -0,0 +1,84 @@ +/* + * 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.common.api; + +import org.microg.gms.common.PublicApi; +import org.microg.gms.common.api.ApiBuilder; + +/** + * Describes a section of the Google Play Services API that should be made available. Instances of + * this should be passed into {@link GoogleApiClient.Builder#addApi(Api)} to enable the appropriate + * parts of Google Play Services. + *

+ * Google APIs are partitioned into sections which allow your application to configure only the + * services it requires. Each Google API provides an API object which can be passed to + * {@link GoogleApiClient.Builder#addApi(Api)} in order to configure and enable that functionality + * in your {@link GoogleApiClient} instance. + *

+ * See {@link GoogleApiClient.Builder} for usage examples. + */ +@PublicApi +public final class Api { + + private final ApiBuilder builder; + + @PublicApi(exclude = true) + public Api(ApiBuilder builder) { + this.builder = builder; + } + + @PublicApi(exclude = true) + public ApiBuilder getBuilder() { + return builder; + } + + /** + * Base interface for API options. These are used to configure specific parameters for + * individual API surfaces. The default implementation has no parameters. + */ + @PublicApi + public interface ApiOptions { + /** + * Base interface for {@link ApiOptions} in {@link Api}s that have options. + */ + @PublicApi + interface HasOptions extends ApiOptions { + } + + /** + * Base interface for {@link ApiOptions} that are not required, don't exist. + */ + @PublicApi + interface NotRequiredOptions extends ApiOptions { + } + + /** + * {@link ApiOptions} implementation for {@link Api}s that do not take any options. + */ + @PublicApi + final class NoOptions implements NotRequiredOptions { + } + + /** + * Base interface for {@link ApiOptions} that are optional. + */ + @PublicApi + interface Optional extends HasOptions, NotRequiredOptions { + } + } + +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java new file mode 100644 index 00000000..1cd0525f --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java @@ -0,0 +1,495 @@ +/* + * 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.common.api; + +import android.app.Activity; +import android.content.Context; +import android.os.Bundle; +import android.os.Handler; +import android.os.Looper; +import android.view.View; + +import androidx.fragment.app.FragmentActivity; + +import com.google.android.gms.common.ConnectionResult; + +import org.microg.gms.auth.AuthConstants; +import org.microg.gms.common.PublicApi; +import org.microg.gms.common.api.GoogleApiClientImpl; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * The main entry point for Google Play services integration. + *

+ * GoogleApiClient is used with a variety of static methods. Some of these methods require that + * GoogleApiClient be connected, some will queue up calls before GoogleApiClient is connected; + * check the specific API documentation to determine whether you need to be connected. + *

+ * Before any operation is executed, the GoogleApiClient must be connected using the + * {@link #connect()} method. The client is not considered connected until the + * {@link ConnectionCallbacks#onConnected(Bundle)} callback has been called. + *

+ * When your app is done using this client, call {@link #disconnect()}, even if the async result + * from {@link #connect()} has not yet been delivered. + *

+ * You should instantiate a client object in your Activity's {@link Activity#onCreate(Bundle)} + * method and then call {@link #connect()} in {@link Activity#onStart()} and {@link #disconnect()} + * in {@link Activity#onStop()}, regardless of the state. + */ +@PublicApi +public interface GoogleApiClient { + /** + * Connects the client to Google Play services. Blocks until the connection either succeeds or + * fails. This is not allowed on the UI thread. + * + * @return the result of the connection + */ + ConnectionResult blockingConnect(); + + /** + * Connects the client to Google Play services. Blocks until the connection is set or failed or + * has timed out. This is not allowed on the UI thread. + * + * @param timeout the maximum time to wait + * @param unit the time unit of the {@code timeout} argument + * @return the result of the connection + */ + ConnectionResult blockingConnect(long timeout, TimeUnit unit); + + /** + * Clears the account selected by the user and reconnects the client asking the user to pick an + * account again if {@link Builder#useDefaultAccount()} was set. + * + * @return the pending result is fired once the default account has been cleared, but before + * the client is reconnected - for that {@link ConnectionCallbacks} can be used. + */ + PendingResult clearDefaultAccountAndReconnect(); + + /** + * Connects the client to Google Play services. This method returns immediately, and connects + * to the service in the background. If the connection is successful, + * {@link ConnectionCallbacks#onConnected(Bundle)} is called and enqueued items are executed. + * On a failure, {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} is + * called. + */ + void connect(); + + /** + * Closes the connection to Google Play services. No calls can be made using this client after + * calling this method. Any method calls that haven't executed yet will be canceled. That is + * {@link ResultCallback#onResult(Result)} won't be called, if connection to the service hasn't + * been established yet all calls already made will be canceled. + * + * @see #connect() + */ + void disconnect(); + + /** + * Checks if the client is currently connected to the service, so that requests to other + * methods will succeed. Applications should guard client actions caused by the user with a + * call to this method. + * + * @return {@code true} if the client is connected to the service. + */ + boolean isConnected(); + + /** + * Checks if the client is attempting to connect to the service. + * + * @return {@code true} if the client is attempting to connect to the service. + */ + boolean isConnecting(); + + /** + * Returns {@code true} if the specified listener is currently registered to receive connection + * events. + * + * @param listener The listener to check for. + * @return {@code true} if the specified listener is currently registered to receive connection + * events. + * @see #registerConnectionCallbacks(ConnectionCallbacks) + * @see #unregisterConnectionCallbacks(ConnectionCallbacks) + */ + boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener); + + /** + * Returns {@code true} if the specified listener is currently registered to receive connection + * failed events. + * + * @param listener The listener to check for. + * @return {@code true} if the specified listener is currently registered to receive connection + * failed events. + * @see #registerConnectionFailedListener(OnConnectionFailedListener) + * @see #unregisterConnectionFailedListener(OnConnectionFailedListener) + */ + public boolean isConnectionFailedListenerRegistered(OnConnectionFailedListener listener); + + /** + * Closes the current connection to Google Play services and creates a new connection. + *

+ * This method closes the current connection then returns immediately and reconnects to the + * service in the background. + *

+ * After calling this method, your application will receive + * {@link ConnectionCallbacks#onConnected(Bundle)} if the connection is successful, or + * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} if the connection + * failed. + * + * @see #connect() + * @see #disconnect() + */ + void reconnect(); + + /** + * Registers a listener to receive connection events from this {@link GoogleApiClient}. If the + * service is already connected, the listener's {@link ConnectionCallbacks#onConnected(Bundle)} + * method will be called immediately. Applications should balance calls to this method with + * calls to {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid leaking + * resources. + *

+ * If the specified listener is already registered to receive connection events, this method + * will not add a duplicate entry for the same listener, but will still call the listener's + * {@link ConnectionCallbacks#onConnected(Bundle)} method if currently connected. + *

+ * Note that the order of messages received here may not be stable, so clients should not rely + * on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} call + * are delivered. + */ + void registerConnectionCallbacks(ConnectionCallbacks listener); + + /** + * Registers a listener to receive connection failed events from this {@link GoogleApiClient}. + * Unlike {@link #registerConnectionCallbacks(ConnectionCallbacks)}, if the service is not + * already connected, the listener's + * {@link OnConnectionFailedListener#onConnectionFailed(ConnectionResult)} method will not be + * called immediately. Applications should balance calls to this method with calls to + * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid leaking + * resources. + *

+ * If the specified listener is already registered to receive connection failed events, this + * method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not rely + * on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} call + * are delivered. + */ + public void registerConnectionFailedListener(OnConnectionFailedListener listener); + + /** + * Disconnects the client and stops automatic lifecycle management. Use this before creating a + * new client (which might be necessary when switching accounts, changing the set of used APIs + * etc.). + *

+ * This method must be called from the main thread. + * + * @param lifecycleActivity the activity managing the client's lifecycle. + * @throws IllegalStateException if called from outside of the main thread. + * @see Builder#enableAutoManage(FragmentActivity, int, OnConnectionFailedListener) + */ + void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException; + + /** + * Removes a connection listener from this {@link GoogleApiClient}. Note that removing a + * listener does not generate any callbacks. + *

+ * If the specified listener is not currently registered to receive connection events, this + * method will have no effect. + * + * @param listener the listener to unregister. + */ + void unregisterConnectionCallbacks(ConnectionCallbacks listener); + + /** + * Removes a connection failed listener from the {@link GoogleApiClient}. Note that removing a + * listener does not generate any callbacks. + *

+ * If the specified listener is not currently registered to receive connection failed events, + * this method will have no effect. + * + * @param listener the listener to unregister. + */ + void unregisterConnectionFailedListener(OnConnectionFailedListener listener); + + /** + * Builder to configure a {@link GoogleApiClient}. + */ + @PublicApi + class Builder { + private final Context context; + private final Map apis = new HashMap(); + private final Set connectionCallbacks = new HashSet(); + private final Set connectionFailedListeners = new HashSet(); + private final Set scopes = new HashSet(); + private String accountName; + private int clientId = -1; + private FragmentActivity fragmentActivity; + private Looper looper; + private int gravityForPopups; + private OnConnectionFailedListener unresolvedConnectionFailedListener; + private View viewForPopups; + + /** + * Builder to help construct the {@link GoogleApiClient} object. + * + * @param context The context to use for the connection. + */ + public Builder(Context context) { + this.context = context; + this.looper = context.getMainLooper(); + } + + /** + * Builder to help construct the {@link GoogleApiClient} object. + * + * @param context The context to use for the connection. + * @param connectedListener The listener where the results of the asynchronous + * {@link #connect()} call are delivered. + * @param connectionFailedListener The listener which will be notified if the connection + * attempt fails. + */ + public Builder(Context context, ConnectionCallbacks connectedListener, + OnConnectionFailedListener connectionFailedListener) { + this(context); + addConnectionCallbacks(connectedListener); + addOnConnectionFailedListener(connectionFailedListener); + } + + /** + * Specify which Apis are requested by your app. See {@link Api} for more information. + * + * @param api The Api requested by your app. + * @param options Any additional parameters required for the specific AP + * @see Api + */ + public Builder addApi(Api api, O options) { + apis.put(api, options); + return this; + } + + /** + * Specify which Apis are requested by your app. See {@link Api} for more information. + * + * @param api The Api requested by your app. + * @see Api + */ + public Builder addApi(Api api) { + apis.put(api, null); + return this; + } + + /** + * Registers a listener to receive connection events from this {@link GoogleApiClient}. + * Applications should balance calls to this method with calls to + * {@link #unregisterConnectionCallbacks(ConnectionCallbacks)} to avoid + * leaking resources. + *

+ * If the specified listener is already registered to receive connection events, this + * method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not + * rely on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} + * call are delivered. + */ + public Builder addConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.add(listener); + return this; + } + + /** + * Adds a listener to register to receive connection failed events from this + * {@link GoogleApiClient}. Applications should balance calls to this method with calls to + * {@link #unregisterConnectionFailedListener(OnConnectionFailedListener)} to avoid + * leaking resources. + *

+ * If the specified listener is already registered to receive connection failed events, + * this method will not add a duplicate entry for the same listener. + *

+ * Note that the order of messages received here may not be stable, so clients should not + * rely on the order that multiple listeners receive events in. + * + * @param listener the listener where the results of the asynchronous {@link #connect()} + * call are delivered. + */ + public Builder addOnConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.add(listener); + return this; + } + + /** + * Specify the OAuth 2.0 scopes requested by your app. See + * {@link com.google.android.gms.common.Scopes} for more information. + * + * @param scope The OAuth 2.0 scopes requested by your app. + * @see com.google.android.gms.common.Scopes + */ + public Builder addScope(Scope scope) { + scopes.add(scope.getScopeUri()); + return this; + } + + /** + * Builds a new {@link GoogleApiClient} object for communicating with the Google APIs. + * + * @return The {@link GoogleApiClient} object. + */ + public GoogleApiClient build() { + return new GoogleApiClientImpl(context, looper, getAccountInfo(), apis, + connectionCallbacks, connectionFailedListeners, clientId); + } + + private AccountInfo getAccountInfo() { + return null; + } + + public Builder enableAutoManage(FragmentActivity fragmentActivity, int cliendId, + OnConnectionFailedListener unresolvedConnectionFailedListener) + throws NullPointerException, IllegalArgumentException, IllegalStateException { + this.fragmentActivity = fragmentActivity; + this.clientId = cliendId; + this.unresolvedConnectionFailedListener = unresolvedConnectionFailedListener; + return this; + } + + /** + * Specify an account name on the device that should be used. If this is never called, the + * client will use the current default account for Google Play services for this + * application. + * + * @param accountName The account name on the device that should be used by + * {@link GoogleApiClient}. + */ + public Builder setAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Specifies the part of the screen at which games service popups (for example, + * "welcome back" or "achievement unlocked" popups) will be displayed using gravity. + * + * @param gravityForPopups The gravity which controls the placement of games service popups. + */ + public Builder setGravityForPopups(int gravityForPopups) { + this.gravityForPopups = gravityForPopups; + return this; + } + + /** + * Sets a {@link Handler} to indicate which thread to use when invoking callbacks. Will not + * be used directly to handle callbacks. If this is not called then the application's main + * thread will be used. + */ + public Builder setHandler(Handler handler) { + this.looper = handler.getLooper(); + return this; + } + + /** + * Sets the {@link View} to use as a content view for popups. + * + * @param viewForPopups The view to use as a content view for popups. View cannot be null. + */ + public Builder setViewForPopups(View viewForPopups) { + this.viewForPopups = viewForPopups; + return this; + } + + /** + * Specify that the default account should be used when connecting to services. + */ + public Builder useDefaultAccount() { + this.accountName = AuthConstants.DEFAULT_ACCOUNT; + return this; + } + } + + /** + * Provides callbacks that are called when the client is connected or disconnected from the + * service. Most applications implement {@link #onConnected(Bundle)} to start making requests. + */ + @PublicApi + interface ConnectionCallbacks { + /** + * A suspension cause informing that the service has been killed. + */ + int CAUSE_SERVICE_DISCONNECTED = 1; + /** + * A suspension cause informing you that a peer device connection was lost. + */ + int CAUSE_NETWORK_LOST = 2; + + /** + * After calling {@link #connect()}, this method will be invoked asynchronously when the + * connect request has successfully completed. After this callback, the application can + * make requests on other methods provided by the client and expect that no user + * intervention is required to call methods that use account and scopes provided to the + * client constructor. + *

+ * Note that the contents of the {@code connectionHint} Bundle are defined by the specific + * services. Please see the documentation of the specific implementation of + * {@link GoogleApiClient} you are using for more information. + * + * @param connectionHint Bundle of data provided to clients by Google Play services. May + * be null if no content is provided by the service. + */ + void onConnected(Bundle connectionHint); + + /** + * Called when the client is temporarily in a disconnected state. This can happen if there + * is a problem with the remote service (e.g. a crash or resource problem causes it to be + * killed by the system). When called, all requests have been canceled and no outstanding + * listeners will be executed. GoogleApiClient will automatically attempt to restore the + * connection. Applications should disable UI components that require the service, and wait + * for a call to {@link #onConnected(Bundle)} to re-enable them. + * + * @param cause The reason for the disconnection. Defined by constants {@code CAUSE_*}. + */ + void onConnectionSuspended(int cause); + } + + /** + * Provides callbacks for scenarios that result in a failed attempt to connect the client to + * the service. See {@link ConnectionResult} for a list of error codes and suggestions for + * resolution. + */ + @PublicApi + interface OnConnectionFailedListener { + /** + * Called when there was an error connecting the client to the service. + * + * @param result A {@link ConnectionResult} that can be used for resolving the error, and + * deciding what sort of error occurred. To resolve the error, the resolution + * must be started from an activity with a non-negative {@code requestCode} + * passed to {@link ConnectionResult#startResolutionForResult(Activity, int)}. + * Applications should implement {@link Activity#onActivityResult} in their + * Activity to call {@link #connect()} again if the user has resolved the + * issue (resultCode is {@link Activity#RESULT_OK}). + */ + void onConnectionFailed(ConnectionResult result); + } +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java b/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java new file mode 100644 index 00000000..ec162920 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/PendingResult.java @@ -0,0 +1,59 @@ +/* + * 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.common.api; + +import java.util.concurrent.TimeUnit; + +/** + * Represents a pending result from calling an API method in Google Play services. The final result + * object from a PendingResult is of type R, which can be retrieved in one of two ways. + *

+ *

    + *
  • via blocking calls to {@link #await()}, or {@link #await(long, TimeUnit)}, or
  • + *
  • via a callback by passing in an object implementing interface {@link ResultCallback} to + * {@link #setResultCallback(ResultCallback)}.
  • + *
+ * After the result has been retrieved using {@link #await()} or delivered to the result callback, + * it is an error to attempt to retrieve the result again. It is the responsibility of the caller + * or callback receiver to release any resources associated with the returned result. Some result + * types may implement {@link Releasable}, in which case {@link Releasable#release()} should be + * used to free the associated resources. + *

+ * TODO: Docs + */ +public interface PendingResult { + /** + * Blocks until the task is completed. This is not allowed on the UI thread. The returned + * result object can have an additional failure mode of INTERRUPTED. + */ + public R await(); + + /** + * Blocks until the task is completed or has timed out waiting for the result. This is not + * allowed on the UI thread. The returned result object can have an additional failure mode + * of either INTERRUPTED or TIMEOUT. + */ + public R await(long time, TimeUnit unit); + + public void cancel(); + + public boolean isCanceled(); + + public void setResultCallback(ResultCallback callback, long time, TimeUnit unit); + + public void setResultCallback(ResultCallback callback); +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java b/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java new file mode 100644 index 00000000..309a667b --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/data/DataBuffer.java @@ -0,0 +1,89 @@ +/* + * 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.common.data; + +import com.google.android.gms.common.api.Releasable; + +import org.microg.gms.common.PublicApi; + +import java.util.Iterator; + +/** + * TODO + */ +@PublicApi +public abstract class DataBuffer implements Releasable, Iterable { + + private DataHolder dataHolder; + + @PublicApi(exclude = true) + public DataBuffer(DataHolder dataHolder) { + this.dataHolder = dataHolder; + } + + /** + * @deprecated use {@link #release()} instead + */ + @Deprecated + public final void close() { + release(); + } + + /** + * Get the item at the specified position. Note that the objects returned from subsequent + * invocations of this method for the same position may not be identical objects, but will be + * equal in value. + * + * @param position The position of the item to retrieve. + * @return the item at {@code position} in this buffer. + */ + public abstract T get(int position); + + public int getCount() { + return dataHolder == null ? 0 : dataHolder.getCount(); + } + + /** + * @deprecated {@link #release()} is idempotent, and so is safe to call multiple times + */ + @Deprecated + public boolean isClosed() { + return false; + } + + @Override + public Iterator iterator() { + return null; + } + + /** + * Releases resources used by the buffer. This method is idempotent. + */ + @Override + public void release() { + + } + + /** + * In order to use this one should correctly override setDataRow(int) in his DataBufferRef + * implementation. Be careful: there will be single DataBufferRef while iterating. + * If you are not sure - DO NOT USE this iterator. + */ + public Iterator singleRefIterator() { + return null; + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java new file mode 100644 index 00000000..9476d3e7 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/DummyApiConnection.java @@ -0,0 +1,43 @@ +/* + * 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 org.microg.gms.common.api.ApiConnection; + +public class DummyApiConnection implements ApiConnection { + private boolean connected = false; + + @Override + public void connect() { + connected = true; + } + + @Override + public void disconnect() { + connected = false; + } + + @Override + public boolean isConnected() { + return connected; + } + + @Override + public boolean isConnecting() { + return false; + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java new file mode 100644 index 00000000..fdffdac7 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionCallbacks.java @@ -0,0 +1,51 @@ +/* + * 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 android.os.Bundle; + +import com.google.android.gms.common.GooglePlayServicesClient; +import com.google.android.gms.common.api.GoogleApiClient; + +public final class ForwardConnectionCallbacks implements GoogleApiClient.ConnectionCallbacks { + private final GooglePlayServicesClient.ConnectionCallbacks callbacks; + + public ForwardConnectionCallbacks(GooglePlayServicesClient.ConnectionCallbacks callbacks) { + this.callbacks = callbacks; + } + + @Override + public boolean equals(Object o) { + return o instanceof ForwardConnectionCallbacks && + callbacks.equals(((ForwardConnectionCallbacks) o).callbacks); + } + + @Override + public int hashCode() { + return callbacks.hashCode(); + } + + @Override + public void onConnected(Bundle connectionHint) { + callbacks.onConnected(connectionHint); + } + + @Override + public void onConnectionSuspended(int cause) { + callbacks.onDisconnected(); + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java new file mode 100644 index 00000000..1d1f4434 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/ForwardConnectionFailedListener.java @@ -0,0 +1,47 @@ +/* + * 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 com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.GooglePlayServicesClient; +import com.google.android.gms.common.api.GoogleApiClient; + +public final class ForwardConnectionFailedListener + implements GoogleApiClient.OnConnectionFailedListener { + private final GooglePlayServicesClient.OnConnectionFailedListener listener; + + public ForwardConnectionFailedListener( + GooglePlayServicesClient.OnConnectionFailedListener listener) { + this.listener = listener; + } + + @Override + public boolean equals(Object o) { + return o instanceof ForwardConnectionFailedListener && + listener.equals(((ForwardConnectionFailedListener) o).listener); + } + + @Override + public int hashCode() { + return listener.hashCode(); + } + + @Override + public void onConnectionFailed(ConnectionResult result) { + listener.onConnectionFailed(result); + } +} 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 new file mode 100644 index 00000000..779f4769 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java @@ -0,0 +1,184 @@ +/* + * 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 android.accounts.Account; +import android.content.ComponentName; +import android.content.Context; +import android.content.ServiceConnection; +import android.os.Bundle; +import android.os.IBinder; +import android.os.IInterface; +import android.os.RemoteException; +import android.util.Log; + +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.internal.GetServiceRequest; +import com.google.android.gms.common.internal.IGmsCallbacks; +import com.google.android.gms.common.internal.IGmsServiceBroker; + +import org.microg.gms.common.api.ApiConnection; + +public abstract class GmsClient implements ApiConnection { + private static final String TAG = "GmsClient"; + + private final Context context; + protected final GoogleApiClient.ConnectionCallbacks callbacks; + protected final GoogleApiClient.OnConnectionFailedListener connectionFailedListener; + protected ConnectionState state = ConnectionState.NOT_CONNECTED; + private ServiceConnection serviceConnection; + private I serviceInterface; + private String actionString; + + protected int serviceId = -1; + protected Account account = null; + protected Bundle extras = new Bundle(); + + public GmsClient(Context context, GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener, String actionString) { + this.context = context; + this.callbacks = callbacks; + this.connectionFailedListener = connectionFailedListener; + this.actionString = actionString; + } + + protected void onConnectedToBroker(IGmsServiceBroker broker, GmsCallbacks callbacks) throws RemoteException { + if (serviceId == -1) { + throw new IllegalStateException("Service ID not set in constructor and onConnectedToBroker not implemented"); + } + GetServiceRequest request = new GetServiceRequest(serviceId); + request.extras = new Bundle(); + request.packageName = context.getPackageName(); + request.account = account; + request.extras = extras; + broker.getService(callbacks, request); + } + + protected abstract I interfaceFromBinder(IBinder binder); + + @Override + public synchronized void connect() { + Log.d(TAG, "connect()"); + if (state == ConnectionState.CONNECTED || state == ConnectionState.CONNECTING) { + Log.d(TAG, "Already connected/connecting - nothing to do"); + } + state = ConnectionState.CONNECTING; + if (serviceConnection != null) { + MultiConnectionKeeper.getInstance(context).unbind(actionString, serviceConnection); + } + serviceConnection = new GmsServiceConnection(); + if (!MultiConnectionKeeper.getInstance(context).bind(actionString, serviceConnection)) { + state = ConnectionState.ERROR; + handleConnectionFailed(); + } + } + + public void handleConnectionFailed() { + connectionFailedListener.onConnectionFailed(new ConnectionResult(ConnectionResult + .API_UNAVAILABLE, null)); + } + + @Override + public synchronized void disconnect() { + Log.d(TAG, "disconnect()"); + if (state == ConnectionState.DISCONNECTING) return; + if (state == ConnectionState.CONNECTING) { + state = ConnectionState.DISCONNECTING; + return; + } + serviceInterface = null; + if (serviceConnection != null) { + MultiConnectionKeeper.getInstance(context).unbind(actionString, serviceConnection); + serviceConnection = null; + } + state = ConnectionState.NOT_CONNECTED; + } + + @Override + public synchronized boolean isConnected() { + return state == ConnectionState.CONNECTED || state == ConnectionState.PSEUDO_CONNECTED; + } + + @Override + public synchronized boolean isConnecting() { + return state == ConnectionState.CONNECTING; + } + + public synchronized boolean hasError() { + return state == ConnectionState.ERROR; + } + + public Context getContext() { + return context; + } + + public synchronized I getServiceInterface() { + if (isConnecting()) { + // TODO: wait for connection to be established and return afterwards. + throw new IllegalStateException("Waiting for connection"); + } else if (!isConnected()) { + throw new IllegalStateException("interface only available once connected!"); + } + return serviceInterface; + } + + protected enum ConnectionState { + NOT_CONNECTED, CONNECTING, CONNECTED, DISCONNECTING, ERROR, PSEUDO_CONNECTED + } + + private class GmsServiceConnection implements ServiceConnection { + + @Override + public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + try { + Log.d(TAG, "ServiceConnection : onServiceConnected(" + componentName + ")"); + onConnectedToBroker(IGmsServiceBroker.Stub.asInterface(iBinder), + new GmsCallbacks()); + } catch (RemoteException e) { + disconnect(); + } + } + + @Override + public void onServiceDisconnected(ComponentName componentName) { + synchronized (GmsClient.this) { + state = ConnectionState.NOT_CONNECTED; + } + } + } + + public class GmsCallbacks extends IGmsCallbacks.Stub { + + @Override + public void onPostInitComplete(int statusCode, IBinder binder, Bundle params) + throws RemoteException { + synchronized (GmsClient.this) { + if (state == ConnectionState.DISCONNECTING) { + state = ConnectionState.CONNECTED; + disconnect(); + return; + } + state = ConnectionState.CONNECTED; + serviceInterface = interfaceFromBinder(binder); + } + Log.d(TAG, "GmsCallbacks : onPostInitComplete(" + serviceInterface + ")"); + callbacks.onConnected(params); + } + } + +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java new file mode 100644 index 00000000..9de363f6 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/GmsConnector.java @@ -0,0 +1,93 @@ +/* + * 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 android.os.Looper; +import android.os.Message; +import android.os.RemoteException; +import android.util.Log; + +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Result; + +import org.microg.gms.common.api.AbstractPendingResult; +import org.microg.gms.common.api.ApiConnection; +import org.microg.gms.common.api.GoogleApiClientImpl; + +public class GmsConnector { + private static final String TAG = "GmsConnector"; + + private final GoogleApiClientImpl apiClient; + private final Api api; + private final Callback callback; + + public GmsConnector(GoogleApiClient apiClient, Api api, Callback callback) { + this.apiClient = (GoogleApiClientImpl) apiClient; + this.api = api; + this.callback = callback; + } + + public static PendingResult call(GoogleApiClient client, Api api, GmsConnector.Callback callback) { + return new GmsConnector(client, api, callback).connect(); + } + + public AbstractPendingResult connect() { + Log.d(TAG, "connect()"); + apiClient.incrementUsageCounter(); + apiClient.getApiConnection(api); + Looper looper = apiClient.getLooper(); + final AbstractPendingResult result = new AbstractPendingResult(looper); + Message msg = new Message(); + msg.obj = result; + new Handler(looper).sendMessage(msg); + return result; + } + + public interface Callback { + void onClientAvailable(C client, ResultProvider resultProvider) throws RemoteException; + + interface ResultProvider { + void onResultAvailable(R result); + } + } + + private class Handler extends android.os.Handler { + private Handler(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + Log.d(TAG, "Handler : handleMessage"); + final AbstractPendingResult result = (AbstractPendingResult) msg.obj; + try { + C connection = (C) apiClient.getApiConnection(api); + callback.onClientAvailable(connection, new GmsConnector.Callback.ResultProvider() { + @Override + public void onResultAvailable(R realResult) { + result.deliverResult(realResult); + apiClient.decrementUsageCounter(); + } + }); + } catch (RemoteException ignored) { + + } + } + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java b/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java new file mode 100644 index 00000000..ea4cfbe6 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/MultiConnectionKeeper.java @@ -0,0 +1,176 @@ +/* + * 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 android.annotation.SuppressLint; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; +import android.util.Log; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import static android.os.Build.VERSION.SDK_INT; +import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH; +import static org.microg.gms.common.Constants.GMS_PACKAGE_NAME; + +public class MultiConnectionKeeper { + private static final String TAG = "GmsMultiConKeeper"; + + private static MultiConnectionKeeper INSTANCE; + + private final Context context; + private final Map connections = new HashMap(); + + public MultiConnectionKeeper(Context context) { + this.context = context; + } + + public synchronized static MultiConnectionKeeper getInstance(Context context) { + if (INSTANCE == null) + INSTANCE = new MultiConnectionKeeper(context); + return INSTANCE; + } + + public synchronized boolean bind(String action, ServiceConnection connection) { + Log.d(TAG, "bind(" + action + ", " + connection + ")"); + Connection con = connections.get(action); + if (con != null) { + if (!con.forwardsConnection(connection)) { + con.addConnectionForward(connection); + if (!con.isBound()) + con.bind(); + } + } else { + con = new Connection(action); + con.addConnectionForward(connection); + con.bind(); + connections.put(action, con); + } + return con.isBound(); + } + + public synchronized void unbind(String action, ServiceConnection connection) { + Log.d(TAG, "unbind(" + action + ", " + connection + ")"); + Connection con = connections.get(action); + if (con != null) { + con.removeConnectionForward(connection); + if (!con.hasForwards() && con.isBound()) { + con.unbind(); + connections.remove(action); + } + } + } + + public class Connection { + private final String actionString; + private final Set connectionForwards = new HashSet(); + private boolean bound = false; + private boolean connected = false; + private IBinder binder; + private ComponentName component; + private ServiceConnection serviceConnection = new ServiceConnection() { + @Override + public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + Log.d(TAG, "Connection(" + actionString + ") : ServiceConnection : " + + "onServiceConnected(" + componentName + ")"); + binder = iBinder; + component = componentName; + for (ServiceConnection connection : connectionForwards) { + connection.onServiceConnected(componentName, iBinder); + } + connected = true; + } + + @Override + public void onServiceDisconnected(ComponentName componentName) { + Log.d(TAG, "Connection(" + actionString + ") : ServiceConnection : " + + "onServiceDisconnected(" + componentName + ")"); + binder = null; + component = componentName; + for (ServiceConnection connection : connectionForwards) { + connection.onServiceDisconnected(componentName); + } + connected = false; + bound = false; + } + }; + + public Connection(String actionString) { + this.actionString = actionString; + } + + @SuppressLint("InlinedApi") + public void bind() { + Log.d(TAG, "Connection(" + actionString + ") : bind()"); + Intent intent = new Intent(actionString).setPackage(GMS_PACKAGE_NAME); + int flags = Context.BIND_AUTO_CREATE; + if (SDK_INT >= ICE_CREAM_SANDWICH) { + flags |= Context.BIND_ADJUST_WITH_ACTIVITY; + } + bound = context.bindService(intent, serviceConnection, flags); + if (!bound) { + context.unbindService(serviceConnection); + } + } + + public boolean isBound() { + return bound; + } + + public IBinder getBinder() { + return binder; + } + + public void unbind() { + Log.d(TAG, "Connection(" + actionString + ") : unbind()"); + try { + context.unbindService(serviceConnection); + } catch (IllegalArgumentException e) { // not bound (whatever reason) + Log.w(TAG, e); + } + bound = false; + } + + public void addConnectionForward(ServiceConnection connection) { + connectionForwards.add(connection); + if (connected) { + connection.onServiceConnected(component, binder); + } + } + + public void removeConnectionForward(ServiceConnection connection) { + connectionForwards.remove(connection); + if (connected) { + connection.onServiceDisconnected(component); + } + } + + public boolean forwardsConnection(ServiceConnection connection) { + return connectionForwards.contains(connection); + } + + public boolean hasForwards() { + return !connectionForwards.isEmpty(); + } + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java new file mode 100644 index 00000000..15aac9e3 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPendingResult.java @@ -0,0 +1,111 @@ +/* + * 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.api; + +import android.os.Looper; + +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.ResultCallback; + +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +public class AbstractPendingResult implements PendingResult { + private final Object lock = new Object(); + private final CountDownLatch countDownLatch = new CountDownLatch(1); + private final ResultCallbackHandler handler; + private boolean canceled; + private R result; + private ResultCallback resultCallback; + + public AbstractPendingResult(Looper looper) { + handler = new ResultCallbackHandler(looper); + } + + private R getResult() { + synchronized (lock) { + return result; + } + } + + @Override + public R await() { + try { + countDownLatch.await(); + } catch (InterruptedException ignored) { + } + return getResult(); + } + + @Override + public R await(long time, TimeUnit unit) { + try { + countDownLatch.await(time, unit); + } catch (InterruptedException ignored) { + } + return getResult(); + } + + @Override + public void cancel() { + // TODO + } + + @Override + public boolean isCanceled() { + synchronized (lock) { + return canceled; + } + } + + public boolean isReady() { + return this.countDownLatch.getCount() == 0L; + } + + @Override + public void setResultCallback(ResultCallback callback, long time, TimeUnit unit) { + synchronized (lock) { + if (!isCanceled()) { + if (isReady()) { + handler.sendResultCallback(callback, getResult()); + } else { + handler.sendTimeoutResultCallback(this, unit.toMillis(time)); + } + } + } + } + + @Override + public void setResultCallback(ResultCallback callback) { + synchronized (lock) { + if (!isCanceled()) { + if (isReady()) { + handler.sendResultCallback(callback, getResult()); + } else { + resultCallback = callback; + } + } + } + } + + public void deliverResult(R result) { + this.result = result; + countDownLatch.countDown(); + + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java new file mode 100644 index 00000000..eb9d66bd --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/AbstractPlayServicesClient.java @@ -0,0 +1,99 @@ +/* + * 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.api; + +import android.util.Log; + +import com.google.android.gms.common.GooglePlayServicesClient; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.ForwardConnectionCallbacks; +import org.microg.gms.common.ForwardConnectionFailedListener; + +public class AbstractPlayServicesClient implements GooglePlayServicesClient { + private static final String TAG = "GmsPlayServicesClient"; + + protected final GoogleApiClient googleApiClient; + + public AbstractPlayServicesClient(GoogleApiClient googleApiClient) { + this.googleApiClient = googleApiClient; + } + + public void assertConnected() { + if (!isConnected()) throw new IllegalStateException("Not connected!"); + } + + @Override + public void connect() { + Log.d(TAG, "connect()"); + googleApiClient.connect(); + } + + @Override + public void disconnect() { + Log.d(TAG, "disconnect()"); + //TODO googleApiClient.disconnect(); + } + + @Override + public boolean isConnected() { + return googleApiClient.isConnected(); + } + + @Override + public boolean isConnecting() { + return googleApiClient.isConnecting(); + } + + @Override + public void registerConnectionCallbacks(final ConnectionCallbacks listener) { + googleApiClient.registerConnectionCallbacks(new ForwardConnectionCallbacks(listener)); + } + + @Override + public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { + return googleApiClient + .isConnectionCallbacksRegistered(new ForwardConnectionCallbacks(listener)); + } + + @Override + public void unregisterConnectionCallbacks( + ConnectionCallbacks listener) { + googleApiClient.unregisterConnectionCallbacks(new ForwardConnectionCallbacks(listener)); + } + + @Override + public void registerConnectionFailedListener( + OnConnectionFailedListener listener) { + googleApiClient.registerConnectionFailedListener( + new ForwardConnectionFailedListener(listener)); + } + + @Override + public boolean isConnectionFailedListenerRegistered( + OnConnectionFailedListener listener) { + return googleApiClient.isConnectionFailedListenerRegistered( + new ForwardConnectionFailedListener(listener)); + } + + @Override + public void unregisterConnectionFailedListener( + OnConnectionFailedListener listener) { + googleApiClient.unregisterConnectionFailedListener( + new ForwardConnectionFailedListener(listener)); + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java new file mode 100644 index 00000000..7d1fb020 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiBuilder.java @@ -0,0 +1,30 @@ +/* + * 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.api; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; + +public interface ApiBuilder { + ApiConnection build(Context context, Looper looper, O options, AccountInfo accountInfo, + GoogleApiClient.ConnectionCallbacks callbacks, + GoogleApiClient.OnConnectionFailedListener connectionFailedListener); +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java new file mode 100644 index 00000000..9ca239b4 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiConnection.java @@ -0,0 +1,27 @@ +/* + * 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.api; + +public interface ApiConnection { + void connect(); + + void disconnect(); + + boolean isConnected(); + + boolean isConnecting(); +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java new file mode 100644 index 00000000..8c802d4a --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -0,0 +1,242 @@ +/* + * 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.api; + +import android.content.Context; +import android.os.Bundle; +import android.os.Looper; +import android.os.Message; +import androidx.fragment.app.FragmentActivity; +import android.util.Log; + +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +public class GoogleApiClientImpl implements GoogleApiClient { + private static final String TAG = "GmsApiClientImpl"; + + private final Context context; + private final Looper looper; + private final AccountInfo accountInfo; + private final Map apis = new HashMap(); + private final Map apiConnections = new HashMap(); + private final Handler handler; + private final Set connectionCallbacks = new HashSet(); + private final Set connectionFailedListeners = new HashSet(); + private final int clientId; + private final ConnectionCallbacks baseConnectionCallbacks = new ConnectionCallbacks() { + @Override + public void onConnected(Bundle connectionHint) { + Log.d(TAG, "ConnectionCallbacks : onConnected()"); + for (ConnectionCallbacks callback : connectionCallbacks) { + callback.onConnected(connectionHint); + } + } + + @Override + public void onConnectionSuspended(int cause) { + Log.d(TAG, "ConnectionCallbacks : onConnectionSuspended()"); + for (ConnectionCallbacks callback : connectionCallbacks) { + callback.onConnectionSuspended(cause); + } + } + }; + private final OnConnectionFailedListener baseConnectionFailedListener = new + OnConnectionFailedListener() { + @Override + public void onConnectionFailed(ConnectionResult result) { + Log.d(TAG, "OnConnectionFailedListener : onConnectionFailed()"); + for (OnConnectionFailedListener listener : connectionFailedListeners) { + listener.onConnectionFailed(result); + } + } + }; + private int usageCounter = 0; + private boolean shouldDisconnect = false; + + public GoogleApiClientImpl(Context context, Looper looper, AccountInfo accountInfo, + Map apis, + Set connectionCallbacks, + Set connectionFailedListeners, int clientId) { + this.context = context; + this.looper = looper; + this.handler = new Handler(looper); + this.accountInfo = accountInfo; + this.apis.putAll(apis); + this.connectionCallbacks.addAll(connectionCallbacks); + this.connectionFailedListeners.addAll(connectionFailedListeners); + this.clientId = clientId; + + for (Api api : apis.keySet()) { + apiConnections.put(api, api.getBuilder().build(context, looper, + apis.get(api), accountInfo, baseConnectionCallbacks, + baseConnectionFailedListener)); + } + } + + public synchronized void incrementUsageCounter() { + usageCounter++; + } + + public synchronized void decrementUsageCounter() { + usageCounter--; + if (shouldDisconnect) disconnect(); + } + + public Looper getLooper() { + return looper; + } + + public ApiConnection getApiConnection(Api api) { + return apiConnections.get(api); + } + + @Override + public ConnectionResult blockingConnect() { + return null; + } + + @Override + public ConnectionResult blockingConnect(long timeout, TimeUnit unit) { + return null; + } + + @Override + public PendingResult clearDefaultAccountAndReconnect() { + return null; + } + + @Override + public synchronized void connect() { + Log.d(TAG, "connect()"); + if (isConnected() || isConnecting()) { + if (shouldDisconnect) { + shouldDisconnect = false; + return; + } + Log.d(TAG, "Already connected/connecting, nothing to do"); + return; + } + for (ApiConnection connection : apiConnections.values()) { + if (!connection.isConnected()) { + connection.connect(); + } + } + } + + @Override + public synchronized void disconnect() { + if (usageCounter > 0) { + shouldDisconnect = true; + } else { + Log.d(TAG, "disconnect()"); + for (ApiConnection connection : apiConnections.values()) { + if (connection.isConnected()) { + connection.disconnect(); + } + } + } + } + + @Override + public synchronized boolean isConnected() { + for (ApiConnection connection : apiConnections.values()) { + if (!connection.isConnected()) return false; + } + return true; + } + + @Override + public synchronized boolean isConnecting() { + for (ApiConnection connection : apiConnections.values()) { + if (connection.isConnecting()) return true; + } + return false; + } + + @Override + public boolean isConnectionCallbacksRegistered(ConnectionCallbacks listener) { + return connectionCallbacks.contains(listener); + } + + @Override + public boolean isConnectionFailedListenerRegistered( + OnConnectionFailedListener listener) { + return connectionFailedListeners.contains(listener); + } + + @Override + public synchronized void reconnect() { + Log.d(TAG, "reconnect()"); + disconnect(); + connect(); + } + + @Override + public void registerConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.add(listener); + } + + @Override + public void registerConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.add(listener); + } + + @Override + public void stopAutoManager(FragmentActivity lifecycleActivity) throws IllegalStateException { + + } + + @Override + public void unregisterConnectionCallbacks(ConnectionCallbacks listener) { + connectionCallbacks.remove(listener); + } + + @Override + public void unregisterConnectionFailedListener(OnConnectionFailedListener listener) { + connectionFailedListeners.remove(listener); + } + + private class Handler extends android.os.Handler { + private Handler(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + if (msg.what == 0 && msg.obj instanceof Runnable) { + ((Runnable) msg.obj).run(); + } else { + super.handleMessage(msg); + } + } + + public void sendRunnable(Runnable runnable) { + sendMessage(obtainMessage(1, runnable)); + } + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/InstantPendingResult.java b/play-services-base/src/main/java/org/microg/gms/common/api/InstantPendingResult.java new file mode 100644 index 00000000..ba75725c --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/InstantPendingResult.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 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.api; + +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.ResultCallback; + +import java.util.concurrent.TimeUnit; + +public class InstantPendingResult implements PendingResult { + R value; + + public InstantPendingResult(R value) { + this.value = value; + } + + @Override + public R await() { + return value; + } + + @Override + public R await(long time, TimeUnit unit) { + return value; + } + + @Override + public void cancel() { + + } + + @Override + public boolean isCanceled() { + return false; + } + + @Override + public void setResultCallback(ResultCallback callback, long time, TimeUnit unit) { + callback.onResult(value); + } + + @Override + public void setResultCallback(ResultCallback callback) { + callback.onResult(value); + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java b/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java new file mode 100644 index 00000000..c19c849c --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ResultCallbackHandler.java @@ -0,0 +1,70 @@ +/* + * 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.api; + +import android.os.Handler; +import android.os.Looper; +import android.os.Message; +import android.util.Log; + +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.ResultCallback; + +class ResultCallbackHandler extends Handler { + private static final String TAG = "GmsResultCbackHandler"; + public static final int CALLBACK_ON_COMPLETE = 1; + public static final int CALLBACK_ON_TIMEOUT = 2; + + public ResultCallbackHandler(Looper looper) { + super(looper); + } + + @Override + public void handleMessage(Message msg) { + switch (msg.what) { + case CALLBACK_ON_COMPLETE: + OnCompleteObject o = (OnCompleteObject) msg.obj; + Log.d(TAG, "handleMessage() : onResult(" + o.result + ")"); + o.callback.onResult(o.result); + break; + case CALLBACK_ON_TIMEOUT: + // TODO + break; + } + } + + public void sendResultCallback(ResultCallback callback, R result) { + Message message = new Message(); + message.what = CALLBACK_ON_COMPLETE; + message.obj = new OnCompleteObject(callback, result); + sendMessage(message); + } + + public void sendTimeoutResultCallback(AbstractPendingResult pendingResult, long millis) { + + } + + public static class OnCompleteObject { + public ResultCallback callback; + public R result; + + public OnCompleteObject(ResultCallback callback, R result) { + this.callback = callback; + this.result = result; + } + } +} diff --git a/play-services-base/src/main/res/values/version.xml b/play-services-base/src/main/res/values/version.xml new file mode 100644 index 00000000..318bb1c2 --- /dev/null +++ b/play-services-base/src/main/res/values/version.xml @@ -0,0 +1,20 @@ + + + + + 6599436 + diff --git a/play-services-basement b/play-services-basement deleted file mode 120000 index aac14e46..00000000 --- a/play-services-basement +++ /dev/null @@ -1 +0,0 @@ -extern/GmsApi/play-services-basement \ No newline at end of file diff --git a/play-services-basement/build.gradle b/play-services-basement/build.gradle new file mode 100644 index 00000000..e88b1909 --- /dev/null +++ b/play-services-basement/build.gradle @@ -0,0 +1,53 @@ +/* + * Copyright 2013-2015 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. + */ + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' + +dependencies { + api "org.microg:safe-parcel:$safeParcelVersion" + + implementation "androidx.annotation:annotation:$annotationVersion" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" +} + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + aidlPackageWhiteList "com/google/android/gms/common/api/Status.aidl" + aidlPackageWhiteList "com/google/android/gms/common/data/DataHolder.aidl" + aidlPackageWhiteList "com/google/android/gms/common/images/WebImage.aidl" + aidlPackageWhiteList "com/google/android/gms/common/internal/ICancelToken.aidl" + aidlPackageWhiteList "com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl" + aidlPackageWhiteList "com/google/android/gms/dynamic/IObjectWrapper.aidl" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} diff --git a/play-services-basement/gradle.properties b/play-services-basement/gradle.properties new file mode 100644 index 00000000..c18a7f49 --- /dev/null +++ b/play-services-basement/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Basement +POM_DESCRIPTION=Interfaces and objects used all over Play Services API, Library and Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +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 + diff --git a/play-services-basement/src/main/AndroidManifest.xml b/play-services-basement/src/main/AndroidManifest.xml new file mode 100644 index 00000000..bd436773 --- /dev/null +++ b/play-services-basement/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/api/Status.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/api/Status.aidl new file mode 100644 index 00000000..701f99a9 --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/api/Status.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.api; + +parcelable Status; \ No newline at end of file diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl new file mode 100644 index 00000000..3bbd1174 --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.data; + +parcelable DataHolder; diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/images/WebImage.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/images/WebImage.aidl new file mode 100644 index 00000000..e31f15ab --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/images/WebImage.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.images; + +parcelable WebImage; diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl new file mode 100644 index 00000000..791dbe90 --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/GetServiceRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.internal; + +parcelable GetServiceRequest; diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl new file mode 100644 index 00000000..aebd4794 --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ICancelToken.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.common.internal; + +interface ICancelToken { + void cancel(); +} diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl new file mode 100644 index 00000000..b0210281 --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.common.internal; + +import android.os.Bundle; + +interface IGmsCallbacks { + void onPostInitComplete(int statusCode, IBinder binder, in Bundle params); +} diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl new file mode 100644 index 00000000..9649150d --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsServiceBroker.aidl @@ -0,0 +1,39 @@ +package com.google.android.gms.common.internal; + +import android.os.Bundle; + +import com.google.android.gms.common.internal.IGmsCallbacks; +import com.google.android.gms.common.internal.GetServiceRequest; +import com.google.android.gms.common.internal.ValidateAccountRequest; + +interface IGmsServiceBroker { + void getPlusService(IGmsCallbacks callback, int code, String packageName, String authPackage, in String[] scopes, String accountName, in Bundle params) = 0; + void getPanoramaService(IGmsCallbacks callback, int code, String packageName, in Bundle params) = 1; + void getAppDataSearchService(IGmsCallbacks callback, int code, String packageName) = 2; + void getWalletService(IGmsCallbacks callback, int code) = 3; + void getPeopleService(IGmsCallbacks callback, int code, String str, in Bundle params) = 4; + void getReportingService(IGmsCallbacks callback, int code, String str, in Bundle params) = 5; + void getLocationService(IGmsCallbacks callback, int code, String str, in Bundle params) = 6; + void getGoogleLocationManagerService(IGmsCallbacks callback, int code, String str, in Bundle params) = 7; + void getGamesService(IGmsCallbacks callback, int code, String packageName, String accountName, in String[] scopes, String gamePackageName, IBinder popupWindowToken, String desiredLocale, in Bundle params) = 8; + void getAppStateService(IGmsCallbacks callback, int code, String packageName, String accountName, in String[] scopes) = 9; + void getPlayLogService(IGmsCallbacks callback, int code, String str, in Bundle params) = 10; + void getAdMobService(IGmsCallbacks callback, int code, String str, in Bundle params) = 11; + void getDroidGuardService(IGmsCallbacks callback, int code, String str, in Bundle params) = 12; + void getLockboxService(IGmsCallbacks callback, int code, String str, in Bundle params) = 13; + void getCastMirroringService(IGmsCallbacks callback, int code, String str, in Bundle params) = 14; + void getNetworkQualityService(IGmsCallbacks callback, int code, String str, in Bundle params) = 15; + void getGoogleIdentityService(IGmsCallbacks callback, int code, String str, in Bundle params) = 16; + void getGoogleFeedbackService(IGmsCallbacks callback, int code, String str, in Bundle params) = 17; + void getCastService(IGmsCallbacks callback, int code, String str, IBinder binder, in Bundle params) = 18; + void getDriveService(IGmsCallbacks callback, int code, String str1, in String[] args, String str2, in Bundle params) = 19; + void getLightweightAppDataSearchService(IGmsCallbacks callback, int code, String str) = 20; + void getSearchAdministrationService(IGmsCallbacks callback, int code, String str) = 21; + void getAutoBackupService(IGmsCallbacks callback, int code, String str, in Bundle params) = 22; + void getAddressService(IGmsCallbacks callback, int code, String str) = 23; + + void getWalletServiceWithPackageName(IGmsCallbacks callback, int code, String packageName) = 41; + + void getService(IGmsCallbacks callback, in GetServiceRequest request) = 45; + void validateAccount(IGmsCallbacks callback, in ValidateAccountRequest request) = 46; +} diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl new file mode 100644 index 00000000..f6c53996 --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.common.internal; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ISignInButtonCreator { + IObjectWrapper createSignInButton(IObjectWrapper context, int size, int color); // returns View +} diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl new file mode 100644 index 00000000..cef6ad7e --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.internal; + +parcelable ValidateAccountRequest; diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl new file mode 100644 index 00000000..69b856bc --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.common.server; + +parcelable FavaDiagnosticsEntity; \ No newline at end of file diff --git a/play-services-basement/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl new file mode 100644 index 00000000..35e1474a --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.dynamic; + +/** + * The concrete class implementing IObjectWrapper must have exactly one declared private field + * for the wrapped object. Preferably, this is an instance of the ObjectWrapper class. + */ +interface IObjectWrapper { +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java b/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java new file mode 100644 index 00000000..f3272de8 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/ConnectionResult.java @@ -0,0 +1,313 @@ +/* + * 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.common; + +import android.app.Activity; +import android.app.PendingIntent; +import android.content.Intent; +import android.content.IntentSender; +import android.text.TextUtils; + +import java.util.Arrays; + +/** + * Contains all possible error codes for when a client fails to connect to Google Play services. + * These error codes are used by {@link GoogleApiClient.OnConnectionFailedListener}. + */ +public class ConnectionResult { + /** + * The connection was successful. + */ + public static final int SUCCESS = 0; + /** + * Google Play services is missing on this device. The calling activity should pass this error + * code to {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to get a localized + * error dialog that will resolve the error when shown. + */ + public static final int SERVICE_MISSING = 1; + /** + * The installed version of Google Play services is out of date. The calling activity should + * pass this error code to {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to + * get a localized error dialog that will resolve the error when shown. + */ + public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2; + /** + * The installed version of Google Play services has been disabled on this device. The calling + * activity should pass this error code to + * {@link GooglePlayServicesUtil#getErrorDialog(int, Activity, int)} to get a localized error + * dialog that will resolve the error when shown. + */ + public static final int SERVICE_DISABLED = 3; + /** + * The client attempted to connect to the service but the user is not signed in. The client may + * choose to continue without using the API or it may call + * {@link #startResolutionForResult(Activity, int)} to prompt the user to sign in. After the + * sign in activity returns with {@link Activity#RESULT_OK} further attempts to connect should + * succeed. + */ + public static final int SIGN_IN_REQUIRED = 4; + /** + * The client attempted to connect to the service with an invalid account name specified. + */ + public static final int INVALID_ACCOUNT = 5; + /** + * Completing the connection requires some form of resolution. A resolution will be available + * to be started with {@link #startResolutionForResult(Activity, int)}. If the result returned + * is {@link Activity#RESULT_OK}, then further attempts to connect should either complete or + * continue on to the next issue that needs to be resolved. + */ + public static final int RESOLUTION_REQUIRED = 6; + /** + * A network error occurred. Retrying should resolve the problem. + */ + public static final int NETWORK_ERROR = 7; + /** + * An internal error occurred. Retrying should resolve the problem. + */ + public static final int INTERNAL_ERROR = 8; + /** + * The version of the Google Play services installed on this device is not authentic. + */ + public static final int SERVICE_INVALID = 9; + /** + * The application is misconfigured. This error is not recoverable and will be treated as + * fatal. The developer should look at the logs after this to determine more actionable + * information. + */ + public static final int DEVELOPER_ERROR = 10; + /** + * The application is not licensed to the user. This error is not recoverable and will be + * treated as fatal. + */ + public static final int LICENSE_CHECK_FAILED = 11; + /** + * The client canceled the connection by calling {@link GoogleApiClient#disconnect()}. + * Only returned by {@link GoogleApiClient#blockingConnect()}. + */ + public static final int CANCELED = 13; + /** + * The timeout was exceeded while waiting for the connection to complete. Only returned by + * {@link GoogleApiClient#blockingConnect()}. + */ + public static final int TIMEOUT = 14; + /** + * An interrupt occurred while waiting for the connection complete. Only returned by + * {@link GoogleApiClient#blockingConnect()}. + */ + public static final int INTERRUPTED = 15; + /** + * One of the API components you attempted to connect to is not available. The API will not + * work on this device, and updating Google Play services will not likely solve the problem. + * Using the API on the device should be avoided. + */ + public static final int API_UNAVAILABLE = 16; + + /** + * Service doesn't have one or more required permissions. + */ + public static final int SERVICE_MISSING_PERMISSION = 19; + + /** + * The Drive API requires external storage (such as an SD card), but no external storage is + * mounted. This error is recoverable if the user installs external storage (if none is + * present) and ensures that it is mounted (which may involve disabling USB storage mode, + * formatting the storage, or other initialization as required by the device). + *

+ * This error should never be returned on a device with emulated external storage. On devices + * with emulated external storage, the emulated "external storage" is always present regardless + * of whether the device also has removable storage. + */ + @Deprecated + public static final int DRIVE_EXTERNAL_STORAGE_REQUIRED = 1500; + + private final int statusCode; + private final PendingIntent pendingIntent; + private final String message; + + /** + * Creates a connection result. + * + * @param statusCode The status code. + */ + public ConnectionResult(int statusCode) { + this(statusCode, null); + } + + /** + * Creates a connection result. + * + * @param statusCode The status code. + * @param pendingIntent A pending intent that will resolve the issue when started, or null. + */ + public ConnectionResult(int statusCode, PendingIntent pendingIntent) { + this(statusCode, pendingIntent, getStatusString(statusCode)); + } + + /** + * Creates a connection result. + * + * @param statusCode The status code. + * @param pendingIntent A pending intent that will resolve the issue when started, or null. + * @param message An additional error message for the connection result, or null. + */ + public ConnectionResult(int statusCode, PendingIntent pendingIntent, String message) { + this.statusCode = statusCode; + this.pendingIntent = pendingIntent; + this.message = message; + } + + static String getStatusString(int statusCode) { + switch (statusCode) { + case -1: + return "UNKNOWN"; + case 0: + return "SUCCESS"; + case 1: + return "SERVICE_MISSING"; + case 2: + return "SERVICE_VERSION_UPDATE_REQUIRED"; + case 3: + return "SERVICE_DISABLED"; + case 4: + return "SIGN_IN_REQUIRED"; + case 5: + return "INVALID_ACCOUNT"; + case 6: + return "RESOLUTION_REQUIRED"; + case 7: + return "NETWORK_ERROR"; + case 8: + return "INTERNAL_ERROR"; + case 9: + return "SERVICE_INVALID"; + case 10: + return "DEVELOPER_ERROR"; + case 11: + return "LICENSE_CHECK_FAILED"; + case 13: + return "CANCELED"; + case 14: + return "TIMEOUT"; + case 15: + return "INTERRUPTED"; + case 16: + return "API_UNAVAILABLE"; + case 17: + return "SIGN_IN_FAILED"; + case 18: + return "SERVICE_UPDATING"; + case 19: + return "SERVICE_MISSING_PERMISSION"; + case 20: + return "RESTRICTED_PROFILE"; + case 21: + return "API_VERSION_UPDATE_REQUIRED"; + case 42: + return "UPDATE_ANDROID_WEAR"; + case 99: + return "UNFINISHED"; + case 1500: + return "DRIVE_EXTERNAL_STORAGE_REQUIRED"; + default: + return "UNKNOWN_ERROR_CODE(" + statusCode + ")"; + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } else if (!(o instanceof ConnectionResult)) { + return false; + } else { + ConnectionResult r = (ConnectionResult)o; + return statusCode == r.statusCode && pendingIntent == null ? r.pendingIntent == null : pendingIntent.equals(r.pendingIntent) && TextUtils.equals(message, r.message); + } + } + + /** + * Indicates the type of error that interrupted connection. + * + * @return the error code, or {@link #SUCCESS} if no error occurred. + */ + public int getErrorCode() { + return statusCode; + } + + /** + * Returns an error message for connection result. + * + * @return the message + */ + public String getErrorMessage() { + return message; + } + + /** + * A pending intent to resolve the connection failure. This intent can be started with + * {@link Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int)} to + * present UI to solve the issue. + * + * @return The pending intent to resolve the connection failure. + */ + public PendingIntent getResolution() { + return pendingIntent; + } + + @Override + public int hashCode() { + return Arrays.hashCode(new Object[]{statusCode, pendingIntent, message}); + } + + /** + * Returns {@code true} if calling {@link #startResolutionForResult(Activity, int)} will start + * any intents requiring user interaction. + * + * @return {@code true} if there is a resolution that can be started. + */ + public boolean hasResolution() { + return statusCode != 0 && pendingIntent != null; + } + + /** + * Returns {@code true} if the connection was successful. + * + * @return {@code true} if the connection was successful, {@code false} if there was an error. + */ + public boolean isSuccess() { + return statusCode == 0; + } + + /** + * Resolves an error by starting any intents requiring user interaction. See + * {@link #SIGN_IN_REQUIRED}, and {@link #RESOLUTION_REQUIRED}. + * + * @param activity An Activity context to use to resolve the issue. The activity's + * {@link Activity#onActivityResult} method will be invoked after the user + * is done. If the resultCode is {@link Activity#RESULT_OK}, the application + * should try to connect again. + * @param requestCode The request code to pass to {@link Activity#onActivityResult}. + * @throws IntentSender.SendIntentException If the resolution intent has been canceled or is no + * longer able to execute the request. + */ + public void startResolutionForResult(Activity activity, int requestCode) throws + IntentSender.SendIntentException { + if (hasResolution()) { + activity.startIntentSenderForResult(pendingIntent.getIntentSender(), requestCode, null, 0, 0, 0); + } + } +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java b/play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java new file mode 100644 index 00000000..a3dfbf5f --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java @@ -0,0 +1,34 @@ +/* + * 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.common; + +public class Scopes { + public static final String PROFILE = "profile"; + public static final String PLUS_LOGIN = "https://www.googleapis.com/auth/plus.login"; + public static final String PLUS_ME = "https://www.googleapis.com/auth/plus.me"; + public static final String GAMES = "https://www.googleapis.com/auth/games"; + public static final String CLOUD_SAVE = "https://www.googleapis.com/auth/datastoremobile"; + public static final String APP_STATE = "https://www.googleapis.com/auth/appstate"; + public static final String DRIVE_FILE = "https://www.googleapis.com/auth/drive.file"; + public static final String DRIVE_APPFOLDER = "https://www.googleapis.com/auth/drive.appdata"; + public static final String FITNESS_ACTIVITY_READ = "https://www.googleapis.com/auth/fitness.activity.read"; + public static final String FITNESS_ACTIVITY_READ_WRITE = "https://www.googleapis.com/auth/fitness.activity.write"; + public static final String FITNESS_LOCATION_READ = "https://www.googleapis.com/auth/fitness.location.read"; + public static final String FITNESS_LOCATION_READ_WRITE = "https://www.googleapis.com/auth/fitness.location.write"; + public static final String FITNESS_BODY_READ = "https://www.googleapis.com/auth/fitness.body.read"; + public static final String FITNESS_BODY_READ_WRITE = "https://www.googleapis.com/auth/fitness.body.write"; +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java new file mode 100644 index 00000000..6a2cbb51 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/CommonStatusCodes.java @@ -0,0 +1,91 @@ +/* + * 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.common.api; + +import androidx.annotation.NonNull; + +import org.microg.gms.common.PublicApi; + +@PublicApi +public class CommonStatusCodes { + public static final int SUCCESS_CACHE = -1; + public static final int SUCCESS = 0; + @Deprecated + public static final int SERVICE_MISSING = 1; + @Deprecated + public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2; + @Deprecated + public static final int SERVICE_DISABLED = 3; + public static final int SIGN_IN_REQUIRED = 4; + public static final int INVALID_ACCOUNT = 5; + public static final int RESOLUTION_REQUIRED = 6; + public static final int NETWORK_ERROR = 7; + public static final int INTERNAL_ERROR = 8; + public static final int SERVICE_INVALID = 9; + public static final int DEVELOPER_ERROR = 10; + public static final int LICENSE_CHECK_FAILED = 11; + public static final int ERROR = 13; + public static final int INTERRUPTED = 14; + public static final int TIMEOUT = 15; + public static final int CANCELED = 16; + public static final int API_NOT_CONNECTED = 17; + public static final int DEAD_CLIENT = 18; + + @NonNull + public static String getStatusCodeString(int statusCode) { + switch (statusCode) { + case SUCCESS_CACHE: + return "SUCCESS_CACHE"; + case SUCCESS: + return "SUCCESS"; + case SERVICE_VERSION_UPDATE_REQUIRED: + return "SERVICE_VERSION_UPDATE_REQUIRED"; + case SERVICE_DISABLED: + return "SERVICE_DISABLED"; + case SIGN_IN_REQUIRED: + return "SIGN_IN_REQUIRED"; + case INVALID_ACCOUNT: + return "INVALID_ACCOUNT"; + case RESOLUTION_REQUIRED: + return "RESOLUTION_REQUIRED"; + case NETWORK_ERROR: + return "NETWORK_ERROR"; + case INTERNAL_ERROR: + return "INTERNAL_ERROR"; + case SERVICE_INVALID: + return "SERVICE_INVALID"; + case DEVELOPER_ERROR: + return "DEVELOPER_ERROR"; + case LICENSE_CHECK_FAILED: + return "LICENSE_CHECK_FAILED"; + case ERROR: + return "ERROR"; + case INTERRUPTED: + return "INTERRUPTED"; + case TIMEOUT: + return "TIMEOUT"; + case CANCELED: + return "CANCELED"; + case API_NOT_CONNECTED: + return "API_NOT_CONNECTED"; + case DEAD_CLIENT: + return "DEAD_CLIENT"; + default: + return "unknown status code: " + statusCode; + } + } +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/Releasable.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Releasable.java new file mode 100644 index 00000000..cbbbd4c7 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/Releasable.java @@ -0,0 +1,24 @@ +/* + * 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.common.api; + +/** + * Represents a resource, or a holder of resources, which may be released once they are no longer needed. + */ +public interface Releasable { + void release(); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/Result.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Result.java new file mode 100644 index 00000000..3ed0bd7e --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/Result.java @@ -0,0 +1,27 @@ +/* + * 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.common.api; + +import org.microg.gms.common.PublicApi; + +/** + * Represents the final result of invoking an API method in Google Play Services. + */ +@PublicApi +public interface Result { + public Status getStatus(); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/ResultCallback.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/ResultCallback.java new file mode 100644 index 00000000..1cac879c --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/ResultCallback.java @@ -0,0 +1,33 @@ +/* + * 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.common.api; + +/** + * An interface for receiving a {@link Result} from a {@link PendingResult} as an asynchronous + * callback. + */ +public interface ResultCallback { + /** + * Called when the {@link Result} is ready. It is the responsibility of each callback to + * release any resources associated with the result. Some result types may implement + * {@link Releasable}, in which case {@link Releasable#release()} should be used to free the + * associated resources. + * + * @param result The result from the API call. May not be null. + */ + public void onResult(R result); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/api/Scope.java b/play-services-basement/src/main/java/com/google/android/gms/common/api/Scope.java new file mode 100644 index 00000000..d99932b2 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/Scope.java @@ -0,0 +1,65 @@ +/* + * 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.common.api; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Describes an OAuth 2.0 scope to request. This has security implications for the user, and + * requesting additional scopes will result in authorization dialogs. + */ +@PublicApi +public class Scope extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private final String scopeUri; + + private Scope() { + scopeUri = null; + } + + /** + * Creates a new scope with the given URI. + */ + public Scope(String scopeUri) { + this.scopeUri = scopeUri; + } + + @Override + public boolean equals(Object o) { + return this == o || o instanceof Scope && scopeUri.equals(((Scope) o).scopeUri); + } + + public String getScopeUri() { + return scopeUri; + } + + @Override + public int hashCode() { + return scopeUri.hashCode(); + } + + @Override + public String toString() { + return scopeUri; + } + + public static final Creator CREATOR = new AutoCreator(Scope.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 new file mode 100644 index 00000000..6a80ff39 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/api/Status.java @@ -0,0 +1,180 @@ +/* + * 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.common.api; + +import android.app.Activity; +import android.app.PendingIntent; +import android.content.Intent; +import android.content.IntentSender; +import android.content.IntentSender.SendIntentException; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Represents the results of work. + */ +@PublicApi +public final class Status extends AutoSafeParcelable implements Result { + @PublicApi(exclude = true) + public static final Status INTERNAL_ERROR = new Status(CommonStatusCodes.INTERNAL_ERROR); + @PublicApi(exclude = true) + public static final Status CANCELED = new Status(CommonStatusCodes.CANCELED); + @PublicApi(exclude = true) + public static final Status SUCCESS = new Status(CommonStatusCodes.SUCCESS); + + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private final int statusCode; + + @SafeParceled(2) + private final String statusMessage; + + @SafeParceled(3) + private final PendingIntent resolution; + + private Status() { + statusCode = 0; + statusMessage = null; + resolution = null; + } + + /** + * Creates a representation of the status resulting from a GoogleApiClient operation. + * + * @param statusCode The status code. + */ + public Status(int statusCode) { + this(statusCode, null); + } + + /** + * Creates a representation of the status resulting from a GoogleApiClient operation. + * + * @param statusCode The status code. + * @param statusMessage The message associated with this status, or null. + */ + public Status(int statusCode, String statusMessage) { + this(statusCode, statusMessage, null); + } + + /** + * Creates a representation of the status resulting from a GoogleApiClient operation. + * + * @param statusCode The status code. + * @param statusMessage The message associated with this status, or null. + * @param resolution A pending intent that will resolve the issue when started, or null. + */ + public Status(int statusCode, String statusMessage, PendingIntent resolution) { + this.statusCode = statusCode; + this.statusMessage = statusMessage; + this.resolution = resolution; + } + + /** + * A pending intent to resolve the failure. This intent can be started with + * {@link Activity#startIntentSenderForResult(IntentSender, int, Intent, int, int, int)} to + * present UI to solve the issue. + * + * @return The pending intent to resolve the failure. + */ + public PendingIntent getResolution() { + return resolution; + } + + /** + * Returns the status of this result. Use {@link #isSuccess()} to determine whether the call + * was successful, and {@link #getStatusCode()} to determine what the error cause was. + *

+ * Certain errors are due to failures that can be resolved by launching a particular intent. + * The resolution intent is available via {@link #getResolution()}. + */ + @Override + public Status getStatus() { + return this; + } + + /** + * Indicates the status of the operation. + * + * @return Status code resulting from the operation. The value is one of the constants in + * {@link CommonStatusCodes} or specific to the APIs added to the GoogleApiClient. + */ + public int getStatusCode() { + return statusCode; + } + + public String getStatusMessage() { + return statusMessage; + } + + /** + * Returns true if calling {@link #startResolutionForResult(Activity, int)} will start any + * intents requiring user interaction. + * + * @return true if there is a resolution that can be started. + */ + public boolean hasResolution() { + return resolution != null; + } + + /** + * Returns true if the operation was canceled. + */ + public boolean isCanceled() { + return statusCode == CommonStatusCodes.CANCELED; + } + + /** + * Returns true if the operation was interrupted. + */ + public boolean isInterrupted() { + return statusCode == CommonStatusCodes.INTERRUPTED; + } + + /** + * Returns true if the operation was successful. + * + * @return true if the operation was successful, false if there was an error. + */ + public boolean isSuccess() { + return statusCode <= 0; + } + + /** + * Resolves an error by starting any intents requiring user interaction. See + * {@link CommonStatusCodes#SIGN_IN_REQUIRED}, and {@link CommonStatusCodes#RESOLUTION_REQUIRED}. + * + * @param activity An Activity context to use to resolve the issue. The activity's + * onActivityResult method will be invoked after the user is done. If the + * resultCode is {@link Activity#RESULT_OK}, the application should try to + * connect again. + * @param requestCode The request code to pass to onActivityResult. + * @throws SendIntentException If the resolution intent has been canceled or is no longer able + * to execute the request. + */ + public void startResolutionForResult(Activity activity, int requestCode) throws SendIntentException { + if (hasResolution()) { + activity.startIntentSenderForResult(resolution.getIntentSender(), requestCode, null, 0, 0, 0); + } + } + + public static final Creator CREATOR = new AutoCreator(Status.class); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-basement/src/main/java/com/google/android/gms/common/data/DataHolder.java new file mode 100644 index 00000000..2867e413 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/data/DataHolder.java @@ -0,0 +1,553 @@ +/* + * 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.common.data; + +import android.annotation.SuppressLint; +import android.content.ContentValues; +import android.database.AbstractWindowedCursor; +import android.database.CharArrayBuffer; +import android.database.Cursor; +import android.database.CursorWindow; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.os.Parcel; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.io.Closeable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Class for accessing collections of data, organized into columns. This provides the backing + * support for DataBuffer. Much like a cursor, the holder supports the notion of a current + * position, and has methods for extracting various types of data from named columns. + */ +@PublicApi(until = "1") +public class DataHolder extends AutoSafeParcelable implements Closeable { + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + private final String[] columns; + + @SafeParceled(2) + private final CursorWindow[] windows; + + @SafeParceled(3) + private final int statusCode; + + @SafeParceled(4) + private final Bundle metadata; + + private boolean closed = false; + private Map columnIndices; + + protected static final int FIELD_TYPE_NULL = 0; + protected static final int FIELD_TYPE_INTEGER = 1; + protected static final int FIELD_TYPE_FLOAT = 2; + protected static final int FIELD_TYPE_STRING = 3; + protected static final int FIELD_TYPE_BLOB = 4; + + private DataHolder() { + columns = null; + windows = null; + statusCode = 0; + metadata = null; + } + + /** + * Creates a data holder with the specified data. + * + * @param columns The column names corresponding to the data in the given windows. + * @param windows The {@link CursorWindow} instances holding the data. + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + */ + public DataHolder(String[] columns, CursorWindow[] windows, int statusCode, Bundle metadata) { + this.columns = columns; + this.windows = windows; + this.statusCode = statusCode; + this.metadata = metadata; + validateContents(); + } + + /** + * Creates a data holder wrapping the provided cursor, with provided status code and metadata. + * + * @param cursor The cursor containing the data. + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + */ + public DataHolder(AbstractWindowedCursor cursor, int statusCode, Bundle metadata) { + this(cursor.getColumnNames(), createCursorWindows(cursor), statusCode, metadata); + } + + /** + * Creates a data holder wrapping the provided cursor, with provided status code and metadata. + * + * @param cursor The cursor containing the data. + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + */ + public DataHolder(Cursor cursor, int statusCode, Bundle metadata) { + this(cursor.getColumnNames(), createCursorWindows(cursor), statusCode, metadata); + } + + /** + * Get a {@link DataHolder.Builder} to create a new {@link DataHolder} manually. + * + * @param columns The array of column names that the object supports. + * @param uniqueColumn The non-null column name that must contain unique values. New rows added to the builder with the same value in this column will replace any older rows. + * @return {@link DataHolder.Builder} object to work with. + */ + public static Builder builder(String[] columns, String uniqueColumn) { + return new Builder(columns, uniqueColumn); + } + + /** + * Get a {@link DataHolder.Builder} to create a new {@link DataHolder} manually. + * + * @param columns The array of column names that the object supports. + * @return {@link DataHolder.Builder} object to work with. + */ + public static Builder builder(String[] columns) { + return builder(columns, null); + } + + /** + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + * @return An empty {@link DataHolder} object with the given status and metadata. + */ + public static DataHolder empty(int statusCode, Bundle metadata) { + return new DataHolder(new String[0], new CursorWindow[0], statusCode, metadata); + } + + /** + * @param statusCode The status code of this {@link DataHolder}. + * @return An empty {@link DataHolder} object with the given status and null metadata. + */ + public static DataHolder empty(int statusCode) { + return empty(statusCode, null); + } + + @SuppressWarnings("deprecation") + @SuppressLint({"NewApi", "ObsoleteSdkInt"}) + static int getCursorType(Cursor cursor, int i) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + return cursor.getType(i); + } + if (cursor instanceof AbstractWindowedCursor) { + CursorWindow cursorWindow = ((AbstractWindowedCursor) cursor).getWindow(); + int pos = cursor.getPosition(); + int type = -1; + if (cursorWindow.isNull(pos, i)) { + type = FIELD_TYPE_NULL; + } else if (cursorWindow.isLong(pos, i)) { + type = FIELD_TYPE_INTEGER; + } else if (cursorWindow.isFloat(pos, i)) { + type = FIELD_TYPE_FLOAT; + } else if (cursorWindow.isString(pos, i)) { + type = FIELD_TYPE_STRING; + } else if (cursorWindow.isBlob(pos, i)) { + type = FIELD_TYPE_BLOB; + } + + return type; + } + throw new RuntimeException("Unsupported cursor on this platform!"); + } + + /** + * Closes the data holder, releasing all of its resources and making it completely invalid. + */ + @Override + public void close() { + synchronized (this) { + if (!closed) { + closed = true; + for (CursorWindow window : windows) { + window.close(); + } + } + } + } + + /** + * Copies the String content in the given column at the provided position into a {@link CharArrayBuffer}. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @param dataOut The {@link CharArrayBuffer} to copy into. + */ + public void copyToBuffer(String column, int row, int windowIndex, CharArrayBuffer dataOut) { + throw new RuntimeException("Not yet available"); + } + + @SuppressWarnings("deprecation") + private static CursorWindow[] createCursorWindows(Builder builder) { + if (builder.columns.length == 0) return new CursorWindow[0]; + List windows = new ArrayList(); + try { + CursorWindow current = null; + for (int rowIndex = 0; rowIndex < builder.rows.size(); rowIndex++) { + Map row = builder.rows.get(rowIndex); + if (current == null || !current.allocRow()) { + current = new CursorWindow(false); + current.setStartPosition(rowIndex); + current.setNumColumns(builder.columns.length); + windows.add(current); + if (!current.allocRow()) { + windows.remove(current); + return windows.toArray(new CursorWindow[windows.size()]); + } + } + for (int columnIndex = 0; columnIndex < builder.columns.length; columnIndex++) { + Object val = row.get(builder.columns[columnIndex]); + if (val == null) { + current.putNull(rowIndex, columnIndex); + } else if (val instanceof String) { + current.putString((String) val, rowIndex, columnIndex); + } else if (val instanceof Long) { + current.putLong((Long) val, rowIndex, columnIndex); + } else if (val instanceof Integer) { + current.putLong((Integer) val, rowIndex, columnIndex); + } else if (val instanceof Boolean) { + if ((Boolean) val) + current.putLong(1, rowIndex, columnIndex); + } else if (val instanceof byte[]) { + current.putBlob((byte[]) val, rowIndex, columnIndex); + } else if (val instanceof Double) { + current.putDouble((Double) val, rowIndex, columnIndex); + } else if (val instanceof Float) { + current.putDouble((Float) val, rowIndex, columnIndex); + } else { + throw new IllegalArgumentException("Unsupported object for column " + columnIndex + ": " + val); + } + } + } + } catch (RuntimeException e) { + for (CursorWindow window : windows) { + window.close(); + } + throw e; + } + return windows.toArray(new CursorWindow[windows.size()]); + } + + private static CursorWindow[] createCursorWindows(Cursor cursor) { + if (cursor.getColumnCount() == 0) return new CursorWindow[0]; + List windows = new ArrayList(); + CursorWindow current = null; + int rowIndex = 0; + while (cursor.moveToNext()) { + if (current == null || !current.allocRow()) { + current = new CursorWindow(false); + current.setStartPosition(rowIndex); + current.setNumColumns(cursor.getColumnCount()); + windows.add(current); + if (!current.allocRow()) { + windows.remove(current); + return windows.toArray(new CursorWindow[windows.size()]); + } + } + for (int i = 0; i < cursor.getColumnCount(); i++) { + switch (getCursorType(cursor, i)) { + case FIELD_TYPE_NULL: + current.putNull(rowIndex, i); + break; + case FIELD_TYPE_BLOB: + current.putBlob(cursor.getBlob(i), rowIndex, i); + break; + case FIELD_TYPE_FLOAT: + current.putDouble(cursor.getDouble(i), rowIndex, i); + break; + case FIELD_TYPE_INTEGER: + current.putLong(cursor.getLong(i), rowIndex, i); + break; + case FIELD_TYPE_STRING: + current.putString(cursor.getString(i), rowIndex, i); + break; + } + } + rowIndex++; + } + cursor.close(); + return windows.toArray(new CursorWindow[windows.size()]); + } + + /** + * Retrieves the boolean value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The boolean value in that column. + */ + public boolean getBoolean(String column, int row, int windowIndex) { + return windows[windowIndex].getLong(row, columnIndices.get(column)) == 1; + } + + /** + * Retrieves the byte array value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The byte array value in that column. + */ + public byte[] getByteArray(String column, int row, int windowIndex) { + return windows[windowIndex].getBlob(row, columnIndices.get(column)); + } + + /** + * Gets the number of rows in the data holder. + * + * @return the number of rows in the data holder. + */ + public int getCount() { + int c = 0; + if (windows != null) { + for (CursorWindow window : windows) { + c += window.getNumRows(); + } + } + return c; + } + + /** + * Retrieves the integer value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The integer value in that column. + */ + public int getInteger(String column, int row, int windowIndex) { + return windows[windowIndex].getInt(row, columnIndices.get(column)); + } + + /** + * Retrieves the long value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The long value in that column. + */ + public long getLong(String column, int row, int windowIndex) { + return windows[windowIndex].getLong(row, columnIndices.get(column)); + } + + public int getStatusCode() { + return statusCode; + } + + /** + * Retrieves the string value for a given column at the provided position. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The string value in that column. + */ + public String getString(String column, int row, int windowIndex) { + return windows[windowIndex].getString(row, columnIndices.get(column)); + } + + /** + * Returns whether the given column at the provided position contains null. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return Whether the column value is null at this position. + */ + public boolean isNull(String column, int row, int windowIndex) { + return windows[windowIndex].isNull(row, columnIndices.get(column)); + } + + public boolean isClosed() { + synchronized (this) { + return closed; + } + } + + /** + * Retrieves the column data at the provided position as a URI if possible, checking for null values. + * This will throw an {@link IllegalArgumentException} if the column does not exist, the + * position is invalid, or the data holder has been closed. + * + * @param column The column to retrieve. + * @param row The row to retrieve the data from. + * @param windowIndex Index of the cursor window to extract the data from. + * @return The column data as a URI, or null if not present. + */ + public Uri parseUri(String column, int row, int windowIndex) { + String string = getString(column, row, windowIndex); + if (string != null) return Uri.parse(string); + return null; + } + + @Override + public String toString() { + return "DataHolder{" + + "columns=" + Arrays.toString(columns) + + ", windows=" + Arrays.toString(windows) + + ", statusCode=" + statusCode + + ", metadata=" + metadata + + '}'; + } + + public void validateContents() { + columnIndices = new HashMap(); + for (int i = 0; i < columns.length; i++) { + columnIndices.put(columns[i], i); + } + } + + /** + * Helper class to build {@link DataHolder} instances containing arbitrary data. + *

+ * Note that the constructor is private; use DataHolder.builder() to create instances of this class. + */ + public static class Builder { + private final String[] columns; + private final ArrayList> rows; + private final String uniqueColumn; + private final Map uniqueIndizes; + + private Builder(String[] columns, String uniqueColumn) { + this.columns = columns; + this.rows = new ArrayList>(); + this.uniqueColumn = uniqueColumn; + this.uniqueIndizes = new HashMap(); + } + + /** + * Instantiate an {@link DataHolder} from this {@link DataHolder.Builder} with the given status code and metadata. + * + * @param statusCode The status code of this {@link DataHolder}. + * @param metadata The metadata associated with this {@link DataHolder} (may be null). + * @return {@link DataHolder} representation of this object. + */ + public DataHolder build(int statusCode, Bundle metadata) { + return new DataHolder(columns, createCursorWindows(this), statusCode, metadata); + } + + /** + * Instantiate an {@link DataHolder} from this {@link DataHolder.Builder} with the given status code and null metadata. + * + * @param statusCode The status code of this {@link DataHolder}. + * @return {@link DataHolder} representation of this object. + */ + public DataHolder build(int statusCode) { + return build(statusCode, null); + } + + /** + * @return The number of rows that the resulting DataHolder will contain. + */ + public int getCount() { + return rows.size(); + } + + /** + * Sort the rows in this builder based on the standard data type comparisons for the value in the provided column. + * Calling this multiple times with the same column will not change the sort order of the builder. + * Note that any data which is added after this call will not be sorted. + * + * @param sortColumn The column to sort the rows in this builder by. + * @return {@link DataHolder.Builder} to continue construction. + */ + public Builder sort(String sortColumn) { + throw new RuntimeException("Not yet implemented"); + } + + /** + * Add a new row of data to the {@link DataHolder} this {@link DataHolder.Builder} will create. Note that the data must contain an entry for all columns + *

+ * Currently the only supported value types that are supported are String, Long, and Boolean (Integer is also accepted and will be stored as a Long). + * + * @param values {@link ContentValues} containing row data. + * @return {@link DataHolder.Builder} to continue construction. + */ + public Builder withRow(ContentValues values) { + HashMap row = new HashMap(); + for (Map.Entry entry : values.valueSet()) { + row.put(entry.getKey(), entry.getValue()); + } + return withRow(row); + } + + /** + * Add a new row of data to the {@link DataHolder} this {@link DataHolder.Builder} will create. Note that the data must contain an entry for all columns + *

+ * Currently the only supported value types that are supported are String, Long, and Boolean (Integer is also accepted and will be stored as a Long). + * + * @param row Map containing row data. + * @return {@link DataHolder.Builder} to continue construction. + */ + public Builder withRow(HashMap row) { + if (uniqueColumn != null) { + Object val = row.get(uniqueColumn); + if (val != null) { + Integer old = uniqueIndizes.get(val); + if (old != null) { + rows.set(old, row); + return this; + } else { + uniqueIndizes.put(val, rows.size()); + } + } + } + rows.add(row); + return this; + } + } + + public static final Creator CREATOR = new AutoCreator(DataHolder.class) { + @Override + public DataHolder createFromParcel(Parcel parcel) { + DataHolder res = super.createFromParcel(parcel); + res.validateContents(); + return res; + } + }; +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/data/Freezable.java b/play-services-basement/src/main/java/com/google/android/gms/common/data/Freezable.java new file mode 100644 index 00000000..51f4847e --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/data/Freezable.java @@ -0,0 +1,39 @@ +/* + * 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.common.data; + +public interface Freezable { + /** + * Freeze a volatile representation into an immutable representation. Objects returned from + * this call are safe to cache. + *

+ * Note that the output of {@link #freeze} may not be identical to the parent object, but + * should be equal. + * + * @return A concrete implementation of the data object. + */ + T freeze(); + + /** + * Check to see if this object is valid for use. If the object is still volatile, this method + * will indicate whether or not the object can be safely used. + * The output of a call to {@link #freeze()} will always be valid. + * + * @return whether or not the object is valid for use. + */ + boolean isDataValid(); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/images/WebImage.java b/play-services-basement/src/main/java/com/google/android/gms/common/images/WebImage.java new file mode 100644 index 00000000..c8f8f2a2 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/images/WebImage.java @@ -0,0 +1,64 @@ +/* + * 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.common.images; + +import java.util.Locale; + +import android.net.Uri; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class WebImage extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(WebImage.class); + + public WebImage () { + this.uri = null; + } + + public WebImage (Uri uri) { + this.uri = uri; + } + + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + private final Uri uri; + + @SafeParceled(3) + private final int width = 0; + + @SafeParceled(4) + private final int height = 0; + + public Uri getUrl() { + return uri; + } + + public int getWidth() { + return width; + } + + public int getHeight() { + return height; + } + + public String toString() { + return String.format(Locale.getDefault(), "Image %dx%d %s", new Object[]{Integer.valueOf(width), Integer.valueOf(height), uri.toString()}); + } +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java b/play-services-basement/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java new file mode 100644 index 00000000..47ec3949 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java @@ -0,0 +1,51 @@ +/* + * 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.common.internal; + +import android.os.IBinder; +import android.os.Parcel; +import android.os.Parcelable; + +public class BinderWrapper implements Parcelable { + public IBinder binder; + + public BinderWrapper(IBinder binder) { + this.binder = binder; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeStrongBinder(binder); + } + + public static final Creator CREATOR = new Creator() { + @Override + public BinderWrapper createFromParcel(Parcel source) { + return new BinderWrapper(source.readStrongBinder()); + } + + @Override + public BinderWrapper[] newArray(int size) { + return new BinderWrapper[size]; + } + }; +} 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 new file mode 100644 index 00000000..488feba9 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/internal/GetServiceRequest.java @@ -0,0 +1,83 @@ +/* + * 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.common.internal; + +import android.accounts.Account; +import android.os.Bundle; +import android.os.IBinder; + +import com.google.android.gms.common.api.Scope; + +import org.microg.gms.common.Constants; +import org.microg.gms.common.GmsService; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.Arrays; + +public class GetServiceRequest extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 3; + + @SafeParceled(2) + public final int serviceId; + + @SafeParceled(3) + public int gmsVersion; + + @SafeParceled(4) + public String packageName; + + @SafeParceled(5) + public IBinder accountAccessor; + + @SafeParceled(6) + public Scope[] scopes; + + @SafeParceled(7) + public Bundle extras; + + @SafeParceled(8) + public Account account; + + @SafeParceled(9) + public long long1; + + private GetServiceRequest() { + serviceId = -1; + gmsVersion = Constants.MAX_REFERENCE_VERSION; + } + + public GetServiceRequest(int serviceId) { + this.serviceId = serviceId; + this.gmsVersion = Constants.MAX_REFERENCE_VERSION; + } + + @Override + public String toString() { + return "GetServiceRequest{" + + "serviceId=" + GmsService.nameFromServiceId(serviceId) + + ", gmsVersion=" + gmsVersion + + ", packageName='" + packageName + '\'' + + (scopes == null || scopes.length == 0 ? "" : (", scopes=" + Arrays.toString(scopes))) + + (extras == null ? "" : (", extras=" + extras)) + + (account == null ? "" : (", account=" + account)) + + '}'; + } + + public static Creator CREATOR = new AutoCreator(GetServiceRequest.class); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java b/play-services-basement/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.java new file mode 100644 index 00000000..71337291 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/internal/ValidateAccountRequest.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.common.internal; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ValidateAccountRequest extends AutoSafeParcelable { + public static Creator CREATOR = new AutoCreator(ValidateAccountRequest.class); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java b/play-services-basement/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java new file mode 100644 index 00000000..6f10959a --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java @@ -0,0 +1,24 @@ +/* + * 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.common.server; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class FavaDiagnosticsEntity extends AutoSafeParcelable { + + public static final Creator CREATOR = new AutoCreator(FavaDiagnosticsEntity.class); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java b/play-services-basement/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java new file mode 100644 index 00000000..6f26194b --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java @@ -0,0 +1,77 @@ +/* + * 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.dynamic; + +import android.os.IBinder; + +import androidx.annotation.Nullable; + +import java.lang.reflect.Field; + +public class ObjectWrapper extends IObjectWrapper.Stub { + private final T t; + + public ObjectWrapper(T t) { + this.t = t; + } + + @Nullable + public static Object unwrap(IObjectWrapper obj) { + if (obj == null) { + return null; + } + if (obj instanceof ObjectWrapper) { + return ((ObjectWrapper) obj).t; + } + IBinder binder = obj.asBinder(); + Field[] fields = binder.getClass().getDeclaredFields(); + if (fields.length != 1) { + throw new IllegalArgumentException(); + } + Field field = fields[0]; + if (!field.isAccessible()) { + field.setAccessible(true); + try { + return field.get(binder); + } catch (NullPointerException localNullPointerException) { + throw new IllegalArgumentException("Binder object is null.", + localNullPointerException); + } catch (IllegalArgumentException localIllegalArgumentException) { + throw new IllegalArgumentException("remoteBinder is the wrong class.", + localIllegalArgumentException); + } catch (IllegalAccessException localIllegalAccessException) { + throw new IllegalArgumentException("Could not access the field in remoteBinder.", + localIllegalAccessException); + } + } else { + throw new IllegalArgumentException(); + } + } + + @Nullable + public static T unwrapTyped(IObjectWrapper obj, Class clazz) { + try { + return clazz.cast(unwrap(obj)); + } catch (ClassCastException e) { + return null; + } + } + + public static ObjectWrapper wrap(T t) { + return new ObjectWrapper(t); + } +} diff --git a/play-services-basement/src/main/java/org/microg/gms/auth/AuthConstants.java b/play-services-basement/src/main/java/org/microg/gms/auth/AuthConstants.java new file mode 100644 index 00000000..2245272c --- /dev/null +++ b/play-services-basement/src/main/java/org/microg/gms/auth/AuthConstants.java @@ -0,0 +1,27 @@ +/* + * 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.auth; + +public class AuthConstants { + public static final String DEFAULT_ACCOUNT = "<>"; + public static final String SCOPE_GET_ACCOUNT_ID = "^^_account_id_^^"; + public static final String PROVIDER_METHOD_GET_ACCOUNTS = "get_accounts"; + public static final String PROVIDER_METHOD_CLEAR_PASSWORD = "clear_password"; + public static final String PROVIDER_EXTRA_CLEAR_PASSWORD = "clear_password"; + public static final String PROVIDER_EXTRA_ACCOUNTS = "accounts"; + public static final String DEFAULT_ACCOUNT_TYPE = "com.google"; +} diff --git a/play-services-basement/src/main/java/org/microg/gms/common/Constants.java b/play-services-basement/src/main/java/org/microg/gms/common/Constants.java new file mode 100644 index 00000000..e6680da8 --- /dev/null +++ b/play-services-basement/src/main/java/org/microg/gms/common/Constants.java @@ -0,0 +1,24 @@ +/* + * 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 org.microg.gms.common; + +public class Constants { + public static final int MAX_REFERENCE_VERSION = 19420 * 1000; + public static final String GMS_PACKAGE_NAME = "com.google.android.gms"; + public static final String GSF_PACKAGE_NAME = "com.google.android.gsf"; + public static final String GMS_PACKAGE_SIGNATURE_SHA1 = "38918a453d07199354f8b19af05ec6562ced5788"; +} 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 new file mode 100644 index 00000000..19dcf1e3 --- /dev/null +++ b/play-services-basement/src/main/java/org/microg/gms/common/GmsService.java @@ -0,0 +1,133 @@ +/* + * 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; + +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"), + CAR(13, "com.google.android.gms.car.service.START"), + WEARABLE(14, "com.google.android.gms.wearable.BIND"), + AUTH(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"), + DROIDGUARD(25, "com.google.android.gms.droidguard.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.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"), + TAP_AND_PAY(79, "com.google.android.gms.tapandpay.service.BIND"), + ACCOUNTS(81, "com.google.android.gms.smartdevice.setup.accounts.AccountsService.START"), + TRUST_AGENT(85, "com.google.android.gms.trustagent.StateApi.START"), + MEASUREMENT(93, "com.google.android.gms.measurement.START"), + FREIGHTER(98, "com.google.android.gms.freighter.service.START"), + BLE(111, "com.google.android.gms.beacon.internal.IBleService.START"), + APP_INDEXING(113), + GASS(116, "com.google.android.gms.gass.START"), + WORK_ACCOUNT(120), + AD_CACHE(123, "com.google.android.gms.ads.service.CACHE"), + ; + + public int SERVICE_ID; + public String ACTION; + public String[] SECONDARY_ACTIONS; + + GmsService(int serviceId, String... actions) { + this.SERVICE_ID = serviceId; + this.ACTION = actions.length > 0 ? actions[0] : null; + 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; + } + return UNKNOWN; + } + + public static String nameFromServiceId(int serviceId) { + return byServiceId(serviceId).toString(serviceId); + } + + public String toString(int serviceId) { + if (this != UNKNOWN) return toString(); + return "UNKNOWN(" + serviceId + ")"; + } +} diff --git a/play-services-basement/src/main/java/org/microg/gms/common/PublicApi.java b/play-services-basement/src/main/java/org/microg/gms/common/PublicApi.java new file mode 100644 index 00000000..92663979 --- /dev/null +++ b/play-services-basement/src/main/java/org/microg/gms/common/PublicApi.java @@ -0,0 +1,48 @@ +/* + * 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.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * An class, method or field is named public, if it can be used with the original play services + * client library. + */ +@Retention(RetentionPolicy.SOURCE) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR}) +public @interface PublicApi { + /** + * @return the first version that contains the given class, method or field + */ + String since() default "0"; + + /** + * @return the last version that contains the given class, method or field + */ + String until() default "latest"; + + /** + * Used on a method or field to exclude it from the public api if the corresponding class was + * marked as public api. + * + * @return true if the method or field is not part of the public api + */ + boolean exclude() default false; +} diff --git a/play-services-basement/src/main/java/org/microg/gms/gcm/GcmConstants.java b/play-services-basement/src/main/java/org/microg/gms/gcm/GcmConstants.java new file mode 100644 index 00000000..d33bbfde --- /dev/null +++ b/play-services-basement/src/main/java/org/microg/gms/gcm/GcmConstants.java @@ -0,0 +1,92 @@ +/* + * 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.gcm; + +public final class GcmConstants { + public static final String ACTION_C2DM_RECEIVE = "com.google.android.c2dm.intent.RECEIVE"; + public static final String ACTION_C2DM_REGISTER = "com.google.android.c2dm.intent.REGISTER"; + public static final String ACTION_C2DM_REGISTRATION = "com.google.android.c2dm.intent.REGISTRATION"; + public static final String ACTION_C2DM_UNREGISTER = "com.google.android.c2dm.intent.UNREGISTER"; + public static final String ACTION_GCM_SEND = "com.google.android.gcm.intent.SEND"; + public static final String ACTION_NOTIFICATION_OPEN = "com.google.android.gms.gcm.NOTIFICATION_OPEN"; + public static final String ACTION_NOTIFICATION_DISMISS = "com.google.android.gms.gcm.NOTIFICATION_DISMISS"; + public static final String ACTION_SCHEDULE = "com.google.android.gms.gcm.ACTION_SCHEDULE"; + public static final String ACTION_TASK_READY = "com.google.android.gms.gcm.ACTION_TASK_READY"; + public static final String ACTION_TASK_INITIALZE = "com.google.android.gms.gcm.SERVICE_ACTION_INITIALIZE"; + public static final String ACTION_INSTANCE_ID = "com.google.android.gms.iid.InstanceID"; + + public static final String EXTRA_APP = "app"; + public static final String EXTRA_APP_ID = "appid"; + public static final String EXTRA_APP_VERSION_CODE = "app_ver"; + public static final String EXTRA_APP_VERSION_NAME = "app_ver_name"; + public static final String EXTRA_CLIENT_VERSION = "cliv"; + public static final String EXTRA_COMPONENT = "component"; + public static final String EXTRA_COLLAPSE_KEY = "collapse_key"; + public static final String EXTRA_DELAY = "google.delay"; + public static final String EXTRA_DELETE = "delete"; + public static final String EXTRA_ERROR = "error"; + public static final String EXTRA_FROM = "from"; + public static final String EXTRA_GSF_INTENT = "GSF"; + public static final String EXTRA_GMS_VERSION = "gmsv"; + public static final String EXTRA_IS_MESSENGER2 = "messenger2"; + public static final String EXTRA_KID = "kid"; + public static final String EXTRA_MESSENGER = "google.messenger"; + public static final String EXTRA_MESSAGE_TYPE = "message_type"; + public static final String EXTRA_MESSAGE_ID = "google.message_id"; + public static final String EXTRA_OS_VERSION = "osv"; + public static final String EXTRA_PENDING_INTENT = "com.google.android.gms.gcm.PENDING_INTENT"; + public static final String EXTRA_PUBLIC_KEY = "pub2"; + public static final String EXTRA_RAWDATA = "rawData"; + public static final String EXTRA_RAWDATA_BASE64 = "gcm.rawData64"; + public static final String EXTRA_REGISTRATION_ID = "registration_id"; + public static final String EXTRA_RETRY_AFTER = "Retry-After"; + public static final String EXTRA_SCHEDULER_ACTION = "scheduler_action"; + public static final String EXTRA_SCOPE = "scope"; + public static final String EXTRA_SENDER = "sender"; + public static final String EXTRA_SENDER_LEGACY = "legacy.sender"; + public static final String EXTRA_SEND_TO = "google.to"; + public static final String EXTRA_SEND_FROM = "google.from"; + public static final String EXTRA_SIGNATURE = "sig"; + public static final String EXTRA_SUBSCIPTION = "subscription"; + public static final String EXTRA_SUBTYPE = "subtype"; + public static final String EXTRA_USE_GSF = "useGsf"; + public static final String EXTRA_TAG = "tag"; + public static final String EXTRA_TOPIC = "gcm.topic"; + public static final String EXTRA_TTL = "google.ttl"; + public static final String EXTRA_UNREGISTERED = "unregistered"; + + public static final String MESSAGE_TYPE_GCM = "gcm"; + public static final String MESSAGE_TYPE_DELETED_MESSAGE = "deleted_message"; + public static final String MESSAGE_TYPE_SEND_ERROR = "send_error"; + public static final String MESSAGE_TYPE_SEND_EVENT = "send_event"; + + public static final String SCHEDULER_ACTION_CANCEL = "CANCEL_TASK"; + public static final String SCHEDULER_ACTION_CANCEL_ALL = "CANCEL_ALL"; + public static final String SCHEDULER_ACTION_SCHEDULE = "SCHEDULE_TASK"; + + public static final String PERMISSION_GTALK = "com.google.android.gtalkservice.permission.GTALK_SERVICE"; + public static final String PERMISSION_NETWORK_TASK = "com.google.android.gms.permission.BIND_NETWORK_TASK_SERVICE"; + public static final String PERMISSION_RECEIVE = "com.google.android.c2dm.permission.RECEIVE"; + public static final String PERMISSION_SEND = "com.google.android.c2dm.permission.SEND"; + + public static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE"; + + public static final String INSTANCE_ID_SCOPE_GCM = "GCM"; + + public static final String GCMID_INSTANCE_ID = "google.com/iid"; + public static final String GCMID_REFRESH = "gcm.googleapis.com/refresh"; +} diff --git a/play-services-basement/src/main/kotlin/com/google/android/gms/dynamic/ObjectWrapper.kt b/play-services-basement/src/main/kotlin/com/google/android/gms/dynamic/ObjectWrapper.kt new file mode 100644 index 00000000..06c131ab --- /dev/null +++ b/play-services-basement/src/main/kotlin/com/google/android/gms/dynamic/ObjectWrapper.kt @@ -0,0 +1,22 @@ +/* + * Copyright (C) 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 org.microg.gms.kotlin + +import com.google.android.gms.dynamic.IObjectWrapper +import com.google.android.gms.dynamic.ObjectWrapper + +inline fun IObjectWrapper?.unwrap(): T? = ObjectWrapper.unwrapTyped(this, T::class.java) diff --git a/play-services-cast-api b/play-services-cast-api deleted file mode 120000 index d74ee46e..00000000 --- a/play-services-cast-api +++ /dev/null @@ -1 +0,0 @@ -extern/GmsApi/play-services-cast-api \ No newline at end of file diff --git a/play-services-cast-api/build.gradle b/play-services-cast-api/build.gradle new file mode 100644 index 00000000..b3d5f509 --- /dev/null +++ b/play-services-cast-api/build.gradle @@ -0,0 +1,40 @@ +/* + * Copyright 2013-2015 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. + */ + +apply plugin: 'com.android.library' + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + aidlPackageWhiteList "com/google/android/gms/cast/ApplicationMetadata.aidl" + aidlPackageWhiteList "com/google/android/gms/cast/LaunchOptions.aidl" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} + +dependencies { + api project(':play-services-basement') +} diff --git a/play-services-cast-api/gradle.properties b/play-services-cast-api/gradle.properties new file mode 100644 index 00000000..18ff0a50 --- /dev/null +++ b/play-services-cast-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Internal Cast API +POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +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 + diff --git a/play-services-cast-api/src/main/AndroidManifest.xml b/play-services-cast-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..d559e589 --- /dev/null +++ b/play-services-cast-api/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationMetadata.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationMetadata.aidl new file mode 100644 index 00000000..236c4dbf --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationMetadata.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast; + +parcelable ApplicationMetadata; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationStatus.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationStatus.aidl new file mode 100644 index 00000000..e7ad0532 --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/ApplicationStatus.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast; + +parcelable ApplicationStatus; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/CastDeviceStatus.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/CastDeviceStatus.aidl new file mode 100644 index 00000000..1585adeb --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/CastDeviceStatus.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast; + +parcelable CastDeviceStatus; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/JoinOptions.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/JoinOptions.aidl new file mode 100644 index 00000000..3eafbddc --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/JoinOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast; + +parcelable JoinOptions; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/LaunchOptions.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/LaunchOptions.aidl new file mode 100644 index 00000000..85ed609d --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/LaunchOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast; + +parcelable LaunchOptions; diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceController.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceController.aidl new file mode 100644 index 00000000..340c3849 --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceController.aidl @@ -0,0 +1,14 @@ +package com.google.android.gms.cast.internal; + +import com.google.android.gms.cast.LaunchOptions; +import com.google.android.gms.cast.JoinOptions; + +interface ICastDeviceController { + void disconnect() = 0; + void stopApplication(String sessionId) = 4; + void sendMessage(String namespace, String message, long requestId) = 8; + void registerNamespace(String namespace) = 10; + void unregisterNamespace(String namespace) = 11; + void launchApplication(String applicationId, in LaunchOptions launchOptions) = 12; + void joinApplication(String applicationId, String sessionId, in JoinOptions joinOptions) = 13; +} diff --git a/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceControllerListener.aidl b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceControllerListener.aidl new file mode 100644 index 00000000..1d26c14b --- /dev/null +++ b/play-services-cast-api/src/main/aidl/com/google/android/gms/cast/internal/ICastDeviceControllerListener.aidl @@ -0,0 +1,21 @@ +package com.google.android.gms.cast.internal; + +import com.google.android.gms.cast.ApplicationMetadata; +import com.google.android.gms.cast.ApplicationStatus; +import com.google.android.gms.cast.CastDeviceStatus; + +interface ICastDeviceControllerListener { + void onDisconnected(int reason) = 0; + void onApplicationConnectionSuccess(in ApplicationMetadata applicationMetadata, String applicationStatus, String sessionId, boolean wasLaunched) = 1; + void onApplicationConnectionFailure(int statusCode) = 2; + // Deprecated: void onStatusReceived(String string1, double double1, boolean boolean1) = 3; + void onTextMessageReceived(String namespace, String message) = 4; + void onBinaryMessageReceived(String namespace, in byte[] data) = 5; + // void onStatusChanged(int status) = 6; // TODO + // void onStatusChanged2(int status) = 7; // TODO + void onApplicationDisconnected(int paramInt) = 8; + void onSendMessageFailure(String response, long requestId, int statusCode) = 9; + void onSendMessageSuccess(String response, long requestId) = 10; + void onApplicationStatusChanged(in ApplicationStatus applicationStatus) = 11; + void onDeviceStatusChanged(in CastDeviceStatus deviceStatus) = 12; +} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java new file mode 100644 index 00000000..71dee27b --- /dev/null +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationMetadata.java @@ -0,0 +1,85 @@ +/* + * 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.cast; + +import android.net.Uri; + +import com.google.android.gms.common.images.WebImage; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; + +@PublicApi +public class ApplicationMetadata extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public String applicationId; + @SafeParceled(3) + public String name; + @SafeParceled(value = 4, subClass = WebImage.class) + public List images; + @SafeParceled(value = 5, subClass = String.class) + public List namespaces; + @SafeParceled(6) + public String senderAppIdentifier; + @SafeParceled(7) + public Uri senderAppLaunchUri; + + public String getApplicationId() { + return applicationId; + } + + public List getImages() { + return images; + } + + public String getName() { + return name; + } + + public String getSenderAppIdentifier() { + return senderAppIdentifier; + } + + public boolean isNamespaceSupported(String namespace) { + return namespaces.contains(namespace); + } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("ApplicationMetadata{"); + sb.append("applicationId='").append(applicationId).append("'"); + sb.append(", name='").append(name).append("'"); + sb.append(", images=").append(images.toString()); + if (namespaces != null) { + sb.append(", namespaces=").append(namespaces.toString()); + } + sb.append(", senderAppIdentifier='").append(senderAppIdentifier).append("'"); + if (senderAppLaunchUri != null) { + sb.append(", senderAppLaunchUri='").append(senderAppLaunchUri.toString()).append("'"); + } + sb.append('}'); + return sb.toString(); + } + + public static final Creator CREATOR = new AutoCreator(ApplicationMetadata.class); +} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationStatus.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationStatus.java new file mode 100644 index 00000000..96537689 --- /dev/null +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/ApplicationStatus.java @@ -0,0 +1,36 @@ +/* + * 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.cast; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class ApplicationStatus extends AutoSafeParcelable { + + public ApplicationStatus() {} + + public ApplicationStatus(String applicationStatus) { + this.applicationStatus = applicationStatus; + } + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private String applicationStatus; + + public static final Creator CREATOR = new AutoCreator(ApplicationStatus.class); +} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDevice.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDevice.java new file mode 100644 index 00000000..f185c8a5 --- /dev/null +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDevice.java @@ -0,0 +1,194 @@ +/* + * 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.cast; + +import android.os.Bundle; +import android.net.Uri; +import android.text.TextUtils; + +import com.google.android.gms.common.images.WebImage; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.net.InetAddress; +import java.net.Inet4Address; +import java.util.ArrayList; +import java.util.List; + +@PublicApi +public class CastDevice extends AutoSafeParcelable { + private static final String EXTRA_CAST_DEVICE = "com.google.android.gms.cast.EXTRA_CAST_DEVICE"; + + public CastDevice () { + } + + public CastDevice ( + String id, String name, InetAddress host, int port, String + deviceVersion, String friendlyName, String modelName, String + iconPath, int status, int capabilities) { + this.deviceId = id; + this.address = host.getHostAddress(); + this.servicePort = port; + this.deviceVersion = deviceVersion; + this.friendlyName = friendlyName; + this.icons = new ArrayList(); + this.icons.add(new WebImage(Uri.parse(String.format("http://%s:8008%s", this.address, iconPath)))); + this.modelName = modelName; + this.capabilities = capabilities; + } + + /** + * Video-output device capability. + */ + public static final int CAPABILITY_VIDEO_OUT = 1; + + /** + * Video-input device capability. + */ + public static final int CAPABILITY_VIDEO_IN = 2; + + /** + * Audio-output device capability. + */ + public static final int CAPABILITY_AUDIO_OUT = 4; + + /** + * Audio-input device capability. + */ + public static final int CAPABILITY_AUDIO_IN = 8; + + @SafeParceled(1) + private int versionCode = 3; + + @SafeParceled(2) + private String deviceId; + + @SafeParceled(3) + private String address; + + @SafeParceled(4) + private String friendlyName; + + @SafeParceled(5) + private String modelName; + + @SafeParceled(6) + private String deviceVersion; + + @SafeParceled(7) + private int servicePort; + + @SafeParceled(value = 8, subClass = WebImage.class) + private ArrayList icons; + + @SafeParceled(9) + private int capabilities; + + @SafeParceled(10) + private int status; + + @SafeParceled(11) + private String unknown; // TODO: Need to figure this one out + + public String getDeviceId() { + return deviceId; + } + + public String getDeviceVersion() { + return deviceVersion; + } + + public String getFriendlyName() { + return friendlyName; + } + + public static CastDevice getFromBundle(Bundle extras) { + if (extras == null) { + return null; + } + extras.setClassLoader(CastDevice.class.getClassLoader()); + return extras.getParcelable(EXTRA_CAST_DEVICE); + } + + public WebImage getIcon(int preferredWidth, int preferredHeight) { + return null; + } + + public List getIcons() { + return icons; + } + + public String getAddress() { + return address; + } + + public String getModelName() { + return modelName; + } + + public int getServicePort() { + return servicePort; + } + + public boolean hasCapabilities(int[] capabilities) { + for (int capability : capabilities) { + if (!this.hasCapability(capability)) { + return false; + } + } + return true; + } + + public boolean hasCapability(int capability) { + return (capability & capabilities) == capability; + } + + public boolean hasIcons() { + return !icons.isEmpty(); + } + + public boolean isOnLocalNetwork() { + return false; + } + + public boolean isSameDevice(CastDevice castDevice) { + return TextUtils.equals(castDevice.deviceId, deviceId); + } + + public void putInBundle(Bundle bundle) { + bundle.putParcelable(EXTRA_CAST_DEVICE, this); + } + + @Override + public String toString() { + return "CastDevice{" + + "deviceId=" + this.deviceId + + ", address=" + address + + ", friendlyName=" + friendlyName + + ", modelName=" + modelName + + ", deviceVersion=" + deviceVersion + + ", servicePort=" + servicePort + + (icons == null ? "" : (", icons=" + icons.toString())) + + ", capabilities=" + capabilities + + ", status=" + status + + "}"; + } + + public static Creator CREATOR = new AutoCreator(CastDevice.class); +} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDeviceStatus.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDeviceStatus.java new file mode 100644 index 00000000..67dba193 --- /dev/null +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastDeviceStatus.java @@ -0,0 +1,49 @@ +/* + * 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.cast; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class CastDeviceStatus extends AutoSafeParcelable { + + public CastDeviceStatus() { + } + + public CastDeviceStatus(double volume, boolean mute, int activeInputState, ApplicationMetadata applicationMetadata, int standbyState) { + this.volume = volume; + this.mute = mute; + this.activeInputState = activeInputState; + this.applicationMetadata = applicationMetadata; + this.standbyState = standbyState; + } + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private double volume; + @SafeParceled(3) + private boolean mute; + @SafeParceled(4) + private int activeInputState; + @SafeParceled(5) + private ApplicationMetadata applicationMetadata; + @SafeParceled(6) + private int standbyState; + + public static final Creator CREATOR = new AutoCreator(CastDeviceStatus.class); +} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java new file mode 100644 index 00000000..ca3a2871 --- /dev/null +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastMediaControlIntent.java @@ -0,0 +1,145 @@ +/* + * 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.cast; + +import android.text.TextUtils; + +import java.util.Collection; +import java.util.Locale; + +/** + * Intent constants for use with the Cast MediaRouteProvider. This class also contains utility methods for creating + * a control category for discovering Cast media routes that support a specific app and/or set of namespaces, to be + * used with MediaRouteSelector. + */ +public final class CastMediaControlIntent { + @Deprecated + public static final String CATEGORY_CAST = "com.google.android.gms.cast.CATEGORY_CAST"; + public static final String ACTION_SYNC_STATUS = "com.google.android.gms.cast.ACTION_SYNC_STATUS"; + + /** + * The application ID for the Cast Default Media Receiver. + */ + public static final String DEFAULT_MEDIA_RECEIVER_APPLICATION_ID = "CC1AD845"; + + /** + * An error code indicating that a Cast request has failed. + */ + public static final int ERROR_CODE_REQUEST_FAILED = 1; + + /** + * An error code indicating that the request could not be processed because the session could not be started. + */ + public static final int ERROR_CODE_SESSION_START_FAILED = 2; + + /** + * An error code indicating that the connection to the Cast device has been lost, but the system is actively + * trying to re-establish the connection. + */ + public static final int ERROR_CODE_TEMPORARILY_DISCONNECTED = 3; + + /** + * The extra that contains the ID of the application to launch for an + * {@link android.support.v7.media.MediaContolIntent#ACTION_START_SESSION} request. + * The value is expected to be a String. + */ + public static final String EXTRA_CAST_APPLICATION_ID = "com.google.android.gms.cast.EXTRA_CAST_APPLICATION_ID"; + public static final String EXTRA_CAST_RELAUNCH_APPLICATION = "com.google.android.gms.cast.EXTRA_CAST_RELAUNCH_APPLICATION"; + public static final String EXTRA_CAST_LANGUAGE_CODE = "com.google.android.gms.cast.EXTRA_CAST_LANGUAGE_CODE"; + public static final String EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS = "com.google.android.gms.cast.EXTRA_CAST_STOP_APPLICATION_WHEN_SESSION_ENDS"; + public static final String EXTRA_CUSTOM_DATA = "com.google.android.gms.cast.EXTRA_CUSTOM_DATA"; + + /** + * The extra that indicates whether debug logging should be enabled for the Cast session. The value is expected to be a boolean. + */ + public static final String EXTRA_DEBUG_LOGGING_ENABLED = "com.google.android.gms.cast.EXTRA_DEBUG_LOGGING_ENABLED"; + + /** + * n error bundle extra for the error code. The value is an integer, and will be one of the {@code ERROR_CODE_*} + * constants declared in this class. + */ + public static final String EXTRA_ERROR_CODE = "com.google.android.gms.cast.EXTRA_ERROR_CODE"; + + public static final String CATEGORY_CAST_REMOTE_PLAYBACK = "com.google.android.gms.cast.CATEGORY_CAST_REMOTE_PLAYBACK"; + + private CastMediaControlIntent() { + } + + /** + * Returns a custom control category for discovering Cast devices that support running the specified app, independent of whether the app is running or not. + * + * @param applicationId The application ID of the receiver application. + */ + public static String categoryForCast(String applicationId) { + return CATEGORY_CAST + "/" + applicationId; + } + + /** + * Returns true if the given category is a custom control category for cast devices, specific to an application ID. + * + * @param applicationId The application ID of the receiver application. + */ + public static boolean isCategoryForCast(String category) { + if (category == null) { + return false; + } + return category.startsWith(CATEGORY_CAST + "/"); + } + + /** + * Returns a custom control category for discovering Cast devices meeting both application ID and namespace + * restrictions. See {@link #categoryForCast(Collection)} and {@link #categoryForCast(String)} for more details. + */ + public static String categoryForCast(String applicationId, Collection namespaces) { + return CATEGORY_CAST + "" + applicationId + "/" + TextUtils.join(",", namespaces); + } + + /** + * Returns a custom control category for discovering Cast devices currently running an application which supports the specified namespaces. Apps supporting additional namespaces beyond those specified here are still considered supported. + */ + public static String categoryForCast(Collection namespaces) { + return CATEGORY_CAST + "//" + TextUtils.join(",", namespaces); + } + + /** + * Returns a custom control category for discovering Cast devices which support the default Android remote + * playback actions using the specified Cast player. If the Default Media Receiver is desired, use + * {@link #DEFAULT_MEDIA_RECEIVER_APPLICATION_ID} as the applicationId. + * + * @param applicationId The application ID of the receiver application. + */ + public static String categoryForRemotePlayback(String applicationId) { + return CATEGORY_CAST_REMOTE_PLAYBACK + "/" + applicationId; + } + + /** + * Returns a custom control category for discovering Cast devices which support the Default Media Receiver. + */ + public static String categoryForRemotePlayback() { + return CATEGORY_CAST_REMOTE_PLAYBACK; + } + + /** + * Returns an RFC-5646 language tag string fo the given locale. + */ + public static String languageTagForLocale(Locale locale) { + StringBuilder sb = new StringBuilder(locale.getLanguage()); + if (!TextUtils.isEmpty(locale.getCountry())) sb.append('-').append(locale.getCountry()); + if (!TextUtils.isEmpty(locale.getVariant())) sb.append('-').append(locale.getVariant()); + return sb.toString(); + } +} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.java new file mode 100644 index 00000000..e95ed75a --- /dev/null +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/CastStatusCodes.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.cast; + +public final class CastStatusCodes { + public static final int APPLICATION_NOT_FOUND = 2004; + public static final int APPLICATION_NOT_RUNNING = 2005; + public static final int AUTHENTICATION_FAILED = 2000; + public static final int CANCELED = 2002; + public static final int ERROR_SERVICE_CREATION_FAILED = 2200; + public static final int ERROR_SERVICE_DISCONNECTED = 2201; + public static final int FAILED = 2100; + public static final int INTERNAL_ERROR = 8; + public static final int INTERRUPTED = 14; + public static final int INVALID_REQUEST = 2001; + public static final int MESSAGE_SEND_BUFFER_TOO_FULL = 2007; + public static final int MESSAGE_TOO_LARGE = 2006; + public static final int NETWORK_ERROR = 7; + public static final int NOT_ALLOWED = 2003; + public static final int REPLACED = 2103; + public static final int SUCCESS = 0; + public static final int TIMEOUT = 15; + public static final int UNKNOWN_ERROR = 13; +} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/JoinOptions.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/JoinOptions.java new file mode 100644 index 00000000..022af3d2 --- /dev/null +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/JoinOptions.java @@ -0,0 +1,29 @@ +/* + * 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.cast; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class JoinOptions extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private int connectionType = 0; + + public static Creator CREATOR = new AutoCreator(JoinOptions.class); +} diff --git a/play-services-cast-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java b/play-services-cast-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java new file mode 100644 index 00000000..7c30fbe3 --- /dev/null +++ b/play-services-cast-api/src/main/java/com/google/android/gms/cast/LaunchOptions.java @@ -0,0 +1,47 @@ +/* + * 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.cast; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class LaunchOptions extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private boolean relaunchIfRunning; + @SafeParceled(3) + private String language; + + public String getLanguage() { + return language; + } + + public boolean getRelaunchIfRunning() { + return relaunchIfRunning; + } + + public void setLanguage(String language) { + this.language = language; + } + + public void setRelaunchIfRunning(boolean relaunchIfRunning) { + this.relaunchIfRunning = relaunchIfRunning; + } + + public static Creator CREATOR = new AutoCreator(LaunchOptions.class); +} diff --git a/play-services-cast-framework-api b/play-services-cast-framework-api deleted file mode 120000 index f9196119..00000000 --- a/play-services-cast-framework-api +++ /dev/null @@ -1 +0,0 @@ -extern/GmsApi/play-services-cast-framework-api \ No newline at end of file diff --git a/play-services-cast-framework-api/build.gradle b/play-services-cast-framework-api/build.gradle new file mode 100644 index 00000000..db8f59e4 --- /dev/null +++ b/play-services-cast-framework-api/build.gradle @@ -0,0 +1,38 @@ +/* + * Copyright 2013-2015 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. + */ + +apply plugin: 'com.android.library' + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} + +dependencies { + api project(':play-services-basement') + api project(':play-services-cast-api') +} diff --git a/play-services-cast-framework-api/gradle.properties b/play-services-cast-framework-api/gradle.properties new file mode 100644 index 00000000..54557daf --- /dev/null +++ b/play-services-cast-framework-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Internal Cast Framework API +POM_DESCRIPTION=Interfaces and objects for IPC between Play Services Library and Play Services Core + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsApi + +POM_SCM_URL=https://github.com/microg/android_external_GmsApi +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsApi.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +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 + diff --git a/play-services-cast-framework-api/src/main/AndroidManifest.xml b/play-services-cast-framework-api/src/main/AndroidManifest.xml new file mode 100644 index 00000000..89224918 --- /dev/null +++ b/play-services-cast-framework-api/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/CastOptions.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/CastOptions.aidl new file mode 100644 index 00000000..e867d59d --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/CastOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast.framework; + +parcelable CastOptions; \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IAppVisibilityListener.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IAppVisibilityListener.aidl new file mode 100644 index 00000000..cb173815 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IAppVisibilityListener.aidl @@ -0,0 +1,10 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IAppVisibilityListener { + IObjectWrapper getThisObject() = 0; + void onAppEnteredForeground() = 1; + void onAppEnteredBackground() = 2; + int getSupportedVersion() = 3; +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastConnectionController.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastConnectionController.aidl new file mode 100644 index 00000000..4ad8ee32 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastConnectionController.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.cast.LaunchOptions; + +interface ICastConnectionController { + void joinApplication(String applicationId, String sessionId) = 0; + void launchApplication(String applicationId, in LaunchOptions launchOptions) = 1; + void stopApplication(String sessionId) = 2; + void closeConnection(int reason) = 3; // Maybe? + int getSupportedVersion() = 4; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastContext.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastContext.aidl new file mode 100644 index 00000000..717671d7 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastContext.aidl @@ -0,0 +1,20 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.cast.framework.IAppVisibilityListener; +import com.google.android.gms.cast.framework.ISessionManager; +import com.google.android.gms.cast.framework.IDiscoveryManager; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ICastContext { + Bundle getMergedSelectorAsBundle() = 0; + boolean isApplicationVisible() = 1; + void addVisibilityChangeListener(IAppVisibilityListener listener) = 2; + void removeVisibilityChangeListener(IAppVisibilityListener listener) = 3; + ISessionManager getSessionManagerImpl() = 4; + IDiscoveryManager getDiscoveryManagerImpl() = 5; + void destroy() = 6; // deprecated? + void onActivityResumed(in IObjectWrapper activity) = 7; // deprecated? + void onActivityPaused(in IObjectWrapper activity) = 8; // deprecated? + IObjectWrapper getWrappedThis() = 9; + void setReceiverApplicationId(String receiverApplicationId, in Map/**/ sessionProvidersByCategory) = 10; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastSession.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastSession.aidl new file mode 100644 index 00000000..e5c11cba --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastSession.aidl @@ -0,0 +1,15 @@ +package com.google.android.gms.cast.framework; + +import android.os.Bundle; + +import com.google.android.gms.cast.ApplicationMetadata; +import com.google.android.gms.common.api.Status; + +interface ICastSession { + void onConnected(in Bundle routeInfoExtra) = 0; + void onConnectionSuspended(int reason) = 1; + void onConnectionFailed(in Status status) = 2; + void onApplicationConnectionSuccess(in ApplicationMetadata applicationMetadata, String applicationStatus, String sessionId, boolean wasLaunched) = 3; + void onApplicationConnectionFailure(int statusCode) = 4; + void disconnectFromDevice(boolean boolean1, int int1) = 5; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastStateListener.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastStateListener.aidl new file mode 100644 index 00000000..98e20151 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ICastStateListener.aidl @@ -0,0 +1,9 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ICastStateListener { + IObjectWrapper getWrappedThis() = 0; + void onCastStateChanged(int newState) = 1; + int getSupportedVersion() = 2; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManager.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManager.aidl new file mode 100644 index 00000000..0c775ac0 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManager.aidl @@ -0,0 +1,12 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.cast.framework.IDiscoveryManagerListener; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IDiscoveryManager { + void startDiscovery() = 0; // Maybe? + void stopDiscovery() = 1; // Maybe? + void addDiscoveryManagerListener(IDiscoveryManagerListener listener) = 2; + void removeDiscoveryManagerListener(IDiscoveryManagerListener listener) = 3; + IObjectWrapper getWrappedThis() = 4; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManagerListener.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManagerListener.aidl new file mode 100644 index 00000000..701a5c24 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IDiscoveryManagerListener.aidl @@ -0,0 +1,8 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IDiscoveryManagerListener { + IObjectWrapper getWrappedThis() = 0; + void onDeviceAvailabilityChanged(boolean deviceAvailable) = 1; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IReconnectionService.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IReconnectionService.aidl new file mode 100644 index 00000000..33f19574 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/IReconnectionService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework; + +interface IReconnectionService { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISession.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISession.aidl new file mode 100644 index 00000000..a5580bc3 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISession.aidl @@ -0,0 +1,22 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ISession { + IObjectWrapper getWrappedObject() = 0; + String getCategory() = 1; + String getSessionId() = 2; + String getRouteId() = 3; + boolean isConnected() = 4; + boolean isConnecting() = 5; + boolean isDisconnecting() = 6; + boolean isDisconnected() = 7; + boolean isResuming() = 8; + boolean isSuspended() = 9; + void notifySessionStarted(String sessionId) = 10; + void notifyFailedToStartSession(int error) = 11; + void notifySessionEnded(int error) = 12; + void notifySessionResumed(boolean wasSuspended) = 13; + void notifyFailedToResumeSession(int error) = 14; + void notifySessionSuspended(int reason) = 15; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManager.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManager.aidl new file mode 100644 index 00000000..caf95617 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManager.aidl @@ -0,0 +1,19 @@ +package com.google.android.gms.cast.framework; + +import android.os.Bundle; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.cast.framework.ISessionManagerListener; +import com.google.android.gms.cast.framework.ICastStateListener; + +interface ISessionManager { + IObjectWrapper getWrappedCurrentSession() = 0; + void addSessionManagerListener(ISessionManagerListener listener) = 1; + void removeSessionManagerListener(ISessionManagerListener listener) = 2; + void addCastStateListener(ICastStateListener listener) = 3; + void removeCastStateListener(ICastStateListener listener) = 4; + void endCurrentSession(boolean b, boolean stopCasting) = 5; + IObjectWrapper getWrappedThis() = 6; + int getCastState() = 7; + void startSession(in Bundle options) = 8; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManagerListener.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManagerListener.aidl new file mode 100644 index 00000000..4dc4ae9d --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionManagerListener.aidl @@ -0,0 +1,17 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ISessionManagerListener { + IObjectWrapper getWrappedThis() = 0; + void onSessionStarting(IObjectWrapper session) = 1; + void onSessionStarted(IObjectWrapper session, String sessionId) = 2; + void onSessionStartFailed(IObjectWrapper session, int error) = 3; + void onSessionEnding(IObjectWrapper session) = 4; + void onSessionEnded(IObjectWrapper session, int error) = 5; + void onSessionResuming(IObjectWrapper session, String sessionId) = 6; + void onSessionResumed(IObjectWrapper session, boolean wasSuspended) = 7; + void onSessionResumeFailed(IObjectWrapper session, int error) = 8; + void onSessionSuspended(IObjectWrapper session, int reason) = 9; + int getSupportedVersion() = 10; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProvider.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProvider.aidl new file mode 100644 index 00000000..5f99e9df --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProvider.aidl @@ -0,0 +1,10 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ISessionProvider { + IObjectWrapper getSession(String sessionId) = 0; + boolean isSessionRecoverable() = 1; + String getCategory() = 2; + int getSupportedVersion() = 3; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProxy.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProxy.aidl new file mode 100644 index 00000000..170680a0 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/ISessionProxy.aidl @@ -0,0 +1,14 @@ +package com.google.android.gms.cast.framework; + +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ISessionProxy { + IObjectWrapper getWrappedSession() = 0; + void start(in Bundle extras) = 1; + void resume(in Bundle extras) = 2; + void end(boolean paramBoolean) = 3; + long getSessionRemainingTimeMs() = 4; + int getSupportedVersion() = 5; + void onStarting(in Bundle routeInfoExtra) = 6; + void onResuming(in Bundle routeInfoExtra) = 7; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/ICastDynamiteModule.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/ICastDynamiteModule.aidl new file mode 100644 index 00000000..2085775a --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/ICastDynamiteModule.aidl @@ -0,0 +1,24 @@ +package com.google.android.gms.cast.framework.internal; + +import com.google.android.gms.cast.framework.CastOptions; +import com.google.android.gms.cast.framework.ICastConnectionController; +import com.google.android.gms.cast.framework.ICastContext; +import com.google.android.gms.cast.framework.ICastSession; +import com.google.android.gms.cast.framework.IReconnectionService; +import com.google.android.gms.cast.framework.ISession; +import com.google.android.gms.cast.framework.ISessionProxy; +import com.google.android.gms.cast.framework.internal.IMediaRouter; +import com.google.android.gms.cast.framework.media.CastMediaOptions; +import com.google.android.gms.cast.framework.media.IMediaNotificationService; +import com.google.android.gms.cast.framework.media.internal.IFetchBitmapTask; +import com.google.android.gms.cast.framework.media.internal.IFetchBitmapTaskProgressPublisher; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface ICastDynamiteModule { + ICastContext newCastContextImpl(in IObjectWrapper context, in CastOptions options, IMediaRouter router, in Map sessionProviders) = 0; + ISession newSessionImpl(String category, String sessionId, ISessionProxy proxy) = 1; + ICastSession newCastSessionImpl(in CastOptions options, in IObjectWrapper session, ICastConnectionController controller) = 2; + IMediaNotificationService newMediaNotificationServiceImpl(in IObjectWrapper service, in IObjectWrapper castContext, in IObjectWrapper resources, in CastMediaOptions options) = 3; + IReconnectionService newReconnectionServiceImpl(in IObjectWrapper service, in IObjectWrapper sessionManager, in IObjectWrapper discoveryManager) = 4; + IFetchBitmapTask newFetchBitmapTaskImpl(in IObjectWrapper asyncTask, IFetchBitmapTaskProgressPublisher progressPublisher, int i1, int i2, boolean b1, long l1, int i3, int i4, int i5) = 5; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouter.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouter.aidl new file mode 100644 index 00000000..3cfba99a --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouter.aidl @@ -0,0 +1,19 @@ +package com.google.android.gms.cast.framework.internal; + +import android.os.Bundle; + +import com.google.android.gms.cast.framework.internal.IMediaRouterCallback; + +interface IMediaRouter { + void registerMediaRouterCallbackImpl(in Bundle selector, IMediaRouterCallback callback) = 0; + void addCallback(in Bundle selector, int flags) = 1; + void removeCallback(in Bundle selector) = 2; + boolean isRouteAvailable(in Bundle selector, int flags) = 3; + void selectRouteById(String routeId) = 4; + void selectDefaultRoute() = 5; + boolean isDefaultRouteSelected() = 6; // Maybe? + Bundle getRouteInfoExtrasById(String routeId) = 7; + String getSelectedRouteId() = 8; // Maybe? + int getSupportedVersion() = 9; + void clearCallbacks() = 10; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouterCallback.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouterCallback.aidl new file mode 100644 index 00000000..d28c87c8 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/internal/IMediaRouterCallback.aidl @@ -0,0 +1,12 @@ +package com.google.android.gms.cast.framework.internal; + +import android.os.Bundle; + +interface IMediaRouterCallback { + void onRouteAdded(String routeId, in Bundle extras) = 0; + void onRouteChanged(String routeId, in Bundle extras) = 1; + void onRouteRemoved(String routeId, in Bundle extras) = 2; + void onRouteSelected(String routeId, in Bundle extras) = 3; + void unknown(String routeId, in Bundle extras) = 4; + void onRouteUnselected(String routeId, in Bundle extras, int reason) = 5; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/CastMediaOptions.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/CastMediaOptions.aidl new file mode 100644 index 00000000..4186fc4b --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/CastMediaOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast.framework.media; + +parcelable CastMediaOptions; \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IImagePicker.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IImagePicker.aidl new file mode 100644 index 00000000..05211a38 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IImagePicker.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.cast.framework.media; + +import com.google.android.gms.common.images.WebImage; +import com.google.android.gms.dynamic.IObjectWrapper; + +interface IImagePicker { + // WebImage onPickImage(MediaMetadata metadata, int int1) = 0; + IObjectWrapper getWrappedClientObject() = 1; + int unknown1() = 2; + // WebImage onPickImage(MediaMetadata metadata, ImageHints imageHints) = 3; +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IMediaNotificationService.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IMediaNotificationService.aidl new file mode 100644 index 00000000..03e48729 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/IMediaNotificationService.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework.media; + +interface IMediaNotificationService { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/INotificationActionsProvider.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/INotificationActionsProvider.aidl new file mode 100644 index 00000000..325efe23 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/INotificationActionsProvider.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework.media; + +interface INotificationActionsProvider { + +} diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/NotificationOptions.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/NotificationOptions.aidl new file mode 100644 index 00000000..b918b7e6 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/NotificationOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.cast.framework.media; + +parcelable NotificationOptions; diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTask.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTask.aidl new file mode 100644 index 00000000..c9f2286d --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTask.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework.media.internal; + +interface IFetchBitmapTask { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTaskProgressPublisher.aidl b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTaskProgressPublisher.aidl new file mode 100644 index 00000000..58b80c08 --- /dev/null +++ b/play-services-cast-framework-api/src/main/aidl/com/google/android/gms/cast/framework/media/internal/IFetchBitmapTaskProgressPublisher.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.cast.framework.media.internal; + +interface IFetchBitmapTaskProgressPublisher { + +} \ No newline at end of file diff --git a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastOptions.java b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastOptions.java new file mode 100644 index 00000000..2592c821 --- /dev/null +++ b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastOptions.java @@ -0,0 +1,65 @@ +/* + * 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.cast.framework; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import com.google.android.gms.cast.framework.media.CastMediaOptions; +import com.google.android.gms.cast.LaunchOptions; + +import java.util.ArrayList; +import java.util.List; + +public class CastOptions extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + private String receiverApplicationId; + + @SafeParceled(3) + private ArrayList supportedNamespaces; + + @SafeParceled(4) + private boolean stopReceiverApplicationWhenEndingSession; + + @SafeParceled(5) + private LaunchOptions launchOptions; + + @SafeParceled(6) + private boolean resumeSavedSession; + + @SafeParceled(7) + private CastMediaOptions castMediaOptions; + + @SafeParceled(8) + private boolean enableReconnectionService; + + @SafeParceled(9) + private double volumeDeltaBeforeIceCreamSandwich; + + public String getReceiverApplicationId() { + return this.receiverApplicationId; + } + + public LaunchOptions getLaunchOptions() { + return this.launchOptions; + } + + public static Creator CREATOR = new AutoCreator(CastOptions.class); +} diff --git a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastState.java b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastState.java new file mode 100644 index 00000000..85d57bea --- /dev/null +++ b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/CastState.java @@ -0,0 +1,39 @@ +/* + * 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.cast.framework; + +public final class CastState { + public static final int NO_DEVICES_AVAILABLE = 1; + public static final int NOT_CONNECTED = 2; + public static final int CONNECTING = 3; + public static final int CONNECTED = 4; + + public static String toString(int castState) { + switch (castState) { + case NO_DEVICES_AVAILABLE: + return "NO_DEVICES_AVAILABLE"; + case NOT_CONNECTED: + return "NOT_CONNECTED"; + case CONNECTING: + return "CONNECTING"; + case CONNECTED: + return "CONNECTED"; + default: + return "UNKNOWN"; + } + } +} diff --git a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/CastMediaOptions.java b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/CastMediaOptions.java new file mode 100644 index 00000000..3db58f3e --- /dev/null +++ b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/CastMediaOptions.java @@ -0,0 +1,36 @@ +/* + * 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.cast.framework.media; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class CastMediaOptions extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public String mediaIntentReceiverClassName; + @SafeParceled(3) + public String expandedControllerActivityClassName; + @SafeParceled(4) + public IImagePicker imagePicker; + @SafeParceled(5) + public NotificationOptions notificationOptions; + + public static Creator CREATOR = new AutoCreator(CastMediaOptions.class); +} diff --git a/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/NotificationOptions.java b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/NotificationOptions.java new file mode 100644 index 00000000..bfed1ad4 --- /dev/null +++ b/play-services-cast-framework-api/src/main/java/com/google/android/gms/cast/framework/media/NotificationOptions.java @@ -0,0 +1,96 @@ +/* + * 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.cast.framework.media; + +import java.util.List; + +import com.google.android.gms.cast.framework.media.INotificationActionsProvider; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class NotificationOptions extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + public List actions; + @SafeParceled(3) + public int[] compatActionIndices; + @SafeParceled(4) + public long skipStepMs; + @SafeParceled(5) + public String targetActivityClassName; + @SafeParceled(6) + public int getSmallIconDrawableResId; + @SafeParceled(7) + public int getStopLiveStreamDrawableResId; + @SafeParceled(8) + public int getPauseDrawableResId; + @SafeParceled(9) + public int getPlayDrawableResId; + @SafeParceled(10) + public int getSkipNextDrawableResId; + @SafeParceled(11) + public int getSkipPrevDrawableResId; + @SafeParceled(12) + public int getForwardDrawableResId; + @SafeParceled(13) + public int getForward10DrawableResId; + @SafeParceled(14) + public int getForward30DrawableResId; + @SafeParceled(15) + public int getRewindDrawableResId; + @SafeParceled(16) + public int getRewind10DrawableResId; + @SafeParceled(17) + public int getRewind30DrawableResId; + @SafeParceled(18) + public int getDisconnectDrawableResId; + @SafeParceled(19) + public int intvar19; + @SafeParceled(20) + public int getCastingToDeviceStringResId; + @SafeParceled(21) + public int getStopLiveStreamTitleResId; + @SafeParceled(22) + public int intvar22; + @SafeParceled(23) + public int intvar23; + @SafeParceled(24) + public int intvar24; + @SafeParceled(25) + public int intvar25; + @SafeParceled(26) + public int intvar26; + @SafeParceled(27) + public int intvar27; + @SafeParceled(28) + public int intvar28; + @SafeParceled(29) + public int intvar29; + @SafeParceled(30) + public int intvar30; + @SafeParceled(31) + public int intvar31; + @SafeParceled(32) + public int intvar32; + @SafeParceled(33) + public INotificationActionsProvider notificationActionsProvider; + + public static Creator CREATOR = new AutoCreator(NotificationOptions.class); +} diff --git a/play-services-cast/build.gradle b/play-services-cast/build.gradle new file mode 100644 index 00000000..85ea138a --- /dev/null +++ b/play-services-cast/build.gradle @@ -0,0 +1,47 @@ +/* + * Copyright 2013-2015 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. + */ + +apply plugin: 'com.android.library' + +String getMyVersionName() { + def stdout = new ByteArrayOutputStream() + if (rootProject.file("gradlew").exists()) + exec { commandLine 'git', 'describe', '--tags', '--always', '--dirty'; standardOutput = stdout } + else // automatic build system, don't tag dirty + exec { commandLine 'git', 'describe', '--tags', '--always'; standardOutput = stdout } + return stdout.toString().trim().substring(1) +} + +android { + compileSdkVersion androidCompileSdk() + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName getMyVersionName() + minSdkVersion androidMinSdk() + targetSdkVersion androidTargetSdk() + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } +} + +dependencies { + api project(':play-services-base') + api project(':play-services-cast-api') +} diff --git a/play-services-cast/gradle.properties b/play-services-cast/gradle.properties new file mode 100644 index 00000000..937fcc06 --- /dev/null +++ b/play-services-cast/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2013-2016 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. +# + +POM_NAME=Play Services Cast Library +POM_DESCRIPTION=The Play Services Library module to access the Cast API + +POM_PACKAGING=aar + +POM_URL=https://github.com/microg/android_external_GmsLib + +POM_SCM_URL=https://github.com/microg/android_external_GmsLib +POM_SCM_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:microg/android_external_GmsLib.git + +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +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 + diff --git a/play-services-cast/src/main/AndroidManifest.xml b/play-services-cast/src/main/AndroidManifest.xml new file mode 100644 index 00000000..7e14f394 --- /dev/null +++ b/play-services-cast/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java b/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java new file mode 100644 index 00000000..b223b584 --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/Cast.java @@ -0,0 +1,223 @@ +/* + * 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.cast; + +import android.os.Bundle; + +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; + +import org.microg.gms.cast.CastApiBuilder; +import org.microg.gms.cast.CastApiImpl; +import org.microg.gms.common.PublicApi; + +import java.io.IOException; + +@PublicApi +public final class Cast { + + /** + * A constant indicating that the Google Cast device is not the currently active video input. + */ + public static final int ACTIVE_INPUT_STATE_NO = 0; + + /** + * A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is + * the currently active video input. Active input state can only be reported when the Google Cast device is + * connected to a TV or AVR with CEC support. + */ + public static final int ACTIVE_INPUT_STATE_UNKNOWN = -1; + + /** + * A constant indicating that the Google Cast device is the currently active video input. + */ + public static final int ACTIVE_INPUT_STATE_YES = 1; + + /** + * A boolean extra for the connection hint bundle passed to + * {@link GoogleApiClient.ConnectionCallbacks#onConnected(Bundle)} that indicates that the connection was + * re-established, but the receiver application that was in use at the time of the connection loss is no longer + * running on the receiver. + */ + public static final String EXTRA_APP_NO_LONGER_RUNNING = "com.google.android.gms.cast.EXTRA_APP_NO_LONGER_RUNNING"; + + /** + * The maximum raw message length (in bytes) that is supported by a Cast channel. + */ + public static final int MAX_MESSAGE_LENGTH = 65536; + + /** + * The maximum length (in characters) of a namespace name. + */ + public static final int MAX_NAMESPACE_LENGTH = 128; + + /** + * A constant indicating that the Google Cast device is not currently in standby. + */ + public static final int STANDBY_STATE_NO = 0; + + /** + * A constant indicating that it is not known (and/or not possible to know) whether the Google Cast device is + * currently in standby. Standby state can only be reported when the Google Cast device is connected to a TV or + * AVR with CEC support. + */ + public static final int STANDBY_STATE_UNKNOWN = -1; + + /** + * A constant indicating that the Google Cast device is currently in standby. + */ + public static final int STANDBY_STATE_YES = 1; + + + /** + * Token to pass to {@link GoogleApiClient.Builder#addApi(Api)} to enable the Cast features. + */ + public static final Api API = new Api(new CastApiBuilder()); + + /** + * An implementation of the CastApi interface. The interface is used to interact with a cast device. + */ + public static final Cast.CastApi CastApi = new CastApiImpl(); + + private Cast() { + } + + public interface ApplicationConnectionResult extends Result { + ApplicationMetadata getApplicationMetadata(); + + String getApplicationStatus(); + + String getSessionId(); + + boolean getWasLaunched(); + } + + public interface CastApi { + int getActiveInputState(GoogleApiClient client); + + ApplicationMetadata getApplicationMetadata(GoogleApiClient client); + + String getApplicationStatus(GoogleApiClient client); + + int getStandbyState(GoogleApiClient client); + + double getVolume(GoogleApiClient client); + + boolean isMute(GoogleApiClient client); + + PendingResult joinApplication(GoogleApiClient client); + + PendingResult joinApplication(GoogleApiClient client, String applicationId, String sessionId); + + PendingResult joinApplication(GoogleApiClient client, String applicationId); + + PendingResult launchApplication(GoogleApiClient client, String applicationId, LaunchOptions launchOptions); + + PendingResult launchApplication(GoogleApiClient client, String applicationId); + + @Deprecated + PendingResult launchApplication(GoogleApiClient client, String applicationId, boolean relaunchIfRunning); + + PendingResult leaveApplication(GoogleApiClient client); + + void removeMessageReceivedCallbacks(GoogleApiClient client, String namespace) throws IOException; + + void requestStatus(GoogleApiClient client) throws IOException; + + PendingResult sendMessage(GoogleApiClient client, String namespace, String message); + + void setMessageReceivedCallbacks(GoogleApiClient client, String namespace, Cast.MessageReceivedCallback callbacks) throws IOException; + + void setMute(GoogleApiClient client, boolean mute) throws IOException; + + void setVolume(GoogleApiClient client, double volume) throws IOException; + + PendingResult stopApplication(GoogleApiClient client); + + PendingResult stopApplication(GoogleApiClient client, String sessionId); + } + + public static class CastOptions implements Api.ApiOptions.HasOptions { + private final CastDevice castDevice; + private final Listener castListener; + private final boolean verboseLoggingEnabled; + + public CastOptions(CastDevice castDevice, Listener castListener, boolean verboseLoggingEnabled) { + this.castDevice = castDevice; + this.castListener = castListener; + this.verboseLoggingEnabled = verboseLoggingEnabled; + } + + @Deprecated + public static Builder builder(CastDevice castDevice, Listener castListener) { + return new Builder(castDevice, castListener); + } + + public static class Builder { + private final CastDevice castDevice; + private final Listener castListener; + private boolean verboseLoggingEnabled; + + public Builder(CastDevice castDevice, Listener castListener) { + this.castDevice = castDevice; + this.castListener = castListener; + } + + public CastOptions build() { + return new CastOptions(castDevice, castListener, verboseLoggingEnabled); + } + + public Builder setVerboseLoggingEnabled(boolean verboseLoggingEnabled) { + this.verboseLoggingEnabled = verboseLoggingEnabled; + return this; + } + } + } + + public static class Listener { + public void onActiveInputStateChanged(int activeInputState) { + + } + + public void onApplicationDisconnected(int statusCode) { + + } + + public void onApplicationMetadataChanged(ApplicationMetadata applicationMetadata) { + + } + + public void onApplicationStatusChanged() { + + } + + public void onStandbyStateChanged(int standbyState) { + + } + + public void onVolumeChanged() { + + } + } + + public interface MessageReceivedCallback { + void onMessageReceived(CastDevice castDevice, String namespace, String message); + } +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastPresentation.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastPresentation.java new file mode 100644 index 00000000..cfc55685 --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastPresentation.java @@ -0,0 +1,33 @@ +/* + * 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.cast; + +import android.annotation.TargetApi; +import android.app.Presentation; +import android.content.Context; +import android.view.Display; + +@TargetApi(17) +public class CastPresentation extends Presentation { + public CastPresentation(Context outerContext, Display display) { + super(outerContext, display); + } + + public CastPresentation(Context outerContext, Display display, int theme) { + super(outerContext, display, theme); + } +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java new file mode 100644 index 00000000..ddb5d53c --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplay.java @@ -0,0 +1,76 @@ +/* + * 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.cast; + +import android.view.Display; + +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.Result; +import com.google.android.gms.common.api.Status; + +import org.microg.gms.cast.CastRemoteDisplayApiBuilder; +import org.microg.gms.cast.CastRemoteDisplayApiImpl; +import org.microg.gms.common.PublicApi; + +@PublicApi +public final class CastRemoteDisplay { + /** + * Token to pass to {@link GoogleApiClient.Builder#addApi(Api)} to enable the CastRemoteDisplay features. + */ + public static final Api API = new Api(new CastRemoteDisplayApiBuilder()); + + /** + * An implementation of the CastRemoteDisplayAPI interface. The interface is used to interact with a cast device. + */ + public static final CastRemoteDisplayApi CastApi = new CastRemoteDisplayApiImpl(); + + private CastRemoteDisplay() { + } + + public static final class CastRemoteDisplayOptions implements Api.ApiOptions.HasOptions { + private CastDevice castDevice; + private CastRemoteDisplaySessionCallbacks callbacks; + + private CastRemoteDisplayOptions(CastDevice castDevice, CastRemoteDisplaySessionCallbacks callbacks) { + this.castDevice = castDevice; + this.callbacks = callbacks; + } + + public static final class Builder { + private CastDevice castDevice; + private CastRemoteDisplaySessionCallbacks callbacks; + + public Builder(CastDevice castDevice, CastRemoteDisplaySessionCallbacks callbacks) { + this.castDevice = castDevice; + this.callbacks = callbacks; + } + + public CastRemoteDisplayOptions build() { + return new CastRemoteDisplayOptions(castDevice, callbacks); + } + } + } + + public interface CastRemoteDisplaySessionCallbacks { + void onRemoteDisplayEnded(Status status); + } + + public interface CastRemoteDisplaySessionResult extends Result { + Display getPresentationDisplay(); + } +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java new file mode 100644 index 00000000..5c053581 --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayApi.java @@ -0,0 +1,26 @@ +/* + * 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.cast; + +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; + +public interface CastRemoteDisplayApi { + PendingResult startRemoteDisplay(GoogleApiClient apiClient, String applicationId); + + PendingResult stopRemoteDisplay(GoogleApiClient apiClient); +} diff --git a/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java new file mode 100644 index 00000000..dbc4108a --- /dev/null +++ b/play-services-cast/src/main/java/com/google/android/gms/cast/CastRemoteDisplayLocalService.java @@ -0,0 +1,28 @@ +/* + * 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.cast; + +import android.app.Service; +import android.content.Intent; +import android.os.IBinder; + +public class CastRemoteDisplayLocalService extends Service { + @Override + public IBinder onBind(Intent intent) { + return null; + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java new file mode 100644 index 00000000..cc40793f --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiBuilder.java @@ -0,0 +1,34 @@ +/* + * 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.cast; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.cast.Cast; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.api.ApiBuilder; +import org.microg.gms.common.api.ApiConnection; + +public class CastApiBuilder implements ApiBuilder{ + @Override + public ApiConnection build(Context context, Looper looper, Cast.CastOptions options, AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + return new CastClientImpl(context, options, callbacks, connectionFailedListener); + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java new file mode 100644 index 00000000..bb95565e --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiImpl.java @@ -0,0 +1,134 @@ +/* + * 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.cast; + +import com.google.android.gms.cast.ApplicationMetadata; +import com.google.android.gms.cast.Cast; +import com.google.android.gms.cast.LaunchOptions; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; +import com.google.android.gms.common.api.Status; + +import java.io.IOException; + +// TODO +public class CastApiImpl implements Cast.CastApi { + @Override + public int getActiveInputState(GoogleApiClient client) { + return 0; + } + + @Override + public ApplicationMetadata getApplicationMetadata(GoogleApiClient client) { + return null; + } + + @Override + public String getApplicationStatus(GoogleApiClient client) { + return null; + } + + @Override + public int getStandbyState(GoogleApiClient client) { + return 0; + } + + @Override + public double getVolume(GoogleApiClient client) { + return 0; + } + + @Override + public boolean isMute(GoogleApiClient client) { + return false; + } + + @Override + public PendingResult joinApplication(GoogleApiClient client) { + return null; + } + + @Override + public PendingResult joinApplication(GoogleApiClient client, String applicationId, String sessionId) { + return null; + } + + @Override + public PendingResult joinApplication(GoogleApiClient client, String applicationId) { + return null; + } + + @Override + public PendingResult launchApplication(GoogleApiClient client, String applicationId, LaunchOptions launchOptions) { + return null; + } + + @Override + public PendingResult launchApplication(GoogleApiClient client, String applicationId) { + return null; + } + + @Override + public PendingResult launchApplication(GoogleApiClient client, String applicationId, boolean relaunchIfRunning) { + return null; + } + + @Override + public PendingResult leaveApplication(GoogleApiClient client) { + return null; + } + + @Override + public void removeMessageReceivedCallbacks(GoogleApiClient client, String namespace) throws IOException { + + } + + @Override + public void requestStatus(GoogleApiClient client) throws IOException { + + } + + @Override + public PendingResult sendMessage(GoogleApiClient client, String namespace, String message) { + return null; + } + + @Override + public void setMessageReceivedCallbacks(GoogleApiClient client, String namespace, Cast.MessageReceivedCallback callbacks) throws IOException { + + } + + @Override + public void setMute(GoogleApiClient client, boolean mute) throws IOException { + + } + + @Override + public void setVolume(GoogleApiClient client, double volume) throws IOException { + + } + + @Override + public PendingResult stopApplication(GoogleApiClient client) { + return null; + } + + @Override + public PendingResult stopApplication(GoogleApiClient client, String sessionId) { + return null; + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java new file mode 100644 index 00000000..1f80aa1f --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.java @@ -0,0 +1,29 @@ +/* + * 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.cast; + +import android.content.Context; + +import com.google.android.gms.cast.Cast; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.DummyApiConnection; + +public class CastClientImpl extends DummyApiConnection { + public CastClientImpl(Context context, Cast.CastOptions options, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java new file mode 100644 index 00000000..048afd15 --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiBuilder.java @@ -0,0 +1,35 @@ +/* + * 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.cast; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.cast.CastRemoteDisplay; +import com.google.android.gms.common.api.AccountInfo; +import com.google.android.gms.common.api.GoogleApiClient; + +import org.microg.gms.common.DummyApiConnection; +import org.microg.gms.common.api.ApiBuilder; +import org.microg.gms.common.api.ApiConnection; + +public class CastRemoteDisplayApiBuilder implements ApiBuilder { + @Override + public ApiConnection build(Context context, Looper looper, CastRemoteDisplay.CastRemoteDisplayOptions options, AccountInfo accountInfo, GoogleApiClient.ConnectionCallbacks callbacks, GoogleApiClient.OnConnectionFailedListener connectionFailedListener) { + return new DummyApiConnection(); + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java new file mode 100644 index 00000000..4f47a90d --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiImpl.java @@ -0,0 +1,34 @@ +/* + * 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.cast; + +import com.google.android.gms.cast.CastRemoteDisplay; +import com.google.android.gms.cast.CastRemoteDisplayApi; +import com.google.android.gms.common.api.GoogleApiClient; +import com.google.android.gms.common.api.PendingResult; + +public class CastRemoteDisplayApiImpl implements CastRemoteDisplayApi { + @Override + public PendingResult startRemoteDisplay(GoogleApiClient apiClient, String applicationId) { + return null; + } + + @Override + public PendingResult stopRemoteDisplay(GoogleApiClient apiClient) { + return null; + } +} diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 0aef5a42..b55d79ef 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -16,19 +16,13 @@ apply plugin: 'com.android.application' -def useMapbox() { - Properties properties = new Properties() - properties.load(project.rootProject.file('local.properties').newDataInputStream()) - return properties.getProperty("mapbox.enabled", "false") == "true" +configurations { + mapboxImplementation + vtmImplementation } dependencies { - implementation 'com.android.support:multidex:1.0.3' - implementation "com.android.support:support-v4:$supportLibraryVersion" - implementation "com.android.support:appcompat-v7:$supportLibraryVersion" - implementation "com.android.support:mediarouter-v7:$supportLibraryVersion" implementation "com.squareup.wire:wire-runtime:1.6.1" - implementation "com.takisoft.fix:preference-v7:$supportLibraryVersion.0" implementation "de.hdodenhof:circleimageview:1.3.0" implementation "org.conscrypt:conscrypt-android:2.1.0" // TODO: Switch to upstream once raw requests are merged @@ -41,52 +35,43 @@ dependencies { api "org.slf4j:slf4j-api:1.7.25" api "uk.uuid.slf4j:slf4j-android:1.7.25-1" - implementation project(':microg-ui-tools') + implementation project(':play-services-base-core') + implementation project(':play-services-location-core') + implementation project(':play-services-core:microg-ui-tools') // deprecated implementation project(':play-services-api') implementation project(':play-services-cast-api') implementation project(':play-services-wearable') - implementation project(':unifiednlp-base') - implementation project(':wearable-lib') + implementation "org.microg:wearable:$wearableVersion" + implementation "org.microg.gms:remote-droid-guard:$remoteDroidGuardVersion" - implementation project(':remote-droid-guard-lib') - if (useMapbox()) { - implementation project(':play-services-maps-core-mapbox') - } else { - implementation project(':play-services-maps-core-vtm') - } + mapboxImplementation project(':play-services-maps-core-mapbox') + vtmImplementation project(':play-services-maps-core-vtm') + + // AndroidX UI + implementation "androidx.multidex:multidex:$multidexVersion" + implementation "androidx.appcompat:appcompat:$appcompatVersion" + implementation "androidx.mediarouter:mediarouter:$mediarouterVersion" + implementation "androidx.preference:preference:$preferenceVersion" + + // Navigation + implementation "androidx.navigation:navigation-fragment:$navigationVersion" + implementation "androidx.navigation:navigation-ui:$navigationVersion" + implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion" + implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion" } -def execResult(...args) { - def stdout = new ByteArrayOutputStream() - exec { - commandLine args - standardOutput = stdout - } - return stdout.toString().trim() -} - -def gmsVersion = "19.4.20" -def gmsVersionCode = Integer.parseInt(gmsVersion.replaceAll('\\.', '')) -def gitVersionBase = execResult('git', 'describe', '--tags', '--abbrev=0', '--match=v[0-9]*').substring(1) -def gitCommitCount = Integer.parseInt(execResult('git', 'rev-list', '--count', "v$gitVersionBase..HEAD")) -def gitCommitId = execResult('git', 'show-ref', '--abbrev=7', '--head', 'HEAD').split(' ')[0] -def gitDirty = execResult('git', 'status', '--porcelain').size() > 0 -def ourVersionBase = gitVersionBase.substring(0, gitVersionBase.lastIndexOf('.')) -def ourVersionMinor = Integer.parseInt(ourVersionBase.substring(ourVersionBase.lastIndexOf('.') + 1)) -def ourVersionCode = gmsVersionCode * 1000 + ourVersionMinor * 2 + (gitCommitCount > 0 || gitDirty ? 1 : 0) -def ourVersionName = "$ourVersionBase.$gmsVersionCode" + (gitCommitCount > 0 && !gitDirty ? "-$gitCommitCount" : "") + (gitDirty ? "-dirty" : "") + (useMapbox() ? "" : "-vtm") + (gitCommitCount > 0 && !gitDirty ? " ($gitCommitId)" : "") -logger.lifecycle('Starting build for version {} ({})...', ourVersionName, ourVersionCode) - android { compileSdkVersion androidCompileSdk() buildToolsVersion "$androidBuildVersionTools" defaultConfig { - versionName ourVersionName - versionCode ourVersionCode + versionName version + versionCode appVersionCode - minSdkVersion androidMinSdk() - targetSdkVersion androidTargetSdk() + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + +// buildConfigField "boolean", "USE_MAPBOX", "${useMapbox()}" multiDexEnabled true @@ -95,6 +80,10 @@ android { } } + dataBinding { + enabled = true + } + sourceSets { main { java.srcDirs += 'src/main/protos-java' @@ -107,11 +96,22 @@ android { buildTypes { release { - minifyEnabled true + minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + flavorDimensions 'maps' + productFlavors { + mapbox { + dimension 'maps' + } + vtm { + dimension 'maps' + versionNameSuffix '-vtm' + } + } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 diff --git a/play-services-core/microg-ui-tools/build.gradle b/play-services-core/microg-ui-tools/build.gradle new file mode 100644 index 00000000..d1479ecf --- /dev/null +++ b/play-services-core/microg-ui-tools/build.gradle @@ -0,0 +1,44 @@ +/* + * Copyright 2013-2016 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. + */ + +apply plugin: 'com.android.library' + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } + + lintOptions { + // TODO: Remove MissingTranslation once we have stable strings and proper translations. + disable 'MissingTranslation' + } +} + +dependencies { + implementation "androidx.appcompat:appcompat:$appcompatVersion" + implementation "androidx.preference:preference:$preferenceVersion" +} + diff --git a/play-services-core/microg-ui-tools/src/main/AndroidManifest.xml b/play-services-core/microg-ui-tools/src/main/AndroidManifest.xml new file mode 100644 index 00000000..004f299c --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/PermissionCheckGroup.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/PermissionCheckGroup.java new file mode 100644 index 00000000..22543802 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/PermissionCheckGroup.java @@ -0,0 +1,77 @@ +/* + * 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.tools.selfcheck; + +import android.annotation.TargetApi; +import android.content.Context; +import android.content.pm.PackageManager; +import android.content.pm.PermissionGroupInfo; +import android.content.pm.PermissionInfo; +import android.util.Log; + +import androidx.fragment.app.Fragment; + +import org.microg.tools.ui.R; + +import static android.os.Build.VERSION_CODES.M; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Negative; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Positive; + +@TargetApi(M) +public class PermissionCheckGroup implements SelfCheckGroup { + private static final String TAG = "SelfCheckPerms"; + + private String[] permissions; + + public PermissionCheckGroup(String... permissions) { + this.permissions = permissions; + } + + @Override + public String getGroupName(Context context) { + return context.getString(R.string.self_check_cat_permissions); + } + + @Override + public void doChecks(Context context, ResultCollector collector) { + for (String permission : permissions) { + doPermissionCheck(context, collector, permission); + } + } + + private void doPermissionCheck(Context context, ResultCollector collector, final String permission) { + PackageManager pm = context.getPackageManager(); + try { + PermissionInfo info = pm.getPermissionInfo(permission, 0); + PermissionGroupInfo groupInfo = info.group != null ? pm.getPermissionGroupInfo(info.group, 0) : null; + CharSequence permLabel = info.loadLabel(pm); + CharSequence groupLabel = groupInfo != null ? groupInfo.loadLabel(pm) : permLabel; + collector.addResult(context.getString(R.string.self_check_name_permission, permLabel), + context.checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED ? Positive : Negative, + context.getString(R.string.self_check_resolution_permission, groupLabel), + new SelfCheckGroup.CheckResolver() { + + @Override + public void tryResolve(Fragment fragment) { + fragment.requestPermissions(new String[]{permission}, 0); + } + }); + } catch (PackageManager.NameNotFoundException e) { + Log.w(TAG, e); + } + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.java new file mode 100644 index 00000000..13828574 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/selfcheck/SelfCheckGroup.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 org.microg.tools.selfcheck; + +import android.content.Context; + +import androidx.fragment.app.Fragment; + +public interface SelfCheckGroup { + String getGroupName(Context context); + + void doChecks(Context context, ResultCollector collector); + + interface ResultCollector { + void addResult(String name, Result value, String resolution); + + void addResult(String name, Result value, String resolution, CheckResolver resolver); + } + + interface CheckResolver { + void tryResolve(Fragment fragment); + } + + enum Result { + Positive, Negative, Unknown + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java new file mode 100644 index 00000000..e0b53f47 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractAboutFragment.java @@ -0,0 +1,149 @@ +/* + * 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.tools.ui; + +import android.content.Context; +import android.content.pm.PackageManager; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.text.TextUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.ListView; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Locale; + +public abstract class AbstractAboutFragment extends Fragment { + + protected abstract void collectLibraries(List libraries); + + public static Drawable getIcon(Context context) { + try { + PackageManager pm = context.getPackageManager(); + return pm.getPackageInfo(context.getPackageName(), 0).applicationInfo.loadIcon(pm); + } catch (PackageManager.NameNotFoundException e) { + // Never happens, self package always exists! + throw new RuntimeException(e); + } + } + + public static String getAppName(Context context) { + try { + PackageManager pm = context.getPackageManager(); + CharSequence label = pm.getPackageInfo(context.getPackageName(), 0).applicationInfo.loadLabel(pm); + if (TextUtils.isEmpty(label)) return context.getPackageName(); + return label.toString().trim(); + } catch (PackageManager.NameNotFoundException e) { + // Never happens, self package always exists! + throw new RuntimeException(e); + } + } + + protected String getAppName() { + return getAppName(getContext()); + } + + public static String getLibVersion(String packageName) { + try { + String versionName = (String) Class.forName(packageName + ".BuildConfig").getField("VERSION_NAME").get(null); + if (TextUtils.isEmpty(versionName)) return ""; + return versionName.trim(); + } catch (Exception e) { + return ""; + } + } + + public static String getSelfVersion(Context context) { + return getLibVersion(context.getPackageName()); + } + + protected String getSelfVersion() { + return getSelfVersion(getContext()); + } + + protected String getSummary() { + return null; + } + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View aboutRoot = inflater.inflate(R.layout.about_root, container, false); + ((ImageView) aboutRoot.findViewById(android.R.id.icon)).setImageDrawable(getIcon(getContext())); + ((TextView) aboutRoot.findViewById(android.R.id.title)).setText(getAppName()); + ((TextView) aboutRoot.findViewById(R.id.about_version)).setText(getString(R.string.about_version_str, getSelfVersion())); + String summary = getSummary(); + if (summary != null) { + ((TextView) aboutRoot.findViewById(android.R.id.summary)).setText(summary); + aboutRoot.findViewById(android.R.id.summary).setVisibility(View.VISIBLE); + } + + List libraries = new ArrayList(); + collectLibraries(libraries); + Collections.sort(libraries); + ((ListView) aboutRoot.findViewById(android.R.id.list)).setAdapter(new LibraryAdapter(getContext(), libraries.toArray(new Library[libraries.size()]))); + + return aboutRoot; + } + + private class LibraryAdapter extends ArrayAdapter { + + public LibraryAdapter(Context context, Library[] libraries) { + super(context, android.R.layout.simple_list_item_2, android.R.id.text1, libraries); + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + View v = super.getView(position, convertView, parent); + ((TextView) v.findViewById(android.R.id.text1)).setText(getString(R.string.about_name_version_str, getItem(position).name, getLibVersion(getItem(position).packageName))); + ((TextView) v.findViewById(android.R.id.text2)).setText(getItem(position).copyright != null ? getItem(position).copyright : getString(R.string.about_default_license)); + return v; + } + } + + protected static class Library implements Comparable { + private final String packageName; + private final String name; + private final String copyright; + + public Library(String packageName, String name, String copyright) { + this.packageName = packageName; + this.name = name; + this.copyright = copyright; + } + + @Override + public String toString() { + return name + ", " + copyright; + } + + @Override + public int compareTo(Library another) { + return name.toLowerCase(Locale.US).compareTo(another.name.toLowerCase(Locale.US)); + } + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractDashboardActivity.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractDashboardActivity.java new file mode 100644 index 00000000..caac607b --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractDashboardActivity.java @@ -0,0 +1,113 @@ +package org.microg.tools.ui; + +import android.os.Bundle; +import android.view.ViewGroup; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; + +import java.util.ArrayList; +import java.util.List; + +public abstract class AbstractDashboardActivity extends AppCompatActivity { + protected int preferencesResource = 0; + + private final List conditions = new ArrayList(); + private ViewGroup conditionContainer; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.dashboard_activity); + conditionContainer = (ViewGroup) findViewById(R.id.condition_container); + + getSupportFragmentManager().beginTransaction() + .replace(R.id.content_wrapper, getFragment()) + .commit(); + } + + @Override + protected void onResume() { + super.onResume(); + forceConditionReevaluation(); + } + + private synchronized void resetConditionViews() { + conditionContainer.removeAllViews(); + for (Condition condition : conditions) { + if (condition.isEvaluated()) { + if (condition.isActive(this)) { + addConditionToView(condition); + } + } else { + evaluateConditionAsync(condition); + } + } + } + + private void evaluateConditionAsync(final Condition condition) { + if (condition.willBeEvaluating()) { + new Thread(new Runnable() { + @Override + public void run() { + if (condition.isActive(AbstractDashboardActivity.this)) { + runOnUiThread(new Runnable() { + @Override + public void run() { + if (conditions.contains(condition) && condition.isEvaluated()) { + addConditionToView(condition); + } + } + }); + } + } + }).start(); + } + } + + protected void forceConditionReevaluation() { + for (Condition condition : conditions) { + condition.resetEvaluated(); + } + resetConditionViews(); + } + + protected void addAllConditions(Condition[] conditions) { + for (Condition condition : conditions) { + addCondition(condition); + } + } + + protected void addCondition(Condition condition) { + conditions.add(condition); + if (conditionContainer == null) return; + if (condition.isEvaluated()) { + addConditionToView(condition); + } else { + evaluateConditionAsync(condition); + } + } + + private synchronized void addConditionToView(Condition condition) { + for (int i = 0; i < conditionContainer.getChildCount(); i++) { + if (conditionContainer.getChildAt(i).getTag() == condition) return; + } + conditionContainer.addView(condition.createView(this, conditionContainer)); + } + + protected void clearConditions() { + conditions.clear(); + resetConditionViews(); + } + + protected Fragment getFragment() { + if (preferencesResource == 0) { + throw new IllegalStateException("Neither preferencesResource given, nor overriden getFragment()"); + } + ResourceSettingsFragment fragment = new ResourceSettingsFragment(); + Bundle b = new Bundle(); + b.putInt(ResourceSettingsFragment.EXTRA_PREFERENCE_RESOURCE, preferencesResource); + fragment.setArguments(b); + return fragment; + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java new file mode 100644 index 00000000..ab05ab8f --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSelfCheckFragment.java @@ -0,0 +1,128 @@ +/* + * 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.tools.ui; + +import android.os.Bundle; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.widget.CheckBox; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import org.microg.tools.selfcheck.SelfCheckGroup; + +import java.util.ArrayList; +import java.util.List; + +import static android.view.View.GONE; +import static android.view.View.INVISIBLE; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Negative; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Positive; +import static org.microg.tools.selfcheck.SelfCheckGroup.Result.Unknown; + +public abstract class AbstractSelfCheckFragment extends Fragment { + private static final String TAG = "SelfCheck"; + + private ViewGroup root; + + @Nullable + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + View scrollRoot = inflater.inflate(R.layout.self_check, container, false); + root = (ViewGroup) scrollRoot.findViewById(R.id.self_check_root); + reset(inflater); + return scrollRoot; + } + + protected abstract void prepareSelfCheckList(List checks); + + protected void reset(LayoutInflater inflater) { + List selfCheckGroupList = new ArrayList(); + prepareSelfCheckList(selfCheckGroupList); + + root.removeAllViews(); + for (SelfCheckGroup group : selfCheckGroupList) { + View groupView = inflater.inflate(R.layout.self_check_group, root, false); + ((TextView) groupView.findViewById(android.R.id.title)).setText(group.getGroupName(getContext())); + final ViewGroup viewGroup = (ViewGroup) groupView.findViewById(R.id.group_content); + final SelfCheckGroup.ResultCollector collector = new GroupResultCollector(viewGroup); + try { + group.doChecks(getContext(), collector); + } catch (Exception e) { + Log.w(TAG, "Failed during check " + group.getGroupName(getContext()), e); + collector.addResult("Self-check failed:", Negative, "An exception occurred during self-check. Please report this issue."); + } + root.addView(groupView); + } + } + + private class GroupResultCollector implements SelfCheckGroup.ResultCollector { + private final ViewGroup viewGroup; + + public GroupResultCollector(ViewGroup viewGroup) { + this.viewGroup = viewGroup; + } + + @Override + public void addResult(final String name, final SelfCheckGroup.Result result, final String resolution) { + addResult(name, result, resolution, null); + } + + @Override + public void addResult(final String name, final SelfCheckGroup.Result result, final String resolution, + final SelfCheckGroup.CheckResolver resolver) { + if (result == null || getActivity() == null) return; + getActivity().runOnUiThread(new Runnable() { + @Override + public void run() { + View resultEntry = LayoutInflater.from(getContext()).inflate(R.layout.self_check_entry, viewGroup, false); + ((TextView) resultEntry.findViewById(R.id.self_check_name)).setText(name); + resultEntry.findViewById(R.id.self_check_result).setOnTouchListener(new View.OnTouchListener() { + @Override + public boolean onTouch(View v, MotionEvent event) { + return true; + } + }); + if (result == Positive) { + ((CheckBox) resultEntry.findViewById(R.id.self_check_result)).setChecked(true); + resultEntry.findViewById(R.id.self_check_resolution).setVisibility(GONE); + } else { + ((TextView) resultEntry.findViewById(R.id.self_check_resolution)).setText(resolution); + if (result == Unknown) { + resultEntry.findViewById(R.id.self_check_result).setVisibility(INVISIBLE); + } + if (resolver != null) { + resultEntry.setClickable(true); + resultEntry.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + resolver.tryResolve(AbstractSelfCheckFragment.this); + } + }); + } + } + viewGroup.addView(resultEntry); + } + }); + } + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java new file mode 100644 index 00000000..a771a9ea --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsActivity.java @@ -0,0 +1,77 @@ +package org.microg.tools.ui; + +import android.os.Bundle; +import android.view.MenuItem; +import android.view.ViewGroup; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentTransaction; + +public abstract class AbstractSettingsActivity extends AppCompatActivity { + protected boolean showHomeAsUp = false; + protected int preferencesResource = 0; + private ViewGroup customBarContainer; + protected int customBarLayout = 0; + protected SwitchBar switchBar; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.settings_activity); + if (showHomeAsUp) { + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + } + + switchBar = (SwitchBar) findViewById(R.id.switch_bar); + + customBarContainer = (ViewGroup) findViewById(R.id.custom_bar); + if (customBarLayout != 0) { + customBarContainer.addView(getLayoutInflater().inflate(customBarLayout, customBarContainer, false)); + } + + getSupportFragmentManager().beginTransaction() + .replace(R.id.content_wrapper, getFragment()) + .commit(); + } + + public void setCustomBarLayout(int layout) { + customBarLayout = layout; + if (customBarContainer != null) { + customBarContainer.removeAllViews(); + customBarContainer.addView(getLayoutInflater().inflate(customBarLayout, customBarContainer, false)); + } + } + + public SwitchBar getSwitchBar() { + return switchBar; + } + + public void replaceFragment(Fragment fragment) { + getSupportFragmentManager().beginTransaction() + .addToBackStack("root") + .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN) + .replace(R.id.content_wrapper, fragment) + .commit(); + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + finish(); + return true; + } + return super.onOptionsItemSelected(item); + } + + protected Fragment getFragment() { + if (preferencesResource == 0) { + throw new IllegalStateException("Neither preferencesResource given, nor overriden getFragment()"); + } + ResourceSettingsFragment fragment = new ResourceSettingsFragment(); + Bundle b = new Bundle(); + b.putInt(ResourceSettingsFragment.EXTRA_PREFERENCE_RESOURCE, preferencesResource); + fragment.setArguments(b); + return fragment; + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsFragment.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsFragment.java new file mode 100644 index 00000000..0f1967a5 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/AbstractSettingsFragment.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 org.microg.tools.ui; + +import androidx.fragment.app.DialogFragment; +import androidx.preference.Preference; +import androidx.preference.PreferenceFragmentCompat; + +public abstract class AbstractSettingsFragment extends PreferenceFragmentCompat { + private static final String TAG = AbstractSettingsFragment.class.getSimpleName(); + + private static final String DIALOG_FRAGMENT_TAG = "androidx.preference.PreferenceFragment.DIALOG"; + + @Override + public void onDisplayPreferenceDialog(Preference preference) { + if (preference instanceof DialogPreference) { + DialogFragment f = DialogPreference.DialogPreferenceCompatDialogFragment.newInstance(preference.getKey()); + f.setTargetFragment(this, 0); + f.show(getFragmentManager(), DIALOG_FRAGMENT_TAG); + } else { + super.onDisplayPreferenceDialog(preference); + } + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/Condition.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/Condition.java new file mode 100644 index 00000000..7ea35cd8 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/Condition.java @@ -0,0 +1,338 @@ +/* + * 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.tools.ui; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.DrawableRes; +import androidx.annotation.PluralsRes; +import androidx.annotation.StringRes; +import androidx.core.content.res.ResourcesCompat; + +public class Condition { + @DrawableRes + private final int iconRes; + private final Drawable icon; + + @StringRes + private final int titleRes; + @PluralsRes + private final int titlePluralsRes; + private final CharSequence title; + + @StringRes + private final int summaryRes; + @PluralsRes + private final int summaryPluralsRes; + private final CharSequence summary; + + @StringRes + private final int firstActionTextRes; + @PluralsRes + private final int firstActionPluralsRes; + private final CharSequence firstActionText; + private final View.OnClickListener firstActionListener; + + @StringRes + private final int secondActionTextRes; + @PluralsRes + private final int secondActionPluralsRes; + private final CharSequence secondActionText; + private final View.OnClickListener secondActionListener; + + private final Evaluation evaluation; + + private boolean evaluated = false; + private boolean evaluating = false; + private int evaluatedPlurals = -1; + private boolean active; + + Condition(Builder builder) { + icon = builder.icon; + title = builder.title; + summary = builder.summary; + firstActionText = builder.firstActionText; + firstActionListener = builder.firstActionListener; + secondActionText = builder.secondActionText; + secondActionListener = builder.secondActionListener; + summaryRes = builder.summaryRes; + iconRes = builder.iconRes; + firstActionTextRes = builder.firstActionTextRes; + secondActionTextRes = builder.secondActionTextRes; + titleRes = builder.titleRes; + evaluation = builder.evaluation; + titlePluralsRes = builder.titlePluralsRes; + summaryPluralsRes = builder.summaryPluralsRes; + firstActionPluralsRes = builder.firstActionPluralsRes; + secondActionPluralsRes = builder.secondActionPluralsRes; + } + + View createView(final Context context, ViewGroup container) { + LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + View view = inflater.inflate(R.layout.condition_card, container, false); + Drawable icon = getIcon(context); + if (icon != null) + ((ImageView) view.findViewById(android.R.id.icon)).setImageDrawable(icon); + ((TextView) view.findViewById(android.R.id.title)).setText(getTitle(context)); + ((TextView) view.findViewById(android.R.id.summary)).setText(getSummary(context)); + Button first = (Button) view.findViewById(R.id.first_action); + first.setText(getFirstActionText(context)); + first.setOnClickListener(getFirstActionListener()); + CharSequence secondActionText = getSecondActionText(context); + if (secondActionText != null) { + Button second = (Button) view.findViewById(R.id.second_action); + second.setText(secondActionText); + second.setOnClickListener(getSecondActionListener()); + second.setVisibility(View.VISIBLE); + } + final View detailGroup = view.findViewById(R.id.detail_group); + final ImageView expandIndicator = (ImageView) view.findViewById(R.id.expand_indicator); + View.OnClickListener expandListener = new View.OnClickListener() { + @Override + public void onClick(View v) { + if (detailGroup.getVisibility() == View.VISIBLE) { + expandIndicator.setImageDrawable(ResourcesCompat.getDrawable(context.getResources(), R.drawable.ic_expand_more, context.getTheme())); + detailGroup.setVisibility(View.GONE); + } else { + expandIndicator.setImageDrawable(ResourcesCompat.getDrawable(context.getResources(), R.drawable.ic_expand_less, context.getTheme())); + detailGroup.setVisibility(View.VISIBLE); + } + } + }; + view.findViewById(R.id.collapsed_group).setOnClickListener(expandListener); + expandIndicator.setOnClickListener(expandListener); + view.setTag(this); + return view; + } + + public Drawable getIcon(Context context) { + if (iconRes != 0) { + return ResourcesCompat.getDrawable(context.getResources(), iconRes, context.getTheme()); + } + return icon; + } + + public CharSequence getTitle(Context context) { + if (titleRes != 0) { + return context.getString(titleRes); + } + if (titlePluralsRes != 0) { + return context.getResources().getQuantityString(titlePluralsRes, evaluatedPlurals); + } + return title; + } + + public CharSequence getSummary(Context context) { + if (summaryRes != 0) { + return context.getString(summaryRes); + } + if (summaryPluralsRes != 0) { + return context.getResources().getQuantityString(summaryPluralsRes, evaluatedPlurals); + } + return summary; + } + + public View.OnClickListener getFirstActionListener() { + return firstActionListener; + } + + public CharSequence getFirstActionText(Context context) { + if (firstActionTextRes != 0) { + return context.getString(firstActionTextRes); + } + if (firstActionPluralsRes != 0) { + return context.getResources().getQuantityString(firstActionPluralsRes, evaluatedPlurals); + } + return firstActionText; + } + + public View.OnClickListener getSecondActionListener() { + return secondActionListener; + } + + public CharSequence getSecondActionText(Context context) { + if (secondActionTextRes != 0) { + return context.getString(secondActionTextRes); + } + if (secondActionPluralsRes != 0) { + return context.getResources().getQuantityString(secondActionPluralsRes, evaluatedPlurals); + } + return secondActionText; + } + + public synchronized boolean willBeEvaluating() { + if (!evaluating && !evaluated && evaluation != null) { + return evaluating = true; + } else { + return false; + } + } + + public boolean isEvaluated() { + return evaluated || evaluation == null; + } + + public synchronized void evaluate(Context context) { + active = evaluation == null || evaluation.isActive(context); + evaluatedPlurals = evaluation.getPluralsCount(); + evaluated = true; + evaluating = false; + } + + public boolean isActive(Context context) { + if (!evaluated && evaluation != null) evaluate(context); + return active; + } + + public void resetEvaluated() { + this.evaluated = false; + } + + public static abstract class Evaluation { + public abstract boolean isActive(Context context); + + public int getPluralsCount() { + return 1; + } + } + + public static class Builder { + + @DrawableRes + private int iconRes; + private Drawable icon; + @StringRes + private int titleRes; + @PluralsRes + private int titlePluralsRes; + private CharSequence title; + @StringRes + private int summaryRes; + @PluralsRes + private int summaryPluralsRes; + private CharSequence summary; + @StringRes + private int firstActionTextRes; + @PluralsRes + private int firstActionPluralsRes; + private CharSequence firstActionText; + private View.OnClickListener firstActionListener; + @StringRes + private int secondActionTextRes; + @PluralsRes + private int secondActionPluralsRes; + private CharSequence secondActionText; + private View.OnClickListener secondActionListener; + private Evaluation evaluation; + + + public Builder() { + } + + public Builder icon(Drawable val) { + icon = val; + return this; + } + + public Builder icon(@DrawableRes int val) { + iconRes = val; + return this; + } + + public Builder title(CharSequence val) { + title = val; + return this; + } + + public Builder title(@StringRes int val) { + titleRes = val; + return this; + } + + public Builder titlePlurals(@PluralsRes int val) { + titlePluralsRes = val; + return this; + } + + public Builder summary(CharSequence val) { + summary = val; + return this; + } + + public Builder summary(@StringRes int val) { + summaryRes = val; + return this; + } + + public Builder summaryPlurals(@PluralsRes int val) { + summaryPluralsRes = val; + return this; + } + + public Builder firstAction(CharSequence text, View.OnClickListener listener) { + firstActionText = text; + firstActionListener = listener; + return this; + } + + public Builder firstAction(@StringRes int val, View.OnClickListener listener) { + firstActionTextRes = val; + firstActionListener = listener; + return this; + } + + public Builder firstActionPlurals(@PluralsRes int val, View.OnClickListener listener) { + firstActionPluralsRes = val; + firstActionListener = listener; + return this; + } + + public Builder secondAction(CharSequence text, View.OnClickListener listener) { + secondActionText = text; + secondActionListener = listener; + return this; + } + + public Builder secondAction(@StringRes int val, View.OnClickListener listener) { + secondActionTextRes = val; + secondActionListener = listener; + return this; + } + + public Builder secondActionPlurals(@PluralsRes int val, View.OnClickListener listener) { + secondActionPluralsRes = val; + secondActionListener = listener; + return this; + } + + public Builder evaluation(Evaluation evaluation) { + this.evaluation = evaluation; + return this; + } + + public Condition build() { + return new Condition(this); + } + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/DialogPreference.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/DialogPreference.java new file mode 100644 index 00000000..af07a691 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/DialogPreference.java @@ -0,0 +1,114 @@ +/* + * 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.tools.ui; + +import android.content.Context; +import android.content.SharedPreferences; +import android.os.Bundle; +import android.util.AttributeSet; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; + +import androidx.fragment.app.DialogFragment; +import androidx.preference.Preference; +import androidx.preference.PreferenceDialogFragmentCompat; +import androidx.preference.PreferenceFragmentCompat; +import androidx.preference.PreferenceViewHolder; + +public class DialogPreference extends androidx.preference.DialogPreference implements PreferenceFragmentCompat.OnPreferenceDisplayDialogCallback { + + private static final String DIALOG_FRAGMENT_TAG = + "android.support.v7.preference.PreferenceFragment.DIALOG"; + + public DialogPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + public DialogPreference(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public DialogPreference(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public DialogPreference(Context context) { + super(context); + } + + protected View onCreateDialogView() { + return null; + } + + /** + * Called when the dialog is dismissed and should be used to save data to + * the {@link SharedPreferences}. + * + * @param positiveResult Whether the positive button was clicked (true), or + * the negative button was clicked or the dialog was canceled (false). + */ + protected void onDialogClosed(boolean positiveResult) { + } + + @Override + public boolean onPreferenceDisplayDialog(PreferenceFragmentCompat caller, Preference pref) { + DialogPreferenceCompatDialogFragment fragment = new DialogPreferenceCompatDialogFragment(); + fragment.setTargetFragment(caller, 0); + fragment.show(caller.getFragmentManager(), DIALOG_FRAGMENT_TAG); + return true; + } + + @Override + public void onBindViewHolder(PreferenceViewHolder view) { + super.onBindViewHolder(view); + + ViewGroup.LayoutParams layoutParams = view.findViewById(R.id.icon_frame).getLayoutParams(); + if (layoutParams instanceof LinearLayout.LayoutParams) { + if (((LinearLayout.LayoutParams) layoutParams).leftMargin < 0) { + ((LinearLayout.LayoutParams) layoutParams).leftMargin = 0; + } + } + } + + public static class DialogPreferenceCompatDialogFragment extends PreferenceDialogFragmentCompat { + + @Override + protected View onCreateDialogView(Context context) { + if (getPreference() instanceof DialogPreference) { + View view = ((DialogPreference) getPreference()).onCreateDialogView(); + if (view != null) return view; + } + return super.onCreateDialogView(context); + } + + @Override + public void onDialogClosed(boolean positiveResult) { + if (getPreference() instanceof DialogPreference) { + ((DialogPreference) getPreference()).onDialogClosed(positiveResult); + } + } + + public static DialogFragment newInstance(String key) { + final DialogPreferenceCompatDialogFragment fragment = new DialogPreferenceCompatDialogFragment(); + final Bundle b = new Bundle(1); + b.putString(ARG_KEY, key); + fragment.setArguments(b); + return fragment; + } + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/DimmableIconPreference.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/DimmableIconPreference.java new file mode 100644 index 00000000..791cbd02 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/DimmableIconPreference.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * + * 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.tools.ui; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.text.TextUtils; +import android.util.AttributeSet; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.preference.Preference; +import androidx.preference.PreferenceViewHolder; + +/** + * A preference item that can dim the icon when it's disabled, either directly or because its parent + * is disabled. + */ +public class DimmableIconPreference extends Preference { + private static final int ICON_ALPHA_ENABLED = 255; + private static final int ICON_ALPHA_DISABLED = 102; + + private final CharSequence mContentDescription; + + public DimmableIconPreference(Context context) { + this(context, (AttributeSet) null); + } + + public DimmableIconPreference(Context context, AttributeSet attrs) { + super(context, attrs); + mContentDescription = null; + } + + public DimmableIconPreference(Context context, CharSequence contentDescription) { + super(context); + mContentDescription = contentDescription; + } + + protected boolean shouldDimIcon() { + return !isEnabled(); + } + + private void dimIcon(boolean dimmed) { + Drawable icon = getIcon(); + if (icon != null) { + icon.mutate().setAlpha(dimmed ? ICON_ALPHA_DISABLED : ICON_ALPHA_ENABLED); + setIcon(icon); + } + } + + @Override + public void onBindViewHolder(PreferenceViewHolder view) { + super.onBindViewHolder(view); + if (!TextUtils.isEmpty(mContentDescription)) { + final TextView titleView = (TextView) view.findViewById(android.R.id.title); + titleView.setContentDescription(mContentDescription); + } + ViewGroup.LayoutParams layoutParams = view.findViewById(R.id.icon_frame).getLayoutParams(); + if (layoutParams instanceof LinearLayout.LayoutParams) { + if (((LinearLayout.LayoutParams) layoutParams).leftMargin < 0) { + ((LinearLayout.LayoutParams) layoutParams).leftMargin = 0; + } + } + dimIcon(shouldDimIcon()); + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/LongTextPreference.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/LongTextPreference.java new file mode 100644 index 00000000..4c6edb8b --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/LongTextPreference.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 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.tools.ui; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.TextView; + +import androidx.preference.Preference; +import androidx.preference.PreferenceViewHolder; + +public class LongTextPreference extends Preference { + + public LongTextPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + public LongTextPreference(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public LongTextPreference(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public LongTextPreference(Context context) { + super(context); + } + + @Override + public void onBindViewHolder(PreferenceViewHolder holder) { + super.onBindViewHolder(holder); + TextView view = (TextView) holder.findViewById(android.R.id.summary); + if (view != null) { + view.setMaxLines(Integer.MAX_VALUE); + } + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/RadioButtonPreference.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/RadioButtonPreference.java new file mode 100644 index 00000000..e45d3812 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/RadioButtonPreference.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 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.tools.ui; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.util.AttributeSet; + +import androidx.core.content.res.TypedArrayUtils; +import androidx.preference.CheckBoxPreference; + +public class RadioButtonPreference extends CheckBoxPreference { + + public RadioButtonPreference(Context context, AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public RadioButtonPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + setWidgetLayoutResource(R.layout.preference_widget_radiobutton); + } + + @SuppressLint("RestrictedApi") + public RadioButtonPreference(Context context, AttributeSet attrs) { + this(context, attrs, TypedArrayUtils.getAttr(context, R.attr.checkBoxPreferenceStyle, + android.R.attr.checkBoxPreferenceStyle)); + } + + public RadioButtonPreference(Context context) { + this(context, null); + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/ResourceSettingsFragment.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/ResourceSettingsFragment.java new file mode 100644 index 00000000..78abc781 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/ResourceSettingsFragment.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 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.tools.ui; + +import android.os.Bundle; + +import androidx.annotation.Nullable; + +public class ResourceSettingsFragment extends AbstractSettingsFragment { + + public static final String EXTRA_PREFERENCE_RESOURCE = "preferencesResource"; + + protected int preferencesResource; + + @Override + public void onCreatePreferences(@Nullable Bundle savedInstanceState, String rootKey) { + Bundle b = getArguments(); + if (b != null) { + preferencesResource = b.getInt(EXTRA_PREFERENCE_RESOURCE, preferencesResource); + } + if (preferencesResource != 0) { + addPreferencesFromResource(preferencesResource); + } + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBar.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBar.java new file mode 100644 index 00000000..ab282dd5 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBar.java @@ -0,0 +1,265 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * Copyright (C) 2014-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.tools.ui; + +import android.content.Context; +import android.os.Build; +import android.os.Parcel; +import android.os.Parcelable; +import android.text.SpannableStringBuilder; +import android.text.TextUtils; +import android.text.style.TextAppearanceSpan; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.CompoundButton; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.appcompat.widget.SwitchCompat; + +import java.util.ArrayList; + +import static android.os.Build.VERSION.SDK_INT; + +public class SwitchBar extends LinearLayout implements CompoundButton.OnCheckedChangeListener, + View.OnClickListener { + + public static interface OnSwitchChangeListener { + /** + * Called when the checked state of the Switch has changed. + * + * @param switchView The Switch view whose state has changed. + * @param isChecked The new checked state of switchView. + */ + void onSwitchChanged(SwitchCompat switchView, boolean isChecked); + } + + private final TextAppearanceSpan mSummarySpan; + + private ToggleSwitch mSwitch; + private TextView mTextView; + private String mLabel; + private String mSummary; + + private ArrayList mSwitchChangeListeners = + new ArrayList(); + + public SwitchBar(Context context) { + this(context, null); + } + + public SwitchBar(Context context, AttributeSet attrs) { + super(context, attrs); + + LayoutInflater.from(context).inflate(R.layout.switch_bar, this); + + mTextView = (TextView) findViewById(R.id.switch_text); + if (SDK_INT > Build.VERSION_CODES.JELLY_BEAN) { + mTextView.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); + } + mLabel = getResources().getString(R.string.abc_capital_off); + mSummarySpan = new TextAppearanceSpan(context, androidx.appcompat.R.style.TextAppearance_AppCompat_Widget_Switch); + updateText(); + + mSwitch = (ToggleSwitch) findViewById(R.id.switch_widget); + // Prevent onSaveInstanceState() to be called as we are managing the state of the Switch + // on our own + mSwitch.setSaveEnabled(false); + if (SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + mSwitch.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); + } + + addOnSwitchChangeListener(new OnSwitchChangeListener() { + @Override + public void onSwitchChanged(SwitchCompat switchView, boolean isChecked) { + setTextViewLabel(isChecked); + } + }); + + setOnClickListener(this); + + // Default is hide + setVisibility(View.GONE); + } + + public void setTextViewLabel(boolean isChecked) { + mLabel = getResources() + .getString(isChecked ? R.string.abc_capital_on : R.string.abc_capital_off); + updateText(); + } + + public void setSummary(String summary) { + mSummary = summary; + updateText(); + } + + private void updateText() { + if (TextUtils.isEmpty(mSummary)) { + mTextView.setText(mLabel); + return; + } + final SpannableStringBuilder ssb = new SpannableStringBuilder(mLabel).append('\n'); + final int start = ssb.length(); + ssb.append(mSummary); + ssb.setSpan(mSummarySpan, start, ssb.length(), 0); + mTextView.setText(ssb); + } + + public void setChecked(boolean checked) { + setTextViewLabel(checked); + mSwitch.setChecked(checked); + } + + public void setCheckedInternal(boolean checked) { + setTextViewLabel(checked); + mSwitch.setCheckedInternal(checked); + } + + public boolean isChecked() { + return mSwitch.isChecked(); + } + + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + mTextView.setEnabled(enabled); + mSwitch.setEnabled(enabled); + } + + public final ToggleSwitch getSwitch() { + return mSwitch; + } + + public void show() { + if (!isShowing()) { + setVisibility(View.VISIBLE); + mSwitch.setOnCheckedChangeListener(this); + } + } + + public void hide() { + if (isShowing()) { + setVisibility(View.GONE); + mSwitch.setOnCheckedChangeListener(null); + } + } + + public boolean isShowing() { + return (getVisibility() == View.VISIBLE); + } + + @Override + public void onClick(View v) { + final boolean isChecked = !mSwitch.isChecked(); + setChecked(isChecked); + } + + public void propagateChecked(boolean isChecked) { + final int count = mSwitchChangeListeners.size(); + for (int n = 0; n < count; n++) { + mSwitchChangeListeners.get(n).onSwitchChanged(mSwitch, isChecked); + } + } + + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + propagateChecked(isChecked); + } + + public void addOnSwitchChangeListener(OnSwitchChangeListener listener) { + if (mSwitchChangeListeners.contains(listener)) { + throw new IllegalStateException("Cannot add twice the same OnSwitchChangeListener"); + } + mSwitchChangeListeners.add(listener); + } + + public void removeOnSwitchChangeListener(OnSwitchChangeListener listener) { + if (!mSwitchChangeListeners.contains(listener)) { + throw new IllegalStateException("Cannot remove OnSwitchChangeListener"); + } + mSwitchChangeListeners.remove(listener); + } + + static class SavedState extends BaseSavedState { + boolean checked; + boolean visible; + + SavedState(Parcelable superState) { + super(superState); + } + + /** + * Constructor called from {@link #CREATOR} + */ + private SavedState(Parcel in) { + super(in); + checked = (Boolean) in.readValue(Boolean.class.getClassLoader()); + visible = (Boolean) in.readValue(Boolean.class.getClassLoader()); + } + + @Override + public void writeToParcel(Parcel out, int flags) { + super.writeToParcel(out, flags); + out.writeValue(checked); + out.writeValue(visible); + } + + @Override + public String toString() { + return "SwitchBar.SavedState{" + + Integer.toHexString(System.identityHashCode(this)) + + " checked=" + checked + + " visible=" + visible + "}"; + } + + public static final Parcelable.Creator CREATOR + = new Parcelable.Creator() { + public SavedState createFromParcel(Parcel in) { + return new SavedState(in); + } + + public SavedState[] newArray(int size) { + return new SavedState[size]; + } + }; + } + + @Override + public Parcelable onSaveInstanceState() { + Parcelable superState = super.onSaveInstanceState(); + + SavedState ss = new SavedState(superState); + ss.checked = mSwitch.isChecked(); + ss.visible = isShowing(); + return ss; + } + + @Override + public void onRestoreInstanceState(Parcelable state) { + SavedState ss = (SavedState) state; + + super.onRestoreInstanceState(ss.getSuperState()); + + mSwitch.setCheckedInternal(ss.checked); + setTextViewLabel(ss.checked); + setVisibility(ss.visible ? View.VISIBLE : View.GONE); + mSwitch.setOnCheckedChangeListener(ss.visible ? this : null); + + requestLayout(); + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBarResourceSettingsFragment.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBarResourceSettingsFragment.java new file mode 100644 index 00000000..950ac8b2 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBarResourceSettingsFragment.java @@ -0,0 +1,71 @@ +/* + * Copyright (C) 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.tools.ui; + +import android.os.Bundle; + +import androidx.appcompat.widget.SwitchCompat; + +public abstract class SwitchBarResourceSettingsFragment extends ResourceSettingsFragment implements SwitchBar.OnSwitchChangeListener { + protected SwitchBar switchBar; + private SwitchCompat switchCompat; + private boolean listenerSetup = false; + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + super.onActivityCreated(savedInstanceState); + + AbstractSettingsActivity activity = (AbstractSettingsActivity) getActivity(); + + switchBar = activity.getSwitchBar(); + switchBar.show(); + switchCompat = switchBar.getSwitch(); + } + + @Override + public void onDestroyView() { + super.onDestroyView(); + switchBar.hide(); + } + + @Override + public void onResume() { + super.onResume(); + if (!listenerSetup) { + switchBar.addOnSwitchChangeListener(this); + listenerSetup = true; + } + } + + @Override + public void onPause() { + if (listenerSetup) { + switchBar.removeOnSwitchChangeListener(this); + listenerSetup = false; + } + super.onPause(); + } + + @Override + public void onSwitchChanged(SwitchCompat switchView, boolean isChecked) { + if (switchView == switchCompat) { + onSwitchBarChanged(isChecked); + } + } + + public abstract void onSwitchBarChanged(boolean isChecked); +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/TintIconPreference.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/TintIconPreference.java new file mode 100644 index 00000000..05486b9c --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/TintIconPreference.java @@ -0,0 +1,45 @@ +package org.microg.tools.ui; + +import android.content.Context; +import android.graphics.drawable.Drawable; +import android.util.AttributeSet; +import android.util.TypedValue; + +import androidx.core.graphics.drawable.DrawableCompat; +import androidx.preference.PreferenceViewHolder; + +import static android.os.Build.VERSION.SDK_INT; +import static android.os.Build.VERSION_CODES.LOLLIPOP; + +public class TintIconPreference extends DimmableIconPreference { + + public TintIconPreference(Context context) { + this(context, (AttributeSet) null); + } + + public TintIconPreference(Context context, AttributeSet attrs) { + super(context, attrs); + } + + private static int getThemeAccentColor(Context context) { + int colorAttr; + if (SDK_INT >= LOLLIPOP) { + colorAttr = android.R.attr.colorAccent; + } else { + //Get colorAccent defined for AppCompat + colorAttr = context.getResources().getIdentifier("colorAccent", "attr", context.getPackageName()); + } + TypedValue outValue = new TypedValue(); + context.getTheme().resolveAttribute(colorAttr, outValue, true); + return outValue.data; + } + + @Override + public void onBindViewHolder(PreferenceViewHolder view) { + super.onBindViewHolder(view); + Drawable icon = getIcon(); + if (icon != null) { + DrawableCompat.setTint(icon, getThemeAccentColor(getContext())); + } + } +} diff --git a/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/ToggleSwitch.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/ToggleSwitch.java new file mode 100644 index 00000000..96247305 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/ToggleSwitch.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2014 The Android Open Source Project + * Copyright (C) 2014-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.tools.ui; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.util.AttributeSet; + +import androidx.appcompat.widget.SwitchCompat; + +@SuppressLint("NewApi") +public class ToggleSwitch extends SwitchCompat { + + private ToggleSwitch.OnBeforeCheckedChangeListener mOnBeforeListener; + + public interface OnBeforeCheckedChangeListener { + boolean onBeforeCheckedChanged(ToggleSwitch toggleSwitch, boolean checked); + } + + public ToggleSwitch(Context context) { + super(context); + } + + public ToggleSwitch(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public ToggleSwitch(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public void setOnBeforeCheckedChangeListener(OnBeforeCheckedChangeListener listener) { + mOnBeforeListener = listener; + } + + @Override + public void setChecked(boolean checked) { + if (mOnBeforeListener != null + && mOnBeforeListener.onBeforeCheckedChanged(this, checked)) { + return; + } + super.setChecked(checked); + } + + public void setCheckedInternal(boolean checked) { + super.setChecked(checked); + } +} diff --git a/play-services-core/microg-ui-tools/src/main/res/drawable-v21/switchbar_background.xml b/play-services-core/microg-ui-tools/src/main/res/drawable-v21/switchbar_background.xml new file mode 100644 index 00000000..20909c3a --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/drawable-v21/switchbar_background.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/play-services-core/microg-ui-tools/src/main/res/drawable/empty.xml b/play-services-core/microg-ui-tools/src/main/res/drawable/empty.xml new file mode 100644 index 00000000..07d028d2 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/drawable/empty.xml @@ -0,0 +1,18 @@ + + + + \ No newline at end of file diff --git a/play-services-core/microg-ui-tools/src/main/res/drawable/ic_expand_less.xml b/play-services-core/microg-ui-tools/src/main/res/drawable/ic_expand_less.xml new file mode 100644 index 00000000..62ff063e --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/drawable/ic_expand_less.xml @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/play-services-core/microg-ui-tools/src/main/res/drawable/ic_expand_more.xml b/play-services-core/microg-ui-tools/src/main/res/drawable/ic_expand_more.xml new file mode 100644 index 00000000..871f6575 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/drawable/ic_expand_more.xml @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/play-services-core/microg-ui-tools/src/main/res/drawable/self_check.xml b/play-services-core/microg-ui-tools/src/main/res/drawable/self_check.xml new file mode 100644 index 00000000..92b47890 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/drawable/self_check.xml @@ -0,0 +1,27 @@ + + + + + + + \ No newline at end of file diff --git a/play-services-core/microg-ui-tools/src/main/res/drawable/switchbar_background.xml b/play-services-core/microg-ui-tools/src/main/res/drawable/switchbar_background.xml new file mode 100644 index 00000000..9c5aba9c --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/drawable/switchbar_background.xml @@ -0,0 +1,20 @@ + + + + + diff --git a/play-services-core/microg-ui-tools/src/main/res/layout-v14/preference_category_dashboard.xml b/play-services-core/microg-ui-tools/src/main/res/layout-v14/preference_category_dashboard.xml new file mode 100644 index 00000000..45d12ba7 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/layout-v14/preference_category_dashboard.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/play-services-core/microg-ui-tools/src/main/res/layout-v21/preference_material.xml b/play-services-core/microg-ui-tools/src/main/res/layout-v21/preference_material.xml new file mode 100644 index 00000000..3f7906ae --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/layout-v21/preference_material.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/play-services-core/microg-ui-tools/src/main/res/layout/about_root.xml b/play-services-core/microg-ui-tools/src/main/res/layout/about_root.xml new file mode 100644 index 00000000..e563293c --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/layout/about_root.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + diff --git a/play-services-core/microg-ui-tools/src/main/res/layout/app_bar.xml b/play-services-core/microg-ui-tools/src/main/res/layout/app_bar.xml new file mode 100644 index 00000000..02d68ae3 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/layout/app_bar.xml @@ -0,0 +1,51 @@ + + + + + + + + + + diff --git a/play-services-core/microg-ui-tools/src/main/res/layout/condition_card.xml b/play-services-core/microg-ui-tools/src/main/res/layout/condition_card.xml new file mode 100644 index 00000000..d18d9e1d --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/layout/condition_card.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +