Merge changes from topic "defer-until-active"
* changes: Add defer-until-active policy to CONNECTIVITY_ACTION. Add defer-until-active policy to NETWORK_STATS_CHANGED.
This commit is contained in:
commit
d2c5e3bf46
3 changed files with 3 additions and 0 deletions
|
|
@ -537,6 +537,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
|||
BroadcastOptions.makeBasic())
|
||||
.setDeliveryGroupPolicy(
|
||||
ConstantsShim.DELIVERY_GROUP_POLICY_MOST_RECENT)
|
||||
.setDeferUntilActive(true)
|
||||
.toBundle();
|
||||
} catch (UnsupportedApiLevelException e) {
|
||||
Log.wtf(TAG, "Using unsupported API" + e);
|
||||
|
|
|
|||
|
|
@ -3082,6 +3082,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
optsShim.setDeliveryGroupPolicy(ConstantsShim.DELIVERY_GROUP_POLICY_MOST_RECENT);
|
||||
optsShim.setDeliveryGroupMatchingKey(ConnectivityManager.CONNECTIVITY_ACTION,
|
||||
createDeliveryGroupKeyForConnectivityAction(info));
|
||||
optsShim.setDeferUntilActive(true);
|
||||
} catch (UnsupportedApiLevelException e) {
|
||||
Log.wtf(TAG, "Using unsupported API" + e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -848,6 +848,7 @@ public class ConnectivityServiceTest {
|
|||
verify(mBroadcastOptionsShim).setDeliveryGroupMatchingKey(
|
||||
eq(CONNECTIVITY_ACTION),
|
||||
eq(createDeliveryGroupKeyForConnectivityAction(ni)));
|
||||
verify(mBroadcastOptionsShim).setDeferUntilActive(eq(true));
|
||||
} catch (UnsupportedApiLevelException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue