Commit Graph

74 Commits

Author SHA1 Message Date
Chaohui Wang
3362e5d14a Refactor PrintSettings (1/n)
Add PrintRepository for display Print services.

Bug: 320076351
Flag: com.android.settings.flags.refactor_print_settings
Test: manual
Test: unit test
Change-Id: I1ea52508d504161675eeffeb3ec077caa641cb2c
2024-06-05 13:14:08 +00:00
Weng Su
4c1dd91695 Restrict Printing Settings
- Don't show Printing Settings if the user is restricted by UserManager.DISALLOW_PRINTING

Bug: 269122009
Test: manual test
atest -c PrintSettingsFragmentTest

Change-Id: I15db778ebc4de3c8a76505043fab1ee02db3f290
2023-05-18 18:40:48 +08:00
Edgar Wang
fc02ce1c20 Refactor AppPreference and AppSwitchPreference
- Move AppSwitchPreference
- Remove FeatureflagPreference summary

Bug: 176815722
Test: robotest
Change-Id: Id337097f237ac9ca6dfa01665df61b1258dc24f2
2021-01-05 18:27:08 +00:00
Raff Tsai
966fa01423 Use SettingsLib Indexable
- Use SettingsLib Indexable
- Directly use resource id in getPreferenceScreenResId

Bug: 135053028
Test: roboletric
Change-Id: I05f493b55e8b6e2091301e9231ba5615215618e6
2019-09-25 18:24:56 +08:00
Raff Tsai
ac3e0d0988 Directly use BaseIndexableProvider
- Add function getXmlResourceId, Fragments don't need to write
xml resource id twice.
- Remove getPreferenceControllers from Indexable.java. Because it will
move to SettingsLib later for other apps which don't need this function

Bug: 135053028
Test: robolectric
Change-Id: I1e74519aecdea3dde64a5aea79f08d766dbc0003
2019-09-24 00:35:52 +08:00
Raff Tsai
1f30b1cd67 Merge similar BaseSearchIndexProvider code together
Bug: 135053028
Test: robolectric, check search_index.db contains the same items
Change-Id: If3c18a170b0e671690df1fdf26e59a421d2c48cd
2019-09-12 11:09:09 +08:00
Amin Shaikh
3f1de20c7e Fix themed settings icons.
- Added android prefix for homeAsUpIndicator attribute
- Override ic_arrow_down_24dp from androidx
- Remove ic_lock drawable overlay
- Update date and time icon
- Dedupe ic_menu_add and ic_add_24dp

Bug: 131346125
Test: mp settings;
Change-Id: I7223249f2adccc5569a37e8b68cae5499e7c7620
2019-05-03 17:02:46 +00: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
754f737c2c Move AppPreference to settingslib, and change imports.
Bug: 116364655
Test: robotests
Change-Id: I313272737dc7c068c47abf8ea021de7d2bea0a25
2018-09-25 09:51:19 -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
Jason Chiu
104e04dab4 Delegate PrintServicesLoader to the framework's one
1. Remove the duplicated PrintServicesLoader in Settings
2. Make a androidx.loader in Settings and internally just delegate all calls to the real PrintServicesLoader
3. Get the result from the real loader

Test: manual
Fixes: 111581651
Change-Id: I2a9b3653f5c68f8383a468cd16ef5f7c3fd4bc3a
2018-07-20 14:25:00 +08:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors.

Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
2018-07-11 18:24:51 -07:00
tmfang
99cc23d0da Settings Fragment Migration (Change imports)
This commit *only* changes imports and optimize imports.
We don't do anything else.

This patch can't compile pass and run test case.
We will update other patches to fix these problem.

Change list.

1. import android.app.Fragment; ->
   import androidx.fragment.app.Fragment;
2. import android.app.DialogFragment; ->
   import androidx.fragment.app.DialogFragment;
3. import android.app.ListFragment; ->
   import androidx.fragment.app.ListFragment;
4. import android.app.LoaderManager; ->
   import androidx.loader.app.LoaderManager;
5. import android.content.AsyncTaskLoader; ->
   import androidx.loader.content.AsyncTaskLoader;
