[SettingsProvider] enforce permission on openFile
Prevent third-party apps to write to ring tone files without permission. BUG: 222687217 Test: manual debug app Test: will add a CTS Change-Id: I759b9674172e2bdb518c1dccfff0f20047343bf0
This commit is contained in:
@@ -818,6 +818,9 @@ public class SettingsProvider extends ContentProvider {
|
||||
getContext().enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS,
|
||||
"Access files from the settings of another user");
|
||||
}
|
||||
if (mode.contains("w")) {
|
||||
enforceWritePermission(Manifest.permission.WRITE_SETTINGS);
|
||||
}
|
||||
uri = ContentProvider.getUriWithoutUserId(uri);
|
||||
|
||||
final String cacheRingtoneSetting;
|
||||
|
||||
Reference in New Issue
Block a user