Loading core/java/android/app/Activity.java +45 −21 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import android.os.RemoteException; import android.os.ServiceManager.ServiceNotFoundException; import android.os.StrictMode; import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; import android.text.Selection; import android.text.SpannableStringBuilder; Loading Loading @@ -1049,8 +1050,28 @@ public class Activity extends ContextThemeWrapper @Retention(RetentionPolicy.SOURCE) @interface ContentCaptureNotificationType{} private String getContentCaptureTypeAsString(@ContentCaptureNotificationType int type) { switch (type) { case CONTENT_CAPTURE_START: return "START"; case CONTENT_CAPTURE_PAUSE: return "PAUSE"; case CONTENT_CAPTURE_RESUME: return "RESUME"; case CONTENT_CAPTURE_STOP: return "STOP"; default: return "UNKNOW-" + type; } } private void notifyContentCaptureManagerIfNeeded(@ContentCaptureNotificationType int type) { if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) { Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "notifyContentCapture(" + getContentCaptureTypeAsString(type) + ") for " + mComponent.toShortString()); } try { final ContentCaptureManager cm = getContentCaptureManager(); if (cm == null) return; Loading @@ -1077,6 +1098,9 @@ public class Activity extends ContextThemeWrapper default: Log.wtf(TAG, "Invalid @ContentCaptureNotificationType: " + type); } } finally { Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } } @Override Loading core/java/android/view/View.java +21 −1 Original line number Diff line number Diff line Loading @@ -8227,7 +8227,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * </ul> */ public void onProvideContentCaptureStructure(@NonNull ViewStructure structure, int flags) { if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.traceBegin(Trace.TRACE_TAG_VIEW, "onProvideContentCaptureStructure() for " + getClass().getSimpleName()); } try { onProvideStructure(structure, VIEW_STRUCTURE_FOR_CONTENT_CAPTURE, flags); } finally { Trace.traceEnd(Trace.TRACE_TAG_VIEW); } } /** @hide */ Loading Loading @@ -9017,6 +9025,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * </ol> */ private void notifyAppearedOrDisappearedForContentCaptureIfNeeded(boolean appeared) { if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.traceBegin(Trace.TRACE_TAG_VIEW, "notifyContentCapture(" + appeared + ") for " + getClass().getSimpleName()); } try { notifyAppearedOrDisappearedForContentCaptureIfNeededNoTrace(appeared); } finally { Trace.traceEnd(Trace.TRACE_TAG_VIEW); } } private void notifyAppearedOrDisappearedForContentCaptureIfNeededNoTrace(boolean appeared) { // First check if context has client, so it saves a service lookup when it doesn't if (!mContext.isContentCaptureSupported()) return; Loading
core/java/android/app/Activity.java +45 −21 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import android.os.RemoteException; import android.os.ServiceManager.ServiceNotFoundException; import android.os.StrictMode; import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; import android.text.Selection; import android.text.SpannableStringBuilder; Loading Loading @@ -1049,8 +1050,28 @@ public class Activity extends ContextThemeWrapper @Retention(RetentionPolicy.SOURCE) @interface ContentCaptureNotificationType{} private String getContentCaptureTypeAsString(@ContentCaptureNotificationType int type) { switch (type) { case CONTENT_CAPTURE_START: return "START"; case CONTENT_CAPTURE_PAUSE: return "PAUSE"; case CONTENT_CAPTURE_RESUME: return "RESUME"; case CONTENT_CAPTURE_STOP: return "STOP"; default: return "UNKNOW-" + type; } } private void notifyContentCaptureManagerIfNeeded(@ContentCaptureNotificationType int type) { if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) { Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "notifyContentCapture(" + getContentCaptureTypeAsString(type) + ") for " + mComponent.toShortString()); } try { final ContentCaptureManager cm = getContentCaptureManager(); if (cm == null) return; Loading @@ -1077,6 +1098,9 @@ public class Activity extends ContextThemeWrapper default: Log.wtf(TAG, "Invalid @ContentCaptureNotificationType: " + type); } } finally { Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } } @Override Loading
core/java/android/view/View.java +21 −1 Original line number Diff line number Diff line Loading @@ -8227,7 +8227,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * </ul> */ public void onProvideContentCaptureStructure(@NonNull ViewStructure structure, int flags) { if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.traceBegin(Trace.TRACE_TAG_VIEW, "onProvideContentCaptureStructure() for " + getClass().getSimpleName()); } try { onProvideStructure(structure, VIEW_STRUCTURE_FOR_CONTENT_CAPTURE, flags); } finally { Trace.traceEnd(Trace.TRACE_TAG_VIEW); } } /** @hide */ Loading Loading @@ -9017,6 +9025,18 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * </ol> */ private void notifyAppearedOrDisappearedForContentCaptureIfNeeded(boolean appeared) { if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { Trace.traceBegin(Trace.TRACE_TAG_VIEW, "notifyContentCapture(" + appeared + ") for " + getClass().getSimpleName()); } try { notifyAppearedOrDisappearedForContentCaptureIfNeededNoTrace(appeared); } finally { Trace.traceEnd(Trace.TRACE_TAG_VIEW); } } private void notifyAppearedOrDisappearedForContentCaptureIfNeededNoTrace(boolean appeared) { // First check if context has client, so it saves a service lookup when it doesn't if (!mContext.isContentCaptureSupported()) return;