package com.unity3d.player;

import android.opengl.GLSurfaceView;
import android.os.Vibrator;
import android.view.View;

/* loaded from: /storage/emulated/0/Documents/jadec/sources/com.UBI.A90.WW/dex-files/2.dex */
public final class e implements j {
    private static int a;

    @Override // com.unity3d.player.j
    public final void a(GLSurfaceView gLSurfaceView, boolean z) {
        gLSurfaceView.setPreserveEGLContextOnPause(z);
    }

    @Override // com.unity3d.player.j
    public final void a(final View view) {
        a = view.getSystemUiVisibility();
        view.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { // from class: com.unity3d.player.e.1
            @Override // android.view.View.OnSystemUiVisibilityChangeListener
            public final void onSystemUiVisibilityChange(final int i) {
                int i2 = e.a ^ i;
                int unused = e.a = i;
                if ((i2 & 1) == 0 || (i & 1) != 0) {
                    return;
                }
                view.getHandler().postDelayed(new Runnable() { // from class: com.unity3d.player.e.1.1
                    @Override // java.lang.Runnable
                    public final void run() {
                        view.setSystemUiVisibility(i | 1);
                    }
                }, 1000L);
            }
        });
    }

    @Override // com.unity3d.player.j
    public final void a(View view, boolean z) {
        if (z) {
            a |= 1;
        } else {
            a &= -2;
        }
        view.setSystemUiVisibility(a);
    }

    @Override // com.unity3d.player.j
    public final boolean a(Vibrator vibrator) {
        return vibrator.hasVibrator();
    }

    @Override // com.unity3d.player.j
    public final boolean b(View view) {
        return (view.getSystemUiVisibility() & 1) != 0;
    }

    @Override // com.unity3d.player.j
    public final void c(final View view) {
        if (b(view)) {
            a(view, false);
            view.getHandler().postDelayed(new Runnable() { // from class: com.unity3d.player.e.2
                @Override // java.lang.Runnable
                public final void run() {
                    e.this.a(view, true);
                }
            }, 500L);
        }
    }
}
