diff options
| author | 2017-05-13 03:54:18 +0000 | |
|---|---|---|
| committer | 2017-05-13 03:54:23 +0000 | |
| commit | 5fd8672d71319ca2b2238b486aee3ac6c7aa7ad8 (patch) | |
| tree | 557e21fb4e9a78867c2210d1e189a7ab4731ab5b | |
| parent | e85b6e4a1f97247aea1d246bd56517abbabfb7ef (diff) | |
| parent | 7a1deb7c5f2c57df4f905ba997863a03d363a53e (diff) | |
Merge "Couple autofill fixes." into oc-dev
4 files changed, 23 insertions, 8 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 02ac9bd6db9b..d3d753b3ee8f 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -2770,6 +2770,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * 1 PFLAG3_HAS_OVERLAPPING_RENDERING_FORCED * 1 PFLAG3_TEMPORARY_DETACH * 1 PFLAG3_NO_REVEAL_ON_FOCUS + * 1 PFLAG3_NOTIFY_AUTOFILL_ENTER_ON_LAYOUT * |-------|-------|-------|-------| */ @@ -2858,14 +2859,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ static final int PFLAG3_SCROLL_INDICATOR_END = 0x2000; - /** - * Flag indicating that when layout is completed we should notify - * that the view was entered for autofill purposes. To minimize - * showing autofill for views not visible to the user we evaluate - * user visibility which cannot be done until the view is laid out. - */ - static final int PFLAG3_NOTIFY_AUTOFILL_ENTER_ON_LAYOUT = 0x4000; - static final int DRAG_MASK = PFLAG2_DRAG_CAN_ACCEPT | PFLAG2_DRAG_HOVERED; static final int SCROLL_INDICATORS_NONE = 0x0000; @@ -3050,6 +3043,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ private static final int PFLAG3_NO_REVEAL_ON_FOCUS = 0x4000000; + /** + * Flag indicating that when layout is completed we should notify + * that the view was entered for autofill purposes. To minimize + * showing autofill for views not visible to the user we evaluate + * user visibility which cannot be done until the view is laid out. + */ + static final int PFLAG3_NOTIFY_AUTOFILL_ENTER_ON_LAYOUT = 0x8000000; + /* End of masks for mPrivateFlags3 */ /** diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java index 41a78a760f60..cbeaa3e20f34 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java @@ -335,6 +335,7 @@ public final class AutofillManagerService extends SystemService { void listSessions(int userId, IResultReceiver receiver) { Slog.i(TAG, "listSessions() for userId " + userId); mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG); + final Bundle resultData = new Bundle(); final ArrayList<String> sessions = new ArrayList<>(); @@ -364,6 +365,7 @@ public final class AutofillManagerService extends SystemService { void reset() { Slog.i(TAG, "reset()"); mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG); + synchronized (mLock) { final int size = mServicesCache.size(); for (int i = 0; i < size; i++) { @@ -376,6 +378,8 @@ public final class AutofillManagerService extends SystemService { // Called by Shell command. void setLogLevel(int level) { Slog.i(TAG, "setLogLevel(): " + level); + mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG); + boolean debug = false; boolean verbose = false; if (level == AutofillManager.FLAG_ADD_CLIENT_VERBOSE) { @@ -391,6 +395,8 @@ public final class AutofillManagerService extends SystemService { // Called by Shell command. int getLogLevel() { + mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG); + synchronized (mLock) { if (sVerbose) return AutofillManager.FLAG_ADD_CLIENT_VERBOSE; if (sDebug) return AutofillManager.FLAG_ADD_CLIENT_DEBUG; @@ -400,6 +406,8 @@ public final class AutofillManagerService extends SystemService { // Called by Shell command. public int getMaxPartitions() { + mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG); + synchronized (mLock) { return sPartitionMaxCount; } @@ -407,6 +415,7 @@ public final class AutofillManagerService extends SystemService { // Called by Shell command. public void setMaxPartitions(int max) { + mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG); Slog.i(TAG, "setMaxPartitions(): " + max); synchronized (mLock) { sPartitionMaxCount = max; diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 6d58e72bf53f..4de293ca6847 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -818,6 +818,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } if (atLeastOneChanged) { + if (sDebug) Slog.d(TAG, "at least one field changed - showing save UI"); mService.setSaveShown(); getUiForShowing().showSaveUi(mService.getServiceLabel(), saveInfo, mPackageName, this); diff --git a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java index 4f69f644f5e8..c3d550549a3f 100644 --- a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java +++ b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java @@ -16,6 +16,7 @@ package com.android.server.autofill.ui; import static com.android.server.autofill.Helper.sDebug; +import static com.android.server.autofill.Helper.sVerbose; import android.annotation.NonNull; import android.annotation.Nullable; @@ -108,6 +109,8 @@ public final class AutoFillUI { * Displays an error message to the user. */ public void showError(@Nullable CharSequence message, @NonNull AutoFillUiCallback callback) { + Slog.w(TAG, "showError(): " + message); + mHandler.post(() -> { if (mCallback != callback) { return; @@ -237,6 +240,7 @@ public final class AutoFillUI { */ public void showSaveUi(@NonNull CharSequence providerLabel, @NonNull SaveInfo info, @NonNull String packageName, @NonNull AutoFillUiCallback callback) { + if (sVerbose) Slog.v(TAG, "showSaveUi() for " + packageName + ": " + info); int numIds = 0; numIds += info.getRequiredIds() == null ? 0 : info.getRequiredIds().length; numIds += info.getOptionalIds() == null ? 0 : info.getOptionalIds().length; |