From 0fab10eb28ab1e246f572302ad0e12508a196b34 Mon Sep 17 00:00:00 2001 From: zachh Date: Wed, 20 Dec 2017 10:57:38 -0800 Subject: 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 --- java/com/android/dialer/function/BiConsumer.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 java/com/android/dialer/function/BiConsumer.java (limited to 'java/com/android/dialer/function') 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 { + + /** Consumes a value. */ + void accept(T t, U u); +} -- cgit v1.2.3