Commit Graph

31 Commits

Author SHA1 Message Date
Bonian Chen
5980b80adc [Settings] Remove PhoneStateIntentReceiver
1. Replace PhoneStateIntentReceiver by adopting PhoneStateListener
2. Replace TelephonyProperties.in_ecm_mode() by
TelephonyManager.getEmergencyCallbackMode()

Bug: 144331663
Test: Manual
make RunSettingsRoboTests -j ROBOTEST_FILTER=AirplaneModePreferenceControllerTest

Change-Id: I95c80d9857c9ca44deede7105e1c200d729fefd3
2019-11-14 04:37:12 +00:00
Inseob Kim
4db955ad57 Schematize Telephony System Properties
Properties accessed across partitions are now schematized and will
become APIs to make explicit interfaces among partitions.

Bug: 117924132
Bug: 141246285
Test: lunch blueline-userdebug; m checkbuild
Change-Id: Ic4f16a4475eb2870dcaeec41b38de90a0f6473bb
2019-11-01 13:10:51 +09:00
Fan Zhang
ec81d6121e Override 2 getSliceUri() instance to return platform slice
Bug: 126222433
Test: robotest
Change-Id: I3f9c8202d9b75b24b80ebcf385abc95f8df851e2
2019-05-30 16:50:43 -07:00
Fan Zhang
7db118e367 Mass clean up: don't cast class when not needed.
Bug: none
Test: rebuild
Change-Id: Ie3f58a3d5ae99ade28a33dcac80c18de90d4d5b2
2019-02-14 12:26:09 -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
Matt Fritze
90899e08f0 First commit for settings panels
Establish the Activity which hosts Settings panels through the
PanelFragment. The Activity's purpose is to validate the intent
data coming in, including:
- Called with startActivityForResult (so we can log who is calling)
- Intent has the proper intent extra to link to a Panel

The fragment takes the Panelable data and builds a Settings Panel.
Each panel will have:
- Title
- List of Slices
- Link to underlying content

The Panelable interface is created to provide all of those datums, and
the new FetureProvider provides the Panelables by linking them with
keys. The keys will eventually become public APIs with CTS tests.For
now, we store them locally.

I included an exmaple panel, the InternetConnectivityPanel which
currently shows Wifi and Airplane mode.

Screenshot: https://screenshot.googleplex.com/c6sv7ZzQ5OJ
Bug: 117804089
Test: make -j40 RunSettingsRobotest
Test: Manual app
Change-Id: I1932f7179cc32088acd6413a736901ddf9651892
2018-11-26 15:26:02 -08: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
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
Matthew Fritze
8f36eb8cfb Update airplane mode key to match framework constant
Change pref key for airplane mode to "airplane_mode" to match the
constant declared in SettingsSlicesContract.

Bug: 80106671
Test: robotests
Change-Id: I898befffbdafc3004fc127414edd04f60ff2554e
2018-05-22 18:51:11 -07:00
Matthew Fritze
bf1f5b5813 Add isSliceable API to BasePrefController
Only support explicitly approved Settings Slices,
dictated by controllers which return true for the new
method isSliceable.

Updating the supported settings to a whitelist means that
the method to return all available slices must be updated,
and checking slicability when we index slices.

Test: robotests
Bug: 79779103
Change-Id: Ib2b9690cdd0036b5cc4a1cb846c52bce7c824ab9
2018-05-22 11:06:42 -07:00
Matthew Fritze
f87a1f3f41 Establish permanently unavailable settings
Distinguish between settings which are permanently unavailable on
the device, and temporarily unavailable. This enables us to restrict
which setting slices are exposed in onSliceGetDescendants.

The primary changes in this CL are renaming:
"DISABLED_UNSUPPORTED" -> "UNSUPPORTED_ON_DEVICE"
to be more clear the the setting will cannot be accessed on the device, and,
adding a new enum to encapsulate settings which are currently unavailable, but
could be enabled in the future.

Also remove UNAVAILABLE_UNKNOWN. Devs should never need this enum.

Bug: 78910582
Bug: 79245656
Test: robotests
Change-Id: I58821a6cfd6134b3b351657b6edf5f74ead00643
2018-05-09 08:36:59 -07:00
Fan Zhang
5f492647c8 Merge "Modified the AirplaneModePreferenceController for slice" into pi-dev am: 62cd5f7f0f
am: 169d6a9cd6

Change-Id: Ie5aada5dc0993e097ad5215895bda86cebab2f87
2018-04-26 16:49:32 -07:00
sunnyshao
c624663312 Modified the AirplaneModePreferenceController for slice
- Updated the AirplaneModePreferenceController for slice feature
- Updated the AirplaneModeEnabler for slice feature

Fixes: 78645242
Test: manual
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.network
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.core
      make RunSettingsRoboTests -j ROBOTEST_FILTER=com.android.settings.dashboard
      atest UniquePreferenceTest SettingsGatewayTest

