Use the constant value from sys/system_properties.h,
rather than having two copies of this constant in two
different places.
This partially addresses the TODO in the header file.
Change-Id: Ic0b098cb8caf562ed2a25a0cf8cd412ba2e06884
* commit 'a817ff9cf61daeb69e8b8382c80677e3e5c573a9':
Add flush_my_map_info_list() and fix a bug in the Mac load_map_info_list().
Add basic Darwin support to libcorkscrew.
(If you fclose(3) rather than pclose(3) a FILE* you got from popen(3),
future popen(3)s fail obscurely, at least on Mac OS.)
(cherry picked from commit 2bf76e143da933184d1392fb9bea3a3896c37e76)
Change-Id: I5578fe06753061b0dbc5ee951ebf31eb2bab0389
This change adds a trace tag bit for Dalvik. It also allows the ATRACE_*
macros to be called from code compiled for the host with no effect.
Bug: 8856374
Change-Id: I9c17129d6cc170cae00b6500485b5b5fa4b5e647
Removed unused code and moved libraries with single clients
near their respective users.
Change-Id: I65f90f8659f27bd0f44ca5ddf33da2bce14674c1
Signed-off-by: Dima Zavin <dima@android.com>
DBUS had been needed by bluetooth bluz stack. It is not needed after
we replaced bluez stack with bluedroid stack.
bug 6872904
Change-Id: I3fa41c1dd4ac80bc679d5950b3b20c7f6d12265f
Move the responsibility for rebooting the system from the
reboot command to init. Init is in a better position to take
actions to bring the system down cleanly, including making sure
filesystems are mounted read-only.
The only UIDs which can perform an init triggered reboot are
root, system, and shell.
Modify the reboot command so that it calls into init to perform
the reboot. The reboot command no longer requires CAP_SYS_BOOT.
Remove the -n reboot option and code which supports it. Anyone needing
to do an unclean shutdown can just do a 'echo c > /proc/sysrq-trigger'.
Modify adb so that it calls into init to perform a shutdown.
Bug: 8646621
Change-Id: I84c0513acb549720cb0e8c9fcbda0050f5c396f5
This change adds the atrace_set_tracing_enabled call to libcutils. The call
can be used to disable all tracing (of the atrace variety) for the current
process. This is to be used to disable tracing in the Zygote process, as there
is no way for Zygote to be notified of changes to the enabled trace tags.
Change-Id: I0b691cc0dcfc65b16e3d17e1db2866a4deb253a7
- adds a library to compute the SHA-256 hash
- updates the RSA verifier to take an argument specifying either SHA-1
or SHA-256
- updates DumpPublicKey to with new "key" version numbers for
specifying SHA-256
- adds new argument to adb auth code to maintain existing behavior
Change-Id: I5b1406cf57c2b8993f6032eda3e29139f7740839
This change adds support for tracing using the ATRACE_TAG_APP tag. This tag is
enabled only for processes in which the /proc/<pid>/cmdline value appears in
the comma-separated list of such values in the debug.atrace.app_cmdlines system
property. It is also only enabled if either the ro.debuggable system property
is set to 1 or the application has declared itself debuggable in its manifest,
which gets reported to libcutils by the framework.
Change-Id: Ic94ba55f4e70a9cf994056acbf151e523428b65d
Set the CAP_SYS_BOOT filesystem capability on the new reboot
command and keep CAP_SYS_BOOT in adb bounding set so that the
shell user can run it.
Change-Id: I1dd6143445ee2a952254f0452ab6e544318431dd
We assume ARMv7 which with thumb2 has ldrex/strex operations that may be
inlined if -mthumb is defined.
Remove remnants of ARMv5 support.
(cherry picked from commit 80c3b278fd)
Change-Id: I194a3d08e933c63f79d48288d9235b4e64099340
Make /vendor have the same permissions as /system/vendor for devices
that have a vendor partition.
Bug: 8341435
Change-Id: I077a2caf9da41fc072a4d3e334be28c24b70c7cd
/system/bin/ping no longer requires CAP_NET_RAW, as we're now
using IPPROTO_ICMP. Please see the following for more details:
* http://lwn.net/Articles/443051/
* https://android-review.googlesource.com/52090
* https://android-review.googlesource.com/52072
We can now make ping a normal, unprivileged program.
/system/bin/run-as only requires CAP_SETUID and CAP_SETGID.
Explicitly set the capabilities of this file, and remove
the setuid bit.
This is equivalent to running the following commands:
* chmod 750 /system/bin/run-as
* chown root:shell /system/bin/run-as
* setcap cap_setgid,cap_setuid+ep /system/bin/run-as
Change-Id: I65df858b45e6de4e2190ac9d6d592c06ea9d28cf
For now, remove linux/capability.h . We're haven't started using
capabilities yet, and this file doesn't exist on mac builds.
Change-Id: Id6ec7fdb408bcdfdd538dac65187194c8ee226ff
Modify android_filesystem_config.h and add a capabilities
field. This field can be used to add filesystem capabilities
to a particular file.
Change-Id: If8953a322457ea7275aa6df75660b714e6dc678a
Don't depend on sys/cdefs.h, which doesn't exist when building
for the host.Don't try to compile property_len() checking code
in mingw32, it doesn't work.
Change-Id: I6a56b759bd4e8d30d6ca136e43d6515bf7408cc6
# Via Gerrit Code Review (1) and Ian Rogers (1)
* commit '78432ab1f42d59fed474365b95b7501dcccacebf':
Inline ldrex/strex for thumb2, remove ARMv5 remnants.
We assume ARMv7 which with thumb2 has ldrex/strex operations that may be
inlined if -mthumb is defined.
Remove remnants of ARMv5 support.
Change-Id: I9bb9525ae6ff4816ba391115019d841f63c12348
Try to verify, at compile time, that the supplied
value buffer is large enough.
There's more we can do here, but this is a good first
pass.
Change-Id: Iac8153826c89114b2755735032423c6744f7a61b
The last caller of this code was removed in
dalvik commit eb1703442f3fc0577b3395b7eb4d55300b4125db
(https://android-review.googlesource.com/50689)
Change-Id: I3f4865c02092752a13369a3b2c3289fc9a4f6a62
Added a value to audio_channel_mask_t enum for front + back mic
combination to allow parsing of audio_policy.conf file by audio
policy manager.
Change-Id: I8412b4d3cfc03323eff867563a1a73322019c0f3
(cherry-pick of d03072ffde. This change
was originally committed to AOSP, is in internal master, but was somehow
lost from AOSP.)
Bug: 7012465
Conflicts:
libcutils/Android.mk
Change-Id: I08ee8eb9b8ce5d3f9d8f2e67437d653e08697bc1
Modify libusbhost to expose the inotify watch descriptor to clients
This modification permits clients to add the watch descriptor to
their polling loop so that they don't have to use a dedicated
thread only for libusbhost.
Change-Id: I615bfcd56beab978135034b228d4d93337351eab
Signed-off-by: Guillaume Ranquet <guillaumex.ranquet@intel.com>
Signed-off-by: Luc Piguet-Lacroix <lucx.piguet-lacroix@intel.com>
The various atomic operations are declared as inline in the header files
to cut the function call overhead. However, the plain inline keyword is
just a suggestion to the compiler which makes its own decision on whether
to inline them or not. Worst, if they are not inlined, the
-fvisibility-inlines-hidden compiler flag will render them as hidden
symbols in the object file. If they are picked up by the linker over the
ones supplied in libcutils.so the following warning will be reported:
warning: hidden symbol 'android_atomic_inc' in foo.o is referenced by
DSO bar.so
One way is to add __attribute__((visibility("default"))) to those inline
functions to suppress the linker warnings. A better way is to force
inlining as with this patch.
Change-Id: Ie4fcfdfaaf06f42d351619a0d89671a9df15ca2f
This will eventually allow us to remove the code in
logd_write.c#__android_log_write which uses the tag
to direct logs to the radio buffer.
Change-Id: Ic992c0b8d1cf000b1814dc7786d2a40becf75eaf
With inline atomics, trace functions have no non-inline function calls
in the fast (tracing off) path. To enable this, ANDROID_SMP must be
defined for the project. Otherwise, normal (non-inline) atomics are
used.
Change-Id: Id1f75bdf7db2f5d319a389ad411f55073d78c48c
Adds a function to read the current trace system property value, and
sets the trace tags to it, do be used as a sysprop change callback.
Change-Id: Ia6336652173aa5b07188898736c2c795a69fe79a
Basic tracing functionality to cutils, which can be turned on at start,
or dynamically controlled by the frameworks. The goal is for hardware
modules to add tracing that will be controlled by their respective
services.
Change-Id: I84eeb7d6be0038f734e719074fa4a2fae4ffe9c0
This will eventually allow us to remove the code in
logd_write.c#__android_log_write which uses the tag
to direct logs to the radio buffer.
Change-Id: Ic992c0b8d1cf000b1814dc7786d2a40becf75eaf
Needed to support tethering of multiple remote Bluetooth devices.
Change-Id: I9f736affd83226e8b2fa4f0faacd3654175dd8c9
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
clatd(464xlat) runs as its own UID after it drops root privs
Change-Id: I2392f8127dcd90d16b0f20ff31bcc5aa096db464
Signed-off-by: Daniel Drown <dan-android@drown.org>
The volume and routing policy of AUDIO_STREAM_ENFORCED_AUDIBLE is
now controlled by AudioService by means of new forced use type
AUDIO_POLICY_FORCE_FOR_SYSTEM with config
AUDIO_POLICY_FORCE_SYSTEM_ENFORCED.
Bug 7032634.
Change-Id: Ib1834ec507f3aa726895b8fd3e8a91cc9cc601a7
The dequeueBuffer_DEPRECATED function also waits for the buffer fence,
so we can just call that. That way the wait call is compiled into our
code (instead of driver code) and we can see/modify it for debugging.
Bug: 7217641
Change-Id: Ie2ea85ed1543a4ff7986d0162aee773e93591309
Each audio device is identified by a bit in a 32 bit field with
16 bits for output devices and 16 bits for input devices.
The number of output devices is now exhausted.
In order to add new devices a new convention for audio device
identification is defined, allowing 31 different input and output
devices: Bit 31 of the bit field is reserved and when set indicates
an input device.
Also added new output device for wifi display and new input devices
for digital and analog docks, USB and wifi display send.
Change-Id: I849bec0b6d46e082e325a3f08890d313c8dc763b
A remote submix is an audio mix of audio streams that
are not going to be played directly through the platform mix,
but rather will be mixed together to be handled in a
different manner. This mix can be obtained by recording
it through the AUDIO_IN_REMOTE_SUBMIX and presenting it
remotely (as opposed to local playback == on the device
itself).
All changes marked "temporary" will be overriden by the
changes to update the audio device definitions for
the 2.0 API.
Change-Id: I9c6da607fc50b7b8545d189ac5b083107369cfb5
This change adds a new HAL pixel format that indicates that the specific format
is to be chosen by the gralloc implementation.
Change-Id: I326b5ec7347a20863b42119431ef1e4d22480fec
Define /storage as top-level concept, so that we enforce permissions
uniformly. Moves external storage paths from headers to per-device
environment variables. Added missing mount flags, and we no longer
have adb-specific external storage.
Bug: 6925012
Change-Id: Ic7ca953be2f552d3f0ec9e69f89fef751daa1b29
Remove mspace functionality from cutils.
Directly declare mspace from dlmalloc in code flinger's code cache, and
manage without using morecore.
Depends upon: https://android-review.googlesource.com/41717
Change-Id: If927254febd4414212c690f16509ef2ee1b44b44
Also remove mount() from adb, since it can come online long before
data partition is ready. Set EXTERNAL_STORAGE environment variable
to point to owner for backwards compatibility.
Bug: 7005701
Change-Id: I63444f6636624eb7ad89f053daa289663424639e
Remount rootfs as recursively shared, so that mount changes are
propagated into child namespaces. Mount external storage for access
from adb.
Clean multi-user dependencies for use in Dalvik. Also define
external storage paths.
Bug: 6925012
Change-Id: I375de581a63f4f36667894c56a34a9dd45361e8f
Code using ifc_reset_connections api needs to have access to
predefined masks for reset_mask parameter
Change-Id: I90bc5e1b62ae4a88501c8ad4e353c0d93d319579
The output produced by DumpPublicKey now has a version tag on each
line (ie, each key). The existing keys are retroactively dubbed
"version 1", and we add a version 2 for 2048-bit e=65537 keys.
Change-Id: I204ec615c8f2346670220a1aeb99269e4abd5f81
Declare audio_devices_t as uint32_t to permit bit operations,
and a separate anonymous enum for the constants. This is similar to
audio_channel_mask_t.
Also remove spurious "typedef" on declaration of anonymous enum for
channel mask constants.
Change-Id: Ib4f92e9168261d44a475b3d48fe211e5c70ed441
Also add ion_alloc_fd helper for when you only want a filedescriptor
and know you won't need to access this handle again by its ion_handle
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
Change-Id: Ia4bae22946b0078084b62f5447fecbf261dfaa83
Code using ifc_reset_connections api needs to have access to
predefined masks for reset_mask parameter
Change-Id: I90bc5e1b62ae4a88501c8ad4e353c0d93d319579
This change deprecates the existing queueBuffer, dequeueBuffer, lockBuffer, and
cancelBuffer functions, and replaces them with a queueBuffer, dequeueBuffer,
and cancelBuffer function that accepts or returns a libsync fence file
descriptor. It also adds the native_window_dequeue_buffer_and_wait convenience
function.
Change-Id: Ifaac91164d014993d7d1d96e0303e04e429f4d00
This change removes the #includes of "linux/*.h" headers from the libsync
header. It currently does this by copying the needed structs that are in the
linux headers. This is intended to be a temporary solution.
Change-Id: Ie7e1a8e05fcf8809ba4aa0e2427efe141dae5327
This format describes buffers that are not structured like normal
image data, and can only be meaningfully understood by the endpoints.
As an example, this format is used for transporting JPEG-compressed
image buffers from the Camera HAL to the framework/apps.
Buffers of this format must have a height of 1 and a width equal to
their size in bytes. Otherwise their interpretation is up to the two
endpoints.
Bug: 6243944
Change-Id: Ia81015694cbf3a89e29bfbf3624c3ea2ef4f66fd
Provides a new mechanism for dumpstate (while running as root)
to request that debuggerd dump the stacks of native processes that
we care about in bug reports. In this mode, the backtrace
is formatted to look similar to a Dalvik backtrace.
Moved the tombstone generating code into a separate file to
make it easier to maintain.
Fixed a bug where sometimes the stack traces would be incomplete
because we were not waiting for each thread to stop after issuing
PTRACE_ATTACH, only the main thread. So sometimes we were missing
traces for some threads.
Refactored the logging code to prevent accidentally writing data
to logcat when explicitly dumping a tombstone or backtrace from the
console.
Only root or system server can request to dump backtraces but
only root can dump tombstones.
Bug: 6615693
Change-Id: Ib3edcc16f9f3a687e414e3f2d250d9500566123b
Added FORCE_NO_BT_A2DP forced use to allow applications to
override default policy to use A2DP whenever connected.
Bug 6485897.
Change-Id: I0039232ea6cce4121f375961b2c153d1a0d92e49
It's safe to change the permissions on files in the root partitions;
incremental OTA now knows how to handle this case.
This reverts commit 08c370cc50.
Change-Id: I503bf8ebd037fa9715494c6539e5430eee47acfe
This change replaces the set_active_rect function with set_post_transform_crop.
There is a temporary set_active_rect function that calls
set_post_transform_crop for compatibility while commiting to multiple git
repositories.
Change-Id: Ia7c171186fd277d5a36f6068ace93a9ce1c82d28
Instead of specifying in init what to mount, and having various hacks in init
itself to deal with encryption, use a filesystem manager library to do the
work, that can also be invoked by vold when mounting an encrypted volume.
Keep all the magic filesystem info an a device specific fstab file.
Change-Id: Ib988f1e4fb0638ba1d5fd98407fa6d8cf862aaca
This change clarifies in the ANativeWindow perform docs which perform calls are
private to the framework and should not be made by code below the HAL level.
Change-Id: Ibfeba0760d9a3f74996e6358d5ad89a408f80dfe
This change makes it clearer how to derive the stride of the Cr and Cb plane
from the stride of the Y plane for the YV12 pixel format.
Change-Id: I54a9a20f35224bd583e25c615014cc8d830a1dd0
It's up to the protocol to know when quotes are required. In the future
the response should probably all be binary blobs with lengths.
bug:6353048
Change-Id: I3f9b48ab0f4e6746d75cdc9c0c84d33f38f63661
Also tid == 0 maps to gettid() on platforms that support it.
This is needed by mediaserver code that was formerly using
the old C++ API.
Change-Id: I8baaa3e42315c9b924cec26b6da01e7cb69e0078
Add a value in audio policy flags to indicate an output
stream providing deep audio PCM buffers. Such an output
helps reducing the power consumption at the expense of audio latency.
Stagefright will indicate a preference for such an output when playing music
only (no video) and the audio duration is more than a given threshold.
Change-Id: I0e6a9f5746a22d2bfea2b21dd182489a34a4b528
Removed obsolete AUDIO_POLICY_OUTPUT_FLAG_xxx flags definition.
All project mmust use AUDIO_OUTPUT_FLAG_xxx flags from system/audio.h
Change-Id: Ib374dee96afcf176df35d9a621be02ce0e30caf5
Used to talk to kernel synchronization framework
Change-Id: I66e1f4a90f5d58d384bf1cec09db52101f182c5e
Signed-off-by: Erik Gilling <konkers@android.com>
Added definitions for output flags needed by new audio
HAL device API.
These flags where previously defined in audio_policy.h.
Definition in audio_policy.h remains temporarily until
all projects are changed to use new flags.
Change-Id: I371558c78050daae73942a36f51854372ab71068
This format is exposed outside of the HAL to applications.
RAW_SENSOR is a single-channel 16-bit format, typically representing raw
Bayer-pattern images from an image sensor, with minimal processing.
The exact pixel layout of the data in the buffer is sensor-dependent, and
needs to be queried from the camera device.
Generally, not all 16 bits are used; more common values are 10 or 12
bits. All parameters to interpret the raw data (black and white points,
color space, etc) must be queried from the camera device.
This format assumes
- an even width
- an even height
- a horizontal stride multiple of 16 pixels (32 bytes).
Change-Id: I67fc72d1c2c899e258fcd53b3ab91b459e9210f0
NATIVE_WINDOW_SCALING_MODE_CROP forces the SurfaceTexture
to match the crop rect's aspect ratio to that of the window.
Change-Id: Id126b106eac06fd34d2d650a1bc66ffbac26c501
xt_IDLETIMER events are used to infer the interface (radio) state
based on a inactivity timeout value.
Change-Id: I755eb54a048ca1c6ce0c646564d61188d8241851
Add token and wrapper function for a new private function
native_window_set_buffers_user_dimensions which overrides the native window
size as the default buffer size. This is intended for use primarily by
ANativeWindow_SetBuffersGeometry so that application-set buffer dimensions may
co-exist with pre-rotation in e.g. the GLES driver which calls
native_window_set_buffers_dimension.
Change-Id: I6c0fc334c070290cc15b04daae1484d0a28cd8ad
This change adds a layer of indirection to uevent's
uevent_kernel_multicast_recv, allowing dependent code to
get the remote endpoint if desired.
Change-Id: If2f00708a1dd6196c415b1ebc2a7eeb72399a90e
Android's kernel logger can optionally return UID information
in addition to the previously returned information. This
information is available by telling the kernel to use the
updated structure via the newly introduced LOGGER_SET_VERSION
ioctl.
int fd = open("/dev/log/main", O_RDONLY);
int version = 2;
ioctl(fd, LOGGER_SET_VERSION, &version);
Change-Id: I6bfe7bfb9df45a56124aa8d0d19e7d7a18e06862
Android's kernel logger can optionally return UID information
in addition to the previously returned information. This
information is available by telling the kernel to use the
updated structure via the newly introduced LOGGER_SET_VERSION
ioctl.
int fd = open("/dev/log/main", O_RDONLY);
int version = 2;
ioctl(fd, LOGGER_SET_VERSION, &version);
Change-Id: I3914be41de55342c2918f8978fcd4d2b96a09288
qsort_r() is declared differently on BSD and GNU libc and
may be absent on other platforms.
Provide qsort_r_compat() which should work everywhere.
Change-Id: I17a9026573b1ed971ff7d79895e7eb41ba108807
This will make it easier to add additional policies (cgroups) if needed.
Also added comments to the sched_policy APIs.
Change-Id: I33ce1cc4deae10983241f7391294b7a512d2c47c
The problem is both face unlock and camera application try to open
the hardware camera at the same time. A new camera open API is
added to let face unlock take the camera away from the existing
client. The release message is used to notify the existing client,
so it has time to release the hardware camera and clean up.
If existing client tries to use the camera after it is released,
the method will return error. It is still possible that the
camera has been taken and the existing client has not got the
notification. When any method returns error, the existing client
can use ping command to check whether the camera has been released.
If yes, the client can silently finish the app itself or show a
toast if it wants.
bug:5584464
Change-Id: I87f9f7db2f7b2b70ab2405f9b3da0d8946d6a01b
Sending 3digit code, null, binary-length and data. Current code sends
3digit code, space, null, binary-length, binary-data.
The space should not be sent.
Change-Id: I1df00a3e70805b39b6105966c7f3c613461a6858
Added a flag for output stream attributes indicating a primary
audio output stream.
The primary audio output stream is unique on a platform and receives all volume,
routing and parameters related to telephony use case.
Change-Id: Ic50b3c02cc60805031f26b819da6cf9ad65ad11c
Add a utility function to SocketClient to send a c-string code
prepended to a binary message. This is necessary to be able to
send a binary message while keeping compatible with underlying
text-based protocol.
Change-Id: Ifc6562003a687577d7deb50260533a5147ae4f97
Allows for one socket to be multiplexed for multiple requests.
Doesn't use command sequence numbers for broadcasts - would make no sense.
Doesn't alter current default behavior so OEM's using these classes
won't notice a difference.
bug:5864209
Change-Id: Ie3b19c4f81eea868569229a365c8cb7de249c2dd