导航菜单

页面标题

页面副标题

CallApp v2.226 - InCallServiceImpl.java 源代码

正在查看: CallApp v2.226 应用的 InCallServiceImpl.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.callapp.contacts.inCallService;

import android.app.UiModeManager;
import android.content.ComponentName;
import android.content.Intent;
import android.os.IBinder;
import android.telecom.Call;
import android.telecom.CallAudioState;
import android.telecom.InCallService;
import com.callapp.contacts.Init;
import com.callapp.contacts.activity.contact.details.BaseContactDetailsActivity;
import com.callapp.contacts.manager.phone.PhoneManager;
import com.callapp.contacts.manager.phone.PhoneStateManager;
import com.callapp.contacts.manager.preferences.Prefs;
import com.callapp.contacts.model.Constants;
import com.callapp.contacts.model.call.CallData;
import com.callapp.contacts.service.CallAppService;
import com.callapp.contacts.util.CLog;
import com.callapp.framework.util.StringUtils;
import java.util.Objects;

public class InCallServiceImpl extends InCallService {
    public final void a() {
        try {
            PhoneStateManager.isInCarModeState = ((UiModeManager) getSystemService("uimode")).getCurrentModeType() == 3;
        } catch (Exception e) {
            CLog.f("InCallServiceImpl", "InCallServiceImpl exception: " + e.getMessage());
        }
    }

    @Override
    public final IBinder onBind(Intent intent) {
        a();
        if ((!Prefs.f1.get().booleanValue() && !PhoneStateManager.get().isSinchVerificationCall()) || PhoneStateManager.isInCarModeState) {
            return null;
        }
        TelecomAdapter.getInstance().setInCallService(this);
        StringUtils.I(InCallServiceImpl.class);
        CLog.a();
        return super.onBind(intent);
    }

    @Override
    public final void onBringToForeground(boolean z) {
        CallData incomingOrConnectingOrConnectedCall;
        StringUtils.I(InCallServiceImpl.class);
        CLog.a();
        Intent intent = new Intent("com.callapp.contacts.ACTION_START_CALL_SCREEN");
        intent.setComponent(new ComponentName(getApplicationContext(), (Class<?>) CallAppService.class));
        intent.putExtra(BaseContactDetailsActivity.EXTRA_SHOW_KEYPAD, z);
        if (PhoneStateManager.get().shouldConferenceScreenAppear() || (incomingOrConnectingOrConnectedCall = PhoneManager.get().getIncomingOrConnectingOrConnectedCall()) == null) {
            return;
        }
        intent.putExtra(Constants.EXTRA_PHONE_NUMBER, incomingOrConnectingOrConnectedCall.getNumber().getRawNumber());
        intent.putExtra(Constants.EXTRA_IS_INCOMING, incomingOrConnectingOrConnectedCall.isIncoming());
        PhoneStateManager.get().showCallAppIfNeeded(incomingOrConnectingOrConnectedCall, true, z, false);
    }

    @Override
    public final void onCallAdded(Call call) {
        PhoneStateManager.get().onCallAdded(call);
        if (getCallAudioState() != null) {
            PhoneStateManager.get().onAudioStateChanged(getCallAudioState());
        }
        Objects.toString(call);
        StringUtils.I(InCallServiceImpl.class);
        CLog.a();
    }

    @Override
    public final void onCallAudioStateChanged(CallAudioState callAudioState) {
        PhoneStateManager.get().onAudioStateChanged(callAudioState);
        Objects.toString(callAudioState);
        StringUtils.I(InCallServiceImpl.class);
        CLog.a();
        PhoneStateManager.get().handleRinger();
    }

    @Override
    public final void onCallRemoved(Call call) {
        Objects.toString(call);
        StringUtils.I(InCallServiceImpl.class);
        CLog.a();
    }

    @Override
    public final void onCanAddCallChanged(boolean z) {
        StringUtils.I(InCallServiceImpl.class);
        CLog.a();
    }

    @Override
    public final void onCreate() {
        Init.e(null);
        super.onCreate();
    }

    @Override
    public final void onSilenceRinger() {
        StringUtils.I(InCallServiceImpl.class);
        CLog.a();
        PhoneStateManager.get().internalSilenceRinger();
    }

    @Override
    public final boolean onUnbind(Intent intent) {
        super.onUnbind(intent);
        a();
        TelecomAdapter.getInstance().a = null;
        return !PhoneStateManager.isInCarModeState;
    }
}