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

Commit e7ba61fd authored by Reema Bajwa's avatar Reema Bajwa Committed by Android (Google) Code Review
Browse files

Merge "Remove Credentials flags for security fix." into main

parents ac5db318 f3776fd3
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.UserInfo;
import android.credentials.flags.Flags;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.Binder;
@@ -1180,13 +1179,12 @@ public abstract class AbstractMasterSystemService<M extends AbstractMasterSystem
                final String[] serviceNames = mServiceNameResolver.getDefaultServiceNameList(
                        userId);
                if (serviceNames != null) {
                    if (Flags.packageUpdateFixEnabled()) {
                    if (mServiceNameResolver.isConfiguredInMultipleMode()) {
                            // Remove any service that is in the cache but is no longer valid
                            // after this modification for this particular package
                            removeInvalidCachedServicesLocked(serviceNames, packageName,
                                    userId);
                        }
                        // Remove any service that is in the cache but is no
                        // longer valid after this modification for this
                        //particular package
                        removeInvalidCachedServicesLocked(serviceNames,
                            packageName, userId);
                    }

                    // Update services that are still valid
+8 −16
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.credentials.CredentialManager;
import android.credentials.CredentialProviderInfo;
import android.credentials.flags.Flags;
import android.service.credentials.CredentialProviderInfoFactory;
import android.service.credentials.CredentialProviderService;
import android.util.Slog;
@@ -161,21 +160,14 @@ public final class CredentialManagerServiceImpl extends
        if (mInfo != null && mInfo.getServiceInfo() != null
                && mInfo.getServiceInfo().getComponentName()
                .getPackageName().equals(packageName)) {
            if (Flags.packageUpdateFixEnabled()) {
            try {
                    updateCredentialProviderInfo(mInfo.getServiceInfo().getComponentName(),
                            mInfo.isSystemProvider());
                updateCredentialProviderInfo(mInfo.getServiceInfo()
                    .getComponentName(), mInfo.isSystemProvider());
            } catch (SecurityException | PackageManager.NameNotFoundException
                     | NullPointerException e) {
                Slog.w(TAG, "Unable to update provider, must be removed: " + e.getMessage());
                    mMaster.handleServiceRemovedMultiModeLocked(mInfo.getComponentName(), mUserId);
                }
            } else {
                try {
                    newServiceInfoLocked(mInfo.getServiceInfo().getComponentName());
                } catch (PackageManager.NameNotFoundException e) {
                    Slog.e(TAG, "Issue while updating serviceInfo: " + e.getMessage());
                }
                mMaster.handleServiceRemovedMultiModeLocked(
                    mInfo.getComponentName(), mUserId);
            }
        }
    }