summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/function
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2017-12-20 10:57:38 -0800
committerEric Erfanian <erfanian@google.com>2017-12-22 08:53:44 -0800
commit0fab10eb28ab1e246f572302ad0e12508a196b34 (patch)
tree6fb4d96f0c6e2d9e31ab92fb7a3da5d50384a26d /java/com/android/dialer/function
parent48609d015f06e262796b7ce8a088243199940a8a (diff)
Added copySubMessage method to PhoneLookup interface.
The existing way that protos are merged in CompositePhoneLookup is not correct because foo_submessage from BarDataSource may incorrectly contribute old information to the merged message. The new copySubMessage method makes it so that each PhoneLookup is responsible for defining which submessage it is responsible for and prevents the problem. Test: unit PiperOrigin-RevId: 179707015 Change-Id: I566305cf64c46c698f14812d9241d166ac75a6d3
Diffstat (limited to 'java/com/android/dialer/function')
-rw-r--r--java/com/android/dialer/function/BiConsumer.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/java/com/android/dialer/function/BiConsumer.java b/java/com/android/dialer/function/BiConsumer.java
new file mode 100644
index 000000000..50052210e
--- /dev/null
+++ b/java/com/android/dialer/function/BiConsumer.java
@@ -0,0 +1,24 @@
+/*
+ * 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.function;
+
+/** Functional interface for consuming two generic values. */
+public interface BiConsumer<T, U> {
+
+ /** Consumes a value. */
+ void accept(T t, U u);
+}