summaryrefslogtreecommitdiffstats
path: root/libs/utils
Commit message (Collapse)AuthorAgeFilesLines
* utils/SharedBuffer: Make variable write atomicDeva Ramasubramanian2011-10-201-1/+1
| | | | | | | | On release(), mRefs write has a data race with SharedBuffer::onlyOwner(). This change makes the write atomic. Change-Id: If5d71800e15214b237b00ba8cb0258967b6472c7
* Merge branch 'gingerbread' of ↵Steve Kondik2011-07-261-12/+36
| | | | | | | | | | | | | | git://android.git.kernel.org/platform/frameworks/base into upstream-2.3.5 Conflicts: core/java/android/content/pm/IPackageManager.aidl core/java/android/server/BluetoothService.java packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java services/java/com/android/server/PackageManagerService.java telephony/java/com/android/internal/telephony/gsm/GSMPhone.java wifi/java/android/net/wifi/WifiStateTracker.java Change-Id: I254bd490297376ae8070fffcb07d4fe15afe3a8d
* libutils: Fix an improper const-cast in RefBaseJosh Stone2011-04-221-1/+1
| | | | | | | | | | | | | | | | Under Fedora 15 Beta, gcc 4.6.0 warns: frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’: frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive] trackMe is not a const function, so don't use const in the static_cast to a weakref_impl pointer. Change-Id: I3c9ba73eb127985f5f54197ffecf2939c50f632c
* Fixed cyanogenmod issue 2861: asset redirection breaks access to ↵Josh Guilfoyle2011-03-081-8/+21
| | | | | | | | | | | | | | | | AndroidManifest.xml. Themed asset managers lose the ability to access application assets without a cookie because the search order favors most recently added asset paths (theme apks are added last). So, searching for AndroidManifest.xml would always return the themes manifest, not the application manifest. The solution is to mark the themed asset path and ignore it when searching for cookie-less assets. This should not cause problems with theme application because the theme uses resource identifier based redirections which always retain the asset path cookie that is to be used to load the final resource.
* Merge branch 'gingerbread' of ↵Steve Kondik2011-02-281-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://android.git.kernel.org/platform/frameworks/base into 233-merge Conflicts: api/current.xml core/java/android/content/pm/PackageParser.java core/java/android/net/ConnectivityManager.java core/java/android/widget/TextView.java core/java/com/android/internal/os/BatteryStatsImpl.java core/res/res/drawable-mdpi/btn_check_off.png core/res/res/drawable-mdpi/btn_check_off_disable.png core/res/res/drawable-mdpi/btn_check_off_disable_focused.png core/res/res/drawable-mdpi/btn_check_off_pressed.png core/res/res/drawable-mdpi/btn_check_off_selected.png core/res/res/drawable-mdpi/btn_check_on.png core/res/res/drawable-mdpi/btn_check_on_disable.png core/res/res/drawable-mdpi/btn_check_on_disable_focused.png core/res/res/drawable-mdpi/btn_check_on_pressed.png core/res/res/drawable-mdpi/btn_check_on_selected.png core/res/res/values-ca/strings.xml core/res/res/values-de/strings.xml core/res/res/values/config.xml include/media/AudioSystem.h include/media/mediarecorder.h media/java/android/media/MediaRecorder.java media/libmedia/AudioSystem.cpp media/libstagefright/StagefrightMediaScanner.cpp media/libstagefright/rtsp/ARTSPConnection.cpp media/libstagefright/rtsp/ASessionDescription.cpp media/libstagefright/rtsp/MyHandler.h policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java policy/src/com/android/internal/policy/impl/LockScreen.java policy/src/com/android/internal/policy/impl/PhoneWindowManager.java policy/src/com/android/internal/policy/impl/RecentApplicationsDialog.java services/audioflinger/AudioPolicyManagerBase.cpp services/java/com/android/server/PackageManagerService.java services/java/com/android/server/am/ActivityManagerService.java test-runner/src/android/test/mock/MockPackageManager.java voip/java/android/net/sip/SipProfile.java voip/java/com/android/server/sip/SipService.java wifi/java/android/net/wifi/WifiStateTracker.java Change-Id: Ia65d02a66c6206b5f4ed95c3a64e3f28a03e7329
| * Merge from open-source gingerbreadJean-Baptiste Queru2011-01-301-0/+1
| |\ | | | | | | | | | Change-Id: I56f2ed37187796807fbf0de15274a85164f9432c
| * | Fix issue 3302649.Eric Laurent2011-01-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cause of the problem is that AudioTrack::start() can fail if it is called from a newly created thread that has the same ID as the AudioTrack callback thread that has just been stopped and not yet exited. This is possible as the thread ID used by the Thread class is not the TID. The fix consists in clearing the thread ID before exiting the thread loop. Change-Id: I66e679665c384403cb3ba2c31746f5de72d5836d
* | | Normalize output from aapt dShachar Shemesh2011-02-051-2/+34
| | | | | | | | | | | | | | | | | | | | | Make the output from aapt dump --values resources and aapt dump xmltree normalized, so that it is unambigously displayed regardless of the content of the strings. Change-Id: Ia3bff36c4ee1e9a44f474534e154830948beabdf
* | | Merge branch 'themes-2.3.1_r1' of ↵Steve Kondik2011-02-042-231/+11
|\ \ \ | | | | | | | | | | | | https://github.com/tmobile/themes-platform-frameworks-base into HEAD
| * | | Removed AssetManager#dumpResources.Josh Guilfoyle2011-02-042-168/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This method was used only for debugging and has not been useful for quite a long time. Change-Id: I38f3c60bb6a7400758623ac80faf2350e387d51e
| * | | Removed dead theme engine code.Josh Guilfoyle2011-02-041-53/+0
| | | | | | | | | | | | | | | | Change-Id: Ib9581787b7f2a305633c17cebe4404b02c01bee5
| * | | Corrected whitespace trespasses.Josh Guilfoyle2011-02-041-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many small whitespace mistakes slipped into the framework as the themes feature was developed. This patch reverts them to make a cleaner patch set against android-2.3.1_r1. Change-Id: I52223c1d572d4f013e37bebc5c11bb7b1c595eb3
* | | | Merge branch 'gingerbread' of ↵Steve Kondik2011-01-301-0/+1
|\ \ \ \ | |/ / / |/| | / | | |/ | |/| git://android.git.kernel.org/platform/frameworks/base into HEAD
| * | fix failing thread object runRitu Srivastava2011-01-251-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | A previously exited Thread object refuses to run again, if the thread-id of the caller, conincides with the thread-id it previously used in the worker thread. Hence reset the previously used worker thread-id to -1 when it exits. Signed-off-by: Ritu Srivastava <rsrivast@sta.samsung.com> Change-Id: I873925c312a43ec8a16392b98cc959042ff6bfd2 Signed-off-by: Madan Ankapura <mankapur@sta.samsung.com>
* | Fixed a regression causing theme switch to fail.Josh Guilfoyle2011-01-201-0/+7
| | | | | | | | | | | | | | | | This would only occur when switching from one theme APK to another, which apparently was not tested on the experimental branch (??). The bug would not repro if switching between system default and a theme APK. Change-Id: I9fc0b5c50c1dff4a0b2d548980977faaa0a51167
* | Asset redirections are now managed by a system service.Josh Guilfoyle2011-01-205-731/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | Adjusted the asset redirection design to use a common system service (AssetRedirectionManagerService) for synchronization and cache management. This replaces the old /data/res-cache design completely (nothing is written to disk now). This change also moves a large amount of code from the C++ layer to Java for parsing the theme meta data and redirection XML files, though the actual redirection still occurs at the native layer. Change-Id: I8820e39425135269f5e723534c4b9c8dc6841779
* | Fix issues with theme APKs that do not specify a styleId.Josh Guilfoyle2010-12-271-3/+3
| |
* | Merge commit 'android-2.3.1_r1' into themes-exp-2.3.1_r1Josh Guilfoyle2010-12-2319-238/+2497
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: core/java/android/app/ActivityThread.java core/java/android/content/pm/ApplicationInfo.java core/java/android/content/pm/PackageParser.java core/res/AndroidManifest.xml services/java/com/android/server/PackageManagerService.java services/java/com/android/server/SystemServer.java test-runner/src/android/test/mock/MockPackageManager.java
| * Initialized check in ZipFileRO::findEntryByNameKenny Root2010-10-211-1/+9
| | | | | | | | | | | | | | | | If a ZipFileRO object is uninitialized, the hash table will not have been initialized. This condition wasn't checked in findEntryByName. Bug: 3121109 Change-Id: Ib696e0e7e0cb4dd0fb2e456d6a847e5e8f4fe14e
| * Reduce logging.Joe Onorato2010-10-191-1/+2
| | | | | | | | | | | | | | | | | | | | Remember, the system and main logs are - Shared resources - Primarily for recording problems - To be used only for large grained events during normal operation Bug: 3104855 Change-Id: I136fbd101917dcbc8ebc3f96f276426b48bde7b7
| * MinGW/Cygwin requires open() in O_BINARY mode.Raphael Moll2010-10-131-20/+37
| | | | | | | | | | | | Alsso printf %zd is not supported on MinGW/Cygwin. Change-Id: I03811dabb46e2b05dd1d8abcc0ff97b125c77d54
| * OBB: use PBKDF2 for key generation.Kenny Root2010-10-132-17/+45
| | | | | | | | | | | | | | | | | | Switch to using PBKDF2 for the key generation for OBBs. Any previously generated OBBs will stop being read correctly. A small pbkdf2gen program is available to allow generation of appropriate keys with the salts. Bug: 3059950 Change-Id: If4305c989fd692fd1150eb270dbf751e09c37295
| * Switch Looper back to using poll() instead of epoll().Jeff Brown2010-10-072-45/+254
| | | | | | | | | | | | | | | | | | | | | | | | Added a couple of micro-optimizations to avoid calling wake() unnecessarily and reduce JNI overhead slightly. Fixed a minor issue where we were not clearing the "next" field of Messages returned by the MessageQueue so the Message would hold on to its successor and potentially prevent the GC from collecting it if the message were leaked somehow. Change-Id: I488d29417ce0cdd7d0e447cda76ec978ef7f811c
| * Use pread() in ZipFileRO for LinuxKenny Root2010-10-041-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AssetManager instances are created by zygote and passed to all its children so that they don't have to individually open frameworks-res.apk. This creates a problem for determining the current file offset when using lseek() on those files, because you can't guarantee the cross-process locking of a mutex. Luckily, Linux implements pread() to get around this suckiness. The problem is that only Linux implements this, so we have to keep the old locking for use on host builds with aapt and friends. aapt doesn't have this same problem of sharing file descriptors across forked processes, so we can keep the local AutoMutex to protect accesses of those files. Change-Id: Ibe9f11499a53fe345f50fbaea438815ec0fd363e
| * ZipFileRO: moar logging and wrap closeKenny Root2010-10-011-7/+19
| | | | | | | | | | | | | | | | | | | | | | | | There is apparently still a race upon reading the entry Local File Header that can't be tracked down, so move the LFH check inside the mutex-protected block so we can call lseek again to see where we are when we log an error. Also, close() can fail so use TEMP_FAILURE_RETRY on it so we don't unwittingly leak file descriptors when Mean Mr. EINTR comes a-knocking. Change-Id: I753abad0bd882fe28f7281c406fa76f64393ef4c
| * Revert "Revert "Free created FileMap when uncompressing files""Kenny Root2010-09-241-5/+9
| | | | | | | | This revert reverts commit a19ef306bd0a257c67b50f5e0e669e9fe52b0889.
| * Add locking around ZIP seekingKenny Root2010-09-241-10/+17
| | | | | | | | | | | | | | | | Since we switched to seeking to the LFH to verify its existence instead of a huge mmap of the file, we have to guarantee that another seek doesn't happen before we finish our read on the LFH. Change-Id: If8135d9cb6f2f5cc4db734eafa4f6b5f6269c62a
| * Looper: use pthread_once for TLS key initialization.Jeff Brown2010-09-211-15/+14
| | | | | | | | | | | | | | | | Also fix a Valgrind complaint by zeroing out the entire epoll event struct since otherwise the data field union would be partly uninitialized (but not in a harmful way). Change-Id: I2091ce517e87fcad7c9caf90e2c5e4854a7ca465
| * Reduce lock thrashing in native Looper.Jeff Brown2010-09-171-32/+38
| | | | | | | | | | | | | | | | In the common case, there is nothing interesting happening on the native Looper besides occasional wake ups. There is no point grabbing the semaphore then. Change-Id: Ib5c426d0e158dfa37891b7ff5537b6f833592fad
| * Ensure input dispatcher and native looper handles EINTR.Jeff Brown2010-09-161-4/+10
| | | | | | | | Change-Id: I0a42db5f273b9bfe4ab174e4ee65d5d852f9f6bc
| * Replace epoll() with poll() and rename PollLoop to Looper.Jeff Brown2010-09-146-749/+803
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As part of this change, consolidated and cleaned up the Looper API so that there are fewer distinctions between the NDK and non-NDK declarations (no need for two callback types, etc.). Removed the dependence on specific constants from sys/poll.h such as POLLIN. Instead looper.h defines events like LOOPER_EVENT_INPUT for the events that it supports. That should help make any future under-the-hood implementation changes easier. Fixed a couple of compiler warnings along the way. Change-Id: I449a7ec780bf061bdd325452f823673e2b39b6ae
| * Input dispatcher ANR handling enhancements.Jeff Brown2010-09-121-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is essentially a rewrite of the main input dispatcher loop with the target identification folded in. Since the input dispatcher now has all of the window state, it can make better decisions about when to ANR. Added a .5 second deadline for processing app switch keys. This behavior predates Gingerbread but had not previously been ported. Fixed some timing inaccuracies in the ANR accounting that could cause applications to ANR sooner than they should have. Added a mechanism for tracking key and motion events that have been dispatched to a window so that appropriate cancelation events can be synthesized when recovering from ANR. This change helps to keep applications in sync so they don't end up with stuck buttons upon recovery from ANRs. Added more comments to describe the tricky parts of PollLoop. Change-Id: I13dffca27acb436fc383980db536abc4d8b9e6f1
| * Always set the scheduling group when starting a new thread.Dianne Hackborn2010-09-091-16/+23
| | | | | | | | Change-Id: Ia33acf13fc3752707f3819928c36315e223fa1bd
| * Revert "Free created FileMap when uncompressing files"Kenny Root2010-09-071-9/+5
| | | | | | | | | | | | | | | | | | This reverts commit 52b8235238fb4d8cf141020cc1ae33880929dc3f. munmap() on a region that overlaps something else (e.g, the ZIP Central Directory in this case) unmaps those other regions as well making the ZipFileRO class unhappy. Revert this for now until we can have FileMap deal with this craziness.
| * Modify native ALooper to take an explicit ident.Dianne Hackborn2010-09-071-6/+13
| | | | | | | | | | | | | | | | The ALooper API now uses an explicit "identifier" for the integer that is returned rather than implicitly using the fd. This allows the APIs that had the fd to be a little more sane. Change-Id: I8507f535ad484c0bdc4a1bd016d87bb09acd7ff0
| * Hopefully fix the build.Dianne Hackborn2010-09-071-0/+2
| | | | | | | | Change-Id: Id8cd92c0895c9939e1386ef488bd1309a3be3568
| * Add system property to turn off scheduling groups.Dianne Hackborn2010-09-071-8/+29
| | | | | | | | | | | | | | | | Do this: adb shell setprop debug.sys.noschedgroups 1 Change-Id: I6e06a74205fd45ee1526ce71fe33944465d39984
| * Add better debug output for ResourceType errorsKenny Root2010-09-021-2/+2
| | | | | | | | | | | | | | | | An error code is returned as -ESOMETHING, but the debug code was printing out 0x%08x for these codes making -74 print out as 0xffffffb5 which is kind of silly. Change-Id: I7d77fb3da2e146845949f121404f662b47288e61
| * Add debugging to ZipFileROKenny Root2010-08-271-2/+2
| | | | | | | | | | | | | | Some assets are failing to read from ZIP files. This adds a bit more debugging to figure out what's going on. Change-Id: Id90e10546c54c85069a34478fbc28bc2523bda5d
| * Free created FileMap when uncompressing filesKenny Root2010-08-191-5/+9
| | | | | | | | Change-Id: Ice22c4ecb7c129b74bf60cd66ae79e110b017a4a
| * Add OBB flags to support overlaysKenny Root2010-08-181-10/+22
| | | | | | | | | | | | | | | | | | | | | | * Add flags field in OBB footer to support overlays. * Remove unused 'crypto' and 'filesystem' fields in obbtool (could later be supported in the "flags" field of the OBB footer). * Add notes to document OBB classes before shipping. Change-Id: I386b43c32c5edef55210acb5d3322639c08010ba
| * Initial tool for OBB manipulationKenny Root2010-08-111-3/+39
| | | | | | | | | | | | | | Add "obbtool" host command for adding, removing, and querying Opaque Binary Blob (OBB) information from a file. Change-Id: Id2ac41e687ad2a500c362616d6738a8ae7e8f5c3
| * More native work.Dianne Hackborn2010-08-111-0/+6
| | | | | | | | | | | | | | Implement save/restore of state, and add native APIs for configuration information. Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
| * Fix String8::operator+Kenny Root2010-08-062-2/+78
| | | | | | | | | | | | | | | | | | | | | | The LHS was ignored when using: String8 + String8 String8 + (const char*) Add unit tests for above. Bug: 2898473 Change-Id: Ic8fe7be668b665c36aaaa3fc3c3ffdfff0fbba25
| * Free scanBuf in ZipFileROKenny Root2010-08-041-6/+4
| | | | | | | | | | | | | | | | | | In the success case, the 65kB scanBuf was not freed! Also, get rid of annoying complaints about ssize_t from printf in error cases. Change-Id: If154ac19bf47637f898b4ec8c8e27c9a073a7b81
| * Attempt to fix the SDK buildChristopher Tate2010-07-291-4/+4
| | | | | | | | | | | | | | | | On the assumption that the local min() function declaration is in conflict with some 'min' #define floating around, rename the local function to min_of(). Change-Id: I62aa27f213c6093cc78805de611cf4aa75f0eef2
| * Change unistd.h to stddef.h to be correctKenny Root2010-07-281-1/+1
| | | | | | | | | | | | size_t should be defined through inclusion of stddef.h instead of unistd.h Change-Id: Ieaadacfca1e1c44c2533ea95f73fc060c1519b52
| * Add unistd.h for size_t typedef to fix sim-engKenny Root2010-07-281-0/+1
| | | | | | | | Change-Id: Ida4f1742547f39539b601f13182c722aa7cf863e
| * Support streaming of compressed assets > 1 megabyteChristopher Tate2010-07-283-30/+271
| | | | | | | | | | | | | | | | | | | | | | | | Compressed assets larger than one megabyte are now decompressed on demand rather than being decompressed in their entirety and held in memory. Reading the data in order is relatively efficient, as is seeking forward in the stream. Seeking backwards is supported, but requires reprocessing the compressed data from the beginning, so is very inefficient. In addition, the size limit on compressed assets has been eliminated. Change-Id: I6e68247957e6c53e7e8ba70d12764695f1723bad
| * Fix bug with phantom input windows.Jeff Brown2010-07-161-7/+29
| | | | | | | | | | | | | | | | | | | | | | Add dumpsys integration for the native input dispatcher. Add some InputDevice API stubs. Add an appendFormat helper method to String8 for printf style string formatting mainly for debugging purposes. Use generic ArrayList<WindowState> everywhere in WindowManagerService to eliminate unnecessary casts all over. Change-Id: I9d1e3bd90eb7222d10620200477f11b7bfd25e44