Commit Graph

60 Commits

Author SHA1 Message Date
Raff Tsai
bf1fa0c2a6 Fix Settings crash
Doesn't unregister contentprovider so that when data changed,
the fragment is destroyed.

Fixes: 127726564
Test: Connect to wifi. Go to Settings -> connected devices ->
      connection preference -> printing -> hp print service -> press
      back. Repeat several times.

Change-Id: I79d1522ce9d91a6bf6b1f982b7687eab1f7896bb
2019-03-08 17:23:38 +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
Philip P. Moltmann
2f4f269264 Redo the empty states in print settings
In the end the UI does not change but the new states:

- Are similar to the "empty" states we use in the print spooler
- Use the system print icon
- Use a translucent background icon which works correctly with dark mode

Test: Looked at all changed Settings pages
Fixes: 115830412
Change-Id: I1f5b005674e7072e989355f01ebd3fdaf56c9355
2018-09-20 17:06:06 -07:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00: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
Fan Zhang
fe93bd9c1e Remove ListView from preference_list_fragment.
As part of it, Use RecyclerView in PrintServiceSettingsFragment, which
still depends on the old preference_list_frag layout.

Also remove some unused pngs

Test: manual

Change-Id: I3189bd0dee5b6a74209eb1e707eb40427c96e312
2018-07-17 15:47:33 -07: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
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
Philip P. Moltmann
578bc45793 Hide unused recylerview to not confuse talkback. am: 6a6db008a9 am: 2664c2331f
am: 5bc6a57729

Change-Id: I934af4a441b19f28a30ea06b74da8df0f270072e
2016-08-30 04:49:55 +00:00
Philip P. Moltmann
6a6db008a9 Hide unused recylerview to not confuse talkback.
Fixes: 31088913
Change-Id: I1394cec881d8a1944004a69bc787e5341f8c9ddc
2016-08-29 18:03:26 +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
Philip P. Moltmann
1ba9127696 Set Fragment title in onCreate.
To allow the accessibility to read the title early enough.

Fixes: 30677578
Change-Id: I2dbd8f0fa7697038cf69e0282ebcb590fbc64cc2
2016-08-08 18:12:36 +00: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
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
3e4c0d8789 Correctly compose activity name of add-printer and print-settings
activity

Previously we were missing to specify the service's package name, hence
we did not have a complete component name.

Bug: 27567031
Change-Id: I88c515a0b8a9defd6329309574aaa8a8e053fddb
2016-03-09 12:42:33 -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
83fb795e8a Use same printer-list template as in the print spooler.
Bug: 26780325
Change-Id: Ic333027aa0d158ad51608565af624b0c1cb10cfa
2016-01-29 10:49:08 -08:00
Chris Wren
9d1bfd1e8d port settings over to new metrics enum
Change-Id: I0b3efd2f4db773ccbc52bfe59ee8eb0dab9584fb
2016-01-27 10:58:58 -05:00
Philip P. Moltmann
be37bdff48 Settings: Handle non-nullness of PrintJobId.unflattenFromString and printer.getName() correctly.
Change-Id: If22acfee7c6a7c21803fe79ff04f33181dd10167
2016-01-21 09:16:25 -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
7fdf34194b Use new getIcon and getMoreInfo api to show more information in Print
Settings

Also fix some text color of the printer list.

Bug: 24135005
Change-Id: I3c387e1277b2a7f09574d42cfe29cc03dd8ef8d5
2015-12-21 09:38:13 -08:00
Julia Reynolds
0c1085e191 Fix print settings crash.
Bug: 25889661
Change-Id: I691b913ce0adc06c29c21ad12d979a0d0e3ad8e7
2015-11-30 13:32:30 -05: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
86846685a0 Finish adjusting the code of PrintServiceSettingsFrament to the changes made
in the layout.

Bug: 25645752
Change-Id: I54401075d4c604850287c7dd101cf4f4b4f21459
2015-11-12 16:11:27 -08: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
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
Makoto Onuki
077a7173c6 Set service name to printer service setting title
Bug 21899319

Change-Id: I940957dd4036eb3386c7f59fbbd3608e7169f415
2015-06-22 13:43:49 -07:00
Chris Wren
8a963babe2 log visibility of views
Depends-On: I5b1dccb5d103ece3112acf38889bae16273b092f
Change-Id: I116aed2bb805f723a5bf2ec9eb94257de0b4a7b5
2015-03-27 13:39:07 -04:00
Raju Yadav
7468085405 IllegalStateException fixed in print service settings
Settings crashed due to IllegalStateException
as OnQueryTextListener refers to an already
detached view. The listener is set to null
on press of home key (onPause).

Change-Id: If9c76fe3ff040c295f0af9c092e8824b9a1371d7
2014-11-25 13:26:42 +01:00
Fabrice Di Meglio
006b2cca13 Fix bug #15897505 Talk back state shows "off" while the talk back is still enabled.
- we were missing the update of the TextView from the SwitchBar so provide a new
setCheckedInternal() method that is doing the TextView and Switch update at the
same time

Change-Id: I6dd9c472a386bb534a58fbf5cf82d9d01fa74f6c
2014-06-27 19:13:19 -07:00
Fabrice Di Meglio
204521626f resolved conflicts for merge of f9360dbc to master
Change-Id: I2e468d83a7ce5200c59f63b4362e7bee10d0a2eb
2014-06-12 15:46:41 -07:00
Fabrice Di Meglio
138ff8c045 Make the SwitchBar appear immediately
- change the way the SwitchBar is shown and hidden
- save its state
- remove the delay transition code

