导航菜单

页面标题

页面副标题

050 IP Phone v2.3.0 - OutgoingCallService.java 源代码

正在查看: 050 IP Phone v2.3.0 应用的 OutgoingCallService.java JAVA 源代码文件

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


package com.ntt.voip.android.com050plus.client.outgoing;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.IBinder;
import android.os.SystemClock;
import androidx.core.content.ContextCompat;
import o4.e;
import t4.f0;
import t4.l;
import t4.m;
import t4.z;

public class OutgoingCallService extends Service {
    private static final String u0 = s4.b.c + ".action.OUTGOING_CANCEL_TIMEOUT";
    private int X;
    private int Y;
    private boolean Z = false;
    private f0.e s0 = new a();
    private final BroadcastReceiver t0 = new b();
    private AlarmManager x;
    private l y;

    class a extends f0.e {
        a() {
        }

        @Override
        public void e(int i, String str) {
            z.n("OutgoingCallService", "onCallStateChanged: " + i);
            if (i == 2 && OutgoingCallService.this.j() != 2) {
                z.n("OutgoingCallService", "Call start");
                OutgoingCallService.this.Z = true;
            }
            if (i == 0 && OutgoingCallService.this.j() != 0 && OutgoingCallService.this.Z) {
                z.n("OutgoingCallService", "Call end");
                OutgoingCallService.this.i();
            }
            OutgoingCallService.this.k(i);
        }
    }

    class b extends BroadcastReceiver {
        b() {
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            z.n("OutgoingCallService", "onReceive: " + intent);
            if (OutgoingCallService.u0.equals(intent.getAction())) {
                z.n("OutgoingCallService", "time is up");
                OutgoingCallService.this.i();
            }
        }
    }

    private void g() {
        z.n("OutgoingCallService", "Stop cancel timer");
        this.x.cancel(h());
    }

    private PendingIntent h() {
        return PendingIntent.getBroadcast(this, 0, new Intent(u0).setPackage(getPackageName()), 201326592);
    }

    public void i() {
        z.n("OutgoingCallService", "finish");
        g();
        stopSelf();
    }

    public int j() {
        return this.X;
    }

    public void k(int i) {
        this.X = i;
        z.n("OutgoingCallService", "CallState: " + this.X);
    }

    private void l() {
        z.n("OutgoingCallService", "Start cancel timer");
        this.y.a(2, SystemClock.elapsedRealtime() + this.Y, h());
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        z.n("OutgoingCallService", "onCreate");
        super.onCreate();
        k(f0.b(this));
        f0.k(this, this.s0);
        AlarmManager alarmManager = (AlarmManager) getSystemService("alarm");
        this.x = alarmManager;
        this.y = m.d(alarmManager);
        ContextCompat.registerReceiver(this, this.t0, new IntentFilter(u0), 2);
        this.Y = new e(this).j(2131887505, 10) * 1000;
        z.n("OutgoingCallService", "mCancelTimeout: " + this.Y);
        f0.i(this, this.s0);
    }

    @Override
    public void onDestroy() {
        z.n("OutgoingCallService", "onDestroy");
        j3.e.m(this, false);
        super.onDestroy();
        f0.n(this, this.s0);
        unregisterReceiver(this.t0);
    }

    @Override
    public int onStartCommand(Intent intent, int i, int i8) {
        z.n("OutgoingCallService", "onStartCommand");
        g();
        l();
        return 1;
    }
}