|
|
|
@ -201,7 +201,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkAuthentication();
|
|
|
|
|
checkAuthentication(true);
|
|
|
|
|
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
}
|
|
|
|
@ -247,7 +247,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
|
finish();
|
|
|
|
|
startActivity(getIntent());
|
|
|
|
|
} else
|
|
|
|
|
checkAuthentication();
|
|
|
|
|
checkAuthentication(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -257,9 +257,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
|
|
|
|
|
|
visible = false;
|
|
|
|
|
|
|
|
|
|
if (!this.getClass().equals(ActivityMain.class) &&
|
|
|
|
|
Helper.shouldAuthenticate(this, true))
|
|
|
|
|
finishAndRemoveTask();
|
|
|
|
|
checkAuthentication(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -271,14 +269,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
|
@Override
|
|
|
|
|
public void onUserInteraction() {
|
|
|
|
|
Log.d("User interaction");
|
|
|
|
|
|
|
|
|
|
if (!this.getClass().equals(ActivityMain.class) &&
|
|
|
|
|
Helper.shouldAuthenticate(this, false)) {
|
|
|
|
|
finishAndRemoveTask();
|
|
|
|
|
Intent main = new Intent(this, ActivityMain.class);
|
|
|
|
|
main.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
|
|
|
startActivity(main);
|
|
|
|
|
}
|
|
|
|
|
checkAuthentication(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -379,13 +370,15 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
|
super.onActivityResult(requestCode, resultCode, data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void checkAuthentication() {
|
|
|
|
|
private void checkAuthentication(boolean auth) {
|
|
|
|
|
if (!this.getClass().equals(ActivityMain.class) &&
|
|
|
|
|
Helper.shouldAuthenticate(this, false)) {
|
|
|
|
|
Intent intent = getIntent();
|
|
|
|
|
finishAndRemoveTask();
|
|
|
|
|
setResult(RESULT_CANCELED);
|
|
|
|
|
finishAffinity();
|
|
|
|
|
|
|
|
|
|
if (auth) {
|
|
|
|
|
Intent intent = getIntent();
|
|
|
|
|
processStreams(intent);
|
|
|
|
|
Intent main = new Intent(this, ActivityMain.class)
|
|
|
|
|
.putExtra("intent", intent);
|
|
|
|
@ -393,6 +386,7 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
|
startActivity(main);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void processStreams(Intent intent) {
|
|
|
|
|
intent.setClipData(null);
|
|
|
|
|