Commit Graph

65 Commits

Author SHA1 Message Date
Johnson Lu
43f0d13e1d Implement host flow of WiFi sharing feature
Add share button and authentication screen to confirm credentials
(pin, pattern or password) for the current user of the device.

Bug: 120517242
Test: make RunSettingsRoboTests
Change-Id: Id79833db0d582c401f1371ff60429e42ce1990e0
2018-12-11 09:44:27 +08:00
tmfang
8ad18fb3eb Use SettingsLib's ActionButtonsPreference
Since we moved old ActionButtonPreference into
SettingsLib, we need to update new imports and
declaration in Settings source code.

Test: robotest, manual test
Bug: 120005054
Change-Id: I1e3514ba68a856071c81534d54c99c3d1a11a8ca
2018-12-03 15:12:41 +00:00
Salvador Martinez
807d3d98ec Fix Wifi-Detail page colors
There were some hardcoded colors in this page that should have
been using colorControlNormal. This CL just updates it to use those.

Test: Visual inspection
Fixes: 37628554
Change-Id: I431744e7613eeb0ac751cf1505bcf2ef9e19d95d
2018-11-29 11:17:38 -08:00
Doris Ling
52552ab0ab Remove WifiDetailPreference.
- use the standard Preference instead to display the wifi details, and
enable sumary copying for the preferences under Wifi Network details.

Change-Id: I5371ac667d9239276f6492896123d617f5193871
Fixes: 62493282
Test: make RunSettingsRoboTests
2018-11-28 15:06:58 -08:00
tmfang
dce94bb237 Use SettingsLib's LayoutPreference
- Remove LayoutPreference in Settings source code.
- Remove unused style, layout
- Replace old imports to com.android.settingslib.widget.LayoutPreference
- Replace old XML tag to com.android.settingslib.widget.LayoutPreference

Test: robotest, manual test
Bug: 120005054
Change-Id: I9ae1ae14a16f443e11ac5d75b6038c7c5e253844
2018-11-27 13:12:53 +08:00
tmfang
5c7f4de999 Remove setButtonPositive method
Since new UI design only exist two button in layout,
we don't need these methods anymore.

Test: robotest
Bug: 116346008
Change-Id: If2e8f7dddb9c13e480438f36fe3c5d6affa4e9ff
2018-11-16 14:33:16 +08:00
tmfang
3adb74ea60 Apply new action button visual design
- Add some icon resources.
- Add icon for each button in action button preference.
- Update "Enable" and "Disable" string to "Install" and "uninstall".
- Remove unused string.
- Add divider between entity header and action buttons.

Test: visual, robotest
Fixes: 119203074
Bug: 116346008
Change-Id: Ib8d7aeb2943d39d257e977b84f165f002bf47559
2018-11-16 14:33:03 +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
Fan Zhang
2ff710a911 Move logic from SavedAccessPoint fragment to controller
Change-Id: Ic54e536f97490cec1746fa58c42ec55b60d17f0e
Fixes: 64806699
Test: robotests
2018-07-19 14:49:14 -07:00
Fan Zhang
176ccd0c35 Clean up: fix incorrect @VisibleForTesting imports
Test: rebuild and robotests
Change-Id: I33d7ee1c0622c01f592920baaf01d44ad19d9a13
2018-07-13 13:08:53 -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
Jason Chang
a76797e756 [SettingsLib] Update Utils.getColorAccent() and Utils.getColorError() to return ColorStateLists instead of colors.
Update Utils.getColorAccent() and Utils.getColorError() to return ColorStateLists instead of colors and change every callers entry.

Bug: 78215054
Test: manually test for UI
Change-Id: Ie201aee439bd9e8337eca989b4cdc836a6e8e917
2018-05-21 17:23:41 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Fan Zhang
01cfb9d8c5 Remove wrapper for ConnectionManager/IPackageManager
Bug: 76167422
Test: robotests
Change-Id: I5f051b0ce58b97a3cfd5d4bae469463dcd6d83ac
2018-04-02 17:09:10 -07:00
Adam Newman
c6b4f3d92c Enable launching captive portal directly
Whenever a user has connected to a captive portal network, split the
ConnectedAccessPointPreference to allow directly signing into the
captive portal or modifying the network's settings. When in any other
network state, use the old behavior of a single tappable preference that
takes the user to settings.

