Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -48636,6 +48636,7 @@ package android.view.autofill { method public void cancel(); method public void commit(); method public void disableAutofillServices(); method public android.content.ComponentName getAutofillServiceComponentName(); method public android.service.autofill.UserData getUserData(); method public boolean hasEnabledAutofillServices(); method public boolean isAutofillSupported(); core/java/android/view/autofill/AutofillManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -1008,6 +1008,21 @@ public final class AutofillManager { } } /** * Returns the component name of the {@link AutofillService} that is enabled for the current * user. */ @Nullable public ComponentName getAutofillServiceComponentName() { if (mService == null) return null; try { return mService.getAutofillServiceComponentName(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets the user data used for * <a href="AutofillService.html#FieldClassification">field classification</a>. Loading core/java/android/view/autofill/IAutoFillManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -57,4 +57,5 @@ interface IAutoFillManager { UserData getUserData(); void setUserData(in UserData userData); boolean isFieldClassificationEnabled(); ComponentName getAutofillServiceComponentName(); } services/autofill/java/com/android/server/autofill/AutofillManagerService.java +26 −16 Original line number Diff line number Diff line Loading @@ -568,13 +568,12 @@ public final class AutofillManagerService extends SystemService { @Override public FillEventHistory getFillEventHistory() throws RemoteException { UserHandle user = getCallingUserHandle(); int uid = getCallingUid(); final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { AutofillManagerServiceImpl service = peekServiceForUserLocked(user.getIdentifier()); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { return service.getFillEventHistory(uid); return service.getFillEventHistory(getCallingUid()); } } Loading @@ -583,13 +582,12 @@ public final class AutofillManagerService extends SystemService { @Override public UserData getUserData() throws RemoteException { UserHandle user = getCallingUserHandle(); int uid = getCallingUid(); final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { AutofillManagerServiceImpl service = peekServiceForUserLocked(user.getIdentifier()); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { return service.getUserData(uid); return service.getUserData(getCallingUid()); } } Loading @@ -598,32 +596,44 @@ public final class AutofillManagerService extends SystemService { @Override public void setUserData(UserData userData) throws RemoteException { UserHandle user = getCallingUserHandle(); int uid = getCallingUid(); final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { AutofillManagerServiceImpl service = peekServiceForUserLocked(user.getIdentifier()); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { service.setUserData(uid, userData); service.setUserData(getCallingUid(), userData); } } } @Override public boolean isFieldClassificationEnabled() throws RemoteException { UserHandle user = getCallingUserHandle(); int uid = getCallingUid(); final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { AutofillManagerServiceImpl service = peekServiceForUserLocked(user.getIdentifier()); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { return service.isFieldClassificationEnabled(); return service.isFieldClassificationEnabled(getCallingUid()); } } return false; } @Override public ComponentName getAutofillServiceComponentName() throws RemoteException { final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { return service.getServiceComponentName(); } } return null; } @Override public boolean restoreSession(int sessionId, IBinder activityToken, IBinder appCallback) throws RemoteException { Loading services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +13 −2 Original line number Diff line number Diff line Loading @@ -835,7 +835,7 @@ final class AutofillManagerServiceImpl { pw.println(mContext.getString(R.string.config_defaultAutofillService)); pw.print(prefix); pw.print("Disabled: "); pw.println(mDisabled); pw.print(prefix); pw.print("Field classification enabled: "); pw.println(isFieldClassificationEnabled()); pw.println(isFieldClassificationEnabledLocked()); pw.print(prefix); pw.print("Setup complete: "); pw.println(mSetupComplete); pw.print(prefix); pw.print("Last prune: "); pw.println(mLastPrune); Loading Loading @@ -1095,7 +1095,18 @@ final class AutofillManagerServiceImpl { return false; } boolean isFieldClassificationEnabled() { // Called by AutofillManager, checks UID. boolean isFieldClassificationEnabled(int uid) { synchronized (mLock) { if (!isCalledByServiceLocked("isFieldClassificationEnabled", uid)) { return false; } return isFieldClassificationEnabledLocked(); } } // Called by internally, no need to check UID. boolean isFieldClassificationEnabledLocked() { return Settings.Secure.getIntForUser( mContext.getContentResolver(), Settings.Secure.AUTOFILL_FEATURE_FIELD_CLASSIFICATION, 0, Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -48636,6 +48636,7 @@ package android.view.autofill { method public void cancel(); method public void commit(); method public void disableAutofillServices(); method public android.content.ComponentName getAutofillServiceComponentName(); method public android.service.autofill.UserData getUserData(); method public boolean hasEnabledAutofillServices(); method public boolean isAutofillSupported();
core/java/android/view/autofill/AutofillManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -1008,6 +1008,21 @@ public final class AutofillManager { } } /** * Returns the component name of the {@link AutofillService} that is enabled for the current * user. */ @Nullable public ComponentName getAutofillServiceComponentName() { if (mService == null) return null; try { return mService.getAutofillServiceComponentName(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Gets the user data used for * <a href="AutofillService.html#FieldClassification">field classification</a>. Loading
core/java/android/view/autofill/IAutoFillManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -57,4 +57,5 @@ interface IAutoFillManager { UserData getUserData(); void setUserData(in UserData userData); boolean isFieldClassificationEnabled(); ComponentName getAutofillServiceComponentName(); }
services/autofill/java/com/android/server/autofill/AutofillManagerService.java +26 −16 Original line number Diff line number Diff line Loading @@ -568,13 +568,12 @@ public final class AutofillManagerService extends SystemService { @Override public FillEventHistory getFillEventHistory() throws RemoteException { UserHandle user = getCallingUserHandle(); int uid = getCallingUid(); final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { AutofillManagerServiceImpl service = peekServiceForUserLocked(user.getIdentifier()); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { return service.getFillEventHistory(uid); return service.getFillEventHistory(getCallingUid()); } } Loading @@ -583,13 +582,12 @@ public final class AutofillManagerService extends SystemService { @Override public UserData getUserData() throws RemoteException { UserHandle user = getCallingUserHandle(); int uid = getCallingUid(); final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { AutofillManagerServiceImpl service = peekServiceForUserLocked(user.getIdentifier()); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { return service.getUserData(uid); return service.getUserData(getCallingUid()); } } Loading @@ -598,32 +596,44 @@ public final class AutofillManagerService extends SystemService { @Override public void setUserData(UserData userData) throws RemoteException { UserHandle user = getCallingUserHandle(); int uid = getCallingUid(); final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { AutofillManagerServiceImpl service = peekServiceForUserLocked(user.getIdentifier()); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { service.setUserData(uid, userData); service.setUserData(getCallingUid(), userData); } } } @Override public boolean isFieldClassificationEnabled() throws RemoteException { UserHandle user = getCallingUserHandle(); int uid = getCallingUid(); final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { AutofillManagerServiceImpl service = peekServiceForUserLocked(user.getIdentifier()); final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { return service.isFieldClassificationEnabled(); return service.isFieldClassificationEnabled(getCallingUid()); } } return false; } @Override public ComponentName getAutofillServiceComponentName() throws RemoteException { final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { final AutofillManagerServiceImpl service = peekServiceForUserLocked(userId); if (service != null) { return service.getServiceComponentName(); } } return null; } @Override public boolean restoreSession(int sessionId, IBinder activityToken, IBinder appCallback) throws RemoteException { Loading
services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +13 −2 Original line number Diff line number Diff line Loading @@ -835,7 +835,7 @@ final class AutofillManagerServiceImpl { pw.println(mContext.getString(R.string.config_defaultAutofillService)); pw.print(prefix); pw.print("Disabled: "); pw.println(mDisabled); pw.print(prefix); pw.print("Field classification enabled: "); pw.println(isFieldClassificationEnabled()); pw.println(isFieldClassificationEnabledLocked()); pw.print(prefix); pw.print("Setup complete: "); pw.println(mSetupComplete); pw.print(prefix); pw.print("Last prune: "); pw.println(mLastPrune); Loading Loading @@ -1095,7 +1095,18 @@ final class AutofillManagerServiceImpl { return false; } boolean isFieldClassificationEnabled() { // Called by AutofillManager, checks UID. boolean isFieldClassificationEnabled(int uid) { synchronized (mLock) { if (!isCalledByServiceLocked("isFieldClassificationEnabled", uid)) { return false; } return isFieldClassificationEnabledLocked(); } } // Called by internally, no need to check UID. boolean isFieldClassificationEnabledLocked() { return Settings.Secure.getIntForUser( mContext.getContentResolver(), Settings.Secure.AUTOFILL_FEATURE_FIELD_CLASSIFICATION, 0, Loading