6. import android.content.Loader; ->
   import androidx.loader.content.Loader;
7. import android.app.FragmentTransaction; ->
   import androidx.fragment.app.FragmentTransaction;
8. import android.app.FragmentManager; ->
   import androidx.fragment.app.FragmentManager;
9. import android.app.LoaderManager.LoaderCallbacks; ->
    import androidx.loader.app.LoaderManager.LoaderCallbacks;

Bug: 110259478
Test: Can't test it.
Change-Id: I0a3f98fff34a3494a839c3c42aeabcec3df2c8b3
2018-07-11 18:23:51 -07:00
Fan Zhang
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Antony Sargent
5a6c3fe645 Make icon size on Printing settings match the rest of settings
The icons on this page were being displayed at 48dp because we were
using a generic Preference element, instead of the custom settings
AppPreference which we use in lots of other places in settings for
displaying app entries in a list (and has a custom layout that ends up
with 32dp icons).

Fixes: 78654919
Test: manual (go to Settings -> Connected devices -> Connection
preferences -> Printing)

Change-Id: Icf21ab6b41fc00936cd58f3342a8c5502c6dd87f
2018-06-06 16:35:52 -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
Tony Mantler
0fcd6cbaa8 Autogenerate SearchIndexableResources subclass
Bug: 77148954
Test: RunSettingsLibRoboTests RunSettingsRoboTests RunSettingsGoogleRoboTests RunArcSettingsRoboTests
Change-Id: I842c42c55014c3310070ef22bd4f0d9a70dfd804
2018-04-03 10:26:55 -07:00
Fan Zhang
2edbaa7062 Change print setting from a dynamic tile to static pref
...because dynamic tile is a lot harder to index correctly.

- Removed metadata that makes PrintSettings a dynamic tile.
- Added PrintSettings into connected_device xml.
- Added a new PreferenceController - all summary updating logic is
  copied from PrintSettingsFragment

Change-Id: I41e7c9d23e97ecd5a043ac7c33f2d404260c92e7
Fixes: 73128944
Test: robotests
2018-02-12 15:19:43 -08:00
Fan Zhang
e0b0e9f902 Refactor help menu stuff into a controller
This is a clean up to action bar menu item pattern, we will use the same
pattern to build search icon on all pages in a later change.

Bug: 68814716
Test: robotests
Change-Id: Iedd3ec263e8ccb63ed75ec7a95b28c00878b1de4
2017-11-29 15:51:04 -08:00
Fan Zhang
7d5c9ace64 Add test and fix null keys in search providers.
- Add keys to some screens.
- Remove dynamic saved network/turst agent from search provider.
- Remove dynamic print services from printsettings.

Bug: 69384409
Test: atest
Change-Id: I62dce27d52585badb2a8953a05084e35dbae2f7d
2017-11-16 12:57:45 -08:00
Philip P. Moltmann
c16600066a Print icons are now vector graphics.
Test: Looked at screens in setting that show this icon
Bug: 69175097
Change-Id: I06c4d37c7c3e641e83fa81d59b651c581e94a9f1
2017-11-13 14:13:17 -08:00
Fan Zhang
206b774f79 Add # of active print jobs back to print setting summary
Change-Id: Iefdde7d9e5f13a892bceff7c676c4c7b9aa8d206
Fix: 37640842
Test: make RunSettingsRoboTests
2017-05-26 16:45:14 -07:00
Doris Ling
c5f4120484 Update summary for Connected devices->Printing.
The summary text now shows the number of enabled print services. Update
the flag to only select enabled service from PrintManager.

Bug: 36234108
Test: make RunSettingsRoboTests
Change-Id: I81e1584182edd1f290faa941c7d3ee711a9d67b8
2017-04-03 13:42:26 -07:00
Fan Zhang
01ece62faa Update print setting summary to show number of services
-Also some minor cleanup in print setting fragment (create pref using
correct context)

