7986 Commits

Author SHA1 Message Date
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
Nick Pelly
75f0fac91b Merge "Fix a couple of bugs from the location overhaul." into jb-mr1-dev 2012-08-10 17:19:09 -07:00
Nick Pelly
08ca1046fe Fix a couple of bugs from the location overhaul.
Marshall LocationRequest array correctly.

Observe reportLocation from FusionEngine.

Actually deliver the setRequest message to fusion engine.

Change-Id: Iff64596fdd42f9fb06e563591dda9fbe0241533a
2012-08-10 17:17:32 -07:00
Ashish Sharma
77b257967d Merge "Setup idletimer for network interface." into jb-mr1-dev 2012-08-10 16:04:07 -07:00
Haoyu Bai
0412423f06 Setup idletimer for network interface.
Cherry-picked from commit f71ca8a5728e425de61ba794c9653dd0b04f16e3 in
master. DO NOT MERGE

Change-Id: I6101c7ae041b4cc1237ce7a9983753dbdfa301d3
2012-08-10 15:58:34 -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
Brian Muramatsu
14262d79c4 Merge "Control GPS logging with property" into jb-mr1-dev 2012-08-09 18:46:10 -07:00
Brian Muramatsu
1715cb36d9 Control GPS logging with property
This allows users of the PDK to debug GPS issues.

Change-Id: I4aff12e124f4264abd1a0be012df4c431044189c
2012-08-09 17:14:13 -07:00
John Spurlock
c5bfe19626 Merge "Fix screen timeout determination for starting dream." into jb-mr1-dev 2012-08-09 15:43:25 -07:00
John Spurlock
b9ba2b6768 Fix screen timeout determination for starting dream.
It turns out OFF_BECAUSE_OF_TIMEOUT is not the best indicator
of actual screen timeout.

For example, it is the reason passed down when acquiring a wake lock.
This was causing us to launch Dreams in the wrong situations, and
deadlocking on calls to WindowManager.

This fix simply adds an additional check ensuring the intention is to
turn the screen off.

Change-Id: If8adff446b5b1fcb19424b45878b75bfd0552b90
2012-08-09 14:47:49 -04:00
Amith Yamasani
2c02933b13 Merge "Send BOOT_COMPLETED to all users." into jb-mr1-dev 2012-08-09 11:45:55 -07:00
Daniel Sandler
015b9f45d4 Fix the dock-insertion Dream entry codepath.
Bug: 6956040
Change-Id: I663e13f8a28db13b94d0f5aa4dbcf0cd64ef22fe
2012-08-09 11:11:33 -04:00
Amith Yamasani
4860cfc684 Send BOOT_COMPLETED to all users.
At least until we have a concept of logged-in users.

Change-Id: I65e3bed2aeef9692dbc64169cf02a7451cfed1cd
2012-08-08 19:15:58 -07:00
Amith Yamasani
8264408f59 Start the correct settings from the status bar.
Added a new method to Context: startActivityAsUser() requiring the
INTERACT_ACROSS_USERS_FULL permission.

Show the correct Recents list, based on current user.
Added a getRecentTasksForUser() in ActivityManager. Hidden and requires
the INTERACT_ACROSS_USERS_FULL permission.

Change-Id: If5b56465efdd3ead36601a3b51ed4af157bbf35c
2012-08-08 16:52:53 -07:00
Jeff Sharkey
fb11ffa2a0 Merge "Isolate NetworkStateTracker creation, test." into jb-mr1-dev 2012-08-08 16:25:41 -07:00
Jeff Sharkey
fb878b66b9 Isolate NetworkStateTracker creation, test.
Change ConnectivityService to use a factory when creating
NetworkStateTrackers, which gives us a good place to inject mocks
for testing.  Add initial tests to verify that network routes are
added and removed as networks changed.

Change-Id: I11cbc61a84c2ed4afa2670036295b1494eab26e1
2012-08-08 16:23:41 -07:00
Jeff Sharkey
82f479d064 Merge "Cleaner controls between Vpn and init services." into jb-mr1-dev 2012-08-08 16:22:23 -07:00
Rich Cannings
a56d9cecee Merge "Revert "Pass URLs to package verifiers"" into jb-mr1-dev 2012-08-08 13:50:56 -07:00
Jason Simmons
5017f23284 Call systemReady on the lock settings before doing so on the window manager
At systemReady time, the window manager needs to obtain values from the lock
settings service (e.g. whether the lock screen is disabled).  During the
initial boot of a wiped device, the window manager was getting the wrong
values because LockSettingsService.systemReady/migrateOldData had not yet been
called.

