8147 Commits

Author SHA1 Message Date
Craig Mautner
3486b9696d Fix drag bug.
Previous assumption -- that the drag window was defined at time of
DragState construction -- was false. The window, and hence the
Display, is not known until performDrag. This change delays assigning
DragState.mDisplayContent until the window/Display is known.

Fixes bug 7028203.

Change-Id: I5799005652c484ff0c45ab340ce3b9e4b784883e
2012-08-27 11:31:24 -07:00
Jean-Baptiste Queru
af18865486 am ba37d595: am e70a32af: am eb00f951: Merge "VibratorService: Fix to ensure actual delay in a vibrate pattern"
* commit 'ba37d595f70d348987a9e60c56c071fdd319260f':
  VibratorService: Fix to ensure actual delay in a vibrate pattern
2012-08-27 08:16:02 -07:00
Jean-Baptiste Queru
ba37d595f7 am e70a32af: am eb00f951: Merge "VibratorService: Fix to ensure actual delay in a vibrate pattern"
* commit 'e70a32afc5b27ddc9681efd867780a0c4c77edd3':
  VibratorService: Fix to ensure actual delay in a vibrate pattern
2012-08-27 08:13:27 -07:00
Jean-Baptiste Queru
eb00f95143 Merge "VibratorService: Fix to ensure actual delay in a vibrate pattern" 2012-08-27 07:55:41 -07:00
Jeff Brown
d59db50ab0 Merge "Initialize screen state earlier in the boot process." into jb-mr1-dev 2012-08-25 13:46:49 -07:00
Jeff Brown
04a286b955 Merge "Fix GpsLocationProvider wake lock book keeping." into jb-mr1-dev 2012-08-25 13:44:51 -07:00
Jeff Brown
f85ddd6571 Merge "Make it easier to create asynchronous Handlers." into jb-mr1-dev 2012-08-25 13:43:48 -07:00
Jeff Brown
f75724b3d3 Initialize screen state earlier in the boot process.
The system depends on receiving reliable vsync signals from
surface flinger during the boot process.  If it doesn't get them
because the screen is off then a hang may occur.

This isn't a problem when surface flinger manages the screen
blanking itself but it is a problem for devices that still
rely on early-suspend.  When early-suspend is involved, the
screen may be off without surface flinger knowing.  This is a
problem because surface flinger will only synthesize fake
vsyncs when it knows the screen is off, otherwise relying
on the hardware to generate vsync signals itself.  Unfortunately,
the hardware won't generate vsync signals if the screen was
turned off by early-suspend, so we have a problem.

Bug: 6975688
Change-Id: Iaf4527f716bf4ea72cc3e6fdaf060855697b02f2
2012-08-25 13:41:35 -07:00
Jeff Brown
028872fe07 Fix GpsLocationProvider wake lock book keeping.
The GpsLocationProvider typically acquires a wake lock
before sending a message to its handler then releases it
after the message has been handled.

There were two cases where messages might be removed from
the handler, resulting in the wake lock being released.

There were also two cases where background tasks were being
started while not holding a wake lock for the duration.

Fixed these issues and marked the GpsLocationProvider handler
as asynchronous too so that it doesn't accidentally get
blocked by traversals if it happens to share a thread with some UI.

Bug: 7057752
Change-Id: I8e12fc91ae943e84db068c08ec809879537503c6
2012-08-25 13:40:28 -07:00
Jeff Brown
a2910d0abb Make it easier to create asynchronous Handlers.
There are potentially very many Handlers owned by services
that should not be blocked by barriers introduced by UI traversals
occurring on the same thread (if that ever happens).
Add some convenience constructors to make it easy to switch
these Handlers over to being async.

