7086 Commits

Author SHA1 Message Date
Jeff Brown
c2346134bb Extract Vibrator implementation from interface.
Moved the core logic of Vibrator into SystemVibrator, potentially
allowing for the creation of other Vibrator subclasses.

Fixed several places where we were creating new Vibrator
instances unnecessarily instead of getting it from the Context.

It is safe to make Vibrator abstract because its constructor
was hidden from the SDK so it was not possible to subclass it.

Bug: 6334179
Change-Id: I18ece6544c26a7efb2d5099f8346a10aef8a5e18
2012-04-13 04:05:17 -07:00
Jeff Sharkey
5d32e772b3 Enforce READ_EXTERNAL on non-user builds.
Enable default enforcement of READ_EXTERNAL_STORAGE on non-user
builds. Users can still explicitly enable enforcement in Settings.

Bug: 6131916
Change-Id: I7dc66b624ad252ed2a2ad3647f3ea85dda7f8e82
2012-04-12 23:29:14 -07:00
Jeff Brown
882735972e Merge "Notify applications when input devices change." 2012-04-12 18:55:57 -07:00
Jeff Brown
af9e8d3818 Notify applications when input devices change.
This change allows the InputManager to keep track of what input
devices are registered with the system and when they change.
It needs to do this so that it can properly clear its cache of
input device properties (especially the key map!) when changes
occur.

Added new API so that applications can register listeners for
input device changes.

Fixed a minor bug in EventHub where it didn't handle EPOLLHUP
properly so it would spam the log about unsupposed epoll events
until inotify noticed that the device was gone and removed it.

Change-Id: I937d8c601f7185d4299038bce6a2934fe4fdd2b3
2012-04-12 18:54:54 -07:00
Dianne Hackborn
67ae551272 Merge "Keep activities stopped while the lock screen is up." 2012-04-12 18:18:45 -07:00
Irfan Sheriff
cbba37c609 Merge "Bonjour fixes" 2012-04-12 17:55:15 -07:00
Dianne Hackborn
ff5b158f69 Keep activities stopped while the lock screen is up.
Tell the activity manager when the lock screen is shown, so it
can keep itself (mostly) in sleep mode during this time, having
the foreground actvities remain in their stopped state.

Change-Id: I71c86d3298f23a98014d7ae36fd540c9df9a64e6
2012-04-12 17:26:55 -07:00
Dianne Hackborn
0c2acffec8 Clean up lock screen hide animation.
We now have an animation to apply to the thing behind the lock
screen animation when it isn't on the wallpaper, which looks
similar to the animation we use when both are on the wallpaper.

In implementing this, cleaned up the code to figure out up-front
which animation to run, getting rid of that kludgy thing that
cleared the window animation if the wallpaper was not being used
for the lower windows.

Change-Id: Ifc4c8a8894ad384124dcf4bbdaab134f1157b0f3
2012-04-12 15:26:11 -07:00
Jeff Sharkey
234766a36a Move TrafficStats iface counters to xt_qtaguid.
Use xt_qtaguid iface_stat_all counters, which are monotonic during
a single boot.

Track all ifaces associated with mobile networks since boot, and
move TrafficStats to using these ifaces.  This will include usage of
networks omitted from config_data_usage_network_types, specifically
on devices that recycle network interfaces across APNs.

Split wildcard template matching, and move NetworkStatsService to
use mobile wildcard when logging stats.

Bug: 5324515
Change-Id: I2211c374c05d1b598cc647f2f873630538955ffe
2012-04-12 14:53:32 -07:00
Dianne Hackborn
187ae2105e Revert to ICS screen rotation animation.
Change-Id: Ida76f17a00e4c8ab828deae51095107e4eeaa321
2012-04-12 13:08:26 -07:00
Irfan Sheriff
817388e056 Bonjour fixes
Change-Id: I1df1dc470bb42c84abc7e1a46bedf9f206910b65
2012-04-12 12:08:51 -07:00
Amith Yamasani
2b23adbc33 Merge "Make dumpsys activity services work again." 2012-04-12 11:18:08 -07:00
Amith Yamasani
7463adacbd Make dumpsys activity services work again.
Due to the step to query the users, dumpsys was crashing when run
as non-root. Clearing the calling identity after checking perms
fixes this.

Bug: 6311443
Change-Id: I0b0bca5c7305cea19adc772b3bfec34c16bb24c4
2012-04-12 10:41:19 -07:00
Jeff Sharkey
a11236bf09 Merge "Include enforcement state in dumpsys." 2012-04-11 19:11:35 -07:00
Jeff Sharkey
1c27576aff Include enforcement state in dumpsys.
Bug: 6323087
Change-Id: I6d779798538c114ea9816d3bdbbff5552c285df6
2012-04-11 19:07:08 -07:00
Justin Mattson
2f63cfda76 am 4ea7bfea: Merge "Check if WallpaperService is enabled" into ics-aah
* commit '4ea7bfea312e4ddf815eabdef04d3f3b4878a51a':
  Check if WallpaperService is enabled
