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

Commit f3776fd3 authored by Reema Bajwa's avatar Reema Bajwa
Browse files

Remove Credentials flags for security fix.

Bug: 346514527
Flag: android.credentials.flags.package_update_fix_enabled

Change-Id: I19239effd673861fbf671991c5d5044c101e6cda
parent 95a16504
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);
            }
        }
    }