package xyz.stream.view;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Process;

/* JADX INFO: loaded from: classes3.dex */
public final class AppKilledDetector {
    public static void clearLastProcessId() {
        Context context = ViewRuntime.getContext();
        SharedPreferences sharedPreferences = context == null ? null : context.getSharedPreferences("xyz_stream_view_runtime", 0);
        if (sharedPreferences != null) {
            sharedPreferences.edit().remove("last_process_id").commit();
        }
    }

    public static boolean isColdStart() {
        Context context = ViewRuntime.getContext();
        SharedPreferences sharedPreferences = context == null ? null : context.getSharedPreferences("xyz_stream_view_runtime", 0);
        if (sharedPreferences == null) {
            return false;
        }
        int iMyPid = Process.myPid();
        int i10 = sharedPreferences.getInt("last_process_id", -1);
        sharedPreferences.edit().putInt("last_process_id", iMyPid).commit();
        return (i10 == -1 || i10 == iMyPid) ? false : true;
    }
}
