Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef5a090d authored by Romain Hunault's avatar Romain Hunault 🚴🏻
Browse files

Merge remote-tracking branch 'origin/lineage-16.0' into v1-pie

parents c8e70007 97b6bc3e
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -22,15 +22,26 @@ import static org.lineageos.setupwizard.SetupWizardApp.EXTRA_DETAILS;
import static org.lineageos.setupwizard.SetupWizardApp.EXTRA_TITLE;
import static org.lineageos.setupwizard.SetupWizardApp.REQUEST_CODE_SETUP_LOCKSCREEN;

import android.app.KeyguardManager;
import android.content.Intent;
import android.util.Log;
import android.view.View;

import org.lineageos.setupwizard.util.SetupWizardUtils;

public class ScreenLockActivity extends SubBaseActivity {

    public static final String TAG = ScreenLockActivity.class.getSimpleName();

    @Override
    protected void onStartSubactivity() {
        if (isKeyguardSecure()) {
            Log.v(TAG, "Screen lock already set up; skipping ScreenLockActivity");
            nextAction(RESULT_OK);
            SetupWizardUtils.disableComponent(this, ScreenLockActivity.class);
            finish();
            return;
        }
        setNextAllowed(true);
        findViewById(R.id.setup_lockscreen).setOnClickListener(new View.OnClickListener() {
            @Override
@@ -75,4 +86,7 @@ public class ScreenLockActivity extends SubBaseActivity {
        return TRANSITION_ID_SLIDE;
    }

    private boolean isKeyguardSecure() {
        return getSystemService(KeyguardManager.class).isKeyguardSecure();
    }
}