diff --git a/.gitignore b/.gitignore index 08f6e53da21cf2b5881c60c9a1738cac0621ac28..e361b15f60716576bc5ea5ed9cac9556bc81fa6a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,6 @@ local.properties bin/ .project .classpath -.output/ +.out/ .settings/ +extern/FakeStore \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fff35a132d1fa84cf10b219955e9a16a28712a6d..ac346080b59f89e84f296c57bccadb9268297c70 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,9 +26,7 @@ cache: build: stage: build script: - - echo sdk.dir $ANDROID_HOME > local.properties - - echo mapbox.key $MAPBOX_KEY >> local.properties - - echo mapbox.enabled true >> local.properties + - echo mapbox.key $MAPBOX_KEY > local.properties - export TERM=dumb - export JAVA_OPTS="-XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx4096m" - ./gradlew assemble diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 7baca207edb24250fcb44d143700d988fa271842..0000000000000000000000000000000000000000 --- a/.gitmodules +++ /dev/null @@ -1,20 +0,0 @@ -[submodule "extern/UnifiedNlp"] - path = extern/UnifiedNlp - url = https://gitlab.e.foundation/e/apps/android_packages_apps_UnifiedNlp - branch = dev -[submodule "extern/GmsApi"] - path = extern/GmsApi - url = https://gitlab.e.foundation/e/apps/GmsApi - branch = dev -[submodule "extern/Wearable"] - path = extern/Wearable - url = https://gitlab.e.foundation/e/apps/Wearable - branch = dev -[submodule "extern/GmsLib"] - path = extern/GmsLib - url = https://gitlab.e.foundation/e/apps/GmsLib - branch = dev -[submodule "extern/RemoteDroidGuard"] - path = extern/RemoteDroidGuard - url = https://gitlab.e.foundation/e/apps/android_packages_apps_RemoteDroidGuard - branch = dev diff --git a/.travis.yml b/.travis.yml index 87ad538a658853850efc446ab60a46d025d475b8..daf99eeb3b8840b87064eb8a8eda27d08a3f70e5 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/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt new file mode 100644 index 0000000000000000000000000000000000000000..4ed90b952240cb872426e64da9e41252cc61ae3e --- /dev/null +++ b/LICENSES/Apache-2.0.txt @@ -0,0 +1,208 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, +AND DISTRIBUTION + + 1. Definitions. + + + +"License" shall mean the terms and conditions for use, reproduction, and distribution +as defined by Sections 1 through 9 of this document. + + + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + + + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct +or indirect, to cause the direction or management of such entity, whether +by contract or otherwise, or (ii) ownership of fifty percent (50%) or more +of the outstanding shares, or (iii) beneficial ownership of such entity. + + + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions +granted by this License. + + + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + + + +"Object" form shall mean any form resulting from mechanical transformation +or translation of a Source form, including but not limited to compiled object +code, generated documentation, and conversions to other media types. + + + +"Work" shall mean the work of authorship, whether in Source or Object form, +made available under the License, as indicated by a copyright notice that +is included in or attached to the work (an example is provided in the Appendix +below). + + + +"Derivative Works" shall mean any work, whether in Source or Object form, +that is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative +Works shall not include works that remain separable from, or merely link (or +bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative +Works thereof, that is intentionally submitted to Licensor for inclusion in +the Work by the copyright owner or by an individual or Legal Entity authorized +to submit on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication +sent to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor +for the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + + + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently incorporated +within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this +License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable copyright license to reproduce, prepare +Derivative Works of, publicly display, publicly perform, sublicense, and distribute +the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, +each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) patent +license to make, have made, use, offer to sell, sell, import, and otherwise +transfer the Work, where such license applies only to those patent claims +licensable by such Contributor that are necessarily infringed by their Contribution(s) +alone or by combination of their Contribution(s) with the Work to which such +Contribution(s) was submitted. If You institute patent litigation against +any entity (including a cross-claim or counterclaim in a lawsuit) alleging +that the Work or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses granted to You +under this License for that Work shall terminate as of the date such litigation +is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or +Derivative Works thereof in any medium, with or without modifications, and +in Source or Object form, provided that You meet the following conditions: + +(a) You must give any other recipients of the Work or Derivative Works a copy +of this License; and + +(b) You must cause any modified files to carry prominent notices stating that +You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source +form of the Work, excluding those notices that do not pertain to any part +of the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its distribution, +then any Derivative Works that You distribute must include a readable copy +of the attribution notices contained within such NOTICE file, excluding those +notices that do not pertain to any part of the Derivative Works, in at least +one of the following places: within a NOTICE text file distributed as part +of the Derivative Works; within the Source form or documentation, if provided +along with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works +that You distribute, alongside or as an addendum to the NOTICE text from the +Work, provided that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, +or distribution of Your modifications, or for any such Derivative Works as +a whole, provided Your use, reproduction, and distribution of the Work otherwise +complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any +Contribution intentionally submitted for inclusion in the Work by You to the +Licensor shall be under the terms and conditions of this License, without +any additional terms or conditions. Notwithstanding the above, nothing herein +shall supersede or modify the terms of any separate license agreement you +may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, +trademarks, service marks, or product names of the Licensor, except as required +for reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to +in writing, Licensor provides the Work (and each Contributor provides its +Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied, including, without limitation, any warranties +or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR +A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness +of using or redistributing the Work and assume any risks associated with Your +exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether +in tort (including negligence), contract, or otherwise, unless required by +applicable law (such as deliberate and grossly negligent acts) or agreed to +in writing, shall any Contributor be liable to You for damages, including +any direct, indirect, special, incidental, or consequential damages of any +character arising as a result of this License or out of the use or inability +to use the Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all other commercial +damages or losses), even if such Contributor has been advised of the possibility +of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work +or Derivative Works thereof, You may choose to offer, and charge a fee for, +acceptance of support, warranty, indemnity, or other liability obligations +and/or rights consistent with this License. However, in accepting such obligations, +You may act only on Your own behalf and on Your sole responsibility, not on +behalf of any other Contributor, and only if You agree to indemnify, defend, +and hold each Contributor harmless for any liability incurred by, or claims +asserted against, such Contributor by reason of your accepting any such warranty +or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own identifying +information. (Don't include the brackets!) The text should be enclosed in +the appropriate comment syntax for the file format. We also recommend that +a file or class name and description of purpose be included on the same "printed +page" as the copyright notice for easier identification within third-party +archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt new file mode 100644 index 0000000000000000000000000000000000000000..3f92dfc5fdda05635f28da16a47fa1a5c99c0dc6 --- /dev/null +++ b/LICENSES/CC-BY-4.0.txt @@ -0,0 +1,324 @@ +Creative Commons Attribution 4.0 International Creative Commons Corporation +("Creative Commons") is not a law firm and does not provide legal services +or legal advice. Distribution of Creative Commons public licenses does not +create a lawyer-client or other relationship. Creative Commons makes its licenses +and related information available on an "as-is" basis. Creative Commons gives +no warranties regarding its licenses, any material licensed under their terms +and conditions, or any related information. Creative Commons disclaims all +liability for damages resulting from their use to the fullest extent possible. + +Using Creative Commons Public Licenses + +Creative Commons public licenses provide a standard set of terms and conditions +that creators and other rights holders may use to share original works of +authorship and other material subject to copyright and certain other rights +specified in the public license below. The following considerations are for +informational purposes only, are not exhaustive, and do not form part of our +licenses. + +Considerations for licensors: Our public licenses are intended for use by +those authorized to give the public permission to use material in ways otherwise +restricted by copyright and certain other rights. Our licenses are irrevocable. +Licensors should read and understand the terms and conditions of the license +they choose before applying it. Licensors should also secure all rights necessary +before applying our licenses so that the public can reuse the material as +expected. Licensors should clearly mark any material not subject to the license. +This includes other CC-licensed material, or material used under an exception +or limitation to copyright. More considerations for licensors : wiki.creativecommons.org/Considerations_for_licensors + +Considerations for the public: By using one of our public licenses, a licensor +grants the public permission to use the licensed material under specified +terms and conditions. If the licensor's permission is not necessary for any +reason–for example, because of any applicable exception or limitation to copyright–then +that use is not regulated by the license. Our licenses grant only permissions +under copyright and certain other rights that a licensor has authority to +grant. Use of the licensed material may still be restricted for other reasons, +including because others have copyright or other rights in the material. A +licensor may make special requests, such as asking that all changes be marked +or described. Although not required by our licenses, you are encouraged to +respect those requests where reasonable. More considerations for the public +: wiki.creativecommons.org/Considerations_for_licensees Creative Commons Attribution +4.0 International Public License + +By exercising the Licensed Rights (defined below), You accept and agree to +be bound by the terms and conditions of this Creative Commons Attribution +4.0 International Public License ("Public License"). To the extent this Public +License may be interpreted as a contract, You are granted the Licensed Rights +in consideration of Your acceptance of these terms and conditions, and the +Licensor grants You such rights in consideration of benefits the Licensor +receives from making the Licensed Material available under these terms and +conditions. + +Section 1 – Definitions. + +a. Adapted Material means material subject to Copyright and Similar Rights +that is derived from or based upon the Licensed Material and in which the +Licensed Material is translated, altered, arranged, transformed, or otherwise +modified in a manner requiring permission under the Copyright and Similar +Rights held by the Licensor. For purposes of this Public License, where the +Licensed Material is a musical work, performance, or sound recording, Adapted +Material is always produced where the Licensed Material is synched in timed +relation with a moving image. + +b. Adapter's License means the license You apply to Your Copyright and Similar +Rights in Your contributions to Adapted Material in accordance with the terms +and conditions of this Public License. + +c. Copyright and Similar Rights means copyright and/or similar rights closely +related to copyright including, without limitation, performance, broadcast, +sound recording, and Sui Generis Database Rights, without regard to how the +rights are labeled or categorized. For purposes of this Public License, the +rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. + +d. Effective Technological Measures means those measures that, in the absence +of proper authority, may not be circumvented under laws fulfilling obligations +under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, +and/or similar international agreements. + +e. Exceptions and Limitations means fair use, fair dealing, and/or any other +exception or limitation to Copyright and Similar Rights that applies to Your +use of the Licensed Material. + +f. Licensed Material means the artistic or literary work, database, or other +material to which the Licensor applied this Public License. + +g. Licensed Rights means the rights granted to You subject to the terms and +conditions of this Public License, which are limited to all Copyright and +Similar Rights that apply to Your use of the Licensed Material and that the +Licensor has authority to license. + +h. Licensor means the individual(s) or entity(ies) granting rights under this +Public License. + +i. Share means to provide material to the public by any means or process that +requires permission under the Licensed Rights, such as reproduction, public +display, public performance, distribution, dissemination, communication, or +importation, and to make material available to the public including in ways +that members of the public may access the material from a place and at a time +individually chosen by them. + +j. Sui Generis Database Rights means rights other than copyright resulting +from Directive 96/9/EC of the European Parliament and of the Council of 11 +March 1996 on the legal protection of databases, as amended and/or succeeded, +as well as other essentially equivalent rights anywhere in the world. + +k. You means the individual or entity exercising the Licensed Rights under +this Public License. Your has a corresponding meaning. + +Section 2 – Scope. + + a. License grant. + +1. Subject to the terms and conditions of this Public License, the Licensor +hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, +irrevocable license to exercise the Licensed Rights in the Licensed Material +to: + + A. reproduce and Share the Licensed Material, in whole or in part; and + + B. produce, reproduce, and Share Adapted Material. + +2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions +and Limitations apply to Your use, this Public License does not apply, and +You do not need to comply with its terms and conditions. + + 3. Term. The term of this Public License is specified in Section 6(a). + +4. Media and formats; technical modifications allowed. The Licensor authorizes +You to exercise the Licensed Rights in all media and formats whether now known +or hereafter created, and to make technical modifications necessary to do +so. The Licensor waives and/or agrees not to assert any right or authority +to forbid You from making technical modifications necessary to exercise the +Licensed Rights, including technical modifications necessary to circumvent +Effective Technological Measures. For purposes of this Public License, simply +making modifications authorized by this Section 2(a)(4) never produces Adapted +Material. + + 5. Downstream recipients. + +A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed +Material automatically receives an offer from the Licensor to exercise the +Licensed Rights under the terms and conditions of this Public License. + +B. No downstream restrictions. You may not offer or impose any additional +or different terms or conditions on, or apply any Effective Technological +Measures to, the Licensed Material if doing so restricts exercise of the Licensed +Rights by any recipient of the Licensed Material. + +6. No endorsement. Nothing in this Public License constitutes or may be construed +as permission to assert or imply that You are, or that Your use of the Licensed +Material is, connected with, or sponsored, endorsed, or granted official status +by, the Licensor or others designated to receive attribution as provided in +Section 3(a)(1)(A)(i). + + b. Other rights. + +1. Moral rights, such as the right of integrity, are not licensed under this +Public License, nor are publicity, privacy, and/or other similar personality +rights; however, to the extent possible, the Licensor waives and/or agrees +not to assert any such rights held by the Licensor to the limited extent necessary +to allow You to exercise the Licensed Rights, but not otherwise. + +2. Patent and trademark rights are not licensed under this Public License. + +3. To the extent possible, the Licensor waives any right to collect royalties +from You for the exercise of the Licensed Rights, whether directly or through +a collecting society under any voluntary or waivable statutory or compulsory +licensing scheme. In all other cases the Licensor expressly reserves any right +to collect such royalties. + +Section 3 – License Conditions. + +Your exercise of the Licensed Rights is expressly made subject to the following +conditions. + + a. Attribution. + +1. If You Share the Licensed Material (including in modified form), You must: + +A. retain the following if it is supplied by the Licensor with the Licensed +Material: + +i. identification of the creator(s) of the Licensed Material and any others +designated to receive attribution, in any reasonable manner requested by the +Licensor (including by pseudonym if designated); + + ii. a copyright notice; + + iii. a notice that refers to this Public License; + + iv. a notice that refers to the disclaimer of warranties; + +v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; + +B. indicate if You modified the Licensed Material and retain an indication +of any previous modifications; and + +C. indicate the Licensed Material is licensed under this Public License, and +include the text of, or the URI or hyperlink to, this Public License. + +2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner +based on the medium, means, and context in which You Share the Licensed Material. +For example, it may be reasonable to satisfy the conditions by providing a +URI or hyperlink to a resource that includes the required information. + +3. If requested by the Licensor, You must remove any of the information required +by Section 3(a)(1)(A) to the extent reasonably practicable. + +4. If You Share Adapted Material You produce, the Adapter's License You apply +must not prevent recipients of the Adapted Material from complying with this +Public License. + +Section 4 – Sui Generis Database Rights. + +Where the Licensed Rights include Sui Generis Database Rights that apply to +Your use of the Licensed Material: + +a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, +reuse, reproduce, and Share all or a substantial portion of the contents of +the database; + +b. if You include all or a substantial portion of the database contents in +a database in which You have Sui Generis Database Rights, then the database +in which You have Sui Generis Database Rights (but not its individual contents) +is Adapted Material; and + +c. You must comply with the conditions in Section 3(a) if You Share all or +a substantial portion of the contents of the database. + +For the avoidance of doubt, this Section 4 supplements and does not replace +Your obligations under this Public License where the Licensed Rights include +other Copyright and Similar Rights. + +Section 5 – Disclaimer of Warranties and Limitation of Liability. + +a. Unless otherwise separately undertaken by the Licensor, to the extent possible, +the Licensor offers the Licensed Material as-is and as-available, and makes +no representations or warranties of any kind concerning the Licensed Material, +whether express, implied, statutory, or other. This includes, without limitation, +warranties of title, merchantability, fitness for a particular purpose, non-infringement, +absence of latent or other defects, accuracy, or the presence or absence of +errors, whether or not known or discoverable. Where disclaimers of warranties +are not allowed in full or in part, this disclaimer may not apply to You. + +b. To the extent possible, in no event will the Licensor be liable to You +on any legal theory (including, without limitation, negligence) or otherwise +for any direct, special, indirect, incidental, consequential, punitive, exemplary, +or other losses, costs, expenses, or damages arising out of this Public License +or use of the Licensed Material, even if the Licensor has been advised of +the possibility of such losses, costs, expenses, or damages. Where a limitation +of liability is not allowed in full or in part, this limitation may not apply +to You. + +c. The disclaimer of warranties and limitation of liability provided above +shall be interpreted in a manner that, to the extent possible, most closely +approximates an absolute disclaimer and waiver of all liability. + +Section 6 – Term and Termination. + +a. This Public License applies for the term of the Copyright and Similar Rights +licensed here. However, if You fail to comply with this Public License, then +Your rights under this Public License terminate automatically. + +b. Where Your right to use the Licensed Material has terminated under Section +6(a), it reinstates: + +1. automatically as of the date the violation is cured, provided it is cured +within 30 days of Your discovery of the violation; or + + 2. upon express reinstatement by the Licensor. + +c. For the avoidance of doubt, this Section 6(b) does not affect any right +the Licensor may have to seek remedies for Your violations of this Public +License. + +d. For the avoidance of doubt, the Licensor may also offer the Licensed Material +under separate terms or conditions or stop distributing the Licensed Material +at any time; however, doing so will not terminate this Public License. + + e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. + +Section 7 – Other Terms and Conditions. + +a. The Licensor shall not be bound by any additional or different terms or +conditions communicated by You unless expressly agreed. + +b. Any arrangements, understandings, or agreements regarding the Licensed +Material not stated herein are separate from and independent of the terms +and conditions of this Public License. + +Section 8 – Interpretation. + +a. For the avoidance of doubt, this Public License does not, and shall not +be interpreted to, reduce, limit, restrict, or impose conditions on any use +of the Licensed Material that could lawfully be made without permission under +this Public License. + +b. To the extent possible, if any provision of this Public License is deemed +unenforceable, it shall be automatically reformed to the minimum extent necessary +to make it enforceable. If the provision cannot be reformed, it shall be severed +from this Public License without affecting the enforceability of the remaining +terms and conditions. + +c. No term or condition of this Public License will be waived and no failure +to comply consented to unless expressly agreed to by the Licensor. + +d. Nothing in this Public License constitutes or may be interpreted as a limitation +upon, or waiver of, any privileges and immunities that apply to the Licensor +or You, including from the legal processes of any jurisdiction or authority. + +Creative Commons is not a party to its public licenses. Notwithstanding, Creative +Commons may elect to apply one of its public licenses to material it publishes +and in those instances will be considered the "Licensor." The text of the +Creative Commons public licenses is dedicated to the public domain under the +CC0 Public Domain Dedication. Except for the limited purpose of indicating +that material is shared under a Creative Commons public license or as otherwise +permitted by the Creative Commons policies published at creativecommons.org/policies, +Creative Commons does not authorize the use of the trademark "Creative Commons" +or any other trademark or logo of Creative Commons without its prior written +consent including, without limitation, in connection with any unauthorized +modifications to any of its public licenses or any other arrangements, understandings, +or agreements concerning use of licensed material. For the avoidance of doubt, +this paragraph does not form part of the public licenses. + +Creative Commons may be contacted at creativecommons.org. diff --git a/README.md b/README.md index b378765fa41d4d443c458a63c126a29976c4c4eb..4b47042c93cc089bc5b72614b6ce8c221d7dedef 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ microG GmsCore is a FLOSS (Free/Libre Open Source Software) framework to allow a License ------- - Copyright 2013-2019 microG Project Team + Copyright 2013-2020 microG Project Team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/build.gradle b/build.gradle index b6ffdcde07818031b191fa61a4fb217bfc22c7a5..b3002c345e29e9bacf1b18b256ec1ace7bbc8f66 100644 --- a/build.gradle +++ b/build.gradle @@ -1,63 +1,113 @@ /* - * 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-alpha2' + ext.remoteDroidGuardVersion = '0.1.2' + 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.coreVersion = '1.3.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.wireVersion = '3.2.2' + + 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" + classpath "com.squareup.wire:wire-gradle-plugin:$wireVersion" } } +def execResult(...args) { + def stdout = new ByteArrayOutputStream() + exec { + commandLine args + standardOutput = stdout + } + return stdout.toString().trim() +} + +def gmsVersion = "20.24.14" +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 c6448e7c55ff95c49a6affe2e514ef96b0a30bf3..0000000000000000000000000000000000000000 --- a/extern/GmsApi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c6448e7c55ff95c49a6affe2e514ef96b0a30bf3 diff --git a/extern/GmsLib b/extern/GmsLib deleted file mode 160000 index 614e111fa02b9aeb195879735ababe869074617c..0000000000000000000000000000000000000000 --- a/extern/GmsLib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 614e111fa02b9aeb195879735ababe869074617c diff --git a/extern/UnifiedNlp b/extern/UnifiedNlp deleted file mode 160000 index 5516c49cb40d5008bd76a0818bb856da1b134f05..0000000000000000000000000000000000000000 --- a/extern/UnifiedNlp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5516c49cb40d5008bd76a0818bb856da1b134f05 diff --git a/firebase-dynamic-links b/firebase-dynamic-links deleted file mode 120000 index 2b9de5972139155200608aa25f5317c008ab69fd..0000000000000000000000000000000000000000 --- a/firebase-dynamic-links +++ /dev/null @@ -1 +0,0 @@ -extern/GmsLib/firebase-dynamic-links \ No newline at end of file diff --git a/firebase-dynamic-links-api b/firebase-dynamic-links-api deleted file mode 120000 index 30d4bb017b2ac08d2bdd4159b45b4463ec36e9ce..0000000000000000000000000000000000000000 --- a/firebase-dynamic-links-api +++ /dev/null @@ -1 +0,0 @@ -extern/GmsApi/firebase-dynamic-links-api \ No newline at end of file diff --git a/firebase-dynamic-links-api/build.gradle b/firebase-dynamic-links-api/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..32edbc9b62625076052db314b1d5a6fca19312e1 --- /dev/null +++ b/firebase-dynamic-links-api/build.gradle @@ -0,0 +1,49 @@ +/* + * Copyright 2019 e Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +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) +} + +group = 'org.microg' +version = getMyVersionName() + +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-basement') +} diff --git a/firebase-dynamic-links-api/gradle.properties b/firebase-dynamic-links-api/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..c601b6d60b7e46141f217cd1fb26096cb1244503 --- /dev/null +++ b/firebase-dynamic-links-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2019 e Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +POM_NAME=Firebase Dynamic Links API +POM_DESCRIPTION=Interfaces and objects for IPC between Firebase Library and microG + +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=alexandruchircu +POM_DEVELOPER_NAME=Alexandru Chircu + diff --git a/play-services-core/src/main/res/xml/preferences_checkin.xml b/firebase-dynamic-links-api/src/main/AndroidManifest.xml similarity index 70% rename from play-services-core/src/main/res/xml/preferences_checkin.xml rename to firebase-dynamic-links-api/src/main/AndroidManifest.xml index 45c982a725cb891d03288e7231018b340c02ae73..ae17555c5d6f1c71a70b65c9c011545c6260eb4a 100644 --- a/play-services-core/src/main/res/xml/preferences_checkin.xml +++ b/firebase-dynamic-links-api/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ - - - \ No newline at end of file + diff --git a/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/DynamicLinkData.aidl b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/DynamicLinkData.aidl new file mode 100644 index 0000000000000000000000000000000000000000..5862178ae36fdfdbb112c741ccffe85b0024afa6 --- /dev/null +++ b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/DynamicLinkData.aidl @@ -0,0 +1,3 @@ +package com.google.firebase.dynamiclinks.internal; + +parcelable DynamicLinkData; \ No newline at end of file diff --git a/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/IDynamicLinksCallbacks.aidl b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/IDynamicLinksCallbacks.aidl new file mode 100644 index 0000000000000000000000000000000000000000..9f9915ffb0f0cfc6c528bbd4fd8cb279ddea9654 --- /dev/null +++ b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/IDynamicLinksCallbacks.aidl @@ -0,0 +1,12 @@ +package com.google.firebase.dynamiclinks.internal; + + +import com.google.firebase.dynamiclinks.internal.DynamicLinkData; +import com.google.firebase.dynamiclinks.internal.ShortDynamicLink; + +import com.google.android.gms.common.api.Status; + +interface IDynamicLinksCallbacks { + void onStatusDynamicLinkData(in Status status, in DynamicLinkData dldata) = 0; + void onStatusShortDynamicLink(in Status status, in ShortDynamicLink sdlink) = 1; +} diff --git a/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/IDynamicLinksService.aidl b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/IDynamicLinksService.aidl new file mode 100644 index 0000000000000000000000000000000000000000..57f083f539d61259ed8adbf7e725405324e0f902 --- /dev/null +++ b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/IDynamicLinksService.aidl @@ -0,0 +1,12 @@ +package com.google.firebase.dynamiclinks.internal; + + +import com.google.firebase.dynamiclinks.internal.IDynamicLinksCallbacks; + +import android.os.Bundle; + + +interface IDynamicLinksService { + void getInitialLink(IDynamicLinksCallbacks callback, String var2) = 0; + void func2(IDynamicLinksCallbacks callback, in Bundle var2) = 1; +} diff --git a/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/ShortDynamicLink.aidl b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/ShortDynamicLink.aidl new file mode 100644 index 0000000000000000000000000000000000000000..f4852a0305959d659169e36f5393ed5e4e6c9032 --- /dev/null +++ b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/ShortDynamicLink.aidl @@ -0,0 +1,3 @@ +package com.google.firebase.dynamiclinks.internal; + +parcelable ShortDynamicLink; \ No newline at end of file diff --git a/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/Warning.aidl b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/Warning.aidl new file mode 100644 index 0000000000000000000000000000000000000000..4331c92a4d86ee23204dcb9d6cdd5c0fa786ed32 --- /dev/null +++ b/firebase-dynamic-links-api/src/main/aidl/com/google/firebase/dynamiclinks/internal/Warning.aidl @@ -0,0 +1,3 @@ +package com.google.firebase.dynamiclinks.internal; + +parcelable Warning; \ No newline at end of file diff --git a/firebase-dynamic-links-api/src/main/java/com/google/firebase/dynamiclinks/internal/DynamicLinkData.java b/firebase-dynamic-links-api/src/main/java/com/google/firebase/dynamiclinks/internal/DynamicLinkData.java new file mode 100644 index 0000000000000000000000000000000000000000..02270cd137c2739050fa42c3190e8e8bb6441d5d --- /dev/null +++ b/firebase-dynamic-links-api/src/main/java/com/google/firebase/dynamiclinks/internal/DynamicLinkData.java @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2019 e Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.firebase.dynamiclinks.internal; + + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import android.os.Bundle; +import android.net.Uri; + + +public class DynamicLinkData extends AutoSafeParcelable { + @SafeParceled(1) + public final String dynamicLink; + + @SafeParceled(2) + public final String deepLink; + + @SafeParceled(3) + public final int minVersion; + + @SafeParceled(4) + public final long clickTimestamp; + + @SafeParceled(5) + public final Bundle extensionBundle; + + @SafeParceled(6) + public final Uri redirectUrl; + + public DynamicLinkData() { + dynamicLink = new String(); + deepLink = new String(); + minVersion = 0; + clickTimestamp = 0; + extensionBundle = new Bundle(); + redirectUrl = Uri.EMPTY; + } + + + public static final Creator CREATOR = new AutoCreator(DynamicLinkData.class); +} \ No newline at end of file diff --git a/firebase-dynamic-links-api/src/main/java/com/google/firebase/dynamiclinks/internal/ShortDynamicLink.java b/firebase-dynamic-links-api/src/main/java/com/google/firebase/dynamiclinks/internal/ShortDynamicLink.java new file mode 100644 index 0000000000000000000000000000000000000000..893e409872328569053322cded4f5d12ad072484 --- /dev/null +++ b/firebase-dynamic-links-api/src/main/java/com/google/firebase/dynamiclinks/internal/ShortDynamicLink.java @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2019 e Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.firebase.dynamiclinks.internal; + + +import com.google.firebase.dynamiclinks.internal.Warning; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import android.net.Uri; +import java.util.List; +import java.util.ArrayList; + + +public class ShortDynamicLink extends AutoSafeParcelable { + @SafeParceled(1) + public final Uri shortLink; + + @SafeParceled(2) + public final Uri previewLink; + + @SafeParceled(3) + public final List warnings; + + + public ShortDynamicLink() { + shortLink = Uri.EMPTY; + previewLink = Uri.EMPTY; + + warnings = new ArrayList<>(); + } + + + public static final Creator CREATOR = new AutoCreator(ShortDynamicLink.class); +} \ No newline at end of file diff --git a/firebase-dynamic-links-api/src/main/java/com/google/firebase/dynamiclinks/internal/Warning.java b/firebase-dynamic-links-api/src/main/java/com/google/firebase/dynamiclinks/internal/Warning.java new file mode 100644 index 0000000000000000000000000000000000000000..950f3de748898db7be7281b0fc16b25d8f4adfe0 --- /dev/null +++ b/firebase-dynamic-links-api/src/main/java/com/google/firebase/dynamiclinks/internal/Warning.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2019 e Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.firebase.dynamiclinks.internal; + + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + + +public class Warning extends AutoSafeParcelable { + @SafeParceled(1) + private int versionCode = 1; + + @SafeParceled(2) + public final String message; + + + public Warning() { + message = null; + } + + + public static final Creator CREATOR = new AutoCreator(Warning.class); +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index e08c81d314ca10b41bcd7e4f7524f1182615fc79..e3cd3843f980cae0c8848c55458cc6ec1c2608f6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ +android.useAndroidX=true org.gradle.jvmargs=-Xms512m -Xmx4096m diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d757f3d33fcc6837851eb73a6963eebcee23c282..21a8fe405ad29d87e38ddb4ce1fe52209e3a5cfe 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 d6e8b594369b8dc7ddbd1ca3889f9d35eccde0be..0000000000000000000000000000000000000000 --- 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 ce1f09ca983cec4669bdc51ef9cd2c42b7d4dd9c..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..259c6337def2a3d6bc9cc1186a2162c7ae2b9bdb --- /dev/null +++ b/play-services-api/build.gradle @@ -0,0 +1,43 @@ +/* + * 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-appinvite-api') + 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 0000000000000000000000000000000000000000..221fda84a554b4babc75d779e693e2969c6ce2e8 --- /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 0000000000000000000000000000000000000000..d4a4d07a2f94f82cd9c23f55c1b2084e60ee4b9b --- /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 0000000000000000000000000000000000000000..75a949b856132e2afc4f34a2a90531b6f6c80289 --- /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 0000000000000000000000000000000000000000..7e07dd018c7488c20c8b400341ee20b3c79d62a0 --- /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 0000000000000000000000000000000000000000..5f4f5c1f4d52035ef47b9033812c97bd5d22be47 --- /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 0000000000000000000000000000000000000000..f893aef8edb4388c299490400927a1da4d3c0178 --- /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 0000000000000000000000000000000000000000..c7f5e43261f51838b92e746161c65602ebee5e1b --- /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 0000000000000000000000000000000000000000..0ae6e4bc64948f8f6af3a3f5052a70f7a14dc930 --- /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 0000000000000000000000000000000000000000..a0a785c1ca53d7030dbf533f853e00b09822437c --- /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 0000000000000000000000000000000000000000..0b3c47ff74bc910b91a931bf8c01ac525ae8c38d --- /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 0000000000000000000000000000000000000000..57d2d63b4dcbddde9faa8bc0c9db0b798315b8f2 --- /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 0000000000000000000000000000000000000000..b52e3d4fff51287f75b4fda9f3e70dce645a5e7d --- /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 0000000000000000000000000000000000000000..ebc204c79a122dfefd066272d741495d7c76e218 --- /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 0000000000000000000000000000000000000000..77e618ac8f20e4d218f13e97dfad98fab3705fc3 --- /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 0000000000000000000000000000000000000000..338a142703b50cb9da5a871bf8f18c0fbcfbb073 --- /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 0000000000000000000000000000000000000000..206b1a9d5144ebfce3dd4a2ff19dbe6f406cf717 --- /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 0000000000000000000000000000000000000000..832e58598fb5d533448547b470554ed608cf29f4 --- /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 0000000000000000000000000000000000000000..82536b930fda61f22498477647c19cd430b32417 --- /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 0000000000000000000000000000000000000000..d000f32e2dbfe96ffbe901a8ac676e88ba7aa6e6 --- /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 0000000000000000000000000000000000000000..7fa0d4ab6cee4dd376823cbc23967a27d6ec39fd --- /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 0000000000000000000000000000000000000000..814f68da882fe2bbd0a49a3ea1cee94b6f1c052a --- /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 0000000000000000000000000000000000000000..da248c338752c4ef4061154ad845cff32db591f0 --- /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 0000000000000000000000000000000000000000..89c6c7e21badfa095f6ff011a7558a2ff56ff9f8 --- /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 0000000000000000000000000000000000000000..b5bcb593a5229ae8f23d7a9f03d2ab0bdbbcc920 --- /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 0000000000000000000000000000000000000000..6ac612897ad58831b9dcc955acdcc74eee9aa36b --- /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 0000000000000000000000000000000000000000..25041d4d1370fe1510cde9f3365868f839a14b4b --- /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 0000000000000000000000000000000000000000..58e796ef7160405ce8f075667968307da94433e6 --- /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 0000000000000000000000000000000000000000..b2f1b2fd512838c75ee62dd2a2d46267fb1100b6 --- /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 0000000000000000000000000000000000000000..ae02e068b4d6c8d63344864e6c0275e42d669ab8 --- /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 0000000000000000000000000000000000000000..19839d7d2070718815241b6aca894fd1c178c658 --- /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 0000000000000000000000000000000000000000..da539f329e7a6a7c862c55f8b1b9567197522858 --- /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/common/internal/ISignInButtonCreator.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/internal/ISignInButtonCreator.aidl new file mode 100644 index 0000000000000000000000000000000000000000..f6c53996eded5b050f47be35c6f6a66c7ec045be --- /dev/null +++ b/play-services-api/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-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl b/play-services-api/src/main/aidl/com/google/android/gms/common/server/FavaDiagnosticsEntity.aidl new file mode 100644 index 0000000000000000000000000000000000000000..69b856bc60915cbd0ceab214b3b83b7c4984fe16 --- /dev/null +++ b/play-services-api/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-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 0000000000000000000000000000000000000000..843b1e0aefb93ed2e92d410cd7fb1f2b307ed9fd --- /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 0000000000000000000000000000000000000000..ba0f503d5f37f1c945869e617c6283141331a5c9 --- /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 0000000000000000000000000000000000000000..70c193052dd720dc5771dab9bda811ea6f243a30 --- /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 0000000000000000000000000000000000000000..30696de0adc49e7c7b3b4cd1f5e8244a1b82aa6c --- /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 0000000000000000000000000000000000000000..dfd43f74cf1d4b563eaed99b640109386f315cca --- /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 0000000000000000000000000000000000000000..05f32cb36ffe6698f962dca4894bb9e9a7469a28 --- /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 0000000000000000000000000000000000000000..b4107a0edda5450706716ba04267e25939ccfbe9 --- /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 0000000000000000000000000000000000000000..eb7001c090ce78b4d147bc0c2470ba1b53b49a85 --- /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 0000000000000000000000000000000000000000..b513f4491dbf74a3c4b8532253937630f8c495dc --- /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 0000000000000000000000000000000000000000..43536051b4a9f12a790a8597d085feb8a3c3678c --- /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 0000000000000000000000000000000000000000..bf226dc022c13cba59146f5e4f2787f39d32310c --- /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 0000000000000000000000000000000000000000..7e3306584e478565c66822a5cab03235366e7744 --- /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 0000000000000000000000000000000000000000..7c7452f79278901519393cd75487b57c3bdbe3c4 --- /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 0000000000000000000000000000000000000000..300d82c6ad74bbf1cee38e21746399e888df429f --- /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 0000000000000000000000000000000000000000..be852bc5a1b50f12a56a4c7d348f6c9faf49078a --- /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 0000000000000000000000000000000000000000..a1b7c8f29c2713f3556f3e060d27ea6ff497bb6d --- /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 0000000000000000000000000000000000000000..c8bbef83181cc30fed9aa9f4c060ecc69c8bcc9c --- /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 0000000000000000000000000000000000000000..1b85028b2ad556322070328af0845034bc11a153 --- /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 0000000000000000000000000000000000000000..22cf3ad1f9ac87a7e08812ced4b964088227cb26 --- /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 0000000000000000000000000000000000000000..d3ead69df9c89cbd659f64c1dc0e86f45ecbba56 --- /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 0000000000000000000000000000000000000000..4655cb3f13e42c77174ffa8de0d1696a86c9e3bc --- /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 0000000000000000000000000000000000000000..e14152f2e380c4445543a38dc2df6ea0b97e1a82 --- /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 0000000000000000000000000000000000000000..424c2cac8d58e1700cf756f2c98b1ee541f1c4cf --- /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 0000000000000000000000000000000000000000..0f748bb91c2a31f9e0d0f79fd4e1de59f4ea878b --- /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 0000000000000000000000000000000000000000..06b38bd88d40e0d9ec5b99fdfadb2c3d788b3a87 --- /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 0000000000000000000000000000000000000000..022ffda3903b4bf875c91a79c07c53c895950419 --- /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 0000000000000000000000000000000000000000..8992b0536a9f51a07db931203b25257eff967daa --- /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 0000000000000000000000000000000000000000..821aefb53a4cb70a8443346346ef673478efadc0 --- /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 0000000000000000000000000000000000000000..9d1a31b91f7c3a4d9d2b0862a7d1346cfc0ed57b --- /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 0000000000000000000000000000000000000000..ae706840a22ca0658fd03e12212aedc1e7a70844 --- /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 0000000000000000000000000000000000000000..845d8325dbd571a36cb4ff5c14e039f137efb432 --- /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 0000000000000000000000000000000000000000..a1e2e085fbde516aee7bb51b0e792c2943e8fcc2 --- /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 0000000000000000000000000000000000000000..6fa1b204e2e24053f22a5161566a766bc81339d9 --- /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 0000000000000000000000000000000000000000..e50999f13d6d7cad853d92d2e9ac483148b075f5 --- /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 0000000000000000000000000000000000000000..14d7cf86b10ec7d537972cb4c9d9732538696a94 --- /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 0000000000000000000000000000000000000000..9a3c5ac948686fbfc4cd0e271bb66c166103b33b --- /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 0000000000000000000000000000000000000000..b2271a983e7f6843a7213ba4fc0fffcc5d0aeb91 --- /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 0000000000000000000000000000000000000000..04ebc59162adcfae22cc7b690abf640d24ac0e2f --- /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 0000000000000000000000000000000000000000..b3b80b5d4b6d6a9fa886cbadf0f17e238ee3eb73 --- /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 0000000000000000000000000000000000000000..3ebc267206e2f8230a7d857389f0b13e4087d58a --- /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 0000000000000000000000000000000000000000..4bfd6f889a26481648ece9e0b093b4171e2a6211 --- /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 0000000000000000000000000000000000000000..4fc8534f7386cb9de4340b05db4785262b369268 --- /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 0000000000000000000000000000000000000000..836ba5323720ae4f6c920e09bb7d00f96201d37e --- /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 0000000000000000000000000000000000000000..c922b2da0dc3594099141d4184d0db835d2ead90 --- /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 0000000000000000000000000000000000000000..e613b2e20ec75532281fef64b63d5ffd6af35c4e --- /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 0000000000000000000000000000000000000000..5d2838c72da4c0f02b745a591402bf52c298110d --- /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 0000000000000000000000000000000000000000..64cd51fe6449b9a8bef71a382d878ca5468c2d81 --- /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 0000000000000000000000000000000000000000..7670296963bfcfabc3cfd97a32290a5b2484234d --- /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 0000000000000000000000000000000000000000..0ceffc62b57c80acc82f9a9bbf4c6f33890c5439 --- /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 0000000000000000000000000000000000000000..43b9c1167d5333b559135b22b4164ea15840e9db --- /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 0000000000000000000000000000000000000000..538c61e40c806125185640e54f23b31cf28868ab --- /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 0000000000000000000000000000000000000000..2f20b49572678afb27682c4eec9fd29a8ae82803 --- /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 0000000000000000000000000000000000000000..9099c4b66ef756275dad55a5642f137ad3710eea --- /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 0000000000000000000000000000000000000000..ed495944b1d661a0227b5bc804b45c7b90229325 --- /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 0000000000000000000000000000000000000000..42480778b8b72a09d12ea83bd12638f3040092ac --- /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 0000000000000000000000000000000000000000..a7fe04bc08b6f532573d85fb2561e5e0af79cdfc --- /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 0000000000000000000000000000000000000000..74fe7d32749164ec63842a73d6dc67b86fd1e31d --- /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 0000000000000000000000000000000000000000..98f7d5474ec47b6a53833393aa8088ad25f48755 --- /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 0000000000000000000000000000000000000000..a866defd61bac449371cd9486264cadb457cae03 --- /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 0000000000000000000000000000000000000000..8cb2be99f136b29a5d245971b955b86ac4ce8f07 --- /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 0000000000000000000000000000000000000000..fa1349db4d2664017efc4ecce26fd28b9803bfbe --- /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 0000000000000000000000000000000000000000..1f8e7b4e20eec57f2a0002787d3aca4f5bc923c8 --- /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 0000000000000000000000000000000000000000..ae48b2276b6660f283c34c3c9821f29f23b3eb56 --- /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 0000000000000000000000000000000000000000..58ea0ba5d3f4fd8d3fd0d21f3f99f34fb5c8df03 --- /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 0000000000000000000000000000000000000000..39b0a53f8ae99c0a01907b0a6e6795d1ddbfcb14 --- /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 0000000000000000000000000000000000000000..854e921edf4d6d44448d1f4035081955189d2e7b --- /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 0000000000000000000000000000000000000000..e2cf4afd6a449cdde7f417530df441af32e52f7c --- /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 0000000000000000000000000000000000000000..a8ea76262ff7bf4feb7ee94b6c8da6cddf12afcd --- /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 0000000000000000000000000000000000000000..0cc5938fd9a1bacf92b57cf2886e3b954a0e28c2 --- /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 0000000000000000000000000000000000000000..f10ab345ed4a975e1a98cf46ec578414c537bdc9 --- /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 0000000000000000000000000000000000000000..af44f1c503a1a8af314a51d942f0fe1da2bb5e61 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IGoogleMapDelegate.aidl @@ -0,0 +1,144 @@ +package com.google.android.gms.maps.internal; + +import android.location.Location; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.maps.model.CameraPosition; +import com.google.android.gms.maps.internal.ICancelableCallback; +import com.google.android.gms.maps.internal.ILocationSourceDelegate; +import com.google.android.gms.maps.internal.IUiSettingsDelegate; +import com.google.android.gms.maps.internal.IProjectionDelegate; +import com.google.android.gms.maps.internal.IOnCameraChangeListener; +import com.google.android.gms.maps.internal.IOnCameraIdleListener; +import com.google.android.gms.maps.internal.IOnCameraMoveCanceledListener; +import com.google.android.gms.maps.internal.IOnCameraMoveListener; +import com.google.android.gms.maps.internal.IOnCameraMoveStartedListener; +import com.google.android.gms.maps.internal.IOnMapClickListener; +import com.google.android.gms.maps.internal.IOnMapLongClickListener; +import com.google.android.gms.maps.internal.IOnMarkerClickListener; +import com.google.android.gms.maps.internal.IOnMarkerDragListener; +import com.google.android.gms.maps.internal.IOnInfoWindowClickListener; +import com.google.android.gms.maps.internal.IInfoWindowAdapter; +import com.google.android.gms.maps.internal.IOnMapLoadedCallback; +import com.google.android.gms.maps.internal.IOnMyLocationChangeListener; +import com.google.android.gms.maps.internal.IOnMyLocationButtonClickListener; +import com.google.android.gms.maps.internal.ISnapshotReadyCallback; +import com.google.android.gms.maps.model.CircleOptions; +import com.google.android.gms.maps.model.GroundOverlayOptions; +import com.google.android.gms.maps.model.LatLngBounds; +import com.google.android.gms.maps.model.MarkerOptions; +import com.google.android.gms.maps.model.MapStyleOptions; +import com.google.android.gms.maps.model.PolygonOptions; +import com.google.android.gms.maps.model.PolylineOptions; +import com.google.android.gms.maps.model.TileOverlayOptions; +import com.google.android.gms.maps.model.internal.IPolylineDelegate; +import com.google.android.gms.maps.model.internal.IPolygonDelegate; +import com.google.android.gms.maps.model.internal.IMarkerDelegate; +import com.google.android.gms.maps.model.internal.ICircleDelegate; +import com.google.android.gms.maps.model.internal.IGroundOverlayDelegate; +import com.google.android.gms.maps.model.internal.ITileOverlayDelegate; + +interface IGoogleMapDelegate { + CameraPosition getCameraPosition() = 0; + + float getMaxZoomLevel() = 1; + float getMinZoomLevel() = 2; + + void moveCamera(IObjectWrapper cameraUpdate) = 3; + void animateCamera(IObjectWrapper cameraUpdate) = 4; + void animateCameraWithCallback(IObjectWrapper cameraUpdate, ICancelableCallback callback) = 5; + void animateCameraWithDurationAndCallback(IObjectWrapper cameraUpdate, int duration, ICancelableCallback callback) = 6; + void stopAnimation() = 7; + + IPolylineDelegate addPolyline(in PolylineOptions options) = 8; + IPolygonDelegate addPolygon(in PolygonOptions options) = 9; + IMarkerDelegate addMarker(in MarkerOptions options) = 10; + IGroundOverlayDelegate addGroundOverlay(in GroundOverlayOptions options) = 11; + ITileOverlayDelegate addTileOverlay(in TileOverlayOptions options) = 12; + + void clear() = 13; + + int getMapType() = 14; + void setMapType(int type) = 15; + boolean isTrafficEnabled() = 16; + void setTrafficEnabled(boolean traffic) = 17; + boolean isIndoorEnabled() = 18; + void setIndoorEnabled(boolean indoor) = 19; + + boolean isMyLocationEnabled() = 20; + void setMyLocationEnabled(boolean myLocation) = 21; + Location getMyLocation() = 22; + void setLocationSource(ILocationSourceDelegate locationSource) = 23; + + IUiSettingsDelegate getUiSettings() = 24; + IProjectionDelegate getProjection() = 25; + + void setOnCameraChangeListener(IOnCameraChangeListener listener) = 26; + void setOnMapClickListener(IOnMapClickListener listener) = 27; + void setOnMapLongClickListener(IOnMapLongClickListener listener) = 28; + void setOnMarkerClickListener(IOnMarkerClickListener listener) = 29; + void setOnMarkerDragListener(IOnMarkerDragListener listener) = 30; + void setOnInfoWindowClickListener(IOnInfoWindowClickListener listener) = 31; + void setInfoWindowAdapter(IInfoWindowAdapter adapter) = 32; + + IObjectWrapper getTestingHelper() = 33; + + ICircleDelegate addCircle(in CircleOptions options) = 34; + + void setOnMyLocationChangeListener(IOnMyLocationChangeListener listener) = 35; + void setOnMyLocationButtonClickListener(IOnMyLocationButtonClickListener listener) = 36; + + void snapshot(ISnapshotReadyCallback callback, IObjectWrapper bitmap) = 37; + + void setPadding(int left, int top, int right, int bottom) = 38; + + boolean isBuildingsEnabled() = 39; + void setBuildingsEnabled(boolean buildings) = 40; + + void setOnMapLoadedCallback(IOnMapLoadedCallback callback) = 41; + + //IIndoorBuildingDelegate getFocusedBuilding() = 43; + //void setIndoorStateChangeListener(IOnIndoorStateChangeListener listener) = 44; + + void setWatermarkEnabled(boolean watermark) = 50; + + //void getMapAsync(IOnMapReadyCallback callback) = 52; + void onCreate(in Bundle savedInstanceState) = 53; + void onResume() = 54; + void onPause() = 55; + void onDestroy() = 56; + void onLowMemory() = 57; + boolean useViewLifecycleWhenInFragment() = 58; + void onSaveInstanceState(out Bundle outState) = 59; + + void setContentDescription(String desc) = 60; + + //void snapshotForTest(ISnapshotReadyCallback callback) = 70; + + //void setPoiClickListener(IOnPoiClickListener listener) = 79; + void onEnterAmbient(in Bundle bundle) = 80; + void onExitAmbient() = 81; + + //void setOnGroundOverlayClickListener(IOnGroundOverlayClickListener listener) = 82; + //void setInfoWindowLongClickListener(IOnInfoWindowLongClickListener listener) = 83; + //void setPolygonClickListener(IOnPolygonClickListener listener) = 84; + //void setInfoWindowCloseListener(IOnInfoWindowCloseListener listener) = 85; + //void setPolylineClickListener(IOnPolylineClickListener listener) = 86; + //void setCircleClickListener(IOnCircleClickListener listener) = 88; + + boolean setMapStyle(in MapStyleOptions options) = 90; + void setMinZoomPreference(float minZoom) = 91; + void setMaxZoomPreference(float maxZoom) = 92; + void resetMinMaxZoomPreference() = 93; + void setLatLngBoundsForCameraTarget(in LatLngBounds bounds) = 94; + + void setCameraMoveStartedListener(IOnCameraMoveStartedListener listener) = 95; + void setCameraMoveListener(IOnCameraMoveListener listener) = 96; + void setCameraMoveCanceledListener(IOnCameraMoveCanceledListener listener) = 97; + void setCameraIdleListener(IOnCameraIdleListener listener) = 98; + + void onStart() = 100; + void onStop() = 101; + + //void setOnMyLocationClickListener(IOnMyLocationClickListener listener) = 106; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/internal/IInfoWindowAdapter.aidl new file mode 100644 index 0000000000000000000000000000000000000000..d11d71d4737169a47d496b940d293c9b54ade832 --- /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 0000000000000000000000000000000000000000..203ec69f12cc3bfccca1432a5ff24ef24ededd45 --- /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 0000000000000000000000000000000000000000..c08c987b4b10717de8cdd06286e3d35b283686fc --- /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 0000000000000000000000000000000000000000..d22db6c64962c0ff55640289967618e2a9ac20e6 --- /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 0000000000000000000000000000000000000000..8abd2929b1609559d91d3daf7d276260c9068178 --- /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 0000000000000000000000000000000000000000..caa686a8a48c0cfe5a256f691abf7c722cba354b --- /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 0000000000000000000000000000000000000000..bb1494e864ac6947f34d37c6b18cfe86cad80f58 --- /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 0000000000000000000000000000000000000000..6b404d65042b19bb9c0c31adf931f1828c3ff11b --- /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 0000000000000000000000000000000000000000..2a5f65d906063b73a154420d22e248cf0a5341c3 --- /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 0000000000000000000000000000000000000000..7c396ce77850405943b73172226583fa41550b6b --- /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 0000000000000000000000000000000000000000..6b3b2ec8de5ea2c1dbd3d998851a9d9b45b59436 --- /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 0000000000000000000000000000000000000000..d3fc105db07148dd43cd8eb1052e9cf878648f9a --- /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 0000000000000000000000000000000000000000..11201b2c3e671b944bc991bf510464582b47cb22 --- /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 0000000000000000000000000000000000000000..1e6760efdcd71a39c8c4c95a7f7d7f553c598ee5 --- /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 0000000000000000000000000000000000000000..94c4465deada6940688afca9883c3d5efce43870 --- /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 0000000000000000000000000000000000000000..b4601a7abddc318e69f9a7f17ab1581691693616 --- /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 0000000000000000000000000000000000000000..b10880dd02f6120db84f0f234d223d9c93010229 --- /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 0000000000000000000000000000000000000000..35a6b6c282f84d5686c9e590883f73ce3f351f35 --- /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 0000000000000000000000000000000000000000..9b2da90bbcc086d33a83dbae1a3d7715683f9cca --- /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 0000000000000000000000000000000000000000..f907e336e541b2e044d4ba1e1f60088bfac2fa90 --- /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 0000000000000000000000000000000000000000..12c781232846c026e015ca0ad31f2079368b3134 --- /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 0000000000000000000000000000000000000000..bb5ab7015224684d5419cedf3717c20ddf66e880 --- /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 0000000000000000000000000000000000000000..33ae45422cdf1ae0b0cbb60d1ad2cb6f808c3bea --- /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 0000000000000000000000000000000000000000..5bdbefafee793ee0c0e82d18d490f485b4daa3b3 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/GroundOverlayOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable GroundOverlayOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MapStyleOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MapStyleOptions.aidl new file mode 100644 index 0000000000000000000000000000000000000000..04312ebf337255e74ba0d6953cb404b613bb65fd --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MapStyleOptions.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.maps.model; + +parcelable MapStyleOptions; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl b/play-services-api/src/main/aidl/com/google/android/gms/maps/model/MarkerOptions.aidl new file mode 100644 index 0000000000000000000000000000000000000000..dc4abbcfda098bde745149b589b5993216ab23d6 --- /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 0000000000000000000000000000000000000000..adac82a082aac9368d524f9c822678d1d78c6774 --- /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 0000000000000000000000000000000000000000..7c1658915e77e6643ea466f6204da1c5d6608901 --- /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 0000000000000000000000000000000000000000..54f1872f14b71ad09ac4c92d13ca2158d2b69a18 --- /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 0000000000000000000000000000000000000000..85f5ac32fd78addd09ce9030dbecdeef30516132 --- /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 0000000000000000000000000000000000000000..09d221015a52c85b351599054989c9d1adfe97a4 --- /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 0000000000000000000000000000000000000000..dca49b60280038c8840ebc9f59acd381eb68d218 --- /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 0000000000000000000000000000000000000000..719d8eab6b3094e799e6a49c0079ee1c92a5c8b6 --- /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 0000000000000000000000000000000000000000..0a1a0632812a9356dc449c7e9da26494716d356d --- /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 0000000000000000000000000000000000000000..ca2d260379d52f5dd1572f8e6ba2ab3f328f09e8 --- /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 0000000000000000000000000000000000000000..67f0517b1a9614ac47b7a881d1fac84bfbef5a72 --- /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 0000000000000000000000000000000000000000..ebbb336bf2729a632a43c7a8155169d2f253d9a6 --- /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 0000000000000000000000000000000000000000..417cb02409a5529f82f00824bb50311e74fe282c --- /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 0000000000000000000000000000000000000000..d6dc516b779db854804e1d05e6ba5784ff0e4950 --- /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 0000000000000000000000000000000000000000..692d414a59b19e82ac1bf6b1c98293627f355e28 --- /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 0000000000000000000000000000000000000000..75db9fae9680bff3d524edad57fd011a4e1b4917 --- /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 0000000000000000000000000000000000000000..62ae147842bbed6ac75d1e1a2f5334ad9467d7a4 --- /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 0000000000000000000000000000000000000000..86169b99ab58d7911a3fb6412262ce3d9a9a349f --- /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 0000000000000000000000000000000000000000..6e7bed5385512ab050c0163be2f0be9643e7f1d0 --- /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 0000000000000000000000000000000000000000..9cc0e0e42e097aaab29df5a110fd339ba8ffbff1 --- /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 0000000000000000000000000000000000000000..7e2121d21b46c8f25a8a0ed93297c82aa84c8301 --- /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 0000000000000000000000000000000000000000..24ae0ffdeb54f7cda6650e8d7ea6d211d8ffa684 --- /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 0000000000000000000000000000000000000000..142ddedfc2e7430bdd5ac4288e0f443ce8b84bff --- /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 0000000000000000000000000000000000000000..ff418443b0b17714e114c6586526a7d32fd40cff --- /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 0000000000000000000000000000000000000000..55ac1beb043cb9fbd4abde2d2d34cfd8e7170750 --- /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 0000000000000000000000000000000000000000..79f91dec00c5d7cd954e493ad1a365787f91cfaa --- /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 0000000000000000000000000000000000000000..5e5506eeba950672b68de234ba54a04c8b71f8df --- /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 0000000000000000000000000000000000000000..2added917c0f2c9cfd11154280a60a09828a9f03 --- /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 0000000000000000000000000000000000000000..f998648407dd01bc587ed09b06fa8846ba44ab91 --- /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 0000000000000000000000000000000000000000..bbb9083679ac65ac9ee9223a1f45903dfc0892d7 --- /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 0000000000000000000000000000000000000000..9a3883c29108556781073ec864ace9637aee0ba2 --- /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 0000000000000000000000000000000000000000..a4c41481f07bb70e442d765e22ae4b6871074c5a --- /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 0000000000000000000000000000000000000000..f1e056b464d4af7e4baf79b7b2f1f1229bcdfbc0 --- /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 0000000000000000000000000000000000000000..9e5456b02945f40790b1ba78aac486cc73fe48f0 --- /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 0000000000000000000000000000000000000000..5b18294d969849f035876d184b48a1a553d95a3f --- /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 0000000000000000000000000000000000000000..fe57be6d96cbcf8865c2c362a62789a9e3a9594b --- /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 0000000000000000000000000000000000000000..7dfc749b8a2ee520304530dbe49037c66ade3d2d --- /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 0000000000000000000000000000000000000000..404544c2d914d4265b0c1385ed5da194ab327215 --- /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 0000000000000000000000000000000000000000..9f718934c43ff0c0a7c29314c0ea44cd4938165f --- /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 0000000000000000000000000000000000000000..11b0a4dc0922f836ac816e13b643b9071e5307b0 --- /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 0000000000000000000000000000000000000000..b2e549d76cbdc0408b9fc7a014fc39018d80ea40 --- /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 0000000000000000000000000000000000000000..a837a7dbb0f6e5e7f23b83c346a1f8a245b92923 --- /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 0000000000000000000000000000000000000000..ad68ef3552853bb5a9d7687328ed4895930ea64a --- /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 0000000000000000000000000000000000000000..7aaa548c6adfb3a4f88efc2218eb149b66691854 --- /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 0000000000000000000000000000000000000000..863b016fdd2eb7654214387646963d57b0e02860 --- /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 0000000000000000000000000000000000000000..fe2073c058c413afe9290915036ebf2c92e02d81 --- /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 0000000000000000000000000000000000000000..426cbe47b96caa6331fad20506d61dfeeec5b04c --- /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 0000000000000000000000000000000000000000..8fdb4567ef1a9372433a91d0848aca2946841e34 --- /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 0000000000000000000000000000000000000000..986ab4db28bb4ab3ab73dc55d2328aedec5ce06e --- /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 0000000000000000000000000000000000000000..86d52a131d03a35c914960a4dfc983c4c99af970 --- /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 0000000000000000000000000000000000000000..8d7382eda4aa64e1195efa4d06b16bb3288dc83d --- /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 0000000000000000000000000000000000000000..ca99ad5f63890360c4305ccb9ecff8285e5f9ce6 --- /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 0000000000000000000000000000000000000000..2bd4d8b3f65bee84fdb7c68b63f26dcefde19cb7 --- /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 0000000000000000000000000000000000000000..ff552760223a1e3344bc761ee69663381eb88e4e --- /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 0000000000000000000000000000000000000000..79cbb179bc0a67ac9d8a51955d9a1f72255a2128 --- /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 0000000000000000000000000000000000000000..a5f2d6d0ea399473222dfd0bd8b9819a97e66031 --- /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 0000000000000000000000000000000000000000..b08d953043a771dbe487923a358903e8f74c967c --- /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 0000000000000000000000000000000000000000..95bc32a7b138e99c36c26d33dff8b7d3ef4f8f34 --- /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 0000000000000000000000000000000000000000..1986e95d2a319faaec5a6ffcbd92adbbc8321bf2 --- /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 0000000000000000000000000000000000000000..97047253c1dd395fad64ff7c0b6e58a61344f606 --- /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 0000000000000000000000000000000000000000..8bcb891ee28af3b5ab899c0ff40342ec01c2f4e8 --- /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 0000000000000000000000000000000000000000..091cdae56228aa29158cccfc168f5418d18bce8b --- /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 0000000000000000000000000000000000000000..622b0ba78cf153f1c884fa66bedbfc6428a38989 --- /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 0000000000000000000000000000000000000000..d9cb9209c710f553ba1b2cca077bb76a1db41e8c --- /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 0000000000000000000000000000000000000000..6269896b959e3c264c94ec2bc0bb0a409e261839 --- /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 0000000000000000000000000000000000000000..689e5918a46903c622618a3e62575a3f1423af1f --- /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 0000000000000000000000000000000000000000..d6c1fc316e116b00c21509d8ec6194e2ecbad8ee --- /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 0000000000000000000000000000000000000000..447f9f4a823d35a8abb52b5e3964092b00af12ee --- /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 0000000000000000000000000000000000000000..c4d45cdd122b7016588424c1350fb238aa7fbd28 --- /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 0000000000000000000000000000000000000000..a5aaa18765ee0dfb8413b21140ce7dfa83829777 --- /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 0000000000000000000000000000000000000000..21e00b1c8a14089c602665aef892f33475252e3b --- /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 0000000000000000000000000000000000000000..9ae649d0e6d625998e91d2d33545312cef6d6e3d --- /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 0000000000000000000000000000000000000000..5806bc358ac9ec357ac37a3aa41fb74a27764f4d --- /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 0000000000000000000000000000000000000000..08d6df187ef7d4e3eaac7a62716c4397c18b4f65 --- /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 0000000000000000000000000000000000000000..5c71ea0ce1894dfaf0e29c9a9e4d63d37c2e86ec --- /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 0000000000000000000000000000000000000000..2f8a596f19f428baf4e0889997cfa86443435f8b --- /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 0000000000000000000000000000000000000000..d542f48f72cbb662675c1a65af46e61178737e10 --- /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 0000000000000000000000000000000000000000..1be52c8f2080deb6e8879cc45900ca2e7b82103f --- /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 0000000000000000000000000000000000000000..720f773ca916171a29853d4aa18356fd0bc87162 --- /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 0000000000000000000000000000000000000000..fec25f00642e6eee3f3b75921f66f35912616832 --- /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 0000000000000000000000000000000000000000..0f80a05393e943614b040e4772d4c31b8a75ff18 --- /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 0000000000000000000000000000000000000000..f616d51daa510080ba6bfcef7dbecb4b7d3b0721 --- /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 0000000000000000000000000000000000000000..a2f0f9e738e39778c5ac0d94452e99809b7ce8d2 --- /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 0000000000000000000000000000000000000000..0485f3a2e7d12272dbb45cb66557318622764c9e --- /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 0000000000000000000000000000000000000000..0d7f5cd8f33ed242500c708f456a2918e60b5024 --- /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 0000000000000000000000000000000000000000..0bff57a8f7ba366a7ab23836bb3337a404068697 --- /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 0000000000000000000000000000000000000000..3b7d45f531d4ff7a37d7daaa20d56ca18ec201f2 --- /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 0000000000000000000000000000000000000000..13ee988edc903dbf24835d262a5955b56759e1c8 --- /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 0000000000000000000000000000000000000000..67d66c05bf337f422389fd2a0982e1c69efd1015 --- /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 0000000000000000000000000000000000000000..80819c714db59bb8d1df57c082fdc1901a044267 --- /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 0000000000000000000000000000000000000000..2ef78f95b5e463205b3888334308acb0b7578881 --- /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 0000000000000000000000000000000000000000..bd7ae6f2413896a964362403fee7583f9fb83745 --- /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 0000000000000000000000000000000000000000..3da7a72add012dea776cac5259ef7e5112a564ae --- /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 0000000000000000000000000000000000000000..5ec25998913ca7f81404d3e8e0f7d2375aabbbc3 --- /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 0000000000000000000000000000000000000000..6c73b4bcccb8271f284723a6fdd7e15776137124 --- /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 0000000000000000000000000000000000000000..cd56eb1ae90e44afd96cc8a75cc53da8ca052261 --- /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 0000000000000000000000000000000000000000..c7db433b29df17e6c69d3cd0bde7ad670bc4100e --- /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 0000000000000000000000000000000000000000..4a200050efc78c9a0f6e26c03bb962b816887416 --- /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 0000000000000000000000000000000000000000..999e9a96e793c8d577d80b2c95dfaa4eab90e5f0 --- /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 0000000000000000000000000000000000000000..0091dee5a7edf5b5fe10299afc3875bc5cefa203 --- /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 0000000000000000000000000000000000000000..139bf29b70c759c3b874de859590aa316685e513 --- /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 0000000000000000000000000000000000000000..4b57130dcd7d0c8b06023ddd2ed2ddd3ac2fa03a --- /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 0000000000000000000000000000000000000000..9e339e8128e0f6e2d492a22d728f299f2a12ac71 --- /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 0000000000000000000000000000000000000000..9563798eae450f7e31b15994c964d59174b19e07 --- /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 0000000000000000000000000000000000000000..81042a97de86d3dc35361274af2bc68b18096ba7 --- /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 0000000000000000000000000000000000000000..826d1c371f44ea59a4b69ca478578319afffcae5 --- /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 0000000000000000000000000000000000000000..c82402790b4fac1c5427e3ef4ead9bd63a56630c --- /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/common/server/FavaDiagnosticsEntity.java b/play-services-api/src/main/java/com/google/android/gms/common/server/FavaDiagnosticsEntity.java new file mode 100644 index 0000000000000000000000000000000000000000..6f10959a3045f464cee57bbeed4855f90928fb52 --- /dev/null +++ b/play-services-api/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-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 0000000000000000000000000000000000000000..bce9276b60c04dda5deef687903a2731f920aeb2 --- /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 0000000000000000000000000000000000000000..559d52d3b5459445e4a70658a6af82ab23b47e06 --- /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 0000000000000000000000000000000000000000..b99fb5f84b97c1878b13195ee7ebc1cd26d26324 --- /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 0000000000000000000000000000000000000000..fb18670d2862c9a33bab7604a46efe72db98f95e --- /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 0000000000000000000000000000000000000000..a7e4630ac671969456e4735726b334c1e8b85537 --- /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 0000000000000000000000000000000000000000..70892fac741b4f498ebc02302c6a2e5e7339b6e5 --- /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 0000000000000000000000000000000000000000..3a43cad49e476dbfd70f6a27a805a3c0a1e31391 --- /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 0000000000000000000000000000000000000000..d892262f5f3fe00fb8fe7eb2eb4060ef82787fd6 --- /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 0000000000000000000000000000000000000000..cb5e8e653ef9863ce93344d6842e42e9012eb674 --- /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 0000000000000000000000000000000000000000..334c98d880563257f4010d3dddc98bba42156b57 --- /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 0000000000000000000000000000000000000000..f59029b8758e0ce55d3e8a1dde077fded7d5cb42 --- /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 0000000000000000000000000000000000000000..2812eb27d41bb334daa373813f594390daa94cdf --- /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 0000000000000000000000000000000000000000..46b5c4195fcb9b06e6e6f9cf8237c4f4bd813a81 --- /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 0000000000000000000000000000000000000000..260283eb38f00fa0a00d6e727ec8285f20d08c6b --- /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 0000000000000000000000000000000000000000..0e914da0b2ecc8b0db4b650d27de34259b355ab8 --- /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 0000000000000000000000000000000000000000..b1e7e79cb90c507ca7bac43c91dccd91d75e7364 --- /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 0000000000000000000000000000000000000000..562d7b372fa15600cb1a4a131637452712c52647 --- /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 0000000000000000000000000000000000000000..c2aae15f4e383ec0155e7c7126558eacd6eb1171 --- /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 0000000000000000000000000000000000000000..abbebd3863c952ca7bdf6430445db4a5d79d9d01 --- /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 0000000000000000000000000000000000000000..52d2a5ec3d26ca476476db8df8f364811f1cd76c --- /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 0000000000000000000000000000000000000000..7aaf7c63bc9a6d15d1b995ebd761eaed8568e42a --- /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 0000000000000000000000000000000000000000..3a96d337ece385962374a8c895e00e46fd7d0a5d --- /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 0000000000000000000000000000000000000000..40cb34d5f30833e4aaefa5c56a8c7d8f7893a204 --- /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 0000000000000000000000000000000000000000..6e83957a7c4ff5be74936ced86ad102979dd2bae --- /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 0000000000000000000000000000000000000000..5b8c5c145a1794a541396fc0eba455f0101c6ca7 --- /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 0000000000000000000000000000000000000000..99499f52f9578d0771ce8a614c764acbe530d233 --- /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 0000000000000000000000000000000000000000..6d338d2ee27b1232e2b05c82c8ee4429624e7344 --- /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 0000000000000000000000000000000000000000..cb56b4f51aab1fd99215bd734b1accd10f6cfbea --- /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 0000000000000000000000000000000000000000..8f0e8c4f0d0347d56ea3c9fe9d2adc8038387e23 --- /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 0000000000000000000000000000000000000000..d63fa651477768118225cdd1d486ab7c193575c6 --- /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 0000000000000000000000000000000000000000..b407068a3497260d60a0deba233cc6ddf4229a57 --- /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 0000000000000000000000000000000000000000..a641348321d2fdc799d7be5aaaa5257df088302d --- /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 0000000000000000000000000000000000000000..b417a6044b3f7724aef4dd8de9fed97ba6cea478 --- /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 0000000000000000000000000000000000000000..e0c532cd6b1fe16c96fecd53d8e1675712e9c32b --- /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 0000000000000000000000000000000000000000..fd326195486e3ad906cb3f153697fec352a2f4bc --- /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 0000000000000000000000000000000000000000..8d6ec09324e4aad77f668ebb4ab3062aaef45dce --- /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 0000000000000000000000000000000000000000..61e1e656ca53b0268865f1d14d85e3d916d21526 --- /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 0000000000000000000000000000000000000000..478a880064b74c83a8084c65f4a458d72b95ec77 --- /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 0000000000000000000000000000000000000000..de7df0662129914d89947ca79f8bbdb10fa67f80 --- /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 0000000000000000000000000000000000000000..e9d152f5f326b78400e401c403fadadce8dd8e74 --- /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 0000000000000000000000000000000000000000..3a0a03c2f5be405075d3457d3e7f79f08f280def --- /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 0000000000000000000000000000000000000000..8df27d1fe9e0a6049a466b6b3bc2a77904fad1dd --- /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 0000000000000000000000000000000000000000..1db6cd07e4f20a7cd7a516559186031a846e219d --- /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 0000000000000000000000000000000000000000..44a1bad1dd994e20b3a4dbec8eaff52140e8030e --- /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 0000000000000000000000000000000000000000..cdb9827cedf453158f57c48e6f8d0b13f198f9e2 --- /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 0000000000000000000000000000000000000000..084a1e7a8f1f82702ef8efcf46c663ea641e6ba4 --- /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 0000000000000000000000000000000000000000..767de36d3feadffa0a20445414957658707e9737 --- /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 0000000000000000000000000000000000000000..83c8227444cabe1168921804b3e77b5dad235c6e --- /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 0000000000000000000000000000000000000000..38728f08f4b4eaaba3f0694f2f9183dfe1b7e848 --- /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 0000000000000000000000000000000000000000..aed23394c907da91e04654e580764ebe934917e2 --- /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 0000000000000000000000000000000000000000..bfb8f7be3992e213fd92b0e17a3914b9dd6a4354 --- /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 0000000000000000000000000000000000000000..61cfed641b5d79b66646c5073802c31b45e66567 --- /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 0000000000000000000000000000000000000000..cce6e6ae8d62367988dba828175e49a43edb45b3 --- /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 0000000000000000000000000000000000000000..f71093f400837483975e17b0a4572475768ad181 --- /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 0000000000000000000000000000000000000000..61587e3a6cc444b3fe6183dfd6813f3a31f0a7ba --- /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 0000000000000000000000000000000000000000..9752627e141c8630d56cb1368b26b4810e8c9db7 --- /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 0000000000000000000000000000000000000000..cc63ed7bac1732cbfe75f27f7ab397325e1d12c1 --- /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 0000000000000000000000000000000000000000..9566ef237036e6c4af31234e35ad045d7dacd830 --- /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 0000000000000000000000000000000000000000..e0e56bb79a0dbbcc08621b671583f777f2770fd0 --- /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 0000000000000000000000000000000000000000..fc1b706cd5cebdba179eae2bb6fee03844919cfa --- /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 0000000000000000000000000000000000000000..f6716de39ecb09e75416f4829da58ee82abffe6c --- /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 0000000000000000000000000000000000000000..d909cbf327e496d3ba4475243da8d426f86b3a73 --- /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 0000000000000000000000000000000000000000..b9770e36dc24c11998d713b040016d55c673e1ac --- /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 0000000000000000000000000000000000000000..aa3959f2016b437bf5b69ca588d2f1e51d6988d4 --- /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 0000000000000000000000000000000000000000..405f31d11714a6344f88aac2d3cd0d05c47f0a4c --- /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 0000000000000000000000000000000000000000..e59c79355f970e00853783c9a28a41bb641fee8a --- /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 0000000000000000000000000000000000000000..9d31c1338dd3a96930a89529942f0f5e53c3f61e --- /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 0000000000000000000000000000000000000000..881c8abb8610c07cbfe2b23594c4ecadc264fef6 --- /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 0000000000000000000000000000000000000000..c6fbe415c20912c648dd32bcff018a51506be04e --- /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 0000000000000000000000000000000000000000..9f61106023db2e59b13f7a09d3472ce8ca4fa62a --- /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 0000000000000000000000000000000000000000..b29afdf75e2144ffb29738b39a21cf4a5ecf7688 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/GroundOverlayOptions.java @@ -0,0 +1,341 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.os.IBinder; + +import com.google.android.gms.dynamic.ObjectWrapper; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +/** + * Defines options for a ground overlay. + */ +@PublicApi +public class GroundOverlayOptions extends AutoSafeParcelable { + /** + * Flag for when no dimension is specified for the height. + */ + public static final float NO_DIMENSION = -1; + + @SafeParceled(1) + private int versionCode; + @SafeParceled(2) + private IBinder image; + private BitmapDescriptor imageDescriptor; + @SafeParceled(3) + private LatLng location; + @SafeParceled(4) + private float width; + @SafeParceled(5) + private float height; + @SafeParceled(6) + private LatLngBounds bounds; + @SafeParceled(7) + private float bearing; + @SafeParceled(8) + private float zIndex; + @SafeParceled(9) + private boolean visible; + @SafeParceled(10) + private float transparency = 0; + @SafeParceled(11) + private float anchorU; + @SafeParceled(12) + private float anchorV; + + /** + * Creates a new set of ground overlay options. + */ + public GroundOverlayOptions() { + } + + /** + * Specifies the anchor to be at a particular point in the image. + *

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

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

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

