Commit Graph

982 Commits

Author SHA1 Message Date
Jeff Brown 4d643d6fdb Fix include paths.
Change-Id: Ifda45688f9f02710a74d5d7a7d902bacf1441e2e
2013-07-30 13:56:53 -07:00
Jeff Brown 66db68948c Native input dispatch rewrite work in progress.
The old dispatch mechanism has been left in place and continues to
be used by default for now.  To enable native input dispatch,
edit the ENABLE_NATIVE_DISPATCH constant in WindowManagerPolicy.

Includes part of the new input event NDK API.  Some details TBD.

To wire up input dispatch, as the ViewRoot adds a window to the
window session it receives an InputChannel object as an output
argument.  The InputChannel encapsulates the file descriptors for a
shared memory region and two pipe end-points.  The ViewRoot then
provides the InputChannel to the InputQueue.  Behind the
scenes, InputQueue simply attaches handlers to the native PollLoop object
that underlies the MessageQueue.  This way MessageQueue doesn't need
to know anything about input dispatch per-se, it just exposes (in native
code) a PollLoop that other components can use to monitor file descriptor
state changes.

There can be zero or more targets for any given input event.  Each
input target is specified by its input channel and some parameters
including flags, an X/Y coordinate offset, and the dispatch timeout.
An input target can request either synchronous dispatch (for foreground apps)
or asynchronous dispatch (fire-and-forget for wallpapers and "outside"
targets).  Currently, finding the appropriate input targets for an event
requires a call back into the WindowManagerServer from native code.
In the future this will be refactored to avoid most of these callbacks
except as required to handle pending focus transitions.

End-to-end event dispatch mostly works!

To do: event injection, rate limiting, ANRs, testing, optimization, etc.

Change-Id: I8c36b2b9e0a2d27392040ecda0f51b636456de25
2013-07-30 13:56:53 -07:00
Mathias Agopian 24ed9052bd Fix a typo in Singleton<>
it could cause the sLock field to be emitted several times
in different compilation unit. it also prevented to
have 2 Singleton<> in the same file.
2013-07-30 13:56:53 -07:00
Mathias Agopian 9b0be73f2a added RWLock C++ wrapper
Change-Id: Ia736bf7f6e2c49915a9ab5669551cf89dafa7961
2013-07-30 13:56:53 -07:00
Kenny Root c2b77d2fad ZipUtilsRO rewrite based on Dalvik Zip rewrite
Change the way zip archives are handled.  This is necessary to deal with
very large (~1GB) APK files, for which our current approach of mapping
the entire file falls over.

We now do the classic scavenger hunt for the End Of Central Directory
magic on a buffer of data read from the file, instead of a memory-mapped
section.  We use what we find to create a map that covers the Central
Directory only.

If the caller is interested in unpacking the file contents, we have to
do an additional file read to discover the size of the Local File Header
section so we can skip past it.

This is based on Change I745fb15abb in the dalvik tree. Both
implementations share a common ancestry, but the cost of unifying them
outweighs the benefits of wrapping C calls.

Change-Id: Iddacb50fe913917c2845708a530872d65fdbe620
2013-07-30 13:56:53 -07:00
Dianne Hackborn 88e4960025 New xlarge screen size.
Not complete, only for experimentation at this point.

This includes a reworking of how screen size configurations are matched,
so that if you are on a larger screen we can select configurations for
smaller screens if there aren't any exactly matching the current screen.

The screen size at which we switch to xlarge has been arbitrarily
chosen; the compatibility behavior has not yet been defined.

Change-Id: I1a33b3818eeb51a68fb72397568c39ab040a07f5
2013-07-30 13:56:53 -07:00
Mathias Agopian 68f6481820 libutils Condition are now PRIVATE by default
Condition must be initialized with SHARED for the old behavior, where
they can be used accross processes.

Updated the two places android that require SHARED conditions.

PRIVATE conditions (and mutexes) use more efficient syscalls.

Change-Id: I9a281a4b88206e92ac559c66554e886b9c62db3a
2013-07-30 13:56:53 -07:00
Dianne Hackborn 30a8e2e135 Add ability for some manifest attributes to reference resources.
This loosens our restriction on many manifest attributes requiring
literal string values, to allow various ones to use values from
resources.  This is only allowed if the resource value does not change
from configuration changes, and the restriction is still in place
for attributes that are core to security (requesting permissions) or
market operation (used libraries and features etc).

Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
2013-07-30 13:56:53 -07:00
Dianne Hackborn 70592f2c47 Refactor car mode.
Extract all UI behavior from dock observer and ACTION_DOCK_EVENT.

Also introduce a desk type to go along with the car type all through
the resource system, since we now need to have corresponding high-level
broadcasts for desk dock mode.  As part of that I also reworked some
of the logic for switching modes to all funnel through a single
update() call that looks all of the current state to decide what to
do next, and fixed various locking issues.

In addition I found there were bugs in the configuration change
handling causing us to only switch into the car mode config and
then never get out of it.  Unfortunately now that we are actually
changing the configuration for each mode change, the transitions
between them are really crummy as we restart all kinds of
activities. :(
2013-07-30 13:56:53 -07:00
Dianne Hackborn aeb43bd6df Fix issue #2448075: aapt doesn't fix up activity-alias android:targetActivity links
And related:

- The aapt tool now sets a resource configurations sdk level to match any configs
  that have been set (for example if you specify density your sdk level will be
  at least 4).
- New option to modify the targetPackage attribute of instrumentation.
- Clean up of aapt options help.
- Fix of UI type values to leave 0 for "unspecified".
- Make the UI mode config APIs public.
2013-07-30 13:56:52 -07:00
Kenny Root 60ed8d122a Use UTF-8 strings to avoid duplicate caching, part 1
StringBlock instances containing UTF-8 strings use a cache to convert
into UTF-16, but using that cache and then using a JNI call to NewString
causes the UTF-8 string as well as two copies of the UTF-16 string to
be held in memory. Getting the UTF-8 string directly from the StringPool
eliminates one copy of the UTF-16 string being held in memory.

This is part 1. Part 2 will include ResXMLParser optimizations.

Change-Id: Ibd4509a485db746d59cd4b9501f544877139276c
2013-07-30 13:56:52 -07:00
Mathias Agopian a580e68cc3 remove a dependency of GraphicBuffer (libui) on Parcel (libbinder).
Add a Flattenable interface to libutils which can be used to flatten
an object into bytestream + filedescriptor stream.
Parcel is modified to handle Flattenable. And GraphicBuffer implements
Flattenable.

Except for the overlay classes libui is now independent of libbinder.
2013-07-30 13:56:52 -07:00
Kenny Root e81635474c Totally remove Unicode.cpp and rely on ICU
Unicode.cpp used a packed data table for character data that essentially
duplicated ICU's functionality.

Change-Id: Ia68fe4ac94e89dc68d9a3f45f33f6e648a5500b7
2013-07-30 13:56:52 -07:00
Kenny Root 861e14ff9f Excise code from Unicode.cpp that was dead
Remove some utility functions for discovering character data
that ICU probably took over a while ago.

Change-Id: I97abe4de2f51eb2bf48679941258bc501184c3dc
2013-07-30 13:56:52 -07:00
Tobias Haamel 4ef8aea3b5 Introduce special UI modes for night and car usage.
The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.

The ui mode can be set, like it is done for the locale, as follows:

IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);

To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.

The automatic night mode switching will be added in a separate change.
2013-07-30 13:56:52 -07:00
Kenny Root 1443fdf933 Add string resource type inspection
Allows "aapt dump --values resource" to print out whether a string in a
ResStringPool is in UTF-8 or UTF-16 encoding.

Change-Id: I6478884a70a3b46fee862dece6cb33454fc34843
2013-07-30 13:56:52 -07:00
Dianne Hackborn 235af97deb Propagate background scheduling class across processes.
This is a very simply implementation: upon receiving an IPC, if the handling
thread is at a background priority (the driver will have taken care of
propagating this from the calling thread), then stick it in to the background
scheduling group.  Plus an API to turn this off for the process, which is
used by the system process.

