From 8df079eaf801c99c8bf0895b004949d5b9b2c84d Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Fri, 22 Feb 2019 15:29:47 +0100 Subject: [PATCH] alter view root visibility only when screen-lock is enabled. this is for performance and general compatibility reasons, no special screenlock-code should run if screen-lock is disalbed.. --- src/org/thoughtcrime/securesms/BaseActionBarActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/BaseActionBarActivity.java b/src/org/thoughtcrime/securesms/BaseActionBarActivity.java index 94c19abb7..78952ea2b 100644 --- a/src/org/thoughtcrime/securesms/BaseActionBarActivity.java +++ b/src/org/thoughtcrime/securesms/BaseActionBarActivity.java @@ -28,6 +28,7 @@ public abstract class BaseActionBarActivity extends AppCompatActivity { private Timer timer; private boolean isWaitingForResult; + private boolean isHiddenByScreenLock; @Override protected void onCreate(Bundle savedInstanceState) { @@ -41,8 +42,9 @@ public abstract class BaseActionBarActivity extends AppCompatActivity { protected void onStart() { if (ScreenLockUtil.isScreenLockEnabled(this) && ScreenLockUtil.getShouldLockApp() && !isWaitingForResult) { ScreenLockUtil.applyScreenLock(this); - } else { + } else if (isHiddenByScreenLock) { findViewById(android.R.id.content).setVisibility(View.VISIBLE); + isHiddenByScreenLock = false; } super.onStart(); } @@ -51,6 +53,7 @@ public abstract class BaseActionBarActivity extends AppCompatActivity { protected void onStop() { if (ScreenLockUtil.isScreenLockEnabled(this)) { findViewById(android.R.id.content).setVisibility(View.GONE); + isHiddenByScreenLock = true; } super.onStop(); }