|
@@ -23,6 +23,7 @@
|
|
package com.owncloud.android.ui.activity;
|
|
package com.owncloud.android.ui.activity;
|
|
|
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
|
+import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.os.SystemClock;
|
|
import android.os.SystemClock;
|
|
import android.text.Editable;
|
|
import android.text.Editable;
|
|
@@ -365,10 +366,13 @@ public class PassCodeActivity extends AppCompatActivity implements Injectable {
|
|
@Override
|
|
@Override
|
|
public boolean onKeyDown(int keyCode, KeyEvent event){
|
|
public boolean onKeyDown(int keyCode, KeyEvent event){
|
|
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount()== 0){
|
|
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount()== 0){
|
|
- if (ACTION_REQUEST_WITH_RESULT.equals(getIntent().getAction()) ||
|
|
|
|
- ACTION_CHECK_WITH_RESULT.equals(getIntent().getAction())) {
|
|
|
|
|
|
+ if(ACTION_CHECK.equals(getIntent().getAction()) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
|
|
|
|
+ moveTaskToBack(true);
|
|
|
|
+ finishAndRemoveTask();
|
|
|
|
+ }else if (ACTION_REQUEST_WITH_RESULT.equals(getIntent().getAction()) ||
|
|
|
|
+ ACTION_CHECK_WITH_RESULT.equals(getIntent().getAction())) {
|
|
finish();
|
|
finish();
|
|
- } // else, do nothing, but report that the key was consumed to stay alive
|
|
|
|
|
|
+ }// else, do nothing, but report that the key was consumed to stay alive
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
return super.onKeyDown(keyCode, event);
|
|
return super.onKeyDown(keyCode, event);
|