package com.ifpdos.factorytest;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.TextView;
import com.seewo.sdk.SDKPictureHelper;

/* JADX INFO: loaded from: classes.dex */
public class BackLightTestActivity extends Activity {
    private static final String TAG = "BackLightTestActivity";
    private int count = 0;
    private TextView mBackLightValue;
    private SeekBar mSeekBar;
    private boolean orgAutoLight;

    @Override // android.app.Activity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_backlight_test_layout);
        this.mSeekBar = (SeekBar) findViewById(R.id.backlight_seek_bar);
        this.mBackLightValue = (TextView) findViewById(R.id.backlight_value_text);
        ((Button) findViewById(R.id.backlight_pass)).setOnClickListener(new View.OnClickListener() { // from class: com.ifpdos.factorytest.BackLightTestActivity$$ExternalSyntheticLambda0
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                this.f$0.lambda$onCreate$0(view);
            }
        });
        ((Button) findViewById(R.id.backlight_fail)).setOnClickListener(new View.OnClickListener() { // from class: com.ifpdos.factorytest.BackLightTestActivity$$ExternalSyntheticLambda1
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                this.f$0.lambda$onCreate$1(view);
            }
        });
        this.orgAutoLight = SDKPictureHelper.I.isAutoLightEnabled();
        Log.d(TAG, "onCreate: AutoLightEnable " + this.orgAutoLight);
        if (this.orgAutoLight) {
            Log.d(TAG, "onCreate: setAutoLightEnable false");
            SDKPictureHelper.I.setAutoLightEnable(false);
        }
        updateCurrentBlackLight();
        initListener();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public /* synthetic */ void lambda$onCreate$0(View view) {
        setResult(1);
        finish();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public /* synthetic */ void lambda$onCreate$1(View view) {
        setResult(2);
        finish();
    }

    private void updateCurrentBlackLight() {
        int backLight = SDKPictureHelper.I.getBackLight();
        this.mSeekBar.setProgress(backLight);
        this.mBackLightValue.setText(getString(R.string.backlight_value) + backLight);
    }

    @Override // android.app.Activity
    protected void onResume() {
        super.onResume();
    }

    @Override // android.app.Activity
    protected void onStart() {
        super.onStart();
    }

    @Override // android.app.Activity
    protected void onStop() {
        super.onStop();
    }

    @Override // android.app.Activity
    protected void onDestroy() {
        super.onDestroy();
    }

    private void initListener() {
        this.mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { // from class: com.ifpdos.factorytest.BackLightTestActivity.1
            @Override // android.widget.SeekBar.OnSeekBarChangeListener
            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            @Override // android.widget.SeekBar.OnSeekBarChangeListener
            public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
                if (z) {
                    BackLightTestActivity.this.count++;
                    BackLightTestActivity.this.mBackLightValue.setText(BackLightTestActivity.this.getString(R.string.backlight_value) + i);
                    if (BackLightTestActivity.this.count % 5 == 0) {
                        BackLightTestActivity.this.setBrightness(i);
                    }
                }
            }

            @Override // android.widget.SeekBar.OnSeekBarChangeListener
            public void onStopTrackingTouch(SeekBar seekBar) {
                BackLightTestActivity.this.setBrightness(seekBar.getProgress());
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public void setBrightness(int i) {
        SDKPictureHelper.I.setBackLight(i);
    }
}
