--- 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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)