Remix.run Logo
lovelearning 4 days ago

The 2017 commit has these code changes:

     private int getNumLevels() {
        if (mConfig.inflateSignalStrengths) {
            return SignalStrength.NUM_SIGNAL_STRENGTH_BINS + 1;
        }
         return SignalStrength.NUM_SIGNAL_STRENGTH_BINS;
     }
  
  ...
  
         } else if (mCurrentState.connected) {
            int level = mCurrentState.level;
            if (mConfig.inflateSignalStrengths) {
                level++;
            }
            return SignalDrawable.getState(level, getNumLevels(),
                     mCurrentState.inetCondition == 0);  
      
If the flag is true, bump up BOTH the reported level as well as the total number of bins.

If the flag is false, use reported level and default number of bins.

Since both numerator and denominator are bumped up, is it really malicious?

Based on this commit at least, personally, I feel such logic could be due to a decision to shift from levels starting from 0 to levels starting from 1 at the UI level.

Or perhaps to make levels consistent between different operators, some of whom were using 0-based while others used 1-based.

I haven't gone through later commits or latest versions. So my opinion's limited just to this original 2017 change.

iso1631 4 days ago | parent | next [-]

> Since both numerator and denominator are bumped up, is it really malicious?

2 bins out of 4 suggests 25%-50%

3 bins out of 5 suggests 40%-60%

Towaway69 4 days ago | parent | prev [-]

`KEY_INFLATE_SIGNAL_STRENGTH_BOOL`

Hm - what is the word 'INFLATE' doing there?

I would like to believe your opinion but that word INFLATE makes it hard ...

If it is a UI correction, then surely it would have had a different name: ENSURE_SIGNAL_IS_ONE_BASED ... ;)