This also pulls some of the code for managing scheduling classes out of
the Process JNI wrappers and in to some convenience methods in thread.h.
2013-07-30 13:56:52 -07:00
Kenny Root 9a2d83e698 Optional use of UTF-8 strings in resource bundles
Allows the use of UTF-8 for packing resources instead of the
default of UTF-16 for Java. When strings are extracted from the
ResStringPool, they are converted to UTF-16 and the result is
cached for subsequent calls.

When using aapt to package, add in the "-8" switch to pack the
resources using UTF-8. This will result in the value, key, and
type strings as well as the compiled XML string values taking
significantly less space in the final application package in
most scenarios.

Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
2013-07-30 13:56:52 -07:00
Dianne Hackborn 6b8297700b Fix issue #2226370: Resource versions match with equality
Also fixed turned-around increment of version number for resources. :(

Change-Id: I604137272da984bcd69cee4f174e6b7f2c786e46
2013-07-30 13:56:52 -07:00
Dianne Hackborn 7f4b32fd75 Implement issue #1780928: Need support hiding nav keys.
This implements support for devices whose hardware can hide
their navigation keys.  It works much like the existing keyboardHidden
configuration, and for compatibility uses the same configuration
change bit.

Also add FLAG_TURN_ON_SCREEN for windows, which has the system
cause the screen to be turned on when the window is displayed.
Great fun when used with FLAG_SHOW_WHEN_LOCKED!

Change-Id: I0b867f19af85cfd8786a14cea194b34f7bdd9b7a
2013-07-30 13:56:52 -07:00
San Mehat f4d57661be process: Switch to common cutils sched_policy api
Signed-off-by: San Mehat <san@google.com>
2013-07-30 13:56:52 -07:00
San Mehat 7089ab8b38 Process: Add support for using scheduler policies instead of cgroups.
Preference is given to cgroups if available.

Signed-off-by: San Mehat <san@google.com>
2013-07-30 13:56:52 -07:00
Mathias Agopian 51ce3ad760 use broadcast() instead of signal() when signaling the condition-variable Thread::RequestExitAndWait() is waiting for
we could have several thread waiting on the condition and they all need to wake-up.
also added a debug "mTid" field in the class, which contains the tid of the thread (as opposed to pthread_t), this
is useful when debugging under gdb for instance.
2013-07-30 13:56:52 -07:00
Mathias Agopian 641b630d2b fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properly
Rewrote SurfaceFlinger's buffer management from the ground-up.
The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice.

The main new feature is to be able to dequeue all buffers at once (very important when there are only two).

A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued.

The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time.

eg. Allowed sequence:   DQ, DQ, LOCK, Q, LOCK, Q
eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
2013-07-30 13:56:52 -07:00
Andreas Huber 023a9546ad Support for marshalling pointers / intptr_t in Parcel.
Some refactoring to eliminate code duplication in Parcel implementation.
2013-07-30 13:56:52 -07:00
Dianne Hackborn 0042a806ce Fix issue #2048263: More debugging information
We now hopefully do better about generating the anr reports, and include
information about the malloc loaded assets in meminfo.
2013-07-30 13:56:52 -07:00
Dianne Hackborn ce87c24b3a Fix #2018814: System cannot correctly render assets with "wrap_content" attribute in QVGA
It turns out we were not returning the density for anything retrieved from a
TypedArray...  which basically means any bitmap references from a layout or style...!!!

This is now fixed.

Also fiddle with the density compatibility mode to turn on smoothing in certain situations,
helping the look of things when they need to scale and we couldn't do the scaling at
load time.
2013-07-30 13:56:51 -07:00
Dianne Hackborn af30c1b0ba First pass at reworking screen density/size APIs.
This changes the names of the directories in aapt, to what you see
in the list of DpiTest resources.  Also adds a new "long" configuration
for wide screens, which the platform sets appropriate, and introduces
a new kind of resizeability for not large but significantly larger
than normal screens which may have compatibility issues.
2013-07-30 13:56:51 -07:00
Dianne Hackborn 5fcc03f9b2 Add "nodpi" density, and expose a bunch of density-related APIs.
Also update the DpiTest app to use nodpi images, and try to have a mode
where it turns off compatibility though it's not quite working.
2013-07-30 13:56:51 -07:00
Mathias Agopian de6926bc94 add a ctor to Mutex to specify the type, which can be shared. This is used by sf and af an soon will allow some optimization in the kernel for non shared mutexes 2013-07-30 13:56:51 -07:00
Mathias Agopian 1555436473 implement Mutex and Condition with pthread instead of calling futex directly.
internally pthread uses futex. the implementation consists of simple inlines
there are no implementation files anymore.
2013-07-30 13:56:51 -07:00
Daisuke Miyakawa 44dad3e006 Add useful functions to String8, which enables users to convert between UTF-8 and UTF-32
It will be used in SQL functions in external/sqlite/android.
See https://android-git.corp.google.com/g/Gerrit#change,5511 for example.

Related internal bug id: 1707173
2013-07-30 13:56:51 -07:00
Andy McFadden 34ed82706a Fix sim build.
Looks like older gcc (4.1.x) doesn't properly handle templated
fanciness.  Apparently that's what we have on the build server.
2013-07-30 13:56:51 -07:00
Dianne Hackborn bd875d2638 Don't re-parse the framework resources all the time.
A small optimization to the resource code, to not re-parse the framework
resources every time we build a new AssetManager.  Instead, you can now
construct a ResTable from a previously created one...  of course, like the
existing code for using the data in-place, you can't delete the original
ResTable until you have deleted the one that has been constructed from it.
2013-07-30 13:56:51 -07:00
Dianne Hackborn cfd03822f0 Fix issue #1673793: Theme styles don't apply.
It turns out this was not a problem in the resource code at all.  Rather,
the system process has a cache of pre-loaded attributes it uses to avoid
continually reloading things as it needs them.  Well it turns out this
cache wasn't flushed after a package was uninstalled or a configuration
changed, so you could re-install an app where you change its style resources
so its theme now points to one that is inconsistent in the cache.

This is mostly a problem for developers, where they continually install
new versions of an app where resources have changed.  This could possibly
show up when updating an app on a normal phone, although the problem would
eventually correct itself since this cache uses weak references.

Anyway, the cache is now reworked to be flushed appropriately.

This change also includes an update to aapt to be able to dump the
contents of bags in resources.
2013-07-30 13:56:51 -07:00
Dianne Hackborn 8b72a9bb4e Expand support for different screen sizes.
Applications can now declare that they support small, normal, or
large screens.  Resource selection can also be done based on these
sizes.  By default, pre-Donut apps are false for small and large,
and Donut or later apps are assumed to support all sizes.  In either
case they can use <supports-screens> in their manifest to declare
what they actually support.
2013-07-30 13:56:51 -07:00
Mathias Agopian 35b4039b48 move ui/Time.cpp to core/jni, since this is the only place it is used 2013-07-30 13:56:51 -07:00
Christopher Tate 585d4f410e Only report "unknown metadata" once per restore helper
Also removes the auto-free object, replacing it with direct memory manipulation.
2013-07-30 13:56:51 -07:00
Christopher Tate 02abe53d8a Add file mode to the file-backup saved state blobs
This change puts the file's access mode into the saved-state blob used by the
file backup helpers.  The tests have been updated for the new blob content
format.

What this change *doesn't* do is actually backup/restore the file mode.  This
change is a prerequisite for that, but mode preservation in backup/restore will
require adding metadata to the backup data stream itself, so will be approached
a bit more carefully.

(Also fixed one outright bug in the test program: ReadEntityData() had been
changed to return a ssize_t union of either a byte-count or a negative number
indicating error, but the test program was still assuming that nonzero == error,
and was spuriously failing.)
2013-07-30 13:56:51 -07:00
Joe Onorato 109518880c Helper API cleanup. Allows multiple helpers to function,
because they'll always go in the same order, and this lets
us not have to write headers to keep them paired.
2013-07-30 13:56:50 -07:00
Mathias Agopian fe3b5edcf1 fix warnings that will show up with GCC 4.4 (in master) 2013-07-30 13:56:50 -07:00
Mathias Agopian a33bd1672f improve Vector<> with types that can be trivially moved and remove some unused code.
This optimization applies to sp<> and wp<> which should now perform about the same as regular pointers when placed in to Vector<>.
2013-07-30 13:56:50 -07:00
Dianne Hackborn 4538dd85da Report densities in badging, debugging for nine patch bug.
The aapt tool now reports all available densities like it already did
for locales.  Also this includes more resource data output, which I
was using to examine bug #1867049 (which at this point I am unable to
reproduce).
2013-07-30 13:56:50 -07:00
Joe Onorato aebb1ce05e backup stuff 2013-07-30 13:56:50 -07:00
Joe Onorato b90ae5522a Make RestoreHelper and friends also write out the snapshot state. 2013-07-30 13:56:50 -07:00
Joe Onorato f9f76ac291 FileRestoreHelper and RestoreHelperDispatcher work. 2013-07-30 13:56:50 -07:00
Joe Onorato 1781fd1ae7 checkpoint BackupDatAInput / RestoreHelper 2013-07-30 13:56:50 -07:00
Joe Onorato 9becbac780 Make the file backup helper not crash if a file you requested
can't be stated.  This means you don't need to know if the files
you are backing up exist or not -- we'll figure it out for you.
2013-07-30 13:56:50 -07:00
Joe Onorato 0d1d7ae49a Fix SharedPrefsBackupHelper so it doesn't hard code the paths to the files.
This took quite a bit of refactoring.
2013-07-30 13:56:50 -07:00
Mathias Agopian 14d978d02d get rid of LogSocket which wasn't even implemented (enabled) 2013-07-30 13:56:50 -07:00
Mathias Agopian 09e2b145ff break dependency on utils/ZipEntry.h and utils/ZipFile.h, get rid of inet_address.h and Socket.h which were not used 2013-07-30 13:56:50 -07:00
Mathias Agopian 254406e313 rename string_array.h to StringArray.h and move the implementation from the header file to a new cpp file.
StringArray is used in two places in framework/base and in the Sim. Ideally we should get rid of it and use Vector<String8> instead of creating new code.
2013-07-30 13:56:50 -07:00
Mathias Agopian ba6a87f916 cleanup Debug.h a bit 2013-07-30 13:56:50 -07:00
Mathias Agopian 7c88914df4 rename a few files to camel-case, add copyright notices 2013-07-30 13:56:50 -07:00
Mathias Agopian 9f2dc70fd1 move utils/Pipe.h to the simulator 2013-07-30 13:56:50 -07:00
Mathias Agopian 861db31eb9 get rid of TimerProbe which is never used 2013-07-30 13:56:50 -07:00
Mathias Agopian d12529a149 get rid of sleepForInterval() which didn't seem to be used anywhere in the source tree. Also get rid of ported.h which seem to be used only (possibly) in the sim. moved the implementation there. 2013-07-30 13:56:50 -07:00
Mathias Agopian ec8fb949ca get rid of utils.h 2013-07-30 13:56:50 -07:00
Mathias Agopian cbae9a27ce get rid of utils/executablepath.h, which now lives in the simulator 2013-07-30 13:56:50 -07:00
Mathias Agopian 624756e7ed force explicit instantiation of Singleton<> objects 2013-07-30 13:56:50 -07:00
Mathias Agopian d0ef3d46f9 some work to try to reduce the code size of some native libraries
- make sure that all binder Bn classes define a ctor and dtor in their respective library.
  This avoids duplication of the ctor/dtor in libraries where these objects are instantiated.
  This is also cleaner, should we want these ctor/dtor to do something one day.

