1390 Commits

Author SHA1 Message Date
Jeff Brown
4b72463d7c Merge "Add factory test feature to shut off on long press power." into jb-mr1-dev 2012-08-20 19:41:48 -07:00
Brian Muramatsu
a5d5d608cc Merge "add wireless charger support" into jb-mr1-dev 2012-08-20 16:57:14 -07:00
Jeff Brown
9a538ee7bd Add factory test feature to shut off on long press power.
Bug: 6847329
Change-Id: I2f4f975c3af2d13ccc06812a5a42e79032700862
2012-08-20 14:56:57 -07:00
Brian Muramatsu
37a37f445c add wireless charger support
bug: 6879638

- add new enum value BATTERY_PLUGGED_WIRELESS
- check for sys online file with contents "Wireless"

Change-Id: I22dc3c40f50573c98643e7b5cbcb237d0216530d
2012-08-20 10:04:12 -07:00
Jeff Brown
98365d7663 Refactor for multi-display support.
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
2012-08-19 22:42:08 -07:00
Dianne Hackborn
79af1dd54c Switch public APIs to use new UserHandle class for identifying users.
Gets rid of "yet another integer" confusion.

Change-Id: Id07ea7307aea7c62f0087c6663a1f1c08e2e5dee
2012-08-17 10:36:08 -07:00
Amith Yamasani
2a00329c6d UserHandle to UserSerialNo mapping
Use AtomicFile for usermanager files.

Added a MANAGE_USERS permission that apps (signature permission) can use
to create/query/modify/remove users.

Change-Id: I5cf232232d0539e7508df8ec9b216e29c2351cd9
2012-08-17 09:06:10 -07:00
Michael Jurka
c40771a90d Merge "Fix bug with preloading recent tasks" into jb-mr1-dev 2012-08-16 13:19:45 -07:00
Dianne Hackborn
f02b60aa4f Rename UserId to UserHandle.
This is the start of turning this into a formal public API.

Change-Id: I5786d2c320f1de41a06ed5d0f65adb68967287a0
2012-08-16 12:46:38 -07:00
Michael Jurka
01de93de1e Fix bug with preloading recent tasks
Don't send a "cancel preloading" event to recents
from PhoneWindowManager if we're not using
long-press on home to invoke recents (ie phones
with soft nav keys)
2012-08-16 00:16:25 -07:00
Jeff Brown
194b6e9716 Merge "Power manager rewrite." into jb-mr1-dev 2012-08-15 10:26:03 -07:00
Jeff Brown
9630704ed3 Power manager rewrite.
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
2012-08-15 03:06:24 -07:00
Jeff Brown
f8d9e2fccd Merge "Make all messages in KeyguardViewMediator asynchronous." into jb-mr1-dev 2012-08-14 21:28:52 -07:00
Jeff Brown
109025d778 Make all messages in KeyguardViewMediator asynchronous.
We don't want these messages to get blocked by UI traversals.

Added a convenience for creating Handlers that always send
asynchronous messages.

Change-Id: Id568e87fcb8b169e8c52c5fe1dc76a4a5771570b
2012-08-14 20:44:44 -07:00
Dianne Hackborn
595b6565dc am 977abbb8: am 48de12c5: Merge "Keep keyguard from starting after finished call when screen is on"
* commit '977abbb887cfaf7cd8a0d31235281fbdd639ac19':
  Keep keyguard from starting after finished call when screen is on
2012-08-14 19:34:14 -07:00
Dianne Hackborn
977abbb887 am 48de12c5: Merge "Keep keyguard from starting after finished call when screen is on"
* commit '48de12c5d1dc8d856724e8a1ec8288d9bfae40cd':
  Keep keyguard from starting after finished call when screen is on
2012-08-14 19:31:55 -07:00
Amith Yamasani
c1d07a4bd2 Launch ASSIST intent on the current user
Lockscreen and statusbar now launch the intent on the current user.
Make sure that the intent resolution is made to the package manager
for the specific user, as the app could have been disabled for that
user or may have an alternative app installed.

Change-Id: I93b0f972d6c7e8880b146da83dc3d08a68fe7e51
2012-08-14 12:39:29 -07:00
Daniel Hansson
4b71686d09 Keep keyguard from starting after finished call when screen is on
Previously keyguard would start after a call ended, even though
the screen was on, if the screen had not been turned off since
phone startup.

Change-Id: I03c18a0bb2a58760614645871f4703afb9a0677d
2012-08-14 13:42:36 +02:00
Amith Yamasani
f83d2d6f6b Merge "User Manager service to manage users and query user details" into jb-mr1-dev 2012-08-11 21:37:08 -07:00
Amith Yamasani
258848d2ae User Manager service to manage users and query user details
Moved a bunch of methods from PackageManager to UserManager.

Fix launching of activities from recents to correct user.

Guest creation APIs

