309 Commits

Author SHA1 Message Date
Christopher Tate
78d2a66ac1 Fix Settings writes to a different user
Oops.  Stacked bugs:  first, the desired user handle was not properly
being passed from the call() entry point to the database operations;
then on top of that, the client-side cache management was still
looking in the local user's cache for the data, so a request to read
a different user's settings would return the local user's instead if
that key was already known to the local user's cache.

Reads and writes of a different user's settings are now uncached,
so they're relatively much slower.  They're rare, however, so this
is not something to worry about unless we encounter a real world
case where it's a significant factor.

This CL also adds a bit of cross-user settings read/write testing
to the existing provider suite.  These new tests caught both the
known wrong-user-write bug and discovered the client-side cache
bug, so yay.

Finally, the existing wholesale mutual-exclusion approach would
deadlock in certain circumstances due to the fact that the
settings database creation code might have to call out to the
Package Manager while populating the bookmark/shortcut table,
and the Package Manager would then call back into the settings
provider in the course of handling that request.  The synchronization
regime has been significantly tightened up now: now the database
code [which is known to deal with concurrency itself] is allowed
to cope with multiple parallel openers of the same db; this
allows the settings provider to avoid calling out to other parts
of the system even implicitly while its internal lock is held.

Change-Id: Ib77d445b4a2ec658cc5c210830f6977c981f87ed
2012-09-13 19:15:54 -07:00
Svetoslav Ganov
27d9183223 Merge "Core accessibility settings should not be cleared on restore." into jb-mr1-dev 2012-09-12 21:40:55 -07:00
Svetoslav Ganov
818d204590 Core accessibility settings should not be cleared on restore.
1. The core accessibility settings required for a blind user to use
   the device should not be overwritten on restore. There could have
   been enabled via a global gesture from setup wizard, hence the
   user definitely needs them. Restoring disabled values for these
   settings render the device useless unless sighted help is sought.

bug:7138401

Change-Id: Idc593889aa61fada65b0407623720517c827df53
2012-09-12 21:40:21 -07:00
Christopher Tate
c868b645b4 Moved a few telephony settings from Secure to Global
Also tidy up the bookkeeping for a few settings that were earlier
moved to Global without the redirect tables being fixed up.

Change-Id: I69275db3b2636cd6ba9c8c51b88e97d8ba4b7b7d
2012-09-12 17:42:43 -07:00
Christopher Tate
4dc7a68dbe Set up default (random) Android IDs for all users
Also correct some now-misleading terminology in a permission-check
log message, and fix a bug in which a system component trying to
write to a secondary user's settings would wind up writing the
owner's settings instead.

Bug 7132405

Change-Id: I5b8fafc35720390a01652e386ab5b7c0ad751abe
2012-09-11 14:51:33 -07:00
Christopher Tate
d5fe147924 Miscellaneous fixes for Settings
(1) It's okay to write literal null as a settings element value
(2) Properly convey the user handle in the put-for-user variant

Bug 7137201
Bug 7139826

Change-Id: I0ed77d65e8377f0e0580a2668f10b7167ad34928
2012-09-10 17:32:39 -07:00
Christopher Tate
0a26696560 Merge "Log all individual settings restored" into jb-mr1-dev 2012-09-07 18:10:02 -07:00
Christopher Tate
d71778804c Log all individual settings restored
Trying to get a handle on bug 7129406

Change-Id: If436c7888f0a8565d83c03024c54ea6ec83e7955
2012-09-07 18:09:03 -07:00
rich cannings
4d8fc793f0 Move verification settings to Settings.Global
Move Settings.Secure.PACKAGE_VERIFIER_ENABLE,
Settings.Secure.PACKAGE_VERIFIER_TIMEOUT,
Settings.Secure.PACKAGE_VERIFIER_DEFAULT_RESPONSE to
Settings.Global.PACKAGE_VERIFIER_ENABLE,
Settings.Global.PACKAGE_VERIFIER_TIMEOUT,
Settings.Global.PACKAGE_VERIFIER_DEFAULT_RESPONSE, respectively.

