aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2023-04-03Revert "Adding a fix for trimming any large fields before they are inserted ↵Kunal Malhotra
into" This reverts commit 4480a86810cc73a198fbe967685dd8980b375887. Reason for revert: Change shouldn't be backported Change-Id: I50efa4b0f7f897befef64d159f7de61721c6dad3
2023-04-03Adding a fix for trimming any large fields before they are inserted intoKunal Malhotra
the DB Test: manual testing done by attempting to add an imported contact with a very large field in it Change-Id: I52814fee6c5e137809020f16f332800ef9d79099 Bug: b/262595156 b/262594744 (cherry picked from commit b915bb73ad6905bf339f5fcf8d47a8f487b0f889) Merged-In: I52814fee6c5e137809020f16f332800ef9d79099
2022-06-03Merge "Add null-check for SubscriptionInfo when trying to get IccId." into ↵android13-devTyler Gunn
tm-dev
2022-06-01Add null-check for SubscriptionInfo when trying to get IccId.Grace Jia
Bug: 234337531 Test: CallLogProviderTest Change-Id: I8f27f053ab10969617dd2850cb327548a0e2d467
2022-05-31Change the CP2 logging to be correct order. The order of the logging fields ↵Dongzhuo Zhang
must match the one in atoms.proto. This issue was initially introduced in T, so we need Dr.No approval to get this in T. Bug: b/233950995 Change-Id: Ie9a12bc2539a7eac78c20f02b15302badfed77f1
2022-05-10enforce stricter CallLogProvider queryThomas Stuart
changes: - phoneNumber is now a selectionArgument - if the user makes a query request for the CALLS_FILTER case, throw a SE if the cursor is empty && SQL is detected Bug: 224771921 Test: 2 manual, manual 1: test app 1 can still make valid call filter query manual 2: test app 2 with invalid query crashes b/c of SE 2 CTS tests, test 1: ensures the existing functionality still works test 2: ensures a SE is thrown on an invalid query for call filter Change-Id: Ia445bb59581abb14e247aa8d9f0177e02307cf96
2022-04-28Fix NumberFormatException in CallLogProvider.Varun Shah
Change-Id: Iaa1febf36297d8ab6f72c6a80b5811d0d7b35044 Fixes: 229124902 Test: atest CallLogProviderTest (cherry picked from commit 4214594346608061f4f5cb02ed2752b90a78d330)
2022-04-20Add check that prevents file operations outside of Call Composer DirThomas Stuart
Cannot open, delete, sync, or insert files outside of the Call Composer directory. New check prevents this. bug: 219015884 Test: 3 UT, 1. CallLogProviderTest#testOpenFileOutsideOfScopeThrowsException 2. CallLogProviderTest#testDeleteFileOutsideOfScopeThrowsException 3. CallLogProviderTest#testInsertFileOutsideOfScopeThrowsException Change-Id: I5a9dc98db446707373479fe1c2cb5fba44bdedf7
2022-04-07PhoneAccountHandle without IccId in TShuo Qian
Before Android 13, PhoneAccountHandle#getId() returns the ICCID for Telephony PhoneAccountHandle. Starting from Android 13, PhoneAccountHandle#getId() returns the on-device Subscription ID for Telephony PhoneAccountHandle. This need to migrate the PhoneAccountHandle ID stored in CalllogProvider and ContactsProvider. When the database is created and upgraded, the device finds the mapping between Sub IDs and IccID by looking at the subscription DB in Telephony and migrate. Set pending status if migration is not available yet. The two databases will listen to broadcast "ACTION_PHONE_ACCOUNT_REGISTERED" to identify a new sim event and performing migration for pending status if possible. This need to be registered as a runtime register instead of a manifest broadcast to avoid process started when unnecessary. In multi-user cases, database for each user would be different. A database for each user need to migrate the database when the database is created or initialized. The way to check if the database need to pending is using a sharedPreference. The historical design is based on a logic that the framework unhides the restored PhoneAccountHandle in call log when the PhoneAccountHandle is registered by Telecom. The best time to do the migration based on the sim event is after PhoneAccountHandle is registered by Telecom and before Calllog provider unhides it. Bug: 185235527 Test: atest CallLogMigrationTest; atest ContactsProvider2Test; atest ContactsDatabaseMigrationTest; atest CallLogProviderTest; atest ContactsDatabaseHelperUpgradeTest Change-Id: I9397ad03094da80c4d6c522e1e09a844edfc4231
2022-03-30Cap field length on certain fieldsMakoto Onuki
Test: manual test Bug: 220865698 Change-Id: I73aba2e5652916d1428e1b3ac4fb7ebeb885460e
2022-03-09Rename grantImplicitAccess to makeProviderVisibleRhed Jao
Bug: 222205552 Test: Build Change-Id: Iae82d4efcd3196ee159eceb2a701c1190e177a5a
2022-01-06Merge "Fix CP2 setDefaultAccount DB writing."Tingting Wang
2022-01-06Fix CP2 setDefaultAccount DB writing.Tingting
DB should update the existing row if the account exists. Test: manual test and unit tests (atest ContactsProviderTests). Bug: 188347310 Change-Id: Ic96176cdf10d2d5e81aa7e7432f5be114128f642
2021-12-13Use the config strings for the local contacts accountMarcus Hagerott
This allows custom local accounts to be handled the same as the AOSP local account. BUG=188858351 Test: atest ContactsProviderTestCases CtsContactsProviderTestCases Change-Id: Icf8b18c2713b8958e5b7150033794289d328907c
2021-12-03Revert "Migrate custom local account to AOSP local account"Marcus Hagerott
This reverts commit 20428525d38d92bf6f4631fe040dd26b02be4c97 which added the 1602 DB upgrade and adds a 1603 updgrade to clean up the changes that were made in 1602. Reverting because partners are concerned about backwards compatibility. Test: atest ContactsProviderTests CtsContactsProviderTestCases BUG=188347648 BUG=179694648 Change-Id: Ib5f675c7794aca57088b492084dcea30169923a5
2021-11-18Add account check for setDefaultAccount API.Tingting
Test: atest ContactsProviderTests. Bug: 188347310 Change-Id: I9ded7fcd4956b48877ed6ce4293b3791e6b551f0
2021-10-08Merge "UM.getUserHandle -> UM.getProcessUserId"Adam Bookatz
2021-10-05Merge "Set/get default account to/from CP2 DB."Tingting Wang
2021-10-05UM.getUserHandle -> UM.getProcessUserIdAdam Bookatz
UM is being made @UserHandleAware, so using an explicit method avoids ambiguity. Bug: 201679968 Test: (No-op) compiles and treehugger Change-Id: I5ea64c4e408509af533488ee071d0f490ee8cd96
2021-09-09Migrate custom local account to AOSP local accountMarcus Hagerott
In Android T the CDD will be updated to require that the "default local account" be used for local contacts. This migration changes the account of raw contacts that are in the OEM custom local accounts to be in this default so that they are compliant with this requirement. Test: atest ContactsProviderTests CtsContactsProviderTestCases BUG=188347648 BUG=179694648 Change-Id: I488ca297887198116d8b0204c02b666195b864dd
2021-08-17Set/get default account to/from CP2 DB.Tingting
Test: unit tests. Bug: 188347310 Change-Id: I9c5f487699662d08f8ff6137ceda08375bd7227c
2021-08-06Add x_is_default column to Accounts table.Tingting
Test: installed the apk to device and verified; unit test. Bug: 188347310 Change-Id: Ie8c66558bfd24016b1a92a77cc244db144b0e662
2021-06-02Merge "Move broadcast and return to after finalizing the transactions" into ↵TreeHugger Robot
sc-dev am: ca2ab19dc7 am: a935067186 am: e7bbed61fe Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/14536864 Change-Id: Ib0e11ee5cc370907897419e8d94ca351e603b061
2021-06-02Merge "Move broadcast and return to after finalizing the transactions" into ↵TreeHugger Robot
sc-dev
2021-05-26Fix issue with call log last modified not being updated. am: 7f70b88e97 am: ↵Tyler Gunn
edb233628c am: d57a92feae Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/14724176 Change-Id: I19b345f335e5641a5b89767bceadf134caa1d032
2021-05-25Fix issue with call log last modified not being updated.Tyler Gunn
In the past a security update was done which replaced usage of the DbModifierWithNotification class with SQLiteQueryBuilders. This solved the security issue but caused all the code in the DbModifierWithNotification update and delete methods to no longer run. This includes notifying of new written voicemails, updating the last modified date for rows, and notifying content observers. We cleaned up the content observer issue in QPR, so it was time to swing back and clean the rest up. In the end it just makes more sense to use SQLiteQueryBuilder instances in DbModifierWithNotification for the user-provided queries; this lets the rest of the update code which resided in that class still operate in the same manner as it used to. Test: Run unit tests Test: Run CTS tests Test: Add new CTS test to verify call log last modified gets updated. Fixes: 177421643 Change-Id: Idc73df91cb1a0f4e77a4c5d2a288ab6ff2f6fc77
2021-05-13Move broadcast and return to after finalizing the transactionsGary Mai
Test: unit and Cts tests Bug: 187969786 Change-Id: I6c1fc9c7e17463a50004a39d370b14d749e8e03d
2021-04-29Merge "Enable detailed logging for StrictMode." into sc-dev am: 89f57c2829TreeHugger Robot
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/14356849 Change-Id: I6d896e80a59dbc40274f9ada0b82ef7dd1787dd1
2021-04-29Merge "Enable detailed logging for StrictMode." into sc-devTreeHugger Robot
2021-04-29Enable detailed logging for StrictMode.Varun Shah
Show additional information like full stacktraces when a StrictMode violation occurs in CP2 - only enabled on debug builds. Bug: 178702677 Test: m and flash Change-Id: I24c67d7e45215a51576cd11208ee047b055f85ef
2021-04-27Minor name convention and comment update, for better readability. am: 5945232ae2Liefu Liu
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/14315160 Change-Id: I8583850d289cc60d8c685a4d2339a766efd3c1cc
2021-04-26Minor name convention and comment update, for better readability.Liefu Liu
Changes to be committed: modified: src/com/android/providers/contacts/ContactsProvider2.java Test: text update. no test Bug: 185855005 Change-Id: Ib6a3a9dd209a1dac42209dcd2329e688f281b693
2021-04-26Merge "Set a rate limit to CP2 notifyChange, if the change is not to sync to ↵Liefu Liu
network." into sc-dev am: 4a016e563e Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/14253248 Change-Id: Ib89b48de3c4f189fd17d0d5c93f48af67741a7c3
2021-04-26Merge "Set a rate limit to CP2 notifyChange, if the change is not to sync to ↵Liefu Liu
network." into sc-dev
2021-04-26Set a rate limit to CP2 notifyChange, if the change is not to sync toLiefu Liu
network. Bug: 185855005 Test: manually tested modified: src/com/android/providers/contacts/ContactsProvider2.java Change-Id: I1f317fd8753087404473aed69a03ba64093296a8
2021-04-26Merge "Add Westworld logging on Dangling Contacts Cleanup Task Bug: ↵Dongzhuo Zhang
b/181693236 Test: Passed manual test and unit tests"
2021-04-23Add Westworld logging on Dangling Contacts Cleanup TaskDongzhuo
Bug: b/181693236 Test: Passed manual test and unit tests Change-Id: Ica7d828a98567bb4c8a4551a111729a960d01eca
2021-04-21Merge "Security fix: as part of enforcing read privilege permission to check ↵Nazanin Bakhshi
package privileges in TelephonyManager, clear calling identity to ensure current functionalities work" into sc-dev am: 78c7a96d48 Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/14100923 Change-Id: I807b526ad30b82d1c2fcdd08d9dbe2dc40d76299
2021-04-20Security fix: as part of enforcing read privilege permission to check packageNazanin
privileges in TelephonyManager, clear calling identity to ensure current functionalities work Bug: 180938364 Test: cts Change-Id: I722ca5cdde260bccd73fdfd0bf6447c2cd7beff9
2021-04-19Force SearchIndex.rowid identical with contact_id, and find the matched ↵Liefu Liu
contact in SearchIndex table via rowId am: bc27940a7f Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/14194127 Change-Id: I1143bb5d2efa05092917592e2f68c7dfc624ad02
2021-04-19Force SearchIndex.rowid identical with contact_id, and find the matched ↵Liefu Liu
contact in SearchIndex table via rowId This idea is initiated by nosh@ and timmurray@ after performance profiling on CP2 and Sqlite. The change improves the index update performance from "linear scan" (to find the contact), to rowId lookup. Performance has been measured during 5K contacts sync on Pixel 3XL, which shows the CP2 writing time has been reduced significantly with this change. The current unit test in SearchIndexManagerTest seems having a good coverage, but feel free to suggest any other scenarios we should cover. Change-Id: Ice726b79b61693b17c78fe4b8657ec6a6c311997 Bug: 185232538
2021-04-08Consolidate settings and accounts tablesMarcus Hagerott
This is primarily to allow settings for the local account. Test: atest ContactsProviderTests CtsContactsProviderTestCases Bug: 166446448 Change-Id: I3589b55c202346986bead0e3b1c290552b33312b
2021-03-29Runtime permission attribution improvements am: 87e66d28a8Svet Ganov
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/13876385 Change-Id: If8a09e22a17fd95d05e99b5c77d1790f8439e0f6
2021-03-27Runtime permission attribution improvementsSvet Ganov
This change updates some of the code due to fw changes. bug:158792096 bug:180647319 Test:atest android.permission5.cts.RuntimePermissionsAppOpTrackingTest Change-Id: I64d12ffa83e6c6ccdbfb066d9235641c53399cf8
2021-03-10Add Dangling Contacts Cleanup TaskDongzhuo
Tracking Bug: b/181693236 Test: Passed manual test and unit tests Change-Id: I6bbb5fee5e87d7cd1d303936839b1f5bd33cbc4f
2021-02-10Require caller be default dialer for call composer locationHall Liu
Remove the requirement for ACCESS_FINE_LOCATION for the CallComposerLocationProvider table and instead require that the caller be the default dialer on the device instead. Fixes: 179939801 Test: atest CallLogTest Change-Id: Iabe3c8f2682845da6756cf82ad70856faa5d58f9
2021-01-19Add new storage for call composer elementsHall Liu
Add columns for the new call composer elements in the call log, and add a new provider/db for location in order to avoid SQL injection that bypasses the ACCESS_FINE_LOCATION requirement. Test: atest CallLogTest Bug: 174798736 Change-Id: I45676ac29e632d5f04edc8d4d0f47327d6cf99a7
2021-01-15Merge "Use new phone number match method in Java directly as a new filter in ↵Grace Jia
ContactsProvider2." am: 03db749ca3 am: 8884eb88a6 am: 35c681b6ed Original change: https://android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/1449515 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Iaca4012e9d4491259a20710965a815af339df266
2021-01-14Merge "Use new phone number match method in Java directly as a new filter in ↵Grace Jia
ContactsProvider2." am: 03db749ca3 am: 8884eb88a6 Original change: https://android-review.googlesource.com/c/platform/packages/providers/ContactsProvider/+/1449515 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I3a8270490ed154eb1db9a41cea5a3fb05cca2a04
2021-01-13Use new phone number match method in Java directly as a new filter inGrace Jia
ContactsProvider2. Change-Id: I4dceec842d624e3cd2a2dacbe3a69f5924fc30fc Bug: 174028667 Test: unit test