summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/enrichedcall/historyquery
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/android/dialer/enrichedcall/historyquery')
-rw-r--r--java/com/android/dialer/enrichedcall/historyquery/HistoryQuery.java46
-rw-r--r--java/com/android/dialer/enrichedcall/historyquery/proto/history_result.proto23
2 files changed, 69 insertions, 0 deletions
diff --git a/java/com/android/dialer/enrichedcall/historyquery/HistoryQuery.java b/java/com/android/dialer/enrichedcall/historyquery/HistoryQuery.java
new file mode 100644
index 000000000..e61c79ec8
--- /dev/null
+++ b/java/com/android/dialer/enrichedcall/historyquery/HistoryQuery.java
@@ -0,0 +1,46 @@
+/*
+ * 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.
+ */
+package com.android.dialer.enrichedcall.historyquery;
+
+import android.support.annotation.NonNull;
+import com.android.dialer.common.LogUtil;
+import com.google.auto.value.AutoValue;
+
+/**
+ * Data object representing the pieces of information required to query for historical enriched call
+ * data.
+ */
+@AutoValue
+public abstract class HistoryQuery {
+
+ @NonNull
+ public static HistoryQuery create(@NonNull String number, long callStartTime, long callEndTime) {
+ return new AutoValue_HistoryQuery(number, callStartTime, callEndTime);
+ }
+
+ public abstract String getNumber();
+
+ public abstract long getCallStartTimestamp();
+
+ public abstract long getCallEndTimestamp();
+
+ @Override
+ public String toString() {
+ return String.format(
+ "HistoryQuery{number: %s, callStartTimestamp: %d, callEndTimestamp: %d}",
+ LogUtil.sanitizePhoneNumber(getNumber()), getCallStartTimestamp(), getCallEndTimestamp());
+ }
+}
diff --git a/java/com/android/dialer/enrichedcall/historyquery/proto/history_result.proto b/java/com/android/dialer/enrichedcall/historyquery/proto/history_result.proto
new file mode 100644
index 000000000..62d013a46
--- /dev/null
+++ b/java/com/android/dialer/enrichedcall/historyquery/proto/history_result.proto
@@ -0,0 +1,23 @@
+syntax = "proto2";
+
+option java_package = "com.android.dialer.enrichedcall.historyquery.proto";
+option java_multiple_files = true;
+option optimize_for = LITE_RUNTIME;
+
+package com.android.dialer.enrichedcall.historyquery.proto;
+
+// Holds data that was used in an enrichedcall in the past
+message HistoryResult {
+ optional Type type = 1;
+ optional string text = 2;
+ optional string image_uri = 4;
+ optional string image_content_type = 5;
+ optional int64 timestamp = 7;
+
+ enum Type {
+ INCOMING_CALL_COMPOSER = 1;
+ OUTGOING_CALL_COMPOSER = 2;
+ INCOMING_POST_CALL = 3;
+ OUTGOING_POST_CALL = 4;
+ }
+}