Change-Id: I0733405e6eb2829675665e225c759d6baa2b708f
2012-08-11 18:24:07 -07:00
Daniel Sandler
f7178d3cad Allow the secure keyguard to engage behind Dreams.
TYPE_DREAM windows are now considered for relevant window
flags alongside application windows.

Bug: 6961616
Change-Id: Idee3303276a8b69c7f07de1d6acdce64c6e1b863
2012-08-11 00:55:14 -04:00
Dianne Hackborn
5773bfdb7c Add power menu action to take a bug report
Change-Id: I5f58d99e9a27a1fc496fa54e0c0ee333087155da
2012-08-07 11:42:09 -07:00
Craig Mautner
cbb6b41aef Merge "Do not use last app rotation as default." into jb-mr1-dev 2012-08-03 18:07:52 -07:00
Dianne Hackborn
dde331cebd We can now (kind-of) change screen density on the fly.
Preloaded drawables now have a density associated with them, so we
can load the correct drawable if we are using a different density.

Window manager now formally keeps track of the density for each
screen, allowing it to be overridden like you can already do with
size, and relies on this density to drive itself internally and
the configurations it reports.

There are a new set of Bitmap constructors where you provide a
DisplayMetrics so they can be constructed with the correct density.
(This will be for when you can have different windows in the same
app running at different densities.)

ActivityThread now watches for density changes, and pushes them
to the DENSITY_DEVICE and Bitmap global density values for that
process.

A new am command allows you to change the density.
2012-08-03 17:27:29 -07:00
Craig Mautner
4bd149ef83 Do not use last app rotation as default.
If the rotation sensor has been disabled we were substituting the
last app rotation for the sensor value. This fix uses the last
sensor value delivered before the sensor was disabled. Only use
the last app rotation if we never have received a valid sensor
value.

Fixes bug 6387946.

Change-Id: I50743c30ee2b4455e9848d3a619809be97eec3c8
2012-08-03 14:47:24 -07:00
John Spurlock
bc632a28e4 Re-enable dreams: frameworks/base
Enable feature in config. Expose Dream in public api for unbundled apps.
Unhide package.  Add isDreaming() method to service.

Re-arrange the Dream api a bit.  (use onStart as hook for subclasses).
Coordinate properly with power manager.