Change-Id: I60825d0e4fad53a5b4349dabf9e5e299b863d0d0

(cherry pick of 2458abaf6676d5015af733c1010ecd67a085e9e2 from jb-aah-dev)
2012-08-08 13:15:00 -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
Dianne Hackborn
537915828b Merge "More mult-user API work." into jb-mr1-dev 2012-08-08 10:22:49 -07:00
John Spurlock
786546eacc Check the ACTIVATE_ON_DOCK setting in DockObserver.
Otherwise docking the device will always launch a Dream.

Change-Id: I2e74ca62f80d7e386d11c00920a75a5a6e78926c
2012-08-08 11:40:20 -04: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
Svetoslav Ganov
85b1041f89 Merge "Window position not reported if the window is not moved." into jb-mr1-dev 2012-08-06 23:51:36 -07:00
Svetoslav Ganov
758143ecfe Window position not reported if the window is not moved.
1.If a window is shown but never moved the window window
  is never notified for its current location. Therefore,
  accessibility nodes do not contain correct bounds in
  screen coordinates.

bug:6926295

Change-Id: I7df18b095d33ecafffced75aba9e4f4693b0c393
2012-08-06 23:49:38 -07:00
Dianne Hackborn
3c91724e7a Merge "Refactor Service code out of main ActivityManagerService class." into jb-mr1-dev 2012-08-06 17:53:18 -07:00
Dianne Hackborn
599db5c85f Refactor Service code out of main ActivityManagerService class.
Change-Id: I83ade73b48e8fda1ad413634c1eb0dba2a545ca7
2012-08-06 17:52:02 -07:00
Jeff Sharkey
088f29f55e Cleaner controls between Vpn and init services.
Change-Id: I35edf054f4a1190f7fb7b4c48ee832e899c9528b
2012-08-06 14:48:49 -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
bec1d13da2 Merge "Make generic BaseNetworkObserver." into jb-mr1-dev 2012-08-05 14:58:13 -07:00
Jeff Sharkey
9c5c659597 Merge "Make LocalSocket Closeable." into jb-mr1-dev 2012-08-05 14:55:28 -07:00
Jeff Sharkey
216c181e76 Make generic BaseNetworkObserver.
This makes it easier to add new INetworkManagementEventObserver events
in future.

Change-Id: I432263d745558de4b878f313c1951230ed9db2b1
2012-08-05 14:32:41 -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
2e5746a7a8 Merge "We can now (kind-of) change screen density on the fly." into jb-mr1-dev 2012-08-03 17:45: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
Jeff Sharkey
0b24b1d37a Merge "Pass changed NetworkInfo to LocationProvider." into jb-mr1-dev 2012-08-03 11:56:03 -07:00
Jeff Sharkey
821bd8081a Pass changed NetworkInfo to LocationProvider.
LocationProviders often rely on non-default networks, so pass the
network that actually changed, instead of the default.

Bug: 6929692
Change-Id: I31d9eec792e07259282aa1bb57ec66c01962df64
2012-08-03 11:53:01 -07:00
John Spurlock
3185b376b0 Merge "Re-enable dreams: frameworks/base" into jb-mr1-dev 2012-08-03 08:36:41 -07:00
Craig Mautner
7de53949bc Merge "Add features to DisplayManager." into jb-mr1-dev 2012-08-03 08:25:42 -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
Jeff Brown
f95f3ebf12 Merge "Allow access to display manager service from isolated processes." into jb-mr1-dev 2012-08-02 14:58:47 -07:00
Jeff Brown
e7c1d88fba Allow access to display manager service from isolated processes.
Bug: 6921302
Change-Id: I9eed4a24992538e18ad0540b96a8cea2c8a9ef76
2012-08-02 14:55:26 -07:00
Craig Mautner
9de4936c99 Add features to DisplayManager.
Added Surface.setDisplayId().
Added callbacks to DisplayManagerService.

Change-Id: Idd3f85f8ca1f1208962f1196efd6a3ab51c8c259
2012-08-02 14:30:30 -07:00
Craig Mautner
2a642a450a Merge "Refactor DisplayManagerService to be functional." into jb-mr1-dev 2012-08-02 13:16:13 -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
Craig Mautner
4f67ba6ba4 Refactor DisplayManagerService to be functional.
Change-Id: Ieac1eca172be5dc5db45302d3afa26188acd4d6d
2012-08-02 11:23:00 -07:00
Craig Mautner
437a0fbd57 Merge "Introduce multiple displays with DisplayContent." into jb-mr1-dev 2012-08-02 09:20:14 -07:00