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

Commit 36ffb021 authored by Fabien Sanglard's avatar Fabien Sanglard Committed by Android (Google) Code Review
Browse files

Revert "adb: check the current Settings values after adding ContentObserver"

This reverts commit 24f6fcb3.

Reason for revert: b/421137553

Bug: 402444824
Change-Id: I92353399e55afa020d0b2129b54c456c95db4596
parent 24f6fcb3
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -162,20 +162,6 @@ public class AdbService extends IAdbManager.Stub {
            mContentResolver.registerContentObserver(
                    Settings.Global.getUriFor(Settings.Global.ADB_WIFI_ENABLED),
                    false, mObserver);

            /*
             * The observer will only trigger when the value *changes*.
             * We need to initialize the state according to the current setting value.
             */
            if (Settings.Global.getInt(mContentResolver,
                                       Settings.Global.ADB_ENABLED, 0) != 0) {
                mObserver.setInitialAdbState(true, AdbTransportType.USB);
            }

            if (Settings.Global.getInt(mContentResolver,
                                       Settings.Global.ADB_WIFI_ENABLED, 0) != 0) {
                mObserver.setInitialAdbState(true, AdbTransportType.WIFI);
            }
        } catch (Exception e) {
            Slog.e(TAG, "Error in registerContentObservers", e);
        }
@@ -211,10 +197,6 @@ public class AdbService extends IAdbManager.Stub {
                setAdbEnabled(shouldEnable, AdbTransportType.WIFI);
            }
        }

        private void setInitialAdbState(boolean enable, byte transportType) {
            setAdbEnabled(enable, transportType);
        }
    }

    private static final String TAG = AdbService.class.getSimpleName();
@@ -239,7 +221,7 @@ public class AdbService extends IAdbManager.Stub {
    private boolean mIsAdbWifiEnabled;
    private final AdbDebuggingManager mDebuggingManager;

    private AdbSettingsObserver mObserver;
    private ContentObserver mObserver;

    private AdbService(Context context) {
        mContext = context;