Commit Graph

239 Commits

Author SHA1 Message Date
Julia Reynolds
3a10b10ee5 Update volume slider on device changed.
Bug: 24501085
Change-Id: I5bd0ac014eb291cafcf918e8a73a30e95245d533
2015-10-14 16:13:28 -04:00
John Spurlock
96d4a9ec39 Volume: Disable seekbar prefs when zen muted.
- And display the last audible value.

Bug: 21267436
Change-Id: I667d0680811b48a51eab22c837933e493f1d5c44
2015-06-10 19:04:40 -04:00
Alan Viverette
5c3188e75e Update seek bar dialog preference for Material
Bug: 21620889
Change-Id: Ie8e6f570a3be32722f4e49ccf81da263fda736fe
2015-06-08 15:59:32 -07:00
Jean-Michel Trivi
02fc19ecfc Ringtone picker is not affected by current sonification policy
Add the FLAG_BYPASS_INTERRUPTION_POLICY AudioAttributes flag when
  launching the ringtone picker so it is not affected by the
  current sonification policy, in order to ensure the audibility
  of the phone ringtone or default notification being previewed
  by the user.

Bug 19407114

Change-Id: Ibd24e3f14e56e67f9e37576a84c97a73f5494074
2015-05-21 11:52:41 -07:00
Alan Viverette
904de2ec93 Always force constructors accessible during inflation
We now correctly throw an IllegalAccessException for non-public accesses,
but we were relying on the old incorrect behavior during inflation. This
CL forces constructors to be accessible so that we emulate the old
behavior and don't crash.

Where we were already doing this, the CL moves the setAccessible() call
immediately after the getConstructor() call, since there's no point in
calling it multiple times.

Bug: 20810495
Change-Id: I63dfcb857e445f688080eea05e86ef22760ed49f
2015-05-04 10:32:57 -07:00
John Spurlock
721d457685 Volume: Automute in seek bar volumizer.
Never disable the slider, allow mutebusting and syncing mute to 0
value.

Also add new framework icon for media.

Bug: 20096341
Change-Id: I9db1671c3442365866a49c9d6f7becf0b2e05435
2015-04-16 11:01:15 -04:00
Andreas Gampe
822b403b68 am 3fa46a0f: am d7fb6d26: am a01250c7: Merge "Frameworks/base: Change String == to equals in Preference"
* commit '3fa46a0f79f35ca32ce102d4bbb1138c517ee754':
  Frameworks/base: Change String == to equals in Preference
2015-03-28 05:18:14 +00:00
Svet Ganov
3695b8a148 First implementation of the grant/revoke UI
Change-Id: Icdb7c822881552b30850697dba709671bf27baa5
2015-03-24 20:15:43 -07:00
Andreas Gampe
c3e1c21482 Frameworks/base: Change String == to equals in Preference
Bug: 19797138
Change-Id: I496b12c425da45ee098db12e72ad843c22444ba3
2015-03-18 17:18:13 -07:00
Tor Norbye
417ee5ba89 Add resource type annotations to some APIs
Change-Id: I37c8afdaea455aa92bc8270bb2dfd60616c5f9bc
2015-03-13 11:20:45 -07:00
Tor Norbye
c615c6fc9c Annotate methods to be called from overrides with @CallSuper
Change-Id: Ibc587c2aaee9f3e7f448079f72a75459fe4e15e7
2015-03-07 20:49:18 -08:00
John Spurlock
08c7116ab9 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00
Scott Kennedy
3c32b62044 Add some more @Nullable annotations
Change-Id: I586d542e087eafa8355f0eaa606d66876c0f5a56
2015-02-22 20:43:56 -08:00
John Spurlock
0a7269bbaf Merge "AudioAttributes: introduce new flags to bypass audio restrictions." 2015-02-19 18:24:24 +00:00
John Spurlock
bbfd31a5d4 AudioAttributes: introduce new flags to bypass audio restrictions.
- New @hidden @SystemApi FLAG_BYPASS_INTERRUPTION_POLICY, request
   to ignore any current audio restrictions, such as zen mode
   content-based notification filtering.
 - Wire up FLAG_BYPASS_INTERRUPTION_POLICY to the existing
   audio restriction checks in the framework.

 - New @hidden @SystemApi FLAG_BYPASS_MUTE, request to play
   audibly, even if the underlying stream is muted.
 - Wiring up to audio framework TBD.

 - Use both of these new flags on the inline volume slider
   controls used in Settings, ensuring playback is heard
   regardless of the current device filter state.

