59 Commits

Author SHA1 Message Date
Lei Yu
f69156ff95 Merge "Refine BatteryInfo and battery drawable" into oc-dev am: 57af565fb7
am: 24638307c2

Change-Id: Ifae38f01a454fe9dcea1fbde0ea1a57a15087d8a
2017-04-14 16:18:02 +00:00
jackqdyulei
ff5bd948b0 Refine BatteryInfo and battery drawable
1. Remove "m" prefix for all public field
2. Change logic about field "discharging", now it only controlled
   by whether it is plugged in.
3. Change Paint in drawable to protected
Bug: 36862496
Test: RunSettingsLibTests
Change-Id: I2908ae6868dc877d3ce6a8a63ec17826a6dcca1d
2017-04-12 12:57:55 -07:00
Filip Pavlis
a121bbba10 Merge "Omit using ctor of PreferenceViewHolder in tests." into oc-dev am: 59dd2ebfc1
am: 3b3bf87165

Change-Id: I314d9bfa7d29eb506fa4bb7faedd7f8d506098b4
2017-04-07 10:44:51 +00:00
Filip Pavlis
59dd2ebfc1 Merge "Omit using ctor of PreferenceViewHolder in tests." into oc-dev 2017-04-07 10:31:44 +00:00
William Luh
80bedc2e17 Merge "Fix injected settings titles not matching a locale change." into oc-dev am: 1b54760eee
am: 5669141382

Change-Id: Ic628750c2332cfdf734bf7798e378ddf93a0cdbd
2017-04-07 00:16:36 +00:00
William Luh
1b54760eee Merge "Fix injected settings titles not matching a locale change." into oc-dev 2017-04-07 00:00:44 +00:00
William Luh
4c978a302a Fix injected settings titles not matching a locale change.
The injected tiles code currently treats the string metadata value
for the title key in the Activity's manifest as the title itself.
When the language on the device is changed the title remains in the
previous language until a reboot.

This CL will make injected tiles attempt to treat the string metadata
value as a resource variable to get the integer res id and then
properly load the localized title using the res id. To be backwards
compatible, if the res id is 0, we treat the string metadata value as
the title itself (current behavior).

Bug:36470694
Test: make RunSettingsLibRoboTests
Change-Id: I3963534a3a3a27d0455c4ed1ad4fa574b03d67fc
2017-04-06 14:35:51 -07:00
jackqdyulei
806f78d988 Add showChargingMethod in BatteryInfo
This toggle is used to decide whether to show charging method.
If it is off, then "Charging over ac" will become "Charging"

Bug: 36558216
Test: RunSettingsLibRoboTests
Change-Id: I98b1f7e7b77d7ce0a7e1aae29e55a33ac79ff0d7
(cherry picked from commit b3c33f63ed120cf4758ec67426bb45291e289fce)
2017-04-06 13:16:58 -07:00
Filip Pavlis
81d53516ab Omit using ctor of PreferenceViewHolder in tests.
See the topic for related change in the support lib.

Bug: b/33774880
Test: N/A
Change-Id: I557278175db17b32ff9ce65ceaebc9a7386d2c20
2017-04-05 10:56:38 +01:00
jackqdyulei
b3c33f63ed Add showChargingMethod in BatteryInfo
This toggle is used to decide whether to show charging method.
If it is off, then "Charging over ac" will become "Charging"

Bug: 36558216
Test: RunSettingsLibRoboTests
Change-Id: I98b1f7e7b77d7ce0a7e1aae29e55a33ac79ff0d7
2017-03-30 15:52:45 -07:00
Maurice Lam
8c54e87e76 Merge "Add custom view support to Tiles" 2017-03-29 22:56:56 +00:00
Maurice Lam
1c07761f8e Merge "Add exclusive attribute to suggestion category" 2017-03-29 01:25:27 +00:00
Maurice Lam
d8ae77b7f5 Add custom view support to Tiles
Make Tiles parse the metadata "com.android.settings.custom_view",
which are inflated as remote views and be displayed instead of the
regular item-summary item.

Test: cd tests/robotests && mma
Bug: 35668836
Change-Id: Id245efdeb42a07766f16915501151348f01d49d6
2017-03-24 14:33:29 -07:00
Maurice Lam
f74b9e522f Add exclusive attribute to suggestion category
Add exlusive attribute to suggestion category XML, which when true,
will prevent all other categories from being shown in suggestions.

If there are multiple suggestions in a single exclusive category, all
of them will be shown.

If there are mutliple exclusive categories with enabled suggestions,
only the first will be shown.

Test: cd tests/robotests && mma
Bug: 35668836
Change-Id: I8b95cdcd021a2d67d460259b4a44ca37290ffd48
2017-03-23 18:53:41 -07:00
TreeHugger Robot
54cacb7aed Merge "Remove tests from SettingsLibShell" 2017-03-23 03:13:59 +00:00
Fan Zhang
035ff93430 Move two target preference layout from settings to lib
Change-Id: I5eda0cdcc4e8d8bb25f95ee12837d90179ac5c0a
Fix: 36511169
Test: make RunSettingsLibRoboTests
2017-03-22 16:02:37 -07:00
Colin Cross
3c17d77610 Remove tests from SettingsLibShell
The tests and the robolectric libraries are already in
SettingsLibRoboTests, and shouldn't be in the package being tested.
Including robolectric in the package causes it to go through
proguard, which complains about missing dependencies.

