Loading api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -4992,6 +4992,7 @@ package android.service.intelligence { } } public final class FillRequest { public final class FillRequest { method public android.view.autofill.AutofillValue getFocusedAutofillValue(); method public android.view.autofill.AutofillId getFocusedId(); method public android.view.autofill.AutofillId getFocusedId(); method public android.service.intelligence.PresentationParams getPresentationParams(); method public android.service.intelligence.PresentationParams getPresentationParams(); method public android.service.intelligence.InteractionSessionId getSessionId(); method public android.service.intelligence.InteractionSessionId getSessionId(); Loading core/java/android/service/intelligence/FillCallback.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -15,8 +15,10 @@ */ */ package android.service.intelligence; package android.service.intelligence; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.service.intelligence.SmartSuggestionsService.AutofillProxy; /** /** * Callback used to indicate at {@link FillRequest} has been fulfilled. * Callback used to indicate at {@link FillRequest} has been fulfilled. Loading @@ -25,8 +27,11 @@ import android.annotation.SystemApi; */ */ @SystemApi @SystemApi public final class FillCallback { public final class FillCallback { private final AutofillProxy mProxy; FillCallback() {} FillCallback(@NonNull AutofillProxy proxy) { mProxy = proxy; } /** /** * Sets the response associated with the request. * Sets the response associated with the request. Loading @@ -35,6 +40,7 @@ public final class FillCallback { * could not provide autofill for the request. * could not provide autofill for the request. */ */ public void onSuccess(@Nullable FillResponse response) { public void onSuccess(@Nullable FillResponse response) { mProxy.report(AutofillProxy.REPORT_EVENT_ON_SUCCESS); final FillWindow fillWindow = response.getFillWindow(); final FillWindow fillWindow = response.getFillWindow(); if (fillWindow != null) { if (fillWindow != null) { fillWindow.show(); fillWindow.show(); Loading core/java/android/service/intelligence/FillRequest.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.service.intelligence.SmartSuggestionsService.AutofillProxy; import android.service.intelligence.SmartSuggestionsService.AutofillProxy; import android.view.autofill.AutofillId; import android.view.autofill.AutofillId; import android.view.autofill.AutofillValue; /** /** * Represents a request to augment-fill an activity. * Represents a request to augment-fill an activity. Loading Loading @@ -51,6 +52,14 @@ public final class FillRequest { return mProxy.focusedId; return mProxy.focusedId; } } /** * Gets the current value of the field that triggered the request. */ @NonNull public AutofillValue getFocusedAutofillValue() { return mProxy.focusedValue; } /** /** * Gets the Smart Suggestions object used to embed the autofill UI. * Gets the Smart Suggestions object used to embed the autofill UI. * * Loading core/java/android/service/intelligence/FillWindow.java +32 −6 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.SystemApi; import android.app.Dialog; import android.app.Dialog; import android.graphics.Rect; import android.graphics.Rect; import android.service.intelligence.PresentationParams.Area; import android.service.intelligence.PresentationParams.Area; import android.service.intelligence.SmartSuggestionsService.AutofillProxy; import android.util.Log; import android.util.Log; import android.view.Gravity; import android.view.Gravity; import android.view.View; import android.view.View; Loading @@ -33,6 +34,8 @@ import android.view.WindowManager; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.GuardedBy; import com.android.internal.util.Preconditions; import com.android.internal.util.Preconditions; import dalvik.system.CloseGuard; import java.io.PrintWriter; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -73,6 +76,7 @@ public final class FillWindow { @interface Flags{} @interface Flags{} private final Object mLock = new Object(); private final Object mLock = new Object(); private final CloseGuard mCloseGuard = CloseGuard.get(); @GuardedBy("mLock") @GuardedBy("mLock") private Dialog mDialog; private Dialog mDialog; Loading @@ -80,6 +84,8 @@ public final class FillWindow { @GuardedBy("mLock") @GuardedBy("mLock") private boolean mDestroyed; private boolean mDestroyed; private AutofillProxy mProxy; /** /** * Updates the content of the window. * Updates the content of the window. * * Loading Loading @@ -123,6 +129,8 @@ public final class FillWindow { synchronized (mLock) { synchronized (mLock) { checkNotDestroyedLocked(); checkNotDestroyedLocked(); mProxy = area.proxy; // TODO(b/111330312): once we have the SurfaceControl approach, we should update the // TODO(b/111330312): once we have the SurfaceControl approach, we should update the // window instead of destroying. In fact, it might be better to allocate a full window // window instead of destroying. In fact, it might be better to allocate a full window // initially, which is transparent (and let touches get through) everywhere but in the // initially, which is transparent (and let touches get through) everywhere but in the Loading @@ -133,6 +141,7 @@ public final class FillWindow { // etc. // etc. mDialog = new Dialog(rootView.getContext()); mDialog = new Dialog(rootView.getContext()); mCloseGuard.open("destroy"); final Window window = mDialog.getWindow(); final Window window = mDialog.getWindow(); window.setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); window.setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); Loading @@ -156,7 +165,7 @@ public final class FillWindow { Log.d(TAG, "Created FillWindow: params= " + smartSuggestion + " view=" + rootView); Log.d(TAG, "Created FillWindow: params= " + smartSuggestion + " view=" + rootView); } } area.proxy.setFillWindow(this); mProxy.setFillWindow(this); return true; return true; } } } } Loading @@ -173,6 +182,9 @@ public final class FillWindow { } } mDialog.show(); mDialog.show(); if (mProxy != null) { mProxy.report(AutofillProxy.REPORT_EVENT_UI_SHOWN); } } } } } Loading @@ -182,15 +194,29 @@ public final class FillWindow { * <p>Once destroyed, this window cannot be used anymore * <p>Once destroyed, this window cannot be used anymore */ */ public void destroy() { public void destroy() { if (DEBUG) Log.d(TAG, "destroy(): mDestroyed = " + mDestroyed); if (DEBUG) Log.d(TAG, "destroy(): mDestroyed=" + mDestroyed + " mDialog=" + mDialog); synchronized (this) { synchronized (this) { if (mDestroyed) return; if (mDestroyed || mDialog == null) return; if (mDialog != null) { mDialog.dismiss(); mDialog.dismiss(); mDialog = null; mDialog = null; if (mProxy != null) { mProxy.report(AutofillProxy.REPORT_EVENT_UI_DESTROYED); } } mCloseGuard.close(); } } @Override protected void finalize() throws Throwable { try { if (mCloseGuard != null) { mCloseGuard.warnIfOpen(); } destroy(); } finally { super.finalize(); } } } } Loading core/java/android/service/intelligence/IIntelligenceService.aidl +3 −1 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.service.intelligence.InteractionContext; import android.service.intelligence.SnapshotData; import android.service.intelligence.SnapshotData; import android.view.autofill.AutofillId; import android.view.autofill.AutofillId; import android.view.autofill.AutofillValue; import android.view.intelligence.ContentCaptureEvent; import android.view.intelligence.ContentCaptureEvent; import java.util.List; import java.util.List; Loading @@ -45,7 +46,8 @@ oneway interface IIntelligenceService { in SnapshotData snapshotData); in SnapshotData snapshotData); void onAutofillRequest(in InteractionSessionId sessionId, in IBinder autofillManagerClient, void onAutofillRequest(in InteractionSessionId sessionId, in IBinder autofillManagerClient, int autofilSessionId, in AutofillId focusedId); int autofilSessionId, in AutofillId focusedId, in AutofillValue focusedValue, long requestTime); void onDestroyAutofillWindowsRequest(in InteractionSessionId sessionId); void onDestroyAutofillWindowsRequest(in InteractionSessionId sessionId); } } Loading
api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -4992,6 +4992,7 @@ package android.service.intelligence { } } public final class FillRequest { public final class FillRequest { method public android.view.autofill.AutofillValue getFocusedAutofillValue(); method public android.view.autofill.AutofillId getFocusedId(); method public android.view.autofill.AutofillId getFocusedId(); method public android.service.intelligence.PresentationParams getPresentationParams(); method public android.service.intelligence.PresentationParams getPresentationParams(); method public android.service.intelligence.InteractionSessionId getSessionId(); method public android.service.intelligence.InteractionSessionId getSessionId(); Loading
core/java/android/service/intelligence/FillCallback.java +7 −1 Original line number Original line Diff line number Diff line Loading @@ -15,8 +15,10 @@ */ */ package android.service.intelligence; package android.service.intelligence; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.service.intelligence.SmartSuggestionsService.AutofillProxy; /** /** * Callback used to indicate at {@link FillRequest} has been fulfilled. * Callback used to indicate at {@link FillRequest} has been fulfilled. Loading @@ -25,8 +27,11 @@ import android.annotation.SystemApi; */ */ @SystemApi @SystemApi public final class FillCallback { public final class FillCallback { private final AutofillProxy mProxy; FillCallback() {} FillCallback(@NonNull AutofillProxy proxy) { mProxy = proxy; } /** /** * Sets the response associated with the request. * Sets the response associated with the request. Loading @@ -35,6 +40,7 @@ public final class FillCallback { * could not provide autofill for the request. * could not provide autofill for the request. */ */ public void onSuccess(@Nullable FillResponse response) { public void onSuccess(@Nullable FillResponse response) { mProxy.report(AutofillProxy.REPORT_EVENT_ON_SUCCESS); final FillWindow fillWindow = response.getFillWindow(); final FillWindow fillWindow = response.getFillWindow(); if (fillWindow != null) { if (fillWindow != null) { fillWindow.show(); fillWindow.show(); Loading
core/java/android/service/intelligence/FillRequest.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.Nullable; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.service.intelligence.SmartSuggestionsService.AutofillProxy; import android.service.intelligence.SmartSuggestionsService.AutofillProxy; import android.view.autofill.AutofillId; import android.view.autofill.AutofillId; import android.view.autofill.AutofillValue; /** /** * Represents a request to augment-fill an activity. * Represents a request to augment-fill an activity. Loading Loading @@ -51,6 +52,14 @@ public final class FillRequest { return mProxy.focusedId; return mProxy.focusedId; } } /** * Gets the current value of the field that triggered the request. */ @NonNull public AutofillValue getFocusedAutofillValue() { return mProxy.focusedValue; } /** /** * Gets the Smart Suggestions object used to embed the autofill UI. * Gets the Smart Suggestions object used to embed the autofill UI. * * Loading
core/java/android/service/intelligence/FillWindow.java +32 −6 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.SystemApi; import android.app.Dialog; import android.app.Dialog; import android.graphics.Rect; import android.graphics.Rect; import android.service.intelligence.PresentationParams.Area; import android.service.intelligence.PresentationParams.Area; import android.service.intelligence.SmartSuggestionsService.AutofillProxy; import android.util.Log; import android.util.Log; import android.view.Gravity; import android.view.Gravity; import android.view.View; import android.view.View; Loading @@ -33,6 +34,8 @@ import android.view.WindowManager; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.GuardedBy; import com.android.internal.util.Preconditions; import com.android.internal.util.Preconditions; import dalvik.system.CloseGuard; import java.io.PrintWriter; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy; Loading Loading @@ -73,6 +76,7 @@ public final class FillWindow { @interface Flags{} @interface Flags{} private final Object mLock = new Object(); private final Object mLock = new Object(); private final CloseGuard mCloseGuard = CloseGuard.get(); @GuardedBy("mLock") @GuardedBy("mLock") private Dialog mDialog; private Dialog mDialog; Loading @@ -80,6 +84,8 @@ public final class FillWindow { @GuardedBy("mLock") @GuardedBy("mLock") private boolean mDestroyed; private boolean mDestroyed; private AutofillProxy mProxy; /** /** * Updates the content of the window. * Updates the content of the window. * * Loading Loading @@ -123,6 +129,8 @@ public final class FillWindow { synchronized (mLock) { synchronized (mLock) { checkNotDestroyedLocked(); checkNotDestroyedLocked(); mProxy = area.proxy; // TODO(b/111330312): once we have the SurfaceControl approach, we should update the // TODO(b/111330312): once we have the SurfaceControl approach, we should update the // window instead of destroying. In fact, it might be better to allocate a full window // window instead of destroying. In fact, it might be better to allocate a full window // initially, which is transparent (and let touches get through) everywhere but in the // initially, which is transparent (and let touches get through) everywhere but in the Loading @@ -133,6 +141,7 @@ public final class FillWindow { // etc. // etc. mDialog = new Dialog(rootView.getContext()); mDialog = new Dialog(rootView.getContext()); mCloseGuard.open("destroy"); final Window window = mDialog.getWindow(); final Window window = mDialog.getWindow(); window.setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); window.setType(WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY); Loading @@ -156,7 +165,7 @@ public final class FillWindow { Log.d(TAG, "Created FillWindow: params= " + smartSuggestion + " view=" + rootView); Log.d(TAG, "Created FillWindow: params= " + smartSuggestion + " view=" + rootView); } } area.proxy.setFillWindow(this); mProxy.setFillWindow(this); return true; return true; } } } } Loading @@ -173,6 +182,9 @@ public final class FillWindow { } } mDialog.show(); mDialog.show(); if (mProxy != null) { mProxy.report(AutofillProxy.REPORT_EVENT_UI_SHOWN); } } } } } Loading @@ -182,15 +194,29 @@ public final class FillWindow { * <p>Once destroyed, this window cannot be used anymore * <p>Once destroyed, this window cannot be used anymore */ */ public void destroy() { public void destroy() { if (DEBUG) Log.d(TAG, "destroy(): mDestroyed = " + mDestroyed); if (DEBUG) Log.d(TAG, "destroy(): mDestroyed=" + mDestroyed + " mDialog=" + mDialog); synchronized (this) { synchronized (this) { if (mDestroyed) return; if (mDestroyed || mDialog == null) return; if (mDialog != null) { mDialog.dismiss(); mDialog.dismiss(); mDialog = null; mDialog = null; if (mProxy != null) { mProxy.report(AutofillProxy.REPORT_EVENT_UI_DESTROYED); } } mCloseGuard.close(); } } @Override protected void finalize() throws Throwable { try { if (mCloseGuard != null) { mCloseGuard.warnIfOpen(); } destroy(); } finally { super.finalize(); } } } } Loading
core/java/android/service/intelligence/IIntelligenceService.aidl +3 −1 Original line number Original line Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.service.intelligence.InteractionContext; import android.service.intelligence.SnapshotData; import android.service.intelligence.SnapshotData; import android.view.autofill.AutofillId; import android.view.autofill.AutofillId; import android.view.autofill.AutofillValue; import android.view.intelligence.ContentCaptureEvent; import android.view.intelligence.ContentCaptureEvent; import java.util.List; import java.util.List; Loading @@ -45,7 +46,8 @@ oneway interface IIntelligenceService { in SnapshotData snapshotData); in SnapshotData snapshotData); void onAutofillRequest(in InteractionSessionId sessionId, in IBinder autofillManagerClient, void onAutofillRequest(in InteractionSessionId sessionId, in IBinder autofillManagerClient, int autofilSessionId, in AutofillId focusedId); int autofilSessionId, in AutofillId focusedId, in AutofillValue focusedValue, long requestTime); void onDestroyAutofillWindowsRequest(in InteractionSessionId sessionId); void onDestroyAutofillWindowsRequest(in InteractionSessionId sessionId); } }