Commit Graph

134 Commits

Author SHA1 Message Date
Yanting Yang
552f340dda Resolve tiles intent before prompting a dialog for profile selection
Symptom:
Once the work profile component of the tile is disabled after Settings
preloaded tiles, Settings will crash when the user clicks the work
option from the profile selection dialog.

Root cause:
Settings just checks the users from the preloaded tiles to prompt
profile selection dialog. It doesn’t check the activity for the work
profile user before launching.

Solution:
Resolve the activity by intent as users before launching if the work
profile is enabled. Directly start activity if only one user is
resolvable, otherwise prompt a dialog for profile selection.

Fixes: 162227425
Test: make RunSettingsRoboTests
Change-Id: Idcc4e5a266ab2a2252db30bb97d4be002212c677
2020-09-09 18:12:42 +08:00
govenliu
b70ddb9df7 [Wi-Fi] WiFi Settings inclusive language fix plan phase 1
Replace WiFi related terms which contain Master wording.
Goal: Create a fixit for Android Platform to reduce the use of non-inclusive language for all code.

Bug: 161425297
Test: make RunSettingsRoboTests -j or
make RunSettingsRoboTests ROBOTEST_FILTER=DashboardFragmentTest
make RunSettingsRoboTests ROBOTEST_FILTER=WirelessDebuggingPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AutomaticStorageManagementSwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=AllInOneTetherPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=TopLevelNetworkEntryPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=PrimarySwitchPreferenceTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiPrimarySwitchPreferenceControllerTest
make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherPreferenceControllerTest

Change-Id: I9395c50e092e124016609f88f7c8151554a0d874
2020-07-21 20:56:22 +08:00
Jason Chiu
26343b82ee Add metric logs for special cases in Display and Battery page
Bug: 137559984
Test: robotest
Change-Id: I60f6237ac2c533306879f46ee4c25d54002cf0e9
2020-03-26 11:31:39 +08:00
Jason Chiu
ca9ece1a0c Card showing mechanism change in homepage
- update contextual card proto interface to fit the new SettingsIntelligence
- show sticky cards at the tail of the card area

Bug: 149274976
Test: robotest
Change-Id: Icca167825c1c037ec12d8836d82c5fdff4331a8e
2020-02-14 17:44:11 +08:00
Jason Chiu
1281e595e4 [Settings] Add preference click metric log
- Move the log point of onPreferenceTreeClick from DashboardFragment to
  it's super class InstrumentedPreferenceFragment for better coverage.
- Write the preference click metric log in PreferenceController handling
  case in DashboardFragment which will skip super class's log point.

Bug: 137559984
Test: robotest
Change-Id: I67178f613c74f755e20fc9dc41319974cb02e83c
2019-12-16 10:57:09 +08:00
Jason Chiu
10e675d6b5 [Settings] Support master switch of inline toggle of Settings Injection v2
Allow developers to inject MasterSwitchPreference, a switch
preference with two tap targets, to Settings page.

Developers should declare keyhint and switch_uri for the activity
in AndroidManifest,and then implement a SwitchesProvider.

Bug: 132808482
Test: robotest
Change-Id: I64cdf18268be0cfcd38aab2c059144536dd79b32
2019-11-22 04:04:04 +00:00
Jason Chiu
bac5987c8e [Settings] Support pure switch of inline toggle of Settings Injection v2
Bug: 132808482
Test: robotest
Change-Id: Ib24614fb46fe990925edad721e3b7d5d032854fc
2019-11-19 18:24:13 +08:00
Jason Chiu
1a1f9314b6 Refactor Settings for injection v2 inline toggle
Bug: 132808482
Test: robotest
Change-Id: I0b74e05bc26b97259a15859c669060ce3da7972a
2019-10-04 18:32:11 +08:00
Fan Zhang
823c4daece Load preference title from uri if available
For injected tiles, allow clients to provide dynamic title from
contentproviders similar to dynamic summary.

Fixes: 131837802
Test: robotests
Change-Id: Iacc80db5d003473cf59ede67d88441947a834888
2019-06-20 15:47:38 -07:00
lindatseng
2e7af2f023 Fix tinting on injected pref icon
We used to tint the injected pref icon when refreshing Tile. However,
when we are going to render the icon, we used Tile.getIcon which uses
the icon resource id to get the original version of icon directly.

Do a little refactor here to move the tinting logic inside Tile.getIcon.

Test: Manual/Visual inspection
Fixes: 129010399
Change-Id: I6f187b12cb6d91b54dcfe43e0ff34add55fd7b07
2019-04-02 13:35:17 -07:00
hughchen
9d4b634535 Remove method that used to get rainbow bt icon
Move get rainbow bt icon method to settingsLib