Replace old dock mode (don't fire old intent).

Change-Id: I1318d20cc1613e5d862f2913f2fcdc9719302cf7
Bug: 6921930
2012-08-03 08:51:17 -04:00
Dianne Hackborn
908aecc3a6 Start moving away from DisplayMetrics.DENSITY_DEVICE.
This puts in most of the infrastructure needed to allow us to
switch between different densities at run time.  The main remaining
uses of the global are to initialize the Bitmap object (not sure
what to do about that since it doesn't have anything passed in
the constructor to get this information from), and being able to
load drawables if we need a different density than what was preloaded
by zygote.

Change-Id: Ifdbfd6b7a5c59e6aa22e63b95b78d96af3d96848
2012-08-01 10:54:39 -07:00
Adam Powell
e72a6e977b am fc92eb94: am 2ffb1acb: Merge " Fix preload classname for phone policy."
* commit 'fc92eb94c413ebae1016d10460ee62e92f0c1a64':
  Fix preload classname for phone policy.
2012-07-30 13:13:22 -07:00
Adam Powell
fc92eb94c4 am 2ffb1acb: Merge " Fix preload classname for phone policy."
* commit '2ffb1acbb704fa9d87fe496d5b7f3053e02799df':
  Fix preload classname for phone policy.
2012-07-30 13:10:06 -07:00
Adam Powell
2ffb1acbb7 Merge " Fix preload classname for phone policy." 2012-07-30 10:46:12 -07:00
Jeff Brown
b696de5c10 Move and rename user activity event type constants.
Change-Id: Ie565808796773b6896e71ddfac6aaaf8031de846
2012-07-27 18:14:56 -07:00
Jeff Brown
525ff5f36b Remove dead code.
Change-Id: I33afe3a1c364d5cdb9fa08867ad1580c0fd04e0e
2012-07-25 11:38:48 -07:00
Shawn Pearce
29f78363d1 am 5f8d4832: am 8d6ff012: Merge "Fix 5608959: Make keyguard follow user setting for orientation" into jb-dev
* commit '5f8d48324e891fa9953ffa3056ea9d8f03075d96':
  Fix 5608959: Make keyguard follow user setting for orientation
2012-07-24 22:11:26 -07:00
Shawn Pearce
5f8d48324e am 8d6ff012: Merge "Fix 5608959: Make keyguard follow user setting for orientation" into jb-dev
* commit '8d6ff012ed14fb2e0ddad059deea3b1fe74aac3c':
  Fix 5608959: Make keyguard follow user setting for orientation
2012-07-24 22:08:57 -07:00
Jim Miller
82f9196318 Fix 5608959: Make keyguard follow user setting for orientation
This fixes a bug where keyguard would always change orientation
when enabled from config_enableLockScreenRotation.  Now it follows
the user preference.

Change-Id: I0437d11e1984d22cdadddc57deb47d800fb86aa1
2012-07-24 14:27:12 -07:00
Jim Miller
bbf1a74318 Clean up info and callback architecture in KeyguardUpdateMonitor.
- We now pass a more robust battery status object to methods that handle battery updates.
- Consolidated battery decision code into BatteryStatus object (e.g.  charging, low, charged)
so it can be shared.
- Consolidated SIMStateCallback into common KeyguardUpdateMonitorCallback object to reduce complexity.
- Consolidated user changes into common callback using KeyguardUpdateMonitorCallback.
- Fixed a race condition caused by launching LockSettingsService after WindowManagerService.

Change-Id: I6b2a328f8581f35593e41348693b92ab66d02429
2012-07-23 17:53:42 -07:00
Wink Saville
33034b13ca Create telephony-common and mms-common - DO NOT MERGE
These have been created to reduce the size and complexity
of frameworks/base.

mms-common was created by moving all of
  frameworks/base/core/java/com/google/android/mms
to:
   frameworks/opt/mms

telephony-common was created by moving some of
   frameworks/base/telephony
to:
   frameworks/opt/telephony

Change-Id: If6cb3c6ff952767fc10210f923dc0e4b343cd4ad
2012-07-17 12:23:09 -07:00
Erik Gilling
f8dcee5151 Merge "remove code to resize status bar when on HDMI" 2012-07-16 16:24:30 -07:00
Jeff Brown
c69238ebc8 Merge "Remove dithering support." 2012-07-16 16:18:13 -07:00
Jeff Brown
3cc321ecf5 Remove dithering support.
The dithering flag is no longer implemented in Surface Flinger
so this is all dead code.

Change-Id: I74c0e452923207e5b7cfe0eeca9457e5cb990947
2012-07-16 16:17:25 -07:00
Erik Gilling
81d13e8e73 remove code to resize status bar when on HDMI
Change-Id: I413eff8fe664033e5187ac54247ec0140175b7ba
2012-07-16 16:00:58 -07:00
Daniel Sandler
ef863701ae Switch to split status/nav bars on all device sizes.
Change-Id: Ie76aa4bdfd76e4a0ffb3949424ab28ef86ec54a1
2012-07-16 09:59:20 -07:00
Romain Guy
565e3e79b0 am 4094fb3c: am 8d170421: Merge "Fix wrong condition."
* commit '4094fb3c5b95c88d689238cbf0a9e2c169a5e557':
  Fix wrong condition.
2012-07-16 01:58:48 -07:00
Romain Guy
4094fb3c5b am 8d170421: Merge "Fix wrong condition."
* commit '8d1704215e80ebec61f6d77c503d83b32d881096':
  Fix wrong condition.
2012-07-16 01:55:55 -07:00
SeongJae Park
8108e9f8cd Fix wrong condition.
Should check width and height, not width and width.

Change-Id: Ie84d3605b2a7a0f4776adb876608ea92f56817c4
2012-07-14 14:18:51 +09:00
Jim Miller
646d60383d Fix regression in SIM state handling
This fixes a bug introduced by If6cb3c6ff952767fc10210f923dc0e4b343cd4ad
that accidentally reverted I019d1d8c65c55cbf4d10d4928e1d2b2b242162a6

Change-Id: Ia006bf31387162a520374f3bc9acb6e69197b106
2012-07-13 15:12:55 -07:00
Fabrice Di Meglio
51c0a6a6fd Merge "Make PhoneWindow aware of layout direction" 2012-07-12 17:53:34 -07:00
Wink Saville
5362f17ff5 Merge commit '1b003ef0' into mit
* commit '1b003ef0':
  Create telephony-common and mms-common

Change-Id: Ie8876541dbe7f4c933cf7d69910dd204538bc975
2012-07-11 18:15:50 -07:00
Wink Saville
a639b311e9 Create telephony-common and mms-common
These have been created to reduce the size and complexity
of frameworks/base.

mms-common was created by moving all of
  frameworks/base/core/java/com/google/android/mms
to:
   frameworks/opt/mms

telephony-common was created by moving some of
   frameworks/base/telephony
to:
   frameworks/opt/telephony

Change-Id: If6cb3c6ff952767fc10210f923dc0e4b343cd4ad
2012-07-11 16:02:08 -07:00
Jean-Michel Trivi
f2b0c11f4e Fix sound effect attenuation calculation
The sound effect volume attenuation calculation is wrong: the
 division by 20 was always returning 1 or 0.
In AudioService, rename the sound effect attenuation value to
 follow the naming conventions for static variables.

Change-Id: I3c36d50f4470ff09ca98cb944aefb5ad0f968782
2012-07-10 13:24:23 -07:00