Bug: 7082362
Change-Id: I21fde031a330563891c0129132f3d6369ac5e7a5
2012-09-07 15:34:08 -07:00
Christopher Tate
9219874be9 Further fixup of migration to global settings
The Settings.System.STAY_ON_WHILE_PLUGGED element should have been
migrated to the global table, but wasn't.  This CL does a couple of
things around dealing with this:

(1) Tidies up the migration tables outright, so that they correctly
    reflect the intended final state

(2) Introduces the option of doing a key migration only if the element
    has not yet been moved to the new table, to allow for safe retry-
    -with-ignore.  This will make it easy to make any future alterations
    to the global vs per-user association of individual elements

(3) Migrates the STAY_ON_WHILE_PLUGGED element if it hasn't been already.

Bug 7126575

Change-Id: Ic5fa9ba45f11b09270bd5bc94c26fbbd84abc749
2012-09-07 12:00:13 -07:00
Christopher Tate
1a9c0dfdbb Mark all settings upgrade transactions as successful along the way
If you don't, then the upgrade gets rolled back by the open helper,
and Bad Stuff Happens.

Change-Id: I191263e5cceb21b96ef413d28e7ee00a924acfc2
2012-09-06 22:52:23 -07:00
Christopher Tate
a96798e4a5 Don't use toArray() inappropriately
HashSet<String>.toArray() does not give you an array of strings.

Change-Id: I2053e714b12eab718aaf75d92bbc0625745b9932
2012-09-06 19:17:45 -07:00
Svetoslav Ganov
1cf70bbf96 Screen magnification - feature - framework.
This change is the initial check in of the screen magnification
feature. This feature enables magnification of the screen via
global gestures (assuming it has been enabled from settings)
to allow a low vision user to efficiently use an Android device.

Interaction model:

1. Triple tap toggles permanent screen magnification which is magnifying
   the area around the location of the triple tap. One can think of the
   location of the triple tap as the center of the magnified viewport.
   For example, a triple tap when not magnified would magnify the screen
   and leave it in a magnified state. A triple tapping when magnified would
   clear magnification and leave the screen in a not magnified state.

2. Triple tap and hold would magnify the screen if not magnified and enable
   viewport dragging mode until the finger goes up. One can think of this
   mode as a way to move the magnified viewport since the area around the
   moving finger will be magnified to fit the screen. For example, if the
   screen was not magnified and the user triple taps and holds the screen
   would magnify and the viewport will follow the user's finger. When the
   finger goes up the screen will clear zoom out. If the same user interaction
   is performed when the screen is magnified, the viewport movement will
   be the same but when the finger goes up the screen will stay magnified.
   In other words, the initial magnified state is sticky.

3. Pinching with any number of additional fingers when viewport dragging
   is enabled, i.e. the user triple tapped and holds, would adjust the
   magnification scale which will become the current default magnification
   scale. The next time the user magnifies the same magnification scale
   would be used.

4. When in a permanent magnified state the user can use two or more fingers
   to pan the viewport. Note that in this mode the content is panned as
   opposed to the viewport dragging mode in which the viewport is moved.

5. When in a permanent magnified state the user can use three or more
   fingers to change the magnification scale which will become the current
   default magnification scale. The next time the user magnifies the same
   magnification scale would be used.

6. The magnification scale will be persisted in settings and in the cloud.

Note: Since two fingers are used to pan the content in a permanently magnified
   state no other two finger gestures in touch exploration or applications
   will work unless the uses zooms out to normal state where all gestures
   works as expected. This is an intentional tradeoff to allow efficient
   panning since in a permanently magnified state this would be the dominant
   action to be performed.

Design:

1. The window manager exposes APIs for setting accessibility transformation
   which is a scale and offsets for X and Y axis. The window manager queries
   the window policy for which windows will not be magnified. For example,
   the IME windows and the navigation bar are not magnified including windows
   that are attached to them.

