Change RSSI notification levels to 5 in framework
At some point the system UI switched to using 5 rssi levels while the framework only broadcasts a change for 4 levels. Hence RSSI change can be slow to be displayed on the UI, fix this Bug: 5732700 Change-Id: I21700f96ba7a8dd678fb2ccfff8ef59f9b696666
This commit is contained in:
@@ -412,6 +412,13 @@ public class WifiManager {
|
||||
/** Anything better than or equal to this will show the max bars. */
|
||||
private static final int MAX_RSSI = -55;
|
||||
|
||||
/**
|
||||
* Number of RSSI levels used in the framework to initiate
|
||||
* {@link #RSSI_CHANGED_ACTION} broadcast
|
||||
* @hide
|
||||
*/
|
||||
public static final int RSSI_LEVELS = 5;
|
||||
|
||||
/**
|
||||
* Auto settings in the driver. The driver could choose to operate on both
|
||||
* 2.4 GHz and 5 GHz or make a dynamic decision on selecting the band.
|
||||
|
||||
@@ -1423,14 +1423,11 @@ public class WifiStateMachine extends StateMachine {
|
||||
* be displayed in the status bar, and only send the
|
||||
* broadcast if that much more coarse-grained number
|
||||
* changes. This cuts down greatly on the number of
|
||||
* broadcasts, at the cost of not mWifiInforming others
|
||||
* broadcasts, at the cost of not informing others
|
||||
* interested in RSSI of all the changes in signal
|
||||
* level.
|
||||
*/
|
||||
// TODO: The second arg to the call below needs to be a symbol somewhere, but
|
||||
// it's actually the size of an array of icons that's private
|
||||
// to StatusBar Policy.
|
||||
int newSignalLevel = WifiManager.calculateSignalLevel(newRssi, 4);
|
||||
int newSignalLevel = WifiManager.calculateSignalLevel(newRssi, WifiManager.RSSI_LEVELS);
|
||||
if (newSignalLevel != mLastSignalLevel) {
|
||||
sendRssiChangeBroadcast(newRssi);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user