- same change as above for some Bp classes and various other non-binder classes

- moved the definition of CHECK_INTERFACE() in IInterface.h instead of having it everywhere.

- improved the CHECK_INTERFACE() macro so it calls a single method in Parcel, instead of inlining its code everywhere

- IBinder::getInterfaceDescriptor() now returns a "const String16&" instead of String16, which saves calls to String16 and ~String16

- implemented a cache for BpBinder::getInterfaceDescriptor(), since this does an IPC. HOWEVER, this method never seems to be called.
  The cache makes BpBinder bigger, so we need to figure out if we need this method at all.
2013-07-30 13:56:50 -07:00
Mathias Agopian 61c60b1a81 move libbinder's header files under includes/binder 2013-07-30 13:56:50 -07:00
Joe Onorato 062a488f1e Hook up the backup data writer, and add a utility to read the backup data files. 2013-07-30 13:56:50 -07:00
Dianne Hackborn 7ac7ecb6bd Update aapt badging for native code, configs, density, etc. 2013-07-30 13:56:50 -07:00
Joe Onorato cd1c1c86c3 Add the backup data file writer C++ class. 2013-07-30 13:56:50 -07:00
Joe Onorato 62a381bd13 Implement the C++ class to write the backed up file data. 2013-07-30 13:56:50 -07:00
Joe Onorato b81a9a18e5 Get the backup calling through to the file backup helper.
This includes some cleanup to make the parameters match
between BackupService.onBackup and FileBackupHelper.performBackup.
2013-07-30 13:56:50 -07:00
Joe Onorato 5222355ad8 fix the sim build. disables the tests for now. 2013-07-30 13:56:50 -07:00
Joe Onorato aaead20164 Add some C++ code to do raw files for backup 2013-07-30 13:56:50 -07:00
Mathias Agopian 019f8ed427 update surfaceflinger, libui and libagl to the new gralloc api
- Currently the lock/unlock path is naive and is done for each drawing operation (glDrawElements and glDrawArrays). this should be improved eventually.
- factor all the lock/unlock code in SurfaceBuffer.
- fixed "showupdate" so it works even when we don't have preserving eglSwapBuffers().
- improved the situation with the dirty-region and fixed a problem that caused GL apps to not update.
- make use of LightRefBase() where needed, instead of duplicating its implementation
- add LightRefBase::getStrongCount()
- renamed EGLNativeWindowSurface.cpp to FramebufferNativeWindow.cpp

- disabled copybits test, since it clashes with the new gralloc api

- Camera/Video will be fixed later when we rework the overlay apis
2013-07-30 13:56:49 -07:00
Mathias Agopian 0077a0dd69 improvements (I hope) to to List.h implementation:
- made the helper Node and Iterator classes protected inner classes of List so they don't pollute the android namespace.
- use "int foo()" instead of "int foo(void)" which is more C++ stylish
- made distance() a template function, this way we write it once and it will work with combinations of iterator and const_iterator
- added the inline keyword on some function to make it clear to the compiler and the programmer that we want/intend these to be small inline functions
- added templated comparison operators to Iterator so it can compare iterator and const_iterator
- use size_t instead of "unsigned int" at places
- distance() should return a ptrdiff_t (it's kind of mening less here because it won't really work if the distance is < 0)
- made sure we handle conversions from iterator to const_iterator, but but fail at compile time in the other direction
- added operator->() on iterator and const_iterator
- made a bunch of private constructors explicit to avoid unwanted conversions
2013-07-30 13:56:49 -07:00
Mathias Agopian ebd9dd5521 small fix to List.h, the post-increment iterators should return "const" objects to disallow constructs such as i++++ 2013-07-30 13:56:49 -07:00
San Mehat 624a35ee48 Add support for changing a threads scheduler group. Three groups are available (default, background non interactive, foreground boost). Setting a thread priority to PRIORITY_BACKGROUND will transparently change groups to background
Signed-off-by: San Mehat <san@google.com>
2013-07-30 13:56:49 -07:00
Mathias Agopian 76f6b453a2 a brand new MessageQueue for SurfaceFlinger. 2013-07-30 13:56:49 -07:00
Mathias Agopian d8c95cc027 Squashed commit of the following:
commit e5c24638f98162c3b75b4c67a16b510d38e31341
Author: Mathias Agopian <mathias@google.com>
Date:   Fri Apr 17 14:09:03 2009 -0700

    oops forgot this file.

