829 Commits

Author SHA1 Message Date
Jeff Sharkey
91bbb8a1e9 Create media paths for existing users.
Bug: 6925012
Change-Id: I23bd9187217645cf538e074527c143a911a61299
2012-08-16 23:29:34 -07:00
Jeff Sharkey
c584b65b20 Merge "Multi-user external storage support." into jb-mr1-dev 2012-08-16 14:32:39 -07:00
Jeff Sharkey
5b1ada2562 Multi-user external storage support.
Emulated external storage always has multi-user support using paths
like "/data/media/<user_id>".  Creates and destroys these paths along
with user data.  Uses new ensure_dir() to create directories while
always ensuring permissions.

Add external storage mount mode to zygote, supporting both single-
and multi-user devices.  For example, devices with physical SD cards
are treated as single-user.  Begin migrating to mount mode instead
of relying on sdcard_r GID to enforce READ_EXTERNAL_STORAGE.

Bug: 6925012
Change-Id: I9b872ded992cd078e2c013567d59f9f0032ec02b
2012-08-15 19:45:53 -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
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
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
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
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
437a0fbd57 Merge "Introduce multiple displays with DisplayContent." into jb-mr1-dev 2012-08-02 09:20:14 -07:00
Craig Mautner
59c009776d Introduce multiple displays with DisplayContent.
Fix a couple of bugs that turned up.
Remove touch/focus from display. Add iterators for access.
Respond to comments. Remove TODOs, and some deviceId parameters.

Change-Id: Idcdb4f1979aa7b14634d450fd0333d6eff26994d
2012-08-02 08:47:44 -07:00
Kenny Root
00efe44923 am b3e4b46d: am e583bcf1: Merge "Explicitly set lib dir permissions during unlink" into jb-dev
* commit 'b3e4b46db028c35d6d12c5f8f25b0463833fb51d':
  Explicitly set lib dir permissions during unlink
2012-07-31 09:36:17 -07:00
Kenny Root
b3e4b46db0 am e583bcf1: Merge "Explicitly set lib dir permissions during unlink" into jb-dev
* commit 'e583bcf13c13957bdf20f8bc5e23258b083b2f51':
  Explicitly set lib dir permissions during unlink
2012-07-31 09:34:26 -07:00
Kenny Root
515087d1c5 Explicitly set lib dir permissions during unlink
The default umask changed, so we have to explicitly set the mode of the
lib directory when we create it in unlinklib.

Bug: 6857022
Change-Id: I06fc3f29e99d686bbbb96184d8c314d4cc57e9fe
2012-07-30 15:01:20 -07:00
Mathias Agopian
92c6d2fc50 update to new getDisplayInfo API
Change-Id: I8051b4f9f23d3ef4791176de1bbcfafacae7d579
2012-07-25 20:38:27 -07:00
Nick Kralevich
b8acd060d4 am fa6e1ea7: am 2c932143: Merge "s/LOG/ALOG/ in HAVE_SELINUX blocks"
* commit 'fa6e1ea773a74aa6a996a783ff16c495ab3cc822':
  s/LOG/ALOG/ in HAVE_SELINUX blocks
2012-07-20 10:00:45 -07:00
Jaikumar Ganesh
1abb1cb3a8 Changes to Bluetooth Service structure.
Changes to make Bluetooth Service part of the system_service.
These changes may be temporary.

Changes to update to the new disable API.

Change-Id: If89dba17e6e6c6daa53c37684221763a2da076e9

Conflicts:

	services/java/com/android/server/pm/PackageManagerService.java
2012-07-13 22:22:51 -07:00
Dianne Hackborn
197a0c82a1 Improve cleanup of file caches.
This rewrites installd's code for deleting cache files to be better:

- Isn't really stupid about just deleting directories in the order
  they are found on the filesytem; now collects all cache files and
  sorts them by mod time to determine which to delete.
- Also deletes cache files in /data/media and for all users.

This also tweaks DeviceStorageMonitor to be a little smarter about
deciding when to flush cache files, having upper and lower limits
that it allows memory to get down to and then flash files to reach
the higher free storage limit.  This should reduce the amount that
we perform flushing when starting to reach the storage limit.

Finally add a new pm command to force a cache flush.

Change-Id: I02229038e1ad553d1168393e5cb6d5025933271d
2012-07-12 14:46:04 -07:00
Joshua Brindle
365861e3aa s/LOG/ALOG/ in HAVE_SELINUX blocks
The latest push changed LOG(E|V) to ALOG(E|V) but it was not updated in HAVE_SELINUX blocks.

