diff --git a/prebuilts/gradle/ActionBarCompat-Basic/.google/packaging.yaml b/prebuilts/gradle/ActionBarCompat-Basic/.google/packaging.yaml index 3c18d1b1a1fc77352078e63e1649b5c8312c7d03..29a923687f5f62d64b48c0c63b6de5d99ab5f2a4 100644 --- a/prebuilts/gradle/ActionBarCompat-Basic/.google/packaging.yaml +++ b/prebuilts/gradle/ActionBarCompat-Basic/.google/packaging.yaml @@ -14,6 +14,6 @@ level: BEGINNER icon: screenshots/big-icon.png apiRefs: - android:android.app.ActionBar - - android:android.support.v7.app.ActionBarActivity + - android:android.support.v7.app.AppCompatActivity - android:android.support.v4.view.MenuItemCompat license: apache2 diff --git a/prebuilts/gradle/ActionBarCompat-Basic/Application/build.gradle b/prebuilts/gradle/ActionBarCompat-Basic/Application/build.gradle index 12dcfb154195284b6dc703d0e2eb7d0a00116e5c..f292a70d2f4699a68105ea8d8027a6c9d9c3f9bf 100644 --- a/prebuilts/gradle/ActionBarCompat-Basic/Application/build.gradle +++ b/prebuilts/gradle/ActionBarCompat-Basic/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:gridlayout-v7:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:gridlayout-v7:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -31,12 +33,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 7 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/ActionBarCompat-Basic/Application/src/main/java/com/example/android/actionbarcompat/basic/MainActivity.java b/prebuilts/gradle/ActionBarCompat-Basic/Application/src/main/java/com/example/android/actionbarcompat/basic/MainActivity.java index 8d3506fd4810a638358d7d2bbf398a8a59649d54..f3b14dc1ad2aeff50cec3f616fdefdee2ce4dfd6 100644 --- a/prebuilts/gradle/ActionBarCompat-Basic/Application/src/main/java/com/example/android/actionbarcompat/basic/MainActivity.java +++ b/prebuilts/gradle/ActionBarCompat-Basic/Application/src/main/java/com/example/android/actionbarcompat/basic/MainActivity.java @@ -18,7 +18,7 @@ package com.example.android.actionbarcompat.basic; import android.os.Bundle; import android.support.v4.view.MenuItemCompat; -import android.support.v7.app.ActionBarActivity; +import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; @@ -26,10 +26,10 @@ import android.view.MenuItem; * This sample shows you how to use ActionBarCompat to create a basic Activity which displays * action items. It covers inflating items from a menu resource, as well as adding an item in code. * - * This Activity extends from {@link ActionBarActivity}, which provides all of the function + * This Activity extends from {@link AppCompatActivity}, which provides all of the function * necessary to display a compatible Action Bar on devices running Android v2.1+. */ -public class MainActivity extends ActionBarActivity { +public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/prebuilts/gradle/ActionBarCompat-Basic/LICENSE b/prebuilts/gradle/ActionBarCompat-Basic/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/ActionBarCompat-Basic/LICENSE +++ b/prebuilts/gradle/ActionBarCompat-Basic/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/ActionBarCompat-Basic/README.md b/prebuilts/gradle/ActionBarCompat-Basic/README.md index dd87b25ee919bebf23bbd399395845c1113064b7..6651c45d8fa7d79d53360c5ea8392e06e939062f 100644 --- a/prebuilts/gradle/ActionBarCompat-Basic/README.md +++ b/prebuilts/gradle/ActionBarCompat-Basic/README.md @@ -22,7 +22,7 @@ This sample demonstrates using the support library APIs. Using an ActionBar with the support library requires the following steps: -1. Create your activity by extending ActionBarActivity. +1. Create your activity by extending AppCompatActivity. 2. Use (or extend) one of the Theme.AppCompat themes for your activity. Once this is done, action items will be created for any options menu items that @@ -35,8 +35,8 @@ would otherwise be created during when `[onCreateOptionsMenu()][3]` is called. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/ActionBarCompat-Basic/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/ActionBarCompat-Basic/gradle/wrapper/gradle-wrapper.properties index 4da4a5808fee2512de0bcbe3cd6b2bb866234b02..86fc139ac8ce03bb1d041893a60d25222baf6c33 100644 --- a/prebuilts/gradle/ActionBarCompat-Basic/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/ActionBarCompat-Basic/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/ActionBarCompat-ListPopupMenu/Application/build.gradle b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/Application/build.gradle index 12dcfb154195284b6dc703d0e2eb7d0a00116e5c..f292a70d2f4699a68105ea8d8027a6c9d9c3f9bf 100644 --- a/prebuilts/gradle/ActionBarCompat-ListPopupMenu/Application/build.gradle +++ b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:gridlayout-v7:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:gridlayout-v7:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -31,12 +33,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 7 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/ActionBarCompat-ListPopupMenu/Application/src/main/java/com/example/android/actionbarcompat/listpopupmenu/MainActivity.java b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/Application/src/main/java/com/example/android/actionbarcompat/listpopupmenu/MainActivity.java index 13a77f3ec806743800618fe76f58760abedc1078..4594a0ca6e7a99964a357bcb11dffdf99d422bb6 100644 --- a/prebuilts/gradle/ActionBarCompat-ListPopupMenu/Application/src/main/java/com/example/android/actionbarcompat/listpopupmenu/MainActivity.java +++ b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/Application/src/main/java/com/example/android/actionbarcompat/listpopupmenu/MainActivity.java @@ -17,7 +17,7 @@ package com.example.android.actionbarcompat.listpopupmenu; import android.os.Bundle; -import android.support.v7.app.ActionBarActivity; +import android.support.v7.app.AppCompatActivity; /** * This sample shows you how to use {@link android.support.v7.widget.PopupMenu PopupMenu} from @@ -25,10 +25,10 @@ import android.support.v7.app.ActionBarActivity; *

* The interesting part of this sample is in {@link PopupListFragment}. * - * This Activity extends from {@link ActionBarActivity}, which provides all of the function + * This Activity extends from {@link AppCompatActivity}, which provides all of the function * necessary to display a compatible Action Bar on devices running Android v2.1+. */ -public class MainActivity extends ActionBarActivity { +public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/prebuilts/gradle/ActionBarCompat-ListPopupMenu/LICENSE b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/ActionBarCompat-ListPopupMenu/LICENSE +++ b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/ActionBarCompat-ListPopupMenu/README.md b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/README.md index ab7dc2febc895a04a0d2590693ee67c9289fbaa4..c4c1ae02dea1d59fdc6ac1f0ec11050e47aa00ae 100644 --- a/prebuilts/gradle/ActionBarCompat-ListPopupMenu/README.md +++ b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/README.md @@ -17,8 +17,8 @@ The sample uses [ListFragment][2] from the v4 support library to display the lis Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/ActionBarCompat-ListPopupMenu/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/gradle/wrapper/gradle-wrapper.properties index 4da4a5808fee2512de0bcbe3cd6b2bb866234b02..86fc139ac8ce03bb1d041893a60d25222baf6c33 100644 --- a/prebuilts/gradle/ActionBarCompat-ListPopupMenu/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/ActionBarCompat-ListPopupMenu/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/ActionBarCompat-Styled/.google/packaging.yaml b/prebuilts/gradle/ActionBarCompat-Styled/.google/packaging.yaml index b5dcbb6fe9d96610875b69853594ee9e8ae5314b..638664840b9944ebdedaae1ed5d44c4943945c9e 100644 --- a/prebuilts/gradle/ActionBarCompat-Styled/.google/packaging.yaml +++ b/prebuilts/gradle/ActionBarCompat-Styled/.google/packaging.yaml @@ -13,5 +13,5 @@ github: android-ActionBarCompat-Styled level: INTERMEDIATE icon: screenshots/big_icon.png apiRefs: - - android:android.support.v7.app.ActionBarActivity + - android:android.support.v7.app.AppCompatActivity license: apache2 diff --git a/prebuilts/gradle/ActionBarCompat-Styled/Application/build.gradle b/prebuilts/gradle/ActionBarCompat-Styled/Application/build.gradle index 12dcfb154195284b6dc703d0e2eb7d0a00116e5c..f292a70d2f4699a68105ea8d8027a6c9d9c3f9bf 100644 --- a/prebuilts/gradle/ActionBarCompat-Styled/Application/build.gradle +++ b/prebuilts/gradle/ActionBarCompat-Styled/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:gridlayout-v7:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:gridlayout-v7:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -31,12 +33,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 7 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/ActionBarCompat-Styled/Application/src/main/java/com/example/android/actionbarcompat/styled/MainActivity.java b/prebuilts/gradle/ActionBarCompat-Styled/Application/src/main/java/com/example/android/actionbarcompat/styled/MainActivity.java index 19fe3a131259ca8eefed942d49cecf682677c909..04163ef9a9d63a8f2083b6154fe9ac835cc958dc 100644 --- a/prebuilts/gradle/ActionBarCompat-Styled/Application/src/main/java/com/example/android/actionbarcompat/styled/MainActivity.java +++ b/prebuilts/gradle/ActionBarCompat-Styled/Application/src/main/java/com/example/android/actionbarcompat/styled/MainActivity.java @@ -19,14 +19,14 @@ package com.example.android.actionbarcompat.styled; import android.os.Bundle; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.ActionBar; -import android.support.v7.app.ActionBarActivity; +import android.support.v7.app.AppCompatActivity; import android.view.Menu; /** * This sample shows you how to use ActionBarCompat with a customized theme. It utilizes a split * action bar when running on a device with a narrow display, and show three tabs. * - * This Activity extends from {@link ActionBarActivity}, which provides all of the function + * This Activity extends from {@link AppCompatActivity}, which provides all of the function * necessary to display a compatible Action Bar on devices running Android v2.1+. * * The interesting bits of this sample start in the theme files @@ -35,7 +35,7 @@ import android.view.Menu; * Many of the drawables used in this sample were generated with the * 'Android Action Bar Style Generator': http://jgilfelt.github.io/android-actionbarstylegenerator */ -public class MainActivity extends ActionBarActivity implements ActionBar.TabListener { +public class MainActivity extends AppCompatActivity implements ActionBar.TabListener { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/prebuilts/gradle/ActionBarCompat-Styled/LICENSE b/prebuilts/gradle/ActionBarCompat-Styled/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/ActionBarCompat-Styled/LICENSE +++ b/prebuilts/gradle/ActionBarCompat-Styled/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/ActionBarCompat-Styled/README.md b/prebuilts/gradle/ActionBarCompat-Styled/README.md index 4cb16df3997081ed3c5d50998cbcc062cc9bad3b..4de0f1efb564268e77e3a1ff52b63fa5e9499b50 100644 --- a/prebuilts/gradle/ActionBarCompat-Styled/README.md +++ b/prebuilts/gradle/ActionBarCompat-Styled/README.md @@ -11,7 +11,7 @@ Introduction This sample shows how to style an ActionBar using the [support library][1] on devices running Android v2.1+ using a custom theme. -This Activity extends from ActionBarActivity, which provides all of the function +This Activity extends from AppCompatActivity, which provides all of the function necessary to display a compatible Action Bar on devices running Android v2.1+. A custom application theme and styles are defined in XML. @@ -23,8 +23,8 @@ Assets have been generated using the ['Android Action Bar Style Generator'][2]. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/ActionBarCompat-Styled/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/ActionBarCompat-Styled/gradle/wrapper/gradle-wrapper.properties index 4da4a5808fee2512de0bcbe3cd6b2bb866234b02..86fc139ac8ce03bb1d041893a60d25222baf6c33 100644 --- a/prebuilts/gradle/ActionBarCompat-Styled/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/ActionBarCompat-Styled/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/ActiveNotifications/Application/build.gradle b/prebuilts/gradle/ActiveNotifications/Application/build.gradle index be6a1a35449f407ca0231838ffb2c7732d75e58e..a736caafbc5de04a60d49cbdd3bd7db532aeb9d5 100644 --- a/prebuilts/gradle/ActiveNotifications/Application/build.gradle +++ b/prebuilts/gradle/ActiveNotifications/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -32,7 +34,8 @@ List dirs = [ android { compileSdkVersion 24 - buildToolsVersion "25.0.3" + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 24 diff --git a/prebuilts/gradle/ActiveNotifications/LICENSE b/prebuilts/gradle/ActiveNotifications/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/ActiveNotifications/LICENSE +++ b/prebuilts/gradle/ActiveNotifications/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/ActiveNotifications/README.md b/prebuilts/gradle/ActiveNotifications/README.md index 6f20204967f87324bc532d576c1faaa0feae1d89..3d5aaab964c2ca40670470fe408b3e37b3768337 100644 --- a/prebuilts/gradle/ActiveNotifications/README.md +++ b/prebuilts/gradle/ActiveNotifications/README.md @@ -32,7 +32,7 @@ Pre-requisites -------------- - Android SDK 24 -- Android Build Tools v25.0.3 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/ActiveNotifications/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/ActiveNotifications/gradle/wrapper/gradle-wrapper.properties index 4da4a5808fee2512de0bcbe3cd6b2bb866234b02..86fc139ac8ce03bb1d041893a60d25222baf6c33 100644 --- a/prebuilts/gradle/ActiveNotifications/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/ActiveNotifications/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/ActivityInstrumentation/Application/build.gradle b/prebuilts/gradle/ActivityInstrumentation/Application/build.gradle index 12dcfb154195284b6dc703d0e2eb7d0a00116e5c..f292a70d2f4699a68105ea8d8027a6c9d9c3f9bf 100644 --- a/prebuilts/gradle/ActivityInstrumentation/Application/build.gradle +++ b/prebuilts/gradle/ActivityInstrumentation/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:gridlayout-v7:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:gridlayout-v7:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -31,12 +33,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 7 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/ActivityInstrumentation/LICENSE b/prebuilts/gradle/ActivityInstrumentation/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/ActivityInstrumentation/LICENSE +++ b/prebuilts/gradle/ActivityInstrumentation/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/ActivityInstrumentation/README.md b/prebuilts/gradle/ActivityInstrumentation/README.md index b35798d5b4dbe835da00f7324c7d480080360fb0..8082c2b6e53188fe4017d3fe37d9e87ff9a8cbfb 100644 --- a/prebuilts/gradle/ActivityInstrumentation/README.md +++ b/prebuilts/gradle/ActivityInstrumentation/README.md @@ -8,8 +8,8 @@ internal state of an Activity. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Getting Started diff --git a/prebuilts/gradle/ActivityInstrumentation/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/ActivityInstrumentation/gradle/wrapper/gradle-wrapper.properties index 4da4a5808fee2512de0bcbe3cd6b2bb866234b02..86fc139ac8ce03bb1d041893a60d25222baf6c33 100644 --- a/prebuilts/gradle/ActivityInstrumentation/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/ActivityInstrumentation/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/ActivitySceneTransitionBasic/Application/build.gradle b/prebuilts/gradle/ActivitySceneTransitionBasic/Application/build.gradle index 90aaa702a673c606f5569372393266bcaf967a52..ec5d2180c828744f864309254633833b132a4def 100644 --- a/prebuilts/gradle/ActivitySceneTransitionBasic/Application/build.gradle +++ b/prebuilts/gradle/ActivitySceneTransitionBasic/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" compile 'com.squareup.picasso:picasso:2.4.0' } @@ -32,12 +34,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 21 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/ActivitySceneTransitionBasic/LICENSE b/prebuilts/gradle/ActivitySceneTransitionBasic/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/ActivitySceneTransitionBasic/LICENSE +++ b/prebuilts/gradle/ActivitySceneTransitionBasic/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/ActivitySceneTransitionBasic/README.md b/prebuilts/gradle/ActivitySceneTransitionBasic/README.md index 93fe2b9b10c447fab3c63e3a26eeb8af0d5d95c4..8a0988144ddeffa9f25ffbdc6fffaed263068c50 100644 --- a/prebuilts/gradle/ActivitySceneTransitionBasic/README.md +++ b/prebuilts/gradle/ActivitySceneTransitionBasic/README.md @@ -19,8 +19,8 @@ See [Defining Custom Animations][1] for all the details on how to do this. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/ActivitySceneTransitionBasic/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/ActivitySceneTransitionBasic/gradle/wrapper/gradle-wrapper.properties index aa3b089c95baba4da4ce553d5bc3c26de45f0e50..cf959fc2237a7f50d7daf014c46824c0cddcdaa6 100644 --- a/prebuilts/gradle/ActivitySceneTransitionBasic/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/ActivitySceneTransitionBasic/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AdvancedImmersiveMode/Application/build.gradle b/prebuilts/gradle/AdvancedImmersiveMode/Application/build.gradle index 19aaaded31477371a7696209da80fa77443e89ec..7a89aa1475bdcc177ad6bf9b5e4e45ac50fce73e 100644 --- a/prebuilts/gradle/AdvancedImmersiveMode/Application/build.gradle +++ b/prebuilts/gradle/AdvancedImmersiveMode/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -31,12 +33,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 19 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/AdvancedImmersiveMode/LICENSE b/prebuilts/gradle/AdvancedImmersiveMode/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AdvancedImmersiveMode/LICENSE +++ b/prebuilts/gradle/AdvancedImmersiveMode/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AdvancedImmersiveMode/README.md b/prebuilts/gradle/AdvancedImmersiveMode/README.md index a03c8e63e06a22f9f86bf243368409235049e9f2..1a2707f586838815c0a10d7c225bd658d8b7a108 100644 --- a/prebuilts/gradle/AdvancedImmersiveMode/README.md +++ b/prebuilts/gradle/AdvancedImmersiveMode/README.md @@ -26,8 +26,8 @@ appear. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AdvancedImmersiveMode/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AdvancedImmersiveMode/gradle/wrapper/gradle-wrapper.properties index 2d6fb9789600ffe304c2798d17ee4a2a44bc563c..064a15ccf6c93db378171ffe047f6140e40e91cb 100644 --- a/prebuilts/gradle/AdvancedImmersiveMode/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AdvancedImmersiveMode/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AgendaData/Application/build.gradle b/prebuilts/gradle/AgendaData/Application/build.gradle index d053b96bd2d2a19ee33eeb295e321f8cbf163137..44ae53b228fdd761f8a694446d4935fdc3cd5530 100644 --- a/prebuilts/gradle/AgendaData/Application/build.gradle +++ b/prebuilts/gradle/AgendaData/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,16 +14,17 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" - compile 'com.android.support:design:24.0.0' - compile 'com.google.android.gms:play-services-wearable:10.2.4' - compile 'com.android.support:support-v13:25.3.1' + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" + compile 'com.android.support:design:25.4.0' + compile 'com.google.android.gms:play-services-wearable:11.8.0' + compile 'com.android.support:support-v13:27.0.2' wearApp project(':Wearable') } @@ -35,8 +37,9 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 18 diff --git a/prebuilts/gradle/AgendaData/LICENSE b/prebuilts/gradle/AgendaData/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AgendaData/LICENSE +++ b/prebuilts/gradle/AgendaData/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AgendaData/README.md b/prebuilts/gradle/AgendaData/README.md index c6c27e71be99f99a3670b45fb5ca75c4a65ef371..4c2e556712cd0e1688b6414fecb4b6e7541d9f64 100644 --- a/prebuilts/gradle/AgendaData/README.md +++ b/prebuilts/gradle/AgendaData/README.md @@ -22,8 +22,8 @@ success or failure. The sample shows implementations for both the success as wel Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AgendaData/Wearable/build.gradle b/prebuilts/gradle/AgendaData/Wearable/build.gradle index 780ff9b1682afa6b7316ed5016c1a21c3fe99e74..e8691582036f70e68b803a739c351443a46565b1 100644 --- a/prebuilts/gradle/AgendaData/Wearable/build.gradle +++ b/prebuilts/gradle/AgendaData/Wearable/build.gradle @@ -2,27 +2,33 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.1' + classpath 'com.android.tools.build:gradle:3.0.1' } } apply plugin: 'com.android.application' +repositories { + jcenter() + google() +} + dependencies { - compile 'com.google.android.gms:play-services-wearable:10.2.4' - compile 'com.android.support:support-v13:25.3.1' + compile 'com.google.android.gms:play-services-wearable:11.8.0' + compile 'com.android.support:support-v13:27.0.2' - provided 'com.google.android.wearable:wearable:2.0.1' + provided 'com.google.android.wearable:wearable:2.2.0' - compile 'com.google.android.support:wearable:2.0.1' + compile 'com.google.android.support:wearable:2.2.0' } @@ -35,17 +41,20 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { versionCode 1 versionName "1.0" - minSdkVersion 18 + minSdkVersion 23 targetSdkVersion 25 + + } compileOptions { diff --git a/prebuilts/gradle/AgendaData/Wearable/src/main/AndroidManifest.xml b/prebuilts/gradle/AgendaData/Wearable/src/main/AndroidManifest.xml index f8bbdd80b690df6e2b06d131dcc1381358eb70bd..0d4831056cca7c7cf8bc6ed6e5c41b8ad318e96f 100644 --- a/prebuilts/gradle/AgendaData/Wearable/src/main/AndroidManifest.xml +++ b/prebuilts/gradle/AgendaData/Wearable/src/main/AndroidManifest.xml @@ -17,7 +17,7 @@ - diff --git a/prebuilts/gradle/AgendaData/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AgendaData/gradle/wrapper/gradle-wrapper.properties index 7a7c4663bfb64c3b20b6769a825507d0ccb45df0..f5d30b76e9ab51ade02fc5632e52c507910e27f0 100644 --- a/prebuilts/gradle/AgendaData/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AgendaData/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AlwaysOn/LICENSE b/prebuilts/gradle/AlwaysOn/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AlwaysOn/LICENSE +++ b/prebuilts/gradle/AlwaysOn/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AlwaysOn/NOTICE b/prebuilts/gradle/AlwaysOn/NOTICE index 8f8105ae655ec234a5e951086fceaa449e7ea2d6..22aef3807d130f4d8782f74e02dcbe21b59f6bff 100644 --- a/prebuilts/gradle/AlwaysOn/NOTICE +++ b/prebuilts/gradle/AlwaysOn/NOTICE @@ -1,7 +1,7 @@ This sample uses the following software: -Copyright 2017 The Android Open Source Project +Copyright 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/prebuilts/gradle/AlwaysOn/README.md b/prebuilts/gradle/AlwaysOn/README.md index e7d88f4688a5a476070b1ff5dbb7976de479ebca..714087477ad277f73122c9b59c1dcad8b29fc995 100644 --- a/prebuilts/gradle/AlwaysOn/README.md +++ b/prebuilts/gradle/AlwaysOn/README.md @@ -24,8 +24,8 @@ As always, you will still want to apply the [performance guidelines][3] outlined Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AlwaysOn/Wearable/build.gradle b/prebuilts/gradle/AlwaysOn/Wearable/build.gradle index 9b5c9341b38d2fcaf401c5fd27dd55b20dfa9a4c..6dcee97578f6b461060083239404108ddb48b717 100644 --- a/prebuilts/gradle/AlwaysOn/Wearable/build.gradle +++ b/prebuilts/gradle/AlwaysOn/Wearable/build.gradle @@ -2,27 +2,34 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.1' + classpath 'com.android.tools.build:gradle:3.0.1' } } apply plugin: 'com.android.application' +repositories { + jcenter() + google() +} + dependencies { + compile 'com.android.support:wear:27.0.2' - compile 'com.google.android.gms:play-services-wearable:10.2.4' - compile 'com.android.support:support-v13:25.3.1' + compile 'com.google.android.gms:play-services-wearable:11.8.0' + compile 'com.android.support:support-v13:27.0.2' - provided 'com.google.android.wearable:wearable:2.0.1' + provided 'com.google.android.wearable:wearable:2.2.0' - compile 'com.google.android.support:wearable:2.0.1' + compile 'com.google.android.support:wearable:2.2.0' } @@ -35,17 +42,21 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 26 + + buildToolsVersion "27.0.2" defaultConfig { versionCode 1 versionName "1.0" - minSdkVersion 24 + minSdkVersion 23 + + targetSdkVersion 26 + + multiDexEnabled true - targetSdkVersion 25 } compileOptions { diff --git a/prebuilts/gradle/AlwaysOn/Wearable/src/main/java/com/example/android/wearable/wear/alwayson/MainActivity.java b/prebuilts/gradle/AlwaysOn/Wearable/src/main/java/com/example/android/wearable/wear/alwayson/MainActivity.java index 3673545e0a1f980914f71ca128b3e666f6e59540..76e14f0c2e279ec176c93732bd27628cc69ae7f4 100644 --- a/prebuilts/gradle/AlwaysOn/Wearable/src/main/java/com/example/android/wearable/wear/alwayson/MainActivity.java +++ b/prebuilts/gradle/AlwaysOn/Wearable/src/main/java/com/example/android/wearable/wear/alwayson/MainActivity.java @@ -15,17 +15,20 @@ */ package com.example.android.wearable.wear.alwayson; +import android.app.Activity; import android.app.AlarmManager; import android.app.PendingIntent; +import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; +import android.content.IntentFilter; import android.graphics.Color; import android.os.Bundle; import android.os.Handler; import android.os.Message; -import android.support.wearable.activity.WearableActivity; -import android.support.wearable.view.WatchViewStub; +import android.support.wear.ambient.AmbientMode; import android.util.Log; +import android.view.View; import android.widget.TextView; import java.lang.ref.WeakReference; @@ -35,36 +38,41 @@ import java.util.Locale; import java.util.concurrent.TimeUnit; /** - * Demonstrates support for Ambient screens by extending WearableActivity and overriding - * onEnterAmbient, onUpdateAmbient, and onExitAmbient. + * Demonstrates support for Ambient Mode by attaching ambient mode support to the activity, + * and listening for ambient mode updates (onEnterAmbient, onUpdateAmbient, and onExitAmbient) via a + * named AmbientCallback subclass. * - * There are two modes (Active and Ambient). To trigger future updates (data/screen), we use a - * custom Handler for the "Active" mode and an Alarm for the "Ambient" mode. + *

Also demonstrates how to update the display more frequently than every 60 seconds, which is + * the default frequency, using an AlarmManager. The Alarm code is only necessary for the custom + * refresh frequency; it can be ignored for basic ambient mode support where you can simply rely on + * calls to onUpdateAmbient() by the system. * - * Why don't we use just one? Handlers are generally less battery intensive and can be triggered - * every second. However, they can not wake up the processor (common in Ambient mode). + *

There are two modes: ambient and active. To trigger future display updates, we + * use a custom Handler for active mode and an Alarm for ambient mode. * - * Alarms can wake up the processor (what we need for Ambient), but they struggle with quick updates - * (less than one second) and are much less efficient compared to Handlers. + *

Why not use just one or the other? Handlers are generally less battery intensive and can be + * triggered every second. However, they can not wake up the processor (common in ambient mode). * - * Therefore, we use Handlers for "Active" mode (can trigger every second and are better on the - * battery), and we use Alarms for "Ambient" mode (only need to update once every 20 seconds and + *

Alarms can wake up the processor (what we need for ambient move), but they are less efficient + * compared to Handlers when it comes to quick update frequencies. + * + *

Therefore, we use Handler for active mode (can trigger every second and are better on the + * battery), and we use an Alarm for ambient mode (only need to update once every 10 seconds and * they can wake up a sleeping processor). * - * Again, the Activity waits 20 seconds between doing any processing (getting data, updating screen - * etc.) while in ambient mode to conserving battery life (processor allowed to sleep). If you can - * hold off on updates for a full minute, you can throw away all the Alarm code and just use + *

The activity waits 10 seconds between doing any processing (getting data, updating display + * etc.) while in ambient mode to conserving battery life (processor allowed to sleep). If your app + * can wait 60 seconds for display updates, you can disregard the Alarm code and simply use * onUpdateAmbient() to save even more battery life. * - * As always, you will still want to apply the performance guidelines outlined in the Watch Faces - * documention to your app. - * - * Finally, in ambient mode, this Activity follows the same best practices outlined in the - * Watch Faces API documentation, e.g., keep most pixels black, avoid large blocks of white pixels, - * use only black and white, and disable anti-aliasing. + *

As always, you will still want to apply the performance guidelines outlined in the Watch Faces + * documentation to your app. * + *

Finally, in ambient mode, this activity follows the same best practices outlined in the Watch + * Faces API documentation: keeping most pixels black, avoiding large blocks of white pixels, using + * only black and white, disabling anti-aliasing, etc. */ -public class MainActivity extends WearableActivity { +public class MainActivity extends Activity implements AmbientMode.AmbientCallbackProvider { private static final String TAG = "MainActivity"; @@ -73,38 +81,59 @@ public class MainActivity extends WearableActivity { /** Milliseconds between updates based on state. */ private static final long ACTIVE_INTERVAL_MS = TimeUnit.SECONDS.toMillis(1); - private static final long AMBIENT_INTERVAL_MS = TimeUnit.SECONDS.toMillis(20); - /** Tracks latest ambient details, such as burnin offsets, etc. */ - private Bundle mAmbientDetails; + private static final long AMBIENT_INTERVAL_MS = TimeUnit.SECONDS.toMillis(10); + + /** Action for updating the display in ambient mode, per our custom refresh cycle. */ + private static final String AMBIENT_UPDATE_ACTION = + "com.example.android.wearable.wear.alwayson.action.AMBIENT_UPDATE"; + + /** Number of pixels to offset the content rendered in the display to prevent screen burn-in. */ + private static final int BURN_IN_OFFSET_PX = 10; + + /** + * Ambient mode controller attached to this display. Used by Activity to see if it is in + * ambient mode. + */ + private AmbientMode.AmbientController mAmbientController; + + /** If the display is low-bit in ambient mode. i.e. it requires anti-aliased fonts. */ + boolean mIsLowBitAmbient; + + /** + * If the display requires burn-in protection in ambient mode, rendered pixels need to be + * intermittently offset to avoid screen burn-in. + */ + boolean mDoBurnInProtection; + private View mContentView; private TextView mTimeTextView; private TextView mTimeStampTextView; private TextView mStateTextView; private TextView mUpdateRateTextView; private TextView mDrawCountTextView; - private final SimpleDateFormat sDateFormat = - new SimpleDateFormat("HH:mm:ss", Locale.US); + private final SimpleDateFormat sDateFormat = new SimpleDateFormat("HH:mm:ss", Locale.US); private volatile int mDrawCount = 0; - /** * Since the handler (used in active mode) can't wake up the processor when the device is in * ambient mode and undocked, we use an Alarm to cover ambient mode updates when we need them - * more frequently than every minute. Remember, if getting updates once a minute in ambient - * mode is enough, you can do away with the Alarm code and just rely on the onUpdateAmbient() + * more frequently than every minute. Remember, if getting updates once a minute in ambient mode + * is enough, you can do away with the Alarm code and just rely on the onUpdateAmbient() * callback. */ - private AlarmManager mAmbientStateAlarmManager; - private PendingIntent mAmbientStatePendingIntent; + private AlarmManager mAmbientUpdateAlarmManager; + + private PendingIntent mAmbientUpdatePendingIntent; + private BroadcastReceiver mAmbientUpdateBroadcastReceiver; /** * This custom handler is used for updates in "Active" mode. We use a separate static class to * help us avoid memory leaks. */ - private final Handler mActiveModeUpdateHandler = new UpdateHandler(this); + private final Handler mActiveModeUpdateHandler = new ActiveModeUpdateHandler(this); @Override public void onCreate(Bundle savedInstanceState) { @@ -113,135 +142,72 @@ public class MainActivity extends WearableActivity { setContentView(R.layout.activity_main); - setAmbientEnabled(); - - mAmbientStateAlarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); - Intent ambientStateIntent = new Intent(getApplicationContext(), MainActivity.class); - - mAmbientStatePendingIntent = PendingIntent.getActivity( - getApplicationContext(), - 0 /* requestCode */, - ambientStateIntent, - PendingIntent.FLAG_UPDATE_CURRENT); + mAmbientController = AmbientMode.attachAmbientSupport(this); + mAmbientUpdateAlarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); - /** Determines whether watch is round or square and applies proper view. **/ - final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub); - stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() { - @Override - public void onLayoutInflated(WatchViewStub stub) { - - mTimeTextView = (TextView) stub.findViewById(R.id.time); - mTimeStampTextView = (TextView) stub.findViewById(R.id.time_stamp); - mStateTextView = (TextView) stub.findViewById(R.id.state); - mUpdateRateTextView = (TextView) stub.findViewById(R.id.update_rate); - mDrawCountTextView = (TextView) stub.findViewById(R.id.draw_count); - - refreshDisplayAndSetNextUpdate(); - } - }); - } - - /** - * This is mostly triggered by the Alarms we set in Ambient mode and informs us we need to - * update the screen (and process any data). - */ - @Override - public void onNewIntent(Intent intent) { - Log.d(TAG, "onNewIntent(): " + intent); - super.onNewIntent(intent); - - setIntent(intent); - - refreshDisplayAndSetNextUpdate(); - } - - @Override - public void onDestroy() { - Log.d(TAG, "onDestroy()"); - - mActiveModeUpdateHandler.removeMessages(MSG_UPDATE_SCREEN); - mAmbientStateAlarmManager.cancel(mAmbientStatePendingIntent); - - super.onDestroy(); - } - - /** - * Prepares UI for Ambient view. - */ - @Override - public void onEnterAmbient(Bundle ambientDetails) { - Log.d(TAG, "onEnterAmbient()"); - super.onEnterAmbient(ambientDetails); - - /** - * In this sample, we aren't using the ambient details bundle (EXTRA_BURN_IN_PROTECTION or - * EXTRA_LOWBIT_AMBIENT), but if you need them, you can pull them from the local variable - * set here. + /* + * Create a PendingIntent which we'll give to the AlarmManager to send ambient mode updates + * on an interval which we've define. */ - mAmbientDetails = ambientDetails; - - /** Clears Handler queue (only needed for updates in active mode). */ - mActiveModeUpdateHandler.removeMessages(MSG_UPDATE_SCREEN); - - /** - * Following best practices outlined in WatchFaces API (keeping most pixels black, - * avoiding large blocks of white pixels, using only black and white, - * and disabling anti-aliasing anti-aliasing, etc.) + Intent ambientUpdateIntent = new Intent(AMBIENT_UPDATE_ACTION); + + /* + * Retrieves a PendingIntent that will perform a broadcast. You could also use getActivity() + * to retrieve a PendingIntent that will start a new activity, but be aware that actually + * triggers onNewIntent() which causes lifecycle changes (onPause() and onResume()) which + * might trigger code to be re-executed more often than you want. + * + * If you do end up using getActivity(), also make sure you have set activity launchMode to + * singleInstance in the manifest. + * + * Otherwise, it is easy for the AlarmManager launch Intent to open a new activity + * every time the Alarm is triggered rather than reusing this Activity. */ - mStateTextView.setTextColor(Color.WHITE); - mUpdateRateTextView.setTextColor(Color.WHITE); - mDrawCountTextView.setTextColor(Color.WHITE); + mAmbientUpdatePendingIntent = + PendingIntent.getBroadcast( + this, 0, ambientUpdateIntent, PendingIntent.FLAG_UPDATE_CURRENT); - mTimeTextView.getPaint().setAntiAlias(false); - mTimeStampTextView.getPaint().setAntiAlias(false); - mStateTextView.getPaint().setAntiAlias(false); - mUpdateRateTextView.getPaint().setAntiAlias(false); - mDrawCountTextView.getPaint().setAntiAlias(false); - - refreshDisplayAndSetNextUpdate(); + /* + * An anonymous broadcast receiver which will receive ambient update requests and trigger + * display refresh. + */ + mAmbientUpdateBroadcastReceiver = + new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + refreshDisplayAndSetNextUpdate(); + } + }; + + mContentView = findViewById(R.id.content_view); + mTimeTextView = findViewById(R.id.time); + mTimeStampTextView = findViewById(R.id.time_stamp); + mStateTextView = findViewById(R.id.state); + mUpdateRateTextView = findViewById(R.id.update_rate); + mDrawCountTextView = findViewById(R.id.draw_count); } - /** - * Updates UI in Ambient view (once a minute). Because we need to update UI sooner than that - * (every ~20 seconds), we also use an Alarm. However, since the processor is awake for this - * callback, we might as well call refreshDisplayAndSetNextUpdate() to update screen and reset - * the Alarm. - * - * If you are happy with just updating the screen once a minute in Ambient Mode (which will be - * the case a majority of the time), then you can just use this method and remove all - * references/code regarding Alarms. - */ @Override - public void onUpdateAmbient() { - Log.d(TAG, "onUpdateAmbient()"); - super.onUpdateAmbient(); + public void onResume() { + Log.d(TAG, "onResume()"); + super.onResume(); + + IntentFilter filter = new IntentFilter(AMBIENT_UPDATE_ACTION); + registerReceiver(mAmbientUpdateBroadcastReceiver, filter); refreshDisplayAndSetNextUpdate(); } - /** - * Prepares UI for Active view (non-Ambient). - */ @Override - public void onExitAmbient() { - Log.d(TAG, "onExitAmbient()"); - super.onExitAmbient(); + public void onPause() { + Log.d(TAG, "onPause()"); + super.onPause(); - /** Clears out Alarms since they are only used in ambient mode. */ - mAmbientStateAlarmManager.cancel(mAmbientStatePendingIntent); + unregisterReceiver(mAmbientUpdateBroadcastReceiver); - mStateTextView.setTextColor(Color.GREEN); - mUpdateRateTextView.setTextColor(Color.GREEN); - mDrawCountTextView.setTextColor(Color.GREEN); - - mTimeTextView.getPaint().setAntiAlias(true); - mTimeStampTextView.getPaint().setAntiAlias(true); - mStateTextView.getPaint().setAntiAlias(true); - mUpdateRateTextView.getPaint().setAntiAlias(true); - mDrawCountTextView.getPaint().setAntiAlias(true); - - refreshDisplayAndSetNextUpdate(); + mActiveModeUpdateHandler.removeMessages(MSG_UPDATE_SCREEN); + mAmbientUpdateAlarmManager.cancel(mAmbientUpdatePendingIntent); } /** @@ -254,23 +220,15 @@ public class MainActivity extends WearableActivity { long timeMs = System.currentTimeMillis(); - if (isAmbient()) { - /** Calculate next trigger time (based on state). */ + if (mAmbientController.isAmbient()) { + /* Calculate next trigger time (based on state). */ long delayMs = AMBIENT_INTERVAL_MS - (timeMs % AMBIENT_INTERVAL_MS); long triggerTimeMs = timeMs + delayMs; - /** - * Note: Make sure you have set activity launchMode to singleInstance in the manifest. - * Otherwise, it is easy for the AlarmManager launch intent to open a new activity - * every time the Alarm is triggered rather than reusing this Activity. - */ - mAmbientStateAlarmManager.setExact( - AlarmManager.RTC_WAKEUP, - triggerTimeMs, - mAmbientStatePendingIntent); - + mAmbientUpdateAlarmManager.setExact( + AlarmManager.RTC_WAKEUP, triggerTimeMs, mAmbientUpdatePendingIntent); } else { - /** Calculate next trigger time (based on state). */ + /* Calculate next trigger time (based on state). */ long delayMs = ACTIVE_INTERVAL_MS - (timeMs % ACTIVE_INTERVAL_MS); mActiveModeUpdateHandler.removeMessages(MSG_UPDATE_SCREEN); @@ -278,16 +236,20 @@ public class MainActivity extends WearableActivity { } } - /** - * Updates display based on Ambient state. If you need to pull data, you should do it here. - */ + /** Updates display based on Ambient state. If you need to pull data, you should do it here. */ private void loadDataAndUpdateScreen() { mDrawCount += 1; long currentTimeMs = System.currentTimeMillis(); - Log.d(TAG, "loadDataAndUpdateScreen(): " + currentTimeMs + "(" + isAmbient() + ")"); + Log.d( + TAG, + "loadDataAndUpdateScreen(): " + + currentTimeMs + + "(" + + mAmbientController.isAmbient() + + ")"); - if (isAmbient()) { + if (mAmbientController.isAmbient()) { mTimeTextView.setText(sDateFormat.format(new Date())); mTimeStampTextView.setText(getString(R.string.timestamp_label, currentTimeMs)); @@ -299,6 +261,7 @@ public class MainActivity extends WearableActivity { mDrawCountTextView.setText(getString(R.string.draw_count_label, mDrawCount)); } else { + mTimeTextView.setText(sDateFormat.format(new Date())); mTimeStampTextView.setText(getString(R.string.timestamp_label, currentTimeMs)); @@ -310,14 +273,108 @@ public class MainActivity extends WearableActivity { } } - /** - * Handler separated into static class to avoid memory leaks. - */ - private static class UpdateHandler extends Handler { + @Override + public AmbientMode.AmbientCallback getAmbientCallback() { + return new MyAmbientCallback(); + } + + private class MyAmbientCallback extends AmbientMode.AmbientCallback { + /** Prepares the UI for ambient mode. */ + @Override + public void onEnterAmbient(Bundle ambientDetails) { + super.onEnterAmbient(ambientDetails); + + mIsLowBitAmbient = ambientDetails.getBoolean(AmbientMode.EXTRA_LOWBIT_AMBIENT, false); + mDoBurnInProtection = + ambientDetails.getBoolean(AmbientMode.EXTRA_BURN_IN_PROTECTION, false); + + /* Clears Handler queue (only needed for updates in active mode). */ + mActiveModeUpdateHandler.removeMessages(MSG_UPDATE_SCREEN); + + /* + * Following best practices outlined in WatchFaces API (keeping most pixels black, + * avoiding large blocks of white pixels, using only black and white, and disabling + * anti-aliasing, etc.) + */ + mStateTextView.setTextColor(Color.WHITE); + mUpdateRateTextView.setTextColor(Color.WHITE); + mDrawCountTextView.setTextColor(Color.WHITE); + + if (mIsLowBitAmbient) { + mTimeTextView.getPaint().setAntiAlias(false); + mTimeStampTextView.getPaint().setAntiAlias(false); + mStateTextView.getPaint().setAntiAlias(false); + mUpdateRateTextView.getPaint().setAntiAlias(false); + mDrawCountTextView.getPaint().setAntiAlias(false); + } + + refreshDisplayAndSetNextUpdate(); + } + + /** + * Updates the display in ambient mode on the standard interval. Since we're using a custom + * refresh cycle, this method does NOT update the data in the display. Rather, this method + * simply updates the positioning of the data in the screen to avoid burn-in, if the display + * requires it. + */ + @Override + public void onUpdateAmbient() { + super.onUpdateAmbient(); + + /* + * If the screen requires burn-in protection, views must be shifted around periodically + * in ambient mode. To ensure that content isn't shifted off the screen, avoid placing + * content within 10 pixels of the edge of the screen. + * + * Since we're potentially applying negative padding, we have ensured + * that the containing view is sufficiently padded (see res/layout/activity_main.xml). + * + * Activities should also avoid solid white areas to prevent pixel burn-in. Both of + * these requirements only apply in ambient mode, and only when this property is set + * to true. + */ + if (mDoBurnInProtection) { + int x = (int) (Math.random() * 2 * BURN_IN_OFFSET_PX - BURN_IN_OFFSET_PX); + int y = (int) (Math.random() * 2 * BURN_IN_OFFSET_PX - BURN_IN_OFFSET_PX); + mContentView.setPadding(x, y, 0, 0); + } + } + + /** Restores the UI to active (non-ambient) mode. */ + @Override + public void onExitAmbient() { + super.onExitAmbient(); + + /* Clears out Alarms since they are only used in ambient mode. */ + mAmbientUpdateAlarmManager.cancel(mAmbientUpdatePendingIntent); + + mStateTextView.setTextColor(Color.GREEN); + mUpdateRateTextView.setTextColor(Color.GREEN); + mDrawCountTextView.setTextColor(Color.GREEN); + + if (mIsLowBitAmbient) { + mTimeTextView.getPaint().setAntiAlias(true); + mTimeStampTextView.getPaint().setAntiAlias(true); + mStateTextView.getPaint().setAntiAlias(true); + mUpdateRateTextView.getPaint().setAntiAlias(true); + mDrawCountTextView.getPaint().setAntiAlias(true); + } + + /* Reset any random offset applied for burn-in protection. */ + if (mDoBurnInProtection) { + mContentView.setPadding(0, 0, 0, 0); + } + + refreshDisplayAndSetNextUpdate(); + } + } + + /** Handler separated into static class to avoid memory leaks. */ + private static class ActiveModeUpdateHandler extends Handler { private final WeakReference mMainActivityWeakReference; - public UpdateHandler(MainActivity reference) { - mMainActivityWeakReference = new WeakReference(reference); + ActiveModeUpdateHandler(MainActivity reference) { + mMainActivityWeakReference = new WeakReference<>(reference); } @Override @@ -333,4 +390,4 @@ public class MainActivity extends WearableActivity { } } } -} \ No newline at end of file +} diff --git a/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/activity_main.xml b/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/activity_main.xml index d808e6bbb5e0d3b9b05752038c1ab5865f29772a..662bbe8f4d62aa4f93e20f799018089a71ef3087 100644 --- a/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/activity_main.xml +++ b/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/activity_main.xml @@ -1,5 +1,4 @@ - - + - + android:padding="10px" + tools:context=".MainActivity"> + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/rect_activity_main.xml b/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/rect_activity_main.xml deleted file mode 100644 index bfb8147706e6652d11a38c49688e68e213351d77..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/rect_activity_main.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - diff --git a/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/round_activity_main.xml b/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/round_activity_main.xml deleted file mode 100644 index 8fa7a2df4ca587da84334c55b7052850eb36b52c..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/layout/round_activity_main.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - diff --git a/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/values/dimens.xml b/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/values/dimens.xml deleted file mode 100644 index d44096abc81346856d274dd0a34cb0d91ff5c4a8..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AlwaysOn/Wearable/src/main/res/values/dimens.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - 24dp - 16dp - - 34dp - 34dp - diff --git a/prebuilts/gradle/AlwaysOn/build.gradle b/prebuilts/gradle/AlwaysOn/build.gradle index 1dac6def475897204170c39bc31939ebfe2c931e..b03b722f5573513147315af9b447d622de8ab21f 100644 --- a/prebuilts/gradle/AlwaysOn/build.gradle +++ b/prebuilts/gradle/AlwaysOn/build.gradle @@ -9,3 +9,9 @@ + +buildscript { + repositories { + google() + } +} \ No newline at end of file diff --git a/prebuilts/gradle/AlwaysOn/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AlwaysOn/gradle/wrapper/gradle-wrapper.properties index c2cde241478f19eac76dc8d5d7312cc2c0f4d2c1..2ceef0316f2e337908cff12cc05bb589506c22df 100644 --- a/prebuilts/gradle/AlwaysOn/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AlwaysOn/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AppRestrictionEnforcer/Application/build.gradle b/prebuilts/gradle/AppRestrictionEnforcer/Application/build.gradle index a96785caaa11c3b842836b0c2fb8ac7e77e7b036..3cdc07d1852b237cc277efd4545e32caf8f5e813 100644 --- a/prebuilts/gradle/AppRestrictionEnforcer/Application/build.gradle +++ b/prebuilts/gradle/AppRestrictionEnforcer/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -31,12 +33,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 21 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/AppRestrictionEnforcer/LICENSE b/prebuilts/gradle/AppRestrictionEnforcer/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AppRestrictionEnforcer/LICENSE +++ b/prebuilts/gradle/AppRestrictionEnforcer/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AppRestrictionEnforcer/README.md b/prebuilts/gradle/AppRestrictionEnforcer/README.md index c92a38999ddbd3bffca9ec98ac780c7caf859f99..c379650c716e51a7fc6cd17bdcdfdef5f98e9e32 100644 --- a/prebuilts/gradle/AppRestrictionEnforcer/README.md +++ b/prebuilts/gradle/AppRestrictionEnforcer/README.md @@ -27,8 +27,8 @@ See the [AppRestrictionSchema sample][2] for further details. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AppRestrictionEnforcer/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AppRestrictionEnforcer/gradle/wrapper/gradle-wrapper.properties index 22aa0ef4b9a55a68a1f4d4cf855d99e3166f80bd..7b9b6541aabcf53a5fc00ae0b25e237aa46d72db 100644 --- a/prebuilts/gradle/AppRestrictionEnforcer/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AppRestrictionEnforcer/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AppRestrictionSchema/Application/build.gradle b/prebuilts/gradle/AppRestrictionSchema/Application/build.gradle index a96785caaa11c3b842836b0c2fb8ac7e77e7b036..3cdc07d1852b237cc277efd4545e32caf8f5e813 100644 --- a/prebuilts/gradle/AppRestrictionSchema/Application/build.gradle +++ b/prebuilts/gradle/AppRestrictionSchema/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -31,12 +33,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 21 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/AppRestrictionSchema/LICENSE b/prebuilts/gradle/AppRestrictionSchema/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AppRestrictionSchema/LICENSE +++ b/prebuilts/gradle/AppRestrictionSchema/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AppRestrictionSchema/README.md b/prebuilts/gradle/AppRestrictionSchema/README.md index 3f20773ce75cd8d816ec03f54a0612e88560f270..b95f86806ec3c1b502da77850efbc644a25a659d 100644 --- a/prebuilts/gradle/AppRestrictionSchema/README.md +++ b/prebuilts/gradle/AppRestrictionSchema/README.md @@ -54,8 +54,8 @@ checked by calling [RestrictionsManager.getApplicationRestrictions()][2]. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AppRestrictionSchema/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AppRestrictionSchema/gradle/wrapper/gradle-wrapper.properties index 819aeb4a5a8f789713b1efc0c55a7715db2a9752..ade4ceeb0f2fc3ef02d2782fa919a46708b3479b 100644 --- a/prebuilts/gradle/AppRestrictionSchema/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AppRestrictionSchema/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AppRestrictions/Application/build.gradle b/prebuilts/gradle/AppRestrictions/Application/build.gradle index 60de96824fff2ebbebc121381809e0706d856afd..aa618ba79a1452e819cb0c8976f40eaead69351f 100644 --- a/prebuilts/gradle/AppRestrictions/Application/build.gradle +++ b/prebuilts/gradle/AppRestrictions/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -31,12 +33,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 18 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/AppRestrictions/LICENSE b/prebuilts/gradle/AppRestrictions/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AppRestrictions/LICENSE +++ b/prebuilts/gradle/AppRestrictions/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AppRestrictions/README.md b/prebuilts/gradle/AppRestrictions/README.md index ff6fe2872713803919d28f6ca69aee9c939accab..bd1445e0efb3c63c2d1af21eb387b70607cf50cf 100644 --- a/prebuilts/gradle/AppRestrictions/README.md +++ b/prebuilts/gradle/AppRestrictions/README.md @@ -27,8 +27,8 @@ profile through the [UserManager][2]. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AppRestrictions/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AppRestrictions/gradle/wrapper/gradle-wrapper.properties index 4da4a5808fee2512de0bcbe3cd6b2bb866234b02..86fc139ac8ce03bb1d041893a60d25222baf6c33 100644 --- a/prebuilts/gradle/AppRestrictions/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AppRestrictions/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AppShortcuts/LICENSE b/prebuilts/gradle/AppShortcuts/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AppShortcuts/LICENSE +++ b/prebuilts/gradle/AppShortcuts/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AppShortcuts/NOTICE b/prebuilts/gradle/AppShortcuts/NOTICE index 8f8105ae655ec234a5e951086fceaa449e7ea2d6..22aef3807d130f4d8782f74e02dcbe21b59f6bff 100644 --- a/prebuilts/gradle/AppShortcuts/NOTICE +++ b/prebuilts/gradle/AppShortcuts/NOTICE @@ -1,7 +1,7 @@ This sample uses the following software: -Copyright 2017 The Android Open Source Project +Copyright 2018 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/prebuilts/gradle/AppShortcuts/README.md b/prebuilts/gradle/AppShortcuts/README.md index 61ec0d614dd80279544036e624118fbe63255e1d..64c8aa33f27b68bc5ea25a1f90a3f532cb489a7a 100644 --- a/prebuilts/gradle/AppShortcuts/README.md +++ b/prebuilts/gradle/AppShortcuts/README.md @@ -39,8 +39,8 @@ For more information on creating shortcuts, see the [Shortcuts to App Actions][1 Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AppShortcuts/build.gradle b/prebuilts/gradle/AppShortcuts/build.gradle index a8de426ca8c713cf087a3150c3fd810f88bf187b..ba9e937e394bd502a312a4f69e8e811386156054 100644 --- a/prebuilts/gradle/AppShortcuts/build.gradle +++ b/prebuilts/gradle/AppShortcuts/build.gradle @@ -4,7 +4,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' + classpath 'com.android.tools.build:gradle:3.0.0' } } diff --git a/prebuilts/gradle/AppShortcuts/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AppShortcuts/gradle/wrapper/gradle-wrapper.properties index a3a3b57b6067ad70f09ec4be0629c11437ada3ec..ce4e724f172f56607eb01bfd962d80ffd220f239 100644 --- a/prebuilts/gradle/AppShortcuts/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AppShortcuts/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AppUsageStatistics/Application/build.gradle b/prebuilts/gradle/AppUsageStatistics/Application/build.gradle index e40e49d17a61ffffec01da8b23c32f4046f0103b..ad18f5a3b063a15a4f5de09a21051e2fb0b7f82c 100644 --- a/prebuilts/gradle/AppUsageStatistics/Application/build.gradle +++ b/prebuilts/gradle/AppUsageStatistics/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" compile 'com.android.support:recyclerview-v7:+' compile 'com.android.support:appcompat-v7:21.+' } @@ -33,12 +35,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 21 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/AppUsageStatistics/Application/src/main/java/com/example/android/appusagestatistics/AppUsageStatisticsActivity.java b/prebuilts/gradle/AppUsageStatistics/Application/src/main/java/com/example/android/appusagestatistics/AppUsageStatisticsActivity.java index 4def465ff658210a3d26dbfafddff8ee0064fbbb..0f733988f801c7c85330b77db19dc0bdb9fe8a4f 100644 --- a/prebuilts/gradle/AppUsageStatistics/Application/src/main/java/com/example/android/appusagestatistics/AppUsageStatisticsActivity.java +++ b/prebuilts/gradle/AppUsageStatistics/Application/src/main/java/com/example/android/appusagestatistics/AppUsageStatisticsActivity.java @@ -17,12 +17,12 @@ package com.example.android.appusagestatistics; import android.os.Bundle; -import android.support.v7.app.ActionBarActivity; +import android.support.v7.app.AppCompatActivity; /** * Launcher Activity for the App Usage Statistics sample app. */ -public class AppUsageStatisticsActivity extends ActionBarActivity { +public class AppUsageStatisticsActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { @@ -34,4 +34,4 @@ public class AppUsageStatisticsActivity extends ActionBarActivity { .commit(); } } -} \ No newline at end of file +} diff --git a/prebuilts/gradle/AppUsageStatistics/LICENSE b/prebuilts/gradle/AppUsageStatistics/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AppUsageStatistics/LICENSE +++ b/prebuilts/gradle/AppUsageStatistics/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AppUsageStatistics/README.md b/prebuilts/gradle/AppUsageStatistics/README.md index db4677908cde02908c5118611b601de59044e20a..25af7d1bc4db9201144669fc08a8d0f04e6e9814 100644 --- a/prebuilts/gradle/AppUsageStatistics/README.md +++ b/prebuilts/gradle/AppUsageStatistics/README.md @@ -49,8 +49,8 @@ and the end of the range of the stats to include in the results. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AppUsageStatistics/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AppUsageStatistics/gradle/wrapper/gradle-wrapper.properties index 4a39e6d5ae7a070b13645564ecdd4b225634c9e9..bc826164043c66074cb7b18475268bb1e6daa4f8 100644 --- a/prebuilts/gradle/AppUsageStatistics/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AppUsageStatistics/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AsymmetricFingerprintDialog/Application/build.gradle b/prebuilts/gradle/AsymmetricFingerprintDialog/Application/build.gradle index 84996ed32bd71e7600489422737c6db30f594d14..98a845433fe48384e4de60943ebec3f88ac89a4b 100644 --- a/prebuilts/gradle/AsymmetricFingerprintDialog/Application/build.gradle +++ b/prebuilts/gradle/AsymmetricFingerprintDialog/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" compile 'com.squareup.dagger:dagger:1.2.2' compile 'com.squareup.dagger:dagger-compiler:1.2.2' compile 'junit:junit:4.12' @@ -35,12 +37,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 23 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/AsymmetricFingerprintDialog/LICENSE b/prebuilts/gradle/AsymmetricFingerprintDialog/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AsymmetricFingerprintDialog/LICENSE +++ b/prebuilts/gradle/AsymmetricFingerprintDialog/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AsymmetricFingerprintDialog/README.md b/prebuilts/gradle/AsymmetricFingerprintDialog/README.md index ce9e94d7a1606c86f02d4dda1387844fc5fce3b2..5d297e4d962173ab717243f5b15800629ccc6efa 100644 --- a/prebuilts/gradle/AsymmetricFingerprintDialog/README.md +++ b/prebuilts/gradle/AsymmetricFingerprintDialog/README.md @@ -38,8 +38,8 @@ client, by verifying the piece of data signed by the Signature. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AsymmetricFingerprintDialog/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AsymmetricFingerprintDialog/gradle/wrapper/gradle-wrapper.properties index 74d071fa1a75d449eae962a09d49930ab2e332ee..8806b786725b20e417b4b0a541000402d237b624 100644 --- a/prebuilts/gradle/AsymmetricFingerprintDialog/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AsymmetricFingerprintDialog/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AutoBackupForApps/Application/build.gradle b/prebuilts/gradle/AutoBackupForApps/Application/build.gradle index cdcf1063c730b94e00a9260f5cf29e4821552b4b..f75d888138883375edaddc6847c36affeca84a74 100644 --- a/prebuilts/gradle/AutoBackupForApps/Application/build.gradle +++ b/prebuilts/gradle/AutoBackupForApps/Application/build.gradle @@ -2,10 +2,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:3.0.1' } } @@ -13,13 +14,14 @@ apply plugin: 'com.android.application' repositories { jcenter() + google() } dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" + compile "com.android.support:support-v4:27.0.2" + compile "com.android.support:support-v13:27.0.2" + compile "com.android.support:cardview-v7:27.0.2" + compile "com.android.support:appcompat-v7:27.0.2" } // The sample build uses multiple directories to @@ -31,12 +33,13 @@ List dirs = [ 'template'] // boilerplate code that is generated by the sample template process android { - compileSdkVersion 25 - buildToolsVersion "25.0.3" + compileSdkVersion 27 + + buildToolsVersion "27.0.2" defaultConfig { minSdkVersion 23 - targetSdkVersion 25 + targetSdkVersion 27 } compileOptions { diff --git a/prebuilts/gradle/AutoBackupForApps/LICENSE b/prebuilts/gradle/AutoBackupForApps/LICENSE index 4f229463d3ec8464e7b6e635fc4f000bf9b7517a..d5cf8f3aa372f0c7c7caeaa3bed2bf809ab7d520 100644 --- a/prebuilts/gradle/AutoBackupForApps/LICENSE +++ b/prebuilts/gradle/AutoBackupForApps/LICENSE @@ -201,447 +201,3 @@ Apache License WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - -All image and audio files (including *.png, *.jpg, *.svg, *.mp3, *.wav -and *.ogg) are licensed under the CC-BY-NC license. All other files are -licensed under the Apache 2 license. - -CC-BY-NC License ----------------- - -Attribution-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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-NonCommercial-ShareAlike 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. BY-NC-SA Compatible License means a license listed at - creativecommons.org/compatiblelicenses, approved by Creative - Commons as essentially the equivalent of this Public License. - - d. 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. - - e. 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. - - f. 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. - - g. License Elements means the license attributes listed in the name - of a Creative Commons Public License. The License Elements of this - Public License are Attribution, NonCommercial, and ShareAlike. - - h. Licensed Material means the artistic or literary work, database, - or other material to which the Licensor applied this Public - License. - - i. 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. - - j. Licensor means the individual(s) or entity(ies) granting rights - under this Public License. - - k. NonCommercial means not primarily intended for or directed towards - commercial advantage or monetary compensation. For purposes of - this Public License, the exchange of the Licensed Material for - other material subject to Copyright and Similar Rights by digital - file-sharing or similar means is NonCommercial provided there is - no payment of monetary compensation in connection with the - exchange. - - l. 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. - - m. 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. - - n. 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, for NonCommercial purposes only; and - - b. produce, reproduce, and Share Adapted Material for - NonCommercial purposes only. - - 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. Additional offer from the Licensor -- Adapted Material. - Every recipient of Adapted Material from You - automatically receives an offer from the Licensor to - exercise the Licensed Rights in the Adapted Material - under the conditions of the Adapter's License You apply. - - c. 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, including when - the Licensed Material is used other than for NonCommercial - purposes. - - -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. - - b. ShareAlike. - - In addition to the conditions in Section 3(a), if You Share - Adapted Material You produce, the following conditions also apply. - - 1. The Adapter's License You apply must be a Creative Commons - license with the same License Elements, this version or - later, or a BY-NC-SA Compatible License. - - 2. You must include the text of, or the URI or hyperlink to, the - Adapter's License You apply. You may satisfy this condition - in any reasonable manner based on the medium, means, and - context in which You Share Adapted Material. - - 3. You may not offer or impose any additional or different terms - or conditions on, or apply any Effective Technological - Measures to, Adapted Material that restrict exercise of the - rights granted under the Adapter's License You apply. - - -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 for NonCommercial purposes - only; - - 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, - including for purposes of Section 3(b); 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. - - 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. - - c. 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. - - d. 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." 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/prebuilts/gradle/AutoBackupForApps/README.md b/prebuilts/gradle/AutoBackupForApps/README.md index 6a11b3dc32768029e4c0f063ca1533b3861bf14e..f2fc408b335f382278c9eacf4bff4d0b37f86c19 100644 --- a/prebuilts/gradle/AutoBackupForApps/README.md +++ b/prebuilts/gradle/AutoBackupForApps/README.md @@ -26,8 +26,8 @@ server. Pre-requisites -------------- -- Android SDK 25 -- Android Build Tools v25.0.3 +- Android SDK 27 +- Android Build Tools v27.0.2 - Android Support Repository Screenshots diff --git a/prebuilts/gradle/AutoBackupForApps/gradle/wrapper/gradle-wrapper.properties b/prebuilts/gradle/AutoBackupForApps/gradle/wrapper/gradle-wrapper.properties index 4da4a5808fee2512de0bcbe3cd6b2bb866234b02..86fc139ac8ce03bb1d041893a60d25222baf6c33 100644 --- a/prebuilts/gradle/AutoBackupForApps/gradle/wrapper/gradle-wrapper.properties +++ b/prebuilts/gradle/AutoBackupForApps/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.4.1-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/build.gradle b/prebuilts/gradle/AutofillFramework/Application/build.gradle index 35233ec8139bc6a57dd088f7f57a5e8b03ebf72f..04778235a67bfc4144012aa516084fd917b36226 100644 --- a/prebuilts/gradle/AutofillFramework/Application/build.gradle +++ b/prebuilts/gradle/AutofillFramework/Application/build.gradle @@ -1,47 +1,23 @@ - -buildscript { - repositories { - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' - } -} - apply plugin: 'com.android.application' -repositories { - jcenter() -} - -dependencies { - compile "com.android.support:support-v4:25.0.1" - compile "com.android.support:support-v13:25.0.1" - compile "com.android.support:cardview-v7:25.0.1" - compile "com.android.support:appcompat-v7:25.0.1" -} - // The sample build uses multiple directories to // keep boilerplate and common code separate from // the main sample code. List dirs = [ - 'main', // main sample code; look here for the interesting stuff. - 'common', // components that are reused by multiple samples - 'template'] // boilerplate code that is generated by the sample template process + 'main'] // main sample code; look here for the interesting stuff. android { - compileSdkVersion "android-O" - buildToolsVersion "25.0.3" + compileSdkVersion 26 + buildToolsVersion '26.0.2' defaultConfig { - minSdkVersion "O" - targetSdkVersion "O" + minSdkVersion 26 + targetSdkVersion 26 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } sourceSets { @@ -53,7 +29,20 @@ android { } androidTest.setRoot('tests') androidTest.java.srcDirs = ['tests/src'] + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 } +} +dependencies { + implementation "com.android.support:support-v4:26.1.0" + implementation "com.android.support:support-v13:26.1.0" + implementation "com.android.support:cardview-v7:26.1.0" + implementation "com.android.support:appcompat-v7:26.1.0" + implementation 'com.android.support:design:26.1.0' + implementation 'com.android.support.constraint:constraint-layout:1.0.2' + implementation group: 'com.google.guava', name: 'guava', version: '22.0-android' } diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/AndroidManifest.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/AndroidManifest.xml index 28d9c0b506c76b514e405b6796748afd6a9c03ac..4f4a356817399a665aaed5ed67f292cc27152fea 100644 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/AndroidManifest.xml +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - - - + package="com.example.android.autofill.app" + android:versionCode="1" + android:versionName="1.0"> + + @@ -37,71 +36,40 @@ - - - - - - + android:name="com.example.android.autofill.app.StandardSignInActivity" + android:taskAffinity=".StandardSignInActivity" /> - - - - - - - + android:name="com.example.android.autofill.app.StandardAutoCompleteSignInActivity" + android:taskAffinity=".StandardAutoCompleteSignInActivity" /> - - - - - - - + android:name="com.example.android.autofill.app.VirtualSignInActivity" + android:taskAffinity=".VirtualSignInActivity" /> + - - - - - - - - - - - - - - - - - + android:name="com.example.android.autofill.app.CreditCardActivity" + android:taskAffinity=".CreditCardActivity" /> + + + + + + + - \ No newline at end of file + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CommonUtil.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CommonUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..d68a371293a63bb4fb2cbe4ae8996813f82056e1 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CommonUtil.java @@ -0,0 +1,154 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.app.assist.AssistStructure; +import android.app.assist.AssistStructure.ViewNode; +import android.app.assist.AssistStructure.WindowNode; +import android.os.Bundle; +import android.util.Log; +import android.view.View; +import android.view.ViewStructure.HtmlInfo; +import android.view.autofill.AutofillValue; + +import java.util.Arrays; +import java.util.Set; + +public final class CommonUtil { + + public static final String TAG = "AutofillSample"; + public static final boolean DEBUG = true; + public static final boolean VERBOSE = false; + public static final String EXTRA_DATASET_NAME = "dataset_name"; + public static final String EXTRA_FOR_RESPONSE = "for_response"; + + private static void bundleToString(StringBuilder builder, Bundle data) { + final Set keySet = data.keySet(); + builder.append("[Bundle with ").append(keySet.size()).append(" keys:"); + for (String key : keySet) { + builder.append(' ').append(key).append('='); + Object value = data.get(key); + if ((value instanceof Bundle)) { + bundleToString(builder, (Bundle) value); + } else { + builder.append((value instanceof Object[]) + ? Arrays.toString((Object[]) value) : value); + } + } + builder.append(']'); + } + + public static String bundleToString(Bundle data) { + if (data == null) { + return "N/A"; + } + final StringBuilder builder = new StringBuilder(); + bundleToString(builder, data); + return builder.toString(); + } + + public static String getTypeAsString(int type) { + switch (type) { + case View.AUTOFILL_TYPE_TEXT: + return "TYPE_TEXT"; + case View.AUTOFILL_TYPE_LIST: + return "TYPE_LIST"; + case View.AUTOFILL_TYPE_NONE: + return "TYPE_NONE"; + case View.AUTOFILL_TYPE_TOGGLE: + return "TYPE_TOGGLE"; + case View.AUTOFILL_TYPE_DATE: + return "TYPE_DATE"; + } + return "UNKNOWN_TYPE"; + } + + private static String getAutofillValueAndTypeAsString(AutofillValue value) { + if (value == null) return "null"; + + StringBuilder builder = new StringBuilder(value.toString()).append('('); + if (value.isText()) { + builder.append("isText"); + } else if (value.isDate()) { + builder.append("isDate"); + } else if (value.isToggle()) { + builder.append("isToggle"); + } else if (value.isList()) { + builder.append("isList"); + } + return builder.append(')').toString(); + } + + public static void dumpStructure(AssistStructure structure) { + int nodeCount = structure.getWindowNodeCount(); + Log.v(TAG, "dumpStructure(): component=" + structure.getActivityComponent() + + " numberNodes=" + nodeCount); + for (int i = 0; i < nodeCount; i++) { + Log.v(TAG, "node #" + i); + WindowNode node = structure.getWindowNodeAt(i); + dumpNode(" ", node.getRootViewNode()); + } + } + + private static void dumpNode(String prefix, ViewNode node) { + StringBuilder builder = new StringBuilder(); + builder.append(prefix) + .append("autoFillId: ").append(node.getAutofillId()) + .append("\tidEntry: ").append(node.getIdEntry()) + .append("\tid: ").append(node.getId()) + .append("\tclassName: ").append(node.getClassName()) + .append('\n'); + + builder.append(prefix) + .append("focused: ").append(node.isFocused()) + .append("\tvisibility").append(node.getVisibility()) + .append("\tchecked: ").append(node.isChecked()) + .append("\twebDomain: ").append(node.getWebDomain()) + .append("\thint: ").append(node.getHint()) + .append('\n'); + + HtmlInfo htmlInfo = node.getHtmlInfo(); + + if (htmlInfo != null) { + builder.append(prefix) + .append("HTML TAG: ").append(htmlInfo.getTag()) + .append(" attrs: ").append(htmlInfo.getAttributes()) + .append('\n'); + } + + String[] afHints = node.getAutofillHints(); + CharSequence[] options = node.getAutofillOptions(); + builder.append(prefix).append("afType: ").append(getTypeAsString(node.getAutofillType())) + .append("\tafValue:") + .append(getAutofillValueAndTypeAsString(node.getAutofillValue())) + .append("\tafOptions:").append(options == null ? "N/A" : Arrays.toString(options)) + .append("\tafHints: ").append(afHints == null ? "N/A" : Arrays.toString(afHints)) + .append("\tinputType:").append(node.getInputType()) + .append('\n'); + + int numberChildren = node.getChildCount(); + builder.append(prefix).append("# children: ").append(numberChildren) + .append("\ttext: ").append(node.getText()) + .append('\n'); + + Log.v(TAG, builder.toString()); + final String prefix2 = prefix + " "; + for (int i = 0; i < numberChildren; i++) { + Log.v(TAG, prefix + "child #" + i); + dumpNode(prefix2, node.getChildAt(i)); + } + } +} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..8322eb5550302912b26752eba54f5bc409a32967 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardActivity.java @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.view.autofill.AutofillManager; +import android.widget.EditText; + + +public class CreditCardActivity extends AppCompatActivity { + + private EditText mCcExpDayView; + private EditText mCcExpMonthView; + private EditText mCcExpYearView; + private EditText mCcNumber; + private EditText mCcSecurityCode; + + public static Intent getStartActivityIntent(Context context) { + Intent intent = new Intent(context, CreditCardActivity.class); + return intent; + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.credit_card_activity); + mCcExpDayView = findViewById(R.id.expirationDay); + mCcExpMonthView = findViewById(R.id.expirationMonth); + mCcExpYearView = findViewById(R.id.expirationYear); + mCcNumber = findViewById(R.id.creditCardNumberField); + mCcSecurityCode = findViewById(R.id.creditCardSecurityCode); + findViewById(R.id.submitButton).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + submit(); + } + }); + findViewById(R.id.clearButton).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + getSystemService(AutofillManager.class).cancel(); + resetFields(); + } + }); + } + + private void resetFields() { + mCcExpDayView.setText(""); + mCcExpMonthView.setText(""); + mCcExpYearView.setText(""); + mCcNumber.setText(""); + mCcSecurityCode.setText(""); + } + + /** + * Launches new Activity and finishes, triggering an autofill save request if the user entered + * any new data. + */ + private void submit() { + Intent intent = WelcomeActivity.getStartActivityIntent(this); + startActivity(intent); + finish(); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardAntiPatternActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardAntiPatternActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..a1cb5999b504f8cac76e93e147de946f022621df --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardAntiPatternActivity.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.view.autofill.AutofillManager; +import android.widget.EditText; + +public class CreditCardAntiPatternActivity extends AppCompatActivity { + + private EditText mCcExpDateView; + private EditText mCcExpNumber; + private EditText mCcSecurityCode; + + public static Intent getStartActivityIntent(Context context) { + Intent intent = new Intent(context, CreditCardAntiPatternActivity.class); + return intent; + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.credit_card_anti_pattern_activity); + mCcExpDateView = findViewById(R.id.creditCardExpirationView); + mCcExpNumber = findViewById(R.id.creditCardNumberField); + mCcSecurityCode = findViewById(R.id.creditCardSecurityCode); + findViewById(R.id.submitButton).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + submit(); + } + }); + findViewById(R.id.clearButton).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + getSystemService(AutofillManager.class).cancel(); + resetFields(); + } + }); + } + + private void resetFields() { + mCcExpDateView.setText(""); + mCcExpNumber.setText(""); + mCcSecurityCode.setText(""); + } + + /** + * Launches new Activity and finishes, triggering an autofill save request if the user entered + * any new data. + */ + private void submit() { + Intent intent = WelcomeActivity.getStartActivityIntent(this); + startActivity(intent); + finish(); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardCompoundViewActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardCompoundViewActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..7a936b91ebf4e11aba053564a9ab00881050cae7 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardCompoundViewActivity.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.view.autofill.AutofillManager; +import android.widget.EditText; + +public class CreditCardCompoundViewActivity extends AppCompatActivity { + + private CreditCardExpirationDateCompoundView mCcExpDateView; + private EditText mCcExpNumber; + private EditText mCcSecurityCode; + + public static Intent getStartActivityIntent(Context context) { + Intent intent = new Intent(context, CreditCardCompoundViewActivity.class); + return intent; + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.credit_card_compound_view_activity); + mCcExpDateView = findViewById(R.id.creditCardExpirationView); + mCcExpNumber = findViewById(R.id.creditCardNumberField); + mCcSecurityCode = findViewById(R.id.creditCardSecurityCode); + findViewById(R.id.submitButton).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + submit(); + } + }); + findViewById(R.id.clearButton).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + getSystemService(AutofillManager.class).cancel(); + resetFields(); + } + }); + } + + private void resetFields() { + mCcExpDateView.reset(); + mCcExpNumber.setText(""); + mCcSecurityCode.setText(""); + } + + /** + * Launches new Activity and finishes, triggering an autofill save request if the user entered + * any new data. + */ + private void submit() { + Intent intent = WelcomeActivity.getStartActivityIntent(this); + startActivity(intent); + finish(); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardDatePickerActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardDatePickerActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..6b575f8acf091c1fc02611945192c2336bddf5c8 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardDatePickerActivity.java @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.app.AppCompatActivity; +import android.util.Log; +import android.view.View; +import android.view.autofill.AutofillManager; +import android.widget.EditText; + +import static com.example.android.autofill.app.CommonUtil.TAG; + +public class CreditCardDatePickerActivity extends AppCompatActivity { + + private CreditCardExpirationDatePickerView mCcExpDateView; + private EditText mCcExpNumber; + private EditText mCcSecurityCode; + + public static Intent getStartActivityIntent(Context context) { + Intent intent = new Intent(context, CreditCardDatePickerActivity.class); + return intent; + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.credit_card_date_picker_activity); + mCcExpDateView = findViewById(R.id.creditCardExpirationView); + mCcExpNumber = findViewById(R.id.creditCardNumberField); + mCcSecurityCode = findViewById(R.id.creditCardSecurityCode); + findViewById(R.id.submitButton).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + submit(); + } + }); + findViewById(R.id.clearButton).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + getSystemService(AutofillManager.class).cancel(); + resetFields(); + } + }); + + mCcExpDateView.reset(); + } + + private void resetFields() { + mCcExpDateView.reset(); + mCcExpNumber.setText(""); + mCcSecurityCode.setText(""); + } + + public void showDatePickerDialog(View v) { + if (v != mCcExpDateView) { + Log.w(TAG, "showDatePickerDialog() called on invalid view: " + v); + return; + } + mCcExpDateView.showDatePickerDialog(getSupportFragmentManager()); + } + + + /** + * Launches new Activity and finishes, triggering an autofill save request if the user entered + * any new data. + */ + private void submit() { + Intent intent = WelcomeActivity.getStartActivityIntent(this); + startActivity(intent); + finish(); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardExpirationDateCompoundView.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardExpirationDateCompoundView.java new file mode 100644 index 0000000000000000000000000000000000000000..151815caccf01b7de28de77de5471dc14eb2e230 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardExpirationDateCompoundView.java @@ -0,0 +1,133 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.util.AttributeSet; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.autofill.AutofillManager; +import android.view.autofill.AutofillValue; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.FrameLayout; +import android.widget.Spinner; + +import java.util.Calendar; + +import static com.example.android.autofill.app.CommonUtil.TAG; + +/** + * A custom view that represents a {@link View#AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE} using + * 2 {@link Spinner spinners} to represent the credit card expiration month and year. + */ +public class CreditCardExpirationDateCompoundView extends FrameLayout { + + private static final int CC_EXP_YEARS_COUNT = 5; + + private final String[] mYears = new String[CC_EXP_YEARS_COUNT]; + + private Spinner mCcExpMonthSpinner; + private Spinner mCcExpYearSpinner; + + public CreditCardExpirationDateCompoundView(@NonNull Context context) { + this(context, null); + } + + public CreditCardExpirationDateCompoundView(@NonNull Context context, + @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public CreditCardExpirationDateCompoundView(@NonNull Context context, + @Nullable AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public CreditCardExpirationDateCompoundView(@NonNull final Context context, + @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + View rootView = LayoutInflater.from(context).inflate(R.layout.cc_exp_date, this); + mCcExpMonthSpinner = rootView.findViewById(R.id.ccExpMonth); + mCcExpYearSpinner = rootView.findViewById(R.id.ccExpYear); + setImportantForAutofill(IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS); + ArrayAdapter monthAdapter = ArrayAdapter.createFromResource + (context, R.array.month_array, android.R.layout.simple_spinner_item); + monthAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + mCcExpMonthSpinner.setAdapter(monthAdapter); + int year = Calendar.getInstance().get(Calendar.YEAR); + for (int i = 0; i < mYears.length; i++) { + mYears[i] = Integer.toString(year + i); + } + mCcExpYearSpinner.setAdapter(new ArrayAdapter<>(context, + android.R.layout.simple_spinner_item, mYears)); + AdapterView.OnItemSelectedListener onItemSelectedListener = + new AdapterView.OnItemSelectedListener() { + @Override + public void onItemSelected(AdapterView parent, View view, int position, long id) { + context.getSystemService(AutofillManager.class) + .notifyValueChanged(CreditCardExpirationDateCompoundView.this); + } + + @Override + public void onNothingSelected(AdapterView parent) { + } + }; + mCcExpMonthSpinner.setOnItemSelectedListener(onItemSelectedListener); + mCcExpYearSpinner.setOnItemSelectedListener(onItemSelectedListener); + } + + @Override + public AutofillValue getAutofillValue() { + Calendar calendar = Calendar.getInstance(); + // Set hours, minutes, seconds, and millis to 0 to ensure getAutofillValue() == the value + // set by autofill(). Without this line, the view will not turn yellow when updated. + calendar.clear(); + int year = Integer.parseInt(mCcExpYearSpinner.getSelectedItem().toString()); + int month = mCcExpMonthSpinner.getSelectedItemPosition(); + calendar.set(Calendar.YEAR, year); + calendar.set(Calendar.MONTH, month); + long unixTime = calendar.getTimeInMillis(); + return AutofillValue.forDate(unixTime); + } + + @Override + public void autofill(AutofillValue value) { + if (!value.isDate()) { + Log.w(TAG, "Ignoring autofill() because service sent a non-date value:" + value); + return; + } + Calendar calendar = Calendar.getInstance(); + calendar.setTimeInMillis(value.getDateValue()); + int month = calendar.get(Calendar.MONTH); + int year = calendar.get(Calendar.YEAR); + mCcExpMonthSpinner.setSelection(month); + mCcExpYearSpinner.setSelection(year - Integer.parseInt(mYears[0])); + } + + @Override + public int getAutofillType() { + return AUTOFILL_TYPE_DATE; + } + + public void reset() { + mCcExpMonthSpinner.setSelection(0); + mCcExpYearSpinner.setSelection(0); + } +} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardExpirationDatePickerView.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardExpirationDatePickerView.java new file mode 100644 index 0000000000000000000000000000000000000000..f9df96f756960e79338d66c3fe853858f90eb7e9 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardExpirationDatePickerView.java @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.app.DatePickerDialog; +import android.app.Dialog; +import android.content.Context; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.v4.app.DialogFragment; +import android.support.v4.app.FragmentManager; +import android.support.v7.widget.AppCompatEditText; +import android.text.format.DateFormat; +import android.util.AttributeSet; +import android.util.Log; +import android.view.View; +import android.view.autofill.AutofillValue; +import android.widget.DatePicker; + +import java.util.Calendar; +import java.util.Date; + +import static com.example.android.autofill.app.CommonUtil.DEBUG; +import static com.example.android.autofill.app.CommonUtil.TAG; + +/** + * A custom view that represents a {@link View#AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE} using + * a non-editable {@link EditText} that triggers a {@link DatePickerDialog} to represent the + * credit card expiration month and year. + */ +public class CreditCardExpirationDatePickerView extends AppCompatEditText { + + private static final int CC_EXP_YEARS_COUNT = 5; + + /** + * Calendar instance used for month / year calculations. Should be reset before each use. + */ + private final Calendar mTempCalendar; + + private int mMonth; + private int mYear; + + public CreditCardExpirationDatePickerView(@NonNull Context context) { + this(context, null); + } + + public CreditCardExpirationDatePickerView(@NonNull Context context, + @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public CreditCardExpirationDatePickerView(@NonNull Context context, + @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + // Use the current date as the initial date in the picker. + mTempCalendar = Calendar.getInstance(); + mYear = mTempCalendar.get(Calendar.YEAR); + mMonth = mTempCalendar.get(Calendar.MONTH); + } + + /** + * Gets a temporary calendar set with the View's year and month. + */ + private Calendar getCalendar() { + mTempCalendar.clear(); + mTempCalendar.set(Calendar.YEAR, mYear); + mTempCalendar.set(Calendar.MONTH, mMonth); + mTempCalendar.set(Calendar.DATE, 1); + return mTempCalendar; + } + + @Override + public AutofillValue getAutofillValue() { + Calendar c = getCalendar(); + AutofillValue value = AutofillValue.forDate(c.getTimeInMillis()); + if (DEBUG) Log.d(TAG, "getAutofillValue(): " + value); + return value; + } + + @Override + public void autofill(AutofillValue value) { + if (value == null || !value.isDate()) { + Log.w(TAG, "autofill(): invalid value " + value); + return; + } + long time = value.getDateValue(); + mTempCalendar.setTimeInMillis(time); + int year = mTempCalendar.get(Calendar.YEAR); + int month = mTempCalendar.get(Calendar.MONTH); + if (DEBUG) Log.d(TAG, "autofill(" + value + "): " + month + "/" + year); + setDate(year, month); + } + + private void setDate(int year, int month) { + mYear = year; + mMonth = month; + Date selectedDate = new Date(getCalendar().getTimeInMillis()); + String dateString = DateFormat.getDateFormat(getContext()).format(selectedDate); + setText(dateString); + } + + @Override + public int getAutofillType() { + return AUTOFILL_TYPE_DATE; + } + + public void reset() { + mTempCalendar.setTimeInMillis(System.currentTimeMillis()); + setDate(mTempCalendar.get(Calendar.YEAR), mTempCalendar.get(Calendar.MONTH)); + } + + public void showDatePickerDialog(FragmentManager fragmentManager) { + DatePickerFragment newFragment = new DatePickerFragment(); + newFragment.mParent = this; + newFragment.show(fragmentManager, "datePicker"); + } + + public static class DatePickerFragment extends DialogFragment + implements DatePickerDialog.OnDateSetListener { + + private CreditCardExpirationDatePickerView mParent; + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + DatePickerDialog dialog = new DatePickerDialog(getActivity(), + R.style.CustomDatePickerDialogTheme, this, mParent.mYear, mParent.mMonth, 1); + + DatePicker datePicker = dialog.getDatePicker(); + + // Limit range. + Calendar c = mParent.getCalendar(); + datePicker.setMinDate(c.getTimeInMillis()); + c.set(Calendar.YEAR, mParent.mYear + CC_EXP_YEARS_COUNT - 1); + datePicker.setMaxDate(c.getTimeInMillis()); + + // Remove day. + datePicker.findViewById(getResources().getIdentifier("day", "id", "android")) + .setVisibility(View.GONE); + return dialog; + } + + @Override + public void onDateSet(DatePicker view, int year, int month, int day) { + mParent.setDate(year, month); + } + } +} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardSpinnersActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardSpinnersActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..1fff8b19672b5eaca59d49a1876218628e9d949e --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CreditCardSpinnersActivity.java @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.view.autofill.AutofillManager; +import android.widget.ArrayAdapter; +import android.widget.EditText; +import android.widget.Spinner; + +import java.util.Calendar; + +public class CreditCardSpinnersActivity extends AppCompatActivity { + + private static final int CC_EXP_YEARS_COUNT = 5; + + private final String[] years = new String[CC_EXP_YEARS_COUNT]; + + private Spinner mCcExpirationDaySpinner; + private Spinner mCcExpirationMonthSpinner; + private Spinner mCcExpirationYearSpinner; + private EditText mCcCardNumber; + private EditText mCcSecurityCode; + + public static Intent getStartActivityIntent(Context context) { + Intent intent = new Intent(context, CreditCardSpinnersActivity.class); + return intent; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.credit_card_spinners_activity); + mCcExpirationDaySpinner = findViewById(R.id.expirationDay); + mCcExpirationMonthSpinner = findViewById(R.id.expirationMonth); + mCcExpirationYearSpinner = findViewById(R.id.expirationYear); + mCcCardNumber = findViewById(R.id.creditCardNumberField); + mCcSecurityCode = findViewById(R.id.creditCardSecurityCode); + + // Create an ArrayAdapter using the string array and a default spinner layout + ArrayAdapter dayAdapter = ArrayAdapter.createFromResource + (this, R.array.day_array, android.R.layout.simple_spinner_item); + // Specify the layout to use when the list of choices appears + dayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + // Apply the adapter to the spinner + mCcExpirationDaySpinner.setAdapter(dayAdapter); + + /* + R.array.month_array could be an array of Strings like "Jan", "Feb", "March", etc., and + the AutofillService would know how to autofill it. However, for the sake of keeping the + AutofillService simple, we will stick to a list of numbers (1, 2, ... 12) to represent + months; it makes it much easier to generate fake autofill data in the service that can still + autofill this spinner. + */ + ArrayAdapter monthAdapter = ArrayAdapter.createFromResource( + this, R.array.month_array, android.R.layout.simple_spinner_item); + // Adapter created from resource has getAutofillOptions() implemented by default. + monthAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + mCcExpirationMonthSpinner.setAdapter(monthAdapter); + + int year = Calendar.getInstance().get(Calendar.YEAR); + for (int i = 0; i < years.length; i++) { + years[i] = Integer.toString(year + i); + } + // Since the years Spinner uses a custom adapter, it needs to implement getAutofillOptions. + mCcExpirationYearSpinner.setAdapter( + new ArrayAdapter(this, android.R.layout.simple_spinner_item, years) { + @Override + public CharSequence[] getAutofillOptions() { + return years; + } + }); + findViewById(R.id.submit).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + submit(); + } + }); + findViewById(R.id.clear).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + getSystemService(AutofillManager.class).cancel(); + resetFields(); + } + }); + } + + private void resetFields() { + mCcExpirationDaySpinner.setSelection(0); + mCcExpirationMonthSpinner.setSelection(0); + mCcExpirationYearSpinner.setSelection(0); + mCcCardNumber.setText(""); + mCcSecurityCode.setText(""); + } + + /** + * Launches new Activity and finishes, triggering an autofill save request if the user entered + * any new data. + */ + private void submit() { + Intent intent = WelcomeActivity.getStartActivityIntent(CreditCardSpinnersActivity.this); + startActivity(intent); + finish(); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CustomVirtualView.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CustomVirtualView.java new file mode 100644 index 0000000000000000000000000000000000000000..24cbd7ed22a91d976f84f00b6683b08edcb4b914 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/CustomVirtualView.java @@ -0,0 +1,506 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.Paint.Style; +import android.graphics.Rect; +import android.support.annotation.Nullable; +import android.text.TextUtils; +import android.util.ArrayMap; +import android.util.ArraySet; +import android.util.AttributeSet; +import android.util.Log; +import android.util.SparseArray; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewStructure; +import android.view.autofill.AutofillManager; +import android.view.autofill.AutofillValue; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import com.google.common.base.Preconditions; + +import java.text.DateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; + +import static com.example.android.autofill.app.CommonUtil.bundleToString; + +/** + * A custom View with a virtual structure for fields supporting {@link View#getAutofillHints()} + */ +public class CustomVirtualView extends View { + + protected static final boolean DEBUG = true; + protected static final boolean VERBOSE = false; + + /** + * When set, it notifies AutofillManager of focus change as the view scrolls, so the + * autofill UI is continually drawn. + * + *

This is janky and incompatible with the way the autofill UI works on native views, but + * it's a cool experiment! + */ + private static final boolean DRAW_AUTOFILL_UI_AFTER_SCROLL = false; + + private static final String TAG = "CustomView"; + private static final int DEFAULT_TEXT_HEIGHT_DP = 34; + private static final int VERTICAL_GAP = 10; + private static final int UNFOCUSED_COLOR = Color.BLACK; + private static final int FOCUSED_COLOR = Color.RED; + private static int sNextId; + protected final AutofillManager mAutofillManager; + private final ArrayList mVirtualViewGroups = new ArrayList<>(); + private final SparseArray mVirtualViews = new SparseArray<>(); + private final SparseArray mPartitionsByAutofillId = new SparseArray<>(); + private final ArrayMap mPartitionsByName = new ArrayMap<>(); + protected Line mFocusedLine; + protected int mTopMargin; + protected int mLeftMargin; + private Paint mTextPaint; + private int mTextHeight; + private int mLineLength; + + public CustomVirtualView(Context context) { + this(context, null); + } + + public CustomVirtualView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public CustomVirtualView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public CustomVirtualView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, + int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + mAutofillManager = context.getSystemService(AutofillManager.class); + mTextPaint = new Paint(); + TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.CustomVirtualView, + defStyleAttr, defStyleRes); + int defaultHeight = + (int) (DEFAULT_TEXT_HEIGHT_DP * getResources().getDisplayMetrics().density); + mTextHeight = typedArray.getDimensionPixelSize( + R.styleable.CustomVirtualView_internalTextSize, defaultHeight); + typedArray.recycle(); + resetCoordinates(); + } + + protected void resetCoordinates() { + mTextPaint.setStyle(Style.FILL); + mTextPaint.setTextSize(mTextHeight); + mTopMargin = getPaddingTop(); + mLeftMargin = getPaddingStart(); + mLineLength = mTextHeight + VERTICAL_GAP; + } + + @Override + public void autofill(SparseArray values) { + Context context = getContext(); + + // User has just selected a Dataset from the list of autofill suggestions. + // The Dataset is comprised of a list of AutofillValues, with each AutofillValue meant + // to fill a specific autofillable view. Now we have to update the UI based on the + // AutofillValues in the list, but first we make sure all autofilled values belong to the + // same partition + if (DEBUG) Log.d(TAG, "autofill(): " + values); + + // First get the name of all partitions in the values + ArraySet partitions = new ArraySet<>(); + for (int i = 0; i < values.size(); i++) { + int id = values.keyAt(i); + Partition partition = mPartitionsByAutofillId.get(id); + if (partition == null) { + showError(context.getString(R.string.message_autofill_no_partitions, id, + mPartitionsByAutofillId)); + return; + } + partitions.add(partition.mName); + } + + // Then make sure they follow the Highlander rule (There can be only one) + if (partitions.size() != 1) { + showError(context.getString(R.string.message_autofill_blocked, partitions)); + return; + } + + // Finally, autofill it. + DateFormat df = android.text.format.DateFormat.getDateFormat(context); + for (int i = 0; i < values.size(); i++) { + int id = values.keyAt(i); + AutofillValue value = values.valueAt(i); + Item item = mVirtualViews.get(id); + + if (item == null) { + Log.w(TAG, "No item for id " + id); + continue; + } + + if (!item.editable) { + showError(context.getString(R.string.message_autofill_readonly, item.text)); + continue; + } + + // Check if the type was properly set by the autofill service + if (DEBUG) { + Log.d(TAG, "Validating " + i + + ": expectedType=" + CommonUtil.getTypeAsString(item.type) + + "(" + item.type + "), value=" + value); + } + boolean valid = false; + if (value.isText() && item.type == AUTOFILL_TYPE_TEXT) { + item.text = value.getTextValue(); + valid = true; + } else if (value.isDate() && item.type == AUTOFILL_TYPE_DATE) { + item.text = df.format(new Date(value.getDateValue())); + valid = true; + } else { + Log.w(TAG, "Unsupported type: " + value); + } + if (!valid) { + item.text = context.getString(R.string.message_autofill_invalid); + } + } + postInvalidate(); + showMessage(context.getString(R.string.message_autofill_ok, partitions.valueAt(0))); + } + + @Override + public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) { + // Build a ViewStructure that will get passed to the AutofillService by the framework + // when it is time to find autofill suggestions. + structure.setClassName(getClass().getName()); + int childrenSize = mVirtualViews.size(); + if (DEBUG) { + Log.d(TAG, "onProvideAutofillVirtualStructure(): flags = " + flags + ", items = " + + childrenSize + ", extras: " + bundleToString(structure.getExtras())); + } + int index = structure.addChildCount(childrenSize); + // Traverse through the view hierarchy, including virtual child views. For each view, we + // need to set the relevant autofill metadata and add it to the ViewStructure. + for (int i = 0; i < childrenSize; i++) { + Item item = mVirtualViews.valueAt(i); + if (DEBUG) Log.d(TAG, "Adding new child at index " + index + ": " + item); + ViewStructure child = structure.newChild(index); + child.setAutofillId(structure.getAutofillId(), item.id); + child.setAutofillHints(item.hints); + child.setAutofillType(item.type); + child.setAutofillValue(item.getAutofillValue()); + child.setDataIsSensitive(!item.sanitized); + child.setFocused(item.focused); + child.setVisibility(View.VISIBLE); + child.setDimens(item.line.mBounds.left, item.line.mBounds.top, 0, 0, + item.line.mBounds.width(), item.line.mBounds.height()); + child.setId(item.id, getContext().getPackageName(), null, item.idEntry); + child.setClassName(item.getClassName()); + child.setDimens(item.line.mBounds.left, item.line.mBounds.top, 0, 0, + item.line.mBounds.width(), item.line.mBounds.height()); + index++; + } + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + + if (VERBOSE) { + Log.v(TAG, "onDraw(): " + mVirtualViewGroups.size() + " lines; canvas:" + canvas); + } + float x; + float y = mTopMargin + mLineLength; + for (int i = 0; i < mVirtualViewGroups.size(); i++) { + Line line = mVirtualViewGroups.get(i); + x = mLeftMargin; + if (VERBOSE) Log.v(TAG, "Drawing '" + line + "' at " + x + "x" + y); + mTextPaint.setColor(line.mFieldTextItem.focused ? FOCUSED_COLOR : UNFOCUSED_COLOR); + String readOnlyText = line.mLabelItem.text + ": ["; + String writeText = line.mFieldTextItem.text + "]"; + // Paints the label first... + canvas.drawText(readOnlyText, x, y, mTextPaint); + // ...then paints the edit text and sets the proper boundary + float deltaX = mTextPaint.measureText(readOnlyText); + x += deltaX; + line.mBounds.set((int) x, (int) (y - mLineLength), + (int) (x + mTextPaint.measureText(writeText)), (int) y); + if (VERBOSE) Log.v(TAG, "setBounds(" + x + ", " + y + "): " + line.mBounds); + canvas.drawText(writeText, x, y, mTextPaint); + y += mLineLength; + + if (DRAW_AUTOFILL_UI_AFTER_SCROLL) { + line.notifyFocusChanged(); + } + } + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + int y = (int) event.getY(); + onMotion(y); + return super.onTouchEvent(event); + } + + /** + * Handles a motion event. + * + * @param y y coordinate. + */ + protected void onMotion(int y) { + if (DEBUG) { + Log.d(TAG, "onMotion(): y=" + y + ", range=" + mLineLength + ", top=" + mTopMargin); + } + int lowerY = mTopMargin; + int upperY = -1; + for (int i = 0; i < mVirtualViewGroups.size(); i++) { + Line line = mVirtualViewGroups.get(i); + upperY = lowerY + mLineLength; + if (DEBUG) Log.d(TAG, "Line " + i + " ranges from " + lowerY + " to " + upperY); + if (lowerY <= y && y <= upperY) { + if (mFocusedLine != null) { + Log.d(TAG, "Removing focus from " + mFocusedLine); + mFocusedLine.changeFocus(false); + } + Log.d(TAG, "Changing focus to " + line); + mFocusedLine = line; + mFocusedLine.changeFocus(true); + invalidate(); + break; + } + lowerY += mLineLength; + } + } + + /** + * Creates a new partition with the given name. + * + * @throws IllegalArgumentException if such partition already exists. + */ + public Partition addPartition(String name) { + Preconditions.checkNotNull(name, "Name cannot be null."); + Preconditions.checkArgument(!mPartitionsByName.containsKey(name), + "Partition with such name already exists."); + Partition partition = new Partition(name); + mPartitionsByName.put(name, partition); + return partition; + } + + private void showError(String message) { + showMessage(true, message); + } + + private void showMessage(String message) { + showMessage(false, message); + } + + private void showMessage(boolean warning, String message) { + if (warning) { + Log.w(TAG, message); + } else { + Log.i(TAG, message); + } + Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show(); + } + + + protected static final class Item { + protected final int id; + private final String idEntry; + private final Line line; + private final boolean editable; + private final boolean sanitized; + private final String[] hints; + private final int type; + private CharSequence text; + private boolean focused = false; + private long date; + + Item(Line line, int id, String idEntry, String[] hints, int type, CharSequence text, + boolean editable, boolean sanitized) { + this.line = line; + this.id = id; + this.idEntry = idEntry; + this.text = text; + this.editable = editable; + this.sanitized = sanitized; + this.hints = hints; + this.type = type; + } + + @Override + public String toString() { + return id + "/" + idEntry + ": " + + (type == AUTOFILL_TYPE_DATE ? date : text) // TODO: use DateFormat for date + + " (" + CommonUtil.getTypeAsString(type) + ")" + + (editable ? " (editable)" : " (read-only)" + + (sanitized ? " (sanitized)" : " (sensitive")) + + (hints == null ? " (no hints)" : " ( " + Arrays.toString(hints) + ")"); + } + + public String getClassName() { + return editable ? EditText.class.getName() : TextView.class.getName(); + } + + public AutofillValue getAutofillValue() { + switch (type) { + case AUTOFILL_TYPE_TEXT: + return (TextUtils.getTrimmedLength(text) > 0) + ? AutofillValue.forText(text) + : null; + case AUTOFILL_TYPE_DATE: + return AutofillValue.forDate(date); + default: + return null; + } + } + } + + /** + * A partition represents a logical group of items, such as credit card info. + */ + public final class Partition { + private final String mName; + private final SparseArray mLines = new SparseArray<>(); + + private Partition(String name) { + mName = name; + } + + /** + * Adds a new line (containining a label and an input field) to the view. + * + * @param idEntryPrefix id prefix used to identify the line - label node will be suffixed + * with {@code Label} and editable node with {@code Field}. + * @param autofillType {@link View#getAutofillType() autofill type} of the field. + * @param label text used in the label. + * @param text initial text used in the input field. + * @param sensitive whether the input is considered sensitive. + * @param autofillHints list of autofill hints. + * @return the new line. + */ + public Line addLine(String idEntryPrefix, int autofillType, String label, String text, + boolean sensitive, String... autofillHints) { + Preconditions.checkArgument(autofillType == AUTOFILL_TYPE_TEXT || + autofillType == AUTOFILL_TYPE_DATE, "Unsupported type: " + autofillType); + Line line = new Line(idEntryPrefix, autofillType, label, autofillHints, text, + !sensitive); + mVirtualViewGroups.add(line); + int id = line.mFieldTextItem.id; + mLines.put(id, line); + mVirtualViews.put(line.mLabelItem.id, line.mLabelItem); + mVirtualViews.put(id, line.mFieldTextItem); + mPartitionsByAutofillId.put(id, this); + + return line; + } + + /** + * Resets the value of all items in the partition. + */ + public void reset() { + for (int i = 0; i < mLines.size(); i++) { + mLines.valueAt(i).reset(); + } + } + + @Override + public String toString() { + return mName; + } + } + + /** + * A line in the virtual view contains a label and an input field. + */ + public final class Line { + + protected final Item mFieldTextItem; + // Boundaries of the text field, relative to the CustomView + private final Rect mBounds = new Rect(); + private final Item mLabelItem; + private final int mAutofillType; + + private Line(String idEntryPrefix, int autofillType, String label, String[] hints, + String text, boolean sanitized) { + this.mAutofillType = autofillType; + this.mLabelItem = new Item(this, ++sNextId, idEntryPrefix + "Label", null, + AUTOFILL_TYPE_NONE, label, false, true); + this.mFieldTextItem = new Item(this, ++sNextId, idEntryPrefix + "Field", hints, + autofillType, text, true, sanitized); + } + + private void changeFocus(boolean focused) { + mFieldTextItem.focused = focused; + notifyFocusChanged(); + } + + void notifyFocusChanged() { + if (mFieldTextItem.focused) { + Rect absBounds = getAbsCoordinates(); + if (DEBUG) { + Log.d(TAG, "focus gained on " + mFieldTextItem.id + "; absBounds=" + absBounds); + } + mAutofillManager.notifyViewEntered(CustomVirtualView.this, mFieldTextItem.id, + absBounds); + } else { + if (DEBUG) Log.d(TAG, "focus lost on " + mFieldTextItem.id); + mAutofillManager.notifyViewExited(CustomVirtualView.this, mFieldTextItem.id); + } + } + + private Rect getAbsCoordinates() { + // Must offset the boundaries so they're relative to the CustomView. + int offset[] = new int[2]; + getLocationOnScreen(offset); + Rect absBounds = new Rect(mBounds.left + offset[0], + mBounds.top + offset[1], + mBounds.right + offset[0], mBounds.bottom + offset[1]); + if (VERBOSE) { + Log.v(TAG, "getAbsCoordinates() for " + mFieldTextItem.id + ": bounds=" + mBounds + + " offset: " + Arrays.toString(offset) + " absBounds: " + absBounds); + } + return absBounds; + } + + /** + * Gets the value of the input field text. + */ + public CharSequence getText() { + return mFieldTextItem.text; + } + + /** + * Resets the value of the input field text. + */ + public void reset() { + mFieldTextItem.text = " "; + } + + @Override + public String toString() { + return "Label: " + mLabelItem + " Text: " + mFieldTextItem + " Focused: " + + mFieldTextItem.focused + " Type: " + mAutofillType; + } + } +} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/EmailComposeActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/EmailComposeActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..bf4995fdb3632a8dfe7d90215cc806b6ea1687f7 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/EmailComposeActivity.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.app.AppCompatActivity; +import android.view.View; + +public class EmailComposeActivity extends AppCompatActivity { + + public static Intent getStartActivityIntent(Context context) { + Intent intent = new Intent(context, EmailComposeActivity.class); + return intent; + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.email_compose_activity); + findViewById(R.id.sendButton).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(WelcomeActivity.getStartActivityIntent(EmailComposeActivity.this)); + finish(); + } + }); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/InfoButton.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/InfoButton.java new file mode 100644 index 0000000000000000000000000000000000000000..cf88d6fb0284d12a6255388cad41cf1380b1eb1b --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/InfoButton.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.res.TypedArray; +import android.support.v7.app.AlertDialog; +import android.support.v7.widget.AppCompatImageButton; +import android.util.AttributeSet; +import android.view.View; + +public class InfoButton extends AppCompatImageButton { + public InfoButton(Context context) { + this(context, null); + } + + public InfoButton(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public InfoButton(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.InfoButton, + defStyleAttr, 0); + String infoText = typedArray.getString(R.styleable.InfoButton_dialogText); + typedArray.recycle(); + setInfoText(infoText); + } + + public void setInfoText(final String infoText) { + setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + new AlertDialog.Builder(InfoButton.this.getContext()) + .setMessage(infoText).create().show(); + } + }); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MainActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MainActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..94d339d4586bf44a4c15c60aa2a58592cd1d3b2e --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MainActivity.java @@ -0,0 +1,141 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Intent; +import android.os.Bundle; +import android.support.annotation.Nullable; +import android.support.v7.app.AppCompatActivity; +import android.util.Log; +import android.view.View; + +/** + * This is used to launch sample activities that showcase autofill. + */ +public class MainActivity extends AppCompatActivity { + + private static final String TAG = "MainActivity"; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + if (launchTrampolineActivity()) { + return; + } + + setContentView(R.layout.activity_main); + NavigationItem loginEditTexts = findViewById(R.id.standardViewSignInButton); + NavigationItem loginCustomVirtual = findViewById(R.id.virtualViewSignInButton); + NavigationItem creditCard = findViewById(R.id.creditCardButton); + NavigationItem creditCardSpinners = findViewById(R.id.creditCardSpinnersButton); + NavigationItem loginAutoComplete = findViewById(R.id.standardLoginWithAutoCompleteButton); + NavigationItem emailCompose = findViewById(R.id.emailComposeButton); + NavigationItem creditCardCompoundView = findViewById(R.id.creditCardCompoundViewButton); + NavigationItem creditCardDatePicker = findViewById(R.id.creditCardDatePickerButton); + NavigationItem creditCardAntiPatternPicker = findViewById(R.id.creditCardAntiPatternButton); + NavigationItem multiplePartitions = findViewById(R.id.multiplePartitionsButton); + NavigationItem loginWebView = findViewById(R.id.webviewSignInButton); + loginEditTexts.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(StandardSignInActivity.getStartActivityIntent(MainActivity.this)); + } + }); + loginCustomVirtual.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(VirtualSignInActivity.getStartActivityIntent(MainActivity.this)); + } + }); + creditCard.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(CreditCardActivity.getStartActivityIntent(MainActivity.this)); + } + }); + creditCardSpinners.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(CreditCardSpinnersActivity.getStartActivityIntent(MainActivity.this)); + } + }); + loginAutoComplete.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(StandardAutoCompleteSignInActivity.getStartActivityIntent(MainActivity.this)); + } + }); + emailCompose.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(EmailComposeActivity.getStartActivityIntent(MainActivity.this)); + } + }); + creditCardCompoundView.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(CreditCardCompoundViewActivity.getStartActivityIntent(MainActivity.this)); + } + }); + creditCardDatePicker.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(CreditCardDatePickerActivity.getStartActivityIntent(MainActivity.this)); + } + }); + creditCardAntiPatternPicker.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startActivity(CreditCardAntiPatternActivity.getStartActivityIntent(MainActivity.this)); + } + }); + multiplePartitions.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + startActivity(MultiplePartitionsActivity.getStartActivityIntent(MainActivity.this)); + } + }); + loginWebView.setNavigationButtonClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + startActivity(WebViewSignInActivity.getStartActivityIntent(MainActivity.this)); + } + }); + } + + private boolean launchTrampolineActivity() { + Intent intent = getIntent(); + if (intent != null) { + String target = intent.getStringExtra("target"); + if (target != null) { + Log.i(TAG, "trampolining into " + target + " instead"); + try { + Intent newIntent = new Intent(this, + Class.forName("com.example.android.autofill.app." + target)); + newIntent.putExtras(intent); + newIntent.removeExtra("target"); + getApplicationContext().startActivity(newIntent); + finish(); + return true; + } catch (Exception e) { + Log.e(TAG, "Error launching " + target, e); + } + } + } + return false; + } +} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MultiplePartitionsActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MultiplePartitionsActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..83dd320428bef642fd48edb2b480ac7b468848ef --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/MultiplePartitionsActivity.java @@ -0,0 +1,123 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.view.autofill.AutofillManager; +import android.widget.Toast; + +/** + * Activity used to demonstrated safe partitioning of data. + *

+ *

It has multiple partitions, but only accepts autofill on each partition at time. + */ +/* + * TODO list + * + * - Fix top margin. + * - Use a combo box to select if credit card expiration date is expressed as date or text. + * - Use a dedicated TextView (instead of Toast) for error messages. + * - Use wrap_context to CustomView container. + * - Use different background color (or borders) for each partition. + * - Add more partitions (like address) - should match same partitions from service. + * - Add more hints (like w3c ones) - should match same hints from service. + */ +public class MultiplePartitionsActivity extends AppCompatActivity { + + private ScrollableCustomVirtualView mCustomVirtualView; + private AutofillManager mAutofillManager; + + private CustomVirtualView.Partition mCredentialsPartition; + private CustomVirtualView.Partition mCcPartition; + + public static Intent getStartActivityIntent(Context context) { + Intent intent = new Intent(context, MultiplePartitionsActivity.class); + return intent; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.multiple_partitions_activity); + + mCustomVirtualView = findViewById(R.id.custom_view); + + + mCredentialsPartition = + mCustomVirtualView.addPartition(getString(R.string.partition_credentials)); + mCredentialsPartition.addLine("username", View.AUTOFILL_TYPE_TEXT, + getString(R.string.username_label), + " ", false, View.AUTOFILL_HINT_USERNAME); + mCredentialsPartition.addLine("password", View.AUTOFILL_TYPE_TEXT, + getString(R.string.password_label), + " ", true, View.AUTOFILL_HINT_PASSWORD); + + int ccExpirationType = View.AUTOFILL_TYPE_DATE; + // TODO: add a checkbox to switch between text / date instead + Intent intent = getIntent(); + if (intent != null) { + int newType = intent.getIntExtra("dateType", -1); + if (newType != -1) { + ccExpirationType = newType; + String typeMessage = getString(R.string.message_credit_card_expiration_type, + CommonUtil.getTypeAsString(ccExpirationType)); + // TODO: display type in a header or proper status widget + Toast.makeText(getApplicationContext(), typeMessage, Toast.LENGTH_LONG).show(); + } + } + + mCcPartition = mCustomVirtualView.addPartition(getString(R.string.partition_credit_card)); + mCcPartition.addLine("ccNumber", View.AUTOFILL_TYPE_TEXT, + getString(R.string.credit_card_number_label), + " ", true, View.AUTOFILL_HINT_CREDIT_CARD_NUMBER); + mCcPartition.addLine("ccDay", View.AUTOFILL_TYPE_TEXT, + getString(R.string.credit_card_expiration_day_label), + " ", true, View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY); + mCcPartition.addLine("ccMonth", ccExpirationType, + getString(R.string.credit_card_expiration_month_label), + " ", true, View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH); + mCcPartition.addLine("ccYear", View.AUTOFILL_TYPE_TEXT, + getString(R.string.credit_card_expiration_year_label), + " ", true, View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR); + mCcPartition.addLine("ccDate", ccExpirationType, + getString(R.string.credit_card_expiration_date_label), + " ", true, View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE); + mCcPartition.addLine("ccSecurityCode", View.AUTOFILL_TYPE_TEXT, + getString(R.string.credit_card_security_code_label), + " ", true, View.AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE); + + findViewById(R.id.clear).setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + resetFields(); + mCustomVirtualView.resetPositions(); + mAutofillManager.cancel(); + } + }); + mAutofillManager = getSystemService(AutofillManager.class); + } + + private void resetFields() { + mCredentialsPartition.reset(); + mCcPartition.reset(); + mCustomVirtualView.postInvalidate(); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/NavigationItem.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/NavigationItem.java new file mode 100644 index 0000000000000000000000000000000000000000..b6196446c3b01053d46222e836f90e46452208de --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/NavigationItem.java @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.PorterDuff; +import android.graphics.drawable.Drawable; +import android.support.annotation.ColorRes; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; +import android.support.v4.content.ContextCompat; +import android.support.v7.widget.CardView; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.FrameLayout; +import android.widget.TextView; + +public class NavigationItem extends FrameLayout { + CardView mCardView; + + public NavigationItem(Context context) { + this(context, null); + } + + public NavigationItem(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public NavigationItem(Context context, AttributeSet attrs, int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public NavigationItem(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, + int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.NavigationItem, + defStyleAttr, defStyleRes); + String labelText = typedArray.getString(R.styleable.NavigationItem_labelText); + String infoText = typedArray.getString(R.styleable.NavigationItem_infoText); + Drawable logoDrawable = typedArray.getDrawable(R.styleable.NavigationItem_itemLogo); + @ColorRes int colorRes = typedArray.getResourceId(R.styleable.NavigationItem_imageColor, 0); + int imageColor = ContextCompat.getColor(getContext(), colorRes); + typedArray.recycle(); + View rootView = LayoutInflater.from(context).inflate(R.layout.navigation_item, this); + if (logoDrawable != null) { + logoDrawable.setColorFilter(imageColor, PorterDuff.Mode.SRC_IN); + } + TextView buttonLabel = rootView.findViewById(R.id.buttonLabel); + buttonLabel.setText(labelText); + buttonLabel.setCompoundDrawablesRelativeWithIntrinsicBounds(logoDrawable, null, + null, null); + InfoButton infoButton = rootView.findViewById(R.id.infoButton); + infoButton.setInfoText(infoText); + infoButton.setColorFilter(imageColor); + mCardView = rootView.findViewById(R.id.cardView); + } + + public void setNavigationButtonClickListener(@Nullable OnClickListener l) { + mCardView.setOnClickListener(l); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/ScrollableCustomVirtualView.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/ScrollableCustomVirtualView.java new file mode 100644 index 0000000000000000000000000000000000000000..a2b081a9a8ef543cc789f2d3f3a5ec9ea37d066b --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/ScrollableCustomVirtualView.java @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.support.annotation.Nullable; +import android.util.AttributeSet; +import android.util.Log; +import android.view.GestureDetector; +import android.view.MotionEvent; + +/** + * A version of {@link CustomVirtualView} that uses gesture to provide scrolling. + */ +public class ScrollableCustomVirtualView extends CustomVirtualView + implements GestureDetector.OnGestureListener { + + private static final String TAG = "ScrollableCustomView"; + + private GestureDetector mGestureDetector; + + public ScrollableCustomVirtualView(Context context) { + this(context, null); + } + + public ScrollableCustomVirtualView(Context context, AttributeSet attrs) { + this(context, attrs, 0); + + } + + public ScrollableCustomVirtualView(Context context, @Nullable AttributeSet attrs, + int defStyleAttr) { + this(context, attrs, defStyleAttr, 0); + } + + public ScrollableCustomVirtualView(Context context, @Nullable AttributeSet attrs, + int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + mGestureDetector = new GestureDetector(context, this); + } + + /** + * Resets the UI to the intial state. + */ + public void resetPositions() { + super.resetCoordinates(); + } + + @Override + public boolean onTouchEvent(MotionEvent event) { + return mGestureDetector.onTouchEvent(event); + } + + /* + * Methods below implement GestureDetector.OnGestureListener + */ + @Override + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { + if (VERBOSE) Log.v(TAG, "onScroll(): " + distanceX + " - " + distanceY); + if (mFocusedLine != null) { + mAutofillManager.notifyViewExited(this, mFocusedLine.mFieldTextItem.id); + } + mTopMargin -= distanceY; + mLeftMargin -= distanceX; + invalidate(); + return true; + } + + @Override + public boolean onDown(MotionEvent event) { + onMotion((int) event.getY()); + return true; + } + + @Override + public void onShowPress(MotionEvent e) { + } + + @Override + public boolean onSingleTapUp(MotionEvent e) { + return true; + } + + @Override + public void onLongPress(MotionEvent e) { + } + + @Override + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { + return true; + } +} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/StandardAutoCompleteSignInActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/StandardAutoCompleteSignInActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..49acd377b6a323fff1934bddcaab1f76a0344536 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/StandardAutoCompleteSignInActivity.java @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.v7.app.AppCompatActivity; +import android.util.Log; +import android.view.View; +import android.view.autofill.AutofillManager; +import android.widget.ArrayAdapter; +import android.widget.AutoCompleteTextView; +import android.widget.TextView; +import android.widget.Toast; + +import static com.example.android.autofill.app.CommonUtil.TAG; + +public class StandardAutoCompleteSignInActivity extends AppCompatActivity { + private AutoCompleteTextView mUsernameAutoCompleteField; + private TextView mPasswordField; + private TextView mLoginButton; + private TextView mClearButton; + private boolean mAutofillReceived = false; + private AutofillManager.AutofillCallback mAutofillCallback; + private AutofillManager mAutofillManager; + + public static Intent getStartActivityIntent(Context context) { + Intent intent = new Intent(context, StandardAutoCompleteSignInActivity.class); + return intent; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.login_with_autocomplete_activity); + + mLoginButton = findViewById(R.id.login); + mClearButton = findViewById(R.id.clear); + mUsernameAutoCompleteField = findViewById(R.id.usernameField); + mPasswordField = findViewById(R.id.passwordField); + mLoginButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + login(); + } + }); + mClearButton.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + resetFields(); + } + }); + mAutofillCallback = new MyAutofillCallback(); + mAutofillManager = getSystemService(AutofillManager.class); + ArrayAdapter mockAutocompleteAdapter = ArrayAdapter.createFromResource + (this, R.array.mock_autocomplete_sign_in_suggestions, + android.R.layout.simple_dropdown_item_1line); + mUsernameAutoCompleteField.setAdapter(mockAutocompleteAdapter); + } + + @Override + protected void onResume() { + super.onResume(); + mAutofillManager.registerCallback(mAutofillCallback); + } + + @Override + protected void onPause() { + super.onPause(); + mAutofillManager.unregisterCallback(mAutofillCallback); + } + + private void resetFields() { + mUsernameAutoCompleteField.setText(""); + mPasswordField.setText(""); + } + + /** + * Emulates a login action. + */ + private void login() { + String username = mUsernameAutoCompleteField.getText().toString(); + String password = mPasswordField.getText().toString(); + boolean valid = isValidCredentials(username, password); + if (valid) { + Intent intent = WelcomeActivity.getStartActivityIntent(StandardAutoCompleteSignInActivity.this); + startActivity(intent); + finish(); + } else { + Toast.makeText(this, "Authentication failed.", Toast.LENGTH_SHORT).show(); + } + } + + /** + * Dummy implementation for demo purposes. A real service should use secure mechanisms to + * authenticate users. + */ + public boolean isValidCredentials(String username, String password) { + return username != null && password != null && username.equals(password); + } + + private class MyAutofillCallback extends AutofillManager.AutofillCallback { + @Override + public void onAutofillEvent(@NonNull View view, int event) { + if (view instanceof AutoCompleteTextView) { + switch (event) { + case AutofillManager.AutofillCallback.EVENT_INPUT_UNAVAILABLE: + // no break on purpose + case AutofillManager.AutofillCallback.EVENT_INPUT_HIDDEN: + if (!mAutofillReceived) { + ((AutoCompleteTextView) view).showDropDown(); + } + break; + case AutofillManager.AutofillCallback.EVENT_INPUT_SHOWN: + mAutofillReceived = true; + ((AutoCompleteTextView) view).setAdapter(null); + break; + default: + Log.d(TAG, "Unexpected callback: " + event); + } + } + } + } +} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/LoginActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/StandardSignInActivity.java similarity index 76% rename from prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/LoginActivity.java rename to prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/StandardSignInActivity.java index 3ec87da07d2051fcf53a2b3842629be40b921155..6664a188b6e72e68f766ec4d6ee1771614a7ba6e 100644 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/LoginActivity.java +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/StandardSignInActivity.java @@ -13,28 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.example.android.autofillframework.app; +package com.example.android.autofill.app; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; -import android.widget.Button; import android.widget.EditText; import android.widget.Toast; -import com.example.android.autofillframework.R; - -public class LoginActivity extends AppCompatActivity { +public class StandardSignInActivity extends AppCompatActivity { private EditText mUsernameEditText; private EditText mPasswordEditText; - private Button mLoginButton; - private Button mClearButton; public static Intent getStartActivityIntent(Context context) { - Intent intent = new Intent(context, LoginActivity.class); + Intent intent = new Intent(context, StandardSignInActivity.class); return intent; } @@ -43,18 +38,15 @@ public class LoginActivity extends AppCompatActivity { super.onCreate(savedInstanceState); setContentView(R.layout.login_activity); - - mLoginButton = (Button) findViewById(R.id.login); - mClearButton = (Button) findViewById(R.id.clear); - mUsernameEditText = (EditText) findViewById(R.id.usernameField); - mPasswordEditText = (EditText) findViewById(R.id.passwordField); - mLoginButton.setOnClickListener(new View.OnClickListener() { + mUsernameEditText = findViewById(R.id.usernameField); + mPasswordEditText = findViewById(R.id.passwordField); + findViewById(R.id.login).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { login(); } }); - mClearButton.setOnClickListener(new View.OnClickListener() { + findViewById(R.id.clear).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { resetFields(); @@ -75,7 +67,7 @@ public class LoginActivity extends AppCompatActivity { String password = mPasswordEditText.getText().toString(); boolean valid = isValidCredentials(username, password); if (valid) { - Intent intent = WelcomeActivity.getStartActivityIntent(LoginActivity.this); + Intent intent = WelcomeActivity.getStartActivityIntent(StandardSignInActivity.this); startActivity(intent); finish(); } else { diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/VirtualLoginActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/VirtualSignInActivity.java similarity index 62% rename from prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/VirtualLoginActivity.java rename to prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/VirtualSignInActivity.java index 5a4a4f4e4944f75b132b506a6e58ba3fac939415..f157faf8521e829a70b5d15df120f187ef3ec68e 100644 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/VirtualLoginActivity.java +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/VirtualSignInActivity.java @@ -13,25 +13,28 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.example.android.autofillframework.app; +package com.example.android.autofill.app; -import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; +import android.view.autofill.AutofillManager; import android.widget.Toast; -import com.example.android.autofillframework.R; - - -public class VirtualLoginActivity extends AppCompatActivity { +/** + * Activity that uses a virtual views for Username/Password text fields. + */ +public class VirtualSignInActivity extends AppCompatActivity { private CustomVirtualView mCustomVirtualView; + private AutofillManager mAutofillManager; + private CustomVirtualView.Line mUsernameLine; + private CustomVirtualView.Line mPasswordLine; public static Intent getStartActivityIntent(Context context) { - Intent intent = new Intent(context, VirtualLoginActivity.class); + Intent intent = new Intent(context, VirtualSignInActivity.class); return intent; } @@ -42,6 +45,16 @@ public class VirtualLoginActivity extends AppCompatActivity { setContentView(R.layout.virtual_login_activity); mCustomVirtualView = (CustomVirtualView) findViewById(R.id.custom_view); + + CustomVirtualView.Partition credentialsPartition = + mCustomVirtualView.addPartition(getString(R.string.partition_credentials)); + mUsernameLine = credentialsPartition.addLine("username", View.AUTOFILL_TYPE_TEXT, + getString(R.string.username_label), + " ", false, View.AUTOFILL_HINT_USERNAME); + mPasswordLine = credentialsPartition.addLine("password", View.AUTOFILL_TYPE_TEXT, + getString(R.string.password_label), + " ", true, View.AUTOFILL_HINT_PASSWORD); + findViewById(R.id.login).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -52,24 +65,29 @@ public class VirtualLoginActivity extends AppCompatActivity { @Override public void onClick(View view) { resetFields(); + mAutofillManager.cancel(); } }); + mAutofillManager = getSystemService(AutofillManager.class); } private void resetFields() { - mCustomVirtualView.resetFields(); + mUsernameLine.reset(); + mPasswordLine.reset(); + mCustomVirtualView.postInvalidate(); } /** * Emulates a login action. */ private void login() { - String username = mCustomVirtualView.getUsernameText().toString(); - String password = mCustomVirtualView.getPasswordText().toString(); + String username = mUsernameLine.getText().toString(); + String password = mPasswordLine.getText().toString(); boolean valid = isValidCredentials(username, password); if (valid) { - Intent intent = WelcomeActivity.getStartActivityIntent(VirtualLoginActivity.this); + Intent intent = WelcomeActivity.getStartActivityIntent(VirtualSignInActivity.this); startActivity(intent); + finish(); } else { Toast.makeText(this, "Authentication failed.", Toast.LENGTH_SHORT).show(); } diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/WebViewSignInActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/WebViewSignInActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..d7c012403ca420ae61c8bf19fcf92cc140dec210 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/WebViewSignInActivity.java @@ -0,0 +1,59 @@ +/* +* Copyright (C) 2017 The Android Open Source Project +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.util.Log; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; + +import static com.example.android.autofill.app.CommonUtil.DEBUG; +import static com.example.android.autofill.app.CommonUtil.TAG; + +public class WebViewSignInActivity extends AppCompatActivity { + + public static Intent getStartActivityIntent(Context context) { + Intent intent = new Intent(context, WebViewSignInActivity.class); + return intent; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.login_webview_activity); + + WebView webView = findViewById(R.id.webview); + WebSettings webSettings = webView.getSettings(); + webView.setWebViewClient(new WebViewClient()); + webSettings.setJavaScriptEnabled(true); + + String url = getIntent().getStringExtra("url"); + if (url == null) { + url = "file:///android_res/raw/sample_form.html"; + } + if (DEBUG) Log.d(TAG, "Clearing WebView data"); + webView.clearHistory(); + webView.clearFormData(); + webView.clearCache(true); + Log.i(TAG, "Loading URL " + url); + webView.loadUrl(url); + } +} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/WelcomeActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/WelcomeActivity.java new file mode 100644 index 0000000000000000000000000000000000000000..5f7b117d55750f54c099cfcfdf10d4eba88593ea --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofill/app/WelcomeActivity.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.android.autofill.app; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.os.CountDownTimer; +import android.support.v7.app.AppCompatActivity; +import android.widget.TextView; + +import static java.lang.Math.toIntExact; + +public class WelcomeActivity extends AppCompatActivity { + + public static Intent getStartActivityIntent(Context context) { + return new Intent(context, WelcomeActivity.class); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.welcome_activity); + final TextView countdownText = findViewById(R.id.countdownText); + new CountDownTimer(5000, 1000) { + @Override + public void onTick(long millisUntilFinished) { + int secondsRemaining = toIntExact(millisUntilFinished / 1000); + countdownText.setText(getResources().getQuantityString + (R.plurals.welcome_page_countdown, secondsRemaining, secondsRemaining)); + } + + @Override + public void onFinish() { + if (!WelcomeActivity.this.isFinishing()) { + finish(); + } + } + }.start(); + } +} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/CommonUtil.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/CommonUtil.java deleted file mode 100644 index 54049902d920b8757abf9cdbaeb7a42301dbe57d..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/CommonUtil.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework; - -import android.os.Bundle; - -import java.util.Arrays; -import java.util.Set; - -public final class CommonUtil { - - public static final String TAG = "AutofillSample"; - - public static final String EXTRA_DATASET_NAME = "dataset_name"; - public static final String EXTRA_FOR_RESPONSE = "for_response"; - - private static void bundleToString(StringBuilder builder, Bundle data) { - final Set keySet = data.keySet(); - builder.append("[Bundle with ").append(keySet.size()).append(" keys:"); - for (String key : keySet) { - builder.append(' ').append(key).append('='); - Object value = data.get(key); - if ((value instanceof Bundle)) { - bundleToString(builder, (Bundle) value); - } else { - builder.append((value instanceof Object[]) - ? Arrays.toString((Object[]) value) : value); - } - } - builder.append(']'); - } - - public static String bundleToString(Bundle data) { - if (data == null) { - return "N/A"; - } - final StringBuilder builder = new StringBuilder(); - bundleToString(builder, data); - return builder.toString(); - } -} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CreditCardActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CreditCardActivity.java deleted file mode 100644 index a82de4c8a1491ab8fa919134656500aff2738dbe..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CreditCardActivity.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.app; - -import android.content.Context; -import android.content.Intent; -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.view.View; -import android.widget.ArrayAdapter; -import android.widget.Button; -import android.widget.Spinner; - -import com.example.android.autofillframework.R; - -public class CreditCardActivity extends AppCompatActivity { - - private Spinner mCcExpirationDaySpinner; - private Spinner mCcExpirationMonthSpinner; - private Spinner mCcExpirationYearSpinner; - private Button mSubmitButton; - private Button mClearButton; - - public static Intent getStartActivityIntent(Context context) { - Intent intent = new Intent(context, CreditCardActivity.class); - return intent; - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setContentView(R.layout.credit_card_activity); - - mSubmitButton = (Button) findViewById(R.id.submit); - mClearButton = (Button) findViewById(R.id.clear); - mCcExpirationDaySpinner = (Spinner) findViewById(R.id.expirationDay); - mCcExpirationMonthSpinner = (Spinner) findViewById(R.id.expirationMonth); - mCcExpirationYearSpinner = (Spinner) findViewById(R.id.expirationYear); - - // Create an ArrayAdapter using the string array and a default spinner layout - ArrayAdapter dayAdapter = ArrayAdapter.createFromResource - (this, R.array.day_array, android.R.layout.simple_spinner_item); - // Specify the layout to use when the list of choices appears - dayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - // Apply the adapter to the spinner - mCcExpirationDaySpinner.setAdapter(dayAdapter); - - ArrayAdapter monthAdapter = ArrayAdapter.createFromResource - (this, R.array.month_array, android.R.layout.simple_spinner_item); - monthAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - mCcExpirationMonthSpinner.setAdapter(monthAdapter); - - ArrayAdapter yearAdapter = ArrayAdapter.createFromResource - (this, R.array.year_array, android.R.layout.simple_spinner_item); - yearAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - mCcExpirationYearSpinner.setAdapter(yearAdapter); - - mSubmitButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - submit(); - } - }); - mClearButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - resetFields(); - } - }); - } - - private void resetFields() { - //TODO - } - - /** - * Launches new Activity and finishes, triggering an autofill save request if the user entered - * any new data. - */ - private void submit() { - Intent intent = WelcomeActivity.getStartActivityIntent(CreditCardActivity.this); - startActivity(intent); - finish(); - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CustomVirtualView.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CustomVirtualView.java deleted file mode 100644 index 085f827c2638619b7427b51edf835bb3011e2e74..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/CustomVirtualView.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.app; - -import android.content.Context; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Paint; -import android.graphics.Paint.Style; -import android.graphics.Rect; -import android.util.AttributeSet; -import android.util.Log; -import android.util.SparseArray; -import android.view.MotionEvent; -import android.view.View; -import android.view.ViewStructure; -import android.view.autofill.AutofillManager; -import android.view.autofill.AutofillValue; -import android.widget.EditText; -import android.widget.TextView; - -import com.example.android.autofillframework.R; - -import java.util.ArrayList; -import java.util.Arrays; - -import static com.example.android.autofillframework.CommonUtil.bundleToString; - - -/** - * Custom View with virtual child views for Username/Password text fields. - */ -public class CustomVirtualView extends View { - - private static final String TAG = "CustomView"; - - private static int nextId; - - private final ArrayList mLines = new ArrayList<>(); - private final SparseArray mItems = new SparseArray<>(); - private final AutofillManager mAfm; - - private Line mFocusedLine; - private Paint mTextPaint; - private int mTextHeight; - private int mTopMargin; - private int mLeftMargin; - private int mVerticalGap; - private int mLineLength; - private int mFocusedColor; - private int mUnfocusedColor; - - private Line mUsernameLine; - private Line mPasswordLine; - - public CustomVirtualView(Context context, AttributeSet attrs) { - super(context, attrs); - - mAfm = context.getSystemService(AutofillManager.class); - - mTextPaint = new Paint(); - - mUnfocusedColor = Color.BLACK; - mFocusedColor = Color.RED; - mTextPaint.setStyle(Style.FILL); - mTopMargin = 100; - mLeftMargin = 100; - mTextHeight = 90; - mVerticalGap = 10; - - mLineLength = mTextHeight + mVerticalGap; - mTextPaint.setTextSize(mTextHeight); - mUsernameLine = addLine("usernameField", context.getString(R.string.username_label), - new String[] {View.AUTOFILL_HINT_USERNAME}, " ", true); - mPasswordLine = addLine("passwordField", context.getString(R.string.password_label), - new String[] {View.AUTOFILL_HINT_PASSWORD}, " ", false); - - Log.d(TAG, "Text height: " + mTextHeight); - } - - @Override - public void autofill(SparseArray values) { - // User has just selected a Dataset from the list of Autofill suggestions and the Dataset's - // AutofillValue gets passed into this method. - Log.d(TAG, "autoFill(): " + values); - for (int i = 0; i < values.size(); i++) { - final int id = values.keyAt(i); - final AutofillValue value = values.valueAt(i); - final Item item = mItems.get(id); - if (item == null) { - Log.w(TAG, "No item for id " + id); - return; - } - if (!item.editable) { - Log.w(TAG, "Item for id " + id + " is not editable: " + item); - return; - } - // Set the item's text to the text wrapped in the AutofillValue. - item.text = value.getTextValue(); - } - postInvalidate(); - } - - @Override - public void onProvideAutofillVirtualStructure(ViewStructure structure, int flags) { - // Build a ViewStructure to pack in AutoFillService requests. - structure.setClassName(getClass().getName()); - int childrenSize = mItems.size(); - Log.d(TAG, "onProvideAutofillVirtualStructure(): flags = " + flags + ", items = " - + childrenSize + ", extras: " + bundleToString(structure.getExtras())); - int index = structure.addChildCount(childrenSize); - for (int i = 0; i < childrenSize; i++) { - Item item = mItems.valueAt(i); - Log.d(TAG, "Adding new child at index " + index + ": " + item); - ViewStructure child = structure.newChild(index); - child.setAutofillId(structure, item.id); - child.setAutofillHints(item.hints); - child.setAutofillType(item.type); - child.setDataIsSensitive(!item.sanitized); - child.setText(item.text); - child.setAutofillValue(AutofillValue.forText(item.text)); - child.setFocused(item.focused); - child.setId(item.id, getContext().getPackageName(), null, item.line.idEntry); - child.setClassName(item.getClassName()); - index++; - } - } - - @Override - protected void onDraw(Canvas canvas) { - super.onDraw(canvas); - - Log.d(TAG, "onDraw: " + mLines.size() + " lines; canvas:" + canvas); - float x; - float y = mTopMargin + mLineLength; - for (int i = 0; i < mLines.size(); i++) { - x = mLeftMargin; - Line line = mLines.get(i); - Log.v(TAG, "Drawing '" + line + "' at " + x + "x" + y); - mTextPaint.setColor(line.fieldTextItem.focused ? mFocusedColor : mUnfocusedColor); - String readOnlyText = line.labelItem.text + ": ["; - String writeText = line.fieldTextItem.text + "]"; - // Paints the label first... - canvas.drawText(readOnlyText, x, y, mTextPaint); - // ...then paints the edit text and sets the proper boundary - float deltaX = mTextPaint.measureText(readOnlyText); - x += deltaX; - line.bounds.set((int) x, (int) (y - mLineLength), - (int) (x + mTextPaint.measureText(writeText)), (int) y); - Log.d(TAG, "setBounds(" + x + ", " + y + "): " + line.bounds); - canvas.drawText(writeText, x, y, mTextPaint); - y += mLineLength; - } - } - - @Override - public boolean onTouchEvent(MotionEvent event) { - int y = (int) event.getY(); - Log.d(TAG, "Touched: y=" + y + ", range=" + mLineLength + ", top=" + mTopMargin); - int lowerY = mTopMargin; - int upperY = -1; - for (int i = 0; i < mLines.size(); i++) { - upperY = lowerY + mLineLength; - Line line = mLines.get(i); - Log.d(TAG, "Line " + i + " ranges from " + lowerY + " to " + upperY); - if (lowerY <= y && y <= upperY) { - if (mFocusedLine != null) { - Log.d(TAG, "Removing focus from " + mFocusedLine); - mFocusedLine.changeFocus(false); - } - Log.d(TAG, "Changing focus to " + line); - mFocusedLine = line; - mFocusedLine.changeFocus(true); - invalidate(); - break; - } - lowerY += mLineLength; - } - return super.onTouchEvent(event); - } - - public CharSequence getUsernameText() { - return mUsernameLine.fieldTextItem.text; - } - - public CharSequence getPasswordText() { - return mPasswordLine.fieldTextItem.text; - } - - public void resetFields() { - mUsernameLine.reset(); - mPasswordLine.reset(); - postInvalidate(); - } - - private Line addLine(String idEntry, String label, String[] hints, String text, boolean sanitized) { - Line line = new Line(idEntry, label, hints, text, sanitized); - mLines.add(line); - mItems.put(line.labelItem.id, line.labelItem); - mItems.put(line.fieldTextItem.id, line.fieldTextItem); - return line; - } - - private static final class Item { - private final Line line; - private final int id; - private final boolean editable; - private final boolean sanitized; - private final String[] hints; - private final int type; - private CharSequence text; - private boolean focused = false; - - Item(Line line, int id, String[] hints, int type, CharSequence text, boolean editable, boolean sanitized) { - this.line = line; - this.id = id; - this.text = text; - this.editable = editable; - this.sanitized = sanitized; - this.hints = hints; - this.type = type; - } - - @Override - public String toString() { - return id + ": " + text + (editable ? " (editable)" : " (read-only)" - + (sanitized ? " (sanitized)" : " (sensitive")); - } - - public String getClassName() { - return editable ? EditText.class.getName() : TextView.class.getName(); - } - } - - private final class Line { - - // Boundaries of the text field, relative to the CustomView - final Rect bounds = new Rect(); - private Item labelItem; - private Item fieldTextItem; - private String idEntry; - - private Line(String idEntry, String label, String[] hints, String text, boolean sanitized) { - this.idEntry = idEntry; - this.labelItem = new Item(this, ++nextId, null, AUTOFILL_TYPE_NONE, label, false, true); - this.fieldTextItem = new Item(this, ++nextId, hints, AUTOFILL_TYPE_TEXT, text, true, sanitized); - } - - void changeFocus(boolean focused) { - fieldTextItem.focused = focused; - if (focused) { - final Rect absBounds = getAbsCoordinates(); - Log.d(TAG, "focus gained on " + fieldTextItem.id + "; absBounds=" + absBounds); - mAfm.notifyViewEntered(CustomVirtualView.this, fieldTextItem.id, absBounds); - } else { - Log.d(TAG, "focus lost on " + fieldTextItem.id); - mAfm.notifyViewExited(CustomVirtualView.this, fieldTextItem.id); - } - } - - private Rect getAbsCoordinates() { - // Must offset the boundaries so they're relative to the CustomView. - final int offset[] = new int[2]; - getLocationOnScreen(offset); - final Rect absBounds = new Rect(bounds.left + offset[0], - bounds.top + offset[1], - bounds.right + offset[0], bounds.bottom + offset[1]); - Log.v(TAG, "getAbsCoordinates() for " + fieldTextItem.id + ": bounds=" + bounds - + " offset: " + Arrays.toString(offset) + " absBounds: " + absBounds); - return absBounds; - } - - public void reset() { - fieldTextItem.text = " "; - } - - @Override - public String toString() { - return "Label: " + labelItem + " Text: " + fieldTextItem + " Focused: " + - fieldTextItem.focused; - } - } -} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.java deleted file mode 100644 index 4b27010b6a70e983b8d7587fbd9fba7513467318..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/app/MainActivity.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.app; - -import android.app.Activity; -import android.content.Intent; -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; -import android.view.View; - -import com.example.android.autofillframework.R; - -/** - * This is used to launch sample activities that showcase autofill. - */ -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - findViewById(R.id.standardViewSignInButton).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - standardViewSignIn(); - } - }); - findViewById(R.id.virtualViewSignInButton).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - virtualViewSignIn(); - } - }); - findViewById(R.id.creditCardCheckoutButton).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View view) { - creditCardCheckout(); - } - }); - } - - private void creditCardCheckout() { - Intent intent = CreditCardActivity.getStartActivityIntent(this); - startActivity(intent); - } - - private void standardViewSignIn() { - Intent intent = LoginActivity.getStartActivityIntent(this); - startActivity(intent); - } - - private void virtualViewSignIn() { - Intent intent = VirtualLoginActivity.getStartActivityIntent(this); - startActivity(intent); - } -} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/AuthActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/AuthActivity.java deleted file mode 100644 index 768b2ee393f48289cbc1cec4e2090f1994b82273..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/AuthActivity.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service; - -import android.app.Activity; -import android.app.PendingIntent; -import android.app.assist.AssistStructure; -import android.content.Context; -import android.content.Intent; -import android.content.IntentSender; -import android.os.Bundle; -import android.service.autofill.Dataset; -import android.service.autofill.FillResponse; -import android.support.annotation.Nullable; -import android.text.Editable; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.EditText; -import android.widget.Toast; - -import com.example.android.autofillframework.R; -import com.example.android.autofillframework.service.datasource.LocalAutofillRepository; -import com.example.android.autofillframework.service.model.AutofillFieldsCollection; -import com.example.android.autofillframework.service.model.ClientFormData; -import com.example.android.autofillframework.service.settings.MyPreferences; - -import java.util.HashMap; - -import static android.view.autofill.AutofillManager.EXTRA_ASSIST_STRUCTURE; -import static android.view.autofill.AutofillManager.EXTRA_AUTHENTICATION_RESULT; -import static com.example.android.autofillframework.CommonUtil.EXTRA_DATASET_NAME; -import static com.example.android.autofillframework.CommonUtil.EXTRA_FOR_RESPONSE; -import static com.example.android.autofillframework.CommonUtil.TAG; - -/** - * This Activity controls the UI for logging in to the Autofill service. - * It is launched when an Autofill Response or specific Dataset within the Response requires - * authentication to access. It bundles the result in an Intent. - */ -public class AuthActivity extends Activity { - - // Unique id for dataset intents. - private static int sDatasetPendingIntentId = 0; - - private EditText mMasterPassword; - private Button mCancel; - private Button mLogin; - private Intent mReplyIntent; - - static IntentSender getAuthIntentSenderForResponse(Context context) { - final Intent intent = new Intent(context, AuthActivity.class); - return PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT) - .getIntentSender(); - } - - static IntentSender getAuthIntentSenderForDataset(Context context, String datasetName) { - final Intent intent = new Intent(context, AuthActivity.class); - intent.putExtra(EXTRA_DATASET_NAME, datasetName); - intent.putExtra(EXTRA_FOR_RESPONSE, false); - return PendingIntent.getActivity(context, ++sDatasetPendingIntentId, intent, - PendingIntent.FLAG_CANCEL_CURRENT).getIntentSender(); - } - - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setContentView(R.layout.auth_activity); - mCancel = findViewById(R.id.cancel); - mLogin = findViewById(R.id.login); - mMasterPassword = findViewById(R.id.master_password); - mLogin.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - login(); - } - - }); - - mCancel.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - onFailure(); - AuthActivity.this.finish(); - } - }); - } - - private void login() { - Editable password = mMasterPassword.getText(); - if (password.toString() - .equals(MyPreferences.getInstance(AuthActivity.this).getMasterPassword())) { - onSuccess(); - } else { - Toast.makeText(this, "Password incorrect", Toast.LENGTH_SHORT).show(); - onFailure(); - } - finish(); - } - - @Override - public void finish() { - if (mReplyIntent != null) { - setResult(RESULT_OK, mReplyIntent); - } else { - setResult(RESULT_CANCELED); - } - super.finish(); - } - - private void onFailure() { - Log.w(TAG, "Failed auth."); - mReplyIntent = null; - } - - private void onSuccess() { - Intent intent = getIntent(); - boolean forResponse = intent.getBooleanExtra(EXTRA_FOR_RESPONSE, true); - AssistStructure structure = intent.getParcelableExtra(EXTRA_ASSIST_STRUCTURE); - StructureParser parser = new StructureParser(structure); - parser.parse(); - AutofillFieldsCollection autofillFields = parser.getAutofillFields(); - int saveTypes = parser.getSaveTypes(); - mReplyIntent = new Intent(); - HashMap clientFormDataMap = - LocalAutofillRepository.getInstance(this).getClientFormData - (autofillFields.getFocusedHints(), autofillFields.getAllHints()); - if (forResponse) { - setResponseIntent(AutofillHelper.newResponse - (this, false, autofillFields, saveTypes, clientFormDataMap)); - } else { - String datasetName = intent.getStringExtra(EXTRA_DATASET_NAME); - setDatasetIntent(AutofillHelper.newDataset - (this, autofillFields, clientFormDataMap.get(datasetName))); - } - } - - private void setResponseIntent(FillResponse fillResponse) { - mReplyIntent.putExtra(EXTRA_AUTHENTICATION_RESULT, fillResponse); - } - - private void setDatasetIntent(Dataset dataset) { - mReplyIntent.putExtra(EXTRA_AUTHENTICATION_RESULT, dataset); - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/AutofillHelper.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/AutofillHelper.java deleted file mode 100644 index 460729e6db549dcb600e9346d1325e2021a7f6a1..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/AutofillHelper.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service; - -import android.content.Context; -import android.content.IntentSender; -import android.service.autofill.Dataset; -import android.service.autofill.FillResponse; -import android.service.autofill.SaveInfo; -import android.util.Log; -import android.view.autofill.AutofillId; -import android.widget.RemoteViews; - -import com.example.android.autofillframework.R; -import com.example.android.autofillframework.service.model.AutofillFieldsCollection; -import com.example.android.autofillframework.service.model.ClientFormData; - -import java.util.HashMap; -import java.util.Set; - -import static com.example.android.autofillframework.CommonUtil.TAG; - -/** - * This is a class containing helper methods for building Autofill Datasets and Responses. - */ -public final class AutofillHelper { - - /** - * Wraps autofill data in a LoginCredential Dataset object which can then be sent back to the - * client View. - */ - public static Dataset newDataset(Context context, - AutofillFieldsCollection autofillFields, ClientFormData clientFormData) { - Dataset.Builder datasetBuilder = new Dataset.Builder - (newRemoteViews(context.getPackageName(), clientFormData.getDatasetName())); - boolean setValueAtLeastOnce = clientFormData.applyToFields(autofillFields, datasetBuilder); - if (setValueAtLeastOnce) { - return datasetBuilder.build(); - } else { - return null; - } - } - - public static RemoteViews newRemoteViews(String packageName, String remoteViewsText) { - RemoteViews presentation = new RemoteViews(packageName, R.layout.list_item); - presentation.setTextViewText(R.id.text1, remoteViewsText); - return presentation; - } - - /** - * Wraps autofill data in a Response object (essentially a series of Datasets) which can then - * be sent back to the client View. - */ - public static FillResponse newResponse(Context context, - boolean datasetAuth, AutofillFieldsCollection autofillFields, int saveType, - HashMap clientFormDataMap) { - FillResponse.Builder responseBuilder = new FillResponse.Builder(); - if (clientFormDataMap != null) { - Set datasetNames = clientFormDataMap.keySet(); - for (String datasetName : datasetNames) { - ClientFormData clientFormData = clientFormDataMap.get(datasetName); - if (datasetAuth) { - Dataset.Builder datasetBuilder = - new Dataset.Builder(newRemoteViews - (context.getPackageName(), clientFormData.getDatasetName())); - IntentSender sender = AuthActivity - .getAuthIntentSenderForDataset(context, clientFormData.getDatasetName()); - datasetBuilder.setAuthentication(sender); - responseBuilder.addDataset(datasetBuilder.build()); - } else { - Dataset dataset = newDataset(context, autofillFields, clientFormData); - if (dataset != null) { - responseBuilder.addDataset(dataset); - } - } - } - } - if (saveType != 0) { - AutofillId[] autofillIds = autofillFields.getAutofillIds(); - responseBuilder.setSaveInfo(new SaveInfo.Builder(saveType, autofillIds).build()); - return responseBuilder.build(); - } else { - Log.d(TAG, "These fields are not meant to be saved by autofill."); - return null; - } - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/MyAutofillService.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/MyAutofillService.java deleted file mode 100644 index 61e42050e64b328c7fbfbd9fb861a1df0f997d3a..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/MyAutofillService.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service; - -import android.app.assist.AssistStructure; -import android.content.IntentSender; -import android.os.Bundle; -import android.os.CancellationSignal; -import android.service.autofill.AutofillService; -import android.service.autofill.FillCallback; -import android.service.autofill.FillContext; -import android.service.autofill.FillRequest; -import android.service.autofill.FillResponse; -import android.service.autofill.SaveCallback; -import android.service.autofill.SaveRequest; -import android.util.Log; -import android.widget.RemoteViews; - -import com.example.android.autofillframework.R; -import com.example.android.autofillframework.service.datasource.LocalAutofillRepository; -import com.example.android.autofillframework.service.model.AutofillFieldsCollection; -import com.example.android.autofillframework.service.model.ClientFormData; -import com.example.android.autofillframework.service.settings.MyPreferences; - -import java.util.HashMap; -import java.util.List; - -import static com.example.android.autofillframework.CommonUtil.TAG; -import static com.example.android.autofillframework.CommonUtil.bundleToString; - -public class MyAutofillService extends AutofillService { - - @Override - public void onFillRequest(AssistStructure assistStructure, Bundle bundle, int i, - CancellationSignal cancellationSignal, FillCallback fillCallback) { - /* Deprecated, ignore */ - } - - @Override - public void onSaveRequest(AssistStructure assistStructure, Bundle bundle, - SaveCallback saveCallback) { - /* Deprecated, ignore */ - } - - @Override - public void onFillRequest(FillRequest request, CancellationSignal cancellationSignal, - FillCallback callback) { - AssistStructure structure = request.getStructure(); - final Bundle data = request.getClientState(); - Log.d(TAG, "onFillRequest(): data=" + bundleToString(data)); - - // Temporary hack for disabling autofill for components in this autofill service. - // i.e. we don't want to autofill components in AuthActivity. - if (structure.getActivityComponent().toShortString() - .contains("com.example.android.autofillframework.service")) { - callback.onSuccess(null); - return; - } - cancellationSignal.setOnCancelListener(new CancellationSignal.OnCancelListener() { - @Override - public void onCancel() { - Log.w(TAG, "Cancel autofill not implemented in this sample."); - } - }); - // Parse AutoFill data in Activity - StructureParser parser = new StructureParser(structure); - parser.parse(); - AutofillFieldsCollection autofillFields = parser.getAutofillFields(); - int saveTypes = parser.getSaveTypes(); - - FillResponse.Builder responseBuilder = new FillResponse.Builder(); - // Check user's settings for authenticating Responses and Datasets. - boolean responseAuth = MyPreferences.getInstance(this).isResponseAuth(); - if (responseAuth) { - // If the entire Autofill Response is authenticated, AuthActivity is used - // to generate Response. - IntentSender sender = AuthActivity.getAuthIntentSenderForResponse(this); - RemoteViews presentation = AutofillHelper - .newRemoteViews(getPackageName(), getString(R.string.autofill_sign_in_prompt)); - responseBuilder - .setAuthentication(autofillFields.getAutofillIds(), sender, presentation); - callback.onSuccess(responseBuilder.build()); - } else { - boolean datasetAuth = MyPreferences.getInstance(this).isDatasetAuth(); - HashMap clientFormDataMap = - LocalAutofillRepository.getInstance(this).getClientFormData - (autofillFields.getFocusedHints(), autofillFields.getAllHints()); - FillResponse response = AutofillHelper.newResponse - (this, datasetAuth, autofillFields, saveTypes, clientFormDataMap); - callback.onSuccess(response); - } - } - - @Override - public void onSaveRequest(SaveRequest request, SaveCallback callback) { - List context = request.getFillContexts(); - final AssistStructure structure = context.get(context.size() - 1).getStructure(); - final Bundle data = request.getClientState(); - Log.d(TAG, "onSaveRequest(): data=" + bundleToString(data)); - StructureParser parser = new StructureParser(structure); - parser.parse(); - ClientFormData clientFormData = parser.getClientFormData(); - LocalAutofillRepository.getInstance(this).saveClientFormData(clientFormData); - } - - @Override - public void onConnected() { - Log.d(TAG, "onConnected"); - } - - @Override - public void onDisconnected() { - Log.d(TAG, "onDisconnected"); - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/StructureParser.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/StructureParser.java deleted file mode 100644 index b6294449d8eb056d759435aa4ad73d3e9c306493..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/StructureParser.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service; - -import android.app.assist.AssistStructure; -import android.app.assist.AssistStructure.ViewNode; -import android.app.assist.AssistStructure.WindowNode; -import android.util.Log; - -import com.example.android.autofillframework.service.model.AutofillField; -import com.example.android.autofillframework.service.model.AutofillFieldsCollection; -import com.example.android.autofillframework.service.model.ClientFormData; -import com.example.android.autofillframework.service.model.SavedAutofillValue; - -import static com.example.android.autofillframework.CommonUtil.TAG; - -/** - * Parser for an AssistStructure object. This is invoked when the Autofill Service receives an - * AssistStructure from the client Activity, representing its View hierarchy. In this - * sample, it parses the hierarchy and records - */ -final class StructureParser { - private final AutofillFieldsCollection mAutofillFields = new AutofillFieldsCollection(); - private final AssistStructure mStructure; - private ClientFormData mClientFormData; - - StructureParser(AssistStructure structure) { - mStructure = structure; - - } - - /** - * Traverse AssistStructure and add ViewNode metadata to a flat list. - */ - void parse() { - Log.d(TAG, "Parsing structure for " + mStructure.getActivityComponent()); - int nodes = mStructure.getWindowNodeCount(); - mClientFormData = new ClientFormData(); - for (int i = 0; i < nodes; i++) { - WindowNode node = mStructure.getWindowNodeAt(i); - ViewNode view = node.getRootViewNode(); - parseLocked(view); - } - } - - private void parseLocked(ViewNode viewNode) { - if (viewNode.getAutofillHints() != null && viewNode.getAutofillHints().length > 0) { - //TODO check to make sure hints are supported by service. - mAutofillFields.add(new AutofillField(viewNode)); - mClientFormData - .set(viewNode.getAutofillHints(), SavedAutofillValue.fromViewNode(viewNode)); - } - int childrenSize = viewNode.getChildCount(); - if (childrenSize > 0) { - for (int i = 0; i < childrenSize; i++) { - parseLocked(viewNode.getChildAt(i)); - } - } - } - - public AutofillFieldsCollection getAutofillFields() { - return mAutofillFields; - } - - public int getSaveTypes() { - return mAutofillFields.getSaveType(); - } - - public ClientFormData getClientFormData() { - return mClientFormData; - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/datasource/LocalAutofillRepository.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/datasource/LocalAutofillRepository.java deleted file mode 100644 index 8336fe1e38aefc68358472af2e439316fa9e84d5..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/datasource/LocalAutofillRepository.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service.datasource; - -import android.content.Context; -import android.content.SharedPreferences; -import android.util.ArraySet; - -import com.example.android.autofillframework.service.model.ClientFormData; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.HashMap; -import java.util.List; -import java.util.Set; - -/** - * Singleton autofill data repository, that stores autofill fields to SharedPreferences. - * DISCLAIMER, you should not store sensitive fields like user data unencrypted. This is only done - * here for simplicity and learning purposes. - */ -public class LocalAutofillRepository implements AutofillRepository { - private static final String SHARED_PREF_KEY = "com.example.android.autofillframework.service"; - private static final String CLIENT_FORM_DATA_KEY = "loginCredentialDatasets"; - private static final String DATASET_NUMBER_KEY = "datasetNumber"; - - private static LocalAutofillRepository sInstance; - - private final SharedPreferences mPrefs; - - // TODO prepend with autofill data set in Settings. - private LocalAutofillRepository(Context context) { - mPrefs = context.getApplicationContext() - .getSharedPreferences(SHARED_PREF_KEY, Context.MODE_PRIVATE); - } - - public static LocalAutofillRepository getInstance(Context context) { - if (sInstance == null) { - sInstance = new LocalAutofillRepository(context); - } - return sInstance; - } - - @Override - public HashMap getClientFormData(List focusedAutofillHints, - List allAutofillHints) { - try { - // TODO use sqlite instead. - boolean hasDataForFocusedAutofillHints = false; - HashMap clientFormDataMap = new HashMap<>(); - Set clientFormDataStringSet = getAllAutofillDataStringSet(); - for (String clientFormDataString : clientFormDataStringSet) { - ClientFormData clientFormData = ClientFormData - .fromJson(new JSONObject(clientFormDataString)); - if (clientFormData != null) { - if (clientFormData.helpsWithHints(focusedAutofillHints)) { - hasDataForFocusedAutofillHints = true; - } - if (clientFormData.helpsWithHints(allAutofillHints)) { - clientFormDataMap.put(clientFormData.getDatasetName(), clientFormData); - } - } - } - if (hasDataForFocusedAutofillHints) { - return clientFormDataMap; - } else { - return null; - } - } catch (JSONException e) { - return null; - } - } - - @Override - public void saveClientFormData(ClientFormData clientFormData) { - //TODO use sqlite instead. - String datasetName = "dataset-" + getDatasetNumber(); - clientFormData.setDatasetName(datasetName); - Set allAutofillData = getAllAutofillDataStringSet(); - allAutofillData.add(clientFormData.toJson().toString()); - saveAllAutofillDataStringSet(allAutofillData); - incrementDatasetNumber(); - } - - @Override - public void clear() { - mPrefs.edit().remove(CLIENT_FORM_DATA_KEY).apply(); - } - - private Set getAllAutofillDataStringSet() { - return mPrefs.getStringSet(CLIENT_FORM_DATA_KEY, new ArraySet()); - } - - private void saveAllAutofillDataStringSet(Set allAutofillDataStringSet) { - mPrefs.edit().putStringSet(CLIENT_FORM_DATA_KEY, allAutofillDataStringSet).apply(); - } - - /** - * For simplicity, datasets will be named in the form "dataset-X" where X means - * this was the Xth dataset saved. - */ - private int getDatasetNumber() { - return mPrefs.getInt(DATASET_NUMBER_KEY, 0); - } - - /** - * Every time a dataset is saved, this should be called to increment the dataset number. - * (only important for this service's dataset naming scheme). - */ - private void incrementDatasetNumber() { - mPrefs.edit().putInt(DATASET_NUMBER_KEY, getDatasetNumber() + 1).apply(); - } -} \ No newline at end of file diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/AutofillField.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/AutofillField.java deleted file mode 100644 index 4d4de2bc532798b608d948fda7d148f96999e280..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/AutofillField.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service.model; - -import android.app.assist.AssistStructure; -import android.service.autofill.SaveInfo; -import android.view.View; -import android.view.autofill.AutofillId; -import android.view.autofill.AutofillValue; - -/** - * Class that represents a field that can be autofilled. It will contain a description - * (what type data the field holds), an AutoFillId (an ID unique to the rest of the ViewStructure), - * and a value (what data is currently in the field). - */ -public class AutofillField { - private int mSaveType = 0; - private String[] mHints; - private AutofillId mId; - private int mAutofillType; - private String[] mAutofillOptions; - private boolean mFocused; - - public AutofillField(AssistStructure.ViewNode view) { - mId = view.getAutofillId(); - setHints(view.getAutofillHints()); - mAutofillType = view.getAutofillType(); - mAutofillOptions = view.getAutofillOptions(); - mFocused = view.isFocused(); - } - - public String[] getHints() { - return mHints; - } - - public void setHints(String[] hints) { - mHints = hints; - updateSaveTypeFromHints(); - } - - public int getSaveType() { - return mSaveType; - } - - public AutofillId getId() { - return mId; - } - - public void setId(AutofillId id) { - mId = id; - } - - public int getAutofillType() { - return mAutofillType; - } - - public int getAutofillOptionIndex(String value) { - for (int i = 0; i < mAutofillOptions.length; i++) { - if (mAutofillOptions[i].equals(value)) { - return i; - } - } - return -1; - } - - public boolean isFocused() { - return mFocused; - } - - private void updateSaveTypeFromHints() { - mSaveType = 0; - if (mHints == null) { - return; - } - for (String hint : mHints) { - switch (hint) { - case View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE: - case View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY: - case View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH: - case View.AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR: - case View.AUTOFILL_HINT_CREDIT_CARD_NUMBER: - case View.AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE: - mSaveType |= SaveInfo.SAVE_DATA_TYPE_CREDIT_CARD; - break; - case View.AUTOFILL_HINT_EMAIL_ADDRESS: - mSaveType |= SaveInfo.SAVE_DATA_TYPE_EMAIL_ADDRESS; - break; - case View.AUTOFILL_HINT_PHONE: - case View.AUTOFILL_HINT_NAME: - mSaveType |= SaveInfo.SAVE_DATA_TYPE_GENERIC; - break; - case View.AUTOFILL_HINT_PASSWORD: - mSaveType |= SaveInfo.SAVE_DATA_TYPE_PASSWORD; - mSaveType &= ~SaveInfo.SAVE_DATA_TYPE_EMAIL_ADDRESS; - mSaveType &= ~SaveInfo.SAVE_DATA_TYPE_USERNAME; - break; - case View.AUTOFILL_HINT_POSTAL_ADDRESS: - case View.AUTOFILL_HINT_POSTAL_CODE: - mSaveType |= SaveInfo.SAVE_DATA_TYPE_ADDRESS; - break; - case View.AUTOFILL_HINT_USERNAME: - mSaveType |= SaveInfo.SAVE_DATA_TYPE_USERNAME; - break; - } - } - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/AutofillFieldsCollection.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/AutofillFieldsCollection.java deleted file mode 100644 index 0354b989e1a333b4e948d87477cc48629d425bfe..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/AutofillFieldsCollection.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service.model; - -import android.view.autofill.AutofillId; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - -public final class AutofillFieldsCollection { - - private final List mAutofillIds = new ArrayList<>(); - private final HashMap> mAutofillHintsToFieldsMap = new HashMap<>(); - private final List mAllAutofillHints = new ArrayList<>(); - private final List mFocusedAutofillHints = new ArrayList<>(); - private int size = 0; - private int mSaveType = 0; - - public void add(AutofillField autofillField) { - mSaveType |= autofillField.getSaveType(); - size++; - mAutofillIds.add(autofillField.getId()); - List hintsList = Arrays.asList(autofillField.getHints()); - mAllAutofillHints.addAll(hintsList); - if (autofillField.isFocused()) { - mFocusedAutofillHints.addAll(hintsList); - } - for (String hint : autofillField.getHints()) { - if (mAutofillHintsToFieldsMap.get(hint) == null) { - mAutofillHintsToFieldsMap.put(hint, new ArrayList()); - } - mAutofillHintsToFieldsMap.get(hint).add(autofillField); - } - } - - public int getSaveType() { - return mSaveType; - } - - public AutofillId[] getAutofillIds() { - return mAutofillIds.toArray(new AutofillId[size]); - } - - public List getFieldsForHint(String hint) { - return mAutofillHintsToFieldsMap.get(hint); - } - - public List getFocusedHints() { - return mFocusedAutofillHints; - } - - public List getAllHints() { - return mAllAutofillHints; - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/ClientFormData.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/ClientFormData.java deleted file mode 100644 index aa57e9359e1ea9af009c3ed7ae0a7d990da8cc7e..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/ClientFormData.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service.model; - -import android.service.autofill.Dataset; -import android.support.annotation.NonNull; -import android.util.Log; -import android.view.View; -import android.view.autofill.AutofillId; -import android.view.autofill.AutofillValue; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -/** - * ClientFormData is the model that holds all of the data on a client app's page, plus the dataset - * name associated with it. - */ -public final class ClientFormData { - private static final String TAG = "ClientFormData"; - private final HashMap hintMap; - private String datasetName; - - public ClientFormData() { - this(null, new HashMap()); - } - - public ClientFormData(String datasetName, HashMap hintMap) { - this.hintMap = hintMap; - this.datasetName = datasetName; - } - - public static ClientFormData fromJson(JSONObject jsonObject) { - HashMap hintMap = new HashMap<>(); - try { - String datasetName = jsonObject.has("datasetName") ? - jsonObject.getString("datasetName") : null; - JSONObject valuesJson = jsonObject.getJSONObject("values"); - Iterator hints = valuesJson.keys(); - while (hints.hasNext()) { - String hint = hints.next(); - JSONObject valueAsJson = valuesJson - .getJSONObject(hint); - if (valueAsJson != null) { - SavedAutofillValue savedAutofillValue = SavedAutofillValue.fromJson(valueAsJson); - hintMap.put(hint, savedAutofillValue); - } - } - return new ClientFormData(datasetName, hintMap); - } catch (JSONException e) { - Log.d(TAG, e.getMessage()); - return null; - } - } - - /** - * Returns the name of the {@link Dataset}. - */ - public String getDatasetName() { - return this.datasetName; - } - - /** - * Sets the {@link Dataset} name. - */ - public void setDatasetName(String datasetName) { - this.datasetName = datasetName; - } - - /** - * Sets values for a list of hints. - */ - public void set(@NonNull String[] autofillHints, @NonNull SavedAutofillValue autofillValue) { - if (autofillHints.length < 1) { - return; - } - for (int i = 0; i < autofillHints.length; i++) { - hintMap.put(autofillHints[i], autofillValue); - } - } - - /** - * Populates a {@link Dataset.Builder} with appropriate values for each {@link AutofillId} - * in a {@code AutofillFieldsCollection}. - */ - public boolean applyToFields(AutofillFieldsCollection autofillFieldsCollection, - Dataset.Builder datasetBuilder) { - boolean setValueAtLeastOnce = false; - List allHints = autofillFieldsCollection.getAllHints(); - for (int hintIndex = 0; hintIndex < allHints.size(); hintIndex++) { - String hint = allHints.get(hintIndex); - List autofillFields = autofillFieldsCollection.getFieldsForHint(hint); - if (autofillFields == null) { - continue; - } - for (int autofillFieldIndex = 0; autofillFieldIndex < autofillFields.size(); autofillFieldIndex++) { - AutofillField autofillField = autofillFields.get(autofillFieldIndex); - AutofillId autofillId = autofillField.getId(); - int autofillType = autofillField.getAutofillType(); - SavedAutofillValue savedAutofillValue = hintMap.get(hint); - switch (autofillType) { - case View.AUTOFILL_TYPE_LIST: - int listValue = autofillField.getAutofillOptionIndex(savedAutofillValue.getTextValue()); - if (listValue != -1) { - datasetBuilder.setValue(autofillId, AutofillValue.forList(listValue)); - setValueAtLeastOnce = true; - } - break; - case View.AUTOFILL_TYPE_DATE: - long dateValue = savedAutofillValue.getDateValue(); - if (dateValue != -1) { - datasetBuilder.setValue(autofillId, AutofillValue.forDate(dateValue)); - setValueAtLeastOnce = true; - } - break; - case View.AUTOFILL_TYPE_TEXT: - String textValue = savedAutofillValue.getTextValue(); - if (textValue != null) { - datasetBuilder.setValue(autofillId, AutofillValue.forText(textValue)); - setValueAtLeastOnce = true; - } - break; - case View.AUTOFILL_TYPE_TOGGLE: - if (savedAutofillValue.hasToggleValue()) { - boolean toggleValue = savedAutofillValue.getToggleValue(); - datasetBuilder.setValue(autofillId, AutofillValue.forToggle(toggleValue)); - setValueAtLeastOnce = true; - } - break; - case View.AUTOFILL_TYPE_NONE: - default: - Log.w(TAG, "Invalid autofill type - " + autofillType); - break; - } - } - } - return setValueAtLeastOnce; - } - - public JSONObject toJson() { - JSONObject jsonObject = new JSONObject(); - try { - jsonObject.put("datasetName", datasetName != null ? datasetName : JSONObject.NULL); - JSONObject jsonValues = new JSONObject(); - Set hints = hintMap.keySet(); - for (String hint : hints) { - SavedAutofillValue value = hintMap.get(hint); - jsonValues.put(hint, value != null ? value.toJson() : JSONObject.NULL); - } - jsonObject.put("values", jsonValues); - } catch (JSONException e) { - Log.e(TAG, e.getMessage()); - } - return jsonObject; - } - - public boolean helpsWithHints(List autofillHints) { - for (int i = 0; i < autofillHints.size(); i++) { - String autofillHint = autofillHints.get(i); - if (hintMap.get(autofillHint) != null && !hintMap.get(autofillHint).isNull()) { - return true; - } - } - return false; - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/SavedAutofillValue.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/SavedAutofillValue.java deleted file mode 100644 index 73e0c81eb0a1493bc5ace231208349da4324d050..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/model/SavedAutofillValue.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service.model; - -import android.app.assist.AssistStructure; -import android.util.Log; -import android.view.autofill.AutofillValue; - -import org.json.JSONException; -import org.json.JSONObject; - -public class SavedAutofillValue { - private static final String TAG = "SavedAutofillValue"; - private String textValue = null; - private Long dateValue = -1L; - private Boolean toggleValue = false; - private boolean hasToggleValue = false; - - public static SavedAutofillValue fromJson(JSONObject jsonObject) { - if (jsonObject == null) { - return null; - } - try { - SavedAutofillValue savedAutofillValue = new SavedAutofillValue(); - - savedAutofillValue.textValue = - !jsonObject.isNull("textValue") ? jsonObject.getString("textValue") : null; - savedAutofillValue.dateValue = - !jsonObject.isNull("dateValue") ? jsonObject.getLong("dateValue") : null; - savedAutofillValue.setToggleValue - (!jsonObject.isNull("toggleValue") ? jsonObject.getBoolean("toggleValue") : null); - return savedAutofillValue; - } catch (JSONException e) { - Log.e(TAG, e.getMessage()); - return null; - } - } - - public static SavedAutofillValue fromViewNode(AssistStructure.ViewNode viewNode) { - SavedAutofillValue savedAutofillValue = new SavedAutofillValue(); - AutofillValue autofillValue = viewNode.getAutofillValue(); - if (autofillValue != null) { - if (autofillValue.isList()) { - String[] autofillOptions = viewNode.getAutofillOptions(); - int index = autofillValue.getListValue(); - if (autofillOptions != null && autofillOptions.length > 0) { - savedAutofillValue.textValue = autofillOptions[index]; - } - } else if (autofillValue.isDate()) { - savedAutofillValue.dateValue = autofillValue.getDateValue(); - } else if (autofillValue.isText()) { - // Using toString of AutofillValue.getTextValue in order to save it to - // SharedPreferences. - savedAutofillValue.textValue = autofillValue.getTextValue().toString(); - } - } - return savedAutofillValue; - } - - public JSONObject toJson() { - JSONObject jsonObject = new JSONObject(); - try { - jsonObject.put("textValue", textValue != null ? textValue : JSONObject.NULL); - jsonObject.put("dateValue", dateValue != null ? dateValue : JSONObject.NULL); - jsonObject.put("toggleValue", toggleValue != null ? toggleValue : JSONObject.NULL); - return jsonObject; - } catch (JSONException e) { - Log.e(TAG, e.getMessage()); - return null; - } - } - - public String getTextValue() { - return textValue; - } - - public long getDateValue() { - return dateValue; - } - - - public boolean getToggleValue() { - return toggleValue; - } - - public void setToggleValue(Boolean toggleValue) { - this.toggleValue = toggleValue; - hasToggleValue = toggleValue != null; - } - - - public boolean isNull() { - return textValue == null && dateValue == -1L && !hasToggleValue; - } - - public boolean hasToggleValue() { - return hasToggleValue; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - SavedAutofillValue that = (SavedAutofillValue) o; - - if (textValue != null ? !textValue.equals(that.textValue) : that.textValue != null) - return false; - if (dateValue != null ? !dateValue.equals(that.dateValue) : that.dateValue != null) - return false; - return toggleValue != null ? toggleValue.equals(that.toggleValue) : that.toggleValue == null; - - } - - @Override - public int hashCode() { - int result = textValue != null ? textValue.hashCode() : 0; - result = 31 * result + (dateValue != null ? dateValue.hashCode() : 0); - result = 31 * result + (toggleValue != null ? toggleValue.hashCode() : 0); - return result; - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/settings/MyPreferences.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/settings/MyPreferences.java deleted file mode 100644 index 3926530e3eb5b0f67610c4c58a50065f4533a9ab..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/settings/MyPreferences.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service.settings; - -import android.content.Context; -import android.content.SharedPreferences; -import android.service.autofill.Dataset; -import android.service.autofill.FillResponse; -import android.support.annotation.NonNull; - -public class MyPreferences { - private static final String TAG = "MyPreferences"; - - private static final String RESPONSE_AUTH_KEY = "response_auth"; - private static final String DATASET_AUTH_KEY = "dataset_auth"; - private static final String MASTER_PASSWORD_KEY = "master_password"; - - private static MyPreferences sInstance; - private final SharedPreferences mPrefs; - - private MyPreferences(Context context) { - mPrefs = context.getApplicationContext().getSharedPreferences("my-settings", - Context.MODE_PRIVATE); - } - - public static MyPreferences getInstance(Context context) { - if (sInstance == null) { - sInstance = new MyPreferences(context); - } - return sInstance; - } - - /** - * Gets whether {@link FillResponse}s should require authentication. - */ - public boolean isResponseAuth() { - return mPrefs.getBoolean(RESPONSE_AUTH_KEY, false); - } - - /** - * Enables/disables authentication for the entire autofill {@link FillResponse}. - */ - public void setResponseAuth(boolean responseAuth) { - mPrefs.edit().putBoolean(RESPONSE_AUTH_KEY, responseAuth).apply(); - } - - /** - * Gets whether {@link Dataset}s should require authentication. - */ - public boolean isDatasetAuth() { - return mPrefs.getBoolean(DATASET_AUTH_KEY, false); - } - - /** - * Enables/disables authentication for individual autofill {@link Dataset}s. - */ - public void setDatasetAuth(boolean datasetAuth) { - mPrefs.edit().putBoolean(DATASET_AUTH_KEY, datasetAuth).apply(); - } - - /** - * Gets autofill master username. - */ - public String getMasterPassword() { - return mPrefs.getString(MASTER_PASSWORD_KEY, null); - } - - /** - * Sets autofill master password. - */ - public void setMasterPassword(@NonNull String masterPassword) { - mPrefs.edit().putString(MASTER_PASSWORD_KEY, masterPassword).apply(); - } - - public void clearCredentials() { - mPrefs.edit().remove(MASTER_PASSWORD_KEY).apply(); - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/settings/SettingsActivity.java b/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/settings/SettingsActivity.java deleted file mode 100644 index 6387d36b844d93be76f3c1a4e7809e39e50abb21..0000000000000000000000000000000000000000 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/java/com/example/android/autofillframework/service/settings/SettingsActivity.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.example.android.autofillframework.service.settings; - -import android.content.DialogInterface; -import android.os.Bundle; -import android.support.v7.app.AlertDialog; -import android.support.v7.app.AppCompatActivity; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.CompoundButton; -import android.widget.EditText; -import android.widget.ImageView; -import android.widget.Switch; -import android.widget.TextView; - -import com.example.android.autofillframework.R; -import com.example.android.autofillframework.service.datasource.LocalAutofillRepository; - -public class SettingsActivity extends AppCompatActivity { - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setContentView(R.layout.settings_activity); - final MyPreferences preferences = MyPreferences.getInstance(this); - setupSettingsSwitch(R.id.settings_auth_responses_container, - R.id.settings_auth_responses_label, - R.id.settings_auth_responses_switch, - preferences.isResponseAuth(), - new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean b) { - preferences.setResponseAuth(b); - } - }); - setupSettingsSwitch(R.id.settings_auth_datasets_container, - R.id.settings_auth_datasets_label, - R.id.settings_auth_datasets_switch, - preferences.isDatasetAuth(), - new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean b) { - preferences.setDatasetAuth(b); - } - }); - setupSettingsButton(R.id.settings_clear_data_container, - R.id.settings_clear_data_label, - R.id.settings_clear_data_icon, - new View.OnClickListener() { - @Override - public void onClick(View view) { - buildClearDataDialog().show(); - } - }); - - setupSettingsButton(R.id.settings_auth_credentials_container, - R.id.settings_auth_credentials_label, - R.id.settings_auth_credentials_icon, - new View.OnClickListener() { - @Override - public void onClick(View view) { - if (preferences.getMasterPassword() != null) { - buildCurrentCredentialsDialog().show(); - } else { - buildNewCredentialsDialog().show(); - } - } - }); - } - - private AlertDialog buildClearDataDialog() { - return new AlertDialog.Builder(SettingsActivity.this) - .setMessage(R.string.settings_clear_data_confirmation) - .setTitle(R.string.settings_clear_data_confirmation_title) - .setNegativeButton(R.string.cancel, null) - .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - LocalAutofillRepository.getInstance - (SettingsActivity.this).clear(); - MyPreferences.getInstance(SettingsActivity.this) - .clearCredentials(); - dialog.dismiss(); - } - }) - .create(); - } - - private AlertDialog.Builder prepareCredentialsDialog() { - return new AlertDialog.Builder(SettingsActivity.this) - .setTitle(R.string.settings_auth_change_credentials_title) - .setNegativeButton(R.string.cancel, null); - } - - private AlertDialog buildCurrentCredentialsDialog() { - final EditText currentPasswordField = LayoutInflater - .from(SettingsActivity.this) - .inflate(R.layout.settings_authentication_dialog, null) - .findViewById(R.id.master_password_field); - return prepareCredentialsDialog() - .setMessage(R.string.settings_auth_enter_current_password) - .setView(currentPasswordField) - .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - String password = currentPasswordField.getText().toString(); - if (MyPreferences.getInstance(SettingsActivity.this).getMasterPassword() - .equals(password)) { - buildNewCredentialsDialog().show(); - dialog.dismiss(); - } - } - }) - .create(); - } - - private AlertDialog buildNewCredentialsDialog() { - final EditText newPasswordField = LayoutInflater - .from(SettingsActivity.this) - .inflate(R.layout.settings_authentication_dialog, null) - .findViewById(R.id.master_password_field); - return prepareCredentialsDialog() - .setMessage(R.string.settings_auth_enter_new_password) - .setView(newPasswordField) - .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - String password = newPasswordField.getText().toString(); - MyPreferences.getInstance(SettingsActivity.this).setMasterPassword(password); - dialog.dismiss(); - } - }) - .create(); - } - - private void setupSettingsSwitch(int containerId, int labelId, int switchId, boolean checked, - CompoundButton.OnCheckedChangeListener checkedChangeListener) { - ViewGroup container = (ViewGroup) findViewById(containerId); - String switchLabel = ((TextView) container.findViewById(labelId)).getText().toString(); - final Switch switchView = container.findViewById(switchId); - switchView.setContentDescription(switchLabel); - switchView.setChecked(checked); - container.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - switchView.performClick(); - } - }); - switchView.setOnCheckedChangeListener(checkedChangeListener); - } - - private void setupSettingsButton(int containerId, int labelId, int imageViewId, - final View.OnClickListener onClickListener) { - ViewGroup container = (ViewGroup) findViewById(containerId); - String buttonLabel = ((TextView) container.findViewById(labelId)).getText().toString(); - final ImageView imageView = container.findViewById(imageViewId); - imageView.setContentDescription(buttonLabel); - container.setOnClickListener(onClickListener); - } -} diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-hdpi/ic_launcher.png b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..b1efaf4b23929755615dc16fa196c5f8496bbf9a Binary files /dev/null and b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-mdpi/ic_launcher.png b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..f5f9244f24dccccab7dbc1259ddfceb0cba619c0 Binary files /dev/null and b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-xhdpi/ic_launcher.png b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..5d07b3f06606f5f005afa8237a53f7ff3ef5966e Binary files /dev/null and b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-xxhdpi/ic_launcher.png b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..6ef21e1f4dfe8eeec63fde13a453812511646c83 Binary files /dev/null and b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..80f30a2f520665ab194da914d9ab0c5f4ef19075 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_autocomplete_logo_24dp.xml @@ -0,0 +1,24 @@ + + + + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..3a8ee3b2d042a4b8c83281d2ee4d64f9cde19172 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_custom_virtual_logo_24dp.xml @@ -0,0 +1,24 @@ + + + + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..17e403d9285267c8ddb8b2cd8202c1fefd698b81 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_edittexts_logo_24dp.xml @@ -0,0 +1,24 @@ + + + + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_email_black_24dp.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_email_black_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..174c1272545aee32679aa9a8abdfdc075e459f63 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_email_black_24dp.xml @@ -0,0 +1,24 @@ + + + + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_info_black_24dp.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_info_black_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..c297121b9ece211313fec3f42ba5a24ac2b93c89 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_info_black_24dp.xml @@ -0,0 +1,24 @@ + + + + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_send_white_24dp.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_send_white_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..f614267aea99b05c7b64f6fff8f39d9026617626 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_send_white_24dp.xml @@ -0,0 +1,24 @@ + + + + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..5fb27a24a6ca393c03ad9ac1e6a882b28ddfe0cf --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_spinners_logo_24dp.xml @@ -0,0 +1,24 @@ + + + + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_view_module_black_24dp.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_view_module_black_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..ab36b07663454c718b2be5c464b564478de26970 --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_view_module_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_web_black_24dp.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_web_black_24dp.xml new file mode 100644 index 0000000000000000000000000000000000000000..48e7b7bab02058a5f5f36fe339caf0f83b77390a --- /dev/null +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/drawable/ic_web_black_24dp.xml @@ -0,0 +1,24 @@ + + + + diff --git a/prebuilts/gradle/AutofillFramework/Application/src/main/res/layout/activity_main.xml b/prebuilts/gradle/AutofillFramework/Application/src/main/res/layout/activity_main.xml index 26d0657d2b846e047eb2a6fe95deedc8efcf92a1..a1ccd0c6ca1cd21b278e355c4667579ec86835e6 100644 --- a/prebuilts/gradle/AutofillFramework/Application/src/main/res/layout/activity_main.xml +++ b/prebuilts/gradle/AutofillFramework/Application/src/main/res/layout/activity_main.xml @@ -1,5 +1,4 @@ - - - - -