WiFi: Fixing WifiDialog issues when rotating Device

The issues fixed by this patch are:
-restoring the advanced fields of a WifiDialog a rotation.
-restoring position of the cursor and enabling/disabling of the password field
-avoiding crashes after a rotation in case like described in bz 43815.

When a dialog is displayed and a rotation occurs, the android framework
is performing this call sequence (I am probably missing some of them,
but the most important are there):
- onSaveInstanceState
- onStop
- onRestoreInstanceState
- onCreate
- onStart

I used this life cycle in order to save the state of the check boxes and
restore their effect when the dialog is recreated.

Change-Id: I54fb6b495d1c4aa571b76cd755f5d1b6c041c2e3
Orig-Change-Id: Id507a140cd3a69ccf3c662a38b8e579cd6ecaeeb
Signed-off-by: Paul Naoumenko <paulx.naoumenko@intel.com>
Signed-off-by: Jean-Marie Lemetayer <jean-mariex.lemetayer@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 30271 35749 43815 19570 23655 26175
Update preferred network mode message.

Change-Id: I4718674ff73116cc6bbec4540c3450ed14663c0d
Show Service State status in Phone Status properly

When the network mode is data only mode, the voice service state
would be OOS. In such cases, data service state is not checked to
show the phone status UI. Fix to consider data service state also to
update the UI properly.

Change-Id: I20fb6ea3256d0fe4a534fbb781e664d7ce774a05
WiFi: "Connect" option disappear after rotating.

The connect option disappears because there is a problem in saving and
restoring the state of the access point showed in the dialog box. When a
rotation accurs, the framework calls onSaveInstanceState(Bundle outState)
of the wifisettings activity. In this method, the state of the access is
saved, but not its rssi level. After a rotation, when restoring the access
point state, the rssi is initialized to the default value, which means out of
range. This is why the connect option is not displayed. I fixed the issue by
saving and restoring the rssi level of the access point.

Change-Id: Ibd58132c922828941603673383ff81f25d61556e
Orig-Change-Id: I624cc8ce82a69fd94931088dc0f7833663ef0772
Signed-off-by: Paul Naoumenko <paulx.naoumenko@intel.com>
Signed-off-by: Jean-Marie Lemetayer <jean-mariex.lemetayer@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 34109
Add LTE/WCDMA to network preferred mode

Change-Id: I1cab3df9a515f7bf51c861587c52771cc7897f18
WiFi access points are hidden in some cases

If AccessPoint.compareTo() returns 0, the object are considered as
equal, and then one object instance is removed from the displayed
list. This is the case for AccessPoints wuth different security level
and different SSID case.

This is unfortunate since the user could by accident choose wrong
network if two networks exist for the same SSID but with different
case of security levels.

Added code for compareTo to also handle difference in Case and
different security levels.

Example of sorting after the change:
AP:         Security:
aa           WEP
Aa           None (previously hidden due to equalsIgnoreCase)
aa           None (previously hidden due to not checking security)
Bb           None

Change-Id: Ifa4a37a9b17159f00e3a900480ece4ff4f5bd89a
Fix polish translation mistake

Both "device_status" and "device_status_summary" should be "Informacje" (Status in english), not "Informacje o telefonie" (phone status in english) just like in
a original english translation. The same string is displayed on both phones and tablets, and it says "phone status" also on tablets only in polish translation.

Change-Id: Icf4ef3a70b15f3964f1d53181755b2577d0e6850
Fix the visibility timeout change from never timeout to undiscoverable.

Open bluetooth setting UI, set timeout to 120s. Before achieving timeout,
change timeout to never-timeout, then 120s later, the visibility will
change to only visible to paired devices.
Root cause is if change the visibility timeout to never timeout, the
timeout = 0, so no setDiscoverableAlarm() is called, and the previous
alarm is not canceled(it cancels old alarm in setDiscoverableAlarm).
Solution is call cancelDiscoverableAlarm() when timeout == 0.

Change-Id: I32ad4c11db7a68ff39e88ce3bde6f9e454cb9d41
Signed-off-by: yuwan@marvell.com <yuwang19860130@gmail.com>
Fix device scanning in DevicePickerFragment

In some conditions, the BT devices scan may be blocked with the phone
displaying "no devices detected".

This behavior is reproduced on Galaxy Nexus reference phone.

This patch will fix the behavior in most of the scenarios by doing a
device scan by default.
However, the device scan will still be blocked upon screen rotation as
this is the expected behavior.

Change-Id: Ic999355db93eeeca97435da9d894c13e4bd97ce8
Orig-Change-Id: Iaef4d8857b006de1e68854d23e0810a433727f4d
Signed-off-by: Patrick Combes <patrick.combes@intel.com>
Reviewed-on: http://android.intel.com:8080/119743
Reviewed-by: Boniface, XavierX <xavierx.boniface@intel.com>
Reviewed-by: Chen, HuaqiangX <huaqiangx.chen@intel.com>
Reviewed-by: Yao, Yong <yong.yao@intel.com>
Reviewed-by: Aquilone, RaffaeleX <raffaelex.aquilone@intel.com>
Reviewed-by: Gros, Julien <julien.gros@intel.com>
Tested-by: Lestienne, ChristopheX <christophex.lestienne@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 124172
WiFi: Add control over SSID size for SoftAP

SSID max length is 32, avoiding to save a too long  SSID (larger than 32 bytes)
prevent to make Softap enabling stuck.

Change-Id: Ibce16b52019d7fc7240517d2869ec0293ed2ae77
Orig-Change-Id: I4fdf56ef0ede609bf73786d2837929d8cb737cd5
Signed-off-by: Honore Tricot <honorex.tricot@intel.com>
Signed-off-by: Jean-Marie Lemetayer <jean-mariex.lemetayer@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 29110