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

Commit 6c31c6d8 authored by Bruno Martins's avatar Bruno Martins
Browse files

Settings: Disable adb root if developer options are disabled

Change-Id: I7944ead69611d232ac65029c664db1f1911a9004
parent 3d4f9484
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2018 The LineageOS Project
 * Copyright (C) 2018-2024 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -71,6 +71,14 @@ public class AdbRootPreferenceController extends DeveloperOptionsPreferenceContr
        return true;
    }

    @Override
    protected void onDeveloperOptionsSwitchDisabled() {
        super.onDeveloperOptionsSwitchDisabled();

        mADBRootService.setEnabled(false);
        ((SwitchPreferenceCompat) mPreference).setChecked(false);
    }

    @Override
    protected void onDeveloperOptionsSwitchEnabled() {
        if (isAdminUser()) {