4198 Commits

Author SHA1 Message Date
Nick Pelly
f34eae6d23 am 78e9ea9c: am 1f3f128a: Merge "Add javadoc for new location API\'s." into jb-mr1-dev
* commit '78e9ea9c7b4cce2317a24f57cd67d74c53bd1eaf':
  Add javadoc for new location API's.
2012-08-16 18:10:35 -07:00
Nick Pelly
1f3f128ad1 Merge "Add javadoc for new location API's." into jb-mr1-dev 2012-08-16 18:05:32 -07:00
Nick Pelly
4e31c4fffb Add javadoc for new location API's.
Change-Id: If15024ee88421c07ba3a174747774fc451fd002e
2012-08-16 17:59:34 -07:00
Jeff Brown
23e3ba534c am 778a616f: am 7c964e78: Merge changes I39804ee6,I6a5a7ea2 into jb-mr1-dev
* commit '778a616febe81517dc149bc4adc72a3e27bbc49e':
  Use spline interpolation for auto-brightness.
  Add FloatMath.hypot.
2012-08-16 02:11:25 -07:00
Jeff Brown
270e3381e7 Add FloatMath.hypot.
Change-Id: I6a5a7ea2254300614dbbf540f40e39dbec2d2900
2012-08-16 01:30:22 -07:00
Jeff Brown
76a2a59966 am e4e71e1d: am 194b6e97: Merge "Power manager rewrite." into jb-mr1-dev
* commit 'e4e71e1d06442726e23f8ccf66c75468634008c4':
  Power manager rewrite.
2012-08-15 10:30:52 -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
Dianne Hackborn
0edc9710b3 am 5cdb2480: am abac0cd1: Merge "Add PendingIntent and IntentSender APIs to get user handle." into jb-mr1-dev
* commit '5cdb2480cea21d3bf8862dfb82b13a9deb21813f':
  Add PendingIntent and IntentSender APIs to get user handle.
2012-08-14 18:29:42 -07:00
Dianne Hackborn
abac0cd161 Merge "Add PendingIntent and IntentSender APIs to get user handle." into jb-mr1-dev 2012-08-14 18:24:59 -07:00
Dianne Hackborn
c7501279ee Add PendingIntent and IntentSender APIs to get user handle.
Also uid.

Change-Id: I0a328d0cc2bbc17dc0a49b7b8b8d515af80f1e15
2012-08-14 18:05:05 -07:00
Dianne Hackborn
b314486cc9 am aeb35ff5: am 34743ac7: Merge "Add API to create new contexts with custom configurations." into jb-mr1-dev
* commit 'aeb35ff52d573f4ab88b097852780dc75a0d3960':
  Add API to create new contexts with custom configurations.
2012-08-14 17:37:16 -07:00
Dianne Hackborn
34743ac7d6 Merge "Add API to create new contexts with custom configurations." into jb-mr1-dev 2012-08-14 17:33:01 -07:00
Dianne Hackborn
756220bd19 Add API to create new contexts with custom configurations.
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
2012-08-14 16:51:38 -07:00
Iliyan Malchev
8c700a874a am c29a6ffd: am 57853108: Revert "Add timestamp in scan results"
* commit 'c29a6ffd8abf73623137b17e803e0c1ca363e6d3':
  Revert "Add timestamp in scan results"
2012-08-14 11:24:06 -07:00
Iliyan Malchev
578531082b Revert "Add timestamp in scan results"
Temporarily reverting this until all devices switch to using wpa_supplicant_8.

This reverts commit b31f78f93768fef269617ec788a5c6655a375f80.

Change-Id: I33fcb8415288d95289dcd46fa71e950e0f2b87ec
Signed-off-by: Iliyan Malchev <malchev@google.com>
2012-08-14 11:17:21 -07:00
Chiao Cheng
38de253d19 am 667cf415: am 472f4161: Merge "Adding limit and offset query parameters to CallLog." into jb-mr1-dev
* commit '667cf4158a3bef4917fff2bc87e288e5eefec6c3':
  Adding limit and offset query parameters to CallLog.
