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

Commit 6a0ef849 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Revert "SetupWizard: Add ability to skip the setup wizard"

This reverts commit a0a8f0e9.
parent 1b2f57a0
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
@@ -18,13 +18,10 @@
package org.lineageos.setupwizard;

import android.os.Bundle;
import android.os.Handler;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;

import org.lineageos.setupwizard.util.EnableAccessibilityController;
import org.lineageos.setupwizard.util.SetupWizardUtils;

public class WelcomeActivity extends BaseSetupWizardActivity {

@@ -33,9 +30,6 @@ public class WelcomeActivity extends BaseSetupWizardActivity {
    private View mRootView;
    private EnableAccessibilityController mEnableAccessibilityController;

    private int mVolumeUpCount = 0;
    private Handler mHandler = new Handler();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
@@ -58,30 +52,6 @@ public class WelcomeActivity extends BaseSetupWizardActivity {
        startEmergencyDialer();
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
            mVolumeUpCount++;
            if (mVolumeUpCount == 1) {
                 // Schedule a runnable to reset the count after 1 second
                mHandler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        mVolumeUpCount = 0;
                    }
                }, 1000); // 1 second delay
            }
        } else if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN && mVolumeUpCount == 2) {
            // If the volume down key is pressed and the volume up count is 2
            // Finish the setup wizard and enable the status bar
            SetupWizardUtils.finishSetupWizard(getApplicationContext());
            SetupWizardUtils.enableStatusBar(getApplicationContext());
            finish();
        }

        return super.onKeyDown(keyCode, event);
    }

    @Override
    protected int getLayoutResId() {
        return R.layout.welcome_activity;