android 11 来电状态按power键灭屏,后自动点亮问题

18 篇文章 0 订阅
diff --git a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
old mode 100644
new mode 100755
index 81d0699..8826666
--- a/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -30,6 +30,9 @@ import android.content.Context;
 import android.content.res.ColorStateList;
 import android.os.Bundle;
 import android.os.SystemClock;
+//<!--jicong.wang modify for bug 28249
+import android.telephony.TelephonyManager;
+//jicong.wang modify for bug 28249-->
 import android.view.KeyEvent;
 import android.view.View;
 import android.view.ViewGroup;
@@ -105,7 +108,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
         @Override
         public void onFullyShown() {
             updateStates();
-            mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), mContainer, "BOUNCER_VISIBLE");
+            //<!--jicong.wang modify for bug 28249
+            //mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), mContainer, "BOUNCER_VISIBLE");
+            if (!TelephonyManager.from(mContext).isRinging()) {
+                mStatusBar.wakeUpIfDozing(SystemClock.uptimeMillis(), mContainer, "BOUNCER_VISIBLE");
+            }
+            //jicong.wang modify for bug 28249-->
             updateLockIcon();
         }
 
@@ -265,11 +273,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
     @Override
     public void onPanelExpansionChanged(float expansion, boolean tracking) {
         // We don't want to translate the bounce when:
-        // • Keyguard is occluded, because we're in a FLAG_SHOW_WHEN_LOCKED activity and need to
+        // �?Keyguard is occluded, because we're in a FLAG_SHOW_WHEN_LOCKED activity and need to
         //   conserve the original animation.
-        // • The user quickly taps on the display and we show "swipe up to unlock."
-        // • Keyguard will be dismissed by an action. a.k.a: FLAG_DISMISS_KEYGUARD_ACTIVITY
-        // • Full-screen user switcher is displayed.
+        // �?The user quickly taps on the display and we show "swipe up to unlock."
+        // �?Keyguard will be dismissed by an action. a.k.a: FLAG_DISMISS_KEYGUARD_ACTIVITY
+        // �?Full-screen user switcher is displayed.
         if (mNotificationPanelViewController.isUnlockHintRunning()) {
             mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
         } else if (bouncerNeedsScrimming()) {
diff --git a/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/InCallActivity.java b/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/InCallActivity.java
index 4739c82..26c399c 100755
--- a/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/InCallActivity.java
+++ b/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/InCallActivity.java
@@ -315,16 +315,12 @@ public class InCallActivity extends TransactionSafeFragmentActivity
     // When the audio stream is not via Bluetooth, turn on the screen once the activity is shown.
     // When the audio stream is via Bluetooth, turn on the screen only for an incoming call.
     final int audioRoute = getAudioRoute();
-    if (audioRoute != CallAudioState.ROUTE_BLUETOOTH
+    //<!--jicong.wang modify for bug 28249
+    /*if (audioRoute != CallAudioState.ROUTE_BLUETOOTH
         || CallList.getInstance().getIncomingCall() != null) {
-      //<!--jicong.wang modify for bug 28249
-      //flags |= WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
-      if (getSystemService(KeyguardManager.class).isKeyguardLocked()) {
-        flags |= WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
-      }
-      //jicong.wang modify for bug 28249 -->
-    }
-
+      flags |= WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON;
+    }*/
+    //jicong.wang modify for bug 28249 -->
     getWindow().addFlags(flags);
   }
 
diff --git a/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/InCallPresenter.java b/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/InCallPresenter.java
old mode 100644
new mode 100755
index e317139..9728d37
--- a/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/InCallPresenter.java
+++ b/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/InCallPresenter.java
@@ -21,6 +21,9 @@ import android.content.Intent;
 import android.graphics.Point;
 import android.os.Bundle;
 import android.os.Handler;
+//<!--jicong.wang modify for bug 28249
+import android.os.PowerManager;
+//jicong.wang modify for bug 28249 -->
 import android.os.Trace;
 import android.support.annotation.MainThread;
 import android.support.annotation.NonNull;
@@ -110,7 +113,9 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud
   private static final String CALL_CONFIGURATION_EXTRA = "call_configuration";
 
   private static final long BLOCK_QUERY_TIMEOUT_MS = 1000;
-
+  //<!--jicong.wang modify for bug 28249
+  private static final int WAKEYUP_DELAY = 1000;
+  //jicong.wang modify for bug 28249 -->
   private static final Bundle EMPTY_EXTRAS = new Bundle();
 
   private static InCallPresenter inCallPresenter;
@@ -1161,7 +1166,17 @@ public class InCallPresenter implements CallList.Listener, AudioModeProvider.Aud
     Trace.beginSection("InCallPresenter.onIncomingCall");
     InCallState newState = startOrFinishUi(InCallState.INCOMING);
     InCallState oldState = inCallState;
-
+    //<!--jicong.wang modify for bug 28249
+    mHandler.postDelayed(new Runnable() {
+        @Override
+        public void run() {
+            PowerManager powerManager = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
+            PowerManager.WakeLock wakeLock = powerManager.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK,"InCallPresenter.onIncomingCall");
+            wakeLock.acquire();
+            wakeLock.release();
+        }
+    },WAKEYUP_DELAY);
+    //jicong.wang modify for bug  28249-->
     LogUtil.i(
         "InCallPresenter.onIncomingCall", "Phone switching state: " + oldState + " -> " + newState);
     inCallState = newState;
diff --git a/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/StatusBarNotifier.java b/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/StatusBarNotifier.java
index 330eee4..d3ba6f2 100755
--- a/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/StatusBarNotifier.java
+++ b/vendor/codeaurora/commonsys/packages/apps/Dialer/java/com/android/incallui/StatusBarNotifier.java
@@ -281,6 +281,12 @@ public class StatusBarNotifier
   @RequiresPermission(Manifest.permission.READ_PHONE_STATE)
   private void buildAndSendNotification(
       CallList callList, DialerCall originalCall, ContactCacheEntry contactInfo) {
+    //<!--jicong.wang modify for bug 28249
+    InCallState state = InCallPresenter.getInstance().getInCallState();
+    if (state == InCallState.INCOMING && InCallPresenter.getInstance().getActivity()!=null){
+      return;
+    }
+    //jicong.wang modify for bug 28249 -->
     Trace.beginSection("StatusBarNotifier.buildAndSendNotification");
     // This can get called to update an existing notification after contact information has come
     // back. However, it can happen much later. Before we continue, we need to make sure that
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值