Bug: 128570540
Test: RunSettingsRoboTests
Change-Id: Iee022bd1471f1da057b1852bb648e9c7ce334727
2019-03-28 10:58:55 +08:00
jackqdyulei
7fb5e75752 Make BT icon colorful
Add new method to get rainbow bt icon and also refactor
AdaptiveHomepageIcon:
1. Rename
2. Add ConstantState

Bug: 126425211
Test: RunSettingsRoboTests

Change-Id: Idb8aaf253d0d9e2ab33d8852f093e6689ebadde4
2019-03-19 12:22:38 -07:00
Amin Shaikh
3304bec980 Use adaptive icon shapes for settings homeepage
- Add AdaptiveIconShapeDrawable for the homepage icon backgrounds
- Rename RoundedHomepageIcon -> AdaptiveHomepageIcon to reflect that the
adaptive icon shape is used

Bug: 123829919
Test: mp settings; manually viewing homepage icons
Change-Id: I9fddfbf57461b300200f30f716d861878bbbcc38
2019-02-05 15:18:52 -05:00
Doris Ling
3e586a5cf2 Add current user handle to tile intent in account detail page.
- the account detail settings page is launched with the correct user
handle when there is work profile to indicate which profile the account
belongs to. When we process the dynamic tile, for the page, we should
add this info to the tile intent, so that it can be launched with the
correct profile.
- when we launch the tile intent, check whether there's user handle
specified. If so, launch the intent directly without prompting for
profile selection.

Change-Id: I91f8c666a826909006b1f53907b3441825322c10
Fixes: 119657694
Test: make RunSettingsRoboTests
2019-01-31 11:19:30 -08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
Fan Zhang
e22bcd07fc Move EXTRA_SOURCE_METRICS_CATEGORY import.
Bug: 117860032
Test: rebuild
Change-Id: Iedf020183fe78cdf8206beb91e1222d821adbe63
2018-11-11 19:43:54 -08:00
Fan Zhang
d011d45da5 Remove getExtraAction() from DashboardFeatureProvider.
It's always set to null and not doing anything.

Bug: 111427617
Test: robotest
Change-Id: I7172a31056950b1597f0b98625a3a2615305e466
2018-08-20 16:14:16 -07:00
Fan Zhang
64951163b8 Use getSummary() to get tile summary text.
Bug: 77600770
Test: robotests
Change-Id: Iecef09853bb49bc259502494912ed81d52e2d7ce
2018-08-20 14:13:14 -07:00
Fan Zhang
54cfb64987 Use tile.getTitle(context) to get tile title.
And switch to getId() instead of title when comparing 2 tiles. This is
more accurate and more efficient.

Bug: 77600770
Test: robotests
Change-Id: I587d90702d98956bf7b420529ac3280351ca4a10
2018-08-20 12:50:06 -07:00
Fan Zhang
fde4f207ff Force externally injected tiles to use rounded icon.
Bug: 110405144
Change-Id: Ic65200fce5010ea8077254e7a67bbe4dae886ec3
Fixes: 79748104
Test: robotests
2018-08-10 15:45:50 -07:00
Fan Zhang
7d5a9eebb8 Add a config to force rounded icon for DashboardFragment.
And each page has ability to turn on/off rounded icons. This CL only
adds the flag, it doesn't actually change icon shape yet.

- Boolean config in xml
- New protected method for each DashboardFragment to load config
- Plumb the boolean into DashboardFeatureProvider for future use.
- Remove some unused APIs from DashboardFeatureProvider

Bug: 110405144
Fixes: 79748104
Test: robotests
Change-Id: Id34782e75aa7289967e4dd1f4fe2978688092702
2018-08-10 10:57:18 -07:00
Fan Zhang
9445d15f9d Remove priority from intent-filters for IA items
And use ORDER metadata instead.

