This reverts commit 62242bdca3.
Reason for revert: ramdumps on ToT related to battersystats parcel parsing
Bug: 243434675
Change-Id: I18522929f5a1499f56a0cc19606c28a2ed9fc26d
Introduces a UserProperties class, which holds (potentially dynamic)
information about each user, where the (default) values depend on the
user type.
This can usually be used instead of
isManagedProfile() calls, giving fine-grained information, rather than
course-grained queries about the user type.
The system copies this object before delivering it to any callers,
filtering the properties by the permissions held by the caller.
The object can be parsed from XML, which is used for both persisting a
user's properties to disk, as well as for reading in the default
properties for each user type.
Bug: 235065648
Bug: 237399048
Bug: 170249807
Bug: 234439331
Test: atest UserManagerServiceUserPropertiesTest
Test: atest android.multiuser.cts.UserManagerTest
Test: atest com.android.server.pm.UserManagerTest
Test: atest UserManagerServiceUserTypeTest
Change-Id: If37480abafa784ce197b482103b6537a60fe2653
Apps are able to prevent their death by forking multiple processes
under different services and monitoring for the death of any of these.
When a child death is detected, the remaining process restarts the
terminating/terminated service before it's able to be killed itself.
This is now prevented by freezing the entire cgroup of the package to be
killed before killing the individual processes. After the kills are
completed synchronously, the cgroup can be unfrozen to allow for
restarts. Before freezing the cgroup, the binder interfaces of the
processes about to be frozen are also frozen to prevent indefinite
blocking by synchronous Binder callers.
Bug: 236708592
Test: raven:/ $ monkey -p com.haok.nirvana 1
Test: bash arg: -p
Test: bash arg: com.haok.nirvana
Test: bash arg: 1
Test: args: [-p, com.haok.nirvana, 1]
Test: arg: "-p"
Test: arg: "com.haok.nirvana"
Test: arg: "1"
Test: data="com.haok.nirvana"
Test: Events injected: 1
Test: ## Network stats: elapsed time=14ms (0ms mobile, 0ms wifi, 14ms not connected)
Test: raven:/ $ ps -eo pid,uid,ppid,name|grep 10266
Test: 2499 10266 823 com.haok.nirvana
Test: 2577 10266 823 com.haok.nirvana:resident
Test: 2584 10266 823 android.media
Test: 2669 10266 1 app_d
Test: 2672 10266 1 app_d
Test: raven:/ $ am force-stop com.haok.nirvana
Test: raven:/ $ ps -eo pid,uid,ppid,name|grep 10266
Test: 1|raven:/ $
Change-Id: I06aaa5a082f7b4923c6d9d1055bcf326e5eae67e
The cameraserver has a need for attributing connect calls to particular
processes. This patch introduces pids as a property of an
AttributionSource.
Test: Smoke test on cuttlefish
Bug: 190657833
Bug: 199526514
Change-Id: I6cdffed62447bbb741290dd9c2e5937254d02e3c
Bug: 242230266
Test: atest FrameworksServicesTests:BatteryStatsTests
NoNonSdkCheck: BatteryStats.getHistoryBaseTime was only used locally within BatteryStats itself. It was assigned to an unused variable, so removing this method is a no-op
Change-Id: Ib132f3e0a13d639c02e51188358fb4525b00ca9c
- Adds hidden API on ActivityManager
- Checks if feature is supported
- Adds shell command to check if user is visible
- Includes (visible) on 'cmd user list -v'
Test: atest CtsMultiUserTestCases:android.multiuser.cts.UserManagerTest#testIsUserVisible_backgroundUserOnSecondaryDisplay
Test: m update-api
Test: adb shell cmd user is-user-visible --display 0 cur
Bug: 239982558
Change-Id: Ie7fe8c832ef2a3ffe4869a67fd35a0da363d0039
When maximum non-guest users were created, button to create guest user disappeared. Button appearance conditions are now updated to fix this issue.
Bug: 232077675
Test: atest UserManagerTest
Change-Id: I3e90c5faac9b63e100f7b3f121d5b78170dd48b3
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
Add millisSinceLastUserActivity and lastUserActivityEvent to PowerGroup log when dozing.
Add timeout to PMS log when dozing.
Bug: 234530184
Test: atest BatteryStatsTests
Test: atest PowerManagerServiceTest
Test: manually observe logs using logcat / adb bugreport
NoNonSdkCheck: USER_ACTIVITY_TYPES is only accessed indirectly by apps through dumpLocked() method.
Change-Id: I835992a08bd4a07350e36ef671c6273c8fee43a0
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
UserManager currently always uses getApplicationContext for its
internal context object, but that method can return null under certain
circumstances. This CL adds a null check, so that the original context
is used if the app context is null.
Bug: 232179155
Bug: 233915566
Test: atest UserManagerTest
Test: install Apex Launcher and App Hider on device with work profile
Change-Id: I26bcf693da8f5bc53126f79f9e6ffb17bd87fc84