This API will be used to determine if the user is interacting with
the device and hence is able to do stuff like launching activities.
This initial version only returns true for the current foreground
user, but it will be expanded to also return true for:
- Background users associated with secondary displays
- (Running) profile of other visible users
Test: atest CtsMultiUserTestCases:android.multiuser.cts.UserManagerTest#testIsUserVisible_currentUser
Test: manual verification with Automotive's KitchenSink
Test: m update-api
Bug: 239824814
Change-Id: Ie8da07f69898d2b376bcf60d1da4221aed03ee3b
By default it reads the value from
config_multiuserUsersOnSecondaryDisplays
overridden by the system property for development purposes.
Test: adb shell setprop fw.users_on_secondary_displays true && \
adb shell dumpsys user | grep -i "secondary display"
Fixes: 240613396
Change-Id: I1428a117a683e99fcaef71492be297c844d520e2
Follow up to ag/18795008.
Lazy Bundles, (aosp/1787847), introduced a change in behavior where a Parcel
created as part of initializing a Bundle is dependent on the next ART GCrun to be
recycled, causing a short term memory-leak. We previously force recycled
the parcel when bundle.clear() was called.
This commit takes it a step further and adds reference counting for the number of
lazy values in mMap. When this reaches 0, we can safely eager recycle the
underlying parcel.
This still does not work when parcel references have been shared outside
the owning bundle (i.e, when mOwnsLazyValues is false.) We have two
options here:
1. Allow the GC to eventually claim the parcel (current behaviour).
2. Track lazy values refs globally across bundles. High complexity cost,
and likely high performance impact.
We can not unmwrap the lazy values before copying, in case the
originating classloader can not instantiate the given class type. See
go/lazy-bundle
In initializeFromParcelLocked(), renamed boolean parameter recycleParcel to ownsParcel since the method no longer recycles in all cases. Also, only create lazy values if ownsParcel = true so that we don't have lazy values referencing the passed in parcel in case the caller doesn't own the parcel (which means the parcel could be recycled out of our control).
Bug: 233216232
Test: Reproduced linked bug on-device
Test: atest android.os.cts.ParcelTest android.os.cts.BundleTest
android.os.BundleTest android.os.ParcelTest android.os.BundleRecylingTest
Change-Id: I8a878a6d0055b04b2611909b4b17977ba5677a4f
Some classes of devices will not have auto power save modes enabled. On
those devices, we should skip tests that require the modes be enabled.
Bug: 240108412
Bug: 240630396
Test: Manually go through CTS-V "Ignore Battery Optimizations Test"
Test: atest CtsUsageStatsTestCases:UsageStatsTest
Change-Id: Icc64fbe75213386a1f41fae258e50c4032920b0a
- original documentation for Parcel.unmarshall could be understood
both ways: Parcel written with bytes of data, data written with
bytes of Parcel
Test: Not applicable
Signed-off-by: danielzhang130 <danielzhang130@gmail.com>
Change-Id: I9afd3ae66ca03f391b272ac0524593395ffe53fa
The API has been no-op for 2 releases.
https://r.android.com/1352354
We should officially deprecate the API.
Bug: 238895989
Test: atest CtsOsTestCases:android.os.cts.DebugTest
Change-Id: Ib1454b200a0ae0da557de02c49c482145deb97df
Move network time logic out of AlarmManagerService in preparation for
a future refactoring. The TimeDetectorService is now a better home for
functionality associated with time signals, as it should receive most
time signals from various sources so it can determine whether the
device's system clock needs to change.
Although the TimeDetectorService is not currently informed every time
the NtpTrustedTime obtains a new time, it should be in future after
further work in later commits.
This change modifies the logic in SystemClock to match the GNSS time
logic in the same class, i.e. rather than calculating the "current time"
in the system server and then sending it over binder (introducing a
delay), the latest information needed to compute the time is sent to the
client, which then calculates the current time.
Bug: 219693030
Bug: 222295093
Test: atest services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
Test: atest cts/tests/tests/os/src/android/os/cts/SystemClockSntpTest.java
Test: Treehugger
Change-Id: I80ea52877352122b52ac54daed8b092f3cc18e02
This method clears the calling identity of a kernel
binder call. However, there is now a generic API to
disallow the use of kernel binder calling identities.
This is used by RPC binder calls in order to ensure
that code doesn't accidentally assume the default
(<pid>, <uid>) calling identity means that the call
originated from another process.
In the C++ layer, this API is attached to
IPCThreadState. In the future, we could consider
expanding the scope of this API to code and restore
many types of calling IDs, but the current return
type may not have enough space, and I want to
push people away from thread locals (globals)
for now.
Bug: 237245600
Test: N/A
Change-Id: I6e293814769cbd3c41e72afd95385af31ceb099f
Upon deserialization, various APIs would check that the passed in class
was assignable from the creator's enclosing class - which was assumed to
always be the Parcelable type.
This assumption is not always true, so updating the check to explicitely
store the parcelable type
Fix: 232589966
Test: m && atest ParcelTest && atest BundleTest
Change-Id: I59b650a854944e9020615a65798c5e54f5540aaa
Detect recycle called twice always (and when DEBUG_RECYCLE is on, we
detect recycle called twice or called zero times, and we show a stack).
Bug: 231799394
Test: manual (calling recycle twice)
Change-Id: I1dd9f392ee916edd9c598085a1c19dbdd3ce957f
Merged-In: I1dd9f392ee916edd9c598085a1c19dbdd3ce957f
Follow up to ag/18795008. Adding tests for new behaviour.
As it is not possible to directly check on the bundle if the parcel has been recycled,
we inject a spy into it. Mocking static methods is not possible in
FrameworkCoreTests, so we introduce a new test class in
FrameworksMockingCoreTests which is run when any parcel or bundle source
file changes.
Bug: 233216232
Test: atest BundleRecyclingTest
Change-Id: If691b68a8db1f0110d131ec620935f566cc9367b