Loading services/autofill/java/com/android/server/autofill/AutofillManagerService.java +8 −2 Original line number Diff line number Diff line Loading @@ -760,6 +760,12 @@ public final class AutofillManagerService return false; } // Called by Shell command String getFieldDetectionServiceName(@UserIdInt int userId) { enforceCallingPermissionForManagement(); return mFieldClassificationResolver.readServiceName(userId); } // Called by Shell command boolean setTemporaryDetectionService(@UserIdInt int userId, @NonNull String serviceName, int durationMs) { Loading Loading @@ -903,9 +909,9 @@ public final class AutofillManagerService } /** * Whether the Autofill PCC Classification feature is enabled. * Whether the Autofill PCC Classification feature flag is enabled. */ public boolean isPccClassificationEnabled() { public boolean isPccClassificationFlagEnabled() { synchronized (mFlagLock) { return mPccClassificationEnabled; } Loading services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +17 −0 Original line number Diff line number Diff line Loading @@ -1730,6 +1730,23 @@ final class AutofillManagerServiceImpl return mRemoteFieldClassificationService; } public boolean isPccClassificationEnabled() { boolean result = isPccClassificationEnabledInternal(); if (sVerbose) { Slog.v(TAG, "pccEnabled: " + result); } return result; } public boolean isPccClassificationEnabledInternal() { boolean flagEnabled = mMaster.isPccClassificationFlagEnabled(); if (!flagEnabled) return false; synchronized (mLock) { return getRemoteFieldClassificationServiceLocked() != null; } } /** * Called when the {@link AutofillManagerService#mFieldClassificationResolver} * changed (among other places). Loading services/autofill/java/com/android/server/autofill/AutofillManagerServiceShellCommand.java +11 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.RemoteCallback; import android.os.ShellCommand; import android.os.UserHandle; import android.service.autofill.AutofillFieldClassificationService.Scores; import android.text.TextUtils; import android.view.autofill.AutofillManager; import com.android.internal.os.IResultReceiver; Loading Loading @@ -154,6 +155,8 @@ public final class AutofillManagerServiceShellCommand extends ShellCommand { return getBindInstantService(pw); case "default-augmented-service-enabled": return getDefaultAugmentedServiceEnabled(pw); case "field-detection-service-enabled": return isFieldDetectionServiceEnabled(pw); case "saved-password-count": return getSavedPasswordCount(pw); default: Loading Loading @@ -343,6 +346,14 @@ public final class AutofillManagerServiceShellCommand extends ShellCommand { return 0; } private int isFieldDetectionServiceEnabled(PrintWriter pw) { final int userId = getNextIntArgRequired(); String name = mService.getFieldDetectionServiceName(userId); boolean enabled = !TextUtils.isEmpty(name); pw.println(enabled); return 0; } private int setTemporaryAugmentedService(PrintWriter pw) { final int userId = getNextIntArgRequired(); final String serviceName = getNextArg(); Loading services/autofill/java/com/android/server/autofill/Session.java +3 −3 Original line number Diff line number Diff line Loading @@ -798,7 +798,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState * Returns empty list if PCC is off or no types available */ private List<String> getTypeHintsForProvider() { if (!mService.getMaster().isPccClassificationEnabled()) { if (!mService.isPccClassificationEnabled()) { return Collections.EMPTY_LIST; } final String typeHints = mService.getMaster().getPccProviderHints(); Loading Loading @@ -1200,7 +1200,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // structure is taken. This causes only one fill request per burst of focus changes. cancelCurrentRequestLocked(); if (mService.getMaster().isPccClassificationEnabled() if (mService.isPccClassificationEnabled() && mClassificationState.mHintsToAutofillIdMap == null) { if (sVerbose) { Slog.v(TAG, "triggering field classification"); Loading Loading @@ -1631,7 +1631,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState Slog.d(TAG, "DBG: computeDatasetsForProviderAndUpdateContainer: " + autofillProviderContainer); } if (!mService.getMaster().isPccClassificationEnabled()) { if (!mService.isPccClassificationEnabled()) { if (sVerbose) { Slog.v(TAG, "PCC classification is disabled"); } Loading Loading
services/autofill/java/com/android/server/autofill/AutofillManagerService.java +8 −2 Original line number Diff line number Diff line Loading @@ -760,6 +760,12 @@ public final class AutofillManagerService return false; } // Called by Shell command String getFieldDetectionServiceName(@UserIdInt int userId) { enforceCallingPermissionForManagement(); return mFieldClassificationResolver.readServiceName(userId); } // Called by Shell command boolean setTemporaryDetectionService(@UserIdInt int userId, @NonNull String serviceName, int durationMs) { Loading Loading @@ -903,9 +909,9 @@ public final class AutofillManagerService } /** * Whether the Autofill PCC Classification feature is enabled. * Whether the Autofill PCC Classification feature flag is enabled. */ public boolean isPccClassificationEnabled() { public boolean isPccClassificationFlagEnabled() { synchronized (mFlagLock) { return mPccClassificationEnabled; } Loading
services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +17 −0 Original line number Diff line number Diff line Loading @@ -1730,6 +1730,23 @@ final class AutofillManagerServiceImpl return mRemoteFieldClassificationService; } public boolean isPccClassificationEnabled() { boolean result = isPccClassificationEnabledInternal(); if (sVerbose) { Slog.v(TAG, "pccEnabled: " + result); } return result; } public boolean isPccClassificationEnabledInternal() { boolean flagEnabled = mMaster.isPccClassificationFlagEnabled(); if (!flagEnabled) return false; synchronized (mLock) { return getRemoteFieldClassificationServiceLocked() != null; } } /** * Called when the {@link AutofillManagerService#mFieldClassificationResolver} * changed (among other places). Loading
services/autofill/java/com/android/server/autofill/AutofillManagerServiceShellCommand.java +11 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.os.RemoteCallback; import android.os.ShellCommand; import android.os.UserHandle; import android.service.autofill.AutofillFieldClassificationService.Scores; import android.text.TextUtils; import android.view.autofill.AutofillManager; import com.android.internal.os.IResultReceiver; Loading Loading @@ -154,6 +155,8 @@ public final class AutofillManagerServiceShellCommand extends ShellCommand { return getBindInstantService(pw); case "default-augmented-service-enabled": return getDefaultAugmentedServiceEnabled(pw); case "field-detection-service-enabled": return isFieldDetectionServiceEnabled(pw); case "saved-password-count": return getSavedPasswordCount(pw); default: Loading Loading @@ -343,6 +346,14 @@ public final class AutofillManagerServiceShellCommand extends ShellCommand { return 0; } private int isFieldDetectionServiceEnabled(PrintWriter pw) { final int userId = getNextIntArgRequired(); String name = mService.getFieldDetectionServiceName(userId); boolean enabled = !TextUtils.isEmpty(name); pw.println(enabled); return 0; } private int setTemporaryAugmentedService(PrintWriter pw) { final int userId = getNextIntArgRequired(); final String serviceName = getNextArg(); Loading
services/autofill/java/com/android/server/autofill/Session.java +3 −3 Original line number Diff line number Diff line Loading @@ -798,7 +798,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState * Returns empty list if PCC is off or no types available */ private List<String> getTypeHintsForProvider() { if (!mService.getMaster().isPccClassificationEnabled()) { if (!mService.isPccClassificationEnabled()) { return Collections.EMPTY_LIST; } final String typeHints = mService.getMaster().getPccProviderHints(); Loading Loading @@ -1200,7 +1200,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // structure is taken. This causes only one fill request per burst of focus changes. cancelCurrentRequestLocked(); if (mService.getMaster().isPccClassificationEnabled() if (mService.isPccClassificationEnabled() && mClassificationState.mHintsToAutofillIdMap == null) { if (sVerbose) { Slog.v(TAG, "triggering field classification"); Loading Loading @@ -1631,7 +1631,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState Slog.d(TAG, "DBG: computeDatasetsForProviderAndUpdateContainer: " + autofillProviderContainer); } if (!mService.getMaster().isPccClassificationEnabled()) { if (!mService.isPccClassificationEnabled()) { if (sVerbose) { Slog.v(TAG, "PCC classification is disabled"); } Loading