Change-Id: Ic05027ee53fd318da6ccd38c9ed98ce10ca49ba8
Fix: 36234108
Test: make RunSettingsRoboTests
2017-03-22 18:27:19 -07:00
Fan Zhang
e05b352758 Misc search summary text updates.
- Remove static text from default app summaries.They will be filled
dynamically at runtime, so we don't need the static ones here.
- Remove summaryOn/summaryOff strings from a few fragments. Search
framework does not need them.

Change-Id: I165766073ba70aceead88c3df02d62f3700e4592
Fix: 36474747
Fix: 34573952
Test: run existing tests
2017-03-21 14:52:40 -07:00
Tamas Berghammer
265d3c2a0c Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:17 +00:00
Fan Zhang
6507613ebc Log visibility change for all fragments.
Bug: 30681771
Test: SettingsUnitTests

Refactor visibility logging from InstrumentedFragment into a mixin. And
apply mixin in remaining fragments.

Change-Id: Ibbb59904336254a3e4bb9e8c7d0b36e5a6bc2622
2016-08-18 14:04:13 -07:00
Fan Zhang
10ad09b658 Clean up some unnecessary inheritance.
Bug: 30681529
Change-Id: I84fa1085cc18b167d506dec3b3054d9f74d3d3e7
2016-08-16 14:53:48 -07:00
Philip P. Moltmann
23176395a5 Setup up print settings fragments in onCreateView instead of onCreate.
Otherwise some of the layout is not yet set up.

Fixes: 29764546
Change-Id: Ia0716dd0603d66e8bf68494e426756bd553f1afd
2016-06-27 21:07:07 +00:00
Philip P. Moltmann
7978909120 Do not set order for print services settings.
What happened before was that negative number turned out to be order
behind ORDER_LAST.

Change-Id: I714f623a2b1be06dde86ae7f36b39c64006203f2
2016-05-04 09:44:06 -07:00
Philip P. Moltmann
eb01628ba8 Update print jobs appropriately in the print settings.
- Always use a fresh print job as once the print job goes away it cannot
  be read. Before we were stuck with the last state which might not been
  the last state
- make loaders relative to fragment to avoid loader id duplications with
  other ids of the activity.

Fixes: 28315242
Change-Id: I57eeb64b44b5d77b2092c22b175407131f7baf97
2016-04-21 15:16:05 -07:00
Philip P. Moltmann
7833d183e7 Deal with the case that no print services are installed.
Bug: 27530312
Change-Id: Idd709e66d72efcca4928b471f138f8be66e7ab00
2016-03-07 15:32:28 -08:00
Philip P. Moltmann
d9779db8c9 Make Print Settings use the new PrintManager.getPrintServices loader
This makes sure that all data always stays up to date.

printer_dropdown_item.xml:
- Reduce the amount of overriden properties

PrintServiceSettingsFragment:
- Instead receiving most data from PrintSettingsFragment have own loader
  and keep data up to date
- Also the updating of the print service state now has a dedicated
  PrintManager call instead of relying of the Settings-ContentObserver
  to transport this information. No more race-conditions, whohoo!

DynamicIndexableContentMonitor:
- To not rewrite too much code the update logic has to live here but the
  reading of the actual data is in PrintSettingsFragment.

Change-Id: I60715cda8952565d7f68cb24fb7da61a37085887
2016-03-07 09:32:55 -08:00
Philip P. Moltmann
24264eb250 Do not count print jobs if printing is not available.
Bug: 27339883
Change-Id: I0b0761917798581e831e8b2692fdc9c5fefb1155
2016-02-25 13:07:26 -08:00
Tony Mak
78d1ca1c2a Merge "Default apps setting for managed profile" 2016-01-27 17:17:44 +00:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Tony Mak
32ccffc07c Default apps setting for managed profile
1. Print settings already support managed profile. Follow the UI of that.
ProfileSettingsPreferenceFragment is created to act as the base class
for per-profile setting.

2. Only show browser and dialer default setting in managed profile.

BUG=26707733

Change-Id: I20d00203e14db58ec03638f692dd83a1bd50c59c
2016-01-27 14:01:16 +00:00
Philip P. Moltmann
43335444ef Small corrections to the code that generates the print summary in the settings.
- Optimize when the listener is active and rely on it to be cleaned up
  automatically
