summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk9
-rw-r--r--build.gradle6
-rw-r--r--proto_overrides/launcher_log_extension.proto30
-rw-r--r--protos/launcher_log.proto6
-rw-r--r--src/com/android/launcher3/logging/LoggerUtils.java8
5 files changed, 53 insertions, 6 deletions
diff --git a/Android.mk b/Android.mk
index c8a53d23d..0543b4244 100644
--- a/Android.mk
+++ b/Android.mk
@@ -33,7 +33,8 @@ LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
$(call all-java-files-under, src_config) \
$(call all-java-files-under, src_flags) \
- $(call all-proto-files-under, protos)
+ $(call all-proto-files-under, protos) \
+ $(call all-proto-files-under, proto_overrides)
LOCAL_RESOURCE_DIR := \
$(LOCAL_PATH)/res \
@@ -42,7 +43,7 @@ LOCAL_RESOURCE_DIR := \
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_PROTOC_OPTIMIZE_TYPE := nano
-LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/protos/
+LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/protos/ --proto_path=$(LOCAL_PATH)/proto_overrides/
LOCAL_PROTO_JAVA_OUTPUT_PARAMS := enum_style=java
LOCAL_AAPT_FLAGS := \
@@ -66,10 +67,10 @@ include $(BUILD_PACKAGE)
#
include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-proto-files-under, protos)
+LOCAL_SRC_FILES := $(call all-proto-files-under, protos) $(call all-proto-files-under, proto_overrides)
LOCAL_PROTOC_OPTIMIZE_TYPE := nano
-LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/protos/
+LOCAL_PROTOC_FLAGS := --proto_path=$(LOCAL_PATH)/protos/ --proto_path=$(LOCAL_PATH)/proto_overrides/
LOCAL_PROTO_JAVA_OUTPUT_PARAMS := enum_style=java
LOCAL_MODULE_TAGS := optional
diff --git a/build.gradle b/build.gradle
index c23a29920..79ee111f5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -41,7 +41,10 @@ android {
res.srcDirs = ['res']
java.srcDirs = ['src', 'src_flags']
manifest.srcFile 'AndroidManifest-common.xml'
- proto.srcDirs 'protos/'
+ proto {
+ srcDir 'protos/'
+ srcDir 'proto_overrides/'
+ }
}
androidTest {
@@ -92,6 +95,7 @@ protobuf {
task.builtins {
remove java
javanano {
+ option "java_package=launcher_log_extension.proto|com.android.launcher3.userevent.nano"
option "java_package=launcher_log.proto|com.android.launcher3.userevent.nano"
option "java_package=launcher_dump.proto|com.android.launcher3.model.nano"
option "enum_style=java"
diff --git a/proto_overrides/launcher_log_extension.proto b/proto_overrides/launcher_log_extension.proto
new file mode 100644
index 000000000..2995aa283
--- /dev/null
+++ b/proto_overrides/launcher_log_extension.proto
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+syntax = "proto2";
+
+option java_package = "com.android.launcher3.userevent";
+option java_outer_classname = "LauncherLogExtensions";
+
+package userevent;
+
+//
+// Use this to add any app specific extensions to the proto.
+//
+message LauncherEventExtension {
+}
+
+message TargetExtension {
+}
diff --git a/protos/launcher_log.proto b/protos/launcher_log.proto
index 93e09aea8..0bbec188d 100644
--- a/protos/launcher_log.proto
+++ b/protos/launcher_log.proto
@@ -15,6 +15,8 @@
*/
syntax = "proto2";
+import "launcher_log_extension.proto";
+
option java_package = "com.android.launcher3.userevent";
option java_outer_classname = "LauncherLogProto";
@@ -52,6 +54,7 @@ message Target {
optional int32 span_x = 13 [default = 1];// Used for ItemType.WIDGET
optional int32 span_y = 14 [default = 1];// Used for ItemType.WIDGET
optional int32 predictedRank = 15;
+ optional TargetExtension extension = 16;
}
// Used to define what type of item a Target would represent.
@@ -144,7 +147,6 @@ message Action {
// Action (Touch) + Target + Target
//
message LauncherEvent {
-
required Action action = 1;
// List of targets that touch actions can be operated on.
@@ -157,4 +159,6 @@ message LauncherEvent {
optional bool is_in_multi_window_mode = 7;
optional bool is_in_landscape_mode = 8;
+
+ optional LauncherEventExtension extension = 9;
}
diff --git a/src/com/android/launcher3/logging/LoggerUtils.java b/src/com/android/launcher3/logging/LoggerUtils.java
index 72a083b9e..ebb69c43b 100644
--- a/src/com/android/launcher3/logging/LoggerUtils.java
+++ b/src/com/android/launcher3/logging/LoggerUtils.java
@@ -25,6 +25,7 @@ import com.android.launcher3.InfoDropTarget;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.UninstallDropTarget;
+import com.android.launcher3.userevent.nano.LauncherLogExtensions.TargetExtension;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.ControlType;
@@ -159,6 +160,13 @@ public class LoggerUtils {
return t;
}
+ public static Target newTarget(int targetType, TargetExtension extension) {
+ Target t = new Target();
+ t.type = targetType;
+ t.extension = extension;
+ return t;
+ }
+
public static Target newTarget(int targetType) {
Target t = new Target();
t.type = targetType;