Bug: 19407114
Change-Id: I3d44394931592ccbc1b61ddd9a4d1cc984da17cc
2015-02-18 20:48:26 -05:00
Tor Norbye
7b9c912f53 Add @ResourceInt annotations on APIs
Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
2015-02-18 07:49:03 -08:00
Deepanshu Gupta
2bd01ebfa9 am 7ed14549: am 7081a114: Merge "Add preferences rendering." into lmp-dev
* commit '7ed145493d3f5bea32c567980f77cc42f613197e':
  Add preferences rendering.
2015-01-06 22:22:36 +00:00
Deepanshu Gupta
10bb1371dc Add preferences rendering.
NO_SQ: Depends on updating layoutlib-api-prebuilt.jar
Change-Id: Iae93ab74c478e6f2158e1528467bec9ee2d7ee9b
2014-12-23 12:04:30 -08:00
John Spurlock
bcc1087af4 Volume: Improve inline volume controls used in settings.
- Make the system internal ringer mode change signal available to
   other system components via a standard intent, instead of a
   volume-controller-only binder call.
 - Update sysui to use new intent for icon policy.
 - Add proper muting state to the volumizer, to look more like
   the associated volume panel slider.
 - Add basic ringer mode state tracking for the notification-ring
   slider setting.

Bug: 17899613
Change-Id: Ie2df52edb070055ef59c74039162a0e785d2fdbb
2014-11-28 15:29:21 -05:00
Alan Viverette
13e13ddd4e Format ListPreference summary with empty string if entry is null
Adding serif-monospace and sans-serif-monospace font families bumped
out the previous monospace, which left the summary as %s. Returning
an unformatted summary is never correct, and we should simply return
a summary populated with an empty string.

BUG: 17666124
Change-Id: Ic22dc5dc87d9ba3ad6f6b92ee059f5c98cbf103a
2014-10-21 17:05:07 -07:00
John Spurlock
735f9ebc18 Settings: Make SeekBarVolumizer more null-resilient.
Now that the instances are reusable, ensure all "post" methods
do a handler check, and ensure they are all internal.

Bug: 18063070
Change-Id: Idc478c636686f666f5656f3d07bf2738ba3e9a5a
2014-10-21 14:23:24 -04:00
John Spurlock
0e588ea8e1 Make SeekBarVolumizer restartable.
Decouple start from constructor, making it possible to restart
once stopped.

Bug:17898190
Change-Id: I2f860864161f818d5a62a28331ef1c47051fb39f
2014-10-13 20:46:36 +00:00
Fabrice Di Meglio
b22be6fcf2 Fix bug #17521147 Settings activity looks terrible on Volantis
- update layouts for PreferenceActivity and its headers
in two panes mode (per UX request)
- add theming where it was missing

Change-Id: I0c478c1a66b6de7e122b7ee73da24f3dd5a7bc28
2014-09-26 13:38:12 -07:00
Alan Viverette
996a63859f Fix accessibility events emitted from TwoStatePreference
Removes redundant and conflicting events emitted from check and switch
preferences. Sends VIEW_CLICKED accessibility events from AdapterView
rows after calling their on click listeners, which ensures data is
consistent.

BUG: 16961152
Change-Id: I4b57bceec6830d775c2da57226b8ee482242caf7
2014-09-02 16:35:45 -07:00
Fabrice Di Meglio
b1a50f2dff Fix bug #16957601 Stability: ISE in Settings: Observer com.android.settings.
SettingsPreferenceFragment$1@273c8fdb was not registered

- add onUnbindPreferences() call to match onBindPreferences()
- this new method is @hide so it does not impact the APIs

Change-Id: Iee0ab8a4ecc2046f89fb96cc52af150e835f658c
2014-08-14 18:00:11 +00:00
John Spurlock
351346092a Volume: Show safe media warning in settings.
If the safe media warning is enabled, make sure
we display it from the new inline slider preference in
Settings (without showing the volume dialog itself).