2. The accessibility features such a screen magnification and touch
   exploration are now impemented as a sequence of transformations on the
   event stream. The accessibility manager service may request each
   of these features or both. The behavior of the features is not changed
   based on the fact that another one is enabled.

3. The screen magnifier keeps a viewport of the content that is magnified
   which is surrounded by a glow in a magnified state. Interactions outside
   of the viewport are delegated directly to the application without
   interpretation. For example, a triple tap on the letter 'a' of the IME
   would type three letters instead of toggling magnified state. The viewport
   is updated on screen rotation and on window transitions. For example,
   when the IME pops up the viewport shrinks.

4. The glow around the viewport is implemented as a special type of window
   that does not take input focus, cannot be touched, is laid out in the
   screen coordiates with width and height matching these of the screen.
   When the magnified region changes the root view of the window draws the
   hightlight but the size of the window does not change - unless a rotation
   happens. All changes in the viewport size or showing or hiding it are
   animated.

5. The viewport is encapsulated in a class that knows how to show,
   hide, and resize the viewport - potentially animating that.
   This class uses the new animation framework for animations.

6. The magnification is handled by a magnification controller that
   keeps track of the current trnasformation to be applied to the screen
   content and the desired such. If these two are not the same it is
   responsibility of the magnification controller to reconcile them by
   potentially animating the transition from one to the other.

7. A dipslay content observer wathces for winodw transitions, screen
   rotations, and when a rectange on the screen has been reqeusted. This
   class is responsible for handling interesting state changes such
   as changing the viewport bounds on IME pop up or screen rotation,
   panning the content to make a requested rectangle visible on the
   screen, etc.

8. To implement viewport updates the window manger was updated with APIs
   to watch for window transitions and when a rectangle has been requested
   on the screen. These APIs are protected by a signature level permission.
   Also a parcelable and poolable window info class has been added with
   APIs for getting the window info given the window token. This enables
   getting some useful information about a window. There APIs are also
   signature protected.

bug:6795382

Change-Id: Iec93da8bf6376beebbd4f5167ab7723dc7d9bd00
2012-09-06 18:56:17 -07:00
Christopher Tate
06efb530a4 Per-user settings
Each user has its own Settings.System.* and Settings.Secure.* namespace now.  In
addition, this CL introduces the new Settings.Global.* namespace, which contains
a number of previously-elsewhere named settings entities; these Global.* entities
are common to all users.  Because these elements have been moved from their prior
existence in the other namespaces, attempts to access them under their old names
and namespaces are detected and redirected (with appropriate compile-time and
logging messages) to their new homes.

The new Global.* namespace can only be written by system-level code, just like
the existing Secure.* namespace.  If an app attempts to write a key that was
previously in the System.* namespace but has been moved to the Global.* namespace,
then a warning is logged and no write is performed; the action is a no-op.  (The
app is explicitly not crashed, to avoid breaking well-behaved apps that can't
know any better.)

There is also now a hidden API for getting/setting settings entities associated
with a user other than the caller's.  Reading/writing data for a user other than
yourself requires the signature-level INTERACT_ACROSS_USERS_FULL permission.

Manipulating data for a different user cannot be done via the ContentProvider
query() / insert() APIs; you must use the Settings.get/put APIs for that degree
of control.  In general, use of the get/set API is *strongly* preferred over
query-type access to Settings.

Bug 6985398

Change-Id: Ibee54ddff99fb847c8c2479c23b50f1e7524d724
2012-09-06 16:39:08 -07:00
rich cannings
16e119e798 Add secure setting for package verification
Framework changes to store and read a secure setting for package verification.
Default is on/true.

This setting will be turned on/off via the Settings app.

Bug: 7082362
Change-Id: I6f93d3136add8af0dbbdc664f0473c5f5b7e3fee
2012-09-06 14:37:44 -07:00
Dmitry Shmidt
8de24dca68 Restore original default Wifi sleep policy (always)
BUG: b/7092819

