[ScreenLock] Fix result code handling
Modify the back stack and result code propagation in the screen lock scenarios. - EncryptionInterstitial now propagates the result of ChooseLock* request instead of always returning RESULT_OK. - ChooseLockGeneric now treats CHOOSE_LOCK_REQUEST and ENABLE_ENCRYPTION_REQUEST the same (since encryption can be a proxy for ChooseLock*). This means ChooseLockGeneric will now stay on back stack when going back from ChooseLock*, just like the case (indirectly) through EncryptionInterstitial. Bug: 26177240 Change-Id: Id7f1256dcbff00d552a3e7db60c285f53f1e63e6
This commit is contained in:
@@ -170,9 +170,8 @@ public class EncryptionInterstitial extends SettingsActivity {
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (requestCode == CHOOSE_LOCK_REQUEST &&
|
||||
resultCode == RESULT_FIRST_USER) {
|
||||
getActivity().setResult(RESULT_OK, data);
|
||||
if (requestCode == CHOOSE_LOCK_REQUEST && resultCode != RESULT_CANCELED) {
|
||||
getActivity().setResult(resultCode, data);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user