Also:
 - Update the warning dialog to the new sysui theme.
 - Separate the warning sentences with an additional line.
 - Fix the auto-dismiss timeout.
 - Add a system property to additionally enable the safe
   media warning for testing
 - Add more information to audio service dumpsys.

Bug:15434662
Change-Id: I95fec12c9049bbfdb7ebdf246160e4b12c0c5be3
2014-07-25 11:27:51 -04:00
Alan Viverette
4d065a04ce Remove old listener when rebinding SwitchPreference
Also fixes switch animation during scrolling, unnecessary call to
requestLayout() on drawable invalidate, and potential NPE.

BUG: 16225972
BUG: 4312303
Change-Id: I015d1f03206dd2c812592b0abfa4214a3de73d3f
2014-07-11 23:03:52 +00:00
Fabrice Di Meglio
f9499b36e6 Add PreferenceFragment styling
- add the capability to specify a specific layout for PreferenceFragment

Change-Id: I2fa36b8fa8110e6cbc8006e1d000dc90ae6a5f0b
2014-07-07 20:08:27 +00:00
Fabrice Di Meglio
5f9f6c3936 Fix PreferenceGroupAdapter highlight code path
- do not change the Preference View background. Instead wrap
the Preference View into a FrameLayout with the highlighting
Drawable as the background
- test the View type to force the Preference View creation and
not rely on the convert View when highlighting
- define a new View type for the highlighting
- increment getViewTypeCount() returned value (for the new type)

Change-Id: Ie5f19311e11545aba848fd637ec61e43071d8dcf
2014-06-23 18:47:26 -07:00
Brian Attwell
02bc31e7b3 setSelectedHeader() when switching to fragment
Without this change, passing a EXTRA_SHOW_FRAGMENT value
for a two panel preferences activity will cause the correct
fragment to be shown. However, it will not cause the
correct header to be highlighted.

Bug: 15675746
Bug: 5045558
Change-Id: I18d8e15dd104e8f39ae1ccbb11ab17fd1bf7462e
2014-06-17 04:43:10 +00:00
Fabrice Di Meglio
19ae4ca5a7 Fix SeekBarPreference Theming
- make the layout a Theme attribute and use it
- make a specific Material version of the layout for matching
what we have in the Settings App

See bug: #15414236 Define a framework theme for system settings

and #15384992 Setting Dashboard - padding updates

Change-Id: I69c90523fab112fecf26d89de8fc35dd62430c06
2014-06-16 15:58:25 -07:00
John Spurlock
0dbf1a6be2 Settings: Keep SeekBarVolumizer in sync with audio stream.
Use AudioManager.VOLUME_CHANGED_ACTION instead of relying
on obsolete settings.

Bug:15343543
Change-Id: Ia95237bb455268314ec985affe92b0cec6b52e29
2014-06-01 13:01:23 -04:00
John Spurlock
95caba1270 frameworks/base: Performance tweaks for SeekBarVolumizer.
Move ringtone init to the worker thread.  Allow the volumizer
instance to be reused by making the seekbar settable.

Bug:15091992
Change-Id: Ib616ae0fbb9a45c63391f8335e48ec2754dbdcd5
2014-05-27 13:10:38 -04:00
John Spurlock
74a2e06d83 VolumeZen: frameworks changes to support Settings.
- Pull SeekBarVolumizer out into a separately reusable class.
- Make register/unregisterOnActivityStopListener avail to system code.
- Add new setting for displaying suppressed notifications in zen mode.

Change-Id: Ic30aa575ae07650cee62c8c1d83b6bc69395cf0d
2014-05-18 12:26:21 -04:00
Alan Viverette
fcb48b3ab9 Ensure volume preference has correct defStyleAttr
BUG: 14635756
Change-Id: Id78da5df3d355a4dda9bd1b80b14df54803d5d03
2014-05-15 15:03:36 -07:00
Fabrice Di Meglio
8a86d734e5 Improve Preference highlighting
- add PreferenceFragment.onBindPreferences() so that we can know
when the binding as been done
- use the Preference's key as a tag for its View (so that we can
locate it latter in the View hierarchy)