Bug: 7057752
Change-Id: I64d9bffe81e7c52ada4cfad4e89d4340153f4688
2012-08-25 13:40:26 -07:00
Amith Yamasani
080ca09c7f Merge "Bind to the correct default container service when installing/moving/measuring pkgs" into jb-mr1-dev 2012-08-25 07:25:42 -07:00
Amith Yamasani
6ec101288b Bind to the correct default container service when installing/moving/measuring pkgs
Change-Id: I0acfe955b5d57b4985d1922fe3dd841a81c824ed
2012-08-25 07:17:29 -07:00
Dianne Hackborn
ba94170a7a Merge "Some clean up of app install and user management." into jb-mr1-dev 2012-08-24 18:03:56 -07:00
Dianne Hackborn
4428e17c5e Some clean up of app install and user management.
UserManagerService is now closely tied to PackageManagerService,
sharing the same locks.  There is no longer direct access of
Installer by UserManagerService, instead the package manager is
back to solely owning it.

Creating a new user now correctly only installs system apps for
that user.

Fixed some misc bugs, where we were getting nulls when
querying content providers and instrumentation in uninstalled
users, incorrect locking, etc.

Change-Id: Ife69b6e373d0cf7c5cfc03fc588e36b43ad5d8b0
2012-08-24 18:00:37 -07:00
Brian Muramatsu
0b23b5f603 Merge "Fix GPS provider thread blocked by NTP and XTRA" into jb-mr1-dev 2012-08-24 14:53:14 -07:00
Kevin Tang
40e1bafc37 Fix GPS provider thread blocked by NTP and XTRA
Currently, the NTP and XTRA downloads block on the GPS provider thread.
This could potentially block the next tasks for over a minute of time.
If the upcoming task happens to be AGPS, AGPS will time out.

Placed the NTP and XTRA downloads in separate threads.

Bug: 6980618

Change-Id: I57a6aaf5348212bc1246813f6d941da7d5b19136
2012-08-24 14:06:47 -07:00
Dianne Hackborn
7767eac323 Keep track of whether an app is installed for each user.
This add a new per-user state for an app, indicating whether
it is installed for that user.

All system apps are always installed for all users (we still
use disable to "uninstall" them).

Now when you call into the package manager to install an app,
it will only install the app for that user unless you supply
a flag saying to install for all users.  Only being installed
for the user is just the normal install state, but all other
users have marked in their state for that app that it is not
installed.

When you call the package manager APIs for information about
apps, uninstalled apps are treated as really being not visible
(somewhat more-so than disabled apps), unless you use the
GET_UNINSTALLED_PACKAGES flag.

If another user calls to install an app that is already installed,
just not for them, then the normal install process takes place
but in addition that user's installed state is toggled on.

The package manager will not send PACKAGE_ADDED, PACKAGE_REMOVED,
PACKAGE_REPLACED etc broadcasts to users who don't have a package
installed or not being involved in a change in the install state.
There are a few things that are not quite right with this -- for
example if you go through a full install (with a new apk) of an
app for one user who doesn't have it already installed, you will
still get the PACKAGED_REPLACED messages even though this is
technically the first install for your user.  I'm not sure how
much of an issue this is.

When you call the existing API to uninstall an app, this toggles
the installed state of the app for that user to be off.  Only if
that is the last user user that has the app uinstalled will it
actually be removed from the device.  Again there is a new flag
you can pass in to force the app to be uninstalled for all users.

Also fixed issues with cleaning external storage of apps, which
was not dealing with multiple users.  We now keep track of cleaning
each user for each package.

Change-Id: I00e66452b149defc08c5e0183fa673f532465ed5
2012-08-24 13:53:13 -07:00
Jeff Sharkey
1552586283 Merge "Clean up firewall interface method names." into jb-mr1-dev 2012-08-24 11:46:27 -07:00
Jeff Sharkey
2c0929850a Clean up firewall interface method names.
Change-Id: I653f0a01af7c90fc96b201abb31ea8354b036e74
2012-08-24 11:44:40 -07:00
Jeff Sharkey
34f8631258 Merge "Migrate legacy VPN arguments to system_server." into jb-mr1-dev 2012-08-24 11:33:00 -07:00
Jeff Sharkey
82f8521d38 Migrate legacy VPN arguments to system_server.
Generate the racoon and mtpd daemon arguments in system_server,
instead of accepting them from Settings.

