summaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Cache resource ID lookups in aaptChristopher Tate2012-11-284-5/+148
| | | | | | | | | | This speeds up certain workloads considerably, particularly those involved in buildling apps via the SDK. Windows-based use should particularly benefit from the change. (cherry picked from commit d8dde13a63565dcd72bcf03a5088407b737ba793) Change-Id: I33835bc64ade77688d41e8bfcd371b0a5f59d8fd
* Add mechanism to kick keyguard to show the assistantJim Miller2012-11-081-0/+5
| | | | | | Fixes bug 7499778 Change-Id: Ic9ea514feb489feeee6716f40bdb9792842f9515
* Add isSafeModeEnabled() API to WindowManagerServiceJim Miller2012-11-051-0/+5
| | | | | | | This adds a means of determining when the device is in safe mode, as required by keyguard to disabled some features. Change-Id: I31d357e6738c92e1837f9e0263e5f3f4de66315a
* Layoutlib: Read and close XML files as soon as possible.Xavier Ducrohet2012-10-181-3/+68
| | | | | | | | | | | Because passing an InputStream to KXML does not close the stream after the file has been parsed, the files are staying locked on windows until the gc and finalizers are run. This change preload the XML files and close their stream, and then pass the content in a stream to the parser. Change-Id: Iabe27989dc616ec9e7de88e52b1ec3af9f007f7c
* Update layoutlib for jb mr1.Xavier Ducrohet2012-10-1729-95/+184
| | | | | | | | | | | Status bar displayed on all devices. Update logic for displaying nav bar to whether or not device has soft button. Update navigation buttons to new look. Remove battery and signal from navigation bar. Change-Id: I8241d71269a17126218a3062ba727e379a8e6c25
* Fix SDK layout rendering in Eclipse.Xavier Ducrohet2012-10-159-28/+186
| | | | Change-Id: I0e9e85632012c0929b987ee9d0ccf7c25eece322
* Merge "Adds showWhenLocked attribute to Activities." into jb-mr1-devCraig Mautner2012-10-071-1/+2
|\
| * Adds showWhenLocked attribute to Activities.Craig Mautner2012-10-061-1/+2
| | | | | | | | | | | | | | | | The new attribute allows an Activity such as the alarm to appear on all users screens. Bug: 7213805 fixed. Change-Id: If7866b13d88c04af07debc69e0e875d0adc6050a
* | Coordinate screen on with the window manager.Jeff Brown2012-10-051-2/+2
| | | | | | | | | | Bug: 7267457 Change-Id: Ic2c322253639e1f0b2e4e72a7b145025d0240f93
* | Plumbing to allow keyguard to be shown with user switcher (issue 7175023)Adam Cohen2012-10-041-1/+2
|/ | | | | | -> Also reduced calls to lockNow, and moved this call in ActivityManagerService Change-Id: I9ba34ca902f7c0f71fa4ec302104688ca8d11f55
* Fix issue #7267494, issue #7212347Dianne Hackborn2012-10-031-1/+6
| | | | | | | | | | | | | | | 7267494 Calendar is not syncing Check for whether a content provider is dead before returning it. This is kind-of a band-aid, but probably the right thing to do; I'm just not sure exactly the full details of why this problem is happening. Hopefully this "fixes" it, though I don't have a way to repro to tell. 7212347 System power off dialog is only visible to user 0 Make it visible. Also turn on some battery debugging stuff and clean it up so we can just keep it. Change-Id: I5add25bf2a763c8dfe1df23bc5c753a9ea5d157a
* New internal API to eliminate poke locks.Jeff Brown2012-10-011-5/+0
| | | | | | | | | | | Added a new WindowManager.LayoutParams inputFeatures flag to disable automatic user activity behavior when an input event is sent to a window. Added a new WindowManager.LayoutParams field userActivityTimeout. Bug: 7165399 Change-Id: I204eafa37ef26aacc2c52a1ba1ecce1eebb0e0d9
* Remove clearUserActivityTimeout().Jeff Brown2012-09-301-5/+0
| | | | | | | This function is not implemented and not needed. Bug: 7165399 Change-Id: Ib1c50fabad6292ccf670404ba70aeb1242c4614d
* Get rid of preventScreenOn().Jeff Brown2012-09-281-5/+0
| | | | | Bug: 7165399 Change-Id: I1968265ecd74fff4d85efd2ca03b1983425ea518
* Make DreamManagerService more robust.Jeff Brown2012-09-261-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clearly isolated the DreamManagerService and DreamController responsibilities. DreamManagerService contains just enough logic to manage the global synchronous behaviors. All of the asynchronous behaviors are in DreamController. Added a new PowerManager function called nap() to request the device to start napping. If it is a good time to nap, then the PowerManagerService will call startDream() on the DreamManagerService to start dreaming. Fixed a possible multi-user issue by explicitly tracking for which user a dream service is being started and stopping dreams when the current user changes. The user id is also passed to bindService() to ensure that the dream has the right environment. Fix interactions with docks and the UI mode manager. It is important that we always send the ACTION_DOCK_EVENT broadcast to the system so that it can configure audio routing and the like. When docked, the UI mode manager starts a dock app if there is one, otherwise it starts a dream. This change resolves issues with dreams started for reasons other than a user activity timeout. Bug: 7204211 Change-Id: I3193cc8190982c0836319176fa2e9c4dcad9c01f
* Fix writing text version of styleable IDs. do not merge.Xavier Ducrohet2012-09-261-1/+1
| | | | | | (cherry picked from commit d16047434bca24b2811de7ea9d22de6ee0f87f79) Change-Id: Ic679080d5157daf77c35516c8f682bd13e2b4d96
* Merge into jb-mr1-devJean-Baptiste Queru2012-09-251-4/+2
|\ | | | | | | Change-Id: I5a9970a011de789aaeb1c4c4ed58ae750071b135
| * Allow multiple 'parcelable' declarations in aidl filesAdam Powell2012-08-161-4/+2
| | | | | | | | | | | | | | This solves a problem with declaring multiple Parcelable static inner classes. Change-Id: I5e42b412d6d937df19a388988be5aa58a8dbc3e4
* | Allow acquiring ContentProviders across users.Jeff Sharkey2012-09-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise services like SystemUI will always open content://-style Uris as USER_OWNER. Surfaces through createPackageContextAsUser() which points all ContentResolver operations towards a given user. Start using in RemoteViews, so that Notifications correctly resolve image Uris to the sending user. Also add user support for "content" shell tool. Bug: 7202982 Change-Id: I8cb7fb8a812e825bb0b5833799dba87055ff8699
* | Update preloaded-classes for JB-MR1Kenny Root2012-09-191-0/+4
| | | | | | | | | | Bug: 5213043 Change-Id: I13fa58fded8e47d2f11d1fbe6724bd81ce35276a
* | am 79c95c3b: am 5de96035: am 31820a35: Merge "Add --output-text-symbols ↵Xavier Ducrohet2012-09-173-14/+205
|\ \ | | | | | | | | | | | | | | | | | | option to aapt." * commit '79c95c3b50ff332f9c92430fd10a15eb648a0b02': Add --output-text-symbols option to aapt.
| * \ am 31820a35: Merge "Add --output-text-symbols option to aapt."Xavier Ducrohet2012-09-173-14/+205
| |\ \ | | | | | | | | | | | | | | | | * commit '31820a35b2cf864a8dcb71d43e6fd21d54f49a2d': Add --output-text-symbols option to aapt.
| | * | Add --output-text-symbols option to aapt.Xavier Ducrohet2012-09-113-14/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Library projects in the SDK are built using --non-constant-id to generate a temporary R.java class. When the library is packaged with the application to generate an apk, the R class is recreated with the proper IDs due to all the resources coming from the app and all the libraries. However for large apps with many libraries (each with their own R class in their package), this means a lot of unnecessary IDs: all R classes contains all the IDs including for resources from by projects they don't have access through the dependency graph. For really large apps (X,000 resources), with lots of libraries (10+), this can generate tens of thousands of resources, which can trigger dalvik's limit of 65K fields and methods per dex files. This changes lets aapt generate not only the R class but a simple text file containing the list of all those IDs so that it is easier to parse back. The SDK build system will not ask aapt to generate the R class of the libraries (through the --extra-packages option), instead it will then read this file to know what IDs are needed for each library and generate a much smaller R class for each library (using the same text file output from compiling all the resources to get the final integer value). Change-Id: I4db959fec372cf3ead9950e4b2b82fa1ae7eed2d
* | | | am 8a67598e: am cc9747ed: am d7252571: Merge "Add --error-on-failed-insert ↵Xavier Ducrohet2012-09-173-19/+60
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | option to aapt." * commit '8a67598eb780560b7efe4e1d9944c7cbcf83bbb1': Add --error-on-failed-insert option to aapt.
| * | | am d7252571: Merge "Add --error-on-failed-insert option to aapt."Xavier Ducrohet2012-09-173-19/+60
| |\ \ \ | | |/ / | | | | | | | | | | | | * commit 'd72525718ea7ef3e1f97cf557365b143c8919a5b': Add --error-on-failed-insert option to aapt.
| | * | Add --error-on-failed-insert option to aapt.Xavier Ducrohet2012-09-113-19/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new SDK build system give the ability to insert versionCode/Name and min/targetSdkVersion in the manifest but aapt won't replace those if they already exist. The main problem is that aapt doesn't actually fail when it doesn't replace them, making the output not what the developer wanted. This patch set adds an option to aapt to make it return an error if the insert failed because the attribute already existed. Change-Id: I8938ec1238da407a8562c974e9598db39001ffd9
* | | | Animations for user switching.Dianne Hackborn2012-09-101-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The window manager now has a facility to provide a full-screen animation, which the activity manager uses every time a user switch happens. The current animation is just a simple dumb slide until we get a design from UX. Also some cleanup: moved the portrait task animations to the default config so we always have an animation for them, and finally got the java symbol stuff out of public.xml. Change-Id: I726f77422b2ef5f2d98f961f8da003e045f0ebe8
* | | | am 61d09810: am 3150feef: am bfe1ab82: Merge "Fix aapt to get expat header ↵Elliott Hughes2012-09-092-2/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | files from the approved location." * commit '61d09810a7b478810adc15af2495136255377e25': Fix aapt to get expat header files from the approved location.
| * | | am bfe1ab82: Merge "Fix aapt to get expat header files from the approved ↵Elliott Hughes2012-09-092-2/+1
| |\ \ \ | | |/ / | | | | | | | | | | | | | | | | | | | | location." * commit 'bfe1ab825731d365fef169deab646d7ceeafc998': Fix aapt to get expat header files from the approved location.
| | * | Fix aapt to get expat header files from the approved location.Elliott Hughes2012-09-092-2/+1
| | | | | | | | | | | | | | | | Change-Id: Ic7c796e048cfe98ee355c18b3708fee5ea716e2e
* | | | Merge "Use "ldrtl" and "ldltr" config qualifiers for RTL / LTR resources" ↵Fabrice Di Meglio2012-09-071-2/+2
|\ \ \ \ | | | | | | | | | | | | | | | into jb-mr1-dev
| * | | | Use "ldrtl" and "ldltr" config qualifiers for RTL / LTR resourcesFabrice Di Meglio2012-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - we cannot use "rtl" / "ltr" qualifiers as they can conflict with ISO-639 Alpha-3 codespace which uses 3 letters for identifying a language code (and could use either "rtl" or "ltr" strings for defining a language in the future). - we are using instead "ldrtl" for RTL and "ldltr" for LTR resources. Those qualifiers are defined by more than 3 chars and outside of what is defined into ISO-639. They are also more understandable as "ld" prefix is for "layoutdirection" Change-Id: Id43e948103707e09bef63ebd54ac1779dde58e72
* | | | | Fixing the buildSvetoslav Ganov2012-09-061-8/+3
| | | | | | | | | | | | | | | | | | | | Change-Id: I123b128f5d9e50653d8d4ed73ea07920b370b0fb
* | | | | Screen magnification - feature - framework.Svetoslav Ganov2012-09-062-21/+41
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is the initial check in of the screen magnification feature. This feature enables magnification of the screen via global gestures (assuming it has been enabled from settings) to allow a low vision user to efficiently use an Android device. Interaction model: 1. Triple tap toggles permanent screen magnification which is magnifying the area around the location of the triple tap. One can think of the location of the triple tap as the center of the magnified viewport. For example, a triple tap when not magnified would magnify the screen and leave it in a magnified state. A triple tapping when magnified would clear magnification and leave the screen in a not magnified state. 2. Triple tap and hold would magnify the screen if not magnified and enable viewport dragging mode until the finger goes up. One can think of this mode as a way to move the magnified viewport since the area around the moving finger will be magnified to fit the screen. For example, if the screen was not magnified and the user triple taps and holds the screen would magnify and the viewport will follow the user's finger. When the finger goes up the screen will clear zoom out. If the same user interaction is performed when the screen is magnified, the viewport movement will be the same but when the finger goes up the screen will stay magnified. In other words, the initial magnified state is sticky. 3. Pinching with any number of additional fingers when viewport dragging is enabled, i.e. the user triple tapped and holds, would adjust the magnification scale which will become the current default magnification scale. The next time the user magnifies the same magnification scale would be used. 4. When in a permanent magnified state the user can use two or more fingers to pan the viewport. Note that in this mode the content is panned as opposed to the viewport dragging mode in which the viewport is moved. 5. When in a permanent magnified state the user can use three or more fingers to change the magnification scale which will become the current default magnification scale. The next time the user magnifies the same magnification scale would be used. 6. The magnification scale will be persisted in settings and in the cloud. Note: Since two fingers are used to pan the content in a permanently magnified state no other two finger gestures in touch exploration or applications will work unless the uses zooms out to normal state where all gestures works as expected. This is an intentional tradeoff to allow efficient panning since in a permanently magnified state this would be the dominant action to be performed. Design: 1. The window manager exposes APIs for setting accessibility transformation which is a scale and offsets for X and Y axis. The window manager queries the window policy for which windows will not be magnified. For example, the IME windows and the navigation bar are not magnified including windows that are attached to them. 2. The accessibility features such a screen magnification and touch exploration are now impemented as a sequence of transformations on the event stream. The accessibility manager service may request each of these features or both. The behavior of the features is not changed based on the fact that another one is enabled. 3. The screen magnifier keeps a viewport of the content that is magnified which is surrounded by a glow in a magnified state. Interactions outside of the viewport are delegated directly to the application without interpretation. For example, a triple tap on the letter 'a' of the IME would type three letters instead of toggling magnified state. The viewport is updated on screen rotation and on window transitions. For example, when the IME pops up the viewport shrinks. 4. The glow around the viewport is implemented as a special type of window that does not take input focus, cannot be touched, is laid out in the screen coordiates with width and height matching these of the screen. When the magnified region changes the root view of the window draws the hightlight but the size of the window does not change - unless a rotation happens. All changes in the viewport size or showing or hiding it are animated. 5. The viewport is encapsulated in a class that knows how to show, hide, and resize the viewport - potentially animating that. This class uses the new animation framework for animations. 6. The magnification is handled by a magnification controller that keeps track of the current trnasformation to be applied to the screen content and the desired such. If these two are not the same it is responsibility of the magnification controller to reconcile them by potentially animating the transition from one to the other. 7. A dipslay content observer wathces for winodw transitions, screen rotations, and when a rectange on the screen has been reqeusted. This class is responsible for handling interesting state changes such as changing the viewport bounds on IME pop up or screen rotation, panning the content to make a requested rectangle visible on the screen, etc. 8. To implement viewport updates the window manger was updated with APIs to watch for window transitions and when a rectangle has been requested on the screen. These APIs are protected by a signature level permission. Also a parcelable and poolable window info class has been added with APIs for getting the window info given the window token. This enables getting some useful information about a window. There APIs are also signature protected. bug:6795382 Change-Id: Iec93da8bf6376beebbd4f5167ab7723dc7d9bd00
* | | | Merge "Add some new native deletage to layoutlib." into jb-mr1-devXavier Ducrohet2012-09-042-0/+49
|\ \ \ \
| * | | | Add some new native deletage to layoutlib.Xavier Ducrohet2012-09-042-0/+49
| | | | | | | | | | | | | | | | | | | | Change-Id: Ib53df6c944ecd9680bf929afe03b08bcaa61ad70
* | | | | Merge "Add support for "-rtl" in resources" into jb-mr1-devFabrice Di Meglio2012-09-043-7/+67
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Add support for "-rtl" in resourcesFabrice Di Meglio2012-08-233-7/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - fix bug #7035019 Need to have "-rtl" support for Resource Change-Id: Ic82145c2ac672729d8a6c695a5f343276a1a0a2c
* | | | | Add registering for explicit users.Dianne Hackborn2012-09-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New API to register as an explicit user, which allows you to also select ALL to see broadcasts for all users. New BroadcastReceiver API to find out which user the broadcast was sent to. Use this in app widget service to handle per-user package broadcasts and boot completed broadcasts correctly. Change-Id: Ibbe28993bd4aa93900c79e412026c27863019eb8
* | | | | Initial draft of high-level multi-display APIs.Jeff Brown2012-08-311-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the ability to create a Context that is bound to a Display. The context gets its configuration and metrics from that display and is able to provide a WindowManager that is bound to the display. To make it easier to use, we also add a new kind of Dialog called a Presentation. Presentation takes care of setting up the context as needed and watches for significant changes in the display configuration. If the display is removed, then the presentation simply dismisses itself. Change-Id: Idc54b4ec84b1ff91505cfb78910cf8cd09696d7d
* | | | | Improve multi-user broadcasts.Dianne Hackborn2012-08-301-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now use ALL and CURRENT when sending broadcasts, to specify where the broadcast goes. Sticky broadcasts are now correctly separated per user, and registered receivers are filtered based on the requested target user. New Context APIs for more kinds of sending broadcasts as users. Updating a bunch of system code that sends broadcasts to explicitly specify which user the broadcast goes to. Made a single version of the code for interpreting the requested target user ID that all entries to activity manager (start activity, send broadcast, start service) use. Change-Id: Ie29f02dd5242ef8c8fa56c54593a315cd2574e1c
* | | | | Keep track of whether an app is installed for each user.Dianne Hackborn2012-08-241-0/+12
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This add a new per-user state for an app, indicating whether it is installed for that user. All system apps are always installed for all users (we still use disable to "uninstall" them). Now when you call into the package manager to install an app, it will only install the app for that user unless you supply a flag saying to install for all users. Only being installed for the user is just the normal install state, but all other users have marked in their state for that app that it is not installed. When you call the package manager APIs for information about apps, uninstalled apps are treated as really being not visible (somewhat more-so than disabled apps), unless you use the GET_UNINSTALLED_PACKAGES flag. If another user calls to install an app that is already installed, just not for them, then the normal install process takes place but in addition that user's installed state is toggled on. The package manager will not send PACKAGE_ADDED, PACKAGE_REMOVED, PACKAGE_REPLACED etc broadcasts to users who don't have a package installed or not being involved in a change in the install state. There are a few things that are not quite right with this -- for example if you go through a full install (with a new apk) of an app for one user who doesn't have it already installed, you will still get the PACKAGED_REPLACED messages even though this is technically the first install for your user. I'm not sure how much of an issue this is. When you call the existing API to uninstall an app, this toggles the installed state of the app for that user to be off. Only if that is the last user user that has the app uinstalled will it actually be removed from the device. Again there is a new flag you can pass in to force the app to be uninstalled for all users. Also fixed issues with cleaning external storage of apps, which was not dealing with multiple users. We now keep track of cleaning each user for each package. Change-Id: I00e66452b149defc08c5e0183fa673f532465ed5
* | | | Refactor for multi-display support.Jeff Brown2012-08-192-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split WindowManagerImpl into two parts, the WindowManager interface implementation remains where it is but the global communications with the window manager are now handled by the WindowManagerGlobal class. This change greatly simplifies the challenge of having separate WindowManager instances for each Context. Removed WindowManagerImpl.getDefault(). This represents the bulk of this change. Most of the usages of this method were either to perform global functions (now handled by WindowManagerGlobal) or to obtain the default display (now handled by DisplayManager). Explicitly associate each new window with a display and make the Display object available to the View hierarchy. Add stubs for some new display manager API features. Start to split apart the concepts of display id and layer stack. since they operate at different layers of abstraction. While it's true that each logical display uniquely corresponds to a surface flinger layer stack, it is not necessarily the case that they must use the same ids. Added Display.getLayerStack() and started using it in places where it was relatively easy to do. Change-Id: I29ed909114dec86807c4d3a5059c3fa0358bea61
* | | | Merge "Adding a thumbnail scale down animation" into jb-mr1-devMichael Jurka2012-08-171-1/+1
|\ \ \ \
| * | | | Adding a thumbnail scale down animationMichael Jurka2012-08-161-1/+1
| | |_|/ | |/| | | | | | | | | | Recents animation will temporarily look a bit wrong, but a subsequent change will fix this.
* | | | Switch public APIs to use new UserHandle class for identifying users.Dianne Hackborn2012-08-171-2/+3
|/ / / | | | | | | | | | | | | | | | Gets rid of "yet another integer" confusion. Change-Id: Id07ea7307aea7c62f0087c6663a1f1c08e2e5dee
* | | Power manager rewrite.Jeff Brown2012-08-152-19/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The major goal of this rewrite is to make it easier to implement power management policies correctly. According, the new implementation primarily uses state-based rather than event-based triggers for applying changes to the current power state. For example, when an application requests that the proximity sensor be used to manage the screen state (by way of a wake lock), the power manager makes note of the fact that the set of wake locks changed. Then it executes a common update function that recalculates the entire state, first looking at wake locks, then considering user activity, and eventually determining whether the screen should be turned on or off. At this point it may make a request to a component called the DisplayPowerController to asynchronously update the display's powe state. Likewise, DisplayPowerController makes note of the updated power request and schedules its own update function to figure out what needs to be changed. The big benefit of this approach is that it's easy to mutate multiple properties of the power state simultaneously then apply their joint effects together all at once. Transitions between states are detected and resolved by the update in a consistent manner. The new power manager service has is implemented as a set of loosely coupled components. For the most part, information only flows one way through these components (by issuing a request to that component) although some components support sending a message back to indicate when the work has been completed. For example, the DisplayPowerController posts a callback runnable asynchronously to tell the PowerManagerService when the display is ready. An important feature of this approach is that each component neatly encapsulates its state and maintains its own invariants. Moreover, we do not need to worry about deadlocks or awkward mutual exclusion semantics because most of the requests are asynchronous. The benefits of this design are especially apparent in the implementation of the screen on / off and brightness control animations which are able to take advantage of framework features like properties, ObjectAnimator and Choreographer. The screen on / off animation is now the responsibility of the power manager (instead of surface flinger). This change makes it much easier to ensure that the animation is properly coordinated with other power state changes and eliminates the cause of race conditions in the older implementation. The because of the userActivity() function has been changed so that it never wakes the device from sleep. This change removes ambiguity around forcing or disabling user activity for various purposes. To wake the device, use wakeUp(). To put it to sleep, use goToSleep(). Simple. The power manager service interface and API has been significantly simplified and consolidated. Also fixed some inconsistencies related to how the minimum and maximum screen brightness setting was presented in brightness control widgets and enforced behind the scenes. At present the following features are implemented: - Wake locks. - User activity. - Wake up / go to sleep. - Power state broadcasts. - Battery stats and event log notifications. - Dreams. - Proximity screen off. - Animated screen on / off transitions. - Auto-dimming. - Auto-brightness control for the screen backlight with different timeouts for ramping up versus ramping down. - Auto-on when plugged or unplugged. - Stay on when plugged. - Device administration maximum user activity timeout. - Application controlled brightness via window manager. The following features are not yet implemented: - Reduced user activity timeout for the key guard. - Reduced user activity timeout for the phone application. - Coordinating screen on barriers with the window manager. - Preventing auto-rotation during power state changes. - Auto-brightness adjustment setting (feature was disabled in previous version of the power manager service pending an improved UI design so leaving it out for now). - Interpolated brightness control (a proposed new scheme for more compactly specifying auto-brightness levels in config.xml). - Button / keyboard backlight control. - Change window manager to associated WorkSource with KEEP_SCREEN_ON_FLAG wake lock instead of talking directly to the battery stats service. - Optionally support animating screen brightness when turning on/off instead of playing electron beam animation (config_animateScreenLights). Change-Id: I1d7a52e98f0449f76d70bf421f6a7f245957d1d7
* | | Add API to create new contexts with custom configurations.Dianne Hackborn2012-08-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows you to, say, make a Context whose configuration is set to a different density than the actual density of the device. The main API is Context.createConfigurationContext(). There is also a new API on ContextThemeWrapper that allows you to apply an override context before its resources are retrieved, which addresses some feature requests from developers to be able to customize the context their app is running in. Change-Id: I88364986660088521e24b567e2fda22fb7042819
* | | am c1c55afb: am e67f8c8c: Merge "Normalize output from aapt d xmltree"Jean-Baptiste Queru2012-08-081-1/+2
|\ \ \ | |/ / | | | | | | | | | * commit 'c1c55afb474dd85a6205bc8ab94065f3ac38aa77': Normalize output from aapt d xmltree
| * | am e67f8c8c: Merge "Normalize output from aapt d xmltree"Jean-Baptiste Queru2012-08-081-1/+2
| |\ \ | | |/ | | | | | | | | | * commit 'e67f8c8c279e20fff5f426eccd062b709e6280ed': Normalize output from aapt d xmltree