BluetoothSetupActivity: ignore cancel results
Change-Id: I9e7f62b2a11d8b2af0c075b0151a29c4485e8931
This commit is contained in:
committed by
Oliver Scott
parent
a09594c415
commit
6cb268b222
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user