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

Commit 2147baa4 authored by Fabien Sanglard's avatar Fabien Sanglard Committed by Android Build Coastguard Worker
Browse files

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

This reverts commit 24f6fcb3.

Reason for revert: b/421137553

Bug: 402444824
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:36ffb021b92bc46c97e6ad8f230d9edab8bf611a)
Merged-In: I92353399e55afa020d0b2129b54c456c95db4596
Change-Id: I92353399e55afa020d0b2129b54c456c95db4596
parent 789aff81
Loading
Loading
Loading
Loading
+1 −19
Original line number Original line Diff line number Diff line
@@ -162,20 +162,6 @@ public class AdbService extends IAdbManager.Stub {
            mContentResolver.registerContentObserver(
            mContentResolver.registerContentObserver(
                    Settings.Global.getUriFor(Settings.Global.ADB_WIFI_ENABLED),
                    Settings.Global.getUriFor(Settings.Global.ADB_WIFI_ENABLED),
                    false, mObserver);
                    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) {
        } catch (Exception e) {
            Slog.e(TAG, "Error in registerContentObservers", e);
            Slog.e(TAG, "Error in registerContentObservers", e);
        }
        }
@@ -211,10 +197,6 @@ public class AdbService extends IAdbManager.Stub {
                setAdbEnabled(shouldEnable, AdbTransportType.WIFI);
                setAdbEnabled(shouldEnable, AdbTransportType.WIFI);
            }
            }
        }
        }

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


    private static final String TAG = AdbService.class.getSimpleName();
    private static final String TAG = AdbService.class.getSimpleName();
@@ -244,7 +226,7 @@ public class AdbService extends IAdbManager.Stub {


    private final AdbDebuggingManager mDebuggingManager;
    private final AdbDebuggingManager mDebuggingManager;


    private AdbSettingsObserver mObserver;
    private ContentObserver mObserver;


    private AdbService(Context context) {
    private AdbService(Context context) {
        mContext = context;
        mContext = context;