Change-Id: I6ee6755fd04df2f0169f8602e60542c3591038f3
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2012-09-05 12:35:09 -07:00
John Spurlock
4e724c8423 Change default setting for dreams to 'when docked'
Bug:7078718
Change-Id: I4ec74cc9562ab728d6f86938758ede74c241c63b
2012-08-29 17:14:49 -04:00
Jean-Baptiste Queru
c88a80a1d7 am 15e099cc: am 0e0942c7: Merge "Default WiFi sleep policy setting"
* commit '15e099cc09589f963933f046d7267552ba3ffad8':
  Default WiFi sleep policy setting
2012-08-29 10:58:35 -07:00
Jean-Baptiste Queru
15e099cc09 am 0e0942c7: Merge "Default WiFi sleep policy setting"
* commit '0e0942c7209c758bc00939ae54059dc24bce3abb':
  Default WiFi sleep policy setting
2012-08-29 10:49:25 -07:00
Erik Ljungberg
7e07147ece Default WiFi sleep policy setting
Creates a defult.xml setting for WiFi sleep policy.

It is now possible, through device overlays, to change
the default sleep policy to e.g. never in order to improve
user experience of WiFi.

Change-Id: Ie459b8e70fdbc7c605452fe0692d7bc26460e939
2012-08-29 09:52:12 +02:00
John Spurlock
1a868b7981 Add framework support for multiple dreams.
Bug:7028665
Change-Id: I4fba6b8e39dc07af4490c621ac3bc7b3867371b2
2012-08-22 16:49:20 -04:00
Svetoslav Ganov
ca34bcf674 resolved conflicts for merge of 80c904df to jb-mr1-dev
Change-Id: Ic2f8d64cd716d04a533ca0685d1fb0d5e2a21933
2012-08-16 12:22:23 -07:00
Svetoslav Ganov
80c904df15 am 8631701b: Allow enabled accessibility service to toggle tocuh exploration after an upgrade to JellyBean.
* commit '8631701bb770f3a4e3b2a139dc282f2244fe86e6':
  Allow enabled accessibility service to toggle tocuh exploration after an upgrade to JellyBean.
2012-08-16 10:36:55 -07:00
Svetoslav Ganov
8631701bb7 Allow enabled accessibility service to toggle tocuh exploration after an upgrade to JellyBean.
1. Before JellyBean touch exploration was a global setting controlled by the user via
   the UI. However, if the enabled accessibility services do not handle touch exploration
   mode, enabling it makes no sense. Therefore, in JellyBean the services request touch
   exploration mode and the user is presented with a dialog to allow that and if she
   does we store that in the database.

   As a result of the above change a user that has enabled  accessibility, touch
   exploration, and some accessibility services running a pre-JellyBean system
   version may lose touch exploration state, thus rendering the device useless unless
   sighted help is provided, since the enabled service(s) are not in the list of
   services to which the user granted a permission to put the device in touch explore
   mode.

   The fix is during a database upgrade to allow allow all enabled accessibility
   services to toggle touch exploration provided accessibility and touch exploration
   are enabled and no services can toggle touch exploration. Note that the user has
   already manually enabled the services and touch exploration which means the she
   has given consent to have these services work in touch exploration mode

bug:6996354

Change-Id: I0af2dc578cc4fbcc90043341035163b876978ab2
2012-08-15 22:13:03 -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
Baligh Uddin
3e300c4693 Import translations. DO NOT MERGE
Change-Id: I95bed23285699c68b623ae0e36600ec5e813db8c
Auto-generated-cl: translation import
2012-08-13 13:20:03 -07:00
Baligh Uddin
63fe5cdc74 Import translations. DO NOT MERGE
Change-Id: I8948cd5b0992133db9dc8e676b5d43b54d672e85
Auto-generated-cl: translation import
2012-08-10 11:14:46 -07:00
Baligh Uddin
03cfc54231 Import translations. DO NOT MERGE
Change-Id: I813d5cfc5f5b60e98f635dc62e9935299c903171
Auto-generated-cl: translation import
2012-08-09 12:32:26 -07:00
John Spurlock
634471edc4 Load default Dream settings into a clean db.
Set the Dream defaults during onCreate, not only onUpgrade.