Also remove the unnecessary libraries that are already included
through frameworks/base/packages/SettingsLib/common.mk.

Test: m -j ANDROID_COMPILE_WITH_JACK=false RunSettingsLibRoboTests
Change-Id: I11f007c4321bb9b147f62010eae046f75d1a52e3
2017-03-22 16:01:52 -07:00
Doris Ling
ce31159be7 Update sort order for settings category tiles.
- change the sort to first compare priority, then compare package name.
- do not normalize the tile's priority for all package.

Change-Id: I5501a8c3d5ca0a7f9e100411348d28cfe373c87a
Fix: 35928954
Test: make RunSettingsLibRoboTests
2017-03-13 12:56:10 -07:00
Fan Zhang
c93dadacdd Show help icon in actionbar
Fix: 35955986
Test: RunSettingsLibRoboTests
Change-Id: If4c328cacf1e3c9a5f66eeb248749c97c80cdb6c
2017-03-06 13:06:38 -08:00
TreeHugger Robot
ab6798951a Merge "Fix broken RestrictedLockUtils KeyGuard APIs" 2017-02-24 19:29:48 +00:00
TreeHugger Robot
23830a0909 Merge "Remove ContentProvider queries in updateTileData." 2017-02-23 21:11:18 +00:00
William Luh
204af1cb44 Remove ContentProvider queries in updateTileData.
The ContentProvider queries in updateTileData are not being used, and
adds extra latency. Queries are performed later in Settings to get the
freshest data.

Bug: 35708630
Test: make RunSettingsLibRoboTests
Change-Id: I3798af0a89ed7261cfa4ebec4fada077495034ed
2017-02-23 11:16:47 -08:00
TreeHugger Robot
120f971679 Merge "Disable settings nav drawer entirely." 2017-02-22 20:08:37 +00:00
Fan Zhang
5ba2d3fef9 Disable settings nav drawer entirely.
Change-Id: I3e9bdd3759a47fc09a654b6dad00b611138d5de6
Fix: 34806148
Test: make RunSettingsLibRoboTests
2017-02-22 10:36:30 -08:00
Robin Lee
acdeac6809 Fix broken RestrictedLockUtils KeyGuard APIs
They were all broken in that they returned profile admins for parent
queries even when they clearly shouldn't.

Examples:
 - disable unredacted notifications
 - disable fingerprint

This doesn't seem to have been tested beyond the bare basics of one
user with one device admin. Added some reasonable coverage. It could
still do with more.

Test: make RunSettingsLibRoboTests
Bug: 34929375
Change-Id: I1b0e986056ffa62d47091c0010977ac810ebd690
2017-02-22 17:39:34 +00:00
jackqdyulei
5dc1f36599 Make precentage calculation round up by 0.5%
So we will show 1% when actually number is 0.5%

Bug: 35305983
Test: RunSettingsLibRoboTests
Change-Id: I26f11f25a7d78cc6b09cb358abd82017fa7cea00
2017-02-21 16:40:01 -08:00
Lei Yu
1335669b0e Merge "Add statusLabel in BatteryInfo" 2017-02-21 18:40:52 +00:00
Fan Zhang
b1d49225c0 Add logging constant for settings search result click
Bug: 34975477
Test: Builds
Change-Id: Ie59fb0639c6aa4044ba4fdb0a71dd489bd2d3b68
2017-02-17 16:07:07 -08:00
jackqdyulei
111418e7ad Add statusLabel in BatteryInfo
The statusLabel shows the current status of the battery(i.e. not
charging, charging).

Bug: 35328749
Test: RunSettingsLibRoboTests
Change-Id: I5be13635be9b2749c0c62edeb1e0ac17ff423d83
2017-02-17 13:58:49 -08:00
Doris Ling
2ddd29df61 Remove nested preference from its parent.
PreferenceScreen.remvoePreference() only removes top level preference in
the preference screen. When we try to remove preference inside a
preference category, it will fail. Add handling to recursively find
the preference and remove it directly from its parent instead.

Change-Id: Ib33efe0b716db2366d712ce1d1eb8b5e33a4683a
Fix: 35365702
Test: make RunSettingsLibRoboTests
2017-02-16 15:29:26 -08:00
Fan Zhang
fdfc88faef Don't hide summary text in RestrictedPreference.
Bug: 34974598
Test: RunSettingsLibRoboTests
Change-Id: I8ea74fb52c38430c120fd4158867a9184d8f16cf
2017-02-10 17:22:51 -08:00
Fan Zhang
73b161ddc1 Fix a crash when opening app data usage for work profile
The icon on app header is a clone of original app icon, which relies on
getConstantState() of the orginal drawable non-null.

