[Settings] Set different ringtones at work profile
Updated the Settings app to allow setting different default system ringtones for work profile apps Bug: 30658854 Change-Id: I7461be070bd4e8d86bf1fd724039e53d500094ad
This commit is contained in:
@@ -1160,4 +1160,17 @@ public final class Utils extends com.android.settingslib.Utils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a context created from the given context for the given user, or null if it fails
|
||||
*/
|
||||
public static Context createPackageContextAsUser(Context context, int userId) {
|
||||
try {
|
||||
return context.createPackageContextAsUser(
|
||||
context.getPackageName(), 0 /* flags */, UserHandle.of(userId));
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.e(TAG, "Failed to create user context", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user