Bug: 6959513
Change-Id: Ia93097edaf1150813c75b6be809db9c97987868f
2012-08-09 10:41:37 -04:00
Daniel Sandler
5927d957ea Merge "Migrate Dreams default settings to DatabaseHelper." into jb-mr1-dev 2012-08-08 08:47:40 -07:00
Daniel Sandler
fdb7c36a10 Migrate Dreams default settings to DatabaseHelper.
Also switch Dreams on for all charging devices by default.

Change-Id: Iccbcc2906d55214320b2f467e88ba9cb188f4886
2012-08-08 08:38:48 -04:00
Nick Kralevich
45576ccd76 Explicitly export content providers
In a future version of Android, the default value for
<provider android:exported> will change from true to false.
Explicitly set android:exported="true"

Bug: 3306452

Change-Id: Iffe4dca4fefc92bb9f89698f149a87c16a7ce3c5
2012-08-06 17:42:12 -07:00
Wink Saville
33034b13ca Create telephony-common and mms-common - DO NOT MERGE
These have been created to reduce the size and complexity
of frameworks/base.

mms-common was created by moving all of
  frameworks/base/core/java/com/google/android/mms
to:
   frameworks/opt/mms

telephony-common was created by moving some of
   frameworks/base/telephony
to:
   frameworks/opt/telephony

Change-Id: If6cb3c6ff952767fc10210f923dc0e4b343cd4ad
2012-07-17 12:23:09 -07:00
Wink Saville
5362f17ff5 Merge commit '1b003ef0' into mit
* commit '1b003ef0':
  Create telephony-common and mms-common

Change-Id: Ie8876541dbe7f4c933cf7d69910dd204538bc975
2012-07-11 18:15:50 -07:00
Wink Saville
a639b311e9 Create telephony-common and mms-common
These have been created to reduce the size and complexity
of frameworks/base.

mms-common was created by moving all of
  frameworks/base/core/java/com/google/android/mms
to:
   frameworks/opt/mms

telephony-common was created by moving some of
   frameworks/base/telephony
to:
   frameworks/opt/telephony

Change-Id: If6cb3c6ff952767fc10210f923dc0e4b343cd4ad
2012-07-11 16:02:08 -07:00
Svetoslav Ganov
11844b14d0 am 4844fccc: am 5d88c14c: Merge "Ensure screen reader URL gets updated during ICS to JB update." into jb-dev
* commit '4844fccc793078f44c8bffd1707ac589fad14f6e':
  Ensure screen reader URL gets updated during ICS to JB update.
2012-06-25 18:17:07 -07:00
Svetoslav Ganov
4844fccc79 am 5d88c14c: Merge "Ensure screen reader URL gets updated during ICS to JB update." into jb-dev
* commit '5d88c14cd39d1100e28f7e340874655ab7a42904':
  Ensure screen reader URL gets updated during ICS to JB update.
2012-06-25 17:11:12 -07:00
Svetoslav Ganov
5d88c14cd3 Merge "Ensure screen reader URL gets updated during ICS to JB update." into jb-dev 2012-06-25 17:09:24 -07:00
alanv
3a67eb3be4 Ensure screen reader URL gets updated during ICS to JB update.
Bug: 6702042
Change-Id: I771863c53fa420ba0746fce30cd17eb8b2b9fba1
2012-06-22 10:47:28 -07:00
Svetoslav Ganov
1ca3609a70 am e523faa8: am 5070a7f0: Merge "Change hard-coded URL for accessibility script." into jb-dev
* commit 'e523faa84f656785adbbd67414f9a141ec49d800':
  Change hard-coded URL for accessibility script.
2012-06-20 22:34:31 -07:00
Svetoslav Ganov
e523faa84f am 5070a7f0: Merge "Change hard-coded URL for accessibility script." into jb-dev
* commit '5070a7f0f4bf817e884b9e6ea8ee23c99209c50e':
  Change hard-coded URL for accessibility script.