Change-Id: I07260430e6709b42517ca011f6d3c3446a626731
2014-06-12 11:13:23 -07:00
Alan Viverette
2c461006b8 am 6bfec2d6: Remove all dialog icons in Settings
* commit '6bfec2d6b197068dd355bd1742179fe3da07136f':
  Remove all dialog icons in Settings
2014-06-11 13:07:58 +00:00
Alan Viverette
6bfec2d6b1 Remove all dialog icons in Settings
BUG: 15474733
Change-Id: I43ab10a3bbcabdac6109abf80266f1c4b52bf6fb
2014-06-10 13:41:07 -07:00
24a746b958 Update the settings due to a framework API change.
Change-Id: I5248b2a6c9f6d9ac60e9b21a0f5377b19c9a3b36
2014-06-04 13:14:09 -07:00
Fabrice Di Meglio
00b5e6b247 This CL is not working (even after careful testing) but when I tried I was not completely ToT.
Revert "Fix bug #15170508 When I initially load settings, all on/off toggles start in off position then move to on after pane loads"

This reverts commit 1e52db8063.

Change-Id: I73bdfeba4a4b3e993e37cdae1e3733ffe272b9eb
2014-05-28 17:36:37 +00:00
Fabrice Di Meglio
1e52db8063 Fix bug #15170508 When I initially load settings, all on/off toggles start in off position then move to on after pane loads
- refactor all the code that was using the Switch to control it thru the SwitchBar
- start the Switch as View.GONE and make it View.VISIBLE when it is set
as "enabled" or "checked" so that you dont see the Switch transition (it shows
only with it final state)

Change-Id: I382076bf3c819c530b5b2c06ca2429dfb2cdc6bf
2014-05-27 17:01:10 -07:00
Fabrice Di Meglio
38f2b27c0d Fix bug #15109661 Settings crash after tap on back key from print settings
- use onResume() / onPause() for adding / removing the SwitchChangeListener

Change-Id: Ia3a4ff57075d2668e446df4f4f09e4593cc34761
2014-05-20 12:26:16 -07:00
Fabrice Di Meglio
7ba17ab12c Use SwitchBar for Print Settings
- follow up CL to 4193776698

Related to bug #14898161 On/Off switches must move down from Action Bar

Change-Id: Ife4990a52ef282563267dc0bff6d3a7f354b0bd0
2014-05-15 19:56:57 -07:00
Fabrice Di Meglio
63609c58a0 Rename SettingsUtils to PrintSettingsUtils
Change-Id: I67e9222265f6326b399de3779f2210e202777ecd
2014-04-21 15:58:41 -07:00
Fabrice Di Meglio
ede1435518 Make all the Settings Switches appear again
- use the ActionBar Theme context when creating the Switch for
getting the correct Theming

Change-Id: Ic3701c53662b0f245c7149b119de8bb5cbaae232
2014-04-18 16:49:35 -07:00
Fabrice Di Meglio
82de8707af Fix Switch button creation for PrintService
- setup the ActionBar switch in the onStart()

Change-Id: I92d8bb34dd7925da79a10fe01790131d22f7d0d8
2014-04-08 18:58:33 -07:00
Fabrice Di Meglio
5c2d723723 Code cleaning for Printing Settings
- remove non needed code

Change-Id: I18a3992d66721dbeba6870aa2834e1c717640a15
2014-02-13 19:00:38 -08:00
Fabrice Di Meglio
10afdb82ac There are several painful issues with the initial CL. Doing a revert for now and will rework this.
Revert "Fix bug #12939786 BACK should go back into the Fragments BackStack and finally to Overview ...and then exit the Settings App"

This reverts commit 4cc95a53c2.

Change-Id: Iaa21d4771d0b004eff3d8e68b91b546a633d8f23
2014-02-11 19:50:56 +00:00
Fabrice Di Meglio
4cc95a53c2 Fix bug #12939786 BACK should go back into the Fragments BackStack and finally to Overview
...and then exit the Settings App

- fix the way we manage the Fragment BackStack
- revert back ChooseLockGeneric to be a PreferenceActivity

Change-Id: I3c366b4be606e2e211facd0299b9a2de5cc6ea79
2014-02-10 16:07:50 -08:00
Fabrice Di Meglio
263bcc8b73 Use Drawer in Settings app
- get rid of PreferenceActivity as much as we can and use fragments instead
- add Drawer widget
- add Dashboard high level entry into the Drawer (but this is work in progress and would be done in another CL)
- add bypass of fragment's Header  validation when launched from the Drawer but *force* validation if external
call thru an Intent

Be aware that WifiPickerActivity should remain for now a PreferenceActivity. It is used by SetupWizard and should
not trigger running the SettingsActivity's header building code. SetupWizard is a Home during the provisionnig process
and then deactivate itself as a Home but would make the Home header to appear in the Drawer (because momentarily we
would have two Home).

Also, verified that:

- the WiFi settings still work when called from SetupWizard
- when you have multiple Launchers, the Home header will appear in the list of Headers in the Drawer

Change-Id: I407a5e0fdd843ad7615d3d511c416a44e3d97c90
2014-02-03 16:36:46 -08:00
Svetoslav
7dfacf5f8c resolved conflicts for merge of 372cd6ab to master
Change-Id: I9232fbe01926436e8ad5c6c7e63ce95fbe842ccb
2013-10-08 17:42:25 -07:00
Svetoslav
39392ef9b0 Fix a crash in the print service settigns.
When the search view is attached and detached we announce that
 for accessibility. The trouble is that if the activity is being
 torn down we are trying to access resources from a fragment that
 is detached and the qcrash occurs. This change does not try to
 access resources if the activity is finishing and also we do not
 load resource strings if accessibility is not enabled.

bug:11127814

Change-Id: If3e97b6e94687775386a43c8fa54fd45140306eb
2013-10-08 12:08:18 -07:00