BluetoothSetupActivity: ignore cancel results

Change-Id: I9e7f62b2a11d8b2af0c075b0151a29c4485e8931
This commit is contained in:
Aaron Kling
2024-03-02 19:14:19 -06:00
committed by Oliver Scott
parent a09594c415
commit 6cb268b222
2 changed files with 17 additions and 1 deletions

View File

@@ -6,9 +6,13 @@
package org.lineageos.setupwizard;
import static com.google.android.setupcompat.util.ResultCodes.RESULT_ACTIVITY_NOT_FOUND;
import android.content.Intent;
import android.util.Log;
import androidx.activity.result.ActivityResult;
import org.lineageos.setupwizard.util.SetupWizardUtils;
public class BluetoothSetupActivity extends SubBaseActivity {
@@ -34,4 +38,16 @@ public class BluetoothSetupActivity extends SubBaseActivity {
SetupWizardUtils.disableComponent(this, BluetoothSetupActivity.class);
}
}
@Override
protected void onActivityResult(ActivityResult activityResult) {
Intent data = activityResult.getData();
if (mIsSubactivityNotFound) {
finishAction(RESULT_ACTIVITY_NOT_FOUND);
} else if (data != null && data.getBooleanExtra("onBackPressed", false)) {
onStartSubactivity();
} else {
nextAction(RESULT_OK, data);
}
}
}

View File

@@ -23,7 +23,7 @@ public abstract class SubBaseActivity extends BaseSetupWizardActivity {
public static final String TAG = SubBaseActivity.class.getSimpleName();
private boolean mIsSubactivityNotFound = false;
protected boolean mIsSubactivityNotFound = false;
protected abstract void onStartSubactivity();