package defpackage;

import android.hardware.display.DisplayManager;
import android.os.Handler;
import android.view.Choreographer;
import android.view.Choreographer$VsyncCallback;

/* renamed from: ᵖˀᵔ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class ChoreographerVsyncCallbackC2345 extends AbstractC3405 implements Choreographer$VsyncCallback {

    /* renamed from: ᵤᵙᵷ, reason: contains not printable characters */
    public final Handler f9178;

    public ChoreographerVsyncCallbackC2345(Choreographer choreographer, DisplayManager displayManager) {
        super(choreographer, displayManager);
        this.f9178 = AbstractC3558.m8130(null);
    }

    @Override // android.hardware.display.DisplayManager.DisplayListener
    public final void onDisplayChanged(int i) {
        if (i == 0) {
            this.f12690.postVsyncCallback(this);
        }
    }

    public final void onVsync(Choreographer.FrameData frameData) {
        this.f12692 = frameData.getFrameTimeNanos();
        Choreographer.FrameTimeline[] frameTimelines = frameData.getFrameTimelines();
        if (frameTimelines.length >= 2) {
            long expectedPresentationTimeNanos = frameTimelines[1].getExpectedPresentationTimeNanos() - frameTimelines[0].getExpectedPresentationTimeNanos();
            this.f12691 = expectedPresentationTimeNanos != 0 ? expectedPresentationTimeNanos : -9223372036854775807L;
        } else {
            this.f12691 = -9223372036854775807L;
        }
        this.f9178.postDelayed(new RunnableC1600(16, this), 500L);
    }

    @Override // defpackage.AbstractC3405
    /* renamed from: ᵥᵯˎ */
    public final void mo5738() {
        this.f12689.registerDisplayListener(this, AbstractC3558.m8130(null));
        this.f12690.postVsyncCallback(this);
    }

    @Override // defpackage.AbstractC3405
    /* renamed from: ᵴᵳ */
    public final void mo5739() {
        this.f12689.unregisterDisplayListener(this);
        this.f9178.removeCallbacksAndMessages(null);
        this.f12690.removeVsyncCallback(this);
        this.f12692 = -9223372036854775807L;
        this.f12691 = -9223372036854775807L;
    }
}