Bug: 5756357
Change-Id: I42c1a644f6add477fe4222342640d7db15982cb8
2012-08-24 11:29:58 -07:00
Jeff Sharkey
96702ad6d7 Merge "Framework interface for netd firewall." into jb-mr1-dev 2012-08-24 11:07:42 -07:00
Jeff Sharkey
c268f0b19e Framework interface for netd firewall.
Bug: 5756357
Change-Id: If8b9f738fcea2cf16bd01682220718b57346c7cc
2012-08-24 11:00:28 -07:00
Craig Mautner
fc6baa8349 Merge "Fix unprotected variable access by serializing." into jb-mr1-dev 2012-08-23 16:47:50 -07:00
Jeff Sharkey
d5fc86f067 Merge "Begin moving VPN to NetworkStateTracker pattern." into jb-mr1-dev 2012-08-23 16:47:50 -07:00
Jeff Sharkey
899223b97c Begin moving VPN to NetworkStateTracker pattern.
Created base tracker that handles common bookkeeping, and move VPN
to become a tracker.  VPN status is now reflected in NetworkInfo, and
is mapped to LegacyVpnInfo.

Legacy VPN now "babysits" any init services it starts, watching for
when they stop unexpectedly.

Bug: 5756357
Change-Id: Iba7ec79da69469f6bd9a970cc39cf6b885b4c9c4
2012-08-23 16:41:06 -07:00
rich cannings
7646c773fa Merge "Allow verifiers to extend timeout" into jb-mr1-dev 2012-08-23 15:56:04 -07:00
rich cannings
d9ef3e5495 Allow verifiers to extend timeout
Create a new verifier API to extend the timeout for a giving package,
including the resulting action (allow or deny) upon the timeout occuring.

Bug: 6901038
Change-Id: I351f7944327f863aff1d7dd1227be74652fa1511
2012-08-23 15:39:02 -07:00
Craig Mautner
5642a48fbb Fix unprotected variable access by serializing.
The variables mKeyguardDisabled and mAllowDisableKeyguard were
being modified unprotected by mKeyguardTokenWatcher. Fix is to
serialize accesses to these variables by only referencing them
from the same Handler that mKeyguardTokenWatcher uses. Eliminates
synchronization blocks and mKeyguardDisabled variable.

Fixes bug 7045624.

Change-Id: I6355aa393507408296316bee61e178dc81e2a172
2012-08-23 14:25:34 -07:00
John Spurlock
10fb224623 Disable screensavers if below first battery warning level.
Don't activate on sleep if below the threshold, and quit any currently
running dream when the threshold is reached.

Bug:6999949
Change-Id: I961b350d24ee6f95e502228aaa57312b0ffbadc1
2012-08-23 16:23:18 -04:00
John Spurlock
21b53df7c3 Merge "Add framework support for multiple dreams." into jb-mr1-dev 2012-08-23 10:44:05 -07:00
Craig Mautner
6715d1effa Merge "Clean up displayId and layerStack usage." into jb-mr1-dev 2012-08-23 08:44:53 -07:00
Craig Mautner
b47bbc3d80 Clean up displayId and layerStack usage.
Make better use of Display object by saving it in DisplayContent.
Only use layerStack when referring to Surfaces. Get displayId from
default Display or default DisplayContent. Remove warnings.

Fixes bug 7038151.

Change-Id: Ie493f0f5e755dc9b91ee969ff561c2a098283ead
2012-08-23 08:43:54 -07:00
Amith Yamasani
2c1dfa29b4 Merge "Fix deadlock in removing a user" into jb-mr1-dev 2012-08-22 18:19:20 -07:00
Jeff Sharkey
3451dc9064 Merge "Iteration on multi-user external storage." into jb-mr1-dev 2012-08-22 18:17:30 -07:00
Amith Yamasani
0cd867c83e Fix deadlock in removing a user
Cleanup PackageManager settings after the package directories are removed.

