Merge "Update fgs manager message and remove dot" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
bba9932a6b
@@ -543,6 +543,11 @@ public final class SystemUiDeviceConfigFlags {
|
|||||||
*/
|
*/
|
||||||
public static final String TASK_MANAGER_ENABLED = "task_manager_enabled";
|
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.
|
* (boolean) Whether the clipboard overlay is enabled.
|
||||||
|
|||||||
@@ -2477,7 +2477,7 @@
|
|||||||
<!-- Title for dialog listing applications currently running [CHAR LIMIT=NONE]-->
|
<!-- Title for dialog listing applications currently running [CHAR LIMIT=NONE]-->
|
||||||
<string name="fgs_manager_dialog_title">Active apps</string>
|
<string name="fgs_manager_dialog_title">Active apps</string>
|
||||||
<!-- Detailed message for dialog listing applications currently running [CHAR LIMIT=NONE]-->
|
<!-- 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]-->
|
<!-- Label of the button to stop an app from running [CHAR LIMIT=12]-->
|
||||||
<string name="fgs_manager_app_item_stop_button_label">Stop</string>
|
<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]-->
|
<!-- Label of the button to stop an app from running but the app is already stopped and the button is disabled [CHAR LIMIT=12]-->
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ import androidx.recyclerview.widget.DiffUtil
|
|||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags.TASK_MANAGER_ENABLED
|
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.Dumpable
|
||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
import com.android.systemui.animation.DialogLaunchAnimator
|
import com.android.systemui.animation.DialogLaunchAnimator
|
||||||
@@ -81,6 +82,8 @@ class FgsManagerController @Inject constructor(
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val LOG_TAG = FgsManagerController::class.java.simpleName
|
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
|
var changesSinceDialog = false
|
||||||
@@ -88,6 +91,8 @@ class FgsManagerController @Inject constructor(
|
|||||||
|
|
||||||
var isAvailable = false
|
var isAvailable = false
|
||||||
private set
|
private set
|
||||||
|
var showFooterDot = false
|
||||||
|
private set
|
||||||
|
|
||||||
private val lock = Any()
|
private val lock = Any()
|
||||||
|
|
||||||
@@ -151,10 +156,14 @@ class FgsManagerController @Inject constructor(
|
|||||||
deviceConfigProxy.addOnPropertiesChangedListener(NAMESPACE_SYSTEMUI,
|
deviceConfigProxy.addOnPropertiesChangedListener(NAMESPACE_SYSTEMUI,
|
||||||
backgroundExecutor) {
|
backgroundExecutor) {
|
||||||
isAvailable = it.getBoolean(TASK_MANAGER_ENABLED, isAvailable)
|
isAvailable = it.getBoolean(TASK_MANAGER_ENABLED, isAvailable)
|
||||||
|
showFooterDot =
|
||||||
|
it.getBoolean(TASK_MANAGER_SHOW_FOOTER_DOT, showFooterDot)
|
||||||
}
|
}
|
||||||
|
|
||||||
isAvailable = deviceConfigProxy
|
isAvailable = deviceConfigProxy.getBoolean(NAMESPACE_SYSTEMUI,
|
||||||
.getBoolean(NAMESPACE_SYSTEMUI, TASK_MANAGER_ENABLED, true)
|
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)
|
dumpManager.registerDumpable(this)
|
||||||
|
|
||||||
|
|||||||
@@ -149,8 +149,8 @@ public class QSFgsManagerFooter implements View.OnClickListener,
|
|||||||
if (mFgsManagerController.shouldUpdateFooterVisibility()) {
|
if (mFgsManagerController.shouldUpdateFooterVisibility()) {
|
||||||
mRootView.setVisibility(mNumPackages > 0
|
mRootView.setVisibility(mNumPackages > 0
|
||||||
&& mFgsManagerController.isAvailable() ? View.VISIBLE : View.GONE);
|
&& mFgsManagerController.isAvailable() ? View.VISIBLE : View.GONE);
|
||||||
int dotVis =
|
int dotVis = mFgsManagerController.getShowFooterDot()
|
||||||
mFgsManagerController.getChangesSinceDialog() ? View.VISIBLE : View.GONE;
|
&& mFgsManagerController.getChangesSinceDialog() ? View.VISIBLE : View.GONE;
|
||||||
mDotView.setVisibility(dotVis);
|
mDotView.setVisibility(dotVis);
|
||||||
mCollapsedDotView.setVisibility(dotVis);
|
mCollapsedDotView.setVisibility(dotVis);
|
||||||
if (mVisibilityChangedListener != null) {
|
if (mVisibilityChangedListener != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user