Set SYNC_PARENT_SOUNDS settings directly

The RingtoneManager.xyzSyncFromParent methods have been removed.

Test: atest SettingsRoboTests
Bug: 204555055
Change-Id: I17ee0353b1c76c810a57640c11f560feb1c52d8c
This commit is contained in:
Robin Lee
2021-11-03 10:47:45 +01:00
parent bd311f550e
commit afe89cee44

View File

@@ -235,8 +235,7 @@ public class SoundWorkSettingsController extends AbstractPreferenceController
mWorkPhoneRingtonePreference = null; mWorkPhoneRingtonePreference = null;
} }
final Context managedProfileContext = getManagedProfileContext(); if (Settings.Secure.getIntForUser(getManagedProfileContext().getContentResolver(),
if (Settings.Secure.getIntForUser(managedProfileContext.getContentResolver(),
Settings.Secure.SYNC_PARENT_SOUNDS, /* def= */ 0, mManagedProfileId) == 1) { Settings.Secure.SYNC_PARENT_SOUNDS, /* def= */ 0, mManagedProfileId) == 1) {
enableWorkSyncSettings(); enableWorkSyncSettings();
} else { } else {
@@ -245,7 +244,8 @@ public class SoundWorkSettingsController extends AbstractPreferenceController
} }
void enableWorkSync() { void enableWorkSync() {
RingtoneManager.enableSyncFromParent(getManagedProfileContext()); Settings.Secure.putIntForUser(getManagedProfileContext().getContentResolver(),
Settings.Secure.SYNC_PARENT_SOUNDS, /* enabled= */ 1, mManagedProfileId);
enableWorkSyncSettings(); enableWorkSyncSettings();
} }
@@ -260,7 +260,8 @@ public class SoundWorkSettingsController extends AbstractPreferenceController
} }
private void disableWorkSync() { private void disableWorkSync() {
RingtoneManager.disableSyncFromParent(getManagedProfileContext()); Settings.Secure.putIntForUser(getManagedProfileContext().getContentResolver(),
Settings.Secure.SYNC_PARENT_SOUNDS, /* enabled= */ 0, mManagedProfileId);
disableWorkSyncSettings(); disableWorkSyncSettings();
} }