Merge "Change RSSI notification levels to 5 in framework"
This commit is contained in:
committed by
Android (Google) Code Review
commit
1108e8ddad
@@ -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.
|
||||
|
||||
@@ -1458,14 +1458,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