Bug: 63929546
Bug: 68031656
Test: make RunSettingsRoboTests
Test: manual by connecting to Captive Portal and normal WiFi networks.

Change-Id: I444202a12138d90c94bda94945c121c8c0810536
(cherry picked from commit 7577624db7)
2018-03-15 21:05:25 +00: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
TreeHugger Robot
e3f187a4a9 Merge "Revert "Migrate to use instrumentation classes from settingslib."" 2018-01-23 01:58:18 +00: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
TreeHugger Robot
5534485c45 Merge "Remove reference to missing string." 2018-01-22 20:21:48 +00:00
Salvador Martinez
b9d8a97b78 Remove reference to missing string.
A support string was being used by non-support xml. These references
have been replaced with new ones so that things don't break.

Test: Robotests still pass
Change-Id: I5574aedca110b9795a68c2947be0a866bb21cb63
Fixes: 71858657
2018-01-22 10:09:09 -08: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
Pavel Grafov
d429225640 Block editing of locked down wifi network from details page.
Test: make ROBOTEST_FILTER=WifiDetailPreferenceControllerTest RunSettingsRoboTests
Bug: 68990370
Change-Id: Idceb064486afd93bc8b2f52d605a788520de8e56
2017-11-17 18:11:25 +00:00
Doris Ling
dee1a22c45 Consolidate all wrappers used for testing.
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.

Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
2017-09-14 18:24:49 -07:00
TreeHugger Robot
e71fa15fe2 Merge "Add modify button to WifiNetworkDetailsFragment." 2017-09-12 19:35:29 +00:00
Erik Kline
c8e912e5c4 Merge "Include IPv6 DNS servers in wifi details" into oc-mr1-dev am: 1b62d99433
am: 775807f422

Change-Id: I55fbd611fee9f17215412a76b480cdee96f62b32
2017-09-11 05:04:28 +00:00
Erik Kline
9adc588749 Include IPv6 DNS servers in wifi details
Test: as follows
    - built
    - flashed
    - booted
    - export ROBOTEST_FILTER=WifiDetailPreferenceControllerTest \
          make -j RunSettingsRoboTests
      RunSettingsRoboTests:
      RunSettingsRoboTests: Time: 19.821
      RunSettingsRoboTests:
      RunSettingsRoboTests: OK (37 tests)
      RunSettingsRoboTests:
    - make -j RunSettingsRoboTests
      RunSettingsRoboTests: ...........................
      RunSettingsRoboTests: Time: 424.847
      RunSettingsRoboTests:
      RunSettingsRoboTests: OK (2250 tests)
      RunSettingsRoboTests:

Bug: 65037256
Bug: 65467586

Change-Id: Icd3d09aa35c04101c41e2521b48e64f28f69ae29
2017-09-11 11:24:45 +09:00
Eric Schwarzenbach
5a7e46dd80 Add modify button to WifiNetworkDetailsFragment.
Adds pencil icon to Wifi Detail action bar to modify the network.
Modifies package/public visibility to allow the detail package to
use the WifiDialog. Listens for changes in WifiConfigurations to
propagate changes to the UI in WifiNetworkDetailsFragment.

Changes WifiNetworkDetail preference launch to conform to pattern
of other Settings apps. Removes unused WifiDetailActionBarObserver.

Bug: 36483704, 37082355
Test: make -j40 RunSettingsRoboTests
Change-Id: Ie9dc1892eaefdfad4a6bd7040bfc5dbf6236cfb4
2017-09-08 13:39:22 -07:00
Charles He
0a72c23393 Merge "Enforce wifi config lockdown on details page." into oc-mr1-dev am: 10adff1163
am: e7cf5e6221

Change-Id: I356a58cadd3e19e61d9585f08e47c9d4cdcf4318
2017-09-06 16:12:08 +00:00
Charles He
289af93896 Enforce wifi config lockdown on details page.
Fixes the bug that, on the new WifiDetailPreference page, the "Forget"
button is not disabled properly for wifi configs created and protected
by DevicePolicyManger.