2012-04-11 17:44:53 -07:00
Craig Mautner
1e1edaa60d Merge "Check WindowState when looking for animation." 2012-04-11 17:18:44 -07:00
Craig Mautner
f20588fdc6 Check WindowState when looking for animation.
The method setTokenVisibilityLocked returns true when animations are
delaying the exit of an app. Previously this only checked AppToken
animations but that caused exiting WindowState animations to be
ignored.

In particular if an application both hid an AppToken and then
dismissed the AppToken, the AppToken was being removed from
mClosingTokens before the animation finished. This caused
rebuildAppWindowListLocked to lose a WindowState. Furthermore
Surfaces were not being removed when a WindowState was lost and
we were leaking Surfaces.

Fixes bug 6297563.

Change-Id: Ie75c71064518199237ec4a17d3f65e2a2dd29674
2012-04-11 17:15:09 -07:00
Dianne Hackborn
f882efadd3 Fix issue #6266651: Low storage warning takes long time to sort apps by usage
On a device with emulated external storage, the low storage notification
should go to the main storage settings UI.  This shows the user all of
the things that could be causing their storage to be low.

Change-Id: I9c345b6cb7abbabc24a67c7e104d077ecbbfb86d
2012-04-11 16:04:12 -07:00
Craig Mautner
b414812549 Merge "Check for existing dimming before stop dimming." 2012-04-11 09:35:05 -07:00
Craig Mautner
f8d4fbb9c8 Check for existing dimming before stop dimming.
Add a test to make sure that we are dimming before we send the message
to stop it. This prevents a CPU consuming loop when dimming is already on.

Fixes bug 6320003.

Change-Id: If26dc5b0800300d8e38c166824651223eded4cfa
2012-04-11 09:25:53 -07:00
Daniel Sandler
3bf928d51e Merge "Fix PowerMgr NPE on emulator." 2012-04-11 07:03:00 -07:00
satok
8d33d39d68 Merge "Show physical keyboard control button on the input method switch dialog" 2012-04-11 00:12:59 -07:00
satok
01038492ff Show physical keyboard control button on the input method switch dialog
Bug: 5240095
Change-Id: Ica768083f95c33dc1e494a28ba7d8b6eb989b0ef
2012-04-11 15:49:35 +09: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
Dianne Hackborn
2a854c13f8 Merge "Some small tweaks to improve memory management." 2012-04-10 15:25:43 -07:00
Dianne Hackborn
162bc0ea0d Some small tweaks to improve memory management.
We now allow processes that currently have stopping activities to
be managed as if they were done stopping, so that memory trimming
can be done before the process goes to the background.  Hopefully
this will reduce cases where the processes goes to the background
and immediately gets killed, but wouldn't have had to be killed if
it had a chance to trim its memory.

Also change window memory trimming to always do the aggressive
trimming when memory is critical, even if not on a low-end device.

And tweak web view trimming to not trim for foreground UI events.

Change-Id: I241b3152b52d09757bd14a202477cf69c9b78786
2012-04-10 14:43:58 -07:00
Craig Mautner
f0cabba38b Merge "Fix NPE in setTransparentRegion." 2012-04-10 14:33:07 -07:00
Jeff Brown
cd2a3ea5c8 Merge "Don't reuse StringBuilder outside of lock when dumping ANR." 2012-04-10 14:30:20 -07:00
Jeff Brown
deb6ed8c2e Don't reuse StringBuilder outside of lock when dumping ANR.
The ANR dumping code was reusing the shared StringBuilder while
not holding the ActivityManagerService lock.  As a result, other
threads could sweep in and clobber the ANR information.
We don't want to hold the lock here, so just create a new StringBuilder.

Change-Id: I0d91af55f5c123102cfab2cd97035491efed59c0
2012-04-10 14:26:26 -07:00
Craig Mautner
1f4e0ccba0 Fix NPE in setTransparentRegion.
Check for null Surface before using it.

Fixes bug 6312835.

Change-Id: Iaaac2a5d88e81b88e369815e09818c268085e4b7
2012-04-10 14:24:38 -07:00
Craig Mautner
8330e40b98 Merge "Reduce load on CPU when animating rotation." 2012-04-10 13:01:12 -07:00
Craig Mautner
73850cb699 Reduce load on CPU when animating rotation.
This change keeps requestTraversalLocked from being called on virtually
every call to animate while rotating.