Bug: 77600770
Test: robotests
Change-Id: I9862c89ff5b601fbb9fb53eaa91f03d95d501284
2018-08-08 09:09:27 -07:00
tmfang
800f713021 Convert ProfileSelectDialog to androidx verison
Change-Id: Ib3baf04860aee07e5f28d7b537a99a3543d2a978
Fixes: 112155563
Test: robo, manual test
2018-08-08 10:33:11 +08:00
Fan Zhang
3506b74659 Get Tile#intent through getter
Bug: 77600770
Test: robotests
Change-Id: I17d3556f833e6a9610fe34f382534bd90bb0499f
2018-08-07 14:50:18 -07:00
Fan Zhang
60243e6873 Remove custom tintable check.
Make a bunch keys private in tile and DashboardCategory
Bug: 77600770
Test: robotests
Change-Id: I4693e6bb71bd50cc664f578c7f8e25e67da20b67
2018-08-03 16:38:36 -07:00
Fan Zhang
9a1928ea36 Move profile selector dialog to Settings
Bug: 77600770
Test: robotest
Change-Id: I601dabfd925a1990b7bd9115ef579bff9039a7c0
2018-08-02 13:35:08 -07:00
Fan Zhang
1c61a58f0d Pass in context when loading icons from Tile
Bug: 111860183
Test: robotests
Change-Id: I836ad66eb420f4e0bd0bbded541f4dfe947c9b18
2018-07-26 13:09:25 -07:00
Fan Zhang
701b65eccc Use Tile.getIcon() to avoid caching issue
Bug: 77600770
Test: robotests
Change-Id: Icb21f5da9b542abc239b04b71813290ad3104ffb
2018-07-25 12:06:10 -07:00
Fan Zhang
75bafefa49 Move CategoryManager to Settings.
Bug: 77600770
Test: robo
Change-Id: Id4a0c89938d43d21147944b820a191486c589238
2018-07-23 15:09:41 -07:00
arangelov
b6852d7828 Add a metadata to control whether an external intent should be opened in
the personal profile when in a managed profile.

This change introduces the com.android.settings.profile metadata with possible values "primary_profile_only" and "all_profiles" (the default
value when not specified). If an application declares this metadata with a value of "primary_profile_only", in a work profile the ProfileSelectDialog is never shown and the application is opened straight in the personal profile. If an application specifies a value of "all_profiles" or does not specify anything, the ProfileSelectDialog is shown to the user.

Bug: 79868199
Test: atest packages/apps/Settings/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java#openTileIntent_profileSelectionDialog_shouldShow
Test: atest packages/apps/Settings/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java#openTileIntent_profileSelectionDialog_explicitMetadataShouldShow
Test: atest packages/apps/Settings/tests/robotests/src/com/android/settings/dashboard/DashboardFeatureProviderImplTest.java#openTileIntent_profileSelectionDialog_shouldNotShow
Change-Id: Id62ab44b58b93c479407cc1bacc7a806a09bfd1b
2018-06-25 14:40:22 +01:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
android-build-team Robot
d3ff522a0b Merge "Fix a NPE where developer options page crash sometimes." into pi-dev am: d940a680a5
am: aee1191c72

Change-Id: Iac0d2a8551d9c1ba230890dadb1bdf2b6edb12b9
2018-04-30 20:51:39 -07:00
Fan Zhang
ecadd0119d Fix a NPE where developer options page crash sometimes.
Developer options page crash for restricted users because the page
removes all preferences while DashboardFeatureProvider tries to
manipulate preferences on screen.

Added a null check to skip changin prefs in DashboardFeatureProvider
because the pref is going to be removed either way.

Change-Id: Ic83fd0dfb2a906605fb1d992d7b36c2163630e89
Fixes: 78655710
Test: robotests
2018-04-30 16:54:10 -07:00
Doris Ling
4333ac1e2e Merge "Fixes crash in security settings." into pi-dev am: abe44c2674
am: c7494be56e

Change-Id: I06db8956a4cb67aa650b7b32dab1c83130d7a97a
2018-04-25 10:22:36 -07:00
Doris Ling
70206e6ff2 Fixes crash in security settings.
- save the loaded icon drawable to a local var, instead of setting it to
the tile.icon and later reset it, so that we will not run into the issue
that the icon will become null when this is called multiple times.

Change-Id: I0fc73961986cddd97ad1e74b0609ac47d011cc87
Fixes: 78445923
Test: make RunSettingsRoboTests
2018-04-24 16:54:42 -07:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Doris Ling
f2dce9fac2 Update icon for security settings.
- also fix the issue of dynamic tile icon is being cached and not
updated properly.

Change-Id: I9289260340c1cddc4123fda88c366d658a11ddfc
Fixes: 74255242
Test: visual
2018-04-17 14:33:15 -07:00
Fan Zhang
f11c885766 Pre-fixup for nav up button
- Remove SettingsDrawerActivity.EXTRA_SHOW_MENU and force up nav button
  to always show. The button doesn't do anything yet. It just finishes
  current activity.
- Remove dead code about suggestions

