summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwyen <twyen@google.com>2017-11-28 11:43:02 -0800
committerCopybara-Service <copybara-piper@google.com>2017-11-29 11:46:38 -0800
commit9264b26505607dee9307c378fdd390c985d6be6c (patch)
tree1749d2cbf1a8636a2b5f79b88ff888e6700970f5
parent2c6803d4af5b3d5274857429e51cbc871ee814bd (diff)
Prevent PreCallActivity from showing in lockscreen if it is not started in the lockscreen
Bug: 69812359 Test: PreCallActivityTest PiperOrigin-RevId: 177193665 Change-Id: Ic61819b8456ee22c01228d6be2255b3f2c1e418a
-rw-r--r--java/com/android/dialer/precall/impl/PreCallActivity.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/java/com/android/dialer/precall/impl/PreCallActivity.java b/java/com/android/dialer/precall/impl/PreCallActivity.java
index 48c2fbfc3..ee417b968 100644
--- a/java/com/android/dialer/precall/impl/PreCallActivity.java
+++ b/java/com/android/dialer/precall/impl/PreCallActivity.java
@@ -18,6 +18,7 @@ package com.android.dialer.precall.impl;
import android.annotation.TargetApi;
import android.app.Activity;
+import android.app.KeyguardManager;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
@@ -34,8 +35,10 @@ public class PreCallActivity extends Activity {
super.onCreate(savedInstanceState);
preCallCoordinator = new PreCallCoordinatorImpl(this);
preCallCoordinator.onCreate(getIntent(), savedInstanceState);
- getWindow().addFlags(LayoutParams.FLAG_SHOW_WHEN_LOCKED);
+ if (getSystemService(KeyguardManager.class).isKeyguardLocked()) {
+ getWindow().addFlags(LayoutParams.FLAG_SHOW_WHEN_LOCKED);
+ }
}
@Override