Enable NetworkCallback optimizations by default.
These optimizations are already launched to all public Pixel devices and were in in 25Q2 beta releases as well. Enable them by default on all supported releases. The appcompat risk is very low (these changes are difficult even for an app to detect if it's looking for them), the user benefits are substantial, and there is a kill switch if any unforeseen issues do occur. Bug: 327038794 Test: both codepaths are covered by existing tests Change-Id: I42c7ceb71ef02d078bf4563744cb11afd412f267
This commit is contained in:
parent
389d728168
commit
2169522878
2 changed files with 8 additions and 5 deletions
|
|
@ -1913,11 +1913,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
&& mDeps.isFeatureEnabled(context, REQUEST_RESTRICTED_WIFI);
|
||||
mBackgroundFirewallChainEnabled = mDeps.isAtLeastV() && mDeps.isFeatureNotChickenedOut(
|
||||
context, ConnectivityFlags.BACKGROUND_FIREWALL_CHAIN);
|
||||
mUseDeclaredMethodsForCallbacksEnabled = mDeps.isFeatureEnabled(context,
|
||||
ConnectivityFlags.USE_DECLARED_METHODS_FOR_CALLBACKS);
|
||||
mUseDeclaredMethodsForCallbacksEnabled =
|
||||
mDeps.isFeatureNotChickenedOut(context,
|
||||
ConnectivityFlags.USE_DECLARED_METHODS_FOR_CALLBACKS);
|
||||
// registerUidFrozenStateChangedCallback is only available on U+
|
||||
mQueueCallbacksForFrozenApps = mDeps.isAtLeastU()
|
||||
&& mDeps.isFeatureEnabled(context, QUEUE_CALLBACKS_FOR_FROZEN_APPS);
|
||||
&& mDeps.isFeatureNotChickenedOut(context, QUEUE_CALLBACKS_FOR_FROZEN_APPS);
|
||||
mCarrierPrivilegeAuthenticator = mDeps.makeCarrierPrivilegeAuthenticator(
|
||||
mContext, mTelephonyManager, mRequestRestrictedWifiEnabled,
|
||||
this::handleUidCarrierPrivilegesLost, mHandler);
|
||||
|
|
|
|||
|
|
@ -154,7 +154,6 @@ import static android.net.OemNetworkPreferences.OEM_NETWORK_PREFERENCE_UNINITIAL
|
|||
import static android.net.Proxy.PROXY_CHANGE_ACTION;
|
||||
import static android.net.RouteInfo.RTN_UNREACHABLE;
|
||||
import static android.net.connectivity.ConnectivityCompatChanges.NETWORK_BLOCKED_WITHOUT_INTERNET_PERMISSION;
|
||||
import static android.net.connectivity.ConnectivityCompatChanges.RESTRICT_LOCAL_NETWORK;
|
||||
import static android.net.resolv.aidl.IDnsResolverUnsolicitedEventListener.PREFIX_OPERATION_ADDED;
|
||||
import static android.net.resolv.aidl.IDnsResolverUnsolicitedEventListener.PREFIX_OPERATION_REMOVED;
|
||||
import static android.net.resolv.aidl.IDnsResolverUnsolicitedEventListener.VALIDATION_RESULT_FAILURE;
|
||||
|
|
@ -258,7 +257,6 @@ import android.app.BroadcastOptions;
|
|||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.admin.DevicePolicyManager;
|
||||
import android.app.compat.CompatChanges;
|
||||
import android.app.usage.NetworkStatsManager;
|
||||
import android.compat.testing.PlatformCompatChangeRule;
|
||||
import android.content.BroadcastReceiver;
|
||||
|
|
@ -2207,6 +2205,10 @@ public class ConnectivityServiceTest {
|
|||
return true;
|
||||
case DELAY_DESTROY_SOCKETS:
|
||||
return true;
|
||||
case ConnectivityFlags.USE_DECLARED_METHODS_FOR_CALLBACKS:
|
||||
return true;
|
||||
case ConnectivityFlags.QUEUE_CALLBACKS_FOR_FROZEN_APPS:
|
||||
return true;
|
||||
default:
|
||||
return super.isFeatureNotChickenedOut(context, name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue