NetworkCapabilities: convert ALL_VALID_CAPABILITIES to long
ALL_VALID_CAPABILITIES should be a long, since there are now 35 NetworkCapabilities that are stored in a bitfield. This caused NetworkCapabilities to be lost during parceling. Bug: 291160389 Test: TH Change-Id: Ia021ba5fd2094fdaec87446c73de2037c920c4f1
This commit is contained in:
@@ -693,11 +693,11 @@ public final class NetworkCapabilities implements Parcelable {
|
|||||||
private static final int MIN_NET_CAPABILITY = NET_CAPABILITY_MMS;
|
private static final int MIN_NET_CAPABILITY = NET_CAPABILITY_MMS;
|
||||||
private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_PRIORITIZE_BANDWIDTH;
|
private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_PRIORITIZE_BANDWIDTH;
|
||||||
|
|
||||||
private static final int ALL_VALID_CAPABILITIES;
|
private static final long ALL_VALID_CAPABILITIES;
|
||||||
static {
|
static {
|
||||||
int caps = 0;
|
long caps = 0;
|
||||||
for (int i = MIN_NET_CAPABILITY; i <= MAX_NET_CAPABILITY; ++i) {
|
for (int i = MIN_NET_CAPABILITY; i <= MAX_NET_CAPABILITY; ++i) {
|
||||||
caps |= 1 << i;
|
caps |= 1L << i;
|
||||||
}
|
}
|
||||||
ALL_VALID_CAPABILITIES = caps;
|
ALL_VALID_CAPABILITIES = caps;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user