2012-08-14 10:58:11 -07:00
Chiao Cheng
472f416140 Merge "Adding limit and offset query parameters to CallLog." into jb-mr1-dev 2012-08-14 10:53:19 -07:00
Jeff Brown
1d89d2b56d am adeadda2: am caaeda95: Merge "Add a toString() method to Sensor for debugging purposes." into jb-mr1-dev
* commit 'adeadda2027ecc87399ce4504145a5bcc78e1bec':
  Add a toString() method to Sensor for debugging purposes.
2012-08-13 23:19:44 -07:00
Jeff Brown
caaeda955b Merge "Add a toString() method to Sensor for debugging purposes." into jb-mr1-dev 2012-08-13 23:14:56 -07:00
Irfan Sheriff
6963e0dc0c am b3a007be: am 4d198869: Merge "Add timestamp in scan results" into jb-mr1-dev
* commit 'b3a007be0ed7fdc55b587af7b3a6faa1a032fb41':
  Add timestamp in scan results
2012-08-13 11:26:55 -07:00
Irfan Sheriff
4d1988699b Merge "Add timestamp in scan results" into jb-mr1-dev 2012-08-13 11:22:22 -07:00
Irfan Sheriff
b31f78f937 Add timestamp in scan results
Propogate 802.11 tsf details per scan result to the applications
and open up hidden access points

BUg: 2961159
Change-Id: I05658fd0cf010c0b36193db3f79422640e8b3a6b
2012-08-13 11:20:14 -07:00
Amith Yamasani
dda851ce9a am 7871b629: am f83d2d6f: Merge "User Manager service to manage users and query user details" into jb-mr1-dev
* commit '7871b629a63a542fb81179c9239c21255a7a42ad':
  User Manager service to manage users and query user details
2012-08-11 21:42:07 -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
Jeff Brown
6a2ef12753 Add a toString() method to Sensor for debugging purposes.
Also made the class final, since it cannot be instantiated
by applications.

Change-Id: I540ad56d19debd99426d37b9b63c163827b4c2fc
2012-08-10 20:52:22 -07:00
Nick Pelly
9e634f8e18 am db95ee9f: am 3914e4b7: Remove LocationManager#getLastKnownLocation(Criteria).
* commit 'db95ee9f61980d210c52cba2928b4c0d46f7fa26':
  Remove LocationManager#getLastKnownLocation(Criteria).
2012-08-10 15:32:31 -07:00
Nick Pelly
3914e4b7d1 Remove LocationManager#getLastKnownLocation(Criteria).
This was never a public API, so we don't need to follow
an orderly deprecation. And it breaks a CTS test:

cts/tests/tests/location/src/android/location/cts/LocationManagerTest.java:521: reference to getLastKnownLocation is ambiguous, both method getLastKnownLocation(java.lang.String) in android.location.LocationManager and method getLastKnownLocation(android.location.Criteria) in android.location.LocationManager match
            mManager.getLastKnownLocation(null);
                    ^

Change-Id: I503267e4fa577ce4bf684239da777f11b0e511f5
2012-08-10 15:27:38 -07:00
Nick Pelly
ecdf2be6fe am b6c703fd: am 6fa9ad4a: Location overhaul, major commit.
* commit 'b6c703fda4995ccd702d4af65e12309d71732594':
  Location overhaul, major commit.
2012-08-10 15:05:27 -07:00
Nick Pelly
6fa9ad4afc Location overhaul, major commit.
Themes: Fused Location, Geofencing, LocationRequest.

API changes
o Fused location is always returned when asking for location by Criteria.
o Fused location is never returned as a LocationProvider object, nor returned
  as a provider String. This wouldn't make sense because the current API
  design assumes that LocationProvider's have fixed properties (accuracy, power
  etc).
o The fused location engine will tune itself based on the criteria passed
  by applications.
o Deprecate LocationProvider. Apps should use fused location (via Criteria
  class), instead of enumerating through LocationProvider objects. It is
  also over-engineered: designed for a world with a plethora of location
  providers that never materialized.
o The Criteria class is also over-engineered, with many methods that aren't
  currently used, but for now we won't deprecate them since they may have
  value in the future. It is now used to tune the fused location engine.
o Deprecate getBestProvider() and getProvider().
o Add getLastKnownLocation(Criteria), so we can return last known
  fused locations.
