Merge "Update system APIs based on feedback."
This commit is contained in:
@@ -537,7 +537,8 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
|
||||
BroadcastOptions.makeBasic())
|
||||
.setDeliveryGroupPolicy(
|
||||
ConstantsShim.DELIVERY_GROUP_POLICY_MOST_RECENT)
|
||||
.setDeferUntilActive(true)
|
||||
.setDeferralPolicy(
|
||||
ConstantsShim.DEFERRAL_POLICY_UNTIL_ACTIVE)
|
||||
.toBundle();
|
||||
} catch (UnsupportedApiLevelException e) {
|
||||
Log.wtf(TAG, "Using unsupported API" + e);
|
||||
|
||||
@@ -3133,7 +3133,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);
|
||||
optsShim.setDeferralPolicy(ConstantsShim.DEFERRAL_POLICY_UNTIL_ACTIVE);
|
||||
} catch (UnsupportedApiLevelException e) {
|
||||
Log.wtf(TAG, "Using unsupported API" + e);
|
||||
}
|
||||
|
||||
@@ -864,7 +864,8 @@ public class ConnectivityServiceTest {
|
||||
verify(mBroadcastOptionsShim).setDeliveryGroupMatchingKey(
|
||||
eq(CONNECTIVITY_ACTION),
|
||||
eq(createDeliveryGroupKeyForConnectivityAction(ni)));
|
||||
verify(mBroadcastOptionsShim).setDeferUntilActive(eq(true));
|
||||
verify(mBroadcastOptionsShim).setDeferralPolicy(
|
||||
eq(ConstantsShim.DEFERRAL_POLICY_UNTIL_ACTIVE));
|
||||
} catch (UnsupportedApiLevelException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user