Change-Id: Ifb3b30e576048b7464af63643834d278a46a8543
2014-04-17 19:42:05 -07:00
Fabrice Di Meglio
35d7b89b9f Add Preference highlighting
- use a specific drawable for highlighting a Preference
at a given position
- also add PreferenceFragment.hasListView() as hidden API

Change-Id: If69854cf6c4852d0f45e2c3a9734b1f63b352f9d
2014-04-16 16:01:13 -07:00
Alan Viverette
55565ecd46 Update list item text appearance
Adds a new attribute for secondary list item text and points
the Gingerbread and Holo themes to use TextAppearance.Small for
compatibility's sake.

Change-Id: I8e78a908b699baae6d1f5b3623fd7b5648b99b77
2014-04-09 16:52:54 -07:00
Fabrice Di Meglio
53c2cf799f Add support for saving and using the Preference's key value
- make public and hide the PreferenceGroupAdapter class
- add setActivated(int position) to be able to set the activated item
- udpate getView(int position, View convertView, ViewGroup parent) to set/unset
the activated item

Change-Id: I8a653ad6541bb6b7a043ba7c3d95e5ecad924a0d
2014-04-08 13:22:07 -07:00
John Spurlock
8a985d24ce Tabs -> spaces in frameworks/base.
Change-Id: I5a84e8e93ac99b5ed0212b37bf66efa5e53864be
2014-02-25 09:49:29 -05:00
Alan Viverette
8eea3ea559 Add APIs for obtaining themed Drawable from Theme, Context
BUG: 12611005
Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
2014-02-03 18:42:24 -08:00
Fabrice Di Meglio
ad2fcfe1b6 Make public but hide OnPreferenceTreeClickListener
- needed as the Settings app is no more a PreferenceActivity

Change-Id: I583493c4027b983efd059564a12eff0814c6bf02
2014-01-20 11:10:52 -08:00
Fabrice Di Meglio
5aaae37506 Code cleaning for PreferenceActivity
- remove non used argument

Change-Id: If57b8230aefffdd77fbba240042093ddb6975b9d
2014-01-08 15:50:34 -08:00
Alan Viverette
f878c298e1 Apply theme to PreferenceActivity headers
BUG: 11900302
Change-Id: Ibd1b08b412f6e64b44b2f3f07d297ede8fa01367
2013-12-02 18:36:00 -08:00
Svetoslav Ganov
f7d720e6b0 am 4f23b610: am b95d6f54: am c6db9c3b: Merge "Revert "PreferenceFragment showing the breadcrumb when not needed."" into klp-dev
* commit '4f23b6104e11be81f3e2ca1a1031de6ca112f50a':
  Revert "PreferenceFragment showing the breadcrumb when not needed."
2013-11-21 12:22:59 -08:00
Svetoslav Ganov
45dbd75290 am dbab7e17: am 4ed5f502: am 4d159661: Merge "Revert "PreferencesFragment showing the breadcrumb area in single pane mode."" into klp-dev
* commit 'dbab7e1794f91e3dc4b0617df6fb59183c7349e5':
  Revert "PreferencesFragment showing the breadcrumb area in single pane mode."
2013-11-21 12:22:55 -08:00
Svetoslav Ganov
c6db9c3b37 Merge "Revert "PreferenceFragment showing the breadcrumb when not needed."" into klp-dev 2013-11-21 20:12:13 +00:00
Svetoslav Ganov
8fc552e695 Revert "PreferenceFragment showing the breadcrumb when not needed."
This reverts commit 7db97b0a29.

Change-Id: Iefe9807fd75baf04e61ec59b508e438320c80fe3
2013-11-21 19:36:22 +00:00
Svetoslav Ganov
68e7f13e22 Revert "PreferencesFragment showing the breadcrumb area in single pane mode."
This reverts commit 2b8795a9db.

Change-Id: If8dcc7190cbe66af09945d8b23a3e1d8fd791b1d
2013-11-21 19:33:53 +00:00
John Spurlock
6090995951 Remove unused imports from frameworks/base.
Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
2013-11-20 11:31:47 -05:00