o Apps with only ACCESS_COARSE_LOCATION _can_ now use the GPS, but the location
  they receive will be fudged to a 1km radius. They can also use NETWORK
  and fused locatoins, which are fudged in the same way if necessary.
o Totally deprecate Criteria, in favor of LocationRequest.
  Criteria was designed to map QOS to a location provider. What we
  really need is to map QOS to _locations_.
  The death knell was the conflicting ACCURACY_ constants on
  Criteria, with values 1, 2, 3, 1, 2. Yes not a typo.
o Totally deprecate LocationProvider.
o Deprecate test/mock provider support. They require a named provider,
  which is a concept we are moving away from. We do not yet have a
  replacement, but I think its ok to deprecate since you also
  need to have 'allow mock locations' checked in developer settings.
  They will continue to work.
o Deprecate event codes associated with provider status. The fused
  provider is _always_ available.
o Introduce Geofence data object to provide an easier path fowards
  for polygons etc.

Implementation changes
o Fused implementation: incoming (GPS and NLP) location fixes are given
  a weight, that exponentially decays with respect to age and accuracy.
  The half-life of age is ~60 seconds, and the half-life of accuracy is
  ~20 meters. The fixes are weighted and combined to output a fused
  location.
o Move Fused Location impl into
  frameworks/base/packages/FusedLocation
o Refactor Fused Location behind the IProvider AIDL interface. This allow us
  to distribute newer versions of Fused Location in a new APK, at run-time.
o Introduce ServiceWatcher.java, to refactor code used for run-time upgrades of
  Fused Location, and the NLP.
o Fused Location is by default run in the system server (but can be moved to
  any process or pacakge, even at run-time).
o Plumb the Criteria requirements through to the Fused Location provider via
  ILocation.sendExtraCommand(). I re-used this interface to avoid modifying the
  ILocation interface, which would have broken run-time upgradability of the
  NLP.
o Switch the geofence manager to using fused location.
o Clean up 'adb shell dumpsys location' output.
o Introduce config_locationProviderPackageNames and
  config_overlay_locationProviderPackageNames to configure the default
  and overlay package names for Geocoder, NLP and FLP.
o Lots of misc cleanup.
o Improve location fudging. Apply random vector then quantize.
o Hide internal POJO's from clients of com.android.location.provider.jar
  (NLP and FLP). Introduce wrappers ProviderRequestUnbundled and
  ProviderPropertiesUnbundled.
o Introduce ProviderProperties to collapse all the provider accuracy/
  bearing/altitude/power plumbing (that is deprecated anyway).
o DELETE lots of code: DummyLocationProvider,
o Rename the (internal) LocationProvider to LocationProviderBase.
o Plumb pid, uid and packageName throughout
  LocationManagerService#Receiver to support future features.

TODO: The FLP and Geofencer have a lot of room to be more intelligent
TODO: Documentation
TODO: test test test

Change-Id: Iacefd2f176ed40ce1e23b090a164792aa8819c55
2012-08-10 14:57:09 -07:00
Jeff Brown
415e6ba016 am 35489c0a: am 1670dc9a: Merge "Add FloatMath.exp." into jb-mr1-dev
* commit '35489c0a3d61092487c1678793256ba754aa677d':
  Add FloatMath.exp.
2012-08-08 18:32:57 -07:00
Jeff Brown
1670dc9abf Merge "Add FloatMath.exp." into jb-mr1-dev 2012-08-08 18:29:08 -07:00
Jeff Brown
5d728bb9ff Add FloatMath.exp.
Change-Id: I7f215e5fd4cb942ddee56eebaef04be565ac79f3
2012-08-08 18:23:53 -07:00
Rich Cannings
b38cb4da4a am 22c5c52d: am a56d9cec: Merge "Revert "Pass URLs to package verifiers"" into jb-mr1-dev
* commit '22c5c52d43d055db307e6a0136180e7995db49f1':
  Revert "Pass URLs to package verifiers"