Change-Id: I626588589dd00775ba29f2a256ac29e481598dc3
Signed-off-by: Joshua Brindle <jbrindle@tresys.com>
2012-07-10 11:02:01 -04:00
Mathias Agopian
4f741c3c22 move sensorservice to the frameworks/native project
Change-Id: I285c190904b2b6b92df3e40154d178407a712f6e
2012-06-28 15:10:44 -07:00
Mathias Agopian
8b38953926 am 06c93386: Merge "Exit boot animation cleanly." into jb-dev
* commit '06c93386374de3812629908f21c057a8d60c4b12':
  Exit boot animation cleanly.
2012-06-20 13:37:13 -07:00
Kevin Hester
d3782b26b2 Exit boot animation cleanly.
The desc.txt file can now mark parts as 'must finish cleanly' by using
'c' as the part line prefix rather than 'p'.  If so indicated, if the
bootanimation is asked to quit it will do so only after waiting to
finish that part.

I considered either making init.c service killing smarter or promoting
bootanim to be a bindable service with a requestExit method.  However,
these changes are probably too big/risky given our ship date.  So
I used a property as a mailbox between SurfaceFlinger and bootanim.

Bug: 6679877
Change-Id: I1f8dd9e7da1ea80a483b31fa14c4a5645922d774
2012-06-19 17:38:43 -07:00
Amith Yamasani
39758edbed am 386ce58a: Merge "Don\'t backup or delete the backup file, if it\'s in the backup path." into jb-dev
* commit '386ce58a21b81390d2831b0f1107d03773af687a':
  Don't backup or delete the backup file, if it's in the backup path.
2012-06-18 16:51:41 -07:00
Amith Yamasani
386ce58a21 Merge "Don't backup or delete the backup file, if it's in the backup path." into jb-dev 2012-06-18 16:49:28 -07:00
Amith Yamasani
0ba48a5402 Don't backup or delete the backup file, if it's in the backup path.
Change-Id: Ie77782722a271e09f8cbde7fb5393e8127d4334d
2012-06-18 13:04:27 -07:00
Kenny Root
33ef4ee712 resolved conflicts for merge of 4de60b26 to jb-dev-plus-aosp
Change-Id: Id1b1847a3ab5c0f51ac8a732fce5ba12e5810259
2012-06-18 10:26:36 -07:00
Kenny Root
4503cf67b5 Make lib dir before changing ownership of app dir
Bug: 6668897
Change-Id: I8998a50359892277b15e80b5b5590ff94b125467
2012-06-14 15:28:37 -07:00
Justin Ho
11d536b381 am ceb80679: Merge "make the boot animation 32-bits to avoid banding" into jb-dev
* commit 'ceb8067920043a430478be386c56c244355d4c9f':
  make the boot animation 32-bits to avoid banding
2012-06-12 12:45:46 -07:00
Mathias Agopian
60691ce160 make the boot animation 32-bits to avoid banding
Bug: 6611693

Change-Id: Id31b711ea755c89240eaea26f6403a031cd939e4
2012-06-11 14:52:32 -07:00
Kenny Root
3a3c7e7bc4 am 63dd4c65: am 60b3d59d: Merge "Modify installd to set the SELinux security context on package directories."
* commit '63dd4c65c41187967ba0828d386117f90020840e':
  Modify installd to set the SELinux security context on package directories.
2012-06-08 14:01:54 -07:00
Kenny Root
60b3d59d7f Merge "Modify installd to set the SELinux security context on package directories." 2012-06-08 12:27:42 -07:00
Dianne Hackborn
d0c5f515c0 Fix issue #6295373: "Package com.google.android.apps.authenticator2 has...
...mismatched uid: X on disk, Y in settings" errors on Froyo and Gingerbread

Deal more gracefully with the uid changing in three ways:

1. If the uid on disk has become root, then have installd change it to
   the application's uid.  This is to correct a potential case where
   installd was interrupted while linking or unlinking the libs dir,
   during which it temporarily changes the owner of the dir to root
   so that a malicious app can not get in its way.  So if the uid on
   disk has become root, we assume we can safely just change it back
   to the correct uid.

2. When scaning packages at boot, use the same "delete and rebuild data
   directory" code for third party applications as we have for system
   applications.  This allows us to at least end up in a state where the
   app will run, even if its data is lost.

3. But we really don't want to get in to case 2, so if an application
   update is being installed and we find that the uid we now have for
   the app is different than the one on disk, fail the update.  This will
   protect against for example a developer changing the sharedUserId of
   their app and getting into this bad state.

Bug: 6295373
Change-Id: Ic802fdd818ac62449ff3c61d1fff1aa4d4942f39
2012-06-07 16:57:57 -07:00
Amith Yamasani
fd3d009dde Remove some unnecessary man page entries
Change-Id: I1ceda3f5efac83b80ab4b6e7cae4086aeed5062a
2012-05-30 17:57:06 -07:00
Romain Guy
13b907353f Remove unused, obsolete debug code
All these features have either been abandonned and left un-maintained
for years or can be replaced by systrace.