Change-Id: I61fa9fefbaa9bced841a05969544b1c824c564ce
Bug: 72337421
Test: rebuild
2018-02-07 10:27:18 -08:00
Doris Ling
a5d0c3e36e Remove suggestion UI v1 codes.
- remove the check for feature flag for suggestion UI v2 and switch to
use the v2 codes.
- remove all code related to v1 of suggestion UI

Fixes: 70573674
Test: make RunSettingsRoboTests

Change-Id: I99ab318c1c0192508a9c5e9e708e86319120d55b
2018-01-31 10:59:40 -08:00
Leif Hendrik Wilden
28dee1f086 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: I70a6e76cc8440547746ecc008c32bd06a7de8161
2018-01-24 12:30:39 -08:00
Leif Wilden
cab0ee611d Revert "Migrate to use instrumentation classes from settingslib."
This reverts commit 1546cca529.

Reason for revert: Broke fingerprint setup flow. b/72267201

Change-Id: I8321265ae64732c526325882ddea51080decddf5
2018-01-22 20:57:36 +00:00
Leif Hendrik Wilden
1546cca529 Migrate to use instrumentation classes from settingslib.
Test: Compiles. Manually tested.
Change-Id: Ie5515bb0fe3e621fc7723a9b04ba23e4bfa9c401
2018-01-18 11:13:24 -08:00
Doris Ling
a213bf0839 Separate suggestions and conditions.
This is the initial change for updating the suggestion cards:
- add a feature flag to swap between the new and current UI
- change suggestions to a standalone dashboard item. It becomes a
  horizontal scroll list that won't collapse/expand.
- the expand/collapse logic now only control the conditions list
- add draft for the new suggestion UI elements, but detail to fine-tune
to match the UI spec will come in following changes.

Bug: 70573674
Test: make RunSettingsRoboTests
Change-Id: I00c901e2598b26a34288fc73fd6031cc26a29ac6
2018-01-17 11:08:53 -08:00
Fan Zhang
361e55bb4c Use proper DashboardFragment APIs for SecuritySettingsV2
Next CL will add tests.

Bug: 32953042
Test: TODO
Change-Id: I0cb0e4eb216d3e9408675486f1cd73ba82d8ca36
2018-01-05 11:20:59 -08:00
Doris Ling
bcb76351b3 Fix ConcurrentModificationException in SummaryLoader.
When the dashboard summary is being initialized, it will rebuild the UI
while the summary loader tries to to go through the tiles to update the
summary. Both is being done on a separate backgroud thread, and it will
run into concurrent modification issue if the thread is being swapped
while one is looping through the list.

Instead of letting clients access the list of tiles directly, add a
getter method in DashboardCategory to get a copy of the list of tiles
for all read-only operations.

Change-Id: I479669abd8d1d0a8ee9a4113d8ad2244da56f4d8
Fixes: 69677575
Test: make RunSettingsRoboTests
2017-11-28 16:43:07 -08:00
Doris Ling
8b14a1a7a6 Change to use the expand button in support lib.
- functionality for hiding portions of the preferences in the preference
screen is added to the support lib. So, changing the settings
implementation to use the feature from the support lib instead.
- remove ProgressiveDisclosureMixin and the related code

Fixes: 63985174
Test: make RunSettingsRoboTests
Change-Id: Ib1d39b2db93d78a56c7adf90abcae5226f9564c2
2017-10-27 13:16:38 -07:00
Doris Ling
c879239238 Add metadata handling for specifying tile order.
- if tile order is set in the metadata, it will be used as preference
order instead of the intent priority specified.

Change-Id: If1a09219ece7bb71fc476aad60dc66d7653dfd28
Fixes: 65172575
Test: make RunSettingsRoboTests
2017-09-18 16:19:05 -07:00
Fan Zhang
18a168239e Index TTS-Settings and dedupe TTS-engine in search result.
Fixes: 63022866
Test: robotests
Change-Id: I5c711e7bafba4e413ee271768c58742be05d8640
2017-08-16 15:46:41 -07:00
Fan Zhang
26a1deffe6 Support dynamic summary and icon for injected tiles
Bug: 63758074
Test: robotests
Change-Id: I2fa27812800c12606a613896ea2aa69dda393944
2017-08-01 16:19:37 -07:00
Doris Ling
631893f582 Change to use new suggestion/condition UI.
Change to always use the new UI that combines the suggestion and conditions,
and remove all codes relating to the old UI.

Bug: 37645754
Bug: 62621808
Test: make RunSettingsRoboTests
Change-Id: I3421a9e5182f6606843392d6fae8b9f07c5f2e46
2017-06-28 11:22:44 -07:00