2012-08-08 15:11:15 -07:00
Rich Cannings
a56d9cecee Merge "Revert "Pass URLs to package verifiers"" into jb-mr1-dev 2012-08-08 13:50:56 -07:00
Rich Cannings
e1d7c711df Revert "Pass URLs to package verifiers"
This reverts commit 24713907fe4632d263aea82f7a35c8fb08918a09

Change-Id: Ie04ba73475b813635c4a74915c45e83250801b6b
2012-08-08 12:46:06 -07:00
James Dong
ca5a689d5a am da1007d1: am aef4af4c: Merge "Add MEDIA_ERROR_SERVER_DIED error constant to MediaRecorder.java class" into jb-mr1-dev
* commit 'da1007d15114311816cb17b15fa662759d194643':
  Add MEDIA_ERROR_SERVER_DIED error constant to MediaRecorder.java class
2012-08-08 11:42:08 -07:00
James Dong
aef4af4cd1 Merge "Add MEDIA_ERROR_SERVER_DIED error constant to MediaRecorder.java class" into jb-mr1-dev 2012-08-08 11:38:05 -07:00
Dianne Hackborn
128f16cfe0 am 852f06b3: am 53791582: Merge "More mult-user API work." into jb-mr1-dev
* commit '852f06b3fc84d559c2ff2ede2b8477bfd4c4ffa6':
  More mult-user API work.
2012-08-08 10:27:38 -07:00
Dianne Hackborn
7d19e0242f More mult-user API work.
- You can now use android:singleUser with receivers and providers.
- New API to send ordered broadcasts as a user.
- New Process.myUserHandle() API.

For now I am trying out "user handle" as the name for the numbers
representing users.

Change-Id: I754c713ab172494bb4251bc7a37a17324a2e235e
2012-08-07 19:19:22 -07:00
James Dong
a35379ae98 Add MEDIA_ERROR_SERVER_DIED error constant to MediaRecorder.java class
o As a result, applications can listen for death notification from MediaRecorder onError callbacks

Change-Id: I49896c4ae8130bd67b52deff6eb97a22b43d3f32
2012-08-07 19:15:35 -07:00
Jeff Sharkey
3d403aacd4 am a51e444e: am 4e4306ab: Merge "Include network type that caused broadcast." into jb-mr1-dev
* commit 'a51e444ed44baa39564d066e78a0650bfd57ccea':
  Include network type that caused broadcast.
2012-08-06 13:44:53 -07:00
Jeff Sharkey
4e4306ab14 Merge "Include network type that caused broadcast." into jb-mr1-dev 2012-08-06 13:40:44 -07:00
Jeff Sharkey
75fbb4bdfd Include network type that caused broadcast.
Network type can be obtained through EXTRA_NETWORK_INFO, but offer
it as first-class extra since the returned NetworkInfo is deprecated.

Bug: 6936247
Change-Id: Ief59577afd2bd930f0f4c5650b413feef86bfbc3
2012-08-06 11:45:01 -07:00
Jeff Sharkey
cbc1a8c40f am 5d945958: am 9c5c6595: Merge "Make LocalSocket Closeable." into jb-mr1-dev
* commit '5d94595889071d84b6d0b6517656f298a4153a09':
  Make LocalSocket Closeable.
2012-08-05 14:59:41 -07:00
Jeff Sharkey
9c5c659597 Merge "Make LocalSocket Closeable." into jb-mr1-dev 2012-08-05 14:55:28 -07:00
Jeff Sharkey
065b299df4 Make LocalSocket Closeable.
Enables usage of IoUtils.closeQuietly().

Change-Id: I91126297c1f235ae9da09f82d8f4f22db46558eb
2012-08-05 14:21:07 -07:00
Dianne Hackborn
c5f61b7325 am e1fdc79b: am 2e5746a7: Merge "We can now (kind-of) change screen density on the fly." into jb-mr1-dev
* commit 'e1fdc79ba2ab32bb084b193d187df1fa8b769e86':
  We can now (kind-of) change screen density on the fly.
2012-08-03 17:50:57 -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
Chiao Cheng
509e1f1a97 Adding limit and offset query parameters to CallLog.
Allows clients to paginate through call logs.

Change-Id: Icdd796f990ccf25f5f5e2183412e5391f4572add
2012-08-03 15:19:37 -07:00