Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3eb9f7ac authored by Ricky Wai's avatar Ricky Wai Committed by Android (Google) Code Review
Browse files

Merge "Change Network Watchlist feature flag"

parents 33487775 eef5065e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -9799,6 +9799,14 @@ public final class Settings {
         */
        public static final java.lang.String APP_STANDBY_ENABLED = "app_standby_enabled";

        /**
         * Whether or not Network Watchlist feature is enabled.
         * Type: int (0 for false, 1 for true)
         * Default: 0
         * @hide
         */
        public static final String NETWORK_WATCHLIST_ENABLED = "network_watchlist_enabled";

        /**
         * Get the key that retrieves a bluetooth headset's priority.
         * @hide
+1 −0
Original line number Diff line number Diff line
@@ -282,6 +282,7 @@ public class SettingsBackupTest {
                    Settings.Global.NETWORK_SCORING_UI_ENABLED,
                    Settings.Global.NETWORK_SWITCH_NOTIFICATION_DAILY_LIMIT,
                    Settings.Global.NETWORK_SWITCH_NOTIFICATION_RATE_LIMIT_MILLIS,
                    Settings.Global.NETWORK_WATCHLIST_ENABLED,
                    Settings.Global.NEW_CONTACT_AGGREGATOR,
                    Settings.Global.NITZ_UPDATE_DIFF,
                    Settings.Global.NITZ_UPDATE_SPACING,
+10 −8
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.os.SharedMemory;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Slog;

@@ -53,9 +54,6 @@ public class NetworkWatchlistService extends INetworkWatchlistManager.Stub {
    private static final String TAG = NetworkWatchlistService.class.getSimpleName();
    static final boolean DEBUG = false;

    private static final String PROPERTY_NETWORK_WATCHLIST_ENABLED =
            "ro.network_watchlist_enabled";

    private static final int MAX_NUM_OF_WATCHLIST_DIGESTS = 10000;

    public static class Lifecycle extends SystemService {
@@ -67,8 +65,10 @@ public class NetworkWatchlistService extends INetworkWatchlistManager.Stub {

        @Override
        public void onStart() {
            if (!SystemProperties.getBoolean(PROPERTY_NETWORK_WATCHLIST_ENABLED, false)) {
            if (Settings.Global.getInt(getContext().getContentResolver(),
                    Settings.Global.NETWORK_WATCHLIST_ENABLED, 0) == 0) {
                // Watchlist service is disabled
                Slog.i(TAG, "Network Watchlist service is disabled");
                return;
            }
            mService = new NetworkWatchlistService(getContext());
@@ -77,11 +77,13 @@ public class NetworkWatchlistService extends INetworkWatchlistManager.Stub {

        @Override
        public void onBootPhase(int phase) {
            if (!SystemProperties.getBoolean(PROPERTY_NETWORK_WATCHLIST_ENABLED, false)) {
            if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) {
                if (Settings.Global.getInt(getContext().getContentResolver(),
                        Settings.Global.NETWORK_WATCHLIST_ENABLED, 0) == 0) {
                    // Watchlist service is disabled
                    Slog.i(TAG, "Network Watchlist service is disabled");
                    return;
                }
            if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) {
                try {
                    mService.initIpConnectivityMetrics();
                    mService.startWatchlistLogging();