Refactor Work sounds in SoundSettings.

- final round of refactoring SoundSettings to use preference
  controller.
- add work sound controller to control all the work profile sound
  settings.

Change-Id: Ifa9f9c1f717ca292576f077311fe284325e12651
Fixes: 32276590
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2016-12-09 14:57:48 -08:00
parent d4b43228b0
commit 2adb6ea4ec
4 changed files with 496 additions and 249 deletions

View File

@@ -16,8 +16,12 @@
package com.android.settings.notification;
import android.annotation.UserIdInt;
import android.content.Context;
import android.media.AudioSystem;
import android.os.UserHandle;
import android.os.UserManager;
import com.android.settings.Utils;
/**
* Helper class to wrap API for testing
@@ -34,4 +38,11 @@ public class AudioHelper {
return AudioSystem.isSingleVolume(mContext);
}
public int getManagedProfileId(UserManager um) {
return Utils.getManagedProfileId(um, UserHandle.myUserId());
}
public Context createPackageContextAsUser(@UserIdInt int profileId) {
return Utils.createPackageContextAsUser(mContext, profileId);
}
}