Skip to content

Commit

Permalink
Fix fullscreen freeform app crash on A10,A11
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshine0523 committed Sep 14, 2023
1 parent 8e6049f commit 9de2cd7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<string name="title_activity_app_list">应用列表</string>
<string name="search_app">搜索应用</string>
<string name="sidebar">侧边栏</string>
<string name="sidebar_message">屏幕两侧边缘向屏幕内侧滑动启动侧边栏</string>
<string name="sidebar_message">屏幕两侧边缘向屏幕内侧滑动启动侧边栏。在Android 11以下设备可能与返回手势冲突,请使用上下滑动手势或其他APP启动</string>
<string name="sidebar_height">侧边栏高度</string>
<string name="freeform_width">小窗宽度</string>
<string name="freeform_height">小窗高度</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<!--SettingView-->
<string name="sidebar">SideBar</string>
<string name="sidebar_message">Swipe both sides of the screen to the inside of the screen to launch the sidebar</string>
<string name="sidebar_message">Swipe both sides of the screen to the inside of the screen to launch the sidebar. On devices below Android 11, it may conflict with the back gesture. Please use the up and down gesture or another APP to start</string>
<string name="sidebar_height">SideBar Height</string>
<string name="freeform_width">Freeform Width</string>
<string name="freeform_height">Freeform Height</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class FreeformTaskStackListener(
) : ITaskStackListener.Stub() {

var taskId = -1
//For A10
//For A10, A11
var stackId = -1
// if true, listen taskRemoved
var listenTaskRemoved = false
Expand Down Expand Up @@ -126,7 +126,7 @@ class FreeformTaskStackListener(

override fun onTaskDescriptionChanged(taskInfo: ActivityManager.RunningTaskInfo?) {
when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.R -> {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
if (taskInfo != null) {
val displayId = taskInfo::class.java.getField("displayId").get(taskInfo) as Int
if (this.displayId == displayId) {
Expand All @@ -135,7 +135,7 @@ class FreeformTaskStackListener(
}
}
}
Build.VERSION.SDK_INT == Build.VERSION_CODES.Q -> {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q -> {
if (taskInfo != null) {
val displayId = taskInfo::class.java.getField("displayId").get(taskInfo) as Int
val stackId = taskInfo::class.java.getField("stackId").get(taskInfo) as Int
Expand Down

0 comments on commit 9de2cd7

Please sign in to comment.