+ * To load an image as a texture (which is used to draw the image on a map), it must be + * converted into an image with sides that are powers of two. This is so that a mipmap can be + * created in order to render the texture at various zoom levels - see + * Mipmap (Wikipedia) for details. Hence, to + * conserve memory by avoiding this conversion, it is advised that the dimensions of the image + * are powers of two. + * + * @param image the {@link BitmapDescriptor} to use for this ground overlay + * @return this {@link GroundOverlayOptions} object with a new image set. + */ + public GroundOverlayOptions image(BitmapDescriptor image) { + this.imageDescriptor = image; + this.image = imageDescriptor.getRemoteObject().asBinder(); + return this; + } + + /** + * Gets the visibility setting for this options object. + * + * @return {@code true} if the ground overlay is to be visible; {@code false} if it is not. + */ + public boolean isVisible() { + return visible; + } + + /** + * Specifies the position for this ground overlay using an anchor point (a {@link LatLng}), + * width and height (both in meters). When rendered, the image will be scaled to fit the + * dimensions specified (i.e., its proportions will not necessarily be preserved). + * + * @param location the location on the map {@code LatLng} to which the anchor point in the + * given image will remain fixed. The anchor will remain fixed to the position + * on the ground when transformations are applied (e.g., setDimensions, + * setBearing, etc.). + * @param width the width of the overlay (in meters) + * @param height the height of the overlay (in meters) + * @return this {@link GroundOverlayOptions} object with a new position set. + * @throws IllegalArgumentException if anchor is null + * @throws IllegalArgumentException if width or height are negative + * @throws IllegalStateException if the position was already set using + * {@link #positionFromBounds(LatLngBounds)} + */ + public GroundOverlayOptions position(LatLng location, float width, float height) + throws IllegalArgumentException, IllegalStateException { + position(location, width); + if (height < 0) + throw new IllegalArgumentException("height must not be negative"); + this.height = height; + return this; + } + + /** + * Specifies the position for this ground overlay using an anchor point (a {@link LatLng}) and + * the width (in meters). When rendered, the image will retain its proportions from the bitmap, + * i.e., the height will be calculated to preserve the original proportions of the image. + * + * @param location the location on the map {@link LatLng} to which the anchor point in the + * given image will remain fixed. The anchor will remain fixed to the position + * on the ground when transformations are applied (e.g., setDimensions, + * setBearing, etc.). + * @param width the width of the overlay (in meters). The height will be determined + * automatically based on the image proportions. + * @return this {@link GroundOverlayOptions} object with a new position set. + * @throws IllegalArgumentException if anchor is null + * @throws IllegalArgumentException if width is negative + * @throws IllegalStateException if the position was already set using + * {@link #positionFromBounds(LatLngBounds)} + */ + public GroundOverlayOptions position(LatLng location, float width) + throws IllegalArgumentException, IllegalStateException { + if (location == null) + throw new IllegalArgumentException("location must not be null"); + if (width < 0) + throw new IllegalArgumentException("width must not be negative"); + if (bounds != null) + throw new IllegalStateException("Position already set using positionFromBounds()"); + this.location = location; + this.width = width; + return this; + } + + /** + * Specifies the position for this ground overlay. When rendered, the image will be scaled to + * fit the bounds (i.e., its proportions will not necessarily be preserved). + * + * @param bounds a {@link LatLngBounds} in which to place the ground overlay + * @return this {@link GroundOverlayOptions} object with a new position set. + * @throws IllegalStateException if the position was already set using + * {@link #position(LatLng, float)} or + * {@link #position(LatLng, float, float)} + */ + public GroundOverlayOptions positionFromBounds(LatLngBounds bounds) + throws IllegalStateException { + if (location != null) + throw new IllegalStateException("Position already set using position()"); + this.bounds = bounds; + return this; + } + + /** + * Specifies the transparency of the ground overlay. The default transparency is {code 0} + * (opaque). + * + * @param transparency a float in the range {@code [0..1]} where {@code 0} means that the + * ground overlay is opaque and {code 1} means that the ground overlay is + * transparent + * @return this {@link GroundOverlayOptions} object with a new visibility setting. + * @throws IllegalArgumentException if the transparency is outside the range [0..1]. + */ + public GroundOverlayOptions transparency(float transparency) throws IllegalArgumentException { + if (transparency < 0 || transparency > 1) + throw new IllegalArgumentException("transparency must be in range [0..1]"); + this.transparency = transparency; + return this; + } + + /** + * Specifies the visibility for the ground overlay. The default visibility is {@code true}. + * + * @return this {@link GroundOverlayOptions} object with a new visibility setting. + */ + public GroundOverlayOptions visible(boolean visible) { + this.visible = visible; + return this; + } + + /** + * Specifies the ground overlay's zIndex, i.e., the order in which it will be drawn. See the + * documentation at the top of this class for more information about zIndex. + * + * @return this {@link GroundOverlayOptions} object with a new zIndex set. + */ + public GroundOverlayOptions zIndex(float zIndex) { + this.zIndex = zIndex; + return this; + } + + public static Creator CREATOR = new AutoCreator(GroundOverlayOptions.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/MapStyleOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/MapStyleOptions.java new file mode 100644 index 0000000000000000000000000000000000000000..c2ebb01d388d914f9b09852bb93a19c0854c8d1d --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/maps/model/MapStyleOptions.java @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2020 e Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.android.gms.maps.model; + +import android.os.IBinder; +import com.google.android.gms.dynamic.ObjectWrapper; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +@PublicApi +public class MapStyleOptions extends AutoSafeParcelable { + + @SafeParceled(1) + private int versionCode = 1; + @SafeParceled(2) + private String json; + + public MapStyleOptions() { + } + + public MapStyleOptions (String json) { + this.json = json; + } + + public String getJson() { + return this.json; + } + + public static Creator CREATOR = new AutoCreator(MapStyleOptions.class); + +} diff --git a/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java b/play-services-api/src/main/java/com/google/android/gms/maps/model/MarkerOptions.java new file mode 100644 index 0000000000000000000000000000000000000000..a950cd3431a80cbc510eff7b1960c874de4d01c2 --- /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 0000000000000000000000000000000000000000..94fca7e196eeb2240b4f53185560f9fc3430430f --- /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 0000000000000000000000000000000000000000..d9a9dc5b4225cf448b4d51472bbeb9a251bc1a26 --- /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 0000000000000000000000000000000000000000..2737de9dd4c48985dbbe51d26c5913bcb081c7d2 --- /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 0000000000000000000000000000000000000000..2dfcbd0338536eea9153a38ac05e9d313b1d9d0e --- /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 0000000000000000000000000000000000000000..b1254689df012f1620977e1b826804a33e7bfa80 --- /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 0000000000000000000000000000000000000000..fa7f657fadd788fac85775bad3aceddb50bf4d5f --- /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 0000000000000000000000000000000000000000..3f0deea57b1a7469c59e77801525774c59b301fa --- /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 0000000000000000000000000000000000000000..1fdffe3625e602974b693628d065d4fa73a30a5b --- /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 0000000000000000000000000000000000000000..9a1e930da4f05c29607a9caf2953ad2fc21bc556 --- /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 0000000000000000000000000000000000000000..93c4d813d7785a380baf25ad8f8636fce986ff64 --- /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 0000000000000000000000000000000000000000..8c40c393071c1fb0cc255d17868aef4d48aefec7 --- /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 0000000000000000000000000000000000000000..61180fd4d2eb574bdfd9445ac074a925cea5f15b --- /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 0000000000000000000000000000000000000000..814a6574c9c637f8873d1e49eccbf2934ac0cb82 --- /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 0000000000000000000000000000000000000000..b03af386c7bb0c9c9c431a936e45cb85c067b92a --- /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 0000000000000000000000000000000000000000..791c19b879b9dcf2d6ec306846e8aa17af4b2e8b --- /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 0000000000000000000000000000000000000000..ca31fb9b2831b6815e1117a3b4c606784ae61e3a --- /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 0000000000000000000000000000000000000000..72d908e3a1ef4c0f3755ee6119f2e96c4da3ab0f --- /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 0000000000000000000000000000000000000000..b5b3f8a0fdc1c50750f88b5791561ff4b20a9fa2 --- /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 0000000000000000000000000000000000000000..aee4d0b6e3a728a03968098c016ee985165f089a --- /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 0000000000000000000000000000000000000000..bf6c967074c4da83d747ee27fe5c8216a857dca6 --- /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 0000000000000000000000000000000000000000..c45512d4fb6e9855e5ba7b8566f8f8cc136e4138 --- /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 0000000000000000000000000000000000000000..4c108aa5e3dc11a2ff11695e808dc0928063f748 --- /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 0000000000000000000000000000000000000000..37a215c097f3258460b83d3082d6ef74bfcefc6a --- /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 0000000000000000000000000000000000000000..3b9c34665a0ea929df04a861d28a5c111b762171 --- /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 0000000000000000000000000000000000000000..a7045a3c4db54d5387c83a3439c14b66141fc243 --- /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 0000000000000000000000000000000000000000..4ad0101f7facc09f5c62a494cc3870c9237d477a --- /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 0000000000000000000000000000000000000000..cc0d81c6e2688e5ee9b84eee1084cb3ff123beb1 --- /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 0000000000000000000000000000000000000000..fd69c55ac5679f18f059a06dc7559af72f681103 --- /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 0000000000000000000000000000000000000000..e6a4eba3950b3da01a62ed163c6f849bc871c550 --- /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 0000000000000000000000000000000000000000..ae7087468c30363c74c720c78aed3731a5c472cc --- /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 0000000000000000000000000000000000000000..29ee864e8b263e68468db6cc0d0519f600911048 --- /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 0000000000000000000000000000000000000000..4062335a4f0b2dc6087a23f97a727c29c2116854 --- /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 0000000000000000000000000000000000000000..1816b1f3c2a9b06e2c43f726caf4acdb533fd200 --- /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 0000000000000000000000000000000000000000..4f1272912eab4fe79f5d5e916d1da53828ac3f94 --- /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 0000000000000000000000000000000000000000..7ac285fee2ccaea8f0844e258fb73bb55ea2d162 --- /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 0000000000000000000000000000000000000000..80fc8c5ceca123ded1ffefffcf80d98066796aa5 --- /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 0000000000000000000000000000000000000000..8e91b86950e87198f31a9001607336360a2c791a --- /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 0000000000000000000000000000000000000000..2da15091871b3b99e06e89b9b695013fa207a1f6 --- /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 0000000000000000000000000000000000000000..051a5332597ec30952c74ca07da050a69632c2fd --- /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 0000000000000000000000000000000000000000..2611d67ea9d4997972f4bf44d47385dce2f104df --- /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 0000000000000000000000000000000000000000..4fa3396b89bba73b37d556a7345e930a8425b3c7 --- /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 0000000000000000000000000000000000000000..cf25d6a77de0f46c3215e348e8d6201f6b891e1a --- /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 0000000000000000000000000000000000000000..6cc364e9a557a30a4dceb1aaa7c54f04c1889fc5 --- /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 0000000000000000000000000000000000000000..6fa3ef70de7da82596a72f3693032c4336da59d0 --- /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 0000000000000000000000000000000000000000..6c062611004ca52c2d48768f162b7fc7fb026b87 --- /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 0000000000000000000000000000000000000000..3aa8e3b242fed45c38971f0843806873e0772617 --- /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 0000000000000000000000000000000000000000..3df0a0ccc12f374dde0f50818ed0a4bf475e0628 --- /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 0000000000000000000000000000000000000000..cd98184a6e7e639a9db5cec8501735d8f99bf5db --- /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 0000000000000000000000000000000000000000..dd6982f21f7b6ba723790c041ee5dd04ce686827 --- /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 0000000000000000000000000000000000000000..17fb679faa3bcb6a59beb3a613cd5b4be3a74877 --- /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 0000000000000000000000000000000000000000..4e4fe7b625ffeba9c4eddd68a403a273ff275b63 --- /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 0000000000000000000000000000000000000000..c9671038fa369af70229d3558ff689d38274cbff --- /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 0000000000000000000000000000000000000000..b3f42a2165e06c95019d058f5e74dcf4ddf7fe5a --- /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 0000000000000000000000000000000000000000..a3f1ce55df2fdfd060ebcaffbb1e4ec65813f22b --- /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 0000000000000000000000000000000000000000..4b72c85d4795f8cb4fc5d657cbfafa780aef71b8 --- /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 0000000000000000000000000000000000000000..290467b2cf3ab789080baf3ead2cf4ff85c462db --- /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 0000000000000000000000000000000000000000..cfd0fd7c1d113a9286d2bdf1c4f08b2ba9336882 --- /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 0000000000000000000000000000000000000000..301d0771192ce576b9025aa4b892275a8e9f6332 --- /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-appinvite b/play-services-appinvite deleted file mode 120000 index 3147eb928fc9a8902b6ba209911597ab0de7d457..0000000000000000000000000000000000000000 --- a/play-services-appinvite +++ /dev/null @@ -1 +0,0 @@ -extern/GmsLib/play-services-appinvite \ No newline at end of file diff --git a/play-services-appinvite-api b/play-services-appinvite-api deleted file mode 120000 index e6b639d2f5929e9521e04ab7b513cb6e05949777..0000000000000000000000000000000000000000 --- a/play-services-appinvite-api +++ /dev/null @@ -1 +0,0 @@ -extern/GmsApi/play-services-appinvite-api/ \ No newline at end of file diff --git a/play-services-appinvite-api/build.gradle b/play-services-appinvite-api/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..32edbc9b62625076052db314b1d5a6fca19312e1 --- /dev/null +++ b/play-services-appinvite-api/build.gradle @@ -0,0 +1,49 @@ +/* + * Copyright 2019 e Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +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) +} + +group = 'org.microg' +version = getMyVersionName() + +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-basement') +} diff --git a/play-services-appinvite-api/gradle.properties b/play-services-appinvite-api/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..7215aee4535c5ae8c58624ba4cd2c9d115b61027 --- /dev/null +++ b/play-services-appinvite-api/gradle.properties @@ -0,0 +1,34 @@ +# +# Copyright 2019 e Foundation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +POM_NAME=Play Services Internal AppInvite 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=alexandruchircu +POM_DEVELOPER_NAME=Alexandru Chircu + diff --git a/play-services-appinvite-api/src/main/AndroidManifest.xml b/play-services-appinvite-api/src/main/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..da7741f921144e08a87dccac942b2cd0d198892f --- /dev/null +++ b/play-services-appinvite-api/src/main/AndroidManifest.xml @@ -0,0 +1,18 @@ + + + + diff --git a/play-services-appinvite-api/src/main/aidl/com/google/android/gms/appinvite/internal/IAppInviteCallbacks.aidl b/play-services-appinvite-api/src/main/aidl/com/google/android/gms/appinvite/internal/IAppInviteCallbacks.aidl new file mode 100644 index 0000000000000000000000000000000000000000..66c64d7e97df49784d910af808caf039d7430754 --- /dev/null +++ b/play-services-appinvite-api/src/main/aidl/com/google/android/gms/appinvite/internal/IAppInviteCallbacks.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.appinvite.internal; + + +import com.google.android.gms.common.api.Status; +import android.content.Intent; + + +interface IAppInviteCallbacks { + void onStatus(in Status status) = 0; + void onStatusIntent(in Status status, in Intent intent) = 1; +} diff --git a/play-services-appinvite-api/src/main/aidl/com/google/android/gms/appinvite/internal/IAppInviteService.aidl b/play-services-appinvite-api/src/main/aidl/com/google/android/gms/appinvite/internal/IAppInviteService.aidl new file mode 100644 index 0000000000000000000000000000000000000000..630edd43eb169ae89fdc3f9341ee07ebb2041ff4 --- /dev/null +++ b/play-services-appinvite-api/src/main/aidl/com/google/android/gms/appinvite/internal/IAppInviteService.aidl @@ -0,0 +1,14 @@ +package com.google.android.gms.appinvite.internal; + + +import com.google.android.gms.appinvite.internal.IAppInviteCallbacks; + +import com.google.android.gms.dynamic.IObjectWrapper; +import com.google.android.gms.common.api.Status; + + +interface IAppInviteService { + void updateInvitationOnInstall(IAppInviteCallbacks callback, String invitationId) = 0; + void convertInvitation(IAppInviteCallbacks callback, String invitationId) = 1; + void getInvitation(IAppInviteCallbacks callback) = 2; +} diff --git a/play-services-base b/play-services-base deleted file mode 120000 index 972776e9cc2dfb49d64122833d24102cb49cb2ca..0000000000000000000000000000000000000000 --- 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-api/build.gradle b/play-services-base-api/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..70d9d6241c388a84122a5b6eb959d57d226b59b9 --- /dev/null +++ b/play-services-base-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' + +dependencies { + api project(':play-services-basement') +} + +android { + compileSdkVersion androidCompileSdk + buildToolsVersion "$androidBuildVersionTools" + + aidlPackageWhiteList "com/google/android/gms/common/data/DataHolder.aidl" + aidlPackageWhiteList "com/google/android/gms/common/images/WebImage.aidl" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} diff --git a/play-services-base-api/src/main/AndroidManifest.xml b/play-services-base-api/src/main/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..7c8eeef38bc4f00bba5369a2631cd449adb2fde8 --- /dev/null +++ b/play-services-base-api/src/main/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + diff --git a/play-services-base-api/src/main/aidl/com/google/android/gms/common/api/internal/IStatusCallback.aidl b/play-services-base-api/src/main/aidl/com/google/android/gms/common/api/internal/IStatusCallback.aidl new file mode 100644 index 0000000000000000000000000000000000000000..6355a13b4a96501f863607b64a0dae8b31293f62 --- /dev/null +++ b/play-services-base-api/src/main/aidl/com/google/android/gms/common/api/internal/IStatusCallback.aidl @@ -0,0 +1,7 @@ +package com.google.android.gms.common.api.internal; + +import com.google.android.gms.common.api.Status; + +interface IStatusCallback { + void onResult(in Status status); +} diff --git a/play-services-base-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl b/play-services-base-api/src/main/aidl/com/google/android/gms/common/data/DataHolder.aidl new file mode 100644 index 0000000000000000000000000000000000000000..3bbd1174457e0573ae3cad485e00f93b31bda12d --- /dev/null +++ b/play-services-base-api/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-base-api/src/main/aidl/com/google/android/gms/common/images/WebImage.aidl b/play-services-base-api/src/main/aidl/com/google/android/gms/common/images/WebImage.aidl new file mode 100644 index 0000000000000000000000000000000000000000..e31f15abdd48676fb1e5b7cb22f50ccc086126ea --- /dev/null +++ b/play-services-base-api/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-base-api/src/main/java/com/google/android/gms/auth/api/signin/GoogleSignInAccount.java b/play-services-base-api/src/main/java/com/google/android/gms/auth/api/signin/GoogleSignInAccount.java new file mode 100644 index 0000000000000000000000000000000000000000..802db9a361e100593db14758da8c6369e7551789 --- /dev/null +++ b/play-services-base-api/src/main/java/com/google/android/gms/auth/api/signin/GoogleSignInAccount.java @@ -0,0 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.auth.api.signin; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GoogleSignInAccount extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(GoogleSignInAccount.class); +} diff --git a/play-services-base-api/src/main/java/com/google/android/gms/common/data/DataHolder.java b/play-services-base-api/src/main/java/com/google/android/gms/common/data/DataHolder.java new file mode 100644 index 0000000000000000000000000000000000000000..2867e4139d217f749f5634b3a883aac61fe23c6a --- /dev/null +++ b/play-services-base-api/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-base-api/src/main/java/com/google/android/gms/common/data/Freezable.java b/play-services-base-api/src/main/java/com/google/android/gms/common/data/Freezable.java new file mode 100644 index 0000000000000000000000000000000000000000..51f4847ea5db698d4c1683d1b22c331bf1ec6b28 --- /dev/null +++ b/play-services-base-api/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-base-api/src/main/java/com/google/android/gms/common/images/WebImage.java b/play-services-base-api/src/main/java/com/google/android/gms/common/images/WebImage.java new file mode 100644 index 0000000000000000000000000000000000000000..c8f8f2a26a6900708bca4ccf9991f5af538a0189 --- /dev/null +++ b/play-services-base-api/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-base-core/build.gradle b/play-services-base-core/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..a534bc6430b4a6a8d94813c05ab5ccfc8e67ec7f --- /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 0000000000000000000000000000000000000000..13255d7c5078b644eae8cd514077757a63c44ce4 --- /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/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-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java b/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java new file mode 100644 index 0000000000000000000000000000000000000000..3c2a7dbea9c0de6515ee446ae28e88a524e51948 --- /dev/null +++ b/play-services-base-core/src/main/java/org/microg/gms/common/ForegroundServiceContext.java @@ -0,0 +1,79 @@ +package org.microg.gms.common; + +import android.app.ActivityManager; +import android.app.Notification; +import android.app.NotificationChannel; +import android.app.NotificationManager; +import android.app.Service; +import android.content.ComponentName; +import android.content.Context; +import android.content.ContextWrapper; +import android.content.Intent; +import android.os.Build; +import android.os.PowerManager; +import android.util.Log; + +import androidx.annotation.RequiresApi; + +import java.util.List; + +public class ForegroundServiceContext extends ContextWrapper { + private static final String TAG = "ForegroundService"; + public static final String EXTRA_FOREGROUND = "foreground"; + + public ForegroundServiceContext(Context base) { + super(base); + } + + @Override + public ComponentName startService(Intent service) { + if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !isIgnoringBatteryOptimizations() && !isAppOnForeground()) { + Log.d(TAG, "Starting in foreground mode."); + service.putExtra(EXTRA_FOREGROUND, true); + return super.startForegroundService(service); + } + return super.startService(service); + } + + @RequiresApi(api = Build.VERSION_CODES.M) + private boolean isIgnoringBatteryOptimizations() { + PowerManager powerManager = (PowerManager) getSystemService(POWER_SERVICE); + return powerManager.isIgnoringBatteryOptimizations(getPackageName()); + } + + private boolean isAppOnForeground() { + ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); + List appProcesses = activityManager.getRunningAppProcesses(); + if (appProcesses == null) { + return false; + } + final String packageName = getPackageName(); + for (ActivityManager.RunningAppProcessInfo appProcess : appProcesses) { + if (appProcess.importance == ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND && appProcess.processName.equals(packageName)) { + return true; + } + } + return false; + } + + public static void completeForegroundService(Service service, Intent intent, String tag) { + if (intent.getBooleanExtra(EXTRA_FOREGROUND, false) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + Log.d(tag, "Started in foreground mode."); + service.startForeground(tag.hashCode(), buildForegroundNotification(service)); + } + } + + @RequiresApi(api = Build.VERSION_CODES.O) + private static Notification buildForegroundNotification(Context context) { + NotificationChannel channel = new NotificationChannel("foreground-service", "Foreground Service", NotificationManager.IMPORTANCE_NONE); + channel.setLockscreenVisibility(Notification.VISIBILITY_SECRET); + channel.setShowBadge(false); + channel.setVibrationPattern(new long[0]); + context.getSystemService(NotificationManager.class).createNotificationChannel(channel); + return new Notification.Builder(context, channel.getId()) + .setOngoing(true) + .setContentTitle("Running in background") + //.setSmallIcon(R.drawable.ic_cloud_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 100% 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 6d0176fb211e2e9faaf83f933e75f6ce5676f68d..8aee1df7551134bca50903a4c11955928f2413af 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 @@ -240,13 +240,13 @@ public class HttpFormClient { @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) - public @interface ResponseField { - public String value(); + public @interface RequestContentDynamic { } @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) - public @interface RequestContentDynamic { + public @interface ResponseField { + public String value(); } @Retention(RetentionPolicy.RUNTIME) 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 bde717020684d863ce00f4cca4be0047ca654b15..b453ee6e969e982bb5242dd53a76213861853183 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 94% 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 01e2d6ec84f85294169575f6ad0bdfbcea8c56cc..58b209b8286e20dadb4ff9a180f3d169795961ba 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,14 +23,14 @@ 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; import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map; import static android.os.Build.VERSION.SDK_INT; @@ -63,6 +63,7 @@ public class PackageUtils { KNOWN_GOOGLE_PACKAGES.put("com.google.android.apps.village.boond", "48e7985b8f901df335b5d5223579c81618431c7b"); KNOWN_GOOGLE_PACKAGES.put("com.google.android.apps.subscriptions.red", "de8304ace744ae4c4e05887a27a790815e610ff0"); KNOWN_GOOGLE_PACKAGES.put("com.google.android.apps.meetings", "47a6936b733dbdb45d71997fbe1d610eca36b8bf"); + KNOWN_GOOGLE_PACKAGES.put("com.google.android.apps.nbu.paisa.user", "80df78bb700f9172bc671779b017ddefefcbf552"); } public static boolean isGooglePackage(Context context, String packageName) { @@ -99,7 +100,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) { @@ -194,12 +195,18 @@ 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; if (pid <= 0) return null; - for (ActivityManager.RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) { - if (processInfo.pid == pid) return processInfo.processName; + List runningAppProcesses = manager.getRunningAppProcesses(); + if (runningAppProcesses != null) { + for (ActivityManager.RunningAppProcessInfo processInfo : runningAppProcesses) { + if (processInfo.pid == pid && processInfo.pkgList.length == 1) { + return processInfo.pkgList[0]; + } + } } return null; } 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 0bd1e9e883eafae70f498ea9212f0daaa1a67052..c965a444c28d469dcbd226d8b888bbb2eb939b89 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 0000000000000000000000000000000000000000..3d47a7370c0824ec1c886746d109cf39f72229c1 --- /dev/null +++ b/play-services-base/build.gradle @@ -0,0 +1,41 @@ +/* + * 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') + api project(':play-services-base-api') + + implementation "androidx.fragment:fragment:$fragmentVersion" +} diff --git a/play-services-base/gradle.properties b/play-services-base/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..b31a23e525b23540b1cc394986b89a16a4254ed1 --- /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 0000000000000000000000000000000000000000..f46f23341db632f0be4bfe25143fc7b451f0018b --- /dev/null +++ b/play-services-base/src/main/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + 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 0000000000000000000000000000000000000000..0439619e1563ea03a6f3936d9de8b9b8b9baf5a5 --- /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 0000000000000000000000000000000000000000..a5642fdd0e5d2212d743c44d1762e6a9d19c136c --- /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 0000000000000000000000000000000000000000..5fb995b5a0b6b677001a5e28bfad0b809a639358 --- /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 0000000000000000000000000000000000000000..30d6a16908d9d005e4c66644b2c80b78f603b27d --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/AccountInfo.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; + +import org.microg.safeparcel.AutoSafeParcelable; + +@Deprecated +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 0000000000000000000000000000000000000000..065fff8ae872c773d3a18c964c8b7116e1bb1552 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/Api.java @@ -0,0 +1,103 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.accounts.Account; + +import com.google.android.gms.auth.api.signin.GoogleSignInAccount; + +import org.microg.gms.common.PublicApi; +import org.microg.gms.common.api.ApiClientBuilder; + +/** + * 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 ApiClientBuilder builder; + + @PublicApi(exclude = true) + public Api(ApiClientBuilder builder) { + this.builder = builder; + } + + @PublicApi(exclude = true) + public ApiClientBuilder 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 { + } + + /** + * An interface for {@link ApiOptions} that include an account. + */ + @PublicApi + interface HasAccountOptions extends HasOptions, NotRequiredOptions { + Account getAccount(); + } + + /** + * An interface for {@link ApiOptions} that includes a {@link GoogleSignInAccount} + */ + @PublicApi + interface HasGoogleSignInAccountOptions extends HasOptions { + GoogleSignInAccount getGoogleSignInAccount(); + } + } + +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApi.java b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApi.java new file mode 100644 index 0000000000000000000000000000000000000000..455ba014bf871dd9877f12ff39b15070b6bf0da0 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApi.java @@ -0,0 +1,48 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.common.api; + +import android.content.Context; + +import com.google.android.gms.common.api.internal.ApiKey; +import com.google.android.gms.tasks.Task; +import com.google.android.gms.tasks.TaskCompletionSource; + +import org.microg.gms.common.PublicApi; +import org.microg.gms.common.api.ApiClient; +import org.microg.gms.common.api.GoogleApiManager; +import org.microg.gms.common.api.PendingGoogleApiCall; + +@PublicApi +public abstract class GoogleApi implements HasApiKey { + private GoogleApiManager manager; + @PublicApi(exclude = true) + public Api api; + + @PublicApi(exclude = true) + protected GoogleApi(Context context, Api api) { + this.api = api; + this.manager = GoogleApiManager.getInstance(context); + } + + @PublicApi(exclude = true) + protected Task scheduleTask(PendingGoogleApiCall apiCall) { + TaskCompletionSource completionSource = new TaskCompletionSource<>(); + manager.scheduleTask(this, apiCall, completionSource); + return completionSource.getTask(); + } + + @Override + @PublicApi(exclude = true) + public ApiKey getApiKey() { + return null; + } + + @PublicApi(exclude = true) + public O getOptions() { + return null; + } +} 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 0000000000000000000000000000000000000000..fb7088e627a0477c15edfec95140704dbce24034 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/GoogleApiClient.java @@ -0,0 +1,458 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY 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.ApiClientSettings; +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 +@Deprecated +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, getClientSettings(), apis, connectionCallbacks, connectionFailedListeners, clientId); + } + + private ApiClientSettings getClientSettings() { + 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 + @Deprecated + interface ConnectionCallbacks extends org.microg.gms.common.api.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; + } + + /** + * 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 + @Deprecated + interface OnConnectionFailedListener extends org.microg.gms.common.api.OnConnectionFailedListener { + } +} diff --git a/play-services-base/src/main/java/com/google/android/gms/common/api/HasApiKey.java b/play-services-base/src/main/java/com/google/android/gms/common/api/HasApiKey.java new file mode 100644 index 0000000000000000000000000000000000000000..e208b4d89339d5d8f6cb6b85781b79e919f5129e --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/HasApiKey.java @@ -0,0 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.common.api; + +import com.google.android.gms.common.api.internal.ApiKey; + +public interface HasApiKey { + ApiKey getApiKey(); +} 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 0000000000000000000000000000000000000000..ec16292058ffd31750eb3e42bfc85509ec4a2b6f --- /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/api/internal/ApiKey.java b/play-services-base/src/main/java/com/google/android/gms/common/api/internal/ApiKey.java new file mode 100644 index 0000000000000000000000000000000000000000..5a42d8fdedacace4d17dbeb599d183eebf235884 --- /dev/null +++ b/play-services-base/src/main/java/com/google/android/gms/common/api/internal/ApiKey.java @@ -0,0 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.common.api.internal; + +import com.google.android.gms.common.api.Api; + +public class ApiKey { + private Api api; +} 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 0000000000000000000000000000000000000000..309a667bec53a994ef02e5dd0e9839dbd2c8b6f4 --- /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/DummyApiClient.java b/play-services-base/src/main/java/org/microg/gms/common/DummyApiClient.java new file mode 100644 index 0000000000000000000000000000000000000000..132a6148fd93effcf66c60b63961d10d52e4571c --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/DummyApiClient.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.ApiClient; + +public class DummyApiClient implements ApiClient { + 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 0000000000000000000000000000000000000000..fdffdac738b68605e0e715498e98d17186c83387 --- /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 0000000000000000000000000000000000000000..1d1f4434f915f921e5ab86365439d1fa6a6490e6 --- /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 0000000000000000000000000000000000000000..dec9c8cad576925a20ea2ed2a20d79bb353945fa --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/GmsClient.java @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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.internal.ConnectionInfo; +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.ApiClient; +import org.microg.gms.common.api.ConnectionCallbacks; +import org.microg.gms.common.api.OnConnectionFailedListener; + +public abstract class GmsClient implements ApiClient { + private static final String TAG = "GmsClient"; + + private final Context context; + protected final ConnectionCallbacks callbacks; + protected final 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, ConnectionCallbacks callbacks, 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); + } + + @Override + public void onAccountValidationComplete(int statusCode, Bundle params) throws RemoteException { + Log.d(TAG, "GmsCallbacks : onAccountValidationComplete"); + } + + @Override + public void onPostInitCompleteWithConnectionInfo(int statusCode, IBinder binder, ConnectionInfo info) throws RemoteException { + onPostInitComplete(statusCode, binder, info == null ? null : info.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 0000000000000000000000000000000000000000..8013d70f040d84adb7e6535bc6427852a2326c07 --- /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.ApiClient; +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 0000000000000000000000000000000000000000..ea4cfbe6d4980260490b174e70a8eb6f0aa26c55 --- /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 0000000000000000000000000000000000000000..15aac9e3216cbd9d155110f8aafe978a05aaf001 --- /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 0000000000000000000000000000000000000000..eb9d66bd6e55a543e44bf6003e710a804adb90c3 --- /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/ApiClient.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiClient.java new file mode 100644 index 0000000000000000000000000000000000000000..602e150e248afad2512effd4c128d0fbc82b80b4 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiClient.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 ApiClient { + void connect(); + + void disconnect(); + + boolean isConnected(); + + boolean isConnecting(); +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiClientBuilder.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiClientBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..b5aa386fb37f18c101f4b8bdb1e8d7c58d367674 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiClientBuilder.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 org.microg.gms.common.api; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.common.api.Api; + +public interface ApiClientBuilder { + ApiClient build(O options, Context context, Looper looper, ApiClientSettings clientSettings, ConnectionCallbacks callbacks, OnConnectionFailedListener connectionFailedListener); +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ApiClientSettings.java b/play-services-base/src/main/java/org/microg/gms/common/api/ApiClientSettings.java new file mode 100644 index 0000000000000000000000000000000000000000..d1e314a748713b01eef05d68fde06357ba654ba9 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ApiClientSettings.java @@ -0,0 +1,9 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.common.api; + +public class ApiClientSettings { +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/ConnectionCallbacks.java b/play-services-base/src/main/java/org/microg/gms/common/api/ConnectionCallbacks.java new file mode 100644 index 0000000000000000000000000000000000000000..738a43d3814191d9f164885289cc5dd7ace596e1 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/ConnectionCallbacks.java @@ -0,0 +1,41 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.common.api; + +import android.os.Bundle; + +import com.google.android.gms.common.api.GoogleApiClient; + +public interface ConnectionCallbacks { + + /** + * 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); +} 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 0000000000000000000000000000000000000000..112336970ae9437320da8f78fcb0550a09750c86 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiClientImpl.java @@ -0,0 +1,220 @@ +/* + * Copyright (C) 2013-2017 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES 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.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 ApiClientSettings clientSettings; + private final Map apis = new HashMap(); + private final Map apiConnections = new HashMap(); + 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, ApiClientSettings clientSettings, + Map apis, + Set connectionCallbacks, + Set connectionFailedListeners, int clientId) { + this.context = context; + this.looper = looper; + this.clientSettings = clientSettings; + 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(apis.get(api), context, looper, clientSettings, baseConnectionCallbacks, baseConnectionFailedListener)); + } + } + + public synchronized void incrementUsageCounter() { + usageCounter++; + } + + public synchronized void decrementUsageCounter() { + usageCounter--; + if (shouldDisconnect) disconnect(); + } + + public Looper getLooper() { + return looper; + } + + public ApiClient 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 (ApiClient connection : apiConnections.values()) { + if (!connection.isConnected()) { + connection.connect(); + } + } + } + + @Override + public synchronized void disconnect() { + if (usageCounter > 0) { + shouldDisconnect = true; + } else { + Log.d(TAG, "disconnect()"); + for (ApiClient connection : apiConnections.values()) { + if (connection.isConnected()) { + connection.disconnect(); + } + } + } + } + + @Override + public synchronized boolean isConnected() { + for (ApiClient connection : apiConnections.values()) { + if (!connection.isConnected()) return false; + } + return true; + } + + @Override + public synchronized boolean isConnecting() { + for (ApiClient 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); + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiManager.java b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiManager.java new file mode 100644 index 0000000000000000000000000000000000000000..1662ca31d88f4f788ca9032b36f4ae4f2c33bbee --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/GoogleApiManager.java @@ -0,0 +1,180 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.common.api; + +import android.content.Context; +import android.os.Bundle; + +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.api.Api; +import com.google.android.gms.common.api.GoogleApi; +import com.google.android.gms.tasks.TaskCompletionSource; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class GoogleApiManager { + private static GoogleApiManager instance; + private Context context; + private Map clientMap = new HashMap<>(); + private Map>> waitingApiCallMap = new HashMap<>(); + + private GoogleApiManager(Context context) { + this.context = context; + } + + public synchronized static GoogleApiManager getInstance(Context context) { + if (instance == null) instance = new GoogleApiManager(context); + return instance; + } + + private synchronized A clientForApi(GoogleApi api) { + ApiInstance apiInstance = new ApiInstance(api); + if (clientMap.containsKey(apiInstance)) { + return (A) clientMap.get(apiInstance); + } else { + ApiClient client = api.api.getBuilder().build(api.getOptions(), context, context.getMainLooper(), null, new ConnectionCallback(apiInstance), new ConnectionFailedListener(apiInstance)); + clientMap.put(apiInstance, client); + waitingApiCallMap.put(apiInstance, new ArrayList<>()); + return (A) client; + } + } + + public synchronized void scheduleTask(GoogleApi api, PendingGoogleApiCall apiCall, TaskCompletionSource completionSource) { + A client = clientForApi(api); + boolean connecting = client.isConnecting(); + boolean connected = client.isConnected(); + if (connected) { + apiCall.execute(client, completionSource); + } else { + waitingApiCallMap.get(new ApiInstance(api)).add(new WaitingApiCall((PendingGoogleApiCall) apiCall, completionSource)); + if (!connecting) { + client.connect(); + } + } + } + + private synchronized void onInstanceConnected(ApiInstance apiInstance, Bundle connectionHint) { + List> waitingApiCalls = waitingApiCallMap.get(apiInstance); + for (WaitingApiCall waitingApiCall : waitingApiCalls) { + waitingApiCall.execute(clientMap.get(apiInstance)); + } + waitingApiCalls.clear(); + } + + private synchronized void onInstanceSuspended(ApiInstance apiInstance, int cause) { + + } + + private synchronized void onInstanceFailed(ApiInstance apiInstance, ConnectionResult result) { + List> waitingApiCalls = waitingApiCallMap.get(apiInstance); + for (WaitingApiCall waitingApiCall : waitingApiCalls) { + waitingApiCall.failed(new RuntimeException(result.getErrorMessage())); + } + waitingApiCalls.clear(); + } + + private class ConnectionCallback implements ConnectionCallbacks { + private ApiInstance apiInstance; + + public ConnectionCallback(ApiInstance apiInstance) { + this.apiInstance = apiInstance; + } + + @Override + public void onConnected(Bundle connectionHint) { + onInstanceConnected(apiInstance, connectionHint); + } + + @Override + public void onConnectionSuspended(int cause) { + onInstanceSuspended(apiInstance, cause); + } + } + + private class ConnectionFailedListener implements OnConnectionFailedListener { + private ApiInstance apiInstance; + + public ConnectionFailedListener(ApiInstance apiInstance) { + this.apiInstance = apiInstance; + } + + @Override + public void onConnectionFailed(ConnectionResult result) { + onInstanceFailed(apiInstance, result); + } + } + + private static class WaitingApiCall { + private PendingGoogleApiCall apiCall; + private TaskCompletionSource completionSource; + + public WaitingApiCall(PendingGoogleApiCall apiCall, TaskCompletionSource completionSource) { + this.apiCall = apiCall; + this.completionSource = completionSource; + } + + public void execute(ApiClient client) { + apiCall.execute(client, completionSource); + } + + public void failed(Exception e) { + completionSource.setException(e); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + WaitingApiCall that = (WaitingApiCall) o; + + if (apiCall != null ? !apiCall.equals(that.apiCall) : that.apiCall != null) return false; + return completionSource != null ? completionSource.equals(that.completionSource) : that.completionSource == null; + } + + @Override + public int hashCode() { + int result = apiCall != null ? apiCall.hashCode() : 0; + result = 31 * result + (completionSource != null ? completionSource.hashCode() : 0); + return result; + } + } + + private static class ApiInstance { + private Class apiClass; + private Api.ApiOptions apiOptions; + + public ApiInstance(Class apiClass, Api.ApiOptions apiOptions) { + this.apiClass = apiClass; + this.apiOptions = apiOptions; + } + + public ApiInstance(GoogleApi api) { + this(api.getClass(), api.getOptions()); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ApiInstance that = (ApiInstance) o; + + if (apiClass != null ? !apiClass.equals(that.apiClass) : that.apiClass != null) return false; + return apiOptions != null ? apiOptions.equals(that.apiOptions) : that.apiOptions == null; + } + + @Override + public int hashCode() { + int result = apiClass != null ? apiClass.hashCode() : 0; + result = 31 * result + (apiOptions != null ? apiOptions.hashCode() : 0); + return result; + } + } +} diff --git a/play-services-base/src/main/java/org/microg/gms/common/api/InstantGoogleApiCall.java b/play-services-base/src/main/java/org/microg/gms/common/api/InstantGoogleApiCall.java new file mode 100644 index 0000000000000000000000000000000000000000..5e813d8bab320a8efa670e9b3db749dc9d88d550 --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/InstantGoogleApiCall.java @@ -0,0 +1,21 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.common.api; + +import com.google.android.gms.tasks.TaskCompletionSource; + +public interface InstantGoogleApiCall extends PendingGoogleApiCall { + R execute(A client) throws Exception; + + @Override + default void execute(A client, TaskCompletionSource completionSource) { + try { + completionSource.setResult(execute(client)); + } catch (Exception e) { + completionSource.setException(e); + } + } +} 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 0000000000000000000000000000000000000000..ba75725cabe60cf0d24f59f7ccfd9086395a5a21 --- /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/OnConnectionFailedListener.java b/play-services-base/src/main/java/org/microg/gms/common/api/OnConnectionFailedListener.java new file mode 100644 index 0000000000000000000000000000000000000000..cd994235c9eff6b458608fb37ea1a5c3d5cc13cb --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/OnConnectionFailedListener.java @@ -0,0 +1,25 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.common.api; + +import android.app.Activity; + +import com.google.android.gms.common.ConnectionResult; + +public 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/org/microg/gms/common/api/PendingGoogleApiCall.java b/play-services-base/src/main/java/org/microg/gms/common/api/PendingGoogleApiCall.java new file mode 100644 index 0000000000000000000000000000000000000000..8c92abd78f814908dac77f835419ed846566f83c --- /dev/null +++ b/play-services-base/src/main/java/org/microg/gms/common/api/PendingGoogleApiCall.java @@ -0,0 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package org.microg.gms.common.api; + +import com.google.android.gms.tasks.TaskCompletionSource; + +public interface PendingGoogleApiCall { + void execute(A client, TaskCompletionSource completionSource); +} 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 0000000000000000000000000000000000000000..c19c849c59204b93fe804b0df325e8a1c79b003d --- /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 0000000000000000000000000000000000000000..318bb1c2697ccacb3478237604dc4bc8edee47c6 --- /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 aac14e468f227ab5af8831b31ceca94d69225a59..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..201ce74e95c990f649c7c254301105e02ed7947a --- /dev/null +++ b/play-services-basement/build.gradle @@ -0,0 +1,51 @@ +/* + * 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/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 0000000000000000000000000000000000000000..c18a7f49cfa44194d6ef32a7bbd28b943474cf43 --- /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 0000000000000000000000000000000000000000..bd43677363276cb7a361dee93319da2c69cb093d --- /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 0000000000000000000000000000000000000000..701f99a9140a324175764da0c2651148b1f1e1d6 --- /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/internal/ConnectionInfo.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ConnectionInfo.aidl new file mode 100644 index 0000000000000000000000000000000000000000..b393f11d0e4f0fd118db76b60395e49574cffd6d --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ConnectionInfo.aidl @@ -0,0 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.common.internal; +parcelable ConnectionInfo; 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 0000000000000000000000000000000000000000..791dbe907f339f045692f043e9469b909c222a52 --- /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 0000000000000000000000000000000000000000..aebd479433e0505cccf08ead7287e921f6638ec5 --- /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 0000000000000000000000000000000000000000..8fe63347d68f8f8d46a42db3688a5e9adfda9ecd --- /dev/null +++ b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/IGmsCallbacks.aidl @@ -0,0 +1,15 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.common.internal; + +import android.os.Bundle; +import com.google.android.gms.common.internal.ConnectionInfo; + +interface IGmsCallbacks { + void onPostInitComplete(int statusCode, IBinder binder, in Bundle params); + void onAccountValidationComplete(int statusCode, in Bundle params); + void onPostInitCompleteWithConnectionInfo(int statusCode, IBinder binder, in ConnectionInfo info); +} 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 0000000000000000000000000000000000000000..9649150d44362db6302ae0df719bd3f957fbfc8b --- /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/ValidateAccountRequest.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/common/internal/ValidateAccountRequest.aidl new file mode 100644 index 0000000000000000000000000000000000000000..cef6ad7e006a6a898255dea36e204241ec8ecd56 --- /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/dynamic/IObjectWrapper.aidl b/play-services-basement/src/main/aidl/com/google/android/gms/dynamic/IObjectWrapper.aidl new file mode 100644 index 0000000000000000000000000000000000000000..35e1474af55802136862d1499fb21623b3cdd311 --- /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 0000000000000000000000000000000000000000..f3272de84773aca2e289211e3875e3d79068a06a --- /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/Feature.java b/play-services-basement/src/main/java/com/google/android/gms/common/Feature.java new file mode 100644 index 0000000000000000000000000000000000000000..0a5b0813d0650629cdb31e01778c764cb64a05b9 --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/Feature.java @@ -0,0 +1,36 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.common; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class Feature extends AutoSafeParcelable { + @Field(1) + private String name; + @Field(2) + private int oldVersion; + @Field(3) + private long version = -1; + + private Feature() { + } + + public Feature(String name, long version) { + this.name = name; + this.version = version; + } + + public String getName() { + return name; + } + + public long getVersion() { + if (version == -1) return oldVersion; + return version; + } + + public static final Creator CREATOR = new AutoSafeParcelable.AutoCreator<>(Feature.class); +} diff --git a/play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java b/play-services-basement/src/main/java/com/google/android/gms/common/Scopes.java new file mode 100644 index 0000000000000000000000000000000000000000..a3dfbf5f57c47f3c6f524487fa7566e4022d04cf --- /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 0000000000000000000000000000000000000000..6a2cbb519464a8711a51d873bd2e24364eb65222 --- /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 0000000000000000000000000000000000000000..cbbbd4c70ad1092756c748ee10dd999a52a189b5 --- /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 0000000000000000000000000000000000000000..3ed0bd7e6ec034239da251667c6caf33ef87f2f3 --- /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 0000000000000000000000000000000000000000..1cac879cae6570220a031db16955d203bef217b5 --- /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 0000000000000000000000000000000000000000..d99932b223c4a5664a7d8e5c015cf03d08996012 --- /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 0000000000000000000000000000000000000000..6a80ff39d5502c2b29bb1719dad119a9798f23b0 --- /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/internal/BinderWrapper.java b/play-services-basement/src/main/java/com/google/android/gms/common/internal/BinderWrapper.java new file mode 100644 index 0000000000000000000000000000000000000000..47ec39497e5d6fc7d54b8f84cf7473c61725fd05 --- /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/ConnectionInfo.java b/play-services-basement/src/main/java/com/google/android/gms/common/internal/ConnectionInfo.java new file mode 100644 index 0000000000000000000000000000000000000000..5afe6d10333759ef92f746e563ce9477ddd5f39a --- /dev/null +++ b/play-services-basement/src/main/java/com/google/android/gms/common/internal/ConnectionInfo.java @@ -0,0 +1,23 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +package com.google.android.gms.common.internal; + +import android.os.Bundle; + +import com.google.android.gms.common.Feature; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ConnectionInfo extends AutoSafeParcelable { + @Field(1) + public Bundle params; + @Field(2) + public Feature[] features; + @Field(3) + public int unknown3; + + public static final Creator CREATOR = new AutoSafeParcelable.AutoCreator<>(ConnectionInfo.class); +} 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 0000000000000000000000000000000000000000..488feba914aa769d920e398c033d80adad70ee52 --- /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 0000000000000000000000000000000000000000..71337291671bac987e1673f88f960bd237f8498a --- /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/dynamic/ObjectWrapper.java b/play-services-basement/src/main/java/com/google/android/gms/dynamic/ObjectWrapper.java new file mode 100644 index 0000000000000000000000000000000000000000..6f26194b658ca1bebddc11115e5f668fb6ba6606 --- /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 0000000000000000000000000000000000000000..2245272c2749da3181c30e073ab46a4d6b4bd658 --- /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 0000000000000000000000000000000000000000..67222fc4a3816cda773838176be1b3d949d0fcd9 --- /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 = 202414 * 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 0000000000000000000000000000000000000000..cd6816d451530195496ac7e2166f3584841be0e5 --- /dev/null +++ b/play-services-basement/src/main/java/org/microg/gms/common/GmsService.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 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"), + APP_INVITE(77, "com.google.android.gms.appinvite.service.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"), + DYNAMIC_LINKS(131, "com.google.firebase.dynamiclinks.service.START"), + NEARBY_EXPOSURE(236, "com.google.android.gms.nearby.exposurenotification.START"), + ; + + 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 GmsService byAction(String action) { + for (GmsService service : values()) { + for (String serviceAction : service.SECONDARY_ACTIONS) { + if (serviceAction.equals(action)) 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 0000000000000000000000000000000000000000..92663979674dff5411a21b8c07187bb1604a9f6a --- /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 0000000000000000000000000000000000000000..d33bbfdee4ee355e8bea0c416db7b27fdfdae31d --- /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 0000000000000000000000000000000000000000..06c131abeffdd9dfbfe98e6b6a5b88773ec04caf --- /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 d74ee46ec995e3c9210feae6adb3c0f3722a22bb..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..bdc679a1a688d9f0863b8981578f38f9f294c11c --- /dev/null +++ b/play-services-cast-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" + + 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') + + api project(':play-services-base-api') +} diff --git a/play-services-cast-api/gradle.properties b/play-services-cast-api/gradle.properties new file mode 100644 index 0000000000000000000000000000000000000000..18ff0a5015a4d43a47fb0be7ce99ac01605b0707 --- /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 0000000000000000000000000000000000000000..d559e5896d42f5e19cfaabe4de88ca01b8afe441 --- /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 0000000000000000000000000000000000000000..236c4dbfed03f681a9b0430883353d62f80d8eeb --- /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 0000000000000000000000000000000000000000..e7ad0532735a46385153ac5f2fa669c8809e02cf --- /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 0000000000000000000000000000000000000000..1585adeb9ee287fffdd7c52cc3c6819c28ed70e1 --- /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 0000000000000000000000000000000000000000..3eafbddcdc6801d33dde467842efa8114369f22b --- /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 0000000000000000000000000000000000000000..85ed609d74e033fd629c72207b4874e7c7093596 --- /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 0000000000000000000000000000000000000000..340c3849fa4220bf04e077d4138bee16bf898509 --- /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 0000000000000000000000000000000000000000..1d26c14b03fa8c9d43a3039ab9a3b101cb95b733 --- /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 0000000000000000000000000000000000000000..71dee27b15d954d922be48b221033afba449e397 --- /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 0000000000000000000000000000000000000000..9653768920270c2bbe4f156b3dd9c5be08b452e4 --- /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 0000000000000000000000000000000000000000..f185c8a5b8a4ec039c48fb18e9645b79563753bb --- /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 0000000000000000000000000000000000000000..67dba19382b0fcf876d00e74cc7780af076ed259 --- /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 0000000000000000000000000000000000000000..ca3a287137378029bfc39ea584d608b4250044e6 --- /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 0000000000000000000000000000000000000000..e95ed75aed74b636db4e17bff389d29d3dabd38a --- /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 0000000000000000000000000000000000000000..022af3d2760e45e50b85724790b28bc1d4bb0713 --- /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 0000000000000000000000000000000000000000..7c30fbe3a5bd82e72603995549286f92bcc80a97 --- /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 f91961194264bdc95a878e98ec868f52a7b4b0a5..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..9db7c8123768818bf30a0db6041819c058204f95 --- /dev/null +++ b/play-services-cast-framework-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" + + defaultConfig { + versionName version + minSdkVersion androidMinSdk + targetSdkVersion androidTargetSdk + } + + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 + } +} + +dependencies { + api project(':play-services-basement') + + api project(':play-services-base-api') + 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 0000000000000000000000000000000000000000..54557daf9996367274f49e9986f95c1b81fd157f --- /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 0000000000000000000000000000000000000000..89224918d08936250fa00842fe7afc9312febb8a --- /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 0000000000000000000000000000000000000000..e867d59d6dbe7df09f14a34ff983d61155d9fb84 --- /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 0000000000000000000000000000000000000000..cb173815c61e0b3e06b3c86e3e7e9c74faf840d4 --- /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 0000000000000000000000000000000000000000..4ad8ee32cb33df400bc09c01a22d8d24bdfb75db --- /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 0000000000000000000000000000000000000000..717671d7c12bc16c9289a38ead50aed30d8fda43 --- /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 0000000000000000000000000000000000000000..e5c11cba7f6c32eafa188cdb44c7d96699603cb4 --- /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 0000000000000000000000000000000000000000..98e20151bae2574cd4c2d7c07cf6a44fb3595195 --- /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 0000000000000000000000000000000000000000..0c775ac0b7d4e4033f7f7f0c34b92ff2ca212806 --- /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 0000000000000000000000000000000000000000..701a5c248ec4b5cdc0bfe1b61bdb32c2271c38fb --- /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 0000000000000000000000000000000000000000..33f19574c28a6c96ceddc6d0a1d64e237be00e0f --- /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 0000000000000000000000000000000000000000..a5580bc323024b5e5aa9afffc71d991788bf2901 --- /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 0000000000000000000000000000000000000000..caf95617e5d35820556d3a205240fd1fc8eca5ff --- /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 0000000000000000000000000000000000000000..4dc4ae9dee4cfd9d86bf37de935678668041b0d0 --- /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 0000000000000000000000000000000000000000..5f99e9df966f9765c65bfa80df43634d41b7bfdf --- /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 0000000000000000000000000000000000000000..170680a0f1459d7878e599f01880482169dd96b6 --- /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 0000000000000000000000000000000000000000..2085775a568f0fc2300622f5ddce99184b32699c --- /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 0000000000000000000000000000000000000000..3cfba99a5a8f6a48ea34c45b5d71dec140b91880 --- /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 0000000000000000000000000000000000000000..d28c87c8a4d9f839587fd995139f2817f133093e --- /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 0000000000000000000000000000000000000000..4186fc4b7df1080d3a88b76a3da126a4dbaee535 --- /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 0000000000000000000000000000000000000000..05211a389a716931fe128ad8c3abb07c4ae1b9f5 --- /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 0000000000000000000000000000000000000000..03e487290ad53ae6681fcab0e7b38101793aa822 --- /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 0000000000000000000000000000000000000000..325efe230dfc5caf9920b05a1dd12b0d76b3304d --- /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 0000000000000000000000000000000000000000..b918b7e6a22c0fa9137db9f14297cb2cc3ec5439 --- /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 0000000000000000000000000000000000000000..c9f2286d54cd31603f7c58197fded203dcbe81da --- /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 0000000000000000000000000000000000000000..58b80c083214e0e29a88f6f69324cb00763a0513 --- /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 0000000000000000000000000000000000000000..2592c821e3709ce55c1d1adc4f9b2548344ff7b0 --- /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 0000000000000000000000000000000000000000..85d57bea17bb5247efcc369844ab302f45614c98 --- /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 0000000000000000000000000000000000000000..3db58f3ea3881180998d99aac036e190a684c6f6 --- /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 0000000000000000000000000000000000000000..bfed1ad4310082e25de8781d6803ffae979c6fa7 --- /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 0000000000000000000000000000000000000000..85ea138a440f662e479c825cbc17b9e7e5f8c10d --- /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 0000000000000000000000000000000000000000..937fcc062a76d6d2b28100879a351a04778489a2 --- /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 0000000000000000000000000000000000000000..7e14f3940bf8fdbfef200ee7a46eae53486f05a5 --- /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 0000000000000000000000000000000000000000..33f7be44bf39911aa052acd5cb88ac2746bb3a31 --- /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.CastApiClientBuilder; +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 CastApiClientBuilder()); + + /** + * 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 0000000000000000000000000000000000000000..cfc5568510a6edce04769d747cde940c111a2264 --- /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 0000000000000000000000000000000000000000..30c20e733e095bc30683402b7016ed70d96c4943 --- /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.CastRemoteDisplayApiClientBuilder; +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 CastRemoteDisplayApiClientBuilder()); + + /** + * 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 0000000000000000000000000000000000000000..5c0535816e0998d1910a2eb295818d92afaabc48 --- /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 0000000000000000000000000000000000000000..dbc4108ab3fcc0ec4fcbb28ddf7010937f853dcd --- /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/CastApiClientBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiClientBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..aba489712051bea9a4f94f437c1d58c100f78d3f --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastApiClientBuilder.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.Cast; + +import org.microg.gms.common.api.ApiClientBuilder; +import org.microg.gms.common.api.ApiClientSettings; +import org.microg.gms.common.api.ApiClient; +import org.microg.gms.common.api.ConnectionCallbacks; +import org.microg.gms.common.api.OnConnectionFailedListener; + +public class CastApiClientBuilder implements ApiClientBuilder { + @Override + public ApiClient build(Cast.CastOptions options, Context context, Looper looper, ApiClientSettings clientSettings, ConnectionCallbacks callbacks, 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 0000000000000000000000000000000000000000..bb95565eb29f6cc779eade4f0b7aa780010b077b --- /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 0000000000000000000000000000000000000000..8b6bd502243e68a9fd8f0915be93613d382ca9fe --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastClientImpl.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.cast; + +import android.content.Context; + +import com.google.android.gms.cast.Cast; + +import org.microg.gms.common.DummyApiClient; +import org.microg.gms.common.api.ConnectionCallbacks; +import org.microg.gms.common.api.OnConnectionFailedListener; + +public class CastClientImpl extends DummyApiClient { + public CastClientImpl(Context context, Cast.CastOptions options, ConnectionCallbacks callbacks, OnConnectionFailedListener connectionFailedListener) { + } +} diff --git a/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiClientBuilder.java b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiClientBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..588d25c3eba8ddbf1df9829ae9e0d0795c94832d --- /dev/null +++ b/play-services-cast/src/main/java/org/microg/gms/cast/CastRemoteDisplayApiClientBuilder.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 org.microg.gms.cast; + +import android.content.Context; +import android.os.Looper; + +import com.google.android.gms.cast.CastRemoteDisplay; + +import org.microg.gms.common.DummyApiClient; +import org.microg.gms.common.api.ApiClientBuilder; +import org.microg.gms.common.api.ApiClientSettings; +import org.microg.gms.common.api.ApiClient; +import org.microg.gms.common.api.ConnectionCallbacks; +import org.microg.gms.common.api.OnConnectionFailedListener; + +public class CastRemoteDisplayApiClientBuilder implements ApiClientBuilder { + @Override + public ApiClient build(CastRemoteDisplay.CastRemoteDisplayOptions options, Context context, Looper looper, ApiClientSettings clientSettings, ConnectionCallbacks callbacks, OnConnectionFailedListener connectionFailedListener) { + return new DummyApiClient(); + } +} 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 0000000000000000000000000000000000000000..4f47a90d17606c54e1788895db96e1eb2282a0c3 --- /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-proto/build.gradle b/play-services-core-proto/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..3ae24b599ea1d79e76b3a932fca3cb97ddcb8932 --- /dev/null +++ b/play-services-core-proto/build.gradle @@ -0,0 +1,25 @@ +/* + * SPDX-FileCopyrightText: 2020, microG Project Team + * SPDX-License-Identifier: Apache-2.0 + */ + +apply plugin: 'com.squareup.wire' +apply plugin: 'kotlin' + +dependencies { + implementation "com.squareup.wire:wire-runtime:$wireVersion" +} + +wire { + kotlin { + javaInterop = true + } +} + +compileKotlin { + kotlinOptions.jvmTarget = 1.8 +} + +compileTestKotlin { + kotlinOptions.jvmTarget = 1.8 +} diff --git a/play-services-core/src/main/protos-repo/auth.proto b/play-services-core-proto/src/main/proto/auth.proto similarity index 100% rename from play-services-core/src/main/protos-repo/auth.proto rename to play-services-core-proto/src/main/proto/auth.proto diff --git a/play-services-core/src/main/protos-repo/checkin.proto b/play-services-core-proto/src/main/proto/checkin.proto similarity index 100% rename from play-services-core/src/main/protos-repo/checkin.proto rename to play-services-core-proto/src/main/proto/checkin.proto diff --git a/play-services-core/src/main/protos-repo/mcs.proto b/play-services-core-proto/src/main/proto/mcs.proto similarity index 100% rename from play-services-core/src/main/protos-repo/mcs.proto rename to play-services-core-proto/src/main/proto/mcs.proto diff --git a/play-services-core/src/main/protos-repo/snet.proto b/play-services-core-proto/src/main/proto/snet.proto similarity index 100% rename from play-services-core/src/main/protos-repo/snet.proto rename to play-services-core-proto/src/main/proto/snet.proto diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 0a16720d9bd71d0995eb18e8480a41ba8c8ccda2..beb23a7ca93e71663c05d1ab607debe0f2db3e96 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -15,21 +15,18 @@ */ apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' -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 "com.squareup.wire:wire-runtime:$wireVersion" implementation "de.hdodenhof:circleimageview:1.3.0" + implementation "com.diogobernardino:williamchart:3.7.1" implementation "org.conscrypt:conscrypt-android:2.1.0" // TODO: Switch to upstream once raw requests are merged // https://github.com/vitalidze/chromecast-java-api-v2/pull/99 @@ -41,83 +38,89 @@ 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(':firebase-dynamic-links-api') + implementation project(':play-services-base-core') + implementation project(':play-services-location-core') + implementation project(':play-services-nearby-core') + implementation project(':play-services-core-proto') + 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(':play-services-appinvite') - implementation project(':unifiednlp-base') - implementation project(':wearable-lib') - implementation project(':firebase-dynamic-links') - - implementation project(':remote-droid-guard-lib') - if (useMapbox()) { - implementation project(':play-services-maps-core-mapbox') - } else { - implementation project(':play-services-maps-core-vtm') - } -} - -def execResult(...args) { - def stdout = new ByteArrayOutputStream() - exec { - commandLine args - standardOutput = stdout - } - return stdout.toString().trim() + implementation "org.microg:wearable:$wearableVersion" + implementation "org.microg.gms:remote-droid-guard:$remoteDroidGuardVersion" + implementation "org.microg.nlp:client:$nlpVersion" + + 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" + + implementation "androidx.lifecycle:lifecycle-service:$lifecycleVersion" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" } -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 multiDexEnabled true + multiDexKeepProguard file('multidex-keep.pro') ndk { abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64" } } + dataBinding { + enabled = true + } + sourceSets { main { - java.srcDirs += 'src/main/protos-java' + java.srcDirs += 'src/main/kotlin' } } - lintOptions { - abortOnError false - } - lintOptions { disable 'MissingTranslation', 'InvalidPackage', 'BatteryLife', 'ImpliedQuantity', 'MissingQuantity', 'InvalidWakeLockTag' } 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 0000000000000000000000000000000000000000..d1479ecf42c063f64e77f3e13c994503c6754d0c --- /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 0000000000000000000000000000000000000000..004f299cbe139b0ebf2403ef95da95dda3643c4c --- /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 0000000000000000000000000000000000000000..22543802806ea3dfefe1cb90a03ac2a5b1d31153 --- /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 0000000000000000000000000000000000000000..13828574dabb71170a2e8391b54bd3763d593da6 --- /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 0000000000000000000000000000000000000000..e0b53f4719fb14e6c78fe00f2ac72068d891a553 --- /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 0000000000000000000000000000000000000000..caac607b1e1fe0af1b558d1f3b9cd76ee7fc6f14 --- /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 0000000000000000000000000000000000000000..ab05ab8f5ea173c3e5eddb149bf41a028c0b9499 --- /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 0000000000000000000000000000000000000000..a771a9ea36d325cccec2ab79c420bdab360eef7c --- /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 0000000000000000000000000000000000000000..0f1967a52f58d483d3d77ea39d601c8366f77666 --- /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 0000000000000000000000000000000000000000..7ea35cd800e0d074c3d729b5f56f4240513ee78b --- /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 0000000000000000000000000000000000000000..af07a691bec5eac7b90a6da56282daa203a1a241 --- /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/LongTextPreference.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/LongTextPreference.java new file mode 100644 index 0000000000000000000000000000000000000000..4c6edb8be504421c9c0117f422e43c3b13683844 --- /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 0000000000000000000000000000000000000000..e45d38123ecb691291306c0f3b3caee047ebd662 --- /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 0000000000000000000000000000000000000000..78abc7817f89acdcdce27428cb4c08d13f9c3520 --- /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 0000000000000000000000000000000000000000..ab282dd50c2536cb6f6faaf5d3c52bc5bc1df761 --- /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 0000000000000000000000000000000000000000..b2b33e3bd4a6bd46c2c6789c82deabba4a8c5607 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/SwitchBarResourceSettingsFragment.java @@ -0,0 +1,69 @@ +/* + * 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); + +// 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/ToggleSwitch.java b/play-services-core/microg-ui-tools/src/main/java/org/microg/tools/ui/ToggleSwitch.java new file mode 100644 index 0000000000000000000000000000000000000000..9624730589ed51982bde6c86866c78e90873712c --- /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 0000000000000000000000000000000000000000..20909c3aab40214f1cc3d1aade7507d4b6c395d0 --- /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 0000000000000000000000000000000000000000..07d028d21875314a86d4a87c09e46f660ec8ac06 --- /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 0000000000000000000000000000000000000000..62ff063e39cd1262dafc46caa433e3da232fc20d --- /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 0000000000000000000000000000000000000000..871f6575eb044d7f49f0588e8d32f4101a947f7f --- /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 0000000000000000000000000000000000000000..714b5e11e54f8681d79076852cafb87e151de714 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/drawable/self_check.xml @@ -0,0 +1,28 @@ + + + + + + + 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 0000000000000000000000000000000000000000..9c5aba9c546b7c0cbe4395843204785261325e1f --- /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 0000000000000000000000000000000000000000..45d12ba74dbfea9128e9a65f674f76300d5debc3 --- /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 0000000000000000000000000000000000000000..3f7906ae6b4e3bbe3fa7fb5454ebde83070f43a4 --- /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 0000000000000000000000000000000000000000..e563293cbedf074ad4cd85fbe7fc6bffb485c839 --- /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 0000000000000000000000000000000000000000..02d68ae3c64256e2fa2b707a97b0fe1ea4deff07 --- /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 0000000000000000000000000000000000000000..d18d9e1da1b1cf39928ea298381d72e8ac8e41d0 --- /dev/null +++ b/play-services-core/microg-ui-tools/src/main/res/layout/condition_card.xml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +