10646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda/*
20646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * Copyright (C) 2011 The Android Open Source Project
30646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda *
40646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * Licensed under the Apache License, Version 2.0 (the "License");
50646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * you may not use this file except in compliance with the License.
60646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * You may obtain a copy of the License at
70646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda *
80646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda *      http://www.apache.org/licenses/LICENSE-2.0
90646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda *
100646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * Unless required by applicable law or agreed to in writing, software
110646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * distributed under the License is distributed on an "AS IS" BASIS,
120646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
130646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * See the License for the specific language governing permissions and
140646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * limitations under the License.
150646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda */
160646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda
170646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerdapackage com.android.contacts.calllog;
180646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda
190646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerdaimport android.content.res.Resources;
200646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda
210646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda/**
220646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * Modified version of {@link PhoneNumberHelper} to be used in tests that allows injecting the
230646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda * voicemail number.
240646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda */
250646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerdapublic final class TestPhoneNumberHelper extends PhoneNumberHelper {
260646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda    private CharSequence mVoicemailNumber;
270646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda
280646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda    public TestPhoneNumberHelper(Resources resources, CharSequence voicemailNumber) {
290646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda        super(resources);
300646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda        mVoicemailNumber = voicemailNumber;
310646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda    }
320646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda
330646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda    @Override
340646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda    public boolean isVoicemailNumber(CharSequence number) {
350646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda        return mVoicemailNumber.equals(number);
360646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda    }
370646f2712e8b4a5ada51bd586d5f179d38a304c5Flavio Lerda}