commit 282642632d0cb12882eecf42e0fdfb2343275de1
Author: Mathias Agopian <mathias@google.com>
Date:   Fri Apr 17 14:07:32 2009 -0700

    use a helper macro for creating Singleton<>'s static attributes instances.
2013-07-30 13:56:49 -07:00
Robert Greenwalt 8dbfd35c60 Squashed commit of the following:
commit 012b56fc607cf243cf4b29cb2a5f172bcbe0aecd
Author: Robert Greenwalt <robdroid@android.com>
Date:   Wed Apr 22 14:31:26 2009 -0700

    Additional fixes and tests for density.

commit 91fdc8e187551ae69e0029a4325fb3ad38fe411b
Author: Robert Greenwalt <robdroid@android.com>
Date:   Tue Apr 14 14:39:00 2009 -0700

    Fix runtime resource selection logic.

    Fix isBetterThan so that o or this may be supperior at any stage.
    Used to only handle this-better or tie at each stage, biasing against o.
    Also allows reset of unit test to succeed.  Fixes bug 1709202.
2013-07-30 13:56:49 -07:00
Mathias Agopian 544e3e3606 fix a rookie mistake causing Singleton<> to be a "multiton". Also improve the BufferMapper's debugging, but turn it off.
Squashed commit of the following:

commit 04e9cae7f806bd65f2cfe35c011b47a36773bbe5
Author: Mathias Agopian <mathias@google.com>
Date:   Wed Apr 15 18:30:30 2009 -0700

    fix and improve BufferMapper's tracking of mapped buffers.

commit 1a8deaed15811092b2349cc3c40cafb5f722046c
Author: Mathias Agopian <mathias@google.com>
Date:   Wed Apr 15 00:52:02 2009 -0700

    fix some bugs with the Singleton<> class. untested.

commit ed01cc06ad70cf640ce1258f01189cb1a96fd3a8
Author: Mathias Agopian <mathias@google.com>
Date:   Tue Apr 14 19:29:25 2009 -0700

    some work to debug the Singleton<> template.
2013-07-30 13:56:49 -07:00
Mathias Agopian cf89aa42ef fix KeyedVector::replaceValueAt, which wouldn't even compile if used. 2013-07-30 13:56:49 -07:00
Mathias Agopian 6b35f970ea Integrate from //sandbox/mathias/donut/...@145728
SurfaceFlinger rework for new EGL driver model support.
2013-07-30 13:56:49 -07:00
The Android Open Source Project 4e3ea4acea auto import from //branches/cupcake_rel/...@140373 2013-07-30 13:56:49 -07:00
The Android Open Source Project 7a4c83922e auto import from //depot/cupcake/@136594 2013-07-30 13:56:49 -07:00
The Android Open Source Project cbb1011c95 auto import from //depot/cupcake/@135843 2013-07-30 13:56:49 -07:00
The Android Open Source Project cf59fa8dc7 auto import from //depot/cupcake/@135843 2013-07-30 13:56:49 -07:00
The Android Open Source Project 7aa707a5d6 auto import from //depot/cupcake/@132589 2013-07-30 13:56:49 -07:00
The Android Open Source Project c739660fb7 auto import from //depot/cupcake/@137055 2013-07-30 13:56:49 -07:00
The Android Open Source Project dccb00bd4c auto import from //branches/cupcake/...@131421 2013-07-30 13:56:49 -07:00
The Android Open Source Project 60dcc00861 auto import from //branches/cupcake/...@130745 2013-07-30 13:56:49 -07:00
ralf 13e4bed7db AAPT needs a buffer larger than 1 MB on the host to decode resources.arsc from SDK/android.jar.
This leaves the asset unzip buffer to 1 MB on the device and 2 MB on the host.
2013-07-30 13:56:49 -07:00
The Android Open Source Project 7976caad7d auto import from //branches/cupcake/...@127101 2013-07-30 13:56:49 -07:00
The Android Open Source Project 046e40caa0 auto import from //branches/cupcake/...@125939 2013-07-30 13:56:49 -07:00
The Android Open Source Project 7810449ca1 Code drop from //branches/cupcake/...@124589 2013-07-30 13:56:49 -07:00
The Android Open Source Project d245d1d097 Initial Contribution 2013-07-30 13:56:46 -07:00
Mathias Agopian 6bac41f1bf get rid of HAL pixelformats 5551 and 4444
Change-Id: I047d948f2f3b5c681a0b187589775f92b4f01541
2013-07-26 14:50:26 -07:00
Mathias Agopian 224445c830 Merge "add sRGB pixel formats to the HALs" 2013-07-26 19:54:11 +00:00
Mathias Agopian 8d9da28ab5 add sRGB pixel formats to the HALs
Change-Id: I1d5f9dd14a6485dd3a29fb5960edfa79aa86da42
2013-07-25 17:07:11 -07:00
Colin Cross 9227bd3855 Move liblog headers to system/core/include/log
Move the liblog headers to log/ instead of cutils/ to complete
the separation of libcutils and liblog.  cutils/log.h still
exists and includes log/log.h in order to support the many existing
modules that use cutils/log.h.

Change-Id: I2758c9f4aedcb809ca7ba8383d0f55041dd44345
2013-07-24 12:32:39 -07:00
Glenn Kasten 87bc464a9f Merge "Valid channel mask must have at least one channel" 2013-07-24 15:49:13 +00:00
Alex Ray 000b1d0c50 thread_defs: remove trailing whitespace
Change-Id: Idba19c64dfde67c40a98c29f68d5e8d4e555a4cf
2013-07-23 22:20:45 -07:00
Colin Cross 42cf2b5945 fix windows build
thread_defs.h gets included by the windows host libandroidfw build,
which does not have sys/cdefs.h or BEGIN_DECLS.  Switch to using
extern "C" manually.

Change-Id: I363e6f2d3a64c5efeff54049a2e5dab080fd4715
2013-07-23 19:58:03 -07:00
Alex Ray 8a84c71acb cutils: add thread_defs header
Change-Id: I3b70054d9f9740a5980df514221de07df55e7176
2013-07-23 17:16:24 -07:00
Glenn Kasten f7326dc0aa Valid channel mask must have at least one channel
Also:
 - Use correct type name audio_channel_mask_t
 - Use the parameter name 'channelMask' instead of the more ambiguous 'channels'

Change-Id: I22bc1821a1bded0e69fe7d99e7b981ff60d77cee
2013-07-23 16:47:17 -07:00
Richard Fitzgerald 05529a1a10 Add defines for audio offload and non-blocking write
- Defines audio output flags for offloaded playback of compressed
    streams, and non-blocking HAL write()/drain()
- Adds audio_offload_info_t to pass additional information about a
    compressed stream when offloading

Change-Id: I4592d0877edd39e68d0c1035d0652adbd397bf3a
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Eric Laurent <elaurent@google.com>
2013-06-27 17:16:25 -07:00
Nick Kralevich f5d79aa4bb Merge "Don't use __attribute__(__error__)" 2013-06-18 20:23:29 +00:00
Nick Kralevich bda25e4ed5 Don't use __attribute__(__error__)
__attribute(__error__) isn't supported on clang, and generates
compiler warnings. Use __errordecl instead, which does the right thing
for different compilers.

Change-Id: Ifb0797a5de703cc5b3c39dcd97bcfaf404f1cafa
2013-06-18 12:14:47 -07:00
Tobias Grosser 9ede33233f Set ATRACE_ENABLE() to '0' if not availble
Change-Id: Iec61d275cd7b2be65f828c282f97cc59adf4cc0b
2013-06-17 18:38:02 -07:00
Dima Zavin abb7d58010 HACK: cutils: restore record_stream temporarily
Restore the record_stream code in cutils that was removed
in e00a12bf8a as part of cutils
cleanup.

Unfortunately, there are some prebuilt vendor libs that rely on
this functionality that we cannot currently rebuild.