Robolectric test to follow in a separate CL.

Test: manual, by locking down wifi config with TestDPC
Test: make RunSettingsRoboTests
Bug: 64971700
Bug: 65396674
Change-Id: I27740eabd5eb94415e4258c9c80f91df2d9ab476
2017-09-06 15:58:14 +00:00
Sundeep Ghuman
3430553a2e Separate multiple DNS addresses with newlines. am: 2716e841be
am: cf37a26795

Change-Id: I61bcfc20d43133c12fb8fe78d7bd968af1ee59eb
2017-08-29 04:57:47 +00:00
Sundeep Ghuman
2716e841be Separate multiple DNS addresses with newlines.
Bug: b/65037256
Test: make -j40 RunSettingsRoboTests
Change-Id: I4b0709648f8e236177ea73338cfb0d42a5971c06
2017-08-28 18:47:48 -07:00
Eric Schwarzenbach
241cb0db02 Update detail icon only if its signal level changed.
Changes behavior to only render the wifi pie icon if the new rssi has
resulted in a new signal level.

Bug: 64712237
Test: make -j40 ROBOTEST_FILTER=WifiDetailPreferenceControllerTest
RunSettingsRoboTests

Change-Id: I01be2f87d61489242d646ff2003db13c9268ea14
2017-08-16 11:52:17 -07:00
Eric Schwarzenbach
27a1b76fdc Remove references to NetworkBadging.
Removes all references to the deprecated NetworkBadging class. Replaces
Badging enums with AccessPoint.Speed. Uses SettingsLib Utils class to
get the WifiIcons.

Note: This change depends on ag/2676505.

Bug: 62355275
Test: make -j40 RunSettingsRoboTests
Change-Id: If3301ce30e22a7b2cc4d534b0a89e6d7ddfef45b
2017-08-15 09:49:53 -07:00
Fan Zhang
2d28a4ceb4 Unify action buttons to a common widget (part 1)
- Create a preference type to host action button preferences.
- Convert app battery usage page to use the new preference
- Convert wifi detail page to use the new preference

Change-Id: I60bc473986ab46f2897e2537eb0e013fa813a4fc
Fix: 63991885
Test: robotests
2017-07-28 01:00:39 +00:00
Eric Schwarzenbach
fbc3eee32a Merge "Change wifi detail buttons to match App buttons." 2017-07-14 23:09:23 +00:00
Eric Schwarzenbach
eb5ceb94e4 Change wifi detail buttons to match App buttons.
Matches color, size and padding.

Bug: 37252029
Test: manual
Change-Id: Ib0d73d8971eef1ecb234f61fc1bfcf294832e594
2017-07-13 16:13:35 -07:00
Fan Zhang
0d8ae943d2 Bidi wrap ip address in Wifi config settings
Change-Id: Ic1b8a61dbb05abd71170a0b98e7d1b8e604bbdcb
Fix: 63670324
Test: robotests
2017-07-13 13:19:29 -07:00
Sundeep Ghuman
2d1e8a736e Merge "Use EntityHeaderController in WifiDetailPreferenceController." into oc-dr1-dev am: 09229abbf2
am: 4fd8528c2f

Change-Id: Ie183a68e7ae944bad8a2ca3782522afd7f78b74f
2017-07-05 22:43:16 +00:00
Sundeep Ghuman
d569195299 Use EntityHeaderController in WifiDetailPreferenceController.
Switch to the Entity header to bring parity in design of
WifiNetworkDetailsFragment and other Settings pages.

