4372 Commits

Author SHA1 Message Date
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
4702a85697 More view hierarchy, fragment debugging.
Add a View.toString() method.

Rename all of the View private flags to have a PFLAG prefix to
avoid going insane trying to figure out which constant goes with
which flag.

Activity.dump() now includes a summary of the activity's view
hierarchy, using the View.toString() method.

All exceptions thrown by FragmentManager now perform a dump of
the owning activity state, where appropriate.

Change-Id: I6482e397e10cb5a0612ab02ce6ed5131823437a6
2012-08-17 17:35:00 -07:00
George Mount
9f410c540a Add getDefaultUserAgent to WebSettings.
Bug 6329117
 Add ability to get the default user-agent without creating
 a WebView. The method is implemented for WebSettingsClassic.

Change-Id: Id15fb57f65875752ccf644481a22b88644635f5d
2012-08-17 15:53:13 -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
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
270e3381e7 Add FloatMath.hypot.
Change-Id: I6a5a7ea2254300614dbbf540f40e39dbec2d2900
2012-08-16 01:30:22 -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
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
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
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
472f416140 Merge "Adding limit and offset query parameters to CallLog." into jb-mr1-dev 2012-08-14 10:53:19 -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
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
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
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
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
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
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
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
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
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
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
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
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
329465c6b2 Merge "Add APIs for interacting across users." into jb-mr1-dev 2012-08-02 19:14:39 -07:00
Dianne Hackborn
b4163a6e12 Add APIs for interacting across users.
- Expose the existing Context.sendBroadcast() as
  Context.sendBroadcastAsUser().
- Add new android:singleUser attribute for services.
- Add new INTERACT_ACROSS_USERS_FULL permission for full
  system-level access to cross-user interface (allows
  sendBroadcastAsUser() to send to any receiver).
- Add new INTERACT_ACROSS_USERS_FULL permission for
  more restricted cross-user interaction: this is required
  for android:singleUser, and allows you to use
  sendBroadcastAsUser() but only to send to your own
  receivers.

Change-Id: I0de88f6718e9505f4de72e3f45d29c0f503b76e9
2012-08-02 19:07:57 -07:00
Adam Powell
478923885d Make AutoCompleteTextView#setText(CharSequence, boolean) public
Bug 6807326

Public bug http://code.google.com/p/android/issues/detail?id=34690

Make this available for use by applications that wish to make
programmatic changes to the AutoCompleteTextView without filtering.

Change-Id: I889452d3b19b378258ad9247f3d254afee1e8408
2012-08-02 17:30:32 -07:00
rich cannings
24713907fe Pass URLs to package verifiers
This change passes the originating URL and accompanied referrer to
package verifiers, when available.

Bug: 6544677
Change-Id: If9ff6663ad7f3426b7aea2aceb1413b689788138
2012-08-02 11:26:47 -07:00
Dianne Hackborn
a7ce1551a6 Merge "Add API to turn on HW drawing in IMEs." into jb-mr1-dev 2012-08-01 19:05:52 -07:00
Dianne Hackborn
836531b0c4 Add API to turn on HW drawing in IMEs.
Change-Id: Ib6a8bda46223ce1153f32834daf02a820d16136e
2012-08-01 19:00:38 -07:00
Wink Saville
9742553603 Merge "Unhide the new location API's" into jb-mr1-dev 2012-08-01 16:43:36 -07:00
Jeff Sharkey
6a916ed0c0 Merge "Add trimToSize() to public API." into jb-mr1-dev 2012-08-01 14:34:47 -07:00
Jeff Sharkey
d96b585f5c Add trimToSize() to public API.
Bug: 6602490
Bug: http://code.google.com/p/android/issues/detail?id=35349
Change-Id: Ib3bc7fee05bb0edc375ebee1c40a1d7bd82e2a17
2012-08-01 14:20:04 -07: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
James Dong
b198004985 Merge "Added a key to retrieve the rotation angle in MediaMetadataRetriever.java class" into jb-mr1-dev 2012-08-01 10:33:28 -07:00
Dianne Hackborn
39606a007a Make AtomicFile a public API. It's about time!
Change-Id: Ib34e294747405b7ab709cb0bbb2d9a0cc80ce86a
2012-07-31 17:54:52 -07:00