Change-Id: Ice5360f5d00d99b3cfe538b167ce67fc06d5e402
Fix: 34190136
Test: make RunSettingsLibRoboTests
2017-02-08 12:02:52 -08:00
Soroosh Mariooryad
e622690efa Merge "Modifying SuggestionParser to support dismiss logic of smart suggestions." 2017-02-07 02:12:58 +00:00
Soroosh Mariooryad
56ce766e92 Modifying SuggestionParser to support dismiss logic of smart
suggestions.

Test: RunSettingsLibRoboTests
Fixes: 35059823
Change-Id: I8c257f4f89f7dbc179aee85e013bdaecc8c3c09c
2017-02-06 17:37:49 -08:00
Doris Ling
864b7f41bb Remove category key SYSTEM_INPUT
Since we are combining Language & regions and Input and gestures in
System settings, we don't need 2 separate category keys.

Bug: 34976047
Test: make RunSettingsLibRoboTests
Change-Id: Ic11bfb5e4e373a3499772b1d4654187749197899
2017-02-03 16:15:03 -08:00
Ido Ofir
a560cd947b Adding missing filters to suggested actions in Settings that that they
match the Optional Steps fliters in setup wizard.
Also added some more logging.

Bug: 34460278
Test: cd tests/; mma

Change-Id: Id576a1a19daa473e203cef41d67f6ef0cfc06dbe
2017-01-31 11:03:44 -08:00
Shahriyar Amini
778cf1d8d6 Support setting icons from Settings or target app.
Bug: 31002801
Test: make RunSettingsLibRoboTests

Injected settings can have a dynamic icon that is based on drawable
resources in the target app or the Settings app.

Change-Id: I2d5df15b0e21d7fe02206ca8df3fbfc7af75c624
2017-01-19 15:30:22 -08:00
roger xue
5404355e0a move PreferenceController into settingLib/core
Test: moved
Change-Id: I9adde03ac7790dc0eacc2f58be3c2af0c9c58900
2017-01-13 11:22:01 -08:00
roger xue
8f06ab0774 making changes to settingsLib so we can create car setting using settingsLib
Test: make -j40 RunSettingsLibRoboTests

Change-Id: I4eff074ebbbf1d4a4325580d68a2123d3f5ff930
2017-01-05 10:20:24 -08:00
Shahriyar Amini
62d80aa09f Merge "Allow Settings tiles to use content provider data." 2016-12-22 18:21:44 +00:00
Shahriyar Amini
676add4122 Allow Settings tiles to use content provider data.
Bug: 31002801
Test: make RunSettingsLibRoboTests

Adds optional metadata fields to specify a URI to a content provider
for reading the tile data.

Change-Id: Idc47eefc067fb9d4832dfbd58171943c29f0a529
2016-12-21 10:01:39 -08:00
Andrew Sapperstein
b9453be364 resolve merge conflicts of 4e10b37 to master
Change-Id: If5091133617285fdb7f3c0312e9e229ae8e53fe0
2016-12-20 15:31:32 -08:00
Andrew Sapperstein
8dc3b870a0 Add flags to send package name for feedback.
Bug: 32189956
Test: make RunSettingsLibRoboTests
Change-Id: I0bd40fdf60b4f3ee21afad6e3f7dc3e4e87212f0
(cherry picked from commit c05c740d606a4a0c4418f34f6cfbc06fbda8d201)
2016-12-20 21:06:38 +00:00
Andrew Sapperstein
c05c740d60 Add flags to send package name for feedback.
Bug: 32189956
Test: make RunSettingsLibRoboTests
Change-Id: I0bd40fdf60b4f3ee21afad6e3f7dc3e4e87212f0
2016-12-19 18:12:53 -08:00
Doris Ling
ec46371999 Merge "Overload TileUtils.getCategories() with an additional parameteri." 2016-12-19 23:53:36 +00:00
Doris Ling
485df11f77 Overload TileUtils.getCategories() with an additional parameteri.
Add a string parameter to specify any extra intent action to be used
to query all dashboard categories.

Bug: 32739952
Test: make RunSettingsLibRoboTests

Change-Id: I4df39acfde841ab0553fe01893e9e4a97d6f7bca
2016-12-19 14:24:36 -08:00
Paul Duffin
6690a19c68 Use junit instead of junit4-target
Bug: 30188076
Test: make checkbuild
Change-Id: I61bf0d812d433d3622e9be33c549da16e511a359
2016-12-19 14:01:32 +00:00
Lei Yu
5ed0692b25 Merge "Change animation based on visibility of the drawable" 2016-12-14 19:00:56 +00:00
jackqdyulei
089b6ac75a Change animation based on visibility of the drawable
Bug: 27633363
Test: make RunSettingsLibRoboTests
Change-Id: I589056eb95ee0af046e39d2a646b51c754886b4d
2016-12-13 10:04:17 -08:00
Andrew Scull
4e201486b5 Extract checking profiles for restrictions into a shared method.
Test: m RunSettingsLibRoboTests
Change-Id: Ie8fd3121771a7a2213ee441aef5a0746ad09a6c9
2016-12-13 10:45:37 +00:00