android 11 Google拨号盘竖屏改横屏

android 11 Google拨号盘竖屏改横屏,第1张

--- a/frameworks/base/core/java/android/app/Activity.java
+++ b/frameworks/base/core/java/android/app/Activity.java
@@ -163,7 +163,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.Executor;
 import java.util.function.Consumer;
-
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
 
 /**
  * An activity is a single, focused thing that the user can do.  Almost all
@@ -1618,6 +1618,13 @@ public class Activity extends ContextThemeWrapper
         }
         mRestoredFromBundle = savedInstanceState != null;
         mCalled = true;
+               ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);
+               if(am.getRunningTasks(1).size()>0){
+        ComponentName cn = am.getRunningTasks(1).get(0).topActivity;
+      
+        if("com.android.incallui.InCallActivity".equals(cn.getClassName())){
+               setRequestedOrientation(SCREEN_ORIENTATION_UNSPECIFIED);}
+               }
 
     }

com.android.incallui.LegacyInCallActivity

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/756978.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-30
下一篇 2022-04-30

发表评论

登录后才能评论

评论列表(0条)

保存