Remove at the earliest possible convenience once the vendor libs
have been fixed.

Bug: 9189218
Change-Id: I5d44126756f1e3ed194d1b5873d64d9154183199
Signed-off-by: Dima Zavin <dima@android.com>
2013-06-04 17:40:28 +00:00
Nick Kralevich e44c6b7183 Merge "property_get: do argument checking." 2013-05-24 21:36:30 +00:00
Nick Kralevich 1c743de2bd Merge "properties.h: avoid duplicating constant values" 2013-05-24 21:36:22 +00:00
Tim Murray d8b11c1ddd Add ATRACE_TAG_RS.
Change-Id: Iaff497a1cb04a797441b5bb47b30ad6f09db8e95
2013-05-23 13:46:12 -07:00
Nick Kralevich 0e54ec825e property_get: do argument checking.
Try to verify, at compile time, that the supplied
value buffer is large enough.

Change-Id: I91fa560d3ceff87609194269356ac634bdbf2ede
2013-05-23 11:05:16 -07:00
Nick Kralevich 53df3ade9b properties.h: avoid duplicating constant values
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
2013-05-23 11:05:16 -07:00
Brian Carlstrom 9186d85021 am a817ff9c: resolved conflicts for merge of 07db2970 to jb-mr2-dev-plus-aosp
* 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.
2013-05-14 22:04:15 -07:00
Brian Carlstrom a817ff9cf6 resolved conflicts for merge of 07db2970 to jb-mr2-dev-plus-aosp
Change-Id: Idf344a1fc7e2f8ec76232ae14a00298ddd322a55
2013-05-14 21:59:53 -07:00
Elliott Hughes 89054056a7 Add flush_my_map_info_list() and fix a bug in the Mac load_map_info_list().
(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
2013-05-14 19:49:30 -07:00
Jamie Gennis a0e780edd3 am 6e46a3b8: am a1ee12ca: Merge "libcutils: add a trace tag for Dalvik" into jb-mr2-dev
* commit '6e46a3b8e64a7a2ca4754ed7b1f9922719bd0a9b':
  libcutils: add a trace tag for Dalvik
2013-05-08 15:03:54 -07:00
Jamie Gennis a1ee12ca3a Merge "libcutils: add a trace tag for Dalvik" into jb-mr2-dev 2013-05-08 01:12:19 +00:00
Jamie Gennis 2b68e0675b libcutils: add a trace tag for Dalvik
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
2013-05-07 15:19:34 -07:00
Dima Zavin e00a12bf8a cutils: first pass at cleaning up legacy/obsolete code in cutils
Removed unused code and moved libraries with single clients
near their respective users.

Change-Id: I65f90f8659f27bd0f44ca5ddf33da2bce14674c1
Signed-off-by: Dima Zavin <dima@android.com>
2013-05-07 00:19:44 -07:00
Jeff Tinker 7629bf19a1 am 9e9ed1b4: am 131ee07b: Merge "Add a new group for MediaDrm engine plugins" into jb-mr2-dev
* commit '9e9ed1b40010745e709157a6977ba6d053d46c49':
  Add a new group for MediaDrm engine plugins
2013-04-24 21:56:49 -07:00
Jeff Tinker 131ee07b77 Merge "Add a new group for MediaDrm engine plugins" into jb-mr2-dev 2013-04-25 04:54:02 +00:00
Matthew Xie af1cbd4c10 am 0db6600a: am 7ee2e26e: Remove DBUS from make and header files
* commit '0db6600a60e8d604aaef5e43db9ae52ed7380979':
  Remove DBUS from make and header files
2013-04-24 14:24:30 -07:00
Jeff Tinker 08d64308b9 Add a new group for MediaDrm engine plugins
bug: 8702754
Change-Id: I3b7988b64b1dcf4685624e4c1af938e132b82696
2013-04-23 19:54:17 -07:00
Matthew Xie 7ee2e26eb9 Remove DBUS from make and header files
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
2013-04-23 14:02:16 -07:00
Nick Kralevich ca8e66a8b0 Make init handle reboots
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
2013-04-23 13:21:40 -07:00
Alex Ray 4fcd7af279 am 3d35db33: am ca0cb785: Merge "graphics: add Android flexible YCbCr format" into jb-mr2-dev
* commit '3d35db33eb9e5b0769732d4baa43729fac50d467':
  graphics: add Android flexible YCbCr format
2013-04-18 13:45:13 -07:00
Alex Ray ca0cb785cb Merge "graphics: add Android flexible YCbCr format" into jb-mr2-dev 2013-04-18 20:39:33 +00:00
Jamie Gennis dcbe6b4b17 am b7b2c71b: am 25538257: Merge "cutils: add a way to disable tracing for a process" into jb-mr2-dev
* commit 'b7b2c71bf8bf685af4c716e78d5c70decab98b54':
  cutils: add a way to disable tracing for a process
2013-04-16 15:21:50 -07:00
Jamie Gennis 2553825797 Merge "cutils: add a way to disable tracing for a process" into jb-mr2-dev 2013-04-16 22:12:47 +00:00
Jamie Gennis b13ea45a04 cutils: add a way to disable tracing for a process
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
2013-04-15 18:50:22 -07:00
Ken Sumrall cb1300a255 am 3b051178: am 774814d1: Merge "klog: Have klog_write() call klog_init() if needed" into jb-mr2-dev
* commit '3b0511788c86968860a682b6652c26c4415fa222':
  klog: Have klog_write() call klog_init() if needed
2013-04-15 10:38:50 -07:00
Ken Sumrall 774814d194 Merge "klog: Have klog_write() call klog_init() if needed" into jb-mr2-dev 2013-04-15 17:33:27 +00:00
Dianne Hackborn 9bd89925ef am c08b50df: am 24bc41b7: Add new resources trace.
* commit 'c08b50dfc68504b692c13194e86d33328d373019':
  Add new resources trace.
2013-04-12 17:03:06 -07:00
Dianne Hackborn 24bc41b78c Add new resources trace.
Change-Id: I63398f282fe7bf04f1c4cefa8f602100f403fa7c
2013-04-12 14:51:43 -07:00
Ken Sumrall 7425fd1b23 klog: Have klog_write() call klog_init() if needed
Also change klog_init() to do nothing if already initialized.

Change-Id: Ia2dfe914c9d9fd119fb8939508d57b15c9884663
2013-04-11 20:03:47 -07:00
Doug Zongker 515e1639ef mincrypt: support SHA-256 hash algorithm
- 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
2013-04-10 14:33:31 -07:00
Alex Ray e13f15ab55 graphics: add Android flexible YCbCr format
Change-Id: I3f6676873febc793f7a4a5e06892cd9fadb35665
2013-04-09 15:09:35 -07:00
Elliott Hughes e5f8a692e4 Modify debuggerd to cope with the abort message.
(cherry picked from commit 707b8bbe18)

Bug: 8531731
Change-Id: I2785a07ef83e085f338d3094f9972de23117807c
2013-04-05 15:59:17 -07:00
Elliott Hughes 879d21ebc3 am 8a4ae0a8: resolved conflicts for merge of f79c0518 to jb-mr2-dev-plus-aosp
* commit '8a4ae0a873862ea0a4764cd3492467843485f1e5':
  Modify debuggerd to cope with the abort message.
2013-04-05 14:36:51 -07:00
Elliott Hughes 8a4ae0a873 resolved conflicts for merge of f79c0518 to jb-mr2-dev-plus-aosp
Change-Id: I106a2aa7ec393a68e51132bf277b22bece155a8e
2013-04-05 13:46:55 -07:00
Elliott Hughes 707b8bbe18 Modify debuggerd to cope with the abort message.
Bug: 8531731
Change-Id: I416ec1da38a8a1b0d0a582ccd7c8aaa681ed4a29
2013-04-04 13:52:01 -07:00
Benoit Goby 5e61ab0d77 Merge "toolbox: Make reboot a separate command from toolbox" 2013-03-29 03:14:27 +00:00
Jamie Gennis 15311e0830 am 38e1bb86: am 774f9299: libcutils: add support for app tracing
* commit '38e1bb8617ee6b7913b9b7b7c40e43338ea5c947':
  libcutils: add support for app tracing
2013-03-28 14:04:50 -07:00
Jamie Gennis 774f929991 libcutils: add support for app tracing
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
2013-03-28 20:59:31 +00:00
Benoit Goby c6d7e200ed toolbox: Make reboot a separate command from toolbox
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
2013-03-26 12:24:10 -07:00
Ying Wang 504d2747bd am 85da9313: am d0f3e858: Merge "android_filesystem_config: add /vendor" into jb-mr2-dev
* commit '85da931345fd420bc2959d79361058efa974f465':
  android_filesystem_config: add /vendor
2013-03-22 16:01:42 +00:00
Ying Wang d0f3e8588a Merge "android_filesystem_config: add /vendor" into jb-mr2-dev 2013-03-22 15:57:59 +00:00
Ian Rogers 63c939aadc am da204c5c: am 62980e81: Inline ldrex/strex for thumb2, remove ARMv5 remnants.
* commit 'da204c5c4244ea67aacbd29c222d0a2d1c35b443':
  Inline ldrex/strex for thumb2, remove ARMv5 remnants.
2013-03-21 21:41:49 +00:00
Ian Rogers 62980e817c 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.

(cherry picked from commit 80c3b278fd)

Change-Id: I194a3d08e933c63f79d48288d9235b4e64099340
2013-03-21 12:37:35 -07:00
Colin Cross 0b56fc769d android_filesystem_config: add /vendor
Make /vendor have the same permissions as /system/vendor for devices
that have a vendor partition.

Bug: 8341435
Change-Id: I077a2caf9da41fc072a4d3e334be28c24b70c7cd
2013-03-20 19:06:11 +00:00
Alex Ray b178fbe67b am ee2dccf2: am 66317770: cutils: trace: add asynchronous events
* commit 'ee2dccf21b61094a0fd782d32f221804b0a7d3fa':
  cutils: trace: add asynchronous events
2013-03-19 00:30:03 +00:00
Alex Ray 66317770d3 cutils: trace: add asynchronous events
Change-Id: Ia09d34cbc6c8c85fb3d0f1a7e95de53d1b79e998
2013-03-18 13:33:38 -07:00
Alex Ray 995ee3b6d5 am 00977e58: am 81b5b5fb: sync: factor sw_sync functionality out of header
* commit '00977e5833a25bffd96d446ee39a25a6baf41a19':
  sync: factor sw_sync functionality out of header
2013-03-06 00:01:49 +00:00
Alex Ray 81b5b5fb02 sync: factor sw_sync functionality out of header
Change-Id: I13127abe1cd07cd52b35ff43902579478505ccf4
2013-03-05 15:53:24 -08:00
Nick Kralevich 6f3622af94 am d1439a7f: am b3be89df: am 3fb63338: Merge "android_filesystem_config.h: change ping and run-as"
* commit 'd1439a7f8eb228eb39dd74845a5e46d20c63b3b0':
  android_filesystem_config.h: change ping and run-as
2013-03-01 22:18:40 +00:00
Nick Kralevich d1439a7f8e am b3be89df: am 3fb63338: Merge "android_filesystem_config.h: change ping and run-as"
* commit 'b3be89dfe9e0eb1cb0fbf834d6fbcef976c03a1e':
  android_filesystem_config.h: change ping and run-as
2013-03-01 22:14:52 +00:00
Nick Kralevich b3be89dfe9 am 3fb63338: Merge "android_filesystem_config.h: change ping and run-as"
* commit '3fb63338e9faddeb50a582cfec114bd48f93f1c2':
  android_filesystem_config.h: change ping and run-as
2013-03-01 14:11:00 -08:00
Nick Kralevich fe8135739c android_filesystem_config.h: change ping and run-as
/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
2013-03-01 13:18:41 -08:00
Alex Ray 3954d778ab Merge "cutils: bitops: Add Hamming weight to bitmask" 2013-02-26 05:25:43 +00:00
Nick Kralevich 09094e729b am 96f60a8c: am ff03bc30: Merge "fix mac sdk build."
* commit '96f60a8cf8a6e8e8c077339a27e417cd15645e1b':
  fix mac sdk build.
2013-02-22 21:44:07 -08:00
Nick Kralevich 96f60a8cf8 am ff03bc30: Merge "fix mac sdk build."
* commit 'ff03bc3024cb60d1840552f4e966f5b616fd861f':
  fix mac sdk build.
2013-02-22 21:41:43 -08:00
Nick Kralevich bb05a92cb1 fix mac sdk build.
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
2013-02-22 20:32:35 -08:00
Nick Kralevich 89b530d215 am 0d060d56: am e3f247c0: Merge "Add support for filesystem capabilities."
* commit '0d060d56d25e41e61dd46e348bff3c875cbc85cd':
  Add support for filesystem capabilities.
2013-02-22 18:31:42 -08:00
Nick Kralevich 0d060d56d2 am e3f247c0: Merge "Add support for filesystem capabilities."
* commit 'e3f247c0e55d8bfd7df66532e807e38983c47761':
  Add support for filesystem capabilities.
2013-02-22 18:28:13 -08:00
Alex Ray f90fd9eeb3 cutils: bitops: Add Hamming weight to bitmask
Change-Id: I5c6b7adf711007edfffcb4fdf8e05b04bcffef54
2013-02-22 14:27:37 -08:00
Nick Kralevich e9e74f3c88 Add support for filesystem capabilities.
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
2013-02-20 12:51:28 -08:00
Mathias Agopian bcfa910611 Refactoring: Rename SurfaceTextureClient to Surface
Change-Id: Ie745d9adf5465834bb8bf751a2f88b19435fdf46
2013-02-15 12:48:01 -08:00
Igor Murashkin 4869a68d56 am 1b69da3e: am 6711f76d: Merge "graphics.h: Remove unnecessary comments for Y8/Y16 formats" into jb-mr1-aah-dev
# Via Android (Google) Code Review (1) and others
* commit '1b69da3ef0f505b885f8621ca2dad44d46aa824e':
  graphics.h: Remove unnecessary comments for Y8/Y16 formats
2013-02-11 17:34:27 -08:00
Igor Murashkin 51b78949b2 am fbb4a5ac: am fba6c12a: Merge "graphics.h: add new Y8, Y16 formats" into jb-mr1-aah-dev
# Via Android (Google) Code Review (1) and others
* commit 'fbb4a5ac1b771b2df0786bb5587c7ed0d5f82089':
  graphics.h: add new Y8, Y16 formats
2013-02-11 17:34:14 -08:00
Igor Murashkin 1b69da3ef0 am 6711f76d: Merge "graphics.h: Remove unnecessary comments for Y8/Y16 formats" into jb-mr1-aah-dev
# Via Android (Google) Code Review (1) and Igor Murashkin (1)
* commit '6711f76d244b22d8c39c33963d2d81504816eaf4':
  graphics.h: Remove unnecessary comments for Y8/Y16 formats
2013-02-11 11:48:38 -08:00
Igor Murashkin d755b52b43 graphics.h: Remove unnecessary comments for Y8/Y16 formats
Change-Id: Ic80f6c4be7df9d9729334b97bb662eb2d0456c33
2013-02-11 11:34:53 -08:00
Igor Murashkin fbb4a5ac1b am fba6c12a: Merge "graphics.h: add new Y8, Y16 formats" into jb-mr1-aah-dev
# Via Android (Google) Code Review (1) and Igor Murashkin (1)
* commit 'fba6c12a3e6ac5fabe91270293b1115f72fd48a1':
  graphics.h: add new Y8, Y16 formats
2013-02-11 11:20:53 -08:00
Igor Murashkin 9e00e66ebc graphics.h: add new Y8, Y16 formats
Change-Id: I0cb3786d91f442b5f3b665dd78bf5f0dd4ae4cf0
2013-02-08 13:40:59 -08:00
Nick Kralevich 21291f1ac5 Revert "property_get: do argument checking."
This reverts commit 75cc88546b.
2013-02-04 09:49:13 -08:00
Nick Kralevich 91e63efeef Revert "Fix win_sdk build."
This reverts commit 941daef629.

Change-Id: I6b509492964baf535e0eeb1a731bf70c91715942
2013-02-04 09:48:54 -08:00
Nick Kralevich 941daef629 Fix win_sdk build.
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
2013-02-02 17:26:38 -08:00
Ian Rogers 271d6dfb9c am 78432ab1: Merge "Inline ldrex/strex for thumb2, remove ARMv5 remnants."
# Via Gerrit Code Review (1) and Ian Rogers (1)
* commit '78432ab1f42d59fed474365b95b7501dcccacebf':
  Inline ldrex/strex for thumb2, remove ARMv5 remnants.
2013-02-01 17:11:02 -08:00
Nick Kralevich cc62beebff Merge "property_get: do argument checking." 2013-02-01 23:18:39 +00:00
Ian Rogers 80c3b278fd 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
2013-02-01 11:30:31 -08:00
Nick Kralevich 75cc88546b property_get: do argument checking.
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
2013-01-31 15:20:14 -08:00
Eric Laurent ef89911ed6 Merge "audio: added input device for front + back mic" 2013-01-31 22:32:34 +00:00
Nick Kralevich b94fd1abcb cutils: remove dead code.
The last caller of this code was removed in
dalvik commit eb1703442f3fc0577b3395b7eb4d55300b4125db
(https://android-review.googlesource.com/50689)

Change-Id: I3f4865c02092752a13369a3b2c3289fc9a4f6a62
2013-01-29 13:19:20 -08:00
Doug Zongker 0060935e1d am 8cc97302: resolved conflicts for merge of 0fe9742e to jb-mr1-dev-plus-aosp
# Via Doug Zongker
* commit '8cc97302b2cc42d70af3c6d84a6a46984a09fe24':
  add AID_LOOP_RADIO for control of loop radio device
2013-01-29 11:06:39 -08:00
Doug Zongker 8cc97302b2 resolved conflicts for merge of 0fe9742e to jb-mr1-dev-plus-aosp
Change-Id: Ie7a8b642dec0f07d4c8bfd9d8f736fd66c4febe0
2013-01-29 10:50:22 -08:00
Doug Zongker 016806a71b change AID_LOOP_RADIO uid assignment
1029 was taken by an AOSP change; use 1030 instead.

Change-Id: Icfe19a5638a4c98a3e2694c0402d19b49b8face9
2013-01-29 10:47:28 -08:00
Doug Zongker 0fe9742e38 add AID_LOOP_RADIO for control of loop radio device
Change-Id: I1e996dfbaa0f187ec87b5318a214ab0b852193cc
2013-01-29 10:37:51 -08:00
Eric Laurent 6c70ceeefe audio: added input device for front + back mic
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
2013-01-22 17:09:30 -08:00
Elliott Hughes def8d6a706 The localtime_tz and mktime_tz extensions are now in bionic.
(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
2013-01-15 11:34:08 -08:00
Robert Greenwalt c93d30f50d Merge "Support 4 dns servers, up from 2" 2013-01-11 15:38:59 -08:00
Alex Ray 60efde774d Merge "cutils: add simple reference counter" 2013-01-11 13:25:34 -08:00
Alex Ray d874cc8bb9 cutils: add simple reference counter
Change-Id: Iefb34abc864cb4ca2da2f1c85c45f89af8c7fe8b
2013-01-10 15:23:55 -08:00
Robert Greenwalt fdd573188d Support 4 dns servers, up from 2
bug:5958524
Change-Id: I61c25e23d21e92653ec9b874d3d456a330d8fe05
2013-01-10 11:36:09 -08:00
Alex Ray 81ec96df4f cutils: bitops: add include for bool
Change-Id: I3eca5a7c1f5ec66ded1229ccb6ca1dbb5d608ffd
2013-01-07 16:58:01 -08:00
Alex Ray 2111bc7b28 cutils: Add bitmask utilities to bitops
Bitmask utils handle resource tracking using a (multi-word) bitmask.

Change-Id: I2ae45df1ac8c665c29ea9cae32a757168686b96c
2013-01-07 13:02:28 -08:00
Elliott Hughes e8097be24e am a82985b6: am 7cd45071: Merge "Include page protections in the debuggerd map output."
* commit 'a82985b6686f8b47119193fee2f804376a90125b':
  Include page protections in the debuggerd map output.
2013-01-03 15:21:56 -08:00
Elliott Hughes d1420be613 Include page protections in the debuggerd map output.
Bug: 7941716
Change-Id: I3bf475425c628c06f7799340c8a6132aab741742
2013-01-03 13:39:57 -08:00
Colin Cross 8b9e9804f1 am 4600545f: am b8e86c5a: Merge "android_filesystem_config: allow absolute paths"
* commit '4600545fbb5b496297a51e43818b8b3e750590c5':
  android_filesystem_config: allow absolute paths
2012-12-28 09:47:48 -08:00
Colin Cross 04aaf5a424 android_filesystem_config: allow absolute paths
SELinux policies use absolute paths, allow absolute paths in fs_config
as well.

Change-Id: Ic97ee0b4eb4df9eac965a8e819fde01df473de7e
2012-12-21 12:51:17 -08:00
Jean-Baptiste Queru 9388033694 am 22e91366: Merge from AOSP staging branch
* commit '22e9136661f55122d4ed4b081f61fd63e9ce3685':
  libusbhost: generates a static library
  libusbhost: permits client polling on inotify wd
2012-12-18 15:52:51 -08:00
Mike Lockwood dea9a93ddd Merge "libusbhost: permits client polling on inotify wd" 2012-12-17 14:34:20 -08:00
Wink Saville bf866aeda1 Merge "Add RLOGx" 2012-12-12 08:22:02 -08:00
Robert Greenwalt 4506426bfb am 8bc848d9: am abce9e85: Merge "libsysutils: Increase command buffersize and command args"
* commit '8bc848d9b2c5b3ed26441315d652ba043f636c17':
  libsysutils: Increase command buffersize and command args
2012-12-11 16:56:06 -08:00
Robert Greenwalt abce9e85e4 Merge "libsysutils: Increase command buffersize and command args" 2012-12-11 15:50:50 -08:00
Guillaume Ranquet dea46b6657 libusbhost: permits client polling on inotify wd
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>
2012-12-10 11:12:35 +01:00
Ben Cheng 26f447f5da am 7f692fe6: am 523e21d3: Merge "Fail-proof the inline directives for SMP atomic operations."
* commit '7f692fe6448049dca2795d7d648615a2dc7a500c':
  Fail-proof the inline directives for SMP atomic operations.
2012-12-07 14:37:04 -08:00
Ben Cheng 5206d59712 Fail-proof the inline directives for SMP atomic operations.
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
2012-12-07 11:07:10 -08:00
Wink Saville 9d7ad45eff Add RLOGx
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
2012-12-06 10:20:27 -08:00
Alex Ray 448f76a1c4 cutils: trace: use ANDROID_SMP to switch atomics
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
2012-11-30 19:40:58 -08:00
Alex Ray e7bb7bca4f cutils: trace: add atrace_update_tags()
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
2012-11-28 13:56:49 -08:00
Alex Ray 0a34643160 cutils: Add tracing support
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
2012-11-28 13:56:15 -08:00
Wink Saville 44a9abdd04 Add RLOGx
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
2012-11-16 12:46:08 -08:00
jp abgrall 3699bcfe83 am 0069b013: am 3ddc0059: am ee854b07: Merge "Allocate a UID for clatd"
* commit '0069b01354ab9a62acaf4547f78688429274f0ef':
  Allocate a UID for clatd
2012-11-12 16:02:00 -08:00
jp abgrall 3ddc0059bb am ee854b07: Merge "Allocate a UID for clatd"
* commit 'ee854b077766a85279fa1849b537c50837d1a204':
  Allocate a UID for clatd
2012-11-12 15:57:02 -08:00
Josef Kindberg 6d358ae44c libsysutils: Increase command buffersize and command args
Needed to support tethering of multiple remote Bluetooth devices.

Change-Id: I9f736affd83226e8b2fa4f0faacd3654175dd8c9
Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
2012-11-12 14:40:21 +01:00
Elliott Hughes 663005248d The localtime_tz and mktime_tz extensions are now in bionic.
Bug: 7012465

(cherry-pick of d03072ffde3279fbb60591a0d07c820d8e792762.)

Conflicts:

	libcutils/Android.mk

Change-Id: I5e34edd4c8f59cc0a4d5dcc4740707ae063608a0
2012-10-18 11:38:23 -07:00
Daniel Drown b49183f122 Allocate a UID for clatd
clatd(464xlat) runs as its own UID after it drops root privs

Change-Id: I2392f8127dcd90d16b0f20ff31bcc5aa096db464
Signed-off-by: Daniel Drown <dan-android@drown.org>
2012-10-15 20:22:53 -05:00
Jean-Michel Trivi 371fc00fc5 Remove force use definition for remote audio submix
Obsolete.

Bug 7318180

Change-Id: I3421ca554a4131d606bdee698aeb7b2091a5d966
2012-10-11 19:13:58 -07:00
Eric Laurent 4daa843432 audio policy: add forced uses for system
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
2012-10-09 09:39:03 -07:00
Matthew Xie 971153aa4a Create bluetooth stack aid for sharing gid between all bluetooth processes
bug 6925422

Change-Id: I8d371f8307dd6bea3909a56643819413ea829a98
2012-10-04 12:38:51 -07:00
Jesse Hall bc930eda39 Move dequeue-buffer-and-wait out-of-line
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
2012-10-01 14:02:45 -07:00
Elliott Hughes 2dbef6ae08 Merge "The localtime_tz and mktime_tz extensions are now in bionic." 2012-09-24 08:41:43 -07:00
Jamie Gennis 96094ae27c ANW: fix my fix for a file descriptor leak
Change-Id: Ief7b973fbdb76920abed19707963a0c3d306af31
2012-09-20 17:25:23 -07:00
Zhihai Xu e16534f8f7 Merge "ISSUE 6849488 Bluedroid stack, remove system/bluetooth." into jb-mr1-dev 2012-09-20 16:43:26 -07:00
Mathias Agopian 37bd30bfd5 Merge "ANW: fix an fd leak" into jb-mr1-dev 2012-09-20 14:09:08 -07:00
Ying Wang 813601785f Merge "Move AndroidConfig.hs to the build project." into jb-mr1-dev 2012-09-20 14:07:52 -07:00
Jamie Gennis 9bd8dd3b13 ANW: fix an fd leak
Change-Id: Id44cae6732c6694d2f470cbdfa5f59e7474f704f
2012-09-20 11:43:43 -07:00
Zhihai Xu c2f59d87d8 ISSUE 6849488 Bluedroid stack, remove system/bluetooth.
remove system/bluetooth stuff.

bug 6849488
Change-Id: I81a94d34a4363562a74fa2e574828fd919cfe18c
2012-09-20 10:55:06 -07:00
Ying Wang 07a56fb0d3 Move AndroidConfig.hs to the build project.
Change-Id: I482e36f9e7f665d7cfe43463c9cbc15846e8b20a
2012-09-20 10:05:51 -07:00
Rebecca Schultz Zavin 3cfcc30005 Add explicit sync call to ion library
Bug: 6854979
Change-Id: I535d55af897eeb4ed707b5da54f3fbf36afa452c
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2012-09-20 09:46:19 -07:00
Jeff Sharkey 7918d81640 Merge "Wrap system calls in TEMP_FAILURE_RETRY." into jb-mr1-dev 2012-09-13 15:07:42 -07:00
Jeff Sharkey ddb1733944 Wrap system calls in TEMP_FAILURE_RETRY.
fs_prepare_dir() is used heavily during Zygote init, and can easily
run into EINTR.

Bug: 7151474
Change-Id: I7aac43a43483d55db47ca20456fff68ce51bbc46
2012-09-13 15:02:53 -07:00
Kenny Root ad59e0a90e am c92961dc: am b905f121: am 9796a83a: Merge "Add shared app gid to fs config"
* commit 'c92961dccb38c6e6a9dbcf519bd59461bbc0dc7c':
  Add shared app gid to fs config
2012-09-13 13:06:58 -07:00
Kenny Root 7e41c8420e Add shared app gid to fs config
This will allow native tools to be able to know where the shared app
gids start and end.

Change-Id: Ie4529baf36b361c51c42f079b259c352e316647f
2012-09-13 11:23:55 -07:00
Elliott Hughes d03072ffde The localtime_tz and mktime_tz extensions are now in bionic.
Bug: 7012465
Change-Id: I5f3d06fe06fad7c3ff6d1950770a30f4f83e56ff
2012-09-11 11:18:38 -07:00
Eric Laurent eeeee802e9 audio: new audio devices enum values
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
2012-09-07 10:37:43 -07:00
Jean-Michel Trivi e11866a879 Device and mode definitions for remote submix
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
2012-09-06 15:08:17 -07:00
Jeff Sharkey 9685194fc9 File-system utilities for installd and zygote.
Bug: 7008879
Change-Id: Ia54b8d4ad434e8973f235e2a4728651814bef8a9
2012-08-30 10:29:41 -07:00
Wink Saville af03b05009 Merge "Export flags needed for ifc_reset_connections API in netutils" 2012-08-28 19:43:27 -07:00
Ian Rogers fd7f1b6a50 Revert "Revert "Upgrade to dlmalloc 2.8.5.""
This reverts commit 42b83c6df7.
2012-08-28 15:52:20 -07:00
Jamie Gennis d7c8fe6abb Merge "Add an IMPL_DEFINED pixel format." into jb-mr1-dev 2012-08-24 11:11:32 -07:00
Jeff Sharkey 42a1e6c9d8 Merge "Iteration on multi-user external storage." into jb-mr1-dev 2012-08-22 18:17:23 -07:00
Jamie Gennis febe9d904f Add an IMPL_DEFINED pixel format.
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
2012-08-22 14:44:51 -07:00
Jeff Sharkey bfcd810b79 Iteration on multi-user external storage.
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
2012-08-22 14:28:37 -07:00
Brian Carlstrom 42b83c6df7 Revert "Upgrade to dlmalloc 2.8.5."
This reverts commit 2d13791ce7.
2012-08-22 12:10:19 -07:00
Erik Gilling 984d35703d update libsync to support new timeout semantics
Change-Id: Ibedbd261bb96a84785c4e679b6fc4061287d5d7d
2012-08-21 18:21:18 -07:00
Brian Carlstrom 1768707951 am e05ac541: am 9d779bf1: Merge "Upgrade to dlmalloc 2.8.5."
* commit 'e05ac5415e861dee6a3f175c8066ff577736ba1f':
  Upgrade to dlmalloc 2.8.5.
2012-08-20 17:04:24 -07:00
Ian Rogers 2d13791ce7 Upgrade to dlmalloc 2.8.5.
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
2012-08-20 15:30:35 -07:00
Jeff Brown a8c2112be6 Merge "Migrate sdcard0 to shell-accessible location." into jb-mr1-dev 2012-08-20 13:15:39 -07:00
Jeff Sharkey 5dd0f86fbf Migrate sdcard0 to shell-accessible location.
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
2012-08-20 13:11:11 -07:00
Jean-Baptiste Queru 80da83ac31 am cd82a6fe: am 36b1399d: Merge "diskconfig: Add missing include for loff_t"
* commit 'cd82a6fea05d1fa06cb0ac56d2dbb27b013b8eaa':
  diskconfig: Add missing include for loff_t
2012-08-20 10:29:37 -07:00
Jean-Baptiste Queru 36b1399d8c Merge "diskconfig: Add missing include for loff_t" 2012-08-20 09:18:06 -07:00