diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-06-18 20:59:55 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-06-18 20:59:55 +0000 |
commit | 8916483918c20cfe800501c953680e2bce736ab3 (patch) | |
tree | 9317ec96657b4e9fbe416bf4bc782dba28033d27 /java | |
parent | a25e320431d172139b0baf0e3162b8a47e0744fa (diff) | |
parent | eb3e5b92e6f74d7c773193f11566ccc023298ad6 (diff) |
Merge changes I572ef7cd,I4bb036ab,Icb2b9bc1,I6c9d9b6e,I7e3d9c3b, ...
* changes:
Updated licenses for v22 release.
Show "Calling accounts" for all users in DialerSettingsActivity
Fix an AOSP build error caused by bottom sheet states.
Check phone capabilities.
Improve Coalescer performance
Fix drag and drop crash.
Fix bug that RTT call is conferenceable with voice call.
Fully expand the bottom sheet when touch exploration is enabled.
Diffstat (limited to 'java')
14 files changed, 1442 insertions, 1661 deletions
diff --git a/java/com/android/dialer/about/res/raw/third_party_license_metadata b/java/com/android/dialer/about/res/raw/third_party_license_metadata index 87440dcd9..bd6259c9c 100755 --- a/java/com/android/dialer/about/res/raw/third_party_license_metadata +++ b/java/com/android/dialer/about/res/raw/third_party_license_metadata @@ -29,32 +29,34 @@ 304646:10693 Compatibility Libraries for Android localbroadcastmanager. 315386:10693 Compatibility Libraries for Android print. 326138:10693 Compatibility Libraries for Android slidingpanelayout. -336891:10693 Compatibility Libraries for Android swiperefreshlayout. -347635:10693 Compatibility Libraries for Android viewpager. -358339:11358 Dagger -369713:11357 Error Prone -381086:11358 Google Auto -392459:11358 Guava JDK5 -403832:11362 Guava JDK7 -415205:11358 J2ObjC -426575:11358 JSR 250 -437945:11365 JSR 330 -449346:11358 Material Components for Android -460715:11358 OkHttp -472082:11358 Okio -483455:11358 OpenCensus -494824:11358 Volley -506192:11357 ZXing -517569:12847 carrierservices -530428:11358 flexbox -541800:11358 gRPC Java -553167:11358 gson -564543:12847 jibercsclient -577409:10173 libphonenumber -587593:18982 mime4j -606594:10699 shortcutbadger -617309:16013 Android SDK -633344:22655 Checker Framework -656018:1096 Animal Sniffer -657124:4771 Glide -661907:1602 JSR 305 +336891:10695 Compatibility Libraries for Android support-slices_core +347646:10693 Compatibility Libraries for Android swiperefreshlayout. +358390:10693 Compatibility Libraries for Android viewpager. +369094:11358 Dagger +380468:11357 Error Prone +391841:11358 Google Auto +403214:11358 Guava JDK5 +414587:11362 Guava JDK7 +425960:11358 J2ObjC +437330:11358 JSR 250 +448700:11365 JSR 330 +460101:11358 Material Components for Android +471470:11358 OkHttp +482837:11358 Okio +494210:11358 OpenCensus +505579:11358 Volley +516947:11357 ZXing +528316:11358 flexbox +539688:11358 gRPC Java +551055:11358 gson +562432:10173 libphonenumber +572624:10699 shortcutbadger +583339:16013 Android SDK +599371:1096 Animal Sniffer +600479:1602 JSR 305 +602099:1732 Protobuf Nano +603865:1846 Checker Framework Annotations +605721:4771 Glide +610512:12847 carrierservices +623377:12847 jibercsclient +636235:18982 mime4j diff --git a/java/com/android/dialer/about/res/raw/third_party_licenses b/java/com/android/dialer/about/res/raw/third_party_licenses index e55131bc2..d8d950682 100755 --- a/java/com/android/dialer/about/res/raw/third_party_licenses +++ b/java/com/android/dialer/about/res/raw/third_party_licenses @@ -6057,6 +6057,200 @@ Compatibility Libraries for Android slidingpanelayout.: END OF TERMS AND CONDITIONS +Compatibility Libraries for Android support-slices_core: + + + Copyright (c) 2005-2011, 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. + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + + Compatibility Libraries for Android swiperefreshlayout.: @@ -9324,31 +9518,7 @@ ZXing: limitations under the License. -carrierservices: - -These components - com.google.android.rcs.core, - com.google.android.rcs.core.utils.CaseInsensitiveMap, - com.google.android.rcs.core.utils.DateTime, - com.google.android.rcs.core.utils.InetAddresses, - com.google.android.rcs.core.network.ConnectivityMonitor, - com.google.android.rcs.client.PrivateDataStorage, - com.google.android.rcs.client.utils.FastXmlSerializer, - com.google.android.rcs.client.utils.XmlUtils, - com.google.android.rcs.client.utils.QueuedWork -are licensed under Apache v2. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +flexbox: Apache License @@ -9528,42 +9698,33 @@ limitations under the License. END OF TERMS AND CONDITIONS -=============================================================================== + APPENDIX: How to apply the Apache License to your work. -These components - com.google.android.rcs.core.utils.FastBase64, - com.google.android.rcs.core.utils.LibraryLoaderHelper -are licensed under BSD. + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: + Copyright [yyyy] [name of copyright owner] - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. + http://www.apache.org/licenses/LICENSE-2.0 -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. -flexbox: +gRPC Java: Apache License @@ -9769,7 +9930,7 @@ flexbox: limitations under the License. -gRPC Java: +gson: Apache License @@ -9975,7 +10136,199 @@ gRPC Java: limitations under the License. -gson: +libphonenumber: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + +shortcutbadger: + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. Apache License @@ -10155,33 +10508,511 @@ gson: END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. +Android SDK: - Copyright [yyyy] [name of copyright owner] +ANDROID SOFTWARE DEVELOPMENT KIT - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at +Terms and Conditions - http://www.apache.org/licenses/LICENSE-2.0 +This is the Android Software Development Kit License Agreement. - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. +1. Introduction +1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and +specifically including the Android system files, packaged APIs, and Google APIs add-ons) is +licensed to you subject to the terms of this License Agreement. This License Agreement forms a +legally binding contract between you and Google in relation to your use of the SDK. -jibercsclient: +1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 +Amphitheatre Parkway, Mountain View, CA 94043, United States. + +2. Accepting this License Agreement + +2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the +SDK if you do not accept this License Agreement. + +2.2 You can accept this License Agreement by: + +(A) clicking to accept or agree to this License Agreement, where this option is made available to +you; or + +(B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of +the Licensing Agreement from that point onwards. + +2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person barred +from receiving the SDK under the laws of the United States or other countries including the country +in which you are resident or from which you use the SDK. + +2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other +entity, you represent and warrant that you have full legal authority to bind your employer or such +entity to this License Agreement. If you do not have the requisite authority, you may not accept +the Licensing Agreement or use the SDK on behalf of your employer or other entity. + +3. SDK License from Google + +3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, +royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop +applications to run on the Android platform. + +3.2 You agree that Google or third parties own all legal right, title and interest in and to the +SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property +Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, +and any and all other proprietary rights. Google reserves all rights not expressly granted to you. + +3.3 Except to the extent required by applicable third party licenses, you may not copy (except for +backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create +derivative works of the SDK or any part of the SDK. Except to the extent required by applicable +third party licenses, you may not load any part of the SDK onto a mobile handset or any other +hardware device except a personal computer, combine any part of the SDK with other software, or +distribute any software or device incorporating a part of the SDK. + +3.4 Use, reproduction and distribution of components of the SDK licensed under an open source +software license are governed solely by the terms of that open source software license and not +this License Agreement. + +3.5 You agree that the form and nature of the SDK that Google provides may change without prior +notice to you and that future versions of the SDK may be incompatible with applications developed +on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) +providing the SDK (or any features within the SDK) to you or to users generally at Google's sole +discretion, without prior notice to you. + +3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names, +trademarks, service marks, logos, domain names, or other distinctive brand features. + +3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including +copyright and trademark notices) that may be affixed to or contained within the SDK. + +4. Use of the SDK by You + +4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under +this License Agreement in or to any software applications that you develop using the SDK, including +any intellectual property rights that subsist in those applications. + +4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this +License Agreement and (b) any applicable law, regulation or generally accepted practices or +guidelines in the relevant jurisdictions (including any laws regarding the export of data or +software to and from the United States or other relevant countries). + +4.3 You agree that if you use the SDK to develop applications for general public users, you will +protect the privacy and legal rights of those users. If the users provide you with user names, +passwords, or other login information or personal information, your must make the users aware that +the information will be available to your application, and you must provide legally adequate privacy +notice and protection for those users. If your application stores personal or sensitive information +provided by users, it must do so securely. If the user provides your application with Google Account +information, your application may only use that information to access the user's Google Account +when, and for the limited purposes for which, the user has given you permission to do so. + +4.4 You agree that you will not engage in any activity with the SDK, including the development or +distribution of an application, that interferes with, disrupts, damages, or accesses in an +unauthorized manner the servers, networks, or other properties or services of any third party +including, but not limited to, Google or any mobile communications carrier. + +4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or +to any third party for) any data, content, or resources that you create, transmit or display through +the Android platform and/or applications for the Android platform, and for the consequences of your +actions (including any loss or damage which Google may suffer) by doing so. + +4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or +to any third party for) any breach of your obligations under this License Agreement, any applicable +third party contract or Terms of Service, or any applicable law or regulation, and for the +consequences (including any loss or damage which Google or any third party may suffer) of any such +breach. + +5. Your Developer Credentials + +5.1 You agree that you are responsible for maintaining the confidentiality of any developer +credentials that may be issued to you by Google or which you may choose yourself and that you will +be solely responsible for all applications that are developed under your developer credentials. + +6. Privacy and Information + +6.1 In order to continually innovate and improve the SDK, Google may collect certain usage +statistics from the software including but not limited to a unique identifier, associated IP +address, version number of the software, and information on which tools and/or services in the SDK +are being used and how they are being used. Before any of this information is collected, the SDK +will notify you and seek your consent. If you withhold consent, the information will not be +collected. + +6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in +accordance with Google's Privacy Policy. + +7. Third Party Applications for the Android Platform + +7.1 If you use the SDK to run applications developed by a third party or that access data, content +or resources provided by a third party, you agree that Google is not responsible for those +applications, data, content, or resources. You understand that all data, content or resources which +you may access through such third party applications are the sole responsibility of the person from +which they originated and that Google is not liable for any loss or damage that you may experience +as a result of the use or access of any of those third party applications, data, content, or +resources. + +7.2 You should be aware the data, content, and resources presented to you through such a third party +application may be protected by intellectual property rights which are owned by the providers (or by +other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute +or create derivative works based on these data, content, or resources (either in whole or in part) +unless you have been specifically given permission to do so by the relevant owners. + +7.3 You acknowledge that your use of such third party applications, data, content, or resources may +be subject to separate terms between you and the relevant third party. In that case, this License +Agreement does not affect your legal relationship with these third parties. + +8. Using Android APIs + +8.1 Google Data APIs + +8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be +protected by intellectual property rights which are owned by Google or those parties that provide +the data (or by other persons or companies on their behalf). Your use of any such API may be subject +to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create +derivative works based on this data (either in whole or in part) unless allowed by the relevant +Terms of Service. + +8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you +shall retrieve data only with the user's explicit consent and only when, and for the limited +purposes for which, the user has given you permission to do so. + +9. Terminating this License Agreement + +9.1 This License Agreement will continue to apply until terminated by either you or Google as set +out below. + +9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK +and any relevant developer credentials. + +9.3 Google may at any time, terminate this License Agreement with you if: + +(A) you have breached any provision of this License Agreement; or + +(B) Google is required to do so by law; or + +(C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated +its relationship with Google or ceased to offer certain parts of the SDK to you; or + +(D) Google decides to no longer providing the SDK or certain parts of the SDK to users in the +country in which you are resident or from which you use the service, or the provision of the SDK or +certain SDK services to you by Google is, in Google's sole discretion, no longer commercially +viable. + +9.4 When this License Agreement comes to an end, all of the legal rights, obligations and +liabilities that you and Google have benefited from, been subject to (or which have accrued over +time whilst this License Agreement has been in force) or which are expressed to continue +indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall +continue to apply to such rights, obligations and liabilities indefinitely. + +10. DISCLAIMER OF WARRANTIES + +10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE +SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. + +10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE +SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR +COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. + +10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + +11. LIMITATION OF LIABILITY + +11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS +LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY +LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN +AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. + +12. Indemnification + +12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless +Google, its affiliates and their respective directors, officers, employees and agents from and +against any and all claims, actions, suits or proceedings, as well as any and all losses, +liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or +accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any +copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any +person or defames any person or violates their rights of publicity or privacy, and (c) any +non-compliance by you with this License Agreement. + +13. Changes to the License Agreement + +13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. +When these changes are made, Google will make a new version of the License Agreement available on +the website where the SDK is made available. + +14. General Legal Terms + +14.1 This License Agreement constitute the whole legal agreement between you and Google and govern +your use of the SDK (excluding any services which Google may provide to you under a separate written +agreement), and completely replace any prior agreements between you and Google in relation to the +SDK. + +14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is +contained in this License Agreement (or which Google has the benefit of under any applicable law), +this will not be taken to be a formal waiver of Google's rights and that those rights or remedies +will still be available to Google. + +14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision +of this License Agreement is invalid, then that provision will be removed from this License +Agreement without affecting the rest of this License Agreement. The remaining provisions of this +License Agreement will continue to be valid and enforceable. + +14.4 You acknowledge and agree that each member of the group of companies of which Google is the +parent shall be third party beneficiaries to this License Agreement and that such other companies +shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that +confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall +be third party beneficiaries to this License Agreement. + +14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST +COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE +LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. + +14.6 The rights granted in this License Agreement may not be assigned or transferred by either you +or Google without the prior written approval of the other party. Neither you nor Google shall be +permitted to delegate their responsibilities or obligations under this License Agreement without the +prior written approval of the other party. + +14.7 This License Agreement, and your relationship with Google under this License Agreement, shall +be governed by the laws of the State of California without regard to its conflict of laws +provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located +within the county of Santa Clara, California to resolve any legal matter arising from this License +Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for +injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. + +April 10, 2009 + + +Animal Sniffer: + +The MIT License + +Copyright (c) 2008 Kohsuke Kawaguchi and codehaus.org. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +JSR 305: + +Copyright (c) 2007-2009, JSR305 expert group +All rights reserved. + +http://www.opensource.org/licenses/bsd-license.php + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the JSR305 expert group nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +Protobuf Nano: + +Copyright 2008, Google Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + + +Checker Framework Annotations: + +A few parts of the Checker Framework have more permissive licenses. + + * The annotations are licensed under the MIT License. (The text of this + license appears below.) More specifically, all the parts of the Checker + Framework that you might want to include with your own program use the + MIT License. This is the checker-qual.jar file and all the files that + appear in it: every file in a qual/ directory, plus NullnessUtils.java + and RegexUtil.java. In addition, the cleanroom implementations of + third-party annotations, which the Checker Framework recognizes as + aliases for its own annotations, are licensed under the MIT License. + +=========================================================================== + +MIT License: + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +=========================================================================== + + +Glide: + +Covers library/ + +Copyright 2014 Google, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are +permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY GOOGLE, INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE, INC. OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those of the +authors and should not be interpreted as representing official policies, either expressed +or implied, of Google, Inc. + +-------------------------------------------------------------------------- +Covers third_party/gif_decoder + +Copyright (c) 2013 Xcellent Creations, Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------------------------------------------------------------------- +Covers third_party/disklrucache + +Copyright 2012 Jake Wharton +Copyright 2011 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. +-------------------------------------------------------------------------- +Covers third_party/gif_encoder/AnimatedGifEncoder.java and +third_party/gif_encoder/LZWEncoder.java: + +No copyright asserted on the source code of this class. May be used for any +purpose, however, refer to the Unisys LZW patent for restrictions on use of +the associated LZWEncoder class. Please forward any corrections to +kweiner@fmsware.com. + +----------------------------------------------------------------------------- +Covers third_party/gif_encoder/NeuQuant.java + +Copyright (c) 1994 Anthony Dekker + +NEUQUANT Neural-Net quantization algorithm by Anthony Dekker, 1994. See +"Kohonen neural networks for optimal colour quantization" in "Network: +Computation in Neural Systems" Vol. 5 (1994) pp 351-367. for a discussion of +the algorithm. + +Any party obtaining a copy of these files from the author, directly or +indirectly, is granted, free of charge, a full and unrestricted irrevocable, +world-wide, paid up, royalty-free, nonexclusive right and license to deal in +this software and documentation files (the "Software"), including without +limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons who +receive copies from any such party to do so, with the only requirement being +that this copyright notice remain intact. + + +carrierservices: These components com.google.android.rcs.core, @@ -10420,7 +11251,32 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -libphonenumber: +jibercsclient: + +These components + com.google.android.rcs.core, + com.google.android.rcs.core.utils.CaseInsensitiveMap, + com.google.android.rcs.core.utils.DateTime, + com.google.android.rcs.core.utils.InetAddresses, + com.google.android.rcs.core.network.ConnectivityMonitor, + com.google.android.rcs.client.PrivateDataStorage, + com.google.android.rcs.client.utils.FastXmlSerializer, + com.google.android.rcs.client.utils.XmlUtils, + com.google.android.rcs.client.utils.QueuedWork +are licensed under Apache v2. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + Apache License Version 2.0, January 2004 @@ -10599,6 +11455,40 @@ libphonenumber: END OF TERMS AND CONDITIONS +=============================================================================== + +These components + com.google.android.rcs.core.utils.FastBase64, + com.google.android.rcs.core.utils.LibraryLoaderHelper +are licensed under BSD. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + mime4j: @@ -10963,1044 +11853,4 @@ mime4j: The End - - -shortcutbadger: - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - -Android SDK: - -ANDROID SOFTWARE DEVELOPMENT KIT - -Terms and Conditions - -This is the Android Software Development Kit License Agreement. - -1. Introduction - -1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and -specifically including the Android system files, packaged APIs, and Google APIs add-ons) is -licensed to you subject to the terms of this License Agreement. This License Agreement forms a -legally binding contract between you and Google in relation to your use of the SDK. - -1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 -Amphitheatre Parkway, Mountain View, CA 94043, United States. - -2. Accepting this License Agreement - -2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the -SDK if you do not accept this License Agreement. - -2.2 You can accept this License Agreement by: - -(A) clicking to accept or agree to this License Agreement, where this option is made available to -you; or - -(B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of -the Licensing Agreement from that point onwards. - -2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person barred -from receiving the SDK under the laws of the United States or other countries including the country -in which you are resident or from which you use the SDK. - -2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other -entity, you represent and warrant that you have full legal authority to bind your employer or such -entity to this License Agreement. If you do not have the requisite authority, you may not accept -the Licensing Agreement or use the SDK on behalf of your employer or other entity. - -3. SDK License from Google - -3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, -royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop -applications to run on the Android platform. - -3.2 You agree that Google or third parties own all legal right, title and interest in and to the -SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property -Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, -and any and all other proprietary rights. Google reserves all rights not expressly granted to you. - -3.3 Except to the extent required by applicable third party licenses, you may not copy (except for -backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create -derivative works of the SDK or any part of the SDK. Except to the extent required by applicable -third party licenses, you may not load any part of the SDK onto a mobile handset or any other -hardware device except a personal computer, combine any part of the SDK with other software, or -distribute any software or device incorporating a part of the SDK. - -3.4 Use, reproduction and distribution of components of the SDK licensed under an open source -software license are governed solely by the terms of that open source software license and not -this License Agreement. - -3.5 You agree that the form and nature of the SDK that Google provides may change without prior -notice to you and that future versions of the SDK may be incompatible with applications developed -on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) -providing the SDK (or any features within the SDK) to you or to users generally at Google's sole -discretion, without prior notice to you. - -3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names, -trademarks, service marks, logos, domain names, or other distinctive brand features. - -3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including -copyright and trademark notices) that may be affixed to or contained within the SDK. - -4. Use of the SDK by You - -4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under -this License Agreement in or to any software applications that you develop using the SDK, including -any intellectual property rights that subsist in those applications. - -4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this -License Agreement and (b) any applicable law, regulation or generally accepted practices or -guidelines in the relevant jurisdictions (including any laws regarding the export of data or -software to and from the United States or other relevant countries). - -4.3 You agree that if you use the SDK to develop applications for general public users, you will -protect the privacy and legal rights of those users. If the users provide you with user names, -passwords, or other login information or personal information, your must make the users aware that -the information will be available to your application, and you must provide legally adequate privacy -notice and protection for those users. If your application stores personal or sensitive information -provided by users, it must do so securely. If the user provides your application with Google Account -information, your application may only use that information to access the user's Google Account -when, and for the limited purposes for which, the user has given you permission to do so. - -4.4 You agree that you will not engage in any activity with the SDK, including the development or -distribution of an application, that interferes with, disrupts, damages, or accesses in an -unauthorized manner the servers, networks, or other properties or services of any third party -including, but not limited to, Google or any mobile communications carrier. - -4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or -to any third party for) any data, content, or resources that you create, transmit or display through -the Android platform and/or applications for the Android platform, and for the consequences of your -actions (including any loss or damage which Google may suffer) by doing so. - -4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or -to any third party for) any breach of your obligations under this License Agreement, any applicable -third party contract or Terms of Service, or any applicable law or regulation, and for the -consequences (including any loss or damage which Google or any third party may suffer) of any such -breach. - -5. Your Developer Credentials - -5.1 You agree that you are responsible for maintaining the confidentiality of any developer -credentials that may be issued to you by Google or which you may choose yourself and that you will -be solely responsible for all applications that are developed under your developer credentials. - -6. Privacy and Information - -6.1 In order to continually innovate and improve the SDK, Google may collect certain usage -statistics from the software including but not limited to a unique identifier, associated IP -address, version number of the software, and information on which tools and/or services in the SDK -are being used and how they are being used. Before any of this information is collected, the SDK -will notify you and seek your consent. If you withhold consent, the information will not be -collected. - -6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in -accordance with Google's Privacy Policy. - -7. Third Party Applications for the Android Platform - -7.1 If you use the SDK to run applications developed by a third party or that access data, content -or resources provided by a third party, you agree that Google is not responsible for those -applications, data, content, or resources. You understand that all data, content or resources which -you may access through such third party applications are the sole responsibility of the person from -which they originated and that Google is not liable for any loss or damage that you may experience -as a result of the use or access of any of those third party applications, data, content, or -resources. - -7.2 You should be aware the data, content, and resources presented to you through such a third party -application may be protected by intellectual property rights which are owned by the providers (or by -other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute -or create derivative works based on these data, content, or resources (either in whole or in part) -unless you have been specifically given permission to do so by the relevant owners. - -7.3 You acknowledge that your use of such third party applications, data, content, or resources may -be subject to separate terms between you and the relevant third party. In that case, this License -Agreement does not affect your legal relationship with these third parties. - -8. Using Android APIs - -8.1 Google Data APIs - -8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be -protected by intellectual property rights which are owned by Google or those parties that provide -the data (or by other persons or companies on their behalf). Your use of any such API may be subject -to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create -derivative works based on this data (either in whole or in part) unless allowed by the relevant -Terms of Service. - -8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you -shall retrieve data only with the user's explicit consent and only when, and for the limited -purposes for which, the user has given you permission to do so. - -9. Terminating this License Agreement - -9.1 This License Agreement will continue to apply until terminated by either you or Google as set -out below. - -9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK -and any relevant developer credentials. - -9.3 Google may at any time, terminate this License Agreement with you if: - -(A) you have breached any provision of this License Agreement; or - -(B) Google is required to do so by law; or - -(C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated -its relationship with Google or ceased to offer certain parts of the SDK to you; or - -(D) Google decides to no longer providing the SDK or certain parts of the SDK to users in the -country in which you are resident or from which you use the service, or the provision of the SDK or -certain SDK services to you by Google is, in Google's sole discretion, no longer commercially -viable. - -9.4 When this License Agreement comes to an end, all of the legal rights, obligations and -liabilities that you and Google have benefited from, been subject to (or which have accrued over -time whilst this License Agreement has been in force) or which are expressed to continue -indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall -continue to apply to such rights, obligations and liabilities indefinitely. - -10. DISCLAIMER OF WARRANTIES - -10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE -SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. - -10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE -SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR -COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. - -10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - -11. LIMITATION OF LIABILITY - -11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS -LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY -LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN -AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. - -12. Indemnification - -12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless -Google, its affiliates and their respective directors, officers, employees and agents from and -against any and all claims, actions, suits or proceedings, as well as any and all losses, -liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or -accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any -copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any -person or defames any person or violates their rights of publicity or privacy, and (c) any -non-compliance by you with this License Agreement. - -13. Changes to the License Agreement - -13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. -When these changes are made, Google will make a new version of the License Agreement available on -the website where the SDK is made available. - -14. General Legal Terms - -14.1 This License Agreement constitute the whole legal agreement between you and Google and govern -your use of the SDK (excluding any services which Google may provide to you under a separate written -agreement), and completely replace any prior agreements between you and Google in relation to the -SDK. - -14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is -contained in this License Agreement (or which Google has the benefit of under any applicable law), -this will not be taken to be a formal waiver of Google's rights and that those rights or remedies -will still be available to Google. - -14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision -of this License Agreement is invalid, then that provision will be removed from this License -Agreement without affecting the rest of this License Agreement. The remaining provisions of this -License Agreement will continue to be valid and enforceable. - -14.4 You acknowledge and agree that each member of the group of companies of which Google is the -parent shall be third party beneficiaries to this License Agreement and that such other companies -shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that -confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall -be third party beneficiaries to this License Agreement. - -14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST -COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE -LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. - -14.6 The rights granted in this License Agreement may not be assigned or transferred by either you -or Google without the prior written approval of the other party. Neither you nor Google shall be -permitted to delegate their responsibilities or obligations under this License Agreement without the -prior written approval of the other party. - -14.7 This License Agreement, and your relationship with Google under this License Agreement, shall -be governed by the laws of the State of California without regard to its conflict of laws -provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located -within the county of Santa Clara, California to resolve any legal matter arising from this License -Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for -injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. - -April 10, 2009 - - -Checker Framework: - -The Checker Framework is licensed under the GNU General Public License, -version 2 (GPL2), with the classpath exception. The text of this license -appears below. This is the same license used for OpenJDK. - -A few parts of the Checker Framework have more permissive licenses. - - * The annotations are licensed under the MIT License. (The text of this - license appears below.) More specifically, all the parts of the Checker - Framework that you might want to include with your own program use the - MIT License. This is the checker-qual.jar file and all the files that - appear in it: every file in a qual/ directory, plus NullnessUtils.java - and RegexUtil.java. In addition, the cleanroom implementations of - third-party annotations, which the Checker Framework recognizes as - aliases for its own annotations, are licensed under the MIT License. - - * The Maven plugin is dual-licensed (you may use whichever you prefer) - under GPL2 and the Apache License, version 2.0 (Apache2). The text of - Apache2 appears in file maven-plugin/LICENSE.txt. Maven itself uses - Apache2. - - * The Eclipse plugin is dual-licensed (you may use whichever you prefer) - under GPL2 and the Eclipse Public License Version 1.0 (EPL). EPL - appears http://www.eclipse.org/org/documents/epl-v10.php. Eclipse - itself uses EPL. - -Some external libraries that are included with the Checker Framework have -different licenses. - - * javaparser is licensed under the LGPL. (The javaparser source code - contains a file with the text of the GPL, but it is not clear why, since - javaparser does not use the GPL.) See file javaparser/COPYING.LESSER - and the source code of all its files. - - * junit is licensed under the Common Public License v1.0 (see - http://www.junit.org/license), with parts (Hamcrest) licensed under the - BSD License (see LICENSE.txt in checkers/tests/junit.jar ). - - * plume-lib is licensed under the MIT License. - -The Checker Framework includes annotations for several libraries, in -directory checkers/jdk/. The only one that uses a different license than -the GPL is Google Guava, which uses Apache2. - -=========================================================================== - -The GNU General Public License (GPL) - -Version 2, June 1991 - -Copyright (C) 1989, 1991 Free Software Foundation, Inc. -59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Everyone is permitted to copy and distribute verbatim copies of this license -document, but changing it is not allowed. - -Preamble - -The licenses for most software are designed to take away your freedom to share -and change it. By contrast, the GNU General Public License is intended to -guarantee your freedom to share and change free software--to make sure the -software is free for all its users. This General Public License applies to -most of the Free Software Foundation's software and to any other program whose -authors commit to using it. (Some other Free Software Foundation software is -covered by the GNU Library General Public License instead.) You can apply it to -your programs, too. - -When we speak of free software, we are referring to freedom, not price. Our -General Public Licenses are designed to make sure that you have the freedom to -distribute copies of free software (and charge for this service if you wish), -that you receive source code or can get it if you want it, that you can change -the software or use pieces of it in new free programs; and that you know you -can do these things. - -To protect your rights, we need to make restrictions that forbid anyone to deny -you these rights or to ask you to surrender the rights. These restrictions -translate to certain responsibilities for you if you distribute copies of the -software, or if you modify it. - -For example, if you distribute copies of such a program, whether gratis or for -a fee, you must give the recipients all the rights that you have. You must -make sure that they, too, receive or can get the source code. And you must -show them these terms so they know their rights. - -We protect your rights with two steps: (1) copyright the software, and (2) -offer you this license which gives you legal permission to copy, distribute -and/or modify the software. - -Also, for each author's protection and ours, we want to make certain that -everyone understands that there is no warranty for this free software. If the -software is modified by someone else and passed on, we want its recipients to -know that what they have is not the original, so that any problems introduced -by others will not reflect on the original authors' reputations. - -Finally, any free program is threatened constantly by software patents. We -wish to avoid the danger that redistributors of a free program will -individually obtain patent licenses, in effect making the program proprietary. -To prevent this, we have made it clear that any patent must be licensed for -everyone's free use or not licensed at all. - -The precise terms and conditions for copying, distribution and modification -follow. - -TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - -0. This License applies to any program or other work which contains a notice -placed by the copyright holder saying it may be distributed under the terms of -this General Public License. The "Program", below, refers to any such program -or work, and a "work based on the Program" means either the Program or any -derivative work under copyright law: that is to say, a work containing the -Program or a portion of it, either verbatim or with modifications and/or -translated into another language. (Hereinafter, translation is included -without limitation in the term "modification".) Each licensee is addressed as -"you". - -Activities other than copying, distribution and modification are not covered by -this License; they are outside its scope. The act of running the Program is -not restricted, and the output from the Program is covered only if its contents -constitute a work based on the Program (independent of having been made by -running the Program). Whether that is true depends on what the Program does. - -1. You may copy and distribute verbatim copies of the Program's source code as -you receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice and -disclaimer of warranty; keep intact all the notices that refer to this License -and to the absence of any warranty; and give any other recipients of the -Program a copy of this License along with the Program. - -You may charge a fee for the physical act of transferring a copy, and you may -at your option offer warranty protection in exchange for a fee. - -2. You may modify your copy or copies of the Program or any portion of it, thus -forming a work based on the Program, and copy and distribute such modifications -or work under the terms of Section 1 above, provided that you also meet all of -these conditions: - - a) You must cause the modified files to carry prominent notices stating - that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in whole or - in part contains or is derived from the Program or any part thereof, to be - licensed as a whole at no charge to all third parties under the terms of - this License. - - c) If the modified program normally reads commands interactively when run, - you must cause it, when started running for such interactive use in the - most ordinary way, to print or display an announcement including an - appropriate copyright notice and a notice that there is no warranty (or - else, saying that you provide a warranty) and that users may redistribute - the program under these conditions, and telling the user how to view a copy - of this License. (Exception: if the Program itself is interactive but does - not normally print such an announcement, your work based on the Program is - not required to print an announcement.) - -These requirements apply to the modified work as a whole. If identifiable -sections of that work are not derived from the Program, and can be reasonably -considered independent and separate works in themselves, then this License, and -its terms, do not apply to those sections when you distribute them as separate -works. But when you distribute the same sections as part of a whole which is a -work based on the Program, the distribution of the whole must be on the terms -of this License, whose permissions for other licensees extend to the entire -whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest your -rights to work written entirely by you; rather, the intent is to exercise the -right to control the distribution of derivative or collective works based on -the Program. - -In addition, mere aggregation of another work not based on the Program with the -Program (or with a work based on the Program) on a volume of a storage or -distribution medium does not bring the other work under the scope of this -License. - -3. You may copy and distribute the Program (or a work based on it, under -Section 2) in object code or executable form under the terms of Sections 1 and -2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable source - code, which must be distributed under the terms of Sections 1 and 2 above - on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three years, to - give any third party, for a charge no more than your cost of physically - performing source distribution, a complete machine-readable copy of the - corresponding source code, to be distributed under the terms of Sections 1 - and 2 above on a medium customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer to - distribute corresponding source code. (This alternative is allowed only - for noncommercial distribution and only if you received the program in - object code or executable form with such an offer, in accord with - Subsection b above.) - -The source code for a work means the preferred form of the work for making -modifications to it. For an executable work, complete source code means all -the source code for all modules it contains, plus any associated interface -definition files, plus the scripts used to control compilation and installation -of the executable. However, as a special exception, the source code -distributed need not include anything that is normally distributed (in either -source or binary form) with the major components (compiler, kernel, and so on) -of the operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the source -code from the same place counts as distribution of the source code, even though -third parties are not compelled to copy the source along with the object code. - -4. You may not copy, modify, sublicense, or distribute the Program except as -expressly provided under this License. Any attempt otherwise to copy, modify, -sublicense or distribute the Program is void, and will automatically terminate -your rights under this License. However, parties who have received copies, or -rights, from you under this License will not have their licenses terminated so -long as such parties remain in full compliance. - -5. You are not required to accept this License, since you have not signed it. -However, nothing else grants you permission to modify or distribute the Program -or its derivative works. These actions are prohibited by law if you do not -accept this License. Therefore, by modifying or distributing the Program (or -any work based on the Program), you indicate your acceptance of this License to -do so, and all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - -6. Each time you redistribute the Program (or any work based on the Program), -the recipient automatically receives a license from the original licensor to -copy, distribute or modify the Program subject to these terms and conditions. -You may not impose any further restrictions on the recipients' exercise of the -rights granted herein. You are not responsible for enforcing compliance by -third parties to this License. - -7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), conditions -are imposed on you (whether by court order, agreement or otherwise) that -contradict the conditions of this License, they do not excuse you from the -conditions of this License. If you cannot distribute so as to satisfy -simultaneously your obligations under this License and any other pertinent -obligations, then as a consequence you may not distribute the Program at all. -For example, if a patent license would not permit royalty-free redistribution -of the Program by all those who receive copies directly or indirectly through -you, then the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply and -the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any patents or -other property right claims or to contest validity of any such claims; this -section has the sole purpose of protecting the integrity of the free software -distribution system, which is implemented by public license practices. Many -people have made generous contributions to the wide range of software -distributed through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing to -distribute software through any other system and a licensee cannot impose that -choice. - -This section is intended to make thoroughly clear what is believed to be a -consequence of the rest of this License. - -8. If the distribution and/or use of the Program is restricted in certain -countries either by patents or by copyrighted interfaces, the original -copyright holder who places the Program under this License may add an explicit -geographical distribution limitation excluding those countries, so that -distribution is permitted only in or among countries not thus excluded. In -such case, this License incorporates the limitation as if written in the body -of this License. - -9. The Free Software Foundation may publish revised and/or new versions of the -General Public License from time to time. Such new versions will be similar in -spirit to the present version, but may differ in detail to address new problems -or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any later -version", you have the option of following the terms and conditions either of -that version or of any later version published by the Free Software Foundation. -If the Program does not specify a version number of this License, you may -choose any version ever published by the Free Software Foundation. - -10. If you wish to incorporate parts of the Program into other free programs -whose distribution conditions are different, write to the author to ask for -permission. For software which is copyrighted by the Free Software Foundation, -write to the Free Software Foundation; we sometimes make exceptions for this. -Our decision will be guided by the two goals of preserving the free status of -all derivatives of our free software and of promoting the sharing and reuse of -software generally. - -NO WARRANTY - -11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR -THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE -STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE -PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND -PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, -YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL -ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE -PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR -INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA -BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER -OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -END OF TERMS AND CONDITIONS - -How to Apply These Terms to Your New Programs - -If you develop a new program, and you want it to be of the greatest possible -use to the public, the best way to achieve this is to make it free software -which everyone can redistribute and change under these terms. - -To do so, attach the following notices to the program. It is safest to attach -them to the start of each source file to most effectively convey the exclusion -of warranty; and each file should have at least the "copyright" line and a -pointer to where the full notice is found. - - One line to give the program's name and a brief idea of what it does. - - Copyright (C) <year> <name of author> - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., 59 - Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this when it -starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author Gnomovision comes - with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free - software, and you are welcome to redistribute it under certain conditions; - type 'show c' for details. - -The hypothetical commands 'show w' and 'show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may be -called something other than 'show w' and 'show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your school, -if any, to sign a "copyright disclaimer" for the program, if necessary. Here -is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - 'Gnomovision' (which makes passes at compilers) written by James Hacker. - - signature of Ty Coon, 1 April 1989 - - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General Public -License instead of this License. - - -"CLASSPATH" EXCEPTION TO THE GPL - -Certain source files distributed by Oracle America and/or its affiliates are -subject to the following clarification and special exception to the GPL, but -only where Oracle has expressly included in the particular source file's header -the words "Oracle designates this particular file as subject to the "Classpath" -exception as provided by Oracle in the LICENSE file that accompanied this code." - - Linking this library statically or dynamically with other modules is making - a combined work based on this library. Thus, the terms and conditions of - the GNU General Public License cover the whole combination. - - As a special exception, the copyright holders of this library give you - permission to link this library with independent modules to produce an - executable, regardless of the license terms of these independent modules, - and to copy and distribute the resulting executable under terms of your - choice, provided that you also meet, for each linked independent module, - the terms and conditions of the license of that module. An independent - module is a module which is not derived from or based on this library. If - you modify this library, you may extend this exception to your version of - the library, but you are not obligated to do so. If you do not wish to do - so, delete this exception statement from your version. - -=========================================================================== - -MIT License: - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -=========================================================================== - - -Animal Sniffer: - -The MIT License - -Copyright (c) 2008 Kohsuke Kawaguchi and codehaus.org. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - - -Glide: - -Covers library/ - -Copyright 2014 Google, Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are -permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of - conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list - of conditions and the following disclaimer in the documentation and/or other materials - provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY GOOGLE, INC. ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE, INC. OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those of the -authors and should not be interpreted as representing official policies, either expressed -or implied, of Google, Inc. - --------------------------------------------------------------------------- -Covers third_party/gif_decoder - -Copyright (c) 2013 Xcellent Creations, Inc. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - --------------------------------------------------------------------------- -Covers third_party/disklrucache - -Copyright 2012 Jake Wharton -Copyright 2011 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. --------------------------------------------------------------------------- -Covers third_party/gif_encoder/AnimatedGifEncoder.java and -third_party/gif_encoder/LZWEncoder.java: - -No copyright asserted on the source code of this class. May be used for any -purpose, however, refer to the Unisys LZW patent for restrictions on use of -the associated LZWEncoder class. Please forward any corrections to -kweiner@fmsware.com. - ------------------------------------------------------------------------------ -Covers third_party/gif_encoder/NeuQuant.java - -Copyright (c) 1994 Anthony Dekker - -NEUQUANT Neural-Net quantization algorithm by Anthony Dekker, 1994. See -"Kohonen neural networks for optimal colour quantization" in "Network: -Computation in Neural Systems" Vol. 5 (1994) pp 351-367. for a discussion of -the algorithm. - -Any party obtaining a copy of these files from the author, directly or -indirectly, is granted, free of charge, a full and unrestricted irrevocable, -world-wide, paid up, royalty-free, nonexclusive right and license to deal in -this software and documentation files (the "Software"), including without -limitation the rights to use, copy, modify, merge, publish, distribute, -sublicense, and/or sell copies of the Software, and to permit persons who -receive copies from any such party to do so, with the only requirement being -that this copyright notice remain intact. - - -JSR 305: - -Copyright (c) 2007-2009, JSR305 expert group -All rights reserved. - -http://www.opensource.org/licenses/bsd-license.php - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the JSR305 expert group nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. +
\ No newline at end of file diff --git a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java index 30b8464ed..f9f8e0e5e 100644 --- a/java/com/android/dialer/app/list/PhoneFavoriteTileView.java +++ b/java/com/android/dialer/app/list/PhoneFavoriteTileView.java @@ -18,6 +18,8 @@ package com.android.dialer.app.list; import android.content.ClipData; import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Point; import android.net.Uri; import android.provider.ContactsContract.PinnedPositions; import android.text.TextUtils; @@ -77,15 +79,12 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { shadowOverlay = findViewById(R.id.shadow_overlay); setOnLongClickListener( - new OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - final PhoneFavoriteTileView view = (PhoneFavoriteTileView) v; - // NOTE The drag shadow is handled in the ListView. - view.startDrag( - EMPTY_CLIP_DATA, new View.DragShadowBuilder(), DRAG_PHONE_FAVORITE_TILE, 0); - return true; - } + (v) -> { + final PhoneFavoriteTileView view = (PhoneFavoriteTileView) v; + // NOTE The drag shadow is handled in the ListView. + view.startDragAndDrop( + EMPTY_CLIP_DATA, new EmptyDragShadowBuilder(), DRAG_PHONE_FAVORITE_TILE, 0); + return true; }); } @@ -207,4 +206,23 @@ public abstract class PhoneFavoriteTileView extends ContactTileView { loader.registerListener(0, (loader1, contact) -> loader.reset()); loader.startLoading(); } + + /** + * A {@link View.DragShadowBuilder} that doesn't draw anything. An object of this class should be + * passed to {@link View#startDragAndDrop} to prevent the framework from drawing a drag shadow. + */ + public static class EmptyDragShadowBuilder extends View.DragShadowBuilder { + + @Override + public void onProvideShadowMetrics(Point size, Point touch) { + // A workaround for P+ not accepting non-positive drag shadow sizes. + size.set(1, 1); + touch.set(0, 0); + } + + @Override + public void onDrawShadow(Canvas canvas) { + // Don't draw anything + } + } } diff --git a/java/com/android/dialer/app/settings/DialerSettingsActivity.java b/java/com/android/dialer/app/settings/DialerSettingsActivity.java index 9cd01b64b..d9bcd6ba5 100644 --- a/java/com/android/dialer/app/settings/DialerSettingsActivity.java +++ b/java/com/android/dialer/app/settings/DialerSettingsActivity.java @@ -116,9 +116,7 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity { (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); // "Call Settings" (full settings) is shown if the current user is primary user and there - // is only one SIM. Before N, "Calling accounts" setting is shown if the current user is - // primary user and there are multiple SIMs. In N+, "Calling accounts" is shown whenever - // "Call Settings" is not shown. + // is only one SIM. Otherwise, "Calling accounts" is shown. boolean isPrimaryUser = isPrimaryUser(); if (isPrimaryUser && TelephonyManagerCompat.getPhoneCount(telephonyManager) <= 1) { Header callSettingsHeader = new Header(); @@ -128,7 +126,7 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity { callSettingsHeader.titleRes = R.string.call_settings_label; callSettingsHeader.intent = callSettingsIntent; target.add(callSettingsHeader); - } else if (isPrimaryUser) { + } else { Header phoneAccountSettingsHeader = new Header(); Intent phoneAccountSettingsIntent = new Intent(TelecomManager.ACTION_CHANGE_PHONE_ACCOUNTS); phoneAccountSettingsIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); diff --git a/java/com/android/dialer/calllog/database/Coalescer.java b/java/com/android/dialer/calllog/database/Coalescer.java index 903b7e26e..2ad9f9a97 100644 --- a/java/com/android/dialer/calllog/database/Coalescer.java +++ b/java/com/android/dialer/calllog/database/Coalescer.java @@ -15,11 +15,9 @@ */ package com.android.dialer.calllog.database; -import android.content.ContentValues; import android.database.Cursor; import android.provider.CallLog.Calls; import android.support.annotation.NonNull; -import android.support.annotation.VisibleForTesting; import android.support.annotation.WorkerThread; import android.telecom.PhoneAccountHandle; import android.text.TextUtils; @@ -27,9 +25,6 @@ import com.android.dialer.CoalescedIds; import com.android.dialer.DialerPhoneNumber; import com.android.dialer.NumberAttributes; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog; -import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.CoalescedAnnotatedCallLog; -import com.android.dialer.calllog.datasources.CallLogDataSource; -import com.android.dialer.calllog.datasources.DataSources; import com.android.dialer.calllog.model.CoalescedRow; import com.android.dialer.common.Assert; import com.android.dialer.common.concurrent.Annotations.BackgroundExecutor; @@ -38,35 +33,24 @@ import com.android.dialer.metrics.FutureTimer; import com.android.dialer.metrics.Metrics; import com.android.dialer.phonenumberproto.DialerPhoneNumberUtil; import com.android.dialer.telecom.TelecomUtil; -import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.protobuf.InvalidProtocolBufferException; -import java.util.ArrayList; -import java.util.List; import java.util.Objects; import javax.inject.Inject; -/** - * Coalesces rows in {@link AnnotatedCallLog} by combining adjacent rows. - * - * <p>Applies the logic that determines which adjacent rows should be coalesced, and then delegates - * to each data source to determine how individual columns should be aggregated. - */ +/** Combines adjacent rows in {@link AnnotatedCallLog}. */ public class Coalescer { - private final DataSources dataSources; private final FutureTimer futureTimer; private final ListeningExecutorService backgroundExecutorService; @Inject Coalescer( @BackgroundExecutor ListeningExecutorService backgroundExecutorService, - DataSources dataSources, FutureTimer futureTimer) { this.backgroundExecutorService = backgroundExecutorService; - this.dataSources = dataSources; this.futureTimer = futureTimer; } @@ -108,256 +92,249 @@ public class Coalescer { return ImmutableList.of(); } - // Note: This method relies on rowsShouldBeCombined to determine which rows should be combined, - // but delegates to data sources to actually aggregate column values. - - DialerPhoneNumberUtil dialerPhoneNumberUtil = new DialerPhoneNumberUtil(); - ImmutableList.Builder<CoalescedRow> coalescedRowListBuilder = new ImmutableList.Builder<>(); - int coalescedRowId = 0; + RowCombiner rowCombiner = new RowCombiner(allAnnotatedCallLogRowsSortedByTimestampDesc); + rowCombiner.startNewGroup(); - // TODO(a bug): Avoid using ContentValues as it doesn't make sense here. - List<ContentValues> currentRowGroup = new ArrayList<>(); + long coalescedRowId = 0; + do { + boolean isRowMerged = rowCombiner.mergeRow(allAnnotatedCallLogRowsSortedByTimestampDesc); - ContentValues firstRow = cursorRowToContentValues(allAnnotatedCallLogRowsSortedByTimestampDesc); - currentRowGroup.add(firstRow); + if (isRowMerged) { + allAnnotatedCallLogRowsSortedByTimestampDesc.moveToNext(); + } - while (!currentRowGroup.isEmpty()) { - // Group consecutive rows - ContentValues firstRowInGroup = currentRowGroup.get(0); - ContentValues currentRow = null; - while (allAnnotatedCallLogRowsSortedByTimestampDesc.moveToNext()) { - currentRow = cursorRowToContentValues(allAnnotatedCallLogRowsSortedByTimestampDesc); + if (!isRowMerged || allAnnotatedCallLogRowsSortedByTimestampDesc.isAfterLast()) { + coalescedRowListBuilder.add( + rowCombiner.combine().toBuilder().setId(coalescedRowId++).build()); + rowCombiner.startNewGroup(); + } + } while (!allAnnotatedCallLogRowsSortedByTimestampDesc.isAfterLast()); - if (!rowsShouldBeCombined(dialerPhoneNumberUtil, firstRowInGroup, currentRow)) { - break; - } + return coalescedRowListBuilder.build(); + } - currentRowGroup.add(currentRow); - } + /** Combines rows from {@link AnnotatedCallLog} into a {@link CoalescedRow}. */ + private static final class RowCombiner { + private final CoalescedRow.Builder coalescedRowBuilder = CoalescedRow.newBuilder(); + private final CoalescedIds.Builder coalescedIdsBuilder = CoalescedIds.newBuilder(); + + // Indexes for columns in AnnotatedCallLog + private final int idColumn; + private final int timestampColumn; + private final int numberColumn; + private final int formattedNumberColumn; + private final int numberPresentationColumn; + private final int isReadColumn; + private final int isNewColumn; + private final int geocodedLocationColumn; + private final int phoneAccountComponentNameColumn; + private final int phoneAccountIdColumn; + private final int featuresColumn; + private final int numberAttributesColumn; + private final int isVoicemailCallColumn; + private final int voicemailCallTagColumn; + private final int callTypeColumn; + + // DialerPhoneNumberUtil will be created lazily as its instantiation is expensive. + private DialerPhoneNumberUtil dialerPhoneNumberUtil = null; + + RowCombiner(Cursor annotatedCallLogRow) { + idColumn = annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog._ID); + timestampColumn = annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.TIMESTAMP); + numberColumn = annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.NUMBER); + formattedNumberColumn = + annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.FORMATTED_NUMBER); + numberPresentationColumn = + annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.NUMBER_PRESENTATION); + isReadColumn = annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.IS_READ); + isNewColumn = annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.NEW); + geocodedLocationColumn = + annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.GEOCODED_LOCATION); + phoneAccountComponentNameColumn = + annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME); + phoneAccountIdColumn = + annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.PHONE_ACCOUNT_ID); + featuresColumn = annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.FEATURES); + numberAttributesColumn = + annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.NUMBER_ATTRIBUTES); + isVoicemailCallColumn = + annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.IS_VOICEMAIL_CALL); + voicemailCallTagColumn = + annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.VOICEMAIL_CALL_TAG); + callTypeColumn = annotatedCallLogRow.getColumnIndexOrThrow(AnnotatedCallLog.CALL_TYPE); + } - // Coalesce the group into a single row - ContentValues coalescedRow = coalesceRowsForAllDataSources(currentRowGroup); - coalescedRow.put(CoalescedAnnotatedCallLog._ID, coalescedRowId++); - coalescedRow.put( - CoalescedAnnotatedCallLog.COALESCED_IDS, getCoalescedIds(currentRowGroup).toByteArray()); - coalescedRowListBuilder.add(toCoalescedRowProto(coalescedRow)); + /** + * Prepares {@link RowCombiner} for building a new group of rows by clearing information on all + * previously merged rows. + */ + void startNewGroup() { + coalescedRowBuilder.clear(); + coalescedIdsBuilder.clear(); + } - // Clear the current group after the rows are coalesced. - currentRowGroup.clear(); + /** + * Merge the given {@link AnnotatedCallLog} row into the current group. + * + * @return true if the given row is merged. + */ + boolean mergeRow(Cursor annotatedCallLogRow) { + Assert.checkArgument(annotatedCallLogRow.getInt(callTypeColumn) != Calls.VOICEMAIL_TYPE); - // Add the first of the remaining rows to the current group. - if (!allAnnotatedCallLogRowsSortedByTimestampDesc.isAfterLast()) { - currentRowGroup.add(currentRow); + if (!canMergeRow(annotatedCallLogRow)) { + return false; } - } - return coalescedRowListBuilder.build(); - } + // Set fields that don't use the most recent value. + // + // Currently there is only one such field: "features". + // If any call in a group includes a feature (like Wifi/HD), consider the group to have + // the feature. + coalescedRowBuilder.setFeatures( + coalescedRowBuilder.getFeatures() | annotatedCallLogRow.getInt(featuresColumn)); + + // Set fields that use the most recent value. + // Rows passed to Coalescer are already sorted in descending order of timestamp. If the + // coalesced ID list is not empty, it means RowCombiner has merged the most recent row in a + // group and there is no need to continue as we only set fields that use the most recent value + // from this point forward. + if (!coalescedIdsBuilder.getCoalescedIdList().isEmpty()) { + coalescedIdsBuilder.addCoalescedId(annotatedCallLogRow.getInt(idColumn)); + return true; + } - private static ContentValues cursorRowToContentValues(Cursor cursor) { - ContentValues values = new ContentValues(); - String[] columns = cursor.getColumnNames(); - int length = columns.length; - for (int i = 0; i < length; i++) { - if (cursor.getType(i) == Cursor.FIELD_TYPE_BLOB) { - values.put(columns[i], cursor.getBlob(i)); - } else { - values.put(columns[i], cursor.getString(i)); + coalescedRowBuilder + .setTimestamp(annotatedCallLogRow.getLong(timestampColumn)) + .setNumberPresentation(annotatedCallLogRow.getInt(numberPresentationColumn)) + .setIsRead(annotatedCallLogRow.getInt(isReadColumn) == 1) + .setIsNew(annotatedCallLogRow.getInt(isNewColumn) == 1) + .setIsVoicemailCall(annotatedCallLogRow.getInt(isVoicemailCallColumn) == 1) + .setCallType(annotatedCallLogRow.getInt(callTypeColumn)); + + // Two different DialerPhoneNumbers could be combined if they are different but considered + // to be a match by libphonenumber; in this case we arbitrarily select the most recent one. + try { + coalescedRowBuilder.setNumber( + DialerPhoneNumber.parseFrom(annotatedCallLogRow.getBlob(numberColumn))); + } catch (InvalidProtocolBufferException e) { + throw Assert.createAssertionFailException("Unable to parse DialerPhoneNumber bytes", e); } - } - return values; - } - /** - * @param row1 a row from {@link AnnotatedCallLog} - * @param row2 a row from {@link AnnotatedCallLog} - */ - private static boolean rowsShouldBeCombined( - DialerPhoneNumberUtil dialerPhoneNumberUtil, ContentValues row1, ContentValues row2) { - // Don't combine rows which don't use the same phone account. - PhoneAccountHandle phoneAccount1 = - TelecomUtil.composePhoneAccountHandle( - row1.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME), - row1.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_ID)); - PhoneAccountHandle phoneAccount2 = - TelecomUtil.composePhoneAccountHandle( - row2.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME), - row2.getAsString(AnnotatedCallLog.PHONE_ACCOUNT_ID)); - if (!Objects.equals(phoneAccount1, phoneAccount2)) { - return false; - } + String formattedNumber = annotatedCallLogRow.getString(formattedNumberColumn); + if (!TextUtils.isEmpty(formattedNumber)) { + coalescedRowBuilder.setFormattedNumber(formattedNumber); + } - if (!row1.getAsInteger(AnnotatedCallLog.NUMBER_PRESENTATION) - .equals(row2.getAsInteger(AnnotatedCallLog.NUMBER_PRESENTATION))) { - return false; - } + String geocodedLocation = annotatedCallLogRow.getString(geocodedLocationColumn); + if (!TextUtils.isEmpty(geocodedLocation)) { + coalescedRowBuilder.setGeocodedLocation(geocodedLocation); + } - if (!meetsCallFeatureCriteria(row1, row2)) { - return false; - } + String phoneAccountComponentName = + annotatedCallLogRow.getString(phoneAccountComponentNameColumn); + if (!TextUtils.isEmpty(phoneAccountComponentName)) { + coalescedRowBuilder.setPhoneAccountComponentName(phoneAccountComponentName); + } - DialerPhoneNumber number1; - DialerPhoneNumber number2; - try { - byte[] number1Bytes = row1.getAsByteArray(AnnotatedCallLog.NUMBER); - byte[] number2Bytes = row2.getAsByteArray(AnnotatedCallLog.NUMBER); + String phoneAccountId = annotatedCallLogRow.getString(phoneAccountIdColumn); + if (!TextUtils.isEmpty(phoneAccountId)) { + coalescedRowBuilder.setPhoneAccountId(phoneAccountId); + } - if (number1Bytes == null || number2Bytes == null) { - // Empty numbers should not be combined. - return false; + try { + coalescedRowBuilder.setNumberAttributes( + NumberAttributes.parseFrom(annotatedCallLogRow.getBlob(numberAttributesColumn))); + } catch (InvalidProtocolBufferException e) { + throw Assert.createAssertionFailException("Unable to parse NumberAttributes bytes", e); } - number1 = DialerPhoneNumber.parseFrom(number1Bytes); - number2 = DialerPhoneNumber.parseFrom(number2Bytes); - } catch (InvalidProtocolBufferException e) { - throw Assert.createAssertionFailException("error parsing DialerPhoneNumber proto", e); - } - return dialerPhoneNumberUtil.isMatch(number1, number2); - } + String voicemailCallTag = annotatedCallLogRow.getString(voicemailCallTagColumn); + if (!TextUtils.isEmpty(voicemailCallTag)) { + coalescedRowBuilder.setVoicemailCallTag(voicemailCallTag); + } - /** - * Returns true if column {@link AnnotatedCallLog#FEATURES} of the two given rows indicate that - * they can be coalesced. - */ - private static boolean meetsCallFeatureCriteria(ContentValues row1, ContentValues row2) { - int row1Features = row1.getAsInteger(AnnotatedCallLog.FEATURES); - int row2Features = row2.getAsInteger(AnnotatedCallLog.FEATURES); - - // A row with FEATURES_ASSISTED_DIALING should not be combined with one without it. - if ((row1Features & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING) - != (row2Features & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING)) { - return false; + coalescedIdsBuilder.addCoalescedId(annotatedCallLogRow.getInt(idColumn)); + return true; } - // A video call should not be combined with one that is not a video call. - if ((row1Features & Calls.FEATURES_VIDEO) != (row2Features & Calls.FEATURES_VIDEO)) { - return false; + /** Builds a {@link CoalescedRow} based on all rows merged into the current group. */ + CoalescedRow combine() { + return coalescedRowBuilder.setCoalescedIds(coalescedIdsBuilder.build()).build(); } - // A RTT call should not be combined with one that is not a RTT call. - if ((row1Features & Calls.FEATURES_RTT) != (row2Features & Calls.FEATURES_RTT)) { - return false; + /** + * Returns true if the given {@link AnnotatedCallLog} row can be merged into the current group. + */ + private boolean canMergeRow(Cursor annotatedCallLogRow) { + return coalescedIdsBuilder.getCoalescedIdList().isEmpty() + || (samePhoneAccount(annotatedCallLogRow) + && sameNumberPresentation(annotatedCallLogRow) + && meetsCallFeatureCriteria(annotatedCallLogRow) + && meetsDialerPhoneNumberCriteria(annotatedCallLogRow)); } - return true; - } - - /** - * Delegates to data sources to aggregate individual columns to create a new coalesced row. - * - * @param individualRows {@link AnnotatedCallLog} rows sorted by timestamp descending - * @return a {@link CoalescedAnnotatedCallLog} row - */ - private ContentValues coalesceRowsForAllDataSources(List<ContentValues> individualRows) { - ContentValues coalescedValues = new ContentValues(); - for (CallLogDataSource dataSource : dataSources.getDataSourcesIncludingSystemCallLog()) { - coalescedValues.putAll(dataSource.coalesce(individualRows)); + private boolean samePhoneAccount(Cursor annotatedCallLogRow) { + PhoneAccountHandle groupPhoneAccountHandle = + TelecomUtil.composePhoneAccountHandle( + coalescedRowBuilder.getPhoneAccountComponentName(), + coalescedRowBuilder.getPhoneAccountId()); + PhoneAccountHandle rowPhoneAccountHandle = + TelecomUtil.composePhoneAccountHandle( + annotatedCallLogRow.getString(phoneAccountComponentNameColumn), + annotatedCallLogRow.getString(phoneAccountIdColumn)); + + return Objects.equals(groupPhoneAccountHandle, rowPhoneAccountHandle); } - return coalescedValues; - } - /** - * Build a {@link CoalescedIds} proto that contains IDs of the rows in {@link AnnotatedCallLog} - * that are coalesced into one row in {@link CoalescedAnnotatedCallLog}. - * - * @param individualRows {@link AnnotatedCallLog} rows sorted by timestamp descending - * @return A {@link CoalescedIds} proto containing IDs of {@code individualRows}. - */ - private CoalescedIds getCoalescedIds(List<ContentValues> individualRows) { - CoalescedIds.Builder coalescedIds = CoalescedIds.newBuilder(); - - for (ContentValues row : individualRows) { - coalescedIds.addCoalescedId(Preconditions.checkNotNull(row.getAsLong(AnnotatedCallLog._ID))); + private boolean sameNumberPresentation(Cursor annotatedCallLogRow) { + return coalescedRowBuilder.getNumberPresentation() + == annotatedCallLogRow.getInt(numberPresentationColumn); } - return coalescedIds.build(); - } + private boolean meetsCallFeatureCriteria(Cursor annotatedCallLogRow) { + int groupFeatures = coalescedRowBuilder.getFeatures(); + int rowFeatures = annotatedCallLogRow.getInt(featuresColumn); - /** - * Creates a new {@link CoalescedRow} proto based on the provided {@link ContentValues}. - * - * <p>The provided {@link ContentValues} should be one for {@link CoalescedAnnotatedCallLog}. - */ - @VisibleForTesting - static CoalescedRow toCoalescedRowProto(ContentValues coalescedContentValues) { - DialerPhoneNumber number; - try { - number = - DialerPhoneNumber.parseFrom( - coalescedContentValues.getAsByteArray(CoalescedAnnotatedCallLog.NUMBER)); - } catch (InvalidProtocolBufferException e) { - throw new IllegalStateException("Couldn't parse DialerPhoneNumber bytes"); - } + // A row with FEATURES_ASSISTED_DIALING should not be combined with one without it. + if ((groupFeatures & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING) + != (rowFeatures & TelephonyManagerCompat.FEATURES_ASSISTED_DIALING)) { + return false; + } - CoalescedIds coalescedIds; - try { - coalescedIds = - CoalescedIds.parseFrom( - coalescedContentValues.getAsByteArray(CoalescedAnnotatedCallLog.COALESCED_IDS)); - } catch (InvalidProtocolBufferException e) { - throw new IllegalStateException("Couldn't parse CoalescedIds bytes"); - } + // A video call should not be combined with one that is not a video call. + if ((groupFeatures & Calls.FEATURES_VIDEO) != (rowFeatures & Calls.FEATURES_VIDEO)) { + return false; + } - NumberAttributes numberAttributes; - try { - numberAttributes = - NumberAttributes.parseFrom( - coalescedContentValues.getAsByteArray(CoalescedAnnotatedCallLog.NUMBER_ATTRIBUTES)); - } catch (InvalidProtocolBufferException e) { - throw new IllegalStateException("Couldn't parse NumberAttributes bytes"); - } + // A RTT call should not be combined with one that is not a RTT call. + if ((groupFeatures & Calls.FEATURES_RTT) != (rowFeatures & Calls.FEATURES_RTT)) { + return false; + } - CoalescedRow.Builder coalescedRowBuilder = - CoalescedRow.newBuilder() - .setId(coalescedContentValues.getAsLong(CoalescedAnnotatedCallLog._ID)) - .setTimestamp(coalescedContentValues.getAsLong(CoalescedAnnotatedCallLog.TIMESTAMP)) - .setNumber(number) - .setNumberPresentation( - coalescedContentValues.getAsInteger(CoalescedAnnotatedCallLog.NUMBER_PRESENTATION)) - .setIsRead(coalescedContentValues.getAsInteger(CoalescedAnnotatedCallLog.IS_READ) == 1) - .setIsNew(coalescedContentValues.getAsInteger(CoalescedAnnotatedCallLog.NEW) == 1) - .setFeatures(coalescedContentValues.getAsInteger(CoalescedAnnotatedCallLog.FEATURES)) - .setCallType(coalescedContentValues.getAsInteger(CoalescedAnnotatedCallLog.CALL_TYPE)) - .setNumberAttributes(numberAttributes) - .setIsVoicemailCall( - coalescedContentValues.getAsInteger(CoalescedAnnotatedCallLog.IS_VOICEMAIL_CALL) - == 1) - .setCoalescedIds(coalescedIds); - - String formattedNumber = - coalescedContentValues.getAsString(CoalescedAnnotatedCallLog.FORMATTED_NUMBER); - if (!TextUtils.isEmpty(formattedNumber)) { - coalescedRowBuilder.setFormattedNumber(formattedNumber); + return true; } - String geocodedLocation = - coalescedContentValues.getAsString(CoalescedAnnotatedCallLog.GEOCODED_LOCATION); - if (!TextUtils.isEmpty(geocodedLocation)) { - coalescedRowBuilder.setGeocodedLocation(geocodedLocation); - } + private boolean meetsDialerPhoneNumberCriteria(Cursor annotatedCallLogRow) { + DialerPhoneNumber groupPhoneNumber = coalescedRowBuilder.getNumber(); - String phoneAccountComponentName = - coalescedContentValues.getAsString(CoalescedAnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME); - if (!TextUtils.isEmpty(phoneAccountComponentName)) { - coalescedRowBuilder.setPhoneAccountComponentName( - coalescedContentValues.getAsString( - CoalescedAnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME)); - } + DialerPhoneNumber rowPhoneNumber; + try { + byte[] rowPhoneNumberBytes = annotatedCallLogRow.getBlob(numberColumn); + if (rowPhoneNumberBytes == null) { + return false; // Empty numbers should not be combined. + } + rowPhoneNumber = DialerPhoneNumber.parseFrom(rowPhoneNumberBytes); + } catch (InvalidProtocolBufferException e) { + throw Assert.createAssertionFailException("Unable to parse DialerPhoneNumber bytes", e); + } - String phoneAccountId = - coalescedContentValues.getAsString(CoalescedAnnotatedCallLog.PHONE_ACCOUNT_ID); - if (!TextUtils.isEmpty(phoneAccountId)) { - coalescedRowBuilder.setPhoneAccountId(phoneAccountId); - } + if (dialerPhoneNumberUtil == null) { + dialerPhoneNumberUtil = new DialerPhoneNumberUtil(); + } - String voicemailCallTag = - coalescedContentValues.getAsString(CoalescedAnnotatedCallLog.VOICEMAIL_CALL_TAG); - if (!TextUtils.isEmpty(voicemailCallTag)) { - coalescedRowBuilder.setVoicemailCallTag(voicemailCallTag); + return dialerPhoneNumberUtil.isMatch(groupPhoneNumber, rowPhoneNumber); } - - return coalescedRowBuilder.build(); } } diff --git a/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java b/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java index 5aa62c2d1..1fdf38ac7 100644 --- a/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java +++ b/java/com/android/dialer/calllog/database/contract/AnnotatedCallLogContract.java @@ -28,15 +28,29 @@ public class AnnotatedCallLogContract { public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY); - /** Columns shared by {@link AnnotatedCallLog} and {@link CoalescedAnnotatedCallLog}. */ - interface CommonColumns extends BaseColumns { + /** AnnotatedCallLog table. */ + public static final class AnnotatedCallLog implements BaseColumns { + + public static final String TABLE = "AnnotatedCallLog"; + public static final String DISTINCT_PHONE_NUMBERS = "DistinctPhoneNumbers"; + + /** The content URI for this table. */ + public static final Uri CONTENT_URI = + Uri.withAppendedPath(AnnotatedCallLogContract.CONTENT_URI, TABLE); + + /** Content URI for selecting the distinct phone numbers from the AnnotatedCallLog. */ + public static final Uri DISTINCT_NUMBERS_CONTENT_URI = + Uri.withAppendedPath(AnnotatedCallLogContract.CONTENT_URI, DISTINCT_PHONE_NUMBERS); + + /** The MIME type of a {@link android.content.ContentProvider#getType(Uri)} single entry. */ + public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/annotated_call_log"; /** * Timestamp of the entry, in milliseconds. * * <p>Type: INTEGER (long) */ - String TIMESTAMP = "timestamp"; + public static final String TIMESTAMP = "timestamp"; /** * The phone number called or number the call came from, encoded as a {@link @@ -45,7 +59,7 @@ public class AnnotatedCallLogContract { * * <p>Type: BLOB */ - String NUMBER = "number"; + public static final String NUMBER = "number"; /** * The number formatted as it should be displayed to the user. Note that it may not always be @@ -53,56 +67,56 @@ public class AnnotatedCallLogContract { * * <p>Type: TEXT */ - String FORMATTED_NUMBER = "formatted_number"; + public static final String FORMATTED_NUMBER = "formatted_number"; /** * See {@link android.provider.CallLog.Calls#NUMBER_PRESENTATION}. * * <p>Type: INTEGER (int) */ - String NUMBER_PRESENTATION = "presentation"; + public static final String NUMBER_PRESENTATION = "presentation"; /** * See {@link android.provider.CallLog.Calls#IS_READ}. * * <p>TYPE: INTEGER (boolean) */ - String IS_READ = "is_read"; + public static final String IS_READ = "is_read"; /** * See {@link android.provider.CallLog.Calls#NEW}. * * <p>Type: INTEGER (boolean) */ - String NEW = "new"; + public static final String NEW = "new"; /** * See {@link android.provider.CallLog.Calls#GEOCODED_LOCATION}. * * <p>TYPE: TEXT */ - String GEOCODED_LOCATION = "geocoded_location"; + public static final String GEOCODED_LOCATION = "geocoded_location"; /** * See {@link android.provider.CallLog.Calls#PHONE_ACCOUNT_COMPONENT_NAME}. * * <p>TYPE: TEXT */ - String PHONE_ACCOUNT_COMPONENT_NAME = "phone_account_component_name"; + public static final String PHONE_ACCOUNT_COMPONENT_NAME = "phone_account_component_name"; /** * See {@link android.provider.CallLog.Calls#PHONE_ACCOUNT_ID}. * * <p>TYPE: TEXT */ - String PHONE_ACCOUNT_ID = "phone_account_id"; + public static final String PHONE_ACCOUNT_ID = "phone_account_id"; /** * See {@link android.provider.CallLog.Calls#FEATURES}. * * <p>TYPE: INTEGER (int) */ - String FEATURES = "features"; + public static final String FEATURES = "features"; /** * Additional attributes about the number. @@ -111,7 +125,7 @@ public class AnnotatedCallLogContract { * * @see com.android.dialer.NumberAttributes */ - String NUMBER_ATTRIBUTES = "number_attributes"; + public static final String NUMBER_ATTRIBUTES = "number_attributes"; /** * Whether the call is to the voicemail inbox. @@ -121,7 +135,7 @@ public class AnnotatedCallLogContract { * @see android.telecom.TelecomManager#isVoiceMailNumber(android.telecom.PhoneAccountHandle, * String) */ - String IS_VOICEMAIL_CALL = "is_voicemail_call"; + public static final String IS_VOICEMAIL_CALL = "is_voicemail_call"; /** * The "name" of the voicemail inbox. This is provided by the SIM to show as the caller ID @@ -130,36 +144,14 @@ public class AnnotatedCallLogContract { * * @see android.telephony.TelephonyManager#getVoiceMailAlphaTag() */ - String VOICEMAIL_CALL_TAG = "voicemail_call_tag"; + public static final String VOICEMAIL_CALL_TAG = "voicemail_call_tag"; /** * Copied from {@link android.provider.CallLog.Calls#TYPE}. * * <p>Type: INTEGER (int) */ - String CALL_TYPE = "call_type"; - } - - /** - * AnnotatedCallLog table. - * - * <p>This contains all of the non-coalesced call log entries. - */ - public static final class AnnotatedCallLog implements CommonColumns { - - public static final String TABLE = "AnnotatedCallLog"; - public static final String DISTINCT_PHONE_NUMBERS = "DistinctPhoneNumbers"; - - /** The content URI for this table. */ - public static final Uri CONTENT_URI = - Uri.withAppendedPath(AnnotatedCallLogContract.CONTENT_URI, TABLE); - - /** Content URI for selecting the distinct phone numbers from the AnnotatedCallLog. */ - public static final Uri DISTINCT_NUMBERS_CONTENT_URI = - Uri.withAppendedPath(AnnotatedCallLogContract.CONTENT_URI, DISTINCT_PHONE_NUMBERS); - - /** The MIME type of a {@link android.content.ContentProvider#getType(Uri)} single entry. */ - public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/annotated_call_log"; + public static final String CALL_TYPE = "call_type"; /** * See {@link android.provider.CallLog.Calls#DATA_USAGE}. @@ -209,21 +201,4 @@ public class AnnotatedCallLogContract { */ public static final String CALL_MAPPING_ID = "call_mapping_id"; } - - /** - * Coalesced view of the AnnotatedCallLog table. - * - * <p>This is an in-memory view of the {@link AnnotatedCallLog} with some adjacent entries - * collapsed. - */ - public static final class CoalescedAnnotatedCallLog implements CommonColumns { - - /** - * IDs of rows in {@link AnnotatedCallLog} that are coalesced into one row in {@link - * CoalescedAnnotatedCallLog}, encoded as a {@link com.android.dialer.CoalescedIds} proto. - * - * <p>Type: BLOB - */ - public static final String COALESCED_IDS = "coalesced_ids"; - } } diff --git a/java/com/android/dialer/calllog/datasources/CallLogDataSource.java b/java/com/android/dialer/calllog/datasources/CallLogDataSource.java index 75f06d5f6..72676a2ad 100644 --- a/java/com/android/dialer/calllog/datasources/CallLogDataSource.java +++ b/java/com/android/dialer/calllog/datasources/CallLogDataSource.java @@ -16,12 +16,8 @@ package com.android.dialer.calllog.datasources; -import android.content.ContentValues; import android.support.annotation.MainThread; -import android.support.annotation.WorkerThread; -import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract; import com.google.common.util.concurrent.ListenableFuture; -import java.util.List; /** * A source of data for one or more columns in the annotated call log. @@ -45,8 +41,6 @@ import java.util.List; * * <p>The same data source objects may be reused across multiple checkDirtyAndRebuild cycles, so * implementors should take care to clear any internal state at the start of a new cycle. - * - * <p>{@link #coalesce(List)} may be called from any worker thread at any time. */ public interface CallLogDataSource { @@ -85,22 +79,6 @@ public interface CallLogDataSource { */ ListenableFuture<Void> onSuccessfulFill(); - /** - * Combines raw annotated call log rows into a single coalesced row. - * - * <p>May be called by any worker thread at any time so implementations should take care to be - * threadsafe. (Ideally no state should be required to implement this.) - * - * @param individualRowsSortedByTimestampDesc group of fully populated rows from {@link - * AnnotatedCallLogContract.AnnotatedCallLog} which need to be combined for display purposes. - * This method should not modify this list. - * @return a partial {@link AnnotatedCallLogContract.CoalescedAnnotatedCallLog} row containing - * only columns which this data source is responsible for, which is the result of aggregating - * {@code individualRowsSortedByTimestampDesc}. - */ - @WorkerThread - ContentValues coalesce(List<ContentValues> individualRowsSortedByTimestampDesc); - @MainThread void registerContentObservers(); diff --git a/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java b/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java index 72e9e0fa9..a80521222 100644 --- a/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java +++ b/java/com/android/dialer/calllog/datasources/phonelookup/PhoneLookupDataSource.java @@ -31,7 +31,6 @@ import com.android.dialer.DialerPhoneNumber; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog; import com.android.dialer.calllog.datasources.CallLogDataSource; import com.android.dialer.calllog.datasources.CallLogMutations; -import com.android.dialer.calllog.datasources.util.RowCombiner; import com.android.dialer.calllogutils.NumberAttributesBuilder; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; @@ -54,7 +53,6 @@ import com.google.common.util.concurrent.MoreExecutors; import com.google.protobuf.InvalidProtocolBufferException; import java.util.ArrayList; import java.util.Arrays; -import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -290,14 +288,6 @@ public final class PhoneLookupDataSource implements CallLogDataSource { return null; } - @WorkerThread - @Override - public ContentValues coalesce(List<ContentValues> individualRowsSortedByTimestampDesc) { - return new RowCombiner(individualRowsSortedByTimestampDesc) - .useMostRecentBlob(AnnotatedCallLog.NUMBER_ATTRIBUTES) - .combine(); - } - @MainThread @Override public void registerContentObservers() { diff --git a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java index 1b66f5099..7a12bc4ba 100644 --- a/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java +++ b/java/com/android/dialer/calllog/datasources/systemcalllog/SystemCallLogDataSource.java @@ -41,7 +41,6 @@ import com.android.dialer.calllog.database.AnnotatedCallLogDatabaseHelper; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog; import com.android.dialer.calllog.datasources.CallLogDataSource; import com.android.dialer.calllog.datasources.CallLogMutations; -import com.android.dialer.calllog.datasources.util.RowCombiner; import com.android.dialer.calllog.observer.MarkDirtyObserver; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; @@ -231,39 +230,6 @@ public class SystemCallLogDataSource implements CallLogDataSource { return null; } - @Override - public ContentValues coalesce(List<ContentValues> individualRowsSortedByTimestampDesc) { - assertNoVoicemailsInRows(individualRowsSortedByTimestampDesc); - - return new RowCombiner(individualRowsSortedByTimestampDesc) - .useMostRecentLong(AnnotatedCallLog.TIMESTAMP) - .useMostRecentLong(AnnotatedCallLog.NEW) - .useMostRecentLong(AnnotatedCallLog.IS_READ) - // Two different DialerPhoneNumbers could be combined if they are different but considered - // to be an "exact match" by libphonenumber; in this case we arbitrarily select the most - // recent one. - .useMostRecentBlob(AnnotatedCallLog.NUMBER) - .useMostRecentString(AnnotatedCallLog.FORMATTED_NUMBER) - .useSingleValueInt(AnnotatedCallLog.NUMBER_PRESENTATION) - .useMostRecentString(AnnotatedCallLog.GEOCODED_LOCATION) - .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_COMPONENT_NAME) - .useSingleValueString(AnnotatedCallLog.PHONE_ACCOUNT_ID) - .useMostRecentLong(AnnotatedCallLog.CALL_TYPE) - // If any call in a group includes a feature (like Wifi/HD), consider the group to have the - // feature. - .bitwiseOr(AnnotatedCallLog.FEATURES) - .combine(); - } - - private void assertNoVoicemailsInRows(List<ContentValues> individualRowsSortedByTimestampDesc) { - for (ContentValues contentValue : individualRowsSortedByTimestampDesc) { - if (contentValue.getAsLong(AnnotatedCallLog.CALL_TYPE) != null) { - Assert.checkArgument( - contentValue.getAsLong(AnnotatedCallLog.CALL_TYPE) != Calls.VOICEMAIL_TYPE); - } - } - } - @TargetApi(Build.VERSION_CODES.N) // Uses try-with-resources private void handleInsertsAndUpdates( Context appContext, CallLogMutations mutations, Set<Long> existingAnnotatedCallLogIds) { diff --git a/java/com/android/dialer/calllog/datasources/util/RowCombiner.java b/java/com/android/dialer/calllog/datasources/util/RowCombiner.java deleted file mode 100644 index 2bb65cc3e..000000000 --- a/java/com/android/dialer/calllog/datasources/util/RowCombiner.java +++ /dev/null @@ -1,108 +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.android.dialer.calllog.datasources.util; - -import android.content.ContentValues; -import com.android.dialer.common.Assert; -import java.util.Iterator; -import java.util.List; -import java.util.Objects; - -/** Convenience class for aggregating row values. */ -public class RowCombiner { - private final List<ContentValues> individualRowsSortedByTimestampDesc; - private final ContentValues combinedRow = new ContentValues(); - - public RowCombiner(List<ContentValues> individualRowsSortedByTimestampDesc) { - Assert.checkArgument(!individualRowsSortedByTimestampDesc.isEmpty()); - this.individualRowsSortedByTimestampDesc = individualRowsSortedByTimestampDesc; - } - - /** Use the most recent value for the specified column. */ - public RowCombiner useMostRecentInt(String columnName) { - combinedRow.put( - columnName, individualRowsSortedByTimestampDesc.get(0).getAsInteger(columnName)); - return this; - } - - /** Use the most recent value for the specified column. */ - public RowCombiner useMostRecentLong(String columnName) { - combinedRow.put(columnName, individualRowsSortedByTimestampDesc.get(0).getAsLong(columnName)); - return this; - } - - /** Use the most recent value for the specified column. */ - public RowCombiner useMostRecentString(String columnName) { - combinedRow.put(columnName, individualRowsSortedByTimestampDesc.get(0).getAsString(columnName)); - return this; - } - - public RowCombiner useMostRecentBlob(String columnName) { - combinedRow.put( - columnName, individualRowsSortedByTimestampDesc.get(0).getAsByteArray(columnName)); - return this; - } - - /** Asserts that all column values for the given column name are the same, and uses it. */ - public RowCombiner useSingleValueString(String columnName) { - Iterator<ContentValues> iterator = individualRowsSortedByTimestampDesc.iterator(); - String singleValue = iterator.next().getAsString(columnName); - while (iterator.hasNext()) { - String current = iterator.next().getAsString(columnName); - Assert.checkState(Objects.equals(singleValue, current), "Values different for " + columnName); - } - combinedRow.put(columnName, singleValue); - return this; - } - - /** Asserts that all column values for the given column name are the same, and uses it. */ - public RowCombiner useSingleValueLong(String columnName) { - Iterator<ContentValues> iterator = individualRowsSortedByTimestampDesc.iterator(); - Long singleValue = iterator.next().getAsLong(columnName); - while (iterator.hasNext()) { - Long current = iterator.next().getAsLong(columnName); - Assert.checkState(Objects.equals(singleValue, current), "Values different for " + columnName); - } - combinedRow.put(columnName, singleValue); - return this; - } - - /** Asserts that all column values for the given column name are the same, and uses it. */ - public RowCombiner useSingleValueInt(String columnName) { - Iterator<ContentValues> iterator = individualRowsSortedByTimestampDesc.iterator(); - Integer singleValue = iterator.next().getAsInteger(columnName); - while (iterator.hasNext()) { - Integer current = iterator.next().getAsInteger(columnName); - Assert.checkState(Objects.equals(singleValue, current), "Values different for " + columnName); - } - combinedRow.put(columnName, singleValue); - return this; - } - - /** Performs a bitwise OR on the specified column and yields the result. */ - public RowCombiner bitwiseOr(String columnName) { - int combinedValue = 0; - for (ContentValues val : individualRowsSortedByTimestampDesc) { - combinedValue |= val.getAsInteger(columnName); - } - combinedRow.put(columnName, combinedValue); - return this; - } - - public ContentValues combine() { - return combinedRow; - } -} diff --git a/java/com/android/dialer/calllog/datasources/voicemail/VoicemailDataSource.java b/java/com/android/dialer/calllog/datasources/voicemail/VoicemailDataSource.java index 7a230220e..cbda9ac81 100644 --- a/java/com/android/dialer/calllog/datasources/voicemail/VoicemailDataSource.java +++ b/java/com/android/dialer/calllog/datasources/voicemail/VoicemailDataSource.java @@ -25,7 +25,6 @@ import com.android.dialer.DialerPhoneNumber; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog; import com.android.dialer.calllog.datasources.CallLogDataSource; import com.android.dialer.calllog.datasources.CallLogMutations; -import com.android.dialer.calllog.datasources.util.RowCombiner; import com.android.dialer.common.concurrent.Annotations.BackgroundExecutor; import com.android.dialer.compat.telephony.TelephonyManagerCompat; import com.android.dialer.inject.ApplicationContext; @@ -35,7 +34,6 @@ import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListeningExecutorService; import com.google.protobuf.InvalidProtocolBufferException; -import java.util.List; import java.util.Map.Entry; import javax.inject.Inject; @@ -104,14 +102,6 @@ public class VoicemailDataSource implements CallLogDataSource { } @Override - public ContentValues coalesce(List<ContentValues> individualRowsSortedByTimestampDesc) { - return new RowCombiner(individualRowsSortedByTimestampDesc) - .useMostRecentInt(AnnotatedCallLog.IS_VOICEMAIL_CALL) - .useMostRecentString(AnnotatedCallLog.VOICEMAIL_CALL_TAG) - .combine(); - } - - @Override public void registerContentObservers() {} @Override diff --git a/java/com/android/dialer/compat/android/support/design/bottomsheet/BottomSheetStateCompat.java b/java/com/android/dialer/compat/android/support/design/bottomsheet/BottomSheetStateCompat.java new file mode 100644 index 000000000..d7079d461 --- /dev/null +++ b/java/com/android/dialer/compat/android/support/design/bottomsheet/BottomSheetStateCompat.java @@ -0,0 +1,43 @@ +/* + * Copyright (C) 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License + */ + +package com.android.dialer.compat.android.support.design.bottomsheet; + +import android.support.design.widget.BottomSheetBehavior; + +/** Provides access to bottom sheet states. */ +public final class BottomSheetStateCompat { + + /** The bottom sheet is dragging. */ + public static final int STATE_DRAGGING = BottomSheetBehavior.STATE_DRAGGING; + + /** The bottom sheet is settling. */ + public static final int STATE_SETTLING = BottomSheetBehavior.STATE_SETTLING; + + /** The bottom sheet is expanded. */ + public static final int STATE_EXPANDED = BottomSheetBehavior.STATE_EXPANDED; + + /** The bottom sheet is collapsed. */ + public static final int STATE_COLLAPSED = BottomSheetBehavior.STATE_COLLAPSED; + + /** The bottom sheet is hidden. */ + public static final int STATE_HIDDEN = BottomSheetBehavior.STATE_HIDDEN; + + /** The bottom sheet is half-expanded (not public yet). */ + public static final int STATE_HALF_EXPANDED = 6; + + private BottomSheetStateCompat() {} +} diff --git a/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java b/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java index f5cdc4d87..9bc657067 100644 --- a/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java +++ b/java/com/android/dialer/historyitemactions/HistoryItemActionBottomSheet.java @@ -28,13 +28,17 @@ import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; +import android.view.ViewTreeObserver.OnPreDrawListener; import android.view.Window; +import android.view.accessibility.AccessibilityManager; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.android.dialer.common.Assert; +import com.android.dialer.compat.android.support.design.bottomsheet.BottomSheetStateCompat; import com.android.dialer.theme.base.ThemeComponent; import com.android.dialer.widget.ContactPhotoView; +import com.google.common.collect.ImmutableSet; import java.util.List; /** @@ -49,6 +53,42 @@ public class HistoryItemActionBottomSheet extends BottomSheetDialog implements O private final List<HistoryItemActionModule> modules; private final HistoryItemBottomSheetHeaderInfo historyItemBottomSheetHeaderInfo; + /** + * An {@link OnPreDrawListener} that sets the contact layout's elevation if + * + * <ul> + * <li>the bottom sheet can expand to full screen, and + * <li>the bottom sheet is fully expanded. + * </ul> + * + * <p>The reason an {@link OnPreDrawListener} instead of a {@link BottomSheetCallback} is used to + * handle this is that the initial state of the bottom sheet will be STATE_EXPANDED when the touch + * exploration (e.g., TalkBack) is enabled and {@link BottomSheetCallback} won't be triggered in + * this case. See {@link #setupBottomSheetBehavior()} for details. + */ + private final OnPreDrawListener onPreDrawListenerForContactLayout = + () -> { + View contactLayout = findViewById(R.id.contact_layout_root); + View background = findViewById(android.support.design.R.id.touch_outside); + View bottomSheet = findViewById(android.support.design.R.id.design_bottom_sheet); + + BottomSheetBehavior<View> behavior = BottomSheetBehavior.from(bottomSheet); + + // If the height of the background is equal to that of the bottom sheet, the bottom sheet + // *can* be expanded to full screen. + contactLayout.setElevation( + background.getHeight() == bottomSheet.getHeight() + && behavior.getState() == BottomSheetStateCompat.STATE_EXPANDED + ? getContext() + .getResources() + .getDimensionPixelSize(R.dimen.contact_actions_header_elevation) + : 0); + + return true; // Return true to proceed with the current drawing pass. + }; + + private LinearLayout contactLayout; + private HistoryItemActionBottomSheet( Context context, HistoryItemBottomSheetHeaderInfo historyItemBottomSheetHeaderInfo, @@ -71,6 +111,10 @@ public class HistoryItemActionBottomSheet extends BottomSheetDialog implements O @Override protected void onCreate(Bundle bundle) { + contactLayout = Assert.isNotNull(findViewById(R.id.contact_layout_root)); + + initBottomSheetState(); + setupBottomSheetBehavior(); setupWindow(); setupContactLayout(); @@ -84,7 +128,68 @@ public class HistoryItemActionBottomSheet extends BottomSheetDialog implements O } } - // Overrwrites the window size since Dialog's don't match parent. + @Override + public void onAttachedToWindow() { + super.onAttachedToWindow(); + contactLayout.getViewTreeObserver().addOnPreDrawListener(onPreDrawListenerForContactLayout); + } + + @Override + public void onDetachedFromWindow() { + super.onDetachedFromWindow(); + contactLayout.getViewTreeObserver().removeOnPreDrawListener(onPreDrawListenerForContactLayout); + } + + private void initBottomSheetState() { + // If the touch exploration in the system (e.g., TalkBack) is enabled, the bottom sheet should + // be fully expanded because sometimes services like TalkBack won't read all items when the + // bottom sheet is not fully expanded. + if (isTouchExplorationEnabled()) { + BottomSheetBehavior<View> behavior = + BottomSheetBehavior.from(findViewById(android.support.design.R.id.design_bottom_sheet)); + behavior.setState(BottomSheetStateCompat.STATE_EXPANDED); + } + } + + /** + * Configures the bottom sheet behavior when its state changes. + * + * <p>If the touch exploration in the system (e.g., TalkBack) is enabled, the bottom sheet will be + * canceled if it is in a final state other than {@link BottomSheetBehavior#STATE_EXPANDED}. This + * is because sometimes services like TalkBack won't read all items when the bottom sheet is not + * fully expanded. + * + * <p>If the touch exploration is disabled, cancel the bottom sheet when it is in {@link + * BottomSheetBehavior#STATE_HIDDEN}. + */ + private void setupBottomSheetBehavior() { + BottomSheetBehavior<View> behavior = + BottomSheetBehavior.from(findViewById(android.support.design.R.id.design_bottom_sheet)); + behavior.setBottomSheetCallback( + new BottomSheetCallback() { + @Override + public void onStateChanged(@NonNull View bottomSheet, int newState) { + ImmutableSet<Integer> statesToCancelBottomSheet = + isTouchExplorationEnabled() + ? ImmutableSet.of( + BottomSheetStateCompat.STATE_COLLAPSED, + BottomSheetStateCompat.STATE_HIDDEN, + BottomSheetStateCompat.STATE_HALF_EXPANDED) + : ImmutableSet.of(BottomSheetStateCompat.STATE_HIDDEN); + + if (statesToCancelBottomSheet.contains(newState)) { + cancel(); + } + + // TODO(calderwoodra): set the status bar color when expanded, else translucent + } + + @Override + public void onSlide(@NonNull View bottomSheet, float slideOffset) {} + }); + } + + // Overwrites the window size since it doesn't match the parent. private void setupWindow() { Window window = getWindow(); if (window == null) { @@ -97,13 +202,11 @@ public class HistoryItemActionBottomSheet extends BottomSheetDialog implements O } private void setupContactLayout() { - View contactView = Assert.isNotNull(findViewById(R.id.contact_layout_root)); - - ContactPhotoView contactPhotoView = contactView.findViewById(R.id.contact_photo_view); + ContactPhotoView contactPhotoView = contactLayout.findViewById(R.id.contact_photo_view); contactPhotoView.setPhoto(historyItemBottomSheetHeaderInfo.getPhotoInfo()); - TextView primaryTextView = contactView.findViewById(R.id.primary_text); - TextView secondaryTextView = contactView.findViewById(R.id.secondary_text); + TextView primaryTextView = contactLayout.findViewById(R.id.primary_text); + TextView secondaryTextView = contactLayout.findViewById(R.id.secondary_text); primaryTextView.setText(historyItemBottomSheetHeaderInfo.getPrimaryText()); if (!TextUtils.isEmpty(historyItemBottomSheetHeaderInfo.getSecondaryText())) { @@ -112,35 +215,6 @@ public class HistoryItemActionBottomSheet extends BottomSheetDialog implements O secondaryTextView.setVisibility(View.GONE); secondaryTextView.setText(null); } - - View background = findViewById(android.support.design.R.id.touch_outside); - BottomSheetBehavior behavior = - BottomSheetBehavior.from(findViewById(android.support.design.R.id.design_bottom_sheet)); - behavior.setBottomSheetCallback( - new BottomSheetCallback() { - @Override - public void onStateChanged(@NonNull View bottomSheet, int newState) { - if (newState == BottomSheetBehavior.STATE_HIDDEN) { - cancel(); - return; - } - - // If the bottomsheet can expand to full screen, set the header's elevation when it's - // fully expanded. - if (background.getHeight() == bottomSheet.getHeight()) { - contactView.setElevation( - newState == BottomSheetBehavior.STATE_EXPANDED - ? getContext() - .getResources() - .getDimensionPixelSize(R.dimen.contact_actions_header_elevation) - : 0); - // TODO(calderwoodra): set the status bar color when expanded, else translucent - } - } - - @Override - public void onSlide(@NonNull View bottomSheet, float slideOffset) {} - }); } private View getDividerView(ViewGroup container) { @@ -170,4 +244,11 @@ public class HistoryItemActionBottomSheet extends BottomSheetDialog implements O dismiss(); } } + + private boolean isTouchExplorationEnabled() { + AccessibilityManager accessibilityManager = + getContext().getSystemService(AccessibilityManager.class); + + return accessibilityManager.isTouchExplorationEnabled(); + } } diff --git a/java/com/android/incallui/call/DialerCall.java b/java/com/android/incallui/call/DialerCall.java index 904a5a833..dd6c25b5b 100644 --- a/java/com/android/incallui/call/DialerCall.java +++ b/java/com/android/incallui/call/DialerCall.java @@ -977,13 +977,23 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa } /** Checks if the call supports the given set of capabilities supplied as a bit mask. */ + @TargetApi(28) public boolean can(int capabilities) { int supportedCapabilities = telecomCall.getDetails().getCallCapabilities(); if ((capabilities & Call.Details.CAPABILITY_MERGE_CONFERENCE) != 0) { + boolean hasConferenceableCall = false; + // RTT call is not conferenceable, it's a bug (a bug) in Telecom and we work around it + // here before it's fixed in Telecom. + for (Call call : telecomCall.getConferenceableCalls()) { + if (!(BuildCompat.isAtLeastP() && call.isRttActive())) { + hasConferenceableCall = true; + break; + } + } // We allow you to merge if the capabilities allow it or if it is a call with // conferenceable calls. - if (telecomCall.getConferenceableCalls().isEmpty() + if (!hasConferenceableCall && ((Call.Details.CAPABILITY_MERGE_CONFERENCE & supportedCapabilities) == 0)) { // Cannot merge calls if there are no calls to merge with. return false; @@ -1704,6 +1714,17 @@ public class DialerCall implements VideoTechListener, StateChangedListener, Capa /** Indicates the call is eligible for SpeakEasy */ public boolean isSpeakEasyEligible() { + + PhoneAccount phoneAccount = getPhoneAccount(); + + if (phoneAccount == null) { + return false; + } + + if (!phoneAccount.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) { + return false; + } + return !isPotentialEmergencyCallback() && !isEmergencyCall() && !isActiveRttCall() |