OSDN Git Service

[Settings] Wifi Setup responds to other connection state change
authorLucky Zhang <luckyzh@google.com>
Tue, 13 Jan 2015 18:22:28 +0000 (10:22 -0800)
committerLucky Zhang <luckyzh@google.com>
Wed, 14 Jan 2015 01:20:42 +0000 (17:20 -0800)
commit9fe89bbb2e0750f1bf9620431b2388abd313d33e
treecdaf05dda92f5b9043fb53b8434b80483391bc05
parentf5a4abc2057f1e2d242f95e5251e563cff7c9da4
[Settings] Wifi Setup responds to other connection state change

Made use of the two new extras isNetworkRequired and ifWifiRequired in
deciding the ui state of the wifi setting. The CL that adds these
extras in setup wizard is here (http://ag/612291).

Added logic to update the next ("skip") button state accordingly:

(1) "Skip" button should be enabled if
    - wifi is not required and network is not required
    - or wifi is not required, but network is required, and we have a
      valid network connection

(2) "Skip" button should be disabled if
    - wifi is required
    - or wifi is not required, but network is required, and we have
      no valid network connection

Note that the newly added logic is only run if wifi is not connected. If
wifi is already connected, the next button will show "next" and be
enabled.

This fixes the bug where wifi settings in setup wizard does not respond
to mobile data connection change.

Bug: 18783746
Change-Id: I155dcb158f790dd96a71099339f64b64cc647da0
src/com/android/settings/wifi/WifiSetupActivity.java