In additional to adding the StringMode API for controling CloseGuard,
this checkin fixes several CloseGuard issues found booting a device.
Bug: 3041575
Change-Id: I4dffd184f49438d6d477ed81a1c2a2a5b56cc76b
Extract all UI behavior from dock observer and ACTION_DOCK_EVENT.
Also introduce a desk type to go along with the car type all through
the resource system, since we now need to have corresponding high-level
broadcasts for desk dock mode. As part of that I also reworked some
of the logic for switching modes to all funnel through a single
update() call that looks all of the current state to decide what to
do next, and fixed various locking issues.
In addition I found there were bugs in the configuration change
handling causing us to only switch into the car mode config and
then never get out of it. Unfortunately now that we are actually
changing the configuration for each mode change, the transitions
between them are really crummy as we restart all kinds of
activities. :(
The current implementation does not take care of location changes in the case
the network location is not enabled. The fix will use the passive location provider
to receive any location updates (gps and network) and using the network location
provider to trigger the passive provider.
Change-Id: I851bb1ff90e9103712a0e741528a6dfa5d4353c8
When the device is booted in a car dock the car mode needs to be set
as well, so that the status bar notification shows up and the system
is initialized the same way as if the phone is placed into a car dock
when it's booted already.
Changing the status bar behavior requires special permission.
Since disableCarMode is called out of a context that might not have this
permission, the calling identity is cleared before changing the status
bar behavior.
The automatic switching between night/notnight is based on the calulcation of
the civil twilight of the current location. The location is mainly retrieved
from the NetworkLocationProvider.
Automatic switching will only be available, when
1) the device is in UI_MODE_TYPE_CAR
2) the setting for the UI mode are set to 'automatic'
If mode is set to automatic, the next twilight is caluclated and
an alarm is set that timestamp. The alarm will trigger a new calculation
of the twilight and sets the UI_MODE_NIGHT to the appropriate value.
modified: services/java/com/android/server/DockObserver.java
new file: services/java/com/android/server/TwilightCalculator.java
- Low battery. (http://b/2320026)
- Dock/undock events.
- Keyguard lock/unlock events.
New system settings have been created to turn these on/off
and to specify the relevant sound files.
[Production notes: The provided low battery sound and dock
sounds were synthesized; the lock screen sounds are
processed samples of a ballpoint pen click mechanism.]
Bug: 2320026
Change-Id: I374285b0f94f59c7555bb8816580f5a8c802e90d
The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.
The ui mode can be set, like it is done for the locale, as follows:
IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);
To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.
The automatic night mode switching will be added in a separate change.
Use this in various places where it should serve no purpose to deliver
both broadcasts. This is intended to reduce somewhat the flurry of
broadcasts that we churn through during boot.
The fact that the phone is losing power will do this anyway,
and this fixes (or works around) bug b/2250075
(Desk dock clock app sometimes doesn't exit when removing a sleeping droid from the dock)
Change-Id: I7b8b6cfb44ca16d2d9eb67589cb9d9a108a8de82
Signed-off-by: Mike Lockwood <lockwood@android.com>
We now just don't send out dock broadcasts/launches when the
device is not provisioned. Good enough for our purposes.
Change-Id: Iee6384121675e0e9854745ec1168245e8a23a241
- New meta-data you can add to a dock activity to have it launched by the
home key when the device is in that dock.
- Fix a deadlock involving ActivityThread's internal content provider lock.
- New window flag to have a non-secure keyguard entirely dismissed when a
window is displayed.
- New WindowManagerPolicy APIs to allow the policy to tell the system when
a change it makes during layout may cause the wall paper or
overall configuration to change.
- Fix a bug where an application token removed while one of its windows is
animating could cause the animating window to get stuck on screen.
Change-Id: I6d33fd39edd796bb9bdfd9dd7e077b84ca62ea08
Categories CATEGORY_CAR_DOCK and CATEGORY_DESK_DOCK can be assigned to
activities to make them launchable on docked events.
This is a better mechanism than listening for ACTION_DOCK_EVENT with a broadcast receiver.
Change-Id: Ic5f3ab3555ce02ca922bc31ebba41978cefe8bda
Signed-off-by: Mike Lockwood <lockwood@android.com>
Docking station intents for dock switch driver.
Add DockObserver and updated Intent.java and systemserver.jave
Signed-off-by: Dan Murphy <D.Murphy@motorola.com>
modified: core/java/android/content/Intent.java
new file: services/java/com/android/server/DockObserver.java
modified: services/java/com/android/server/SystemServer.java
Docking station updates
Add constants for the dock
Signed-off-by: Dan Murphy <D.Murphy@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>