Note with featureId from ContentProvider

This takes the Context#getFeatureId from the calling context and pipes
it all way through to the noteOp calls done by the content provider.

Bug: 136595429
Test: atest CtsAppOpsTestCases (new test added to capture this case)
            TelecomUnitTests:CallLogManagerTest
	    ContentProviderClientTest
	    TelecomUnitTests:MissedCallNotifierImplTest
	    TelecomUnitTests:BasicCallTests
	    MediaInserterTest
	    PreferencesHelperTest
	    RankingHelperTest
	    PinnedSliceStateTest
	    FrameworksCoreTests:ContentResolverTest
Change-Id: I53b1035626229c920b353509a5bece157b52fb51
This commit is contained in:
Philip P. Moltmann
2019-09-27 08:44:12 -07:00
parent a7f66b7ee8
commit 128b70364e
24 changed files with 540 additions and 346 deletions

View File

@@ -129,17 +129,17 @@ public class ExternalStorageProvider extends FileSystemProvider {
}
@Override
protected int enforceReadPermissionInner(Uri uri, String callingPkg, IBinder callerToken)
throws SecurityException {
protected int enforceReadPermissionInner(Uri uri, String callingPkg,
@Nullable String featureId, IBinder callerToken) throws SecurityException {
enforceShellRestrictions();
return super.enforceReadPermissionInner(uri, callingPkg, callerToken);
return super.enforceReadPermissionInner(uri, callingPkg, featureId, callerToken);
}
@Override
protected int enforceWritePermissionInner(Uri uri, String callingPkg, IBinder callerToken)
throws SecurityException {
protected int enforceWritePermissionInner(Uri uri, String callingPkg,
@Nullable String featureId, IBinder callerToken) throws SecurityException {
enforceShellRestrictions();
return super.enforceWritePermissionInner(uri, callingPkg, callerToken);
return super.enforceWritePermissionInner(uri, callingPkg, featureId, callerToken);
}
public void updateVolumes() {