128 Commits

Author SHA1 Message Date
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
TreeHugger Robot
6e82080513 Merge "Move Badging from ScoredNetwork to NetworkingBadging." 2017-02-18 01:14:04 +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
TreeHugger Robot
4e43b811e7 Merge "Add multi-dex to SettingsLibTests when buliding with coverage" 2017-02-17 20:47:52 +00:00
TreeHugger Robot
8c9a6b0089 Merge "Revert "Revert "Per user setting for instant app""" 2017-02-17 20:46:12 +00:00
Colin Cross
a7cfd57759 Add multi-dex to SettingsLibTests when buliding with coverage
Building with coverage enabled pushes SettingsLibTests over the dex
limit, enable multi-dex.

Test: builds
Change-Id: Ia72db71a2e46e2fdc8cf3e5484f122fa985f25c7
2017-02-17 18:54:37 +00: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
Todd Kennedy
be0b8896d1 Revert "Revert "Per user setting for instant app""
This reverts commit be9ffa15af9e1906e9ffb505768328d62d4a3793.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Ib21321cf157a79890de487060a093840f7182047
2017-02-16 12:43:37 -08:00
Antony Sargent
67952e94a9 Add "Instant apps" filter to app listing
Bug: 35098444
Test: new test added in ApplicationsStateTest.java ; run it by doing the
following commands:
 make SettingsLibTests -j40
 adb install -r $OUT/data/app/SettingsLibTests/SettingsLibTests.apk
 adb shell am instrument -w com.android.settingslib

In Settings->Apps&Notifications->Apps, the list of filters before this CL is:

 All | Enabled | Disabled

With this CL, the filter list becomes:

 All apps | Installed apps | Disabled apps | Instant apps

Change-Id: Ia2ec099f758901839a2aa84fe155ae032990092f
2017-02-15 15:52:33 -08:00
Guang Zhu
be9ffa15af Revert "Per user setting for instant app"
Bug: 35390781

This reverts commit 2f5811dcfd840e149851a9333e27ef3cdddf7a46.

Change-Id: Ibb1c8dacbdc6908fc7fa2bc5dca664f2455162bf
2017-02-15 21:43:48 +00:00
Sundeep Ghuman
699deaf610 Move Badging from ScoredNetwork to NetworkingBadging.
This is a non-functional refactor. The old enums will be removed once
ag/35323372 is addressed.

Bug: 35114358
Test: Ran existing tests (see files touched).
Change-Id: I08fd8c7964463b5908ce361e61f8fe811d0ff6f3
2017-02-14 14:04:18 -08:00
Todd Kennedy
2f5811dcfd Per user setting for instant app
The same application can run as either an instant app or an installed
app. Store this setting per-user instead of based upon the install
location.

Bug: 25119046
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.EphemeralTest
Change-Id: Iff565bb1ac10d631499f0bd0f69b401cb073c10e
2017-02-14 13:42:01 -08:00
Daniel Nishi
646b56c844 Merge "Don't show game and music apps in Other Apps." 2017-02-14 18:45:33 +00: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
Sundeep Ghuman
ac7b43616e Serially (un/)register score cache in WifiTracker.
Before the cache unregistration logic was posted to the worker thread.
However, when WifiSettings is quit, the onDestroy method immediately
kills the WorkHandler. This caused unregistration to never occur, which
left the cache registered and the listener to try to post work on the
dead worker thread. The cache is now registered and unregistered
serially in start and stop tracking, respectively. Furthermore, the
cachelistener is running on the mainHandler as it is a lightweight task
(posting to work handler).

Bug: 34891717
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java

Change-Id: I7739fdbe036be5b2870be45f33f670fd69d69af1
2017-02-08 20:56:07 -08:00
TreeHugger Robot
4a7b9f2b90 Merge "Fix a crash when opening app data usage for work profile" 2017-02-08 22:33:47 +00:00
Daniel Nishi
bd8c6652cd Don't show game and music apps in Other Apps.
Bug: 35143240
Test: SettingsLib Robotest
Change-Id: Ifaa086373d27dc81203137d20fa1617df21f6093
2017-02-08 12:20:12 -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
Dan Sandler
6aa6e6e640 Clean up BatteryMeterDrawable internal api.
Bug: 32539932
Test: runtest -x frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/graph/BatteryMeterDrawableBaseTest.java
Test: runtest -x frameworks/base/packages/SystemUI/tests/src/com/android/systemui/BatteryMeterDrawableTest.java
Change-Id: Ifdc3368b930abcf248b60ee99f6f9139ad804f91
2017-02-08 10:10:46 -08:00
TreeHugger Robot
ba89ed754f Merge "Move the logic of batteryMeterDrawable to settingslib" 2017-02-08 10:14:28 +00:00
jackqdyulei
597b10f6db Move the logic of batteryMeterDrawable to settingslib
In Settings, we also need a BatteryMeterDrawable to show battery meter,
that's why I move it to settingslib.

