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

Commit 5cee04e1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set SYNC_PARENT_SOUNDS settings directly"

parents 4b59b75c afe89cee
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -235,8 +235,7 @@ public class SoundWorkSettingsController extends AbstractPreferenceController
            mWorkPhoneRingtonePreference = null;
        }

        final Context managedProfileContext = getManagedProfileContext();
        if (Settings.Secure.getIntForUser(managedProfileContext.getContentResolver(),
        if (Settings.Secure.getIntForUser(getManagedProfileContext().getContentResolver(),
                Settings.Secure.SYNC_PARENT_SOUNDS, /* def= */ 0, mManagedProfileId) == 1) {
            enableWorkSyncSettings();
        } else {
@@ -245,7 +244,8 @@ public class SoundWorkSettingsController extends AbstractPreferenceController
    }

    void enableWorkSync() {
        RingtoneManager.enableSyncFromParent(getManagedProfileContext());
        Settings.Secure.putIntForUser(getManagedProfileContext().getContentResolver(),
                Settings.Secure.SYNC_PARENT_SOUNDS, /* enabled= */ 1, mManagedProfileId);
        enableWorkSyncSettings();
    }

@@ -260,7 +260,8 @@ public class SoundWorkSettingsController extends AbstractPreferenceController
    }

    private void disableWorkSync() {
        RingtoneManager.disableSyncFromParent(getManagedProfileContext());
        Settings.Secure.putIntForUser(getManagedProfileContext().getContentResolver(),
                Settings.Secure.SYNC_PARENT_SOUNDS, /* enabled= */ 0, mManagedProfileId);
        disableWorkSyncSettings();
    }