Now that Result<T> is actually expected<T, ...>, and the expected
proposal states expected<void, ...> as the way to indicate an expected
object that returns either successfully with no object or an error,
let's move init's Result<Success> to the preferred Result<void>.
Bug: 132145659
Test: boot, init unit tests
Change-Id: Ib2f98396d8e6e274f95a496fcdfd8341f77585ee
The old "time zone updates via APK" feature installs time zone data
files in /data. tzdatacheck is run during boot to guard against an
OTA leaving the data in /data older, or in a different format, than the
files that exist elsewhere on device. If such files existed the system
could use old versions of tzdb (and related) data or even end up
unstable.
Soon, the time zone data mainline module will be made "functionally
mandatory" by the removal of most time zone data files from the
runtime module APEX, i.e. the time zone data module cannot be absent,
and the runtime module won't have files to compare against.
This change modifies the command line args for tzdatacheck to reference
the contents of time zone data module instead of the runtime module.
Bug: 132168458
Test: Build / boot / inspect logcat
Change-Id: Iac8023b7cbb72213df344d603c121caa867a196f
This change fixes a bug that *.rc files in APEXes are not read when the
APEXes are flattened. This was because init used "/apex/*@*/etc/*.rc"
glob pattern to find the files, which gives 0 result with flattened
APEXes; with flattend APEXes /system/apex is just bind-mounted to /apex,
and therefore, the name@version directories don't exist.
Fixing the issue by globing /apex/*/etc/*.rc and filter-out the paths
with @ to avoid double parsing the *.rc files in case of non-flattend
APEXes.
Bug: 134067086
Test: revert I75ec6b69cca1cef071b50fac9a4cf8b8ceddb142
build sdk_gphone_x86_64 and record a video in the camera app.
The recording works. `ps -A | grep media.swcodec` shows media.swcodec process.
`atest CtsStatsdHostTestCases:android.cts.statsd.atom.UidAtomTests#testAudioState` passes
Test: build sdk_phone_x86_64 and do the same.
Change-Id: I00af1910a8e8a330addc4c6903e5f3695aeb6865
I was looking for 'MmapFile' earlier and couldn't find it. After
being pointed to it, we thought that adding this synonym would help
others trying to find this file.
Test: n/a
Change-Id: I7fbfd8e090f21183a5de3603a76f884562b99c4a
uidToName() originally used a separate worker thread with additional
group permissions. Threads are not security boundaries however, so
these group permissions are removed in a previous change.
This change handles the lookup for uidToName() directly without using
a separate thread.
Test: boot CF, logd unit tests
Change-Id: If245388bc221bc77102a0bbcee82c8f42b140760
These tend to get manually, so let's promote to actual helpers.
Bug: 134536978
Test: liblp_test gtest
Change-Id: Ifb79c8d6f247cc3f9635bf6adfd1c99907340002
On Android, unlike POSIX, groups and capabilities are able to be set
per thread. This is useless however, since threads are not a security
boundary. This change drops the logic to set groups and capabilities
per thread and instead leaves all threads running with the initial
user and groups.
This does still drop some capabilities if they're unneeded due to
features being disabled.
This also moves the setpriority() call from code into the init script.
Test: logd runs with the expected user/groups and with the expected
capabilities and priority without any errors
Change-Id: Ibb0e529ea1574a2b8ec391a2678504ca9fbe19be
Move these from toybox as they're Android specific and more easily
maintained here.
A few changes during the conversion:
* Report error in setprop if value is not a UTF8 string; this would
previously fail only after attempting to set the property
* Inform users to check dmesg for further failure messages for all
three programs
* Only start/stop zygote_secondary if the device is not single arch
Bug: 117321744
Bug: 133901248
Test: setprop works, start and stop work on single and multi-arch.
Change-Id: Id2194cf2b65221bde38aff91f0e86b33edb37f42
There is no reason that rlimits cannot be set earlier than they are,
and apexd-bootstrap may want to set the priority service option, which
would require that these rlimits have been set, so we move these to
the beginning of early-init.
Bug: 134668377
Test: apexd-bootstrap can set the priorty service option
Change-Id: I8040190cd4dc5e141784496ae65cfab80d9cad53
The Result, Error, ErrnoError are quite generic. Moving them from init
to libbase so that they can be used from other places.
Bug: 132145659
Test: libbase_test
Change-Id: Id774a587f74380fadd7a0fc88c0aa892c3d9a489
As of Android-P, __system_property_set() is synchronous and only will
return '0' if the property was successfully set.
Test: n/a
Change-Id: Icbc0a6d8be1ae683565f378c534ea8e5c5f25357
Which will dump all the allowed properties, similar to `adb shell
getprop`.
Bug: 134027350
Test: Run the command under rescue mode.
Change-Id: Id668224098006d71ee192c8c2bea5d791d2423c1
* changes:
adb: daemon: Assign valid fd to usb_handle ep0 file descriptor
adbd: respond to device-to-host control transfers.
adbd: read, print, and ignore USB control transfers.
When adding a dex frame, no offset is ever printed even if the dex data
is coming from a non-zero offset map. Fixed so an offset is printed
in this case.
Previous the line looked like this:
#17 pc 0000000000500d7a /product/app/GoogleCamera/GoogleCamera.apk (com.google.android.libraries.camera.async.AndroidPriorityThread.run+10)
Now looks like:
#17 pc 0000000000500d7a /product/app/GoogleCamera/GoogleCamera.apk (offset 0x11d0000) (com.google.android.libraries.camera.async.AndroidPriorityThread.run+10)
Add new unit test for this case.
Bug: 134420076
Test: Wrote new unit test, and verified a non-zero offset for dex file
Test: data results in a frame with a non-zero offset.
Change-Id: I58c134fda4fad5456ca0f1723192667a1ca5d509
We recently changed 'xfer' to a size_t, so update the DBG format
accordingly. We also fix a long standing issue with format for
the unsigned 'read'.
Test: TreeHugger
Change-Id: I3dc5f26a033fea64119016802bc9cdb54bbb7b52
After flashing empty image to scratch device, the device did not
return after 3 minutes. It also did not collect any triage data
reporting only:
[ FAILED ] did not reboot after flash
Add triage data, increase timeout to 4 minutes.
Test: adb-remount-test.sh
Bug: 132070014
Change-Id: Ic607abb5b2575d630bf6c27817a38a90820d24e1
If we just disabled verity, take the step to setup the backing
storage for overlayfs.
Test: adb-remount-test.sh
Bug: 130131892
Change-Id: Ic56569eaf363e4417a0ce5df11ee5480a07b8b03
This works around a deadlock when a bridge that is about to be closed
is reused for a new call to openFile. The call to open() ends up holding
the vold lock, waiting for appfuse to respond. The appfuse event loop
calls onClosed(), which ends up calling vold.unmountAppFuse(), which
cannot get the lock.
Closing this file descriptor causes any current calls to open() on its
mount path to fail with either ECONNABORTED or ENOTCONN, allowing the
event loop to make progress, call onClosed() and unmount the path.
Note that the failed call to open() will result in a retry, which
will create a new appfuse bridge. This is not ideal but not a new
problem -- the common case here is that that each call to
openProxyFileDescriptor creates a new bridge. This should ideally
be improved.
Bug: 132344997
Test: flick through info of photos with location info attached
Change-Id: I878e5cf86f18c5233f8505f52eb9db076bd72d01
Merged-In: I878e5cf86f18c5233f8505f52eb9db076bd72d01