Change-Id: I42e4579a8078744047e5fe08a7a15254970b09bc
2012-05-21 13:29:06 -07:00
Mathias Agopian
db7dd2af93 fix BootAnimation timing
We were including the delay of the previous frame when
calculating the delay needed between a frame and the next.
This caused a bad jitter in the animation timing.

We also now use clock_nanosleep().

Change-Id: Iebb8cca4d57fe2f11d83b23a736e03db7a7d2006
2012-05-12 15:08:21 -07:00
Jeff Brown
995cb9739a Merge "Empower the 'input' command with keycode labels." into jb-dev 2012-05-09 17:35:28 -07:00
Jeff Brown
ca13fed08b Empower the 'input' command with keycode labels.
Change-Id: Ia077f8ee0732599cec9b04efc2f828d3d22f5bac
2012-05-09 17:18:20 -07:00
Anonymous Coward
ceb1b0bfae Add encryption parameters to package installation
Change-Id: Ic9f8ab9f8110f08bb3c00725cfce5b8ee7b766f3
2012-05-07 16:34:49 -07:00
Guang Zhu
7fdde0cee2 Merge "remove extra semi colon" into jb-dev 2012-05-01 15:47:28 -07:00
Guang Zhu
f0e3edc070 remove extra semi colon
Eclipse has been complaining about it...

Change-Id: I39fb4eeab26af883dd2287baf49ec244db453365
2012-04-30 18:29:23 -07:00
Jeff Sharkey
719a6320a7 Change permission enforcement through pm command.
Add "set-permission-enforced", which can currently only mutate
enforcement of READ_EXTERNAL_STORAGE.

Bug: 6363043
Change-Id: I3f7929738c8c36b0a54fbf171c03fe16c09b5d99
2012-04-30 13:46:54 -07:00
Robert Greenwalt
59d3d86811 Add Usb control to svc.
We used to have control over usb via ndc but recent changes removed that.
The reverse_tether.sh script needs control (on rooted devices) to run
so added this.

bug:4208971
Change-Id: I722fc0e14540890be0d79a0b7d22f23b2d57f20c
2012-04-27 10:06:16 -07:00
Travis Geiselbrecht
fd135bc809 am f4b6628e: BootAnimation: fix bug to delay the appropriate amount of time per frame
* commit 'f4b6628e5084bf317eab5326c51cbecb8fabdc45':
  BootAnimation: fix bug to delay the appropriate amount of time per frame
2012-04-24 14:23:25 -07:00
Travis Geiselbrecht
f4b6628e50 BootAnimation: fix bug to delay the appropriate amount of time per frame
Change-Id: I300b67a97a9a685cec59df12d8d605c2b0b49180
2012-04-24 14:14:55 -07:00
Dianne Hackborn
7df7d2022d Fix issue #4499996: LiveWallpaperPreview activity intent filter
Change-Id: I5fc71503d2c59c907da954dbda3587394e6405bf
2012-04-19 18:00:04 -07:00
Jeff Brown
9f25b7fdf2 Request key maps from input manager service.
Instead of each application loading the KeyCharacterMap from
the file system, get them from the input manager service as
part of the InputDevice object.

Refactored InputManager to be a proper singleton instead of
having a bunch of static methods.

InputManager now maintains a cache of all InputDevice objects
that it has loaded.  Currently we never invalidate the cache
which can cause InputDevice to return stale motion ranges if
the device is reconfigured.  This will be fixed in a future change.

Added a fake InputDevice with ID -1 to represent the virtual keyboard.

Change-Id: If7a695839ad0972317a5aab89e9d1e42ace28eb7
2012-04-10 18:23:58 -07:00
Stephen Hines
90d82ea008 Merge "Build /system/bin/asan/app_process." 2012-04-06 10:30:49 -07:00
Jeff Brown
ac14351e16 Move some APIs from window manager to input manager.
Simplified input injection API down to just one call.

Removed all input state reading API.  It was only used by the
window manager policy and required a permission that applications
could not obtain.  READ_INPUT_STATE is now unused and deprecated.

Change-Id: I41278141586ddee9468cae0fb59ff0dced6cbc00
2012-04-05 19:33:11 -07:00
Evgeniy Stepanov
bb4cd82592 Build /system/bin/asan/app_process.
Change-Id: Id3fa26a1bc0e0832bfde73dbd3acce15ecce823d
2012-04-04 21:51:44 +04:00
Stephen Hines
5bb508fac6 Revert "Build /system/bin/asan/app_process."
This reverts commit cb5c734790e1e3d8496b4c75c57e8a537784c056
2012-04-04 08:12:46 -07:00