导航菜单

页面标题

页面副标题

Rilo v2.0.21 - VideoCallService.java 源代码

正在查看: Rilo v2.0.21 应用的 VideoCallService.java JAVA 源代码文件

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


package app.callpe.service;

import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Person;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Icon;
import android.os.Build;
import android.os.IBinder;
import androidx.core.app.NotificationCompat;
import androidx.core.app.ServiceCompat;
import app.callpe.App;
import app.callpe.common.agora.LiveStreamEvent;
import app.callpe.common.agora.LiveStreamEventTypes;
import app.callpe.common.utils.Constants;
import app.callpe.common.utils.RxBus;
import app.callpe.common.utils.receivers.VideoCallBroadcastReceiver;
import app.callpe.common.utils.sharedpref.PrefKeys;
import app.callpe.common.utils.sharedpref.SharedPref;
import app.callpe.data.model.StreamerModel;
import app.callpe.data.model.VideoDetailModel;
import app.callpe.ui.call.RtcScreenHandler;
import app.callpe.ui.login.LoginActivity;
import com.google.gson.Gson;
import dagger.hilt.android.AndroidEntryPoint;
import java.util.concurrent.CancellationException;
import javax.inject.Inject;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.Job;

@Metadata(d1 = {"\u0000~\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\b\u0007\u0018\u0000 ;2\u00020\u0001:\u0001;B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0017\u001a\u00020\u0018H\u0003J\u0012\u0010\u0019\u001a\u0004\u0018\u00010\u001a2\u0006\u0010\u001b\u001a\u00020\u001aH\u0002J\u001b\u0010\u001c\u001a\u0004\u0018\u00010\u001d2\u0006\u0010\u001e\u001a\u00020\u0004H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010\u001fJ\u001b\u0010 \u001a\u0004\u0018\u00010\u001d2\u0006\u0010\u001e\u001a\u00020\u0004H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010\u001fJ\b\u0010!\u001a\u00020\u0018H\u0002J\b\u0010\"\u001a\u00020#H\u0003J\u0018\u0010$\u001a\u00020%2\u0006\u0010&\u001a\u00020'2\u0006\u0010(\u001a\u00020\u000bH\u0002J\u0012\u0010)\u001a\u00020#2\b\u0010*\u001a\u0004\u0018\u00010+H\u0002J\u001b\u0010,\u001a\u0004\u0018\u00010\u001a2\u0006\u0010\u001e\u001a\u00020\u0004H\u0082@ø\u0001\u0000¢\u0006\u0002\u0010\u001fJ\u0012\u0010-\u001a\u0004\u0018\u00010.2\u0006\u0010*\u001a\u00020+H\u0016J\b\u0010/\u001a\u00020#H\u0016J\"\u00100\u001a\u00020%2\b\u0010*\u001a\u0004\u0018\u00010+2\u0006\u00101\u001a\u00020%2\u0006\u00102\u001a\u00020%H\u0016J\b\u00103\u001a\u00020#H\u0002J*\u00104\u001a\u00020#2\b\u00105\u001a\u0004\u0018\u00010\u00042\u0006\u00106\u001a\u0002072\u0006\u00108\u001a\u0002092\u0006\u0010:\u001a\u000209H\u0003R\u0010\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0006\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\t\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010\f\u001a\u00020\r8\u0006@\u0006X\u0087.¢\u0006\u000e\n\u0000\u001a\u0004\b\u000e\u0010\u000f\"\u0004\b\u0010\u0010\u0011R\u0010\u0010\u0012\u001a\u0004\u0018\u00010\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0013\u001a\u0004\u0018\u00010\u0014X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0015\u001a\u00020\u0016X\u0082\u000e¢\u0006\u0002\n\u0000\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006<"}, d2 = {"Lapp/callpe/service/VideoCallService;", "Landroid/app/Service;", "()V", "accessToken", "", "callType", "caller", "job", "Lkotlinx/coroutines/Job;", "mChannel", "notificationUpdateFailed", "", "rxBus", "Lapp/callpe/common/utils/RxBus;", "getRxBus", "()Lapp/callpe/common/utils/RxBus;", "setRxBus", "(Lapp/callpe/common/utils/RxBus;)V", "userIconJob", "videoDetails", "Lapp/callpe/data/model/VideoDetailModel;", "videoId", "", "createCallStyleNotification", "Landroid/app/Notification;", "createCircularBitmap", "Landroid/graphics/Bitmap;", "bitmap", "createIcon", "Landroid/graphics/drawable/Icon;", "url", "(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "createIconFromUrl", "createNotification", "createNotificationChanel", "", "getNotificationIcon", "", "notificationBuilder", "Landroidx/core/app/NotificationCompat$Builder;", "isAudio", "getVideoDetails", "intent", "Landroid/content/Intent;", "loadImage", "onBind", "Landroid/os/IBinder;", "onDestroy", "onStartCommand", "flags", "startId", "sendEndEvent", "updateCallNotification", "personImage", "personBuilder", "Landroid/app/Person$Builder;", "pendingIntent", "Landroid/app/PendingIntent;", "hangUpPendingIntent", "Companion", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
@AndroidEntryPoint
public final class VideoCallService extends Hilt_VideoCallService {

    public static final Companion INSTANCE = new Companion(null);
    public static final long INTERVAL = 2000;
    public static final int MAX_TRY = 3;
    private static boolean isOngoingCallWebView;
    private static boolean isPriorityVideoCallServiceRunning;
    private static boolean isVideoCallServiceRunning;
    private String accessToken;
    private String caller;
    private Job job;
    private String mChannel;
    private boolean notificationUpdateFailed;

    @Inject
    public RxBus rxBus;
    private Job userIconJob;
    private VideoDetailModel videoDetails;
    private long videoId = -1;
    private String callType = Constants.VIDEO_CALL;

    @Override
    public IBinder onBind(Intent intent) {
        Intrinsics.checkNotNullParameter(intent, "intent");
        return null;
    }

    @Metadata(d1 = {"\u0000 \n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\b\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0086T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0086T¢\u0006\u0002\n\u0000R\u001a\u0010\u0007\u001a\u00020\bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\t\"\u0004\b\n\u0010\u000bR\u001a\u0010\f\u001a\u00020\bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\f\u0010\t\"\u0004\b\r\u0010\u000bR\u001a\u0010\u000e\u001a\u00020\bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000e\u0010\t\"\u0004\b\u000f\u0010\u000b¨\u0006\u0010"}, d2 = {"Lapp/callpe/service/VideoCallService$Companion;", "", "()V", "INTERVAL", "", "MAX_TRY", "", "isOngoingCallWebView", "", "()Z", "setOngoingCallWebView", "(Z)V", "isPriorityVideoCallServiceRunning", "setPriorityVideoCallServiceRunning", "isVideoCallServiceRunning", "setVideoCallServiceRunning", "app_riloRelease"}, k = 1, mv = {1, 8, 0}, xi = 48)
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }

        public final boolean isVideoCallServiceRunning() {
            return VideoCallService.isVideoCallServiceRunning;
        }

        public final void setVideoCallServiceRunning(boolean z) {
            VideoCallService.isVideoCallServiceRunning = z;
        }

        public final boolean isPriorityVideoCallServiceRunning() {
            return VideoCallService.isPriorityVideoCallServiceRunning;
        }

        public final void setPriorityVideoCallServiceRunning(boolean z) {
            VideoCallService.isPriorityVideoCallServiceRunning = z;
        }

        public final boolean isOngoingCallWebView() {
            return VideoCallService.isOngoingCallWebView;
        }

        public final void setOngoingCallWebView(boolean z) {
            VideoCallService.isOngoingCallWebView = z;
        }
    }

    public final RxBus getRxBus() {
        RxBus rxBus = this.rxBus;
        if (rxBus != null) {
            return rxBus;
        }
        Intrinsics.throwUninitializedPropertyAccessException("rxBus");
        return null;
    }

    public final void setRxBus(RxBus rxBus) {
        Intrinsics.checkNotNullParameter(rxBus, "<set-?>");
        this.rxBus = rxBus;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        super.onStartCommand(intent, flags, startId);
        isVideoCallServiceRunning = true;
        this.mChannel = intent != null ? intent.getStringExtra(Constants.KEY_CALLING_CHANNEL) : null;
        this.videoId = intent != null ? intent.getLongExtra(Constants.KEY_CALLING_VIDEO_ID, -1L) : -1L;
        this.caller = intent != null ? intent.getStringExtra(Constants.KEY_CALLER) : null;
        this.accessToken = intent != null ? intent.getStringExtra(Constants.KEY_AGORA_ACCESS_TOKEN) : null;
        String stringExtra = intent != null ? intent.getStringExtra(Constants.KEY_CALL_TYPE) : null;
        if (stringExtra == null) {
            stringExtra = Constants.VIDEO_CALL;
        }
        this.callType = stringExtra;
        isOngoingCallWebView = App.Companion.getWebViewVideoCall();
        getVideoDetails(intent);
        this.job = BuildersKt.launch$default(CoroutineScopeKt.CoroutineScope(Dispatchers.getDefault()), (CoroutineContext) null, (CoroutineStart) null, new VideoCallService$onStartCommand$1(this, null), 3, (Object) null);
        if (Build.VERSION.SDK_INT > 26) {
            createNotificationChanel();
        } else {
            startForeground(1, createNotification());
        }
        return 1;
    }

    private final void getVideoDetails(Intent intent) {
        String stringExtra;
        boolean z;
        if (intent == null || intent.getExtras() == null || (stringExtra = intent.getStringExtra(Constants.FCM_DATA)) == null) {
            return;
        }
        VideoDetailModel videoDetailModel = (VideoDetailModel) new Gson().fromJson(stringExtra, VideoDetailModel.class);
        this.videoDetails = videoDetailModel;
        if ((videoDetailModel != null ? videoDetailModel.getRandomCallType() : null) != null) {
            VideoDetailModel videoDetailModel2 = this.videoDetails;
            if (Intrinsics.areEqual("PRIORITY", videoDetailModel2 != null ? videoDetailModel2.getRandomCallType() : null)) {
                z = true;
                isPriorityVideoCallServiceRunning = z;
            }
        }
        z = false;
        isPriorityVideoCallServiceRunning = z;
    }

    private final Notification createNotification() {
        StreamerModel streamerDetails;
        String name;
        StreamerModel userDetails;
        VideoCallService videoCallService = this;
        boolean areEqual = Intrinsics.areEqual(SharedPref.getString(videoCallService, PrefKeys.USER_ROLE), "STREAMER");
        Intent rtcScreenIntent = RtcScreenHandler.getRtcScreenIntent(videoCallService, RtcScreenHandler.getRtcScreenType$default(null, 1, null));
        rtcScreenIntent.putExtra(Constants.FROM_NOTIFICATION_CLICK, true);
        rtcScreenIntent.putExtra(Constants.KEY_CALLING_CHANNEL, this.mChannel);
        rtcScreenIntent.putExtra(Constants.KEY_CALLING_VIDEO_ID, this.videoId);
        rtcScreenIntent.putExtra(Constants.KEY_AGORA_ACCESS_TOKEN, this.accessToken);
        rtcScreenIntent.putExtra(Constants.KEY_CALLER, this.caller);
        rtcScreenIntent.putExtra(Constants.KEY_CALL_TYPE, this.callType);
        String string = getString(2131953061);
        Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.video_call)");
        VideoDetailModel videoDetailModel = this.videoDetails;
        if (videoDetailModel != null) {
            string = "";
            if (!areEqual ? !((streamerDetails = videoDetailModel.getStreamerDetails()) == null || (name = streamerDetails.getName()) == null) : !((userDetails = videoDetailModel.getUserDetails()) == null || (name = userDetails.getName()) == null)) {
                string = name;
            }
            rtcScreenIntent.putExtra(Constants.FCM_DATA, new Gson().toJson(videoDetailModel));
        }
        PendingIntent activity = PendingIntent.getActivity(videoCallService, 0, rtcScreenIntent, 201326592);
        NotificationCompat.Builder priority = new NotificationCompat.Builder(videoCallService, "video_call_channel").setContentTitle(string).setUsesChronometer(true).setShowWhen(true).setContentText(getString(2131952400)).setPriority(0);
        Intrinsics.checkNotNullExpressionValue(priority, "Builder(this, \"video_cal…nCompat.PRIORITY_DEFAULT)");
        priority.setSmallIcon(getNotificationIcon(priority, Intrinsics.areEqual(this.callType, "AUDIO")));
        priority.setContentIntent(activity);
        Notification build = priority.build();
        Intrinsics.checkNotNullExpressionValue(build, "builder.build()");
        return build;
    }

    private final void createNotificationChanel() {
        StreamerModel streamerDetails;
        String name;
        StreamerModel userDetails;
        VideoCallService videoCallService = this;
        boolean areEqual = Intrinsics.areEqual(SharedPref.getString(videoCallService, PrefKeys.USER_ROLE), "STREAMER");
        Intent rtcScreenIntent = RtcScreenHandler.getRtcScreenIntent(videoCallService, RtcScreenHandler.getRtcScreenType$default(null, 1, null));
        rtcScreenIntent.putExtra(Constants.FROM_NOTIFICATION_CLICK, true);
        rtcScreenIntent.putExtra(Constants.KEY_CALLING_CHANNEL, this.mChannel);
        rtcScreenIntent.putExtra(Constants.KEY_CALLING_VIDEO_ID, this.videoId);
        rtcScreenIntent.putExtra(Constants.KEY_AGORA_ACCESS_TOKEN, this.accessToken);
        rtcScreenIntent.putExtra(Constants.KEY_CALLER, this.caller);
        String string = getString(2131953061);
        Intrinsics.checkNotNullExpressionValue(string, "getString(R.string.video_call)");
        VideoDetailModel videoDetailModel = this.videoDetails;
        if (videoDetailModel != null) {
            string = "";
            if (!areEqual ? !((streamerDetails = videoDetailModel.getStreamerDetails()) == null || (name = streamerDetails.getName()) == null) : !((userDetails = videoDetailModel.getUserDetails()) == null || (name = userDetails.getName()) == null)) {
                string = name;
            }
            rtcScreenIntent.putExtra(Constants.FCM_DATA, new Gson().toJson(videoDetailModel));
        }
        PendingIntent activity = PendingIntent.getActivity(videoCallService, 0, rtcScreenIntent, 201326592);
        Object systemService = getSystemService("notification");
        Intrinsics.checkNotNull(systemService, "null cannot be cast to non-null type android.app.NotificationManager");
        NotificationManager notificationManager = (NotificationManager) systemService;
        NotificationChannel notificationChannel = new NotificationChannel("25002", "Video Call Notification", 2);
        notificationChannel.enableLights(true);
        notificationChannel.enableVibration(true);
        notificationChannel.setLightColor(2131099815);
        notificationChannel.setLockscreenVisibility(1);
        notificationChannel.setDescription("Video Call");
        notificationManager.createNotificationChannel(notificationChannel);
        if (Build.VERSION.SDK_INT > 30) {
            Notification createCallStyleNotification = createCallStyleNotification();
            if (Build.VERSION.SDK_INT >= 34) {
                ServiceCompat.startForeground(this, 3, createCallStyleNotification, 4);
                return;
            } else {
                startForeground(3, createCallStyleNotification);
                return;
            }
        }
        NotificationCompat.Builder ongoing = new NotificationCompat.Builder(videoCallService, "25002").setContentTitle(string).setContentText(getString(2131952400)).setAutoCancel(false).setContentIntent(activity).setUsesChronometer(true).setShowWhen(true).setOngoing(true);
        Intrinsics.checkNotNullExpressionValue(ongoing, "Builder(this, \"25002\").s…        .setOngoing(true)");
        ongoing.setSmallIcon(getNotificationIcon(ongoing, Intrinsics.areEqual(this.callType, "AUDIO")));
        Notification build = ongoing.build();
        Intrinsics.checkNotNullExpressionValue(build, "builder.build()");
        notificationManager.notify(3, build);
        startForeground(3, build);
    }

    private final Notification createCallStyleNotification() {
        String name;
        StreamerModel userDetails;
        StreamerModel userDetails2;
        StreamerModel streamerDetails;
        StreamerModel streamerDetails2;
        VideoCallService videoCallService = this;
        boolean areEqual = Intrinsics.areEqual(SharedPref.getString(videoCallService, PrefKeys.USER_ROLE), "STREAMER");
        String str = null;
        Intent rtcScreenIntent = RtcScreenHandler.getRtcScreenIntent(videoCallService, RtcScreenHandler.getRtcScreenType$default(null, 1, null));
        rtcScreenIntent.putExtra(Constants.FROM_NOTIFICATION_CLICK, true);
        rtcScreenIntent.putExtra(Constants.KEY_CALLING_CHANNEL, this.mChannel);
        rtcScreenIntent.putExtra(Constants.KEY_CALLING_VIDEO_ID, this.videoId);
        rtcScreenIntent.putExtra(Constants.KEY_AGORA_ACCESS_TOKEN, this.accessToken);
        rtcScreenIntent.putExtra(Constants.KEY_CALLER, this.caller);
        rtcScreenIntent.putExtra(Constants.KEY_CALL_TYPE, this.callType);
        Intrinsics.checkNotNullExpressionValue(getString(2131953061), "getString(R.string.video_call)");
        VideoDetailModel videoDetailModel = this.videoDetails;
        if (videoDetailModel != null) {
            if (areEqual) {
                StreamerModel userDetails3 = videoDetailModel.getUserDetails();
                if (userDetails3 != null) {
                    userDetails3.getName();
                }
            } else {
                StreamerModel streamerDetails3 = videoDetailModel.getStreamerDetails();
                if (streamerDetails3 != null) {
                    streamerDetails3.getName();
                }
            }
            rtcScreenIntent.putExtra(Constants.FCM_DATA, new Gson().toJson(videoDetailModel));
        }
        PendingIntent activity = PendingIntent.getActivity(videoCallService, 0, rtcScreenIntent, 201326592);
        Intent intent = new Intent(videoCallService, (Class<?>) VideoCallBroadcastReceiver.class);
        intent.setAction(Constants.END_VIDEO_CALL);
        intent.putExtra(Constants.KEY_CALLING_VIDEO_ID, this.videoId);
        PendingIntent broadcast = PendingIntent.getBroadcast(videoCallService, 0, intent, 201326592);
        if (!areEqual) {
            VideoDetailModel videoDetailModel2 = this.videoDetails;
            name = (videoDetailModel2 == null || (streamerDetails2 = videoDetailModel2.getStreamerDetails()) == null) ? null : streamerDetails2.getName();
            String str2 = name;
            if (!(!(str2 == null || StringsKt.isBlank(str2)))) {
                name = null;
            }
            if (name == null) {
                name = "Streamer";
            }
        } else {
            VideoDetailModel videoDetailModel3 = this.videoDetails;
            name = (videoDetailModel3 == null || (userDetails = videoDetailModel3.getUserDetails()) == null) ? null : userDetails.getName();
            String str3 = name;
            if (!(!(str3 == null || StringsKt.isBlank(str3)))) {
                name = null;
            }
            if (name == null) {
                name = "User";
            }
        }
        if (!areEqual) {
            VideoDetailModel videoDetailModel4 = this.videoDetails;
            if (videoDetailModel4 != null && (streamerDetails = videoDetailModel4.getStreamerDetails()) != null) {
                str = StreamerModel.getProfile$default(streamerDetails, false, 1, null);
            }
        } else {
            VideoDetailModel videoDetailModel5 = this.videoDetails;
            if (videoDetailModel5 != null && (userDetails2 = videoDetailModel5.getUserDetails()) != null) {
                str = StreamerModel.getProfile$default(userDetails2, false, 1, null);
            }
        }
        Person.Builder builder = new Person.Builder();
        builder.setName(name);
        builder.setImportant(true);
        Intrinsics.checkNotNullExpressionValue(activity, "pendingIntent");
        Intrinsics.checkNotNullExpressionValue(broadcast, "hangUpPendingIntent");
        updateCallNotification(str, builder, activity, broadcast);
        Person build = builder.build();
        Intrinsics.checkNotNullExpressionValue(build, "personBuilder.build()");
        Notification build2 = new Notification.Builder(videoCallService, "25002").setContentText(getString(Intrinsics.areEqual(this.callType, Constants.VIDEO_CALL) ? 2131952383 : 2131952381)).setSmallIcon(Intrinsics.areEqual(this.callType, Constants.VIDEO_CALL) ? 2131231746 : 2131231521).setShowWhen(true).setStyle(Notification.CallStyle.forOngoingCall(build, broadcast)).setOngoing(true).setContentIntent(activity).build();
        Intrinsics.checkNotNullExpressionValue(build2, "Builder(this, \"25002\")\n …ent)\n            .build()");
        return build2;
    }

    private final void updateCallNotification(String personImage, Person.Builder personBuilder, PendingIntent pendingIntent, PendingIntent hangUpPendingIntent) {
        BuildersKt.launch$default(CoroutineScopeKt.CoroutineScope(Dispatchers.getMain()), (CoroutineContext) null, (CoroutineStart) null, new VideoCallService$updateCallNotification$1(this, personImage, personBuilder, hangUpPendingIntent, pendingIntent, null), 3, (Object) null);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Job job = this.job;
        if (job != null) {
            Job.DefaultImpls.cancel$default(job, (CancellationException) null, 1, (Object) null);
        }
        Job job2 = this.userIconJob;
        if (job2 != null) {
            Job.DefaultImpls.cancel$default(job2, (CancellationException) null, 1, (Object) null);
        }
        isOngoingCallWebView = false;
        isVideoCallServiceRunning = false;
        isPriorityVideoCallServiceRunning = false;
        App.Companion.setVideoCallScreen(false);
        if (LoginActivity.INSTANCE.isVitok()) {
            sendEndEvent();
        }
    }

    private final void sendEndEvent() {
        for (int i = 1; i < 4; i++) {
            getRxBus().send(new LiveStreamEvent(LiveStreamEventTypes.ENDED, null));
        }
    }

    private final int getNotificationIcon(NotificationCompat.Builder notificationBuilder, boolean isAudio) {
        notificationBuilder.setColor(32768);
        return isAudio ? 2131231521 : 2131231746;
    }

    public final Object createIcon(String str, Continuation<? super Icon> continuation) {
        return createIconFromUrl(str, continuation);
    }

    public final Object loadImage(String str, Continuation<? super Bitmap> continuation) {
        return BuildersKt.withContext(Dispatchers.getIO(), new VideoCallService$loadImage$2(str, null), continuation);
    }

    public final java.lang.Object createIconFromUrl(java.lang.String r5, kotlin.coroutines.Continuation<? super android.graphics.drawable.Icon> r6) {
        throw new UnsupportedOperationException("Method not decompiled: app.callpe.service.VideoCallService.createIconFromUrl(java.lang.String, kotlin.coroutines.Continuation):java.lang.Object");
    }

    private final Bitmap createCircularBitmap(Bitmap bitmap) {
        try {
            int min = Math.min(bitmap.getWidth(), bitmap.getHeight());
            Bitmap createBitmap = Bitmap.createBitmap(min, min, Bitmap.Config.ARGB_8888);
            Intrinsics.checkNotNullExpressionValue(createBitmap, "createBitmap(size, size, Bitmap.Config.ARGB_8888)");
            Canvas canvas = new Canvas(createBitmap);
            Paint paint = new Paint();
            paint.setAntiAlias(true);
            float f = min;
            RectF rectF = new RectF(0.0f, 0.0f, f, f);
            Path path = new Path();
            path.addOval(rectF, Path.Direction.CCW);
            canvas.drawPath(path, paint);
            paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
            canvas.drawBitmap(bitmap, (Rect) null, rectF, paint);
            return createBitmap;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}