Don't rely on the GC to clean up FD resources when they can
just be cleaned up immediately. We know the MemoryFile isn't
going to be used any further, so just close it.
Bug: 138323667
Test: Repro steps in bug. Verified addresses FD leak in system_server from repeatedly opening & closing settings.
Change-Id: Ic82006c9cb48f580aaad942c4679e774186382c9
Bug: 138422309
This reverts commit 390d9e6a18.
Reason for revert: crashes documented in b/138422309
Change-Id: I235f727d0fe87c09f6f05dddcae7759bab64dfd8
Bug: 138422309
This reverts commit 20ab1e3427.
Reason for revert: crashes documented in b/138422309
Change-Id: Ic9e33fdb24bad2b30f0eb357d6752c1834df41d5
We run the Cleaner in close, but after the fix in commit 6ca916a6, this
no longer clears the value stored in the FileDescriptor, which means
that subsequent operations on an explicitly closed SharedMemory will
operate on a bogus fd number. Clearing the FileDescriptor value in close
is sufficient, because Cleaner.clean is idempotent, and the only other
case where it executes is when the FileDescriptor is phantom reachable,
which means no one can access it to get its integer value.
Bug: http://b/138392115
Bug: http://b/138323667
Test: treehugger
Change-Id: I8bdb4c745466532a0712976416184c53fcf0dbf6
(cherry picked from commit a7641806dd)
Previously, the Cleaner we create to close the ashmem file descriptor
used a thunk that held a strong reference to the FileDescriptor we
wanted to clean up, which prevented the Cleaner from ever running.
Break the cycle by storing the integer value of the file descriptor
instead.
Bug: http://b/138323667
Test: treehugger
Change-Id: I613a7d035892032f9567d59acb04672957c96011
(cherry picked from commit 6ca916a657)
Previously, the Cleaner we create to close the ashmem file descriptor
used a thunk that held a strong reference to the FileDescriptor we
wanted to clean up, which prevented the Cleaner from ever running.
Break the cycle by storing the integer value of the file descriptor
instead.
Bug: http://b/138323667
Test: treehugger
Change-Id: I613a7d035892032f9567d59acb04672957c96011
- isHeadlessSystemUserMode() returns whether the device is running with
headless system user (go/multi-user-headless-user0)
- RoSystemProperties.MULTIUSER_HEADLESS_SYSTEM_USER is replaced by
isHeadlessSystemUserMode()
Bug: 137755681
Test: Bluetooth service and Network policy manager should work fine with
headless system user. A profile user should be created with headless
system user.
Change-Id: Ic48d98426f7a5ea47dde2008ae51f78855f622e6
This commit is mainly from I7a6a30bf8e8db9f2738594d187bb9148f138b8da, so
test cases and features are mostly same.
We change product_services partition name to "system_ext" because this
partition's purpose changes.
- installing a RRO package for framework from /system_ext/overlay
- installing apps from /system_ext/app
- installing priv-apps from /system_ext/priv-app
- installing permissions from
/system_ext/etc/[default-permissions|permissions|sysconfig]
Bug: 134359158
Test: `mma` under frameworks/base/tests/[libs|privapp]-permissions
adb sync && adb reboot
adb shell cmd package list libraries
=> confirmed com.android.test.libs.system_ext library
adb shell cmd package dump \
com.android.framework.permission.privapp.tests.system_ext
=> confirmed that the package is a priv-app
Change-Id: Ibbccbba64156a7bc464ffb3785fb8fe69ebb973c
Due to the restriction of Treble, update_engine cannot access to OTA
packages located on non-core domain area.
(e.g. /data/vendor/upgrade/xxx.zip)
To solve such problem, update_engine needs to accept a file descriptor
(FD) of OTA package file instead of its URI. Accordingly, UpdateEngine
also needs to add a new interface of applyPayload which accepts FD.
Test: Manual update
Bug: 130209137
Change-Id: Ic924445c4abf27fd7dc111c74b972ac7ff9ffa6b
Also HistoryItem does not need to implement Parcelable interface,
just like other batterystats classes, readFromParcel() and
writeToParcel() are pair of symmetric methods, but those classes do
not implement Parcelable interface because readFromParcel() is not a
method of readFromParcel() interface.
Change-Id: I5ac974c9903c5639a6bb52fc0a53367f92187af0
Fix: 135442392
Test: reboot device and "adb shell dumpsys batterystats"