- Only count print jobs that should be shown (i.e. not ones that are
  already finished.)

Change-Id: Idba995f1036e736f47ca7402d493210600eae91c
2016-01-07 14:22:20 -08:00
Philip P. Moltmann
fae4a88530 Use disabled print services instead of enabled print services in print settings.
Change-Id: I32bc8a8dda86f92b180f043a98b304fe676db98c
2016-01-07 09:30:43 -08:00
Philip P. Moltmann
738e6db7b8 Display number of print jobs as summary in settings app.
Change-Id: I4309c67fb62171c7b4f0f5fdd86454f155a3ec01
2016-01-07 08:28:18 -08:00
Philip P. Moltmann
99f0bd4aa6 Change onResume -> onStart in the print settings to update even paused activities.
Change-Id: Ie28de2cd3ba02c3f19d11c61b3dbbce5d33ddb5a
2015-11-25 16:13:01 -08:00
Philip P. Moltmann
68d6e32b65 Merge "Remove warning message when enabling a serive and enable new services" 2015-11-09 18:38:22 +00:00
Philip P. Moltmann
849c05f342 Remove warning message when enabling a serive and enable new services
The warning message will be moved to the print spooler and displayed
when the user issues the first print job to the service.

Change-Id: I121ad0b46e5b3e25e68db4cc67a59fbaf15c70c3
Bug: 24135353
2015-11-06 17:13:06 -08:00
Jason Monk
af00109242 Settings Drawer: Support multi-user changes
Change-Id: I3a6e481ca18794bf1ed3bc9dc0382deacfcf81f4
2015-11-04 13:16:18 -05:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Makoto Onuki
0ec96fe64c Promote "add service" from menu to list item
Also show the app icon for each service.

Bug 19914125

Change-Id: I592c526746a3ec9f67e8e8a6c6f1530e7724e310
2015-06-11 14:26:29 -07:00
Maurice Lam
28c3f6bb71 [WifiSettings] Add progress bar when scanning
Add a progress bar when the Wi-Fi screen is in a transient state,
like enabling, disabling Wi-Fi and scanning for network. This change
sets the progress bar as a pinned header at the top of the activity.

The pinned header container needs to be match parent so that the
progress bar can occupy the full width of the screen. If the header
view doesn't want to fill the width, then the header view *inside*
the container should be wrap_content.

Added an overloaded setPinnedHeader method that takes a layout
resource ID, and returns the view to the caller. This way the
inflater can set the parent property so that layout params will not
be ignored.

Bug: 17389577
Change-Id: I18d0eb7c72ad31d1c4b35a54789016c32c81fb93
2015-04-29 22:38:22 -07:00
Jason Monk
23acc2bb8a Allow help to be defined to intent uri
Allow help uris to be either an intent uri or as uri (as they were
before). Also add a default help uri, and specific helps for several
screens.

Bug: 15475009
Change-Id: Iff982892973f01d32ff61ea88d4844e9a7153500
2015-04-14 15:43:20 -04:00
Chris Wren
8a963babe2 log visibility of views
Depends-On: I5b1dccb5d103ece3112acf38889bae16273b092f
Change-Id: I116aed2bb805f723a5bf2ec9eb94257de0b4a7b5
2015-03-27 13:39:07 -04:00
Jason Monk
2ebc8a0169 Allow system apps to add to settings dashboard
Allow system apps to add a tile to the top level of settings that
links to an activity through adding a filter for a specific action.
Determine the info for the tile based off manifest info for the
activity. Also allow the same for managed profiles, but show a dialog
in between to select which profile.

The category in which the item is to be placed must be in meta-data.
The icon and title can be specified through meta-data as well or
if unspecified the activity's label and icon will be used.

Also added an optional <external-tiles> tag to the dashboard
category xml, this allows Settings to put external tiles
in the middle of some categories (Personal does this).

Bug: 19443117
Change-Id: Idc9938d1549d181103a3030a8784b527215a8399
2015-03-25 11:11:36 -04:00