18779efd5Sopenharmony_ci/** 28779efd5Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 38779efd5Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 48779efd5Sopenharmony_ci * you may not use this file except in compliance with the License. 58779efd5Sopenharmony_ci * You may obtain a copy of the License at 68779efd5Sopenharmony_ci * 78779efd5Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 88779efd5Sopenharmony_ci * 98779efd5Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 108779efd5Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 118779efd5Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128779efd5Sopenharmony_ci * See the License for the specific language governing permissions and 138779efd5Sopenharmony_ci * limitations under the License. 148779efd5Sopenharmony_ci */ 158779efd5Sopenharmony_ci 168779efd5Sopenharmony_ciimport { CallLog } from '../entity/CallLog'; 178779efd5Sopenharmony_ciimport Calls from '../contract/Calls'; 188779efd5Sopenharmony_ci 198779efd5Sopenharmony_ciexport default class CallLogDelta { 208779efd5Sopenharmony_ci readonly callLog: CallLog; 218779efd5Sopenharmony_ci constructor(callLog: CallLog) { 228779efd5Sopenharmony_ci this.callLog = callLog; 238779efd5Sopenharmony_ci } 248779efd5Sopenharmony_ci 258779efd5Sopenharmony_ci createValuesBucket(): {} { 268779efd5Sopenharmony_ci if (!this.callLog) { 278779efd5Sopenharmony_ci return []; 288779efd5Sopenharmony_ci } 298779efd5Sopenharmony_ci 308779efd5Sopenharmony_ci return { 318779efd5Sopenharmony_ci [Calls.PHONE_NUMBER]: this.callLog.phoneNumber, 328779efd5Sopenharmony_ci [Calls.DISPLAY_NAME]: this.callLog.displayName, 338779efd5Sopenharmony_ci [Calls.CALL_DIRECTION]: this.callLog.callDirection, 348779efd5Sopenharmony_ci [Calls.VOICEMAIL_URI]: this.callLog.voicemailUri, 358779efd5Sopenharmony_ci [Calls.SIM_TYPE]: this.callLog.simType, 368779efd5Sopenharmony_ci [Calls.IS_HD]: this.callLog.isHD, 378779efd5Sopenharmony_ci [Calls.IS_READ]: this.callLog.isRead, 388779efd5Sopenharmony_ci [Calls.RING_DURATION]: this.callLog.ringDuration, 398779efd5Sopenharmony_ci [Calls.TALK_DURATION]: this.callLog.talkDuration, 408779efd5Sopenharmony_ci [Calls.FORMAT_NUMBER]: this.callLog.formattedNumber, 418779efd5Sopenharmony_ci [Calls.QUICK_SEARCH_KEY]: this.callLog.quickSearchKey, 428779efd5Sopenharmony_ci [Calls.NUMBER_TYPE]: this.callLog.numberType, 438779efd5Sopenharmony_ci [Calls.BEGIN_TIME]: this.callLog.beginTime, 448779efd5Sopenharmony_ci [Calls.END_TIME]: this.callLog.endTime, 458779efd5Sopenharmony_ci [Calls.ANSWER_STATE]: this.callLog.answerState, 468779efd5Sopenharmony_ci [Calls.CREATE_TIME]: this.callLog.createTime, 478779efd5Sopenharmony_ci [Calls.NUMBER_LOCATION]: this.callLog.numberLocation, 488779efd5Sopenharmony_ci [Calls.PHOTO_ID]: this.callLog.photoId, 498779efd5Sopenharmony_ci [Calls.PHOTO_URI]: this.callLog.photoUri, 508779efd5Sopenharmony_ci [Calls.COUNTRY_ISO_CODE]: this.callLog.countryIsoCode, 518779efd5Sopenharmony_ci }; 528779efd5Sopenharmony_ci } 538779efd5Sopenharmony_ci}