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

Commit e4b63199 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Reset the whitelist helper for augmented autofill and content capture when service changes."

parents ec35184b 59e96e14
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -1149,6 +1149,7 @@ final class AutofillManagerServiceImpl
                mRemoteAugmentedAutofillService.destroy();
                mRemoteAugmentedAutofillService = null;
                mRemoteAugmentedAutofillServiceInfo = null;
                resetAugmentedAutofillWhitelistLocked();
            }

            final boolean available = isAugmentedAutofillServiceAvailableLocked();
@@ -1180,6 +1181,7 @@ final class AutofillManagerServiceImpl
     *
     * @return whether caller UID is the augmented autofill service for the user
     */
    @GuardedBy("mLock")
    boolean setAugmentedAutofillWhitelistLocked(List<String> packages,
            List<ComponentName> activities, int callingUid) {

@@ -1267,10 +1269,20 @@ final class AutofillManagerServiceImpl
                Slog.v(TAG, "whitelisting packages: " + packages + "and activities: " + components);
            }
            mAugmentedWhitelistHelper.setWhitelist(packages, components);
            mRemoteAugmentedAutofillService = getRemoteAugmentedAutofillServiceLocked();
        }
    }

    /**
     * Resets the augmented autofill whitelist.
     */
    @GuardedBy("mLock")
    void resetAugmentedAutofillWhitelistLocked() {
        if (mMaster.verbose) {
            Slog.v(TAG, "resetting augmented autofill whitelist");
        }
        whitelistForAugmentedAutofillPackages(null, null);
    }

    private void sendStateToClients(boolean resetClient) {
        final RemoteCallbackList<IAutoFillManagerClient> clients;
        final int userClientCount;
+12 −1
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ final class ContentCapturePerUserService
            if (mMaster.debug) Slog.d(TAG, "updateRemoteService(): destroying old remote service");
            mRemoteService.destroy();
            mRemoteService = null;
            resetContentCaptureWhitelistLocked();
        }

        // Updates the component name
@@ -551,6 +552,17 @@ final class ContentCapturePerUserService
        return null;
    }

    /**
     * Resets the content capture whitelist.
     */
    @GuardedBy("mLock")
    private void resetContentCaptureWhitelistLocked() {
        if (mMaster.verbose) {
            Slog.v(TAG, "resetting content capture whitelist");
        }
        mWhitelistHelper.setWhitelist((List) null, null);
    }

    private final class ContentCaptureServiceRemoteCallback extends
            IContentCaptureServiceCallback.Stub {

@@ -567,7 +579,6 @@ final class ContentCapturePerUserService
            synchronized (mLock) {
                mWhitelistHelper.setWhitelist(packages, activities);
            }
            // TODO(b/119613670): log metrics
        }

        @Override