Change-Id: I4afbc666f916570d648ad2b33ebb25924024e9f1
2018-04-26 14:49:04 -07:00
Jason Monk
0d3322a57b Merge "Push full slice index to device index" into pi-dev am: 3d29ca2893
am: 2332aad2a6

Change-Id: I3563eb7ed2ab93b35b1a950d89ca2466abaa59e3
2018-04-26 14:26:38 -07:00
Jason Monk
fcd5f0f1aa Push full slice index to device index
Test: make RunSettingsRoboTests
Bug: 74555610
Change-Id: I3f0aa1218e1d7e736dc918d83e76423fa81ac6ab
2018-04-26 11:16:04 -04:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
CY Cheng
fee4807dc0 Refactor airplane mode preference controller.
- Convert inheritance from AbstractPreferenceController to
TogglePreferenceController.
- Register AirplaneModePreferenceController in XML.
- Decouple AirplaneModeEnabler with preference, leave the UI be
controled by PreferenceController.
- Add RoboTests test cases for AirplaneModePreferenceController.

Fixes: 67997339
Test: RunSettingsRoboTests
Change-Id: I7398943ed51345e014ee7aa774bfae1ca28632f1
2018-04-12 14:10:35 +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
Ben Lin
e5e8f0368f Add ability to show/hide airplane toggle.
This introduces a new boolean flag:
config_show_toggle_airplane

Which when set to false, will hide the airplane mode toggle in network &
internet.

Bug: 69813881
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=AirplaneModePreferenceControllerTest

Change-Id: I2cf682bf78231040eba5573fbcb55a65be2a13df
2018-01-16 18:23:52 +00:00
Ben Lin
6c216c06f5 Fix crash for AirplaneModePreferenceController when not available.
Bug: 70043779
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=AirplaneModePreferenceControllerTest passes 1/1.
Change-Id: Ide9e1dda0589414467a4952e67d2e4e39e90845a
2017-12-01 15:39:54 -08:00
Fan Zhang
a72620b67b Use setVisible instead of removePreference everywhere.
Change-Id: I2e8084b23d3cb2c0a31a38c01716fc76236734ea
Fixes: 68956750
Test: robotests
2017-11-09 13:22:36 -08:00
Andrew Sapperstein
fba88cc7c0 Merge "Make AirplaneModePrefController.isAvailable static." into oc-dr1-dev
am: 5b67e453bf

Change-Id: I7454c59679ad05711f8923b35138fd27b6d36061
2017-07-25 23:34:03 +00:00
Andrew Sapperstein
c8c42838ca Make AirplaneModePrefController.isAvailable static.
Allows calling without instantiating the pref controller.
Also some minor cleanup of MobileNetworkPrefController.

Bug: 62022517
Test: robotests
Change-Id: I34ff5d3729d06158bff3cc125de4c114bf4861d5
2017-07-24 13:42:19 -07:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
Juan Lang
777ed2535a Depend on SettingsLib's version of lifecycle and FooterMixin.
The implementations have been imported into SettingsLib. Setting's copy
can now be removed, which this change also does.

Test: Manually check battery status, which uses FooterMixin, looks OK.
make RunSettingsLibRobotTests && make RunSettingsRoboTests
     && make RunSettingsGoogleRoboTests
Change-Id: I6539605fdad80d156ff5ff249e68df4a1c412067
2017-05-12 11:10:46 -07:00
Fan Zhang
242da31179 Fix logging spam in DashboardFragment.
When updating preferences managed through PreferenceController, the
fragment should skip prefs that are not available.

Bug: 32255863
Test: RunSettingsRoboTests
Change-Id: I2f9b6ddf8c78d40068dc18f07e60672dcba4474a
2016-10-25 17:14:47 -07:00
Fan Zhang
db1112a221 Add progressive disclsoure
- Add a ProgressiveDisclosureMixin that contains all logic for collapse
  preference list when it's too long
- Refactored PreferenceController's updateState to take a preference
  instead of PreferenceScreen, because with progressive disclosure the
  preference can either be in screen or the mixin. DashboardFragment is
  responsible finding the preference before passing it to controller.

Bug: 32255863
Test: RunSettingsRoboTests

Change-Id: I6713abd61c954ce12732902e5b3ca4d4c0b1563e
2016-10-18 16:57:11 -07:00
Fan Zhang
7f1a4b5891 Add PreferenceControllers to Network page.
- Also made tiles refresh more efficient: when category changes, only
  refresh dynamic tiles. Static tiles from xml will not change due to
  category change.

Bug: 31799836
Test: RunSettingsRoboTests
Change-Id: I1e4c85f2c122c65ec99729e43a66c80acdd863c8
2016-10-12 15:04:39 -07:00