15dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh/* 25dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * Copyright (C) 2018 The Android Open Source Project 35dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * 45dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * Licensed under the Apache License, Version 2.0 (the "License"); 55dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * you may not use this file except in compliance with the License. 65dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * You may obtain a copy of the License at 75dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * 85dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * http://www.apache.org/licenses/LICENSE-2.0 95dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * 105dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * Unless required by applicable law or agreed to in writing, software 115dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * distributed under the License is distributed on an "AS IS" BASIS, 125dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * See the License for the specific language governing permissions and 145dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh * limitations under the License 155dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh */ 165dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh 175dd30438fd3e4384b57cef3c7606ec20fad9b50dzachhpackage com.android.dialer.calllogutils; 185dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh 195dd30438fd3e4384b57cef3c7606ec20fad9b50dzachhimport com.android.dialer.calllog.model.CoalescedRow; 205dd30438fd3e4384b57cef3c7606ec20fad9b50dzachhimport com.android.dialer.lettertile.LetterTileDrawable; 215dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh 225dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh/** Determines the {@link LetterTileDrawable.ContactType} for a {@link CoalescedRow}. */ 235dd30438fd3e4384b57cef3c7606ec20fad9b50dzachhpublic class CallLogContactTypes { 245dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh 255dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh /** Determines the {@link LetterTileDrawable.ContactType} for a {@link CoalescedRow}. */ 265dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh @LetterTileDrawable.ContactType 275dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh public static int getContactType(CoalescedRow row) { 285dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh // TODO(zachh): Set these fields correctly. 295dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh boolean isVoicemail = false; 305dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh boolean isSpam = false; 315dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh boolean isBusiness = false; 3203b13198537df025febb842db7f95794a1faad8fzachh int numberPresentation = row.numberPresentation(); 335dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh boolean isConference = false; 345dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh 355dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh return LetterTileDrawable.getContactTypeFromPrimitives( 365dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh isVoicemail, isSpam, isBusiness, numberPresentation, isConference); 375dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh } 385dd30438fd3e4384b57cef3c7606ec20fad9b50dzachh} 39