Merge "Update fgs manager message and remove dot" into tm-dev am: bba9932a6b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18705774

Change-Id: I6bb93b4769fc772a65fc4eb869b2adfa77090f4f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-06-02 05:24:04 +00:00
committed by Automerger Merge Worker
4 changed files with 19 additions and 5 deletions

View File

@@ -543,6 +543,11 @@ public final class SystemUiDeviceConfigFlags {
*/
public static final String TASK_MANAGER_ENABLED = "task_manager_enabled";
/**
* (boolean) Whether the task manager should show an attention grabbing dot when tasks changed.
*/
public static final String TASK_MANAGER_SHOW_FOOTER_DOT = "task_manager_show_footer_dot";
/**
* (boolean) Whether the clipboard overlay is enabled.

View File

@@ -2490,7 +2490,7 @@
<!-- Title for dialog listing applications currently running [CHAR LIMIT=NONE]-->
<string name="fgs_manager_dialog_title">Active apps</string>
<!-- Detailed message for dialog listing applications currently running [CHAR LIMIT=NONE]-->
<string name="fgs_manager_dialog_message">Even if you\u2019re not using these apps, they\u2019re still active and might affect battery life</string>
<string name="fgs_manager_dialog_message">These apps are active and running, even when you\u2019re not using them. This improves their functionality, but it may also affect battery life.</string>
<!-- Label of the button to stop an app from running [CHAR LIMIT=12]-->
<string name="fgs_manager_app_item_stop_button_label">Stop</string>
<!-- Label of the button to stop an app from running but the app is already stopped and the button is disabled [CHAR LIMIT=12]-->

View File

@@ -44,6 +44,7 @@ import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags.TASK_MANAGER_ENABLED
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags.TASK_MANAGER_SHOW_FOOTER_DOT
import com.android.systemui.Dumpable
import com.android.systemui.R
import com.android.systemui.animation.DialogLaunchAnimator
@@ -81,6 +82,8 @@ class FgsManagerController @Inject constructor(
companion object {
private val LOG_TAG = FgsManagerController::class.java.simpleName
private const val DEFAULT_TASK_MANAGER_ENABLED = true
private const val DEFAULT_TASK_MANAGER_SHOW_FOOTER_DOT = false
}
var changesSinceDialog = false
@@ -88,6 +91,8 @@ class FgsManagerController @Inject constructor(
var isAvailable = false
private set
var showFooterDot = false
private set
private val lock = Any()
@@ -151,10 +156,14 @@ class FgsManagerController @Inject constructor(
deviceConfigProxy.addOnPropertiesChangedListener(NAMESPACE_SYSTEMUI,
backgroundExecutor) {
isAvailable = it.getBoolean(TASK_MANAGER_ENABLED, isAvailable)
showFooterDot =
it.getBoolean(TASK_MANAGER_SHOW_FOOTER_DOT, showFooterDot)
}
isAvailable = deviceConfigProxy
.getBoolean(NAMESPACE_SYSTEMUI, TASK_MANAGER_ENABLED, true)
isAvailable = deviceConfigProxy.getBoolean(NAMESPACE_SYSTEMUI,
TASK_MANAGER_ENABLED, DEFAULT_TASK_MANAGER_ENABLED)
showFooterDot = deviceConfigProxy.getBoolean(NAMESPACE_SYSTEMUI,
TASK_MANAGER_SHOW_FOOTER_DOT, DEFAULT_TASK_MANAGER_SHOW_FOOTER_DOT)
dumpManager.registerDumpable(this)

View File

@@ -149,8 +149,8 @@ public class QSFgsManagerFooter implements View.OnClickListener,
if (mFgsManagerController.shouldUpdateFooterVisibility()) {
mRootView.setVisibility(mNumPackages > 0
&& mFgsManagerController.isAvailable() ? View.VISIBLE : View.GONE);
int dotVis =
mFgsManagerController.getChangesSinceDialog() ? View.VISIBLE : View.GONE;
int dotVis = mFgsManagerController.getShowFooterDot()
&& mFgsManagerController.getChangesSinceDialog() ? View.VISIBLE : View.GONE;
mDotView.setVisibility(dotVis);
mCollapsedDotView.setVisibility(dotVis);
if (mVisibilityChangedListener != null) {