Bug: b/37252029
Test: make -j40 RunSettingsRoboTests
Change-Id: Ib11f3d37eac4dca08fa61eef67910cd328682bac
2017-07-05 12:54:38 -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
Hugo Benichi
2c06009ad6 Instrument sign-in-captive-portal button
Bug: 36203355
Bug: 34901696
Bug: 36532213
Test: WifiDetailPreferenceControllerTest updated
Change-Id: I03dbcdd6efbd0d7aaf2ef67d541fceeb6acc2acf
(cherry picked from commit 539211a718)
2017-06-09 02:51:46 +00:00
Hugo Benichi
539211a718 Instrument sign-in-captive-portal button
Bug: 36203355
Bug: 34901696
Bug: 36532213
Test: WifiDetailPreferenceControllerTest updated
Change-Id: I03dbcdd6efbd0d7aaf2ef67d541fceeb6acc2acf
2017-06-08 22:03:49 +09:00
Lorenzo Colitti
60c5313ff5 Merge "Wifi details: minor ordering fixes." into oc-dev am: 85395155fb
am: 1185ea72f2

Change-Id: Id2661d1f4edac5d987f122542176372b2f99ef3b
2017-06-06 22:40:32 +00:00
Lorenzo Colitti
acb76030de Merge changes I23540440,I67269e1a into oc-dev am: 4249a7092b
am: 844c385c09

Change-Id: I258837998e0c242d4c4dd4fb7c69da8049837173
2017-06-06 13:54:56 +00:00
Lorenzo Colitti
088215d877 Wifi details: minor ordering fixes.
1. Set mNetwork before the NetworkCallbacks can be delivered.
   Previously, the code would set mNetwork in updateInfo, relying
   on the fact that the BroadcastReceiver registered in onResume
   is immediately invoked. However, this races with the
   callbacks, which are also immediately invoked. If the
   callbacks won the race, mNetwork would not be set and they
   would be ignored.

2. Call updateInfo in onResume instead of in displayPreference.
   This ensures that it's always called exactly once before the
   activity starts running, regardless of whether it's being
   displayed the first time (i.e., after onStart) or resumed
   by switching from another app. displayPreference is only
   called in the former case.

3. Don't call getLinkProperties and getNetworkCapabilities in
   updateInfo. These calls are superfluous, because this
   information is update by the NetworkCallbacks, and they can
   cause jank because updateInfo is called on the UI thread.

This requires that the tests be changed so they always call
onResume, since no UI elements are populated until onResume is
called.

Bug: 62209358
Test: make -j64 RunSettingsRoboTests
Change-Id: Iccb1b9ae51188755d890a6df83004dbe9bec565e
2017-06-06 11:39:17 +09:00
Lorenzo Colitti
2561df8083 When validation state changes, update the AP summary.
This stops the AP summary from getting stuck on "Connected, no
Internet" even when the system has validated Internet access.

Bug: 62209358
Test: make -j64 RunSettingsRoboTests
Change-Id: I235404408f7d8b958653d25656d97da8206e35ce
2017-06-04 23:00:47 +09:00
Lorenzo Colitti
5692d23042 Merge changes from topic 'wifi_detail_jank' into oc-dev am: 0187221bd8
am: cc347f4e14

Change-Id: Idf82b916ae8121b837b7113af7ab182640124814
2017-06-02 06:27:13 +00:00
TreeHugger Robot
0187221bd8 Merge changes from topic 'wifi_detail_jank' into oc-dev
* changes:
  Reduce jank in the wifi detail status page.
  Improve testing of IP address display code.
2017-06-02 06:11:52 +00:00
Lorenzo Colitti
0bde06cd59 Reduce jank in the wifi detail status page.
Currently, when anything changes, the wifi detail status page
removes and then redraws all IP address information. This causes
the whole screen to flicker. Instead, only add and remove things
when they actually change.

In order to do this, convert the IPv6 addresses from a list of
Preference objects to a single newline-separated text field.
This removes the need to keep track of addresses as they are
added and deleted, and also looks a bit better.

Also, minor correctness fixes:
- Get the gateway from the default route, not from the last route
  with a non-null gateway.
- Get the IPv4 subnet mask from the IPv4 address prefix, not from
  the last route with prefix length > 0.

Bug: 62171690
Test: make -j64 RunSettingsRoboTests
Test: IP information does not flicker when signal strength changes
Change-Id: Ia9f2a277e53a2800407ae327701c5b95a9eec20a
2017-06-01 12:08:41 +09:00