2012-06-20 22:31:05 -07:00
alanv
3ff50a0a8a Change hard-coded URL for accessibility script.
The old version of the script is broken and is cached due to an error in
our gstatic configuration. We had to change the name to avoid hitting the
cached version on external proxies.

Bug: 6702042
Change-Id: I0e5ee8b3a6ae8c7ba11f5760f2f99d4b5614ac97
2012-06-20 16:51:00 -07:00
Amith Yamasani
82f47c95b6 Merge "Disable lockscreen using a system property." 2012-06-12 12:57:18 -07:00
Amith Yamasani
d1645f8d0f Disable lockscreen using a system property.
For factory testing.

Change-Id: Ie5b8be432ab8ad40d8752f978899987c95a5aef9
2012-06-12 11:53:26 -07:00
Jean-Baptiste Queru
01cb25fdde resolved conflicts for merge of 29bea61c to jb-dev-plus-aosp
Change-Id: If582e1fa99691b4e4182c3a9b148fcef5cad251e
2012-06-12 08:13:10 -07:00
Athimoolam Ealumalai
44030b7864 Added support for customization of mobile data setting.
Introduced system property "mobiledata", which will be
used for default behavior of the mobile data connection
either on/off.

This is analog to how the setting for "dataroaming" is
handeled.

Change-Id: Ifae8822dedfa55a515671014e2e29d43c469e701
2012-06-11 15:20:34 +02:00
Christopher Tate
8dfe2b9dd7 Merge restored wifi APs, don't overwrite
We now preserve any already-known AP configuration information when
restoring wifi from backup, instead of flatly overwriting the known
definitions with the historical ones.  This means that if you are
performing setup while connected to an AP unknown in the restored
dataset, you will retain your connection instead of seeing it drop
partway through the restore process because suddenly the supplicant
"forgot" how to connect to it.

Duplicates are resolved by retaining the currently-defined network
configuration and discarding the historical one.

Bug 6443790

Change-Id: I1f44cc6a01fc4ae7c4b680682a10fcb7a0be65dc
2012-05-15 17:18:22 -07:00
Daisuke Miyakawa
3c60eeb133 Have a new constant for "vibrate when ringing" setting
Bug: 6036529
Change-Id: I850d27629a75615647883fdaa2933f337c4824d1
2012-05-08 18:37:41 -07:00
Eric Laurent
bffc3d1bd3 Silent and Vibrate mode clean up
Clean up related to new Vibration policy.
The vibrate behavior is now only derived from:
 - presence of a vibrator on the device
 - current ringer mode selected: NORMAL, VIBRATE or SILENT
If no vibrator is present the ringer mode can only be NORMAL or SILENT.

The control of ringer mode via volume keys when volume keys control the "master"
stream type (RING on phones, MUSIC on tablets) is as follows:
If a vibrator is present:
 VOL- and volume equals 1: NORMAL => VIBRATE
 VOL- and volume equals 0 and not continuous press: VIBRATE => SILENT
 VOL+ and in SILENT mode: SILENT => VIBRATE
 VOL+ and in VIBRATE mode: VIBRATE => NORMAL, volume = 1
If no vibrator is present:
 VOL- and volume equals 0 and not continuous press: NORMAL => SILENT
 VOL+ and in SILENT mode: SILENT => NORMAL, volume = 0

VIBRATE_ON and VIBRATE_IN_SILENT settings are not stored/retreived any more.

AudioService checks and corrects ringer mode and stream volumes if necessary when reading from
DB at boot time.

Also:
 Added dump for stream volumes in AudioService.
 Added device names missing in AudioSystem for USB accessory and USB device.

Issue: 6036529
Issue: 6414950
Issue: 6448163

Change-Id: I77fb821ec63e4e566320cac2701b4ac466e86aef
2012-05-08 15:10:37 -07:00
Irfan Sheriff
4f4f5166c9 Fetch WifiManager instance at the time of use
Bug: 5340393
Change-Id: Idb0a6dbe969bc3c7955134df43b86f28208c73c3
2012-04-27 14:42:42 -07:00