Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8567a36 authored by Ashish Kumar Gaurav's avatar Ashish Kumar Gaurav Committed by Automerger Merge Worker
Browse files

Merge "Fixing tests failure due to unhandled exceptions" into udc-dev am: a67b2834

parents 7df04761 a67b2834
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -342,15 +342,16 @@ public abstract class ContentProvider implements ContentInterface, ComponentCall
            final int enumCheckUriPermission =
                    GET_TYPE_ACCESSED_WITHOUT_PERMISSION__LOCATION__PROVIDER_CHECK_URI_PERMISSION;
            if (permissionCheckPassed) {
                try {
                    // Just for logging for mediaProvider cases
                    final ProviderInfo cpi = mContext.getPackageManager()
                            .resolveContentProvider(uri.getAuthority(),
                                PackageManager.ComponentInfoFlags.of(PackageManager.GET_META_DATA));
                                    PackageManager.ComponentInfoFlags.of(
                                            PackageManager.GET_META_DATA));
                    final int callingUserId = UserHandle.getUserId(callingUid);
                    final Uri userUri = (mSingleUser
                            && !UserHandle.isSameUser(mMyUid, callingUid))
                            ? maybeAddUserId(uri, callingUserId) : uri;
                try {
                    if (cpi.forceUriPermissions
                            && mInterface.checkUriPermission(uri,
                            callingUid, Intent.FLAG_GRANT_READ_URI_PERMISSION)
+7 −2
Original line number Diff line number Diff line
@@ -930,7 +930,8 @@ public abstract class ContentResolver implements ContentInterface {
        if (provider != null) {
            try {
                final StringResultListener resultListener = new StringResultListener();
                provider.getTypeAsync(url, new RemoteCallback(resultListener));
                provider.getTypeAsync(mContext.getAttributionSource(),
                        url, new RemoteCallback(resultListener));
                resultListener.waitForResult(CONTENT_PROVIDER_TIMEOUT_MILLIS);
                if (resultListener.exception != null) {
                    throw resultListener.exception;
@@ -944,7 +945,11 @@ public abstract class ContentResolver implements ContentInterface {
                Log.w(TAG, "Failed to get type for: " + url + " (" + e.getMessage() + ")");
                return null;
            } finally {
                try {
                    releaseProvider(provider);
                } catch (java.lang.NullPointerException e) {
                    // does nothing, Binder connection already null
                }
            }
        }