Fix restore page back navigation
Issue: calyxos#2284 Change-Id: I72249924d4b0c56b6bcceea1c5a4adbfa5c54fb2
This commit is contained in:
committed by
Michael Bestas
parent
ac47a02936
commit
a1a6530ddd
@@ -6,8 +6,12 @@
|
||||
|
||||
package org.lineageos.setupwizard.backup;
|
||||
|
||||
import static com.google.android.setupcompat.util.ResultCodes.RESULT_ACTIVITY_NOT_FOUND;
|
||||
|
||||
import static org.lineageos.setupwizard.SetupWizardApp.ACTION_RESTORE_FROM_BACKUP;
|
||||
|
||||
import androidx.activity.result.ActivityResult;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -23,6 +27,19 @@ public class RestoreIntroActivity extends SubBaseActivity {
|
||||
getString(R.string.os_name)));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(ActivityResult activityResult) {
|
||||
int resultCode = activityResult.getResultCode();
|
||||
Intent data = activityResult.getData();
|
||||
if (resultCode != RESULT_CANCELED) {
|
||||
nextAction(resultCode, data);
|
||||
} else if (mIsSubactivityNotFound) {
|
||||
finishAction(RESULT_ACTIVITY_NOT_FOUND);
|
||||
} else if (data != null && data.getBooleanExtra("onBackPressed", false)) {
|
||||
onStartSubactivity();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStartSubactivity() {
|
||||
setNextAllowed(true);
|
||||
|
Reference in New Issue
Block a user