In this cl, what I have changed is listed below:
1. Create BatteryMeterDrawableLib that contains logic of battery
drawing.
2. Still Keep the battery control logic in systemui.
3. Remove hardcoded battery color by using the color state lists.
4. Move some tests to settingslib

Bug: 34771849
Test: make SettingsLibTests

Change-Id: I39c0f0e31ca5e1b958467298db1d0590d16c9f6d
2017-02-07 17:27:00 -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
Daniel Nishi
646f500315 Merge "Add a filter for audio apps." 2017-02-01 21:01:55 +00: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
Daniel Nishi
7e33682338 Add a filter for audio apps.
Bug: 33199077
Test: SettingsLib integ tests
Change-Id: Iad3717c78debe4d4c5edbb4337d0c79f062d93a6
2017-01-26 14:34:32 -08:00
Sundeep Ghuman
e869d83ea8 Create Settings Flags to Disable Scoring UI changes.
When disabled, this will prevent badges from being shown in the status
bar or wifi picker as well as prevent access points in the picker from
being rearranged based on ranking scores.

Fix missing permission dropped from previous CL to run
NetworkControllerWifiTest and refactored tests to enable new setting.

Bug: 34712533
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java
and runtest --path
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java

Change-Id: I79c97f2205ebb70c0f7f5b1f66f7207055e5769b
2017-01-26 12:09:04 -08:00
Daniel Nishi
abb4bd2128 Add a games filter to the ApplicationsState.
This allows us to filter on game apps in Settings.

Bug: 33199077
Test: SettingsLib integ tests
Change-Id: I8cbd7f77ab95e2ce19e56a5af3597334f804885e
2017-01-20 15:13:38 -08:00
Paul Duffin
1d0244a846 Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Change-Id: If507b641624a2933e722f61e815890fcdf442265
2017-01-20 09:00:33 +00:00
TreeHugger Robot
b8e3643066 Merge "Add rankingScores and badges to WifiPicker." 2017-01-20 02:03:33 +00: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
Sundeep Ghuman
5519b7b873 Add rankingScores and badges to WifiPicker.
Adds support to request scores in WifiTracker and then plumb
those scores via AccessPoint.java. AccessPoints will sort on
ranking scores. Show badging in WifiSettings picker.

Bug: 33457699, 33778046
Test: Unit tests
Change-Id: Icc3161cf147b3a9715d6e9f56af574e52ae6c832
2017-01-19 15:13:09 -08:00
Tadashi G. Takaoka
e12a6fff14 Add supportsDismissingSelfWindow attribute of IME
When a virtual keyboard is shown on some configurations (e.g. Phone),
the System UI may change the back navigation button to a different UI
element in order to dismiss the virtual keyboard. Such UI modification
is unnecessary when the virtual keyboard has a dismissing button on
its own window. This new attribute hints the System UI that the
virtual keyboard may have a UI element to dismiss itself. This will be
also useful for Tablet System UI which may not show a navigation bar
when a virtual keyboard is shown.

Bug: 34133139
Test: Add unit test InputMethodInfoTest
Change-Id: I0f6b130a7df57557e40b52a7b7ac00be965a17c3
2017-01-16 12:22:54 +09:00
Bartosz Fabianowski
9e0642287e Merge "Add install reason" 2017-01-14 12:58:20 +00:00
roger xue
5404355e0a move PreferenceController into settingLib/core
Test: moved
Change-Id: I9adde03ac7790dc0eacc2f58be3c2af0c9c58900
2017-01-13 11:22:01 -08:00
Bartosz Fabianowski
a34f53f61b Add install reason
This CL allows a reason to be specified when installing a package. The
install reason is a sticky piece of metadata: When a package is e.g.
installed via enterprise policy and an update is then manually
installed or sideloaded, the install reason will remain "policy."
The install reason is tracked separately for each user.

With this CL, two install reasons exist: "policy" and "unknown." Other
install reasons will likely be supported in the future.

Bug: 32692748
Bug: 33415829
Test: Tested manually with "adb install" / "adb uninstall"

Change-Id: I0c9b9e1b8eb666bb6962564f6efd97e41703cd86
2017-01-13 16:51:28 +01: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
Fan Zhang
cf439c0e80 Disable nav drawer in Settings app.
Bug: 34054123
Test: runtest --path frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/drawer/SettingsDrawerActivityTest.java
Change-Id: Ia6ae42315c3d1798803b9554aa8400aafa2f31fa
2017-01-03 16:41:50 -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