Change-Id: I264bc95ea21da653a234d7c81df5b25d4de7aa9e
2012-08-22 16:45:47 -07:00
Craig Mautner
b9b56954ec Merge "Eliminate special battery calls by WindowManager" into jb-mr1-dev 2012-08-22 14:14:54 -07:00
Jeff Sharkey
2bca868361 Iteration on multi-user external storage.
Remove single-user bind mounts, since they need to remain as raw
mounts to correctly propagate when remounted.  This means we're back
to using sdcard_r GID to enforce READ_EXTERNAL_STORAGE.

Bug: 6925012
Change-Id: I41b5d7ddc985a5df2e288632a0a80d4724089e00
2012-08-22 13:59:58 -07:00
John Spurlock
1a868b7981 Add framework support for multiple dreams.
Bug:7028665
Change-Id: I4fba6b8e39dc07af4490c621ac3bc7b3867371b2
2012-08-22 16:49:20 -04:00
Jeff Brown
6cf3b925ca Merge "Fix auto-brightness adjustment sentinel value." into jb-mr1-dev 2012-08-22 13:31:08 -07:00
Jeff Brown
5d03a53681 Fix auto-brightness adjustment sentinel value.
Change-Id: I1b0da4566eb350333d3c3b09a96266627260baa3
2012-08-22 13:22:02 -07:00
Jeff Brown
6da92032da Merge "Fix NPE." into jb-mr1-dev 2012-08-22 13:17:22 -07:00
Jeff Brown
b5b710a485 Fix NPE.
Bug: 7034583
Change-Id: Ie6b436492d12b0dd6bbe1c25d9b7ac35b74095d3
2012-08-22 13:16:01 -07:00
Craig Mautner
259328c04c Eliminate special battery calls by WindowManager
Previous to this change the WindowManager was notifying the
BatteryDtatsService about windows that keep the screen on. WM used a
custom WakeLock tag to indicate to PowerManagerService that it had
already notified the BatteryStatsService.

This change eliminates WindowManager notifying the BatteryStatsService
and lets PowerManagerService do the job.

Fixes bug 7030326.

Change-Id: I666dc6ef8f094b8d3d109fea6876be058e057b4f
2012-08-22 11:01:35 -07:00
Amith Yamasani
98dddda791 Merge "Remove permission requirement for some UserManager calls" into jb-mr1-dev 2012-08-22 10:31:30 -07:00
Amith Yamasani
1952637425 Remove permission requirement for some UserManager calls
Update javadocs to be explicit about permissions.
Minor fixes in UserManagerService

Change-Id: I0d355e0a60e5dbdb49ed06091111d480ff249f3d
2012-08-22 10:28:56 -07:00
Jean-Baptiste Queru
2bd65b61ba am 29c6f24b: am 6ffe2594: Merge "restorecon /data/anr directory."
* commit '29c6f24b254b4ea1a7d8448980e736355e4badf6':
  restorecon /data/anr directory.
2012-08-22 07:49:03 -07:00
Jean-Baptiste Queru
29c6f24b25 am 6ffe2594: Merge "restorecon /data/anr directory."
* commit '6ffe2594674f250c16c5e3055aa69680efaa6f69':
  restorecon /data/anr directory.
2012-08-22 07:46:41 -07:00
Jean-Baptiste Queru
6ffe259467 Merge "restorecon /data/anr directory." 2012-08-22 07:18:39 -07:00
Jeff Brown
00a8f4ff62 Make the electron beam animation shorter.
Now using about the same duration as it used to have when
it was implemented in Surface Flinger.

Change-Id: I09b28222379f4b6583f1f7b34188cc36c50509e9
2012-08-22 00:06:09 -07:00