From 41a25211de08327c5178fb5f168e1154871a08d6 Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Tue, 27 Mar 2018 10:54:13 -0400 Subject: [PATCH] fix SliceMetrics typo and disambiguate logTouch Bug: 76461931, 76461916 Test: make docs Change-Id: I25c453effbfa7037c036eed81aac26fff30cc55a --- api/current.txt | 2 +- core/java/android/app/slice/SliceMetrics.java | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/api/current.txt b/api/current.txt index be5e3e70d0a2b..682b97f39feeb 100644 --- a/api/current.txt +++ b/api/current.txt @@ -7279,7 +7279,7 @@ package android.app.slice { public class SliceMetrics { ctor public SliceMetrics(android.content.Context, android.net.Uri); method public void logHidden(); - method public void logTouch(android.net.Uri); + method public void logTouch(int, android.net.Uri); method public void logVisible(); } diff --git a/core/java/android/app/slice/SliceMetrics.java b/core/java/android/app/slice/SliceMetrics.java index a7069bc107d45..20c1390b25ff7 100644 --- a/core/java/android/app/slice/SliceMetrics.java +++ b/core/java/android/app/slice/SliceMetrics.java @@ -25,7 +25,7 @@ /** * Metrics interface for slices. * - * This is called by SliceView, so Slice develoers should + * This is called by SliceView, so Slice developers should * not need to reference this class. * * @see androidx.slice.widget.SliceView @@ -55,9 +55,18 @@ public void logHidden() { } /** - * To be called whenever the use interacts with a slice. - *@param subSlice The URI of the sub-slice that is the subject of the interaction. + * To be called whenever the user invokes a discrete action via a slice. + * + *

+ * Use this for discrete events like a tap or the end of a drag, + * not for a continuous streams of events, such as the motion during a gesture. + *

+ * + * @see androidx.slice.widget.EventInfo#actionType + * + * @param actionType The type of the event. + * @param subSlice The URI of the sub-slice that is the subject of the interaction. */ - public void logTouch(@NonNull Uri subSlice) { + public void logTouch(int actionType, @NonNull Uri subSlice) { } }