Fix an infinite loop
If the top bit is set, then >>= propagates it. That means |bitmask| is never 0, and this is an infinite loop. A followup will move this method to frameworks/libs/net and add tests for it. Test: FrameworksNetTests Change-Id: I28a0a74be41f6f29b796b1c76e404ecc21f810c6
This commit is contained in:
parent
6557144b32
commit
1e4afe071d
1 changed files with 1 additions and 1 deletions
|
|
@ -2308,7 +2308,7 @@ public final class NetworkCapabilities implements Parcelable {
|
|||
}
|
||||
sb.append(nameFetcher.nameOf(bitPos));
|
||||
}
|
||||
bitMask >>= 1;
|
||||
bitMask >>>= 1;
|
||||
++bitPos;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue