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
Reverting to the previous stub as the display adapter registration
and the logical to physical mapping is not at all what we are going
to need moving forward.
Fixed up the service initialization order so that the display manager
service has a context from the start.
Change-Id: I717f2f1099c7a77180ef207c371ec8329258850a
Earlier assumption that systemui was running in the system process
does not hold true, so running static wallpaper in its own user
sandbox.
Bug: 7008230
Change-Id: I32a128e6bbd8efa7006286330e970bafcf37f05a
Need to clear the callers identity before calling into geofence manager
because it in turn calls fused location API's.
Change-Id: I7993b0b8b2a947ff93c37a7c9d29ca0e7c95f9a8
I had to re-do this change for MR1 because LocationManagerService changed
so much. Here is the original change description:
Add package-name-prefix blacklist for location updates.
The Settings.Secure value locationPackagePrefixBlacklist and
locationPackagePrefixWhitelist contains comma seperated package-name
prefixes.
Location & geo-fence updates are silently dropped if the receiving
package name has a prefix on the blacklist. Status updates are
not affected. All other API's work as before.
A content observer is used so run-time updates to the blacklist
apply immediately. There is both a blacklist and a whitelist.
The blacklist applies first, and then exemptions are allowed
from the whitelist. In other words, if your package name prefix
matches both the black AND white list, then it is allowed.
Bug: 6986553
Change-Id: I1e151e08bd7143e47db005bc3fe9795076398df7
So each user can have their own set of intent resolution preferences.
ResolverActivity now launches the activity on the correct user, and
persists the preference for the correct user.
Bug: 6961905
Change-Id: I6d3a8a9af89bc649277d4fc8d0f367ee123f8392
The client UID list wasn't being saved, so we never removed
client UID's. As a result apps get blamed for GPS even when
they are no longer using it.
Bug: 7007314
Change-Id: Idff3b7c8c0ee87b99c9bdd7bd20d8391d0b1ac0f
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
Also added an internal flag to control whether the electron beam
on animation is used. It's on for now but we might want to
turn if off if we can't get the HAL to provide the
necessary screen on synchronization on all devices.
Change-Id: Iaa3cfa0fd61de10174e68351e4db890eff2d2918
PackageManagerService just needed to know the owner for this file, so
just use stat instead so we can remove the old JNI code.
This is the last user of FileUtils#getPermissions so just remove the
FileUtils method as well.
Change-Id: I953057cd6b9de4410f33b6f22e4bddff02fe2988
Fix a couple of bugs, and modify the behavior of the random offset.
The random offset now slowly changes over time, to mitigate against
applications averaging out the offset over time while at a
grid boundary.
Change-Id: Iecffff29145b8c2b30d1eca1662cf9d3e8cff756
Fixes b/6996990
Ideally, the HWC HAL should turn off the backlight when the display is turned
off. This patch enforces this at the PowerManager, which can guard against
errant HWC implementations.
Change-Id: Ibb826a02871c983f8a68034d010e68abe9c5c1d5
Signed-off-by: Iliyan Malchev <malchev@google.com>
Strictly speaking, this is a change in behavior for all products.
Instead of using discrete zones, they will all now use spline
interpolation. We could make this behavior configurable
but there seems to be little point to it. The range of brightness
values used will be more or less the same as before, it's just
that what used to be the brightness value for all levels within
a particular zone now becomes the brightness value for the
highest level in that zone and lower values are used for lower
levels within the zone.
Change-Id: I39804ee630ba55f018e1e53c0576b28e7bd27931
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
The window manager was telling the activity manager to evaluate
the new configuration when first initializing the display, before
actually setting mDisplay, so it failed creating that first config.
Change-Id: I6e94fcf55b0587ccf15a5fd7ecbe2c9a0c201b96
The new WiFi watchdog requires kernel/driver to export some packet loss
counters. This CTS tests whether those counters are correctly exported.
Change-Id: I41999676f8488e86f35f1f8214ce668f1a2b5638
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
Normally the ValueAnimator scale factor is applied the first
time a ViewRootImpl window session is created but that may
be too late for animators created by system services that
start early in the boot process. So set the scale factor
immediately whenever the setting changes.
Also make ValueAnimator.getDurationScale() accessible (but @hide)
for custom animators that want to apply the same scale to
their animations.
Change-Id: I0f5a750ab5b014f63848445435d8dca86f2a7ada
For now only the device owner "user" gets cloud backups. Also, only the
device owner account has access to local backup/restore.
Bug 6956438
Change-Id: I87d7ba5969e606c23f4214469f9bf2fd47a6c61b