Change-Id: I6d2db37db3bb82f4f9ecc84b17dbf121819a6c1b
2012-04-10 12:56:27 -07:00
Daniel Sandler
0af489568d Fix PowerMgr NPE on emulator.
Bug: 6313695
Change-Id: Ib12b9102df01603df135cef03fd2a2f6e3634dd1
2012-04-10 15:15:32 -04:00
Daniel Sandler
c38cf4c7db Merge "New Android Dreams architecture, disabled for now." 2012-04-10 05:33:07 -07:00
Justin Mattson
4233f26249 Check if WallpaperService is enabled
If WallpaperService is disabled, don't delay starting SurfaceFlinger
until it is.

Change-Id: I95db6b7bc791329e2bae33472cfeb125e5f6f324
2012-04-09 18:36:15 -07:00
Daniel Sandler
7d276c377c New Android Dreams architecture, disabled for now.
Rather than normal Activities (which have a host of problems
when used for this purpose), screen savers are now a
special kind of Service that can add views to its own
special window (TYPE_DREAM, in the SCREENSAVER layer).

Dreams are now launched by the power manager; whenever it is
about to turn the screen off, it asks the window manager if
it wants to run a screen saver instead. (http://b/5677408)

Also, the new config_enableDreams bool allows the entire
feature to be switched on or off in one place. It is
currently switched off (and the APIs are all @hidden).

Change-Id: Idfe9d430568471d15f4b463cb70586a899a331f7
2012-04-09 15:33:26 -04:00
Jeff Sharkey
eaeee6a55c Merge "Migrate to @Override to remove warnings." 2012-04-09 11:26:34 -07:00
Jeff Brown
fd6ebee93c Merge "Fix lid switch interpretation." 2012-04-09 11:25:02 -07:00
Jeff Brown
27fd3420ac Fix lid switch interpretation.
Also remove unnecessary permission check for method that is
only called internally.

Change-Id: I32f63fc3e96b06709d18b046ee2d3c8f310de70d
2012-04-09 11:22:12 -07:00
Jeff Sharkey
bfdd680ab4 Migrate to @Override to remove warnings.
Bug: 6303344
Change-Id: I0d33b2ed448467379d576ccd71fb5ae20c878852
2012-04-09 10:57:21 -07:00
Jeff Sharkey
4b3c523210 Merge "Splice operations before collapsing ifaces." 2012-04-09 10:31:20 -07:00
Jeff Sharkey
21a547823d Splice operations before collapsing ifaces.
Bug: 6241038
Change-Id: Ide9058703f7305df8fb070af149ddce0653a0abf
2012-04-09 10:27:55 -07:00
Eric Laurent
079f09c6ca Merge "Added support for USB audio devices" 2012-04-09 08:39:05 -07:00
Eric Laurent
59f482764e Added support for USB audio devices
Two types of USB audio devices are defined:
- USB audio device: the audio device in USB device mode while
the Android device is in USB host mode.
- USB audio accessory: the audio device in USB host mode while
the Android device is in USB device mode.

Renamed intents for analog and digital docks to avoid confusion:
 - ACTION_USB_ANLG_HEADSET_PLUG to ACTION_ANALOG_AUDIO_DOCK_PLUG
 - ACTION_USB_DGTL_HEADSET_PLUG to ACTION_DIGITAL_AUDIO_DOCK_PLUG

Factorized code in AudioService broadcast receiver.

Change-Id: I1b6d0257a9d68ecb9495c78c98bac8c67fec7891
2012-04-06 18:24:48 -07:00
Craig Mautner
cd837070f6 Merge "Fix endless looping in layout." 2012-04-06 18:14:15 -07:00
Craig Mautner
3de422fe4f Fix endless looping in layout.
An odd alignment of the stars can end up with all of mAppToken.allDrawn
animating and mAppToken.startingDisplayed all false, and animation not
null. In such a case we can continue returning false but still pass
the test in WindowAnimator.updateWindowsAndRotation setting
wasAnimating to true. The combination continually sets the
FINISH_LAYOUT_REDO_WALLPAPER bit in mPendingLayoutChanges.

Fixes bug 6304838.

Change-Id: Ie7a7b39ea218213f51dc3df3eefe4ff03f1d885d
2012-04-06 18:04:13 -07:00
Dianne Hackborn
b7943811a2 Merge "Fix issue #6242583: ResolverActivity is considered as home activity" 2012-04-06 17:53:59 -07:00
Dianne Hackborn
2d69d49d30 Fix issue #6242583: ResolverActivity is considered as home activity
Change-Id: Ib29908cdfcbbff769d12df1770264ad13ec5337b
2012-04-06 16:24:14 -07:00
Christopher Tate
bf64e70f9b Merge "Attribute alarm broadcast wakelocks to the sender" 2012-04-06 14:35:16 -07:00