Over the years we've had several obscure bugs related to how SDK level
comparisons are performed, specifically during the window of time
where we've started distributing the "frankenbuild" to developers.
Consider the case where a framework developer shipping release "R"
wants to only grant a specific behavior to modern apps; they could
write this in two different ways:
1. if (targetSdkVersion > Build.VERSION_CODES.Q) {
2. if (targetSdkVersion >= Build.VERSION_CODES.R) {
The safer of these two options is (2), which will ensure that
developers only get the behavior when *both* the app and the
platform concur on the specific SDK level having shipped.
Consider the breakage that would happen with option (1) if we
started shipping APKs that are based on the final R SDK, but are
then installed on earlier preview releases which still consider R
to be CUR_DEVELOPMENT; they'd risk crashing due to behaviors that
were never part of the official R SDK.
Bug: 64412239
Test: ./build/soong/soong_ui.bash --make-mode services RUN_ERROR_PRONE=true
Exempt-From-Owner-Approval: trivial blueprint changes
Change-Id: Ia20181f8602451ac9a719ea488d148e160708592
Before this change, People Service uses the presence of the Person object
in ShortcutInfo as the criteria of conversation shortcut. This changes
the criteria that the shortcut needs to be a share shortcut instead of having Person object.
Change-Id: I1ea52a50c909ca96365c1d4e55af97931d048d8f
Test: atest ShortcutHelperTest
Test: atest DataManagerTest
Bug: 154254830
Add a Logger for sharesheet and add calls into ChooserActivity.java
Bug: 147508495
Test: manual testing and added unit tests into ChooserActivityTests.
Change-Id: I0024b5020f47475a28c4745af4d8ef268e5f85be
This change is targeting on reducing the latency to unlock a user. It
includes these changes:
(1) In DataManager.onUserUnlocked(), execute the listeners registration
code on a worker thread.
(2) Merge the usage stats service query and data persistence to one thread.
(3) Adjust the query events max age from 1 day to 5 mins because we
already persist those events in PeopleService. No need to re-query those
events.
With this change, PeopleService.onUserUnlocked() execution is reduced
from ~200 ms to <1ms. And listeners are set up after conversations being
loaded from the disk. This ensures at the events query time (such as
UsageStatsService query), all the conversations are already available in
People Service to avoid missing some events (events without an
associated conversation are dropped).
Change-Id: I5248afa2771588a2434c335867de4e2d1a2eb6f3
Test: atest com.android.server.people.data.DataManagerTest
Test: atest com.android.server.people.data.ConversationStoreTest
Test: atest com.android.server.people.data.PackageDataTest
Bug: 150733302
In addition to the bug fix, this also changes the user lifecycle callbacks People Service is using:
1) onUserUnlocking() -> onUserUnlocked()
2) onUserStopped() -> onUserStopping()
The user lifecycle callback changes are based on a recent callback API
change in ag/10396717. This change will make the service run safer: it
avoids performing queries on locked users.
Change-Id: I4d0ebdb80f2181b5eb5a636d345c53a01c7df210
Test: Manual test
Test: atest com.android.server.people.data.DataManagerTest
Bug: 150882079
recency of past sharing for the moment.
Bug: 149822311
Test: atest com.android.server.people.data.DataManagerTest
Test: atest com.android.server.people.data.ShareTargetPredictorTest
Change-Id: I90d1b3f488b34fede7d577dc04832b976f4a1bbb
Previously, the caller's user ID was got from Binder. But
AppPredictionManager clears caller's identity. The only way to get the
caller's user ID is to get it from session ID.
Bug: 146522621
Test: atest com.android.server.people.data.DataManagerTest
Test: atest com.android.server.people.data.ShareTargetPredictorTest
Change-Id: Ia0dc35879084110849e06e919ff3b3c7241c46fd
UsageStats NOTIFICATION_INTERRUPTION events are only created if a
conversation has its own conversation-specific notification channel
created. Switch to NotificationListenerService so that we could get the notification posted events from all conversations.
Bug: 146522621
Test: atest com.android.server.people.data.DataManagerTest
Test: atest com.android.server.people.data.UsageStatsQueryHelperTest
Change-Id: Iaa120567891144a952707deb5cea1321aa28341c
This change is to speed up the system boot time. The people service
start time will be reduced from ~1.5 ms to ~0.5 ms.
Bug: 149245782
Test: Manual run with System.nanoTime() logged
Change-Id: I9114b3c9e3637b2498618220665cd98df1d1f994
- Refactor the class EventStore to simplify the event history access methods
- Add the prune methods to delete the data for:
- uninstalled packages
- event data that exceeds the retention period
- call events data for non-dialer packages
- SMS events data for non-SMS-app packages
- orphan events (the annotated locus ID or phone number have changed in the associated shortcut)
- Change the package-level events to class-level for the app share events
Bug: 146522621
Test: Manually verify the behavior on device \
atest com.android.server.people.data.DataManagerTest \
atest com.android.server.people.data.PackageDataTest
Change-Id: I3f17ed269fe5cb05f1d3696e44dfb0bed951678f
UsageStats will return obfuscated NOTIFICATION_SEEN or
NOTIFICATION_INTERRUPTION events to callers of #queryEvents
and #queryEventsForUser if they don't hold the MANAGE_NOTIFICATIONS
permission.
Additionaly, refactor the query API in UsageStats to take in flags as
defined in UsageEvents to make future obfuscation/visibility parameters
cleaner.
Also, add the MANAGE_NOTIFICATIONS permission to shell for CTS test.
Bug: 144724524
Test: atest android.app.usage.cts.UsageStatsTest
Test: atest com.android.server.people.data.UsageStatsQueryHelperTest
Test: atest android.content.pm.cts.shortcutmanager.ShortcutManagerUsageTest
Change-Id: I118de7e589ac8dd5924d3740c70903fa484b79b5
- New @SystemApis on Conference and PhoneAccount were missing the required
permissions annotations.
- Rename PROPERTY_ASSISTED_DIALING_USED to PROPERTY_ASSISTED_DIALING
- Standardize get/setConnectionStartElapsedRealtimeMillis method naming
across Connection and Conference classes.
- Clarify Conference#sendConferenceEvent API documentation to match the
docs present for similar method in Connection; include some examples of
valid event/extras combinations.
- Update TelecomManager#getDefaultdialerPackage to use UserHandle instead
of userId.
- Move Conference#getConnectionStartElapsedRealtimeMillis to public API
since the setter is already part of the public API.
Test: Run Telecom and Telephony CTS tests.
Test: Run Telephony unit tests.
Test: Perform manual single-party-conference regression test to confirm
that conference behavior does not regress.
Bug: 147301297
Bug: 148286830
Bug: 148284863
Bug: 148284843
Bug: 148287068
Bug: 148285484
Bug: 148285560
Change-Id: I1f446d81859fa109d74af3661a42a0bd224de5aa
UsageStats will not return LOCUS_ID_SET events to callers
of #queryEvents and #queryEventsForUser if they don't have visibility.
Bug: 148821246
Test: manual, atest tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest
Change-Id: Ic904a97e66775ef63bc8b84e67e8f430b2a4121b
It processes these UsageStats events:
- SHORTCUT_INVOCATION
- NOTIFICATION_INTERRUPTION
- LOCUS_ID_SET
- ACTIVITY_PAUSED/STOPPED/DESTROYED
The in-app conversation is counted from the LOCUS_ID_SET event to the
next LOCUS_ID_SET event, or the associated Activity is
paused/stopped/destroyed.
Change-Id: I5ecb78e61f9f69129e7fa9cc67e9e94b2148fcda
Test: Manual tests \
atest com.android.server.people.data.UsageStatsQueryHelperTest \
atest com.android.server.people.data.DataManagerTest \
atest com.android.server.people.data.CallLogQueryHelperTest \
atest com.android.server.people.data.ConversationInfoTest \
atest com.android.server.people.data.ConversationStoreTest
Bug: 146522621