/cts/hostsidetests/appsecurity/test-apps/UsePermissionDiffCert/src/com/android/cts/usespermissiondiffcertapp/ |
D | Asserts.java | 46 Uri uri = item.getUri(); in assertAccess() local 47 if (uri != null) { in assertAccess() 48 assertAccess(uri, mode); in assertAccess() 51 uri = intent.getData(); in assertAccess() 52 if (uri != null) { in assertAccess() 53 assertAccess(uri, mode); in assertAccess() 63 static void assertAccess(Uri uri, int mode) { in assertAccess() argument 65 assertReadingContentUriAllowed(uri); in assertAccess() 67 assertReadingContentUriNotAllowed(uri, null); in assertAccess() 70 assertWritingContentUriAllowed(uri); in assertAccess() [all …]
|
D | UriGrantsResultTest.java | 67 for (Uri uri : GRANTABLE) { in testGrantableToResult() 69 Log.d(TAG, "Testing " + uri + " " + mode); in testGrantableToResult() 70 assertGrantableToResult(uri, mode, UriGrantsTest::makeSingleClipData); in testGrantableToResult() 71 assertGrantableToResult(uri, mode, UriGrantsTest::makeMultiClipData); in testGrantableToResult() 76 private void assertGrantableToResult(Uri uri, int mode, in assertGrantableToResult() argument 80 assertGrantableToResultInternal(uri, mode, clipper); in assertGrantableToResult() 86 private void assertGrantableToResultInternal(Uri uri, int mode, in assertGrantableToResultInternal() argument 88 final Uri subUri = Uri.withAppendedPath(uri, "foo"); in assertGrantableToResultInternal() 92 assertAccess(uri, 0); in assertGrantableToResultInternal() 103 assertAccess(uri, 0); in assertGrantableToResultInternal() [all …]
|
D | UriGrantsServiceTest.java | 51 for (Uri uri : GRANTABLE) { in testGrantableToService() 53 Log.d(TAG, "Testing " + uri + " " + mode); in testGrantableToService() 54 assertGrantableToService(uri, mode, UriGrantsTest::makeSingleClipData); in testGrantableToService() 55 assertGrantableToService(uri, mode, UriGrantsTest::makeMultiClipData); in testGrantableToService() 60 private void assertGrantableToService(Uri uri, int mode, Function<Uri, ClipData> clipper) { in assertGrantableToService() argument 61 final Uri subUri = Uri.withAppendedPath(uri, "foo"); in assertGrantableToService() 63 final Uri sub2Uri = Uri.withAppendedPath(uri, "yes"); in assertGrantableToService() 71 assertAccess(uri, 0); in assertGrantableToService() 87 assertAccess(uri, 0); in assertGrantableToService() 102 assertAccess(uri, 0); in assertGrantableToService() [all …]
|
D | UriGrantsActivityTest.java | 60 for (Uri uri : GRANTABLE) { in testGrantableToActivity() 62 Log.d(TAG, "Testing " + uri + " " + mode); in testGrantableToActivity() 63 assertGrantableToActivity(uri, mode, UriGrantsTest::makeSingleClipData); in testGrantableToActivity() 64 assertGrantableToActivity(uri, mode, UriGrantsTest::makeMultiClipData); in testGrantableToActivity() 69 private void assertGrantableToActivity(Uri uri, int mode, Function<Uri, ClipData> clipper) { in assertGrantableToActivity() argument 70 final Uri subUri = Uri.withAppendedPath(uri, "foo"); in assertGrantableToActivity() 72 final Uri sub2Uri = Uri.withAppendedPath(uri, "yes"); in assertGrantableToActivity() 78 assertAccess(uri, 0); in assertGrantableToActivity() 92 assertAccess(uri, 0); in assertGrantableToActivity() 106 assertAccess(uri, 0); in assertGrantableToActivity() [all …]
|
/cts/tests/tests/contactsprovider/src/android/provider/cts/contacts/ |
D | ContactsContract_AllUriTest.java | 293 private String[] getColumns(Uri uri) { in getColumns() argument 294 try (Cursor c = mResolver.query(uri, in getColumns() 304 private void checkQueryExecutable(Uri uri, in checkQueryExecutable() argument 308 try (Cursor c = mResolver.query(uri, projection, selection, in checkQueryExecutable() 313 addFailure("Query failed: URI=" + uri + " Message=" + th.getMessage(), th); in checkQueryExecutable() 317 try (Cursor c = mResolver.query(uri, projection, selection, in checkQueryExecutable() 322 addFailure("Query with cancel failed: URI=" + uri + " Message=" + th.getMessage(), th); in checkQueryExecutable() 327 uri.buildUpon().appendQueryParameter( in checkQueryExecutable() 333 addFailure("Query with limit failed: URI=" + uri + " Message=" + th.getMessage(), th); in checkQueryExecutable() 339 uri.buildUpon() in checkQueryExecutable() [all …]
|
D | ContactsContract_DumpFileProviderTest.java | 52 Uri uri = Uri.parse(URI_PREFIX + fileName); in testOpenFileDescriptor_throwsErrorWithIllegalFileName() local 53 assertOpenFileDescriptorThrowsError(uri); in testOpenFileDescriptor_throwsErrorWithIllegalFileName() 59 final Uri uri = Uri.parse(URI_PREFIX + fileName); in testOpenFileDescriptor_worksWithValidFileName() local 61 mResolver.openFileDescriptor(uri, "r"); in testOpenFileDescriptor_worksWithValidFileName() 70 final Uri uri = Uri.parse(URI_PREFIX + fileName); in testQuery_throwsErrorWithIllegalFileName() local 71 assertQueryThrowsError(uri); in testQuery_throwsErrorWithIllegalFileName() 77 final Uri uri = Uri.parse(URI_PREFIX + fileName); in testQuery_worksWithValidFileName() local 78 mResolver.query(uri, null, null, null, null); in testQuery_worksWithValidFileName() 82 private void assertQueryThrowsError(Uri uri) { in assertQueryThrowsError() argument 84 mResolver.query(uri, null, null, null, null); in assertQueryThrowsError() [all …]
|
D | ContactsContract_StatusUpdatesTest.java | 62 assertNotNull(results[0].uri); in setUp() 63 assertNotNull(results[1].uri); in setUp() 65 dataId = ContentUris.parseId(results[1].uri); in setUp() 69 Uri uri = insertStatusUpdate(dataId, StatusUpdates.DO_NOT_DISTURB, null, null); in testInsertStatus() local 70 assertPresence(uri, StatusUpdates.DO_NOT_DISTURB); in testInsertStatus() 71 assertStatus(uri, null); in testInsertStatus() 72 assertHasTimestamp(uri, false); in testInsertStatus() 73 assertRowCount(uri, 1); in testInsertStatus() 76 assertEquals(uri, uri2); in testInsertStatus() 78 assertPresence(uri, StatusUpdates.AVAILABLE); in testInsertStatus() [all …]
|
/cts/hostsidetests/scopedstorage/libs/ScopedStorageTestLib/src/android/scopedstorage/cts/lib/ |
D | ResolverAccessTestUtils.java | 47 public static void assertResolver_readWrite(Uri uri, ContentResolver resolver) in assertResolver_readWrite() argument 49 try (ParcelFileDescriptor pfd = resolver.openFileDescriptor(uri, "rw")) { in assertResolver_readWrite() 54 public static void assertResolver_noReadNoWrite(Uri uri, ContentResolver resolver) in assertResolver_noReadNoWrite() argument 56 assertResolver_noRead(uri, resolver); in assertResolver_noReadNoWrite() 57 assertResolver_noWrite(uri, resolver); in assertResolver_noReadNoWrite() 60 public static void assertResolver_noRead(Uri uri, ContentResolver resolver) throws Exception { in assertResolver_noRead() argument 61 try (ParcelFileDescriptor pfd = resolver.openFileDescriptor(uri, "r")) { in assertResolver_noRead() 62 fail("Should not grant read access to uri " + uri.toString()); in assertResolver_noRead() 68 public static void assertResolver_noWrite(Uri uri, ContentResolver resolver) throws Exception { in assertResolver_noWrite() argument 69 try (ParcelFileDescriptor pfd = resolver.openFileDescriptor(uri, "w")) { in assertResolver_noWrite() [all …]
|
/cts/tests/framework/base/windowmanager/util/src/android/server/wm/settings/ |
D | SettingsSession.java | 91 public SettingsSession(final Uri uri, final SettingsGetter<T> getter, in SettingsSession() argument 93 mUri = uri; in SettingsSession() 99 initialValue = get(uri, getter); in SettingsSession() 108 Log.i(TAG, "start: uri=" + uri in SettingsSession() 110 sSessionCounters.open(uri); in SettingsSession() 114 public static <T> TestRule overrideForTest(final Uri uri, final SettingsGetter<T> getter, in overrideForTest() argument 117 SettingsSession<T> session = new SettingsSession<>(uri, getter, setter); in overrideForTest() 156 private static <T> void put(final Uri uri, final SettingsSetter<T> setter, T value) { in put() argument 158 setter.set(getContentResolver(), uri.getLastPathSegment(), value); in put() 162 private static <T> T get(final Uri uri, final SettingsGetter<T> getter) in get() argument [all …]
|
/cts/tests/PhotoPicker/src/android/photopicker/cts/util/ |
D | ResultsAssertionsUtils.java | 57 public static void assertPickerUriFormat(String action, Uri uri, int expectedUserId) { in assertPickerUriFormat() argument 59 final int userId = Integer.parseInt(uri.getPathSegments().get(1)); in assertPickerUriFormat() 62 final String auth = uri.getPathSegments().get(0); in assertPickerUriFormat() 70 public static void assertPersistedGrant(Uri uri, ContentResolver resolver) { in assertPersistedGrant() argument 71 resolver.takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION); in assertPersistedGrant() 81 assertThat(uris).contains(uri); in assertPersistedGrant() 84 public static void assertMimeType(Uri uri, String expectedMimeType) throws Exception { in assertMimeType() argument 86 final String resultMimeType = context.getContentResolver().getType(uri); in assertMimeType() 90 public static void assertContainsMimeType(Uri uri, String[] expectedMimeTypes) { in assertContainsMimeType() argument 92 final String resultMimeType = context.getContentResolver().getType(uri); in assertContainsMimeType() [all …]
|
/cts/hostsidetests/devicepolicy/app/IntentSender/src/com/android/cts/intent/sender/ |
D | ContentTest.java | 87 Uri uri = getUriWithTextInFile("reading_test", MESSAGE); in testReceiverCanRead() local 88 assertNotNull(uri); in testReceiverCanRead() 90 intent.setClipData(ClipData.newRawUri("", uri)); in testReceiverCanRead() 107 Uri uri = getUriWithTextInFile("writing_test", ""); in testReceiverCanWrite() local 108 assertTrue(uri != null); in testReceiverCanWrite() 110 intent.setClipData(ClipData.newRawUri("", uri)); in testReceiverCanWrite() 116 assertEquals(MESSAGE, getFirstLineFromUri(uri)); in testReceiverCanWrite() 120 Uri uri = getUriWithTextInFile("persistable_test", MESSAGE); in testPersistablePermission() local 121 grantPersistableReadPermission(uri); in testPersistablePermission() 125 intent.setClipData(ClipData.newRawUri("", uri)); in testPersistablePermission() [all …]
|
/cts/tests/tests/content/src/android/content/cts/ |
D | IntentFilter_AuthorityEntryTest.java | 57 Uri uri = Uri.parse("testUri"); in testMatch() local 58 assertEquals(IntentFilter.NO_MATCH_DATA, mAuthorityEntry.match(uri)); in testMatch() 59 uri = Uri.parse("content://contacts/deleted_people"); in testMatch() 60 assertEquals(IntentFilter.NO_MATCH_DATA, mAuthorityEntry.match(uri)); in testMatch() 61 uri = Uri.parse("test"); in testMatch() 63 assertEquals(IntentFilter.NO_MATCH_DATA, mAuthorityEntry.match(uri)); in testMatch() 64 uri = Uri.parse("http://" + mHost); in testMatch() 66 assertEquals(IntentFilter.MATCH_CATEGORY_HOST, mAuthorityEntry.match(uri)); in testMatch() 68 uri = Uri.parse("http://" + mHost + ":90"); in testMatch() 70 assertEquals(IntentFilter.MATCH_CATEGORY_HOST, mAuthorityEntry.match(uri)); in testMatch() [all …]
|
D | MockContentProvider.java | 142 public int delete(Uri uri, String selection, String[] selectionArgs) { in delete() argument 147 switch (URL_MATCHER.match(uri)) { in delete() 156 segment = uri.getPathSegments().get(1); in delete() 165 segment = uri.getPathSegments().get(1); in delete() 177 throw new IllegalArgumentException("Unknown URL " + uri); in delete() 180 getContext().getContentResolver().notifyChange(uri, null); in delete() 185 public String getType(Uri uri) { in getType() argument 186 switch (URL_MATCHER.match(uri)) { in getType() 199 throw new IllegalArgumentException("Unknown URL " + uri); in getType() 204 public String[] getStreamTypes(@NonNull Uri uri, @NonNull String mimeTypeFilter) { in getStreamTypes() argument [all …]
|
D | DummyProvider.java | 97 public Uri insert(Uri uri, ContentValues values) { in insert() argument 98 String tbName = getTableName(uri); in insert() 104 getContext().getContentResolver().notifyChange(uri, null); in insert() 105 return uri; in insert() 115 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument 117 String tbName = getTableName(uri); in query() 123 c.setNotificationUri(getContext().getContentResolver(), uri); in query() local 127 private String getTableName(Uri uri) { in getTableName() argument 128 switch (sMatcher.match(uri)) { in getTableName() 162 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument [all …]
|
D | ContentProviderTest.java | 97 Uri uri = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + in testOpenAssetFile() local 101 mockContentProvider.openAssetFile(uri, "r"); in testOpenAssetFile() 159 Uri uri = Uri.parse("content://browser/bookmarks"); in testBulkInsert() local 160 assertEquals(count, mockContentProvider.bulkInsert(uri, values)); in testBulkInsert() 223 Uri uri = Uri.parse("content://test"); in testOpenFile() local 224 mockContentProvider.openFile(uri, "r"); in testOpenFile() 245 Uri uri = Uri.parse("content://test"); in testOpenFileHelper() local 246 assertNotNull(cp.openFile(uri, "r")); in testOpenFileHelper() 249 uri = Uri.parse("content://test"); in testOpenFileHelper() 250 cp.openFile(uri, "wrong"); in testOpenFileHelper() [all …]
|
/cts/tests/mediaprovider/src/android/provider/cts/media/ |
D | MediaStorePlacementTest.java | 90 final Uri uri = MediaProviderTestUtils.stageMedia(R.drawable.scenery, in testDefault() local 94 final File before = MediaProviderTestUtils.getRelativeFile(uri); in testDefault() 102 final Uri uri = MediaProviderTestUtils.stageMedia(R.drawable.scenery, in testIgnored() local 108 assertEquals(0, mContentResolver.update(uri, values, null, null)); in testIgnored() 120 mContentResolver.update(uri, values, null, null); in testIgnored() 129 final Uri uri = MediaProviderTestUtils.stageMedia(R.drawable.scenery, in testDisplayName_SameMime() local 133 final File before = MediaProviderTestUtils.getRelativeFile(uri); in testDisplayName_SameMime() 135 assertTrue(updatePlacement(uri, null, Optional.of(name))); in testDisplayName_SameMime() 137 final File after = MediaProviderTestUtils.getRelativeFile(uri); in testDisplayName_SameMime() 144 final Uri uri = MediaProviderTestUtils.stageMedia(R.drawable.scenery, in testDisplayName_DifferentMime() local [all …]
|
/cts/tests/JobScheduler/src/android/jobscheduler/ |
D | DummyJobContentProvider.java | 86 public Uri insert(Uri uri, ContentValues values) { in insert() argument 87 String tbName = getTableName(uri); in insert() 93 getContext().getContentResolver().notifyChange(uri, null); in insert() 94 return uri; in insert() 104 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument 106 String tbName = getTableName(uri); in query() 112 c.setNotificationUri(getContext().getContentResolver(), uri); in query() local 116 private String getTableName(Uri uri) { in getTableName() argument 117 switch (sMatcher.match(uri)) { in getTableName() 131 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument [all …]
|
/cts/tests/JobSchedulerSharedUid/src/android/jobscheduler/ |
D | DummyJobContentProvider.java | 86 public Uri insert(Uri uri, ContentValues values) { in insert() argument 87 String tbName = getTableName(uri); in insert() 93 getContext().getContentResolver().notifyChange(uri, null); in insert() 94 return uri; in insert() 104 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument 106 String tbName = getTableName(uri); in query() 112 c.setNotificationUri(getContext().getContentResolver(), uri); in query() local 116 private String getTableName(Uri uri) { in getTableName() argument 117 switch (sMatcher.match(uri)) { in getTableName() 131 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument [all …]
|
/cts/tests/tests/telephonyprovider/src/android/telephonyprovider/cts/ |
D | SmsTest.java | 83 Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY); in testSmsInsert() local 84 assertThat(uri).isNotNull(); in testSmsInsert() 86 Cursor cursor = mContentResolver.query(uri, null, null, null); in testSmsInsert() 99 Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY); in testSmsDelete() local 100 assertThat(uri).isNotNull(); in testSmsDelete() 102 int deletedRows = mContentResolver.delete(uri, null, null); in testSmsDelete() 106 Cursor cursor = mContentResolver.query(uri, null, null, null); in testSmsDelete() 117 Uri uri = mSmsTestHelper.insertTestSms(TEST_ADDRESS, TEST_SMS_BODY); in testSmsUpdate() local 118 assertThat(uri).isNotNull(); in testSmsUpdate() 120 mSmsTestHelper.assertSmsColumnEquals(Telephony.Sms.BODY, uri, TEST_SMS_BODY); in testSmsUpdate() [all …]
|
/cts/tests/tests/content/MockRestrictedApp/src/android/content/cts/mockrestrictedapp/ |
D | MockRestrictedProvider.java | 47 public String getType(Uri uri) { in getType() argument 48 switch (mUrlMatcher.match(uri)) { in getType() 54 throw new IllegalArgumentException("Unknown URL " + uri); in getType() 59 public String getTypeAnonymous(Uri uri) { in getTypeAnonymous() argument 60 final String type = getType(uri); in getTypeAnonymous() 69 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, in query() argument 75 public Uri insert(Uri uri, ContentValues values) { in insert() argument 80 public int delete(Uri uri, String selection, in delete() argument 86 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { in update() argument
|
/cts/tests/tests/slice/src/android/slice/cts/ |
D | SliceBindingTest.java | 88 Uri uri = BASE_URI.buildUpon().appendPath("subslice").build(); in testSubSlice() local 89 Slice s = mSliceManager.bindSlice(uri, Collections.emptySet()); in testSubSlice() 90 assertEquals(uri, s.getUri()); in testSubSlice() 97 assertTrue(item.getSlice().getUri().toString().startsWith(uri.toString())); in testSubSlice() 98 assertNotEquals(uri, item.getSlice().getUri()); in testSubSlice() 104 Uri uri = BASE_URI.buildUpon().appendPath("text").build(); in testText() local 105 Slice s = mSliceManager.bindSlice(uri, in testText() 107 assertEquals(uri, s.getUri()); in testText() 119 Uri uri = BASE_URI.buildUpon().appendPath("icon").build(); in testIcon() local 120 Slice s = mSliceManager.bindSlice(uri, in testIcon() [all …]
|
/cts/hostsidetests/devicepolicy/app/IntentReceiver/src/com/android/cts/intent/receiver/ |
D | IntentReceiverActivity.java | 82 final Uri uri = clipData != null ? clipData.getItemAt(0).getUri() : null; in onCreate() local 95 message = getFirstLineFromUri(uri); in onCreate() 97 Log.i(TAG, "Caught a SecurityException while trying to read " + uri, e); in onCreate() 100 Log.i(TAG, "Caught a IOException while trying to read " + uri, e); in onCreate() 106 Log.i(TAG, "Taking persistable uri permission to " + uri); in onCreate() 107 getContentResolver().takePersistableUriPermission(uri, in onCreate() 115 writeToUri(uri, message); in onCreate() 117 Log.i(TAG, "Caught a SecurityException while trying to write to " + uri, e); in onCreate() 120 Log.i(TAG, "Caught a IOException while trying to write to " + uri, e); in onCreate() 124 Log.i(TAG, "Notifying a uri change to " + uri); in onCreate() [all …]
|
/cts/tests/tests/notification/NotificationProvider/src/com/android/test/notificationprovider/ |
D | AssetFileProvider.kt | 29 override fun openAssetFile(uri: Uri, mode: String): AssetFileDescriptor? { in openAssetFile() 31 val filename = uri.lastPathSegment in openAssetFile() 35 return super.openAssetFile(uri, mode) in openAssetFile() 39 uri: Uri, in query() 48 override fun getType(uri: Uri): String? { in getType() 52 override fun insert(uri: Uri, values: ContentValues?): Uri? { in insert() 56 override fun delete(uri: Uri, selection: String?, selectionArgs: Array<String>?): Int { in delete() 61 uri: Uri, in update()
|
/cts/tests/app/app/src/android/app/stubs/ |
D | AssetFileProvider.kt | 27 override fun openAssetFile(uri: Uri, mode: String): AssetFileDescriptor? { in onCreate() 29 val filename = uri.lastPathSegment in onCreate() 33 return super.openAssetFile(uri, mode) in onCreate() 37 uri: Uri, 44 override fun getType(uri: Uri): String? = null 46 override fun insert(uri: Uri, values: ContentValues?): Uri = 49 override fun delete(uri: Uri, selection: String?, selectionArgs: Array<String>?): Int = 53 uri: Uri,
|
/cts/hostsidetests/inputmethodservice/deviceside/provider/src/android/inputmethodservice/cts/provider/ |
D | EventProvider.java | 70 public Cursor query(@NonNull Uri uri, @Nullable String[] projection, @Nullable String selection, in query() argument 72 final UriHelper uriHelper = mUriFactory.newInstance(uri); in query() 75 + " uri=" + uri in query() 88 cursor.setNotificationUri(getContext().getContentResolver(), uri); in query() local 93 public Uri insert(@NonNull Uri uri, @Nullable ContentValues values) { in insert() argument 94 final UriHelper uriHelper = mUriFactory.newInstance(uri); in insert() 96 Log.d(TAG, "insert: uri=" + uri + " values={" + values + "}"); in insert() 99 final Uri insertedUri = ContentUris.withAppendedId(uri, rowId); in insert() 108 public int delete(@NonNull Uri uri, @Nullable String selection, in delete() argument 110 final UriHelper uriHelper = mUriFactory.newInstance(uri); in delete() [all …]
|