Merge remote-tracking branch 'origin/merge-aosp15' into 15-dev
This commit is contained in:
commit
1802db8b23
2920 files changed
+323976
-46436
No files matched your search
+111
-149
@@ -17,48 +17,44 @@ package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
min_launcher3_sdk_version = "26"
|
||||
min_launcher3_sdk_version = "30"
|
||||
|
||||
// Common source files used to build launcher (java and kotlin)
|
||||
// All sources are split so they can be reused in many other libraries/apps in other folders
|
||||
|
||||
// Main Launcher source, excluding the build config
|
||||
filegroup {
|
||||
name: "launcher-src",
|
||||
srcs: [ "src/**/*.java", "src/**/*.kt" ],
|
||||
srcs: [
|
||||
"src/**/*.java",
|
||||
"src/**/*.kt",
|
||||
],
|
||||
}
|
||||
|
||||
// Source code for quickstep build, on top of launcher-src
|
||||
filegroup {
|
||||
name: "launcher-quickstep-src",
|
||||
srcs: [ "quickstep/src/**/*.java", "quickstep/src/**/*.kt" ],
|
||||
srcs: [
|
||||
"quickstep/src/**/*.java",
|
||||
"quickstep/src/**/*.kt",
|
||||
],
|
||||
}
|
||||
|
||||
// Alternate source when quickstep is not included
|
||||
filegroup {
|
||||
name: "launcher-go-src",
|
||||
srcs: [ "go/src/**/*.java", "go/src/**/*.kt" ],
|
||||
name: "launcher-src_no_quickstep",
|
||||
srcs: [
|
||||
"src_no_quickstep/**/*.java",
|
||||
"src_no_quickstep/**/*.kt",
|
||||
],
|
||||
}
|
||||
|
||||
// Default build config for Launcher3
|
||||
filegroup {
|
||||
name: "launcher-go-quickstep-src",
|
||||
srcs: [ "go/quickstep/src/**/*.java", "go/quickstep/src/**/*.kt" ],
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "launcher-src_shortcuts_overrides",
|
||||
srcs: [ "src_shortcuts_overrides/**/*.java", "src_shortcuts_overrides/**/*.kt" ],
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "launcher-src_ui_overrides",
|
||||
srcs: [ "src_ui_overrides/**/*.java", "src_ui_overrides/**/*.kt" ],
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "launcher-ext_tests",
|
||||
srcs: [ "ext_tests/**/*.java", "ext_tests/**/*.kt" ],
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "launcher-quickstep-ext_tests",
|
||||
srcs: [ "quickstep/ext_tests/**/*.java", "quickstep/ext_tests/**/*.kt" ],
|
||||
name: "launcher-build-config",
|
||||
srcs: [
|
||||
"src_build_config/**/*.java",
|
||||
],
|
||||
}
|
||||
|
||||
// Proguard files for Launcher3
|
||||
@@ -79,13 +75,14 @@ android_library {
|
||||
"androidx.test.uiautomator_uiautomator",
|
||||
"androidx.preference_preference",
|
||||
"SystemUISharedLib",
|
||||
"animationlib",
|
||||
"//frameworks/libs/systemui:animationlib",
|
||||
"launcher-testing-shared",
|
||||
],
|
||||
srcs: [
|
||||
"tests/tapl/**/*.java",
|
||||
"tests/tapl/**/*.kt",
|
||||
],
|
||||
resource_dirs: [ ],
|
||||
resource_dirs: [],
|
||||
manifest: "tests/tapl/AndroidManifest.xml",
|
||||
platform_apis: true,
|
||||
}
|
||||
@@ -99,7 +96,7 @@ java_library_static {
|
||||
sdk_version: "current",
|
||||
proto: {
|
||||
type: "lite",
|
||||
local_include_dirs:[
|
||||
local_include_dirs: [
|
||||
"protos",
|
||||
"protos_overrides",
|
||||
],
|
||||
@@ -115,14 +112,14 @@ java_library_static {
|
||||
sdk_version: "current",
|
||||
proto: {
|
||||
type: "lite",
|
||||
local_include_dirs:[
|
||||
local_include_dirs: [
|
||||
"quickstep/protos_overrides",
|
||||
],
|
||||
},
|
||||
static_libs: [
|
||||
"libprotobuf-java-lite",
|
||||
"launcher_log_protos_lite"
|
||||
],
|
||||
"libprotobuf-java-lite",
|
||||
"launcher_log_protos_lite",
|
||||
],
|
||||
}
|
||||
|
||||
java_library {
|
||||
@@ -139,11 +136,12 @@ java_library {
|
||||
// Library with all the dependencies for building Launcher3
|
||||
android_library {
|
||||
name: "Launcher3ResLib",
|
||||
srcs: [ ],
|
||||
srcs: [],
|
||||
resource_dirs: ["res"],
|
||||
static_libs: [
|
||||
"LauncherPluginLib",
|
||||
"launcher_quickstep_log_protos_lite",
|
||||
"android.os.flags-aconfig-java",
|
||||
"androidx-constraintlayout_constraintlayout",
|
||||
"androidx.recyclerview_recyclerview",
|
||||
"androidx.dynamicanimation_dynamicanimation",
|
||||
@@ -151,35 +149,28 @@ android_library {
|
||||
"androidx.preference_preference",
|
||||
"androidx.slice_slice-view",
|
||||
"androidx.cardview_cardview",
|
||||
"androidx.window_window",
|
||||
"com.google.android.material_material",
|
||||
"iconloader_base",
|
||||
"view_capture",
|
||||
"animationlib"
|
||||
],
|
||||
manifest: "AndroidManifest-common.xml",
|
||||
sdk_version: "current",
|
||||
min_sdk_version: min_launcher3_sdk_version,
|
||||
lint: {
|
||||
baseline_filename: "lint-baseline-res-lib.xml",
|
||||
},
|
||||
}
|
||||
|
||||
//
|
||||
// Build rule for Launcher3 dependencies lib.
|
||||
//
|
||||
android_library {
|
||||
name: "Launcher3CommonDepsLib",
|
||||
srcs: ["src_build_config/**/*.java"],
|
||||
static_libs: [
|
||||
"Launcher3ResLib",
|
||||
"//frameworks/libs/systemui:iconloader_base",
|
||||
"//frameworks/libs/systemui:view_capture",
|
||||
"//frameworks/libs/systemui:animationlib",
|
||||
"SystemUI-statsd",
|
||||
"launcher-testing-shared",
|
||||
"animationlib"
|
||||
"androidx.lifecycle_lifecycle-common-java8",
|
||||
"androidx.lifecycle_lifecycle-extensions",
|
||||
"androidx.lifecycle_lifecycle-runtime-ktx",
|
||||
"kotlinx_coroutines_android",
|
||||
"kotlinx_coroutines",
|
||||
"com_android_launcher3_flags_lib",
|
||||
"com_android_wm_shell_flags_lib",
|
||||
"android.appwidget.flags-aconfig-java",
|
||||
"com.android.window.flags.window-aconfig-java",
|
||||
],
|
||||
manifest: "AndroidManifest-common.xml",
|
||||
sdk_version: "current",
|
||||
min_sdk_version: min_launcher3_sdk_version,
|
||||
manifest: "AndroidManifest-common.xml",
|
||||
lint: {
|
||||
baseline_filename: "lint-baseline-common-deps-lib.xml",
|
||||
baseline_filename: "lint-baseline.xml",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -190,17 +181,14 @@ android_app {
|
||||
name: "Launcher3",
|
||||
|
||||
static_libs: [
|
||||
"Launcher3CommonDepsLib",
|
||||
"Launcher3ResLib",
|
||||
],
|
||||
srcs: [
|
||||
":launcher-src",
|
||||
":launcher-src_shortcuts_overrides",
|
||||
":launcher-src_ui_overrides",
|
||||
":launcher-ext_tests",
|
||||
],
|
||||
resource_dirs: [
|
||||
"ext_tests/res",
|
||||
":launcher-src_no_quickstep",
|
||||
":launcher-build-config",
|
||||
],
|
||||
|
||||
optimize: {
|
||||
proguard_flags_files: ["proguard.pro"],
|
||||
// Proguard is disable for testing. Derivarive prjects to keep proguard enabled
|
||||
@@ -226,14 +214,14 @@ android_app {
|
||||
"AndroidManifest-common.xml",
|
||||
],
|
||||
lint: {
|
||||
baseline_filename: "lint-baseline-launcher3.xml",
|
||||
baseline_filename: "lint-baseline.xml",
|
||||
},
|
||||
}
|
||||
|
||||
// Library with all the dependencies for building quickstep
|
||||
android_library {
|
||||
name: "QuickstepResLib",
|
||||
srcs: [ ],
|
||||
srcs: [],
|
||||
resource_dirs: [
|
||||
"quickstep/res",
|
||||
],
|
||||
@@ -244,25 +232,22 @@ android_library {
|
||||
"Launcher3ResLib",
|
||||
"lottie",
|
||||
"SystemUISharedLib",
|
||||
"SystemUI-statsd",
|
||||
"animationlib",
|
||||
"SettingsLibSettingsTheme",
|
||||
],
|
||||
manifest: "quickstep/AndroidManifest.xml",
|
||||
min_sdk_version: "current",
|
||||
}
|
||||
|
||||
|
||||
// Library with all the dependencies for building Launcher Go
|
||||
// Library with all the source code and dependencies for building Launcher Go
|
||||
android_library {
|
||||
name: "LauncherGoResLib",
|
||||
name: "Launcher3GoLib",
|
||||
srcs: [
|
||||
":launcher-src",
|
||||
":launcher-quickstep-src",
|
||||
":launcher-go-src",
|
||||
":launcher-go-quickstep-src",
|
||||
"go/quickstep/src/**/*.java",
|
||||
"go/quickstep/src/**/*.kt",
|
||||
],
|
||||
resource_dirs: [
|
||||
"go/res",
|
||||
"go/quickstep/res",
|
||||
],
|
||||
// Note the ordering here is important when it comes to resource
|
||||
@@ -270,7 +255,6 @@ android_library {
|
||||
// in QuickstepResLib to take precendece, so it should be the final
|
||||
// dependency. See b/205278434 for how this can go wrong.
|
||||
static_libs: [
|
||||
"Launcher3CommonDepsLib",
|
||||
"QuickstepResLib",
|
||||
"androidx.room_room-runtime",
|
||||
],
|
||||
@@ -281,18 +265,17 @@ android_library {
|
||||
"AndroidManifest-common.xml",
|
||||
],
|
||||
min_sdk_version: "current",
|
||||
lint: {
|
||||
baseline_filename: "lint-baseline-go-res-lib.xml",
|
||||
},
|
||||
// TODO(b/319712088): re-enable use_resource_processor
|
||||
use_resource_processor: false,
|
||||
}
|
||||
|
||||
// Build rule for Quickstep library
|
||||
// Library with all the source code and dependencies for building Quickstep
|
||||
android_library {
|
||||
name: "Launcher3QuickStepLib",
|
||||
srcs: [
|
||||
":launcher-src",
|
||||
":launcher-quickstep-src",
|
||||
":launcher-src_shortcuts_overrides",
|
||||
":launcher-build-config",
|
||||
],
|
||||
resource_dirs: [],
|
||||
libs: [
|
||||
@@ -304,60 +287,13 @@ android_library {
|
||||
// dependency. See b/208647810 for how this can go wrong.
|
||||
static_libs: [
|
||||
"SystemUI-statsd",
|
||||
"SystemUISharedLib",
|
||||
"Launcher3CommonDepsLib",
|
||||
"QuickstepResLib",
|
||||
"animationlib",
|
||||
],
|
||||
manifest: "quickstep/AndroidManifest.xml",
|
||||
platform_apis: true,
|
||||
min_sdk_version: "current",
|
||||
lint: {
|
||||
baseline_filename: "lint-baseline-launcher3.xml",
|
||||
},
|
||||
}
|
||||
|
||||
// Build rule for Launcher3 Go app for Android Go devices.
|
||||
android_app {
|
||||
name: "Launcher3Go",
|
||||
|
||||
static_libs: ["Launcher3CommonDepsLib"],
|
||||
|
||||
srcs: [
|
||||
":launcher-src",
|
||||
":launcher-go-src",
|
||||
":launcher-src_ui_overrides",
|
||||
],
|
||||
|
||||
resource_dirs: ["go/res"],
|
||||
|
||||
optimize: {
|
||||
proguard_flags_files: ["proguard.flags"],
|
||||
},
|
||||
|
||||
sdk_version: "current",
|
||||
min_sdk_version: "current",
|
||||
target_sdk_version: "current",
|
||||
privileged: true,
|
||||
system_ext_specific: true,
|
||||
overrides: [
|
||||
"Home",
|
||||
"Launcher2",
|
||||
"Launcher3",
|
||||
"Launcher3QuickStep",
|
||||
],
|
||||
required: ["privapp_whitelist_com.android.launcher3"],
|
||||
|
||||
additional_manifests: [
|
||||
"AndroidManifest.xml",
|
||||
"AndroidManifest-common.xml",
|
||||
],
|
||||
|
||||
manifest: "go/AndroidManifest.xml",
|
||||
jacoco: {
|
||||
include_filter: ["com.android.launcher3.*"],
|
||||
}
|
||||
|
||||
// TODO(b/319712088): re-enable use_resource_processor
|
||||
use_resource_processor: false,
|
||||
}
|
||||
|
||||
// Build rule for Quickstep app.
|
||||
@@ -392,32 +328,24 @@ android_app {
|
||||
manifest: "quickstep/AndroidManifest.xml",
|
||||
jacoco: {
|
||||
include_filter: ["com.android.launcher3.*"],
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
// Build rule for Launcher3 Go app with quickstep for Android Go devices.
|
||||
android_app {
|
||||
name: "Launcher3QuickStepGo",
|
||||
|
||||
static_libs: [
|
||||
"SystemUI-statsd",
|
||||
"SystemUISharedLib",
|
||||
"LauncherGoResLib",
|
||||
],
|
||||
// Build rule for Launcher3 Go app with quickstep for Android Go devices.
|
||||
// Note that the following two rules are exactly same, and should
|
||||
// eventually be merged into a single target
|
||||
android_app {
|
||||
name: "Launcher3Go",
|
||||
|
||||
static_libs: ["Launcher3GoLib"],
|
||||
resource_dirs: [],
|
||||
|
||||
platform_apis: true,
|
||||
min_sdk_version: "current",
|
||||
target_sdk_version: "current",
|
||||
|
||||
srcs: [ ],
|
||||
|
||||
resource_dirs: [
|
||||
"go/quickstep/res",
|
||||
"go/res",
|
||||
"quickstep/res",
|
||||
],
|
||||
|
||||
optimize: {
|
||||
proguard_flags_files: ["proguard.flags"],
|
||||
enabled: true,
|
||||
@@ -442,7 +370,41 @@ android_app {
|
||||
manifest: "quickstep/AndroidManifest.xml",
|
||||
jacoco: {
|
||||
include_filter: ["com.android.launcher3.*"],
|
||||
}
|
||||
|
||||
},
|
||||
}
|
||||
android_app {
|
||||
name: "Launcher3QuickStepGo",
|
||||
|
||||
static_libs: ["Launcher3GoLib"],
|
||||
resource_dirs: [],
|
||||
|
||||
platform_apis: true,
|
||||
min_sdk_version: "current",
|
||||
target_sdk_version: "current",
|
||||
|
||||
optimize: {
|
||||
proguard_flags_files: ["proguard.flags"],
|
||||
enabled: true,
|
||||
},
|
||||
|
||||
privileged: true,
|
||||
system_ext_specific: true,
|
||||
overrides: [
|
||||
"Home",
|
||||
"Launcher2",
|
||||
"Launcher3",
|
||||
"Launcher3QuickStep",
|
||||
],
|
||||
required: ["privapp_whitelist_com.android.launcher3"],
|
||||
|
||||
additional_manifests: [
|
||||
"go/AndroidManifest.xml",
|
||||
"go/AndroidManifest-launcher.xml",
|
||||
"AndroidManifest-common.xml",
|
||||
],
|
||||
|
||||
manifest: "quickstep/AndroidManifest.xml",
|
||||
jacoco: {
|
||||
include_filter: ["com.android.launcher3.*"],
|
||||
},
|
||||
}
|
||||
+15
-10
@@ -56,21 +56,22 @@
|
||||
name in the permissions. eq com.mypackage.permission.READ_SETTINGS
|
||||
-->
|
||||
<permission
|
||||
android:name="${packageName}.permission.READ_SETTINGS"
|
||||
android:name="${applicationId}.permission.READ_SETTINGS"
|
||||
android:protectionLevel="signatureOrSystem"
|
||||
android:label="@string/permlab_read_settings"
|
||||
android:description="@string/permdesc_read_settings"/>
|
||||
<permission
|
||||
android:name="${packageName}.permission.WRITE_SETTINGS"
|
||||
android:name="${applicationId}.permission.WRITE_SETTINGS"
|
||||
android:protectionLevel="signatureOrSystem"
|
||||
android:label="@string/permlab_write_settings"
|
||||
android:description="@string/permdesc_write_settings"/>
|
||||
|
||||
<uses-permission android:name="${packageName}.permission.READ_SETTINGS" />
|
||||
<uses-permission android:name="${packageName}.permission.WRITE_SETTINGS" />
|
||||
<uses-permission android:name="${applicationId}.permission.READ_SETTINGS" />
|
||||
<uses-permission android:name="${applicationId}.permission.WRITE_SETTINGS" />
|
||||
|
||||
<application
|
||||
android:backupAgent="com.android.launcher3.LauncherBackupAgent"
|
||||
android:name="app.lawnchair.LawnchairApp"
|
||||
android:fullBackupOnly="true"
|
||||
android:backupInForeground="true"
|
||||
android:fullBackupContent="@xml/backupscheme"
|
||||
@@ -130,10 +131,10 @@
|
||||
-->
|
||||
<provider
|
||||
android:name="com.android.launcher3.LauncherProvider"
|
||||
android:authorities="${packageName}.settings"
|
||||
android:authorities="${applicationId}.settings"
|
||||
android:exported="true"
|
||||
android:writePermission="${packageName}.permission.WRITE_SETTINGS"
|
||||
android:readPermission="${packageName}.permission.READ_SETTINGS" />
|
||||
android:writePermission="${applicationId}.permission.WRITE_SETTINGS"
|
||||
android:readPermission="${applicationId}.permission.READ_SETTINGS" />
|
||||
|
||||
<!--
|
||||
The content provider for exposing various launcher grid options.
|
||||
@@ -141,7 +142,7 @@
|
||||
-->
|
||||
<provider
|
||||
android:name="com.android.launcher3.graphics.GridCustomizationsProvider"
|
||||
android:authorities="${packageName}.grid_control"
|
||||
android:authorities="${applicationId}.grid_control"
|
||||
android:exported="true" />
|
||||
|
||||
<!--
|
||||
@@ -161,7 +162,7 @@
|
||||
|
||||
<provider
|
||||
android:name="com.android.launcher3.testing.TestInformationProvider"
|
||||
android:authorities="${packageName}.TestInfo"
|
||||
android:authorities="${applicationId}.TestInfo"
|
||||
android:readPermission="android.permission.WRITE_SECURE_SETTINGS"
|
||||
android:writePermission="android.permission.WRITE_SECURE_SETTINGS"
|
||||
android:exported="true"
|
||||
@@ -183,10 +184,14 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<!-- [b/197780098] Disable eager initialization of Jetpack libraries. -->
|
||||
<!-- Disable eager initialization of Jetpack libraries. See bug 197780098. -->
|
||||
<provider
|
||||
android:name="androidx.startup.InitializationProvider"
|
||||
android:authorities="${applicationId}.androidx-startup"
|
||||
tools:node="remove" />
|
||||
|
||||
<property
|
||||
android:name="android.window.PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED"
|
||||
android:value="true" />
|
||||
</application>
|
||||
</manifest>
|
||||
+1
-1
@@ -47,7 +47,7 @@
|
||||
attributes and intent filters the same
|
||||
-->
|
||||
<activity
|
||||
android:name="com.android.launcher3.Launcher"
|
||||
android:name="app.lawnchair.LawnchairLauncher"
|
||||
android:launchMode="singleTask"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:stateNotNeeded="true"
|
||||
|
||||
@@ -5,17 +5,51 @@
|
||||
#
|
||||
|
||||
adamcohen@google.com
|
||||
captaincole@google.com
|
||||
hyunyoungs@google.com
|
||||
sunnygoyal@google.com
|
||||
twickham@google.com
|
||||
vadimt@google.com
|
||||
winsonc@google.com
|
||||
jonmiranda@google.com
|
||||
alexchau@google.com
|
||||
patmanning@google.com
|
||||
tsuharesu@google.com
|
||||
awickham@google.com
|
||||
agvard@google.com
|
||||
|
||||
# Launcher workspace eng team
|
||||
captaincole@google.com
|
||||
sunnygoyal@google.com
|
||||
charlander@google.com
|
||||
fbaron@google.com
|
||||
fengjial@google.com
|
||||
fransebas@google.com
|
||||
pinyaoting@google.com
|
||||
andonian@google.com
|
||||
sihua@google.com
|
||||
|
||||
# Multitasking eng team
|
||||
tracyzhou@google.com
|
||||
peanutbutter@google.com
|
||||
jeremysim@google.com
|
||||
atsjenk@google.com
|
||||
brianji@google.com
|
||||
|
||||
# Overview eng team
|
||||
alexchau@google.com
|
||||
samcackett@google.com
|
||||
silvajordan@google.com
|
||||
uwaisashraf@google.com
|
||||
|
||||
# Physical Keyboard & Trackpad eng team
|
||||
patmanning@google.com
|
||||
helencheuk@google.com
|
||||
|
||||
# Widget Picker team
|
||||
shamalip@google.com
|
||||
zakcohen@google.com
|
||||
|
||||
per-file FeatureFlags.java, globs = set noparent
|
||||
per-file FeatureFlags.java = sunnygoyal@google.com, winsonc@google.com, adamcohen@google.com, hyunyoungs@google.com, captaincole@google.com
|
||||
|
||||
per-file DeviceConfigWrapper.java, globs = set noparent
|
||||
per-file DeviceConfigWrapper.java = sunnygoyal@google.com, winsonc@google.com, adamcohen@google.com, hyunyoungs@google.com
|
||||
|
||||
# Predictive Back
|
||||
per-file LauncherBackAnimationController.java = shanh@google.com, gallmann@google.com
|
||||
+10
-1
@@ -1,4 +1,13 @@
|
||||
[Builtin Hooks]
|
||||
ktfmt = true
|
||||
|
||||
[Builtin Hooks Options]
|
||||
ktfmt = --kotlinlang-style
|
||||
|
||||
[Tool Paths]
|
||||
ktfmt = ${REPO_ROOT}/external/ktfmt/ktfmt.sh
|
||||
|
||||
[Hook Scripts]
|
||||
checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --config_xml tools/checkstyle.xml --sha ${PREUPLOAD_COMMIT}
|
||||
|
||||
ktfmt_hook = ${REPO_ROOT}/external/ktfmt/ktfmt.py --check ${PREUPLOAD_FILES}
|
||||
flag_hook = ${REPO_ROOT}/frameworks/base/packages/SystemUI/flag_check.py --msg=${PREUPLOAD_COMMIT_MESSAGE} --files=${PREUPLOAD_FILES} --project=${REPO_PATH}
|
||||
@@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2023 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package {
|
||||
// See: http://go/android-license-faq
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
aconfig_declarations {
|
||||
name: "com_android_launcher3_flags",
|
||||
package: "com.android.launcher3",
|
||||
container: "system_ext",
|
||||
srcs: ["**/*.aconfig"],
|
||||
}
|
||||
|
||||
java_aconfig_library {
|
||||
name: "com_android_launcher3_flags_lib",
|
||||
aconfig_declarations: "com_android_launcher3_flags",
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
package: "com.android.launcher3"
|
||||
container: "system_ext"
|
||||
|
||||
flag {
|
||||
name: "enable_expanding_pause_work_button"
|
||||
namespace: "launcher"
|
||||
description: "Expand and collapse pause work button while scrolling."
|
||||
bug: "270390779"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_twoline_allapps"
|
||||
namespace: "launcher"
|
||||
description: "Enables two line label inside all apps."
|
||||
bug: "270390937"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_twoline_toggle"
|
||||
namespace: "launcher"
|
||||
description: "Enables visibility in home settings to see the toggle to turn on/off two lines in all apps."
|
||||
bug: "316027081"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_grid_only_overview"
|
||||
namespace: "launcher"
|
||||
description: "Enable a grid-only overview without a focused task."
|
||||
bug: "257950105"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_cursor_hover_states"
|
||||
namespace: "launcher"
|
||||
description: "Enables cursor hover states for certain elements."
|
||||
bug: "243191650"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_responsive_workspace"
|
||||
namespace: "launcher"
|
||||
description: "Enables new workspace grid calculations method."
|
||||
bug: "302189128"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_overview_icon_menu"
|
||||
namespace: "launcher"
|
||||
description: "Enable updated overview icon and menu within task."
|
||||
bug: "257950105"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_focus_outline"
|
||||
namespace: "launcher"
|
||||
description: "Enables focus states outline for launcher."
|
||||
bug: "310953377"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_taskbar_no_recreate"
|
||||
namespace: "launcher"
|
||||
description: "Enables taskbar with no recreation from lifecycle changes of TaskbarActivityContext."
|
||||
bug: "299193589"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_home_transition_listener"
|
||||
namespace: "launcher"
|
||||
description: "Enables launcher to listen to all transitions that include home activity"
|
||||
bug: "306053414"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_taskbar_pinning"
|
||||
namespace: "launcher"
|
||||
description: "Enables taskbar pinning to allow user to switch between transient and persistent taskbar flavors."
|
||||
bug: "296231746"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_taskbar_customization"
|
||||
namespace: "launcher"
|
||||
description: "Enables taskbar customization framework."
|
||||
bug: "347281365"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_unfolded_two_pane_picker"
|
||||
namespace: "launcher"
|
||||
description: "Enables two pane widget picker for unfolded foldables"
|
||||
bug: "313922374"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_tablet_two_pane_picker_v2"
|
||||
namespace: "launcher"
|
||||
description: "Enables full width two pane widget picker for tablets in landscape and portrait"
|
||||
bug: "315055849"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_two_pane_launcher_settings"
|
||||
namespace: "launcher"
|
||||
description: "Enables two panel settings when on large enough displays"
|
||||
bug: "204463748"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_predictive_back_gesture"
|
||||
namespace: "launcher"
|
||||
description: "Enable predictive back gesture on Launcher (including all apps and widget picker)."
|
||||
bug: "238475505"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_shortcut_dont_suggest_app"
|
||||
namespace: "launcher"
|
||||
description: "Enables don't suggest app shortcut for suggested apps"
|
||||
bug: "319250810"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_support_for_archiving"
|
||||
namespace: "launcher"
|
||||
description: "Enables support for archived apps in Launcher3, such as empty progress bar etc."
|
||||
bug: "210590852"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_private_space_install_shortcut"
|
||||
namespace: "launcher"
|
||||
description: "Enables long-press shortcut to install a copy of an app to Private space"
|
||||
bug: "316118005"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_launcher_br_metrics_fixed"
|
||||
namespace: "launcher"
|
||||
description: "Enables logging of Launcher restore metrics to the Backup & Restore team"
|
||||
bug: "307527314"
|
||||
is_fixed_read_only: true
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_reboot_unlock_animation"
|
||||
namespace: "launcher"
|
||||
description: "Enables unlock animation after device reboot"
|
||||
bug: "298231234"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_workspace_inflation"
|
||||
namespace: "launcher"
|
||||
description: "Enables asnc inflation of workspace icons"
|
||||
bug: "318539160"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_unfold_state_animation"
|
||||
namespace: "launcher"
|
||||
description: "Tie unfold animation with state animation"
|
||||
bug: "297057373"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_generated_previews"
|
||||
namespace: "launcher"
|
||||
description: "Enables support for RemoteViews previews in the widget picker."
|
||||
bug: "306546610"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_categorized_widget_suggestions"
|
||||
namespace: "launcher"
|
||||
description: "Enables widget suggestions in widget picker to be displayed in categories"
|
||||
bug: "318410881"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "force_monochrome_app_icons"
|
||||
namespace: "launcher"
|
||||
description: "Enable the ability to generate monochromatic icons, if it is not provided by the app"
|
||||
bug: "270396209"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_add_app_widget_via_config_activity_v2"
|
||||
namespace: "launcher"
|
||||
description: "When adding app widget through config activity, directly add it to workspace to reduce flicker"
|
||||
bug: "284236964"
|
||||
metadata {
|
||||
purpose: PURPOSE_BUGFIX
|
||||
}
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "use_activity_overlay"
|
||||
namespace: "launcher"
|
||||
description: "Use an activity for home screen overlay"
|
||||
bug: "273828110"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_grid_migration_fix"
|
||||
namespace: "launcher"
|
||||
description: "Keep items in place when migrating to a bigger grid"
|
||||
bug: "325286145"
|
||||
is_fixed_read_only: true
|
||||
metadata {
|
||||
purpose: PURPOSE_BUGFIX
|
||||
}
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_narrow_grid_restore"
|
||||
namespace: "launcher"
|
||||
description: "Using only the most recent workspace when restoring to avoid confusion."
|
||||
is_fixed_read_only: true
|
||||
bug: "325285743"
|
||||
metadata {
|
||||
purpose: PURPOSE_BUGFIX
|
||||
}
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_scaling_reveal_home_animation"
|
||||
namespace: "launcher"
|
||||
description: "Enables the Home gesture animation"
|
||||
bug: "308801666"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_widget_tap_to_add"
|
||||
namespace: "launcher"
|
||||
description: "Enables an add button in the widget picker"
|
||||
bug: "323886237"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_refactor_task_thumbnail"
|
||||
namespace: "launcher"
|
||||
description: "Enables rewritten version of TaskThumbnailViews in Overview"
|
||||
bug: "331753115"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_handle_delayed_gesture_callbacks"
|
||||
namespace: "launcher"
|
||||
description: "Enables additional handling for delayed mid-gesture callbacks"
|
||||
bug: "285636175"
|
||||
metadata {
|
||||
purpose: PURPOSE_BUGFIX
|
||||
}
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_fallback_overview_in_window"
|
||||
namespace: "launcher"
|
||||
description: "Enables fallback recents opening inside of a window instead of an activity."
|
||||
bug: "292269949"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_smartspace_as_a_widget"
|
||||
namespace: "launcher"
|
||||
description: "Enables smartspace as a widget"
|
||||
bug: "300140279"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_smartspace_removal_toggle"
|
||||
namespace: "launcher"
|
||||
description: "Enables smartspace removal toggle"
|
||||
bug: "303471576"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_additional_home_animations"
|
||||
namespace: "launcher"
|
||||
description: "Enables custom home animations for non-running tasks"
|
||||
bug: "237638627"
|
||||
metadata {
|
||||
purpose: PURPOSE_BUGFIX
|
||||
}
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enabled_folders_in_all_apps"
|
||||
namespace: "launcher"
|
||||
description: "Enables folders in all apps"
|
||||
bug: "341582436"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_recents_in_taskbar"
|
||||
namespace: "launcher"
|
||||
description: "Replace hybrid hotseat app predictions with strictly Recent Apps"
|
||||
bug: "315354060"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "enable_first_screen_broadcast_archiving_extras"
|
||||
namespace: "launcher"
|
||||
description: "adds Extras to first screen broadcast for archived apps"
|
||||
bug: "322314760"
|
||||
is_fixed_read_only: true
|
||||
metadata {
|
||||
purpose: PURPOSE_BUGFIX
|
||||
}
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "floating_search_bar"
|
||||
namespace: "launcher"
|
||||
description: "Search bar persists at the bottom of the screen across Launcher states"
|
||||
bug: "346408388"
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package: "com.android.launcher3"
|
||||
container: "system_ext"
|
||||
|
||||
flag {
|
||||
name: "enable_private_space"
|
||||
namespace: "launcher_search"
|
||||
description: "Enables all Launcher features associated with private space."
|
||||
bug: "306187906"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "private_space_animation"
|
||||
namespace: "launcher_search"
|
||||
description: "This flag enables the animation of the Private Space container"
|
||||
bug: "299294792"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "private_space_sys_apps_separation"
|
||||
namespace: "launcher_search"
|
||||
description: "This flag enables showing system apps separate in Private Space container."
|
||||
bug: "308054233"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "private_space_app_installer_button"
|
||||
namespace: "launcher_search"
|
||||
description: "This flag enables addition of App Installer button in Private Space container."
|
||||
bug: "308064949"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "private_space_restrict_accessibility_drag"
|
||||
namespace: "launcher_search"
|
||||
description: "This flag disables accessibility drag for Private Space Apps."
|
||||
bug: "289223923"
|
||||
}
|
||||
|
||||
flag {
|
||||
name: "private_space_restrict_item_drag"
|
||||
namespace: "launcher_search"
|
||||
description: "This flag disables drag and drop for Private Space Items."
|
||||
bug: "289223923"
|
||||
}
|
||||
|
||||
|
||||
flag {
|
||||
name: "private_space_add_floating_mask_view"
|
||||
namespace: "launcher_search"
|
||||
description: "This flag enables the floating mask view as part of the Private Space animation. "
|
||||
bug: "339850589"
|
||||
metadata {
|
||||
purpose: PURPOSE_BUGFIX
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "androidx.dynamicanimation.animation"
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs = ['src']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addFrameworkJar('framework-15.jar')
|
||||
compileOnlyCommonJars()
|
||||
@@ -0,0 +1,296 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.dynamicanimation.animation;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.os.SystemClock;
|
||||
import android.view.Choreographer;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.collection.SimpleArrayMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* This custom handler handles the timing pulse that is shared by all active ValueAnimators.
|
||||
* This approach ensures that the setting of animation values will happen on the
|
||||
* same thread that animations start on, and that all animations will share the same times for
|
||||
* calculating their values, which makes synchronizing animations possible.
|
||||
*
|
||||
* The handler uses the Choreographer by default for doing periodic callbacks. A custom
|
||||
* AnimationFrameCallbackProvider can be set on the handler to provide timing pulse that
|
||||
* may be independent of UI frame update. This could be useful in testing.
|
||||
*/
|
||||
public class AnimationHandler {
|
||||
/**
|
||||
* Callbacks that receives notifications for animation timing
|
||||
*/
|
||||
interface AnimationFrameCallback {
|
||||
/**
|
||||
* Run animation based on the frame time.
|
||||
*
|
||||
* @param frameTime The frame start time
|
||||
*/
|
||||
boolean doAnimationFrame(long frameTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is responsible for interacting with the available frame provider by either
|
||||
* registering frame callback or posting runnable, and receiving a callback for when a
|
||||
* new frame has arrived. This dispatcher class then notifies all the on-going animations of
|
||||
* the new frame, so that they can update animation values as needed.
|
||||
*/
|
||||
private class AnimationCallbackDispatcher {
|
||||
/**
|
||||
* Notifies all the on-going animations of the new frame.
|
||||
*/
|
||||
void dispatchAnimationFrame() {
|
||||
mCurrentFrameTime = SystemClock.uptimeMillis();
|
||||
AnimationHandler.this.doAnimationFrame(mCurrentFrameTime);
|
||||
if (mAnimationCallbacks.size() > 0) {
|
||||
mScheduler.postFrameCallback(mRunnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final ThreadLocal<AnimationHandler> sAnimatorHandler = new ThreadLocal<>();
|
||||
|
||||
/**
|
||||
* Internal per-thread collections used to avoid set collisions as animations start and end
|
||||
* while being processed.
|
||||
*/
|
||||
private final SimpleArrayMap<AnimationFrameCallback, Long> mDelayedCallbackStartTime =
|
||||
new SimpleArrayMap<>();
|
||||
@SuppressWarnings("WeakerAccess") /* synthetic access */
|
||||
final ArrayList<AnimationFrameCallback> mAnimationCallbacks = new ArrayList<>();
|
||||
private final AnimationCallbackDispatcher mCallbackDispatcher =
|
||||
new AnimationCallbackDispatcher();
|
||||
private final Runnable mRunnable = () -> mCallbackDispatcher.dispatchAnimationFrame();
|
||||
private FrameCallbackScheduler mScheduler;
|
||||
@SuppressWarnings("WeakerAccess") /* synthetic access */
|
||||
long mCurrentFrameTime = 0;
|
||||
private boolean mListDirty = false;
|
||||
@RestrictTo(RestrictTo.Scope.LIBRARY)
|
||||
@VisibleForTesting
|
||||
public float mDurationScale = 1.0f;
|
||||
@Nullable
|
||||
@RestrictTo(RestrictTo.Scope.LIBRARY)
|
||||
@VisibleForTesting
|
||||
public DurationScaleChangeListener mDurationScaleChangeListener;
|
||||
|
||||
static AnimationHandler getInstance() {
|
||||
if (sAnimatorHandler.get() == null) {
|
||||
AnimationHandler handler = new AnimationHandler(
|
||||
new FrameCallbackScheduler16());
|
||||
sAnimatorHandler.set(handler);
|
||||
}
|
||||
return sAnimatorHandler.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* The constructor of the AnimationHandler with {@link FrameCallbackScheduler} which is handle
|
||||
* running the given Runnable on the next frame.
|
||||
*
|
||||
* @param scheduler The scheduler for this handler to run the given runnable.
|
||||
*/
|
||||
public AnimationHandler(@NonNull FrameCallbackScheduler scheduler) {
|
||||
mScheduler = scheduler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register to get a callback on the next frame after the delay.
|
||||
*/
|
||||
void addAnimationFrameCallback(final AnimationFrameCallback callback, long delay) {
|
||||
if (mAnimationCallbacks.size() == 0) {
|
||||
mScheduler.postFrameCallback(mRunnable);
|
||||
if (Build.VERSION.SDK_INT >= 33) {
|
||||
mDurationScale = ValueAnimator.getDurationScale();
|
||||
if (mDurationScaleChangeListener == null) {
|
||||
mDurationScaleChangeListener = new DurationScaleChangeListener33();
|
||||
}
|
||||
mDurationScaleChangeListener.register();
|
||||
}
|
||||
}
|
||||
if (!mAnimationCallbacks.contains(callback)) {
|
||||
mAnimationCallbacks.add(callback);
|
||||
}
|
||||
|
||||
if (delay > 0) {
|
||||
mDelayedCallbackStartTime.put(callback, (SystemClock.uptimeMillis() + delay));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Removes the given callback from the list, so it will no longer be called for frame related
|
||||
* timing.
|
||||
*/
|
||||
void removeCallback(AnimationFrameCallback callback) {
|
||||
mDelayedCallbackStartTime.remove(callback);
|
||||
int id = mAnimationCallbacks.indexOf(callback);
|
||||
if (id >= 0) {
|
||||
mAnimationCallbacks.set(id, null);
|
||||
mListDirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("WeakerAccess") /* synthetic access */
|
||||
void doAnimationFrame(long frameTime) {
|
||||
long currentTime = SystemClock.uptimeMillis();
|
||||
for (int i = 0; i < mAnimationCallbacks.size(); i++) {
|
||||
final AnimationFrameCallback callback = mAnimationCallbacks.get(i);
|
||||
if (callback == null) {
|
||||
continue;
|
||||
}
|
||||
if (isCallbackDue(callback, currentTime)) {
|
||||
callback.doAnimationFrame(frameTime);
|
||||
}
|
||||
}
|
||||
cleanUpList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the current thread is the same thread as the animation handler
|
||||
* frame scheduler.
|
||||
*
|
||||
* @return true the current thread is the same thread as the animation handler frame scheduler.
|
||||
*/
|
||||
boolean isCurrentThread() {
|
||||
return mScheduler.isCurrentThread();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the callbacks from mDelayedCallbackStartTime once they have passed the initial delay
|
||||
* so that they can start getting frame callbacks.
|
||||
*
|
||||
* @return true if they have passed the initial delay or have no delay, false otherwise.
|
||||
*/
|
||||
private boolean isCallbackDue(AnimationFrameCallback callback, long currentTime) {
|
||||
Long startTime = mDelayedCallbackStartTime.get(callback);
|
||||
if (startTime == null) {
|
||||
return true;
|
||||
}
|
||||
if (startTime < currentTime) {
|
||||
mDelayedCallbackStartTime.remove(callback);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void cleanUpList() {
|
||||
if (mListDirty) {
|
||||
for (int i = mAnimationCallbacks.size() - 1; i >= 0; i--) {
|
||||
if (mAnimationCallbacks.get(i) == null) {
|
||||
mAnimationCallbacks.remove(i);
|
||||
}
|
||||
}
|
||||
// Unregister duration scale listener if there are no current animations.
|
||||
if (mAnimationCallbacks.size() == 0) {
|
||||
if (Build.VERSION.SDK_INT >= 33) {
|
||||
mDurationScaleChangeListener.unregister();
|
||||
}
|
||||
}
|
||||
mListDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the FrameCallbackScheduler in this handler.
|
||||
*
|
||||
* @return The FrameCallbackScheduler in this handler
|
||||
*/
|
||||
@NonNull
|
||||
FrameCallbackScheduler getScheduler() {
|
||||
return mScheduler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default provider of timing pulse that uses Choreographer for frame callbacks.
|
||||
*/
|
||||
static final class FrameCallbackScheduler16 implements FrameCallbackScheduler {
|
||||
|
||||
private final Choreographer mChoreographer = Choreographer.getInstance();
|
||||
private final Looper mLooper = Looper.myLooper();
|
||||
|
||||
@Override
|
||||
public void postFrameCallback(@NonNull Runnable frameCallback) {
|
||||
mChoreographer.postFrameCallback(time -> frameCallback.run());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCurrentThread() {
|
||||
return Thread.currentThread() == mLooper.getThread();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the system-wide scaling factor for animations.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public float getDurationScale() {
|
||||
return mDurationScale;
|
||||
}
|
||||
|
||||
/**
|
||||
* T+ listener for changes to the system-wide scaling factor for Animator-based animations.
|
||||
*/
|
||||
@RestrictTo(RestrictTo.Scope.LIBRARY)
|
||||
@RequiresApi(api = 33)
|
||||
@VisibleForTesting
|
||||
public class DurationScaleChangeListener33 implements DurationScaleChangeListener {
|
||||
ValueAnimator.DurationScaleChangeListener mListener;
|
||||
|
||||
@Override
|
||||
public boolean register() {
|
||||
if (mListener == null) {
|
||||
mListener = scale -> AnimationHandler.this.mDurationScale = scale;
|
||||
return ValueAnimator.registerDurationScaleChangeListener(mListener);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean unregister() {
|
||||
boolean unregistered = ValueAnimator.unregisterDurationScaleChangeListener(mListener);
|
||||
mListener = null;
|
||||
return unregistered;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* listener for changes to the system-wide scaling factor for Animator-based animations.
|
||||
*/
|
||||
@RestrictTo(RestrictTo.Scope.LIBRARY)
|
||||
@VisibleForTesting
|
||||
public interface DurationScaleChangeListener {
|
||||
/**
|
||||
* Registers a duration scale change listener.
|
||||
* @return true if a listener is registered or one is already registered.
|
||||
*/
|
||||
boolean register();
|
||||
|
||||
/**
|
||||
* Unregisters a duration scale change listener.
|
||||
* @return true if a listener is unregistered.
|
||||
*/
|
||||
boolean unregister();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,846 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.dynamicanimation.animation;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.util.AndroidRuntimeException;
|
||||
import android.view.Choreographer;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.FloatRange;
|
||||
import androidx.annotation.MainThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RestrictTo;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.core.view.ViewCompat;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* This class is the base class of physics-based animations. It manages the animation's
|
||||
* lifecycle such as {@link #start()} and {@link #cancel()}. This base class also handles the common
|
||||
* setup for all the subclass animations. For example, DynamicAnimation supports adding
|
||||
* {@link OnAnimationEndListener} and {@link OnAnimationUpdateListener} so that the important
|
||||
* animation events can be observed through the callbacks. The start conditions for any subclass of
|
||||
* DynamicAnimation can be set using {@link #setStartValue(float)} and
|
||||
* {@link #setStartVelocity(float)}.
|
||||
*
|
||||
* @param <T> subclass of DynamicAnimation
|
||||
*/
|
||||
public abstract class DynamicAnimation<T extends DynamicAnimation<T>>
|
||||
implements AnimationHandler.AnimationFrameCallback {
|
||||
|
||||
/**
|
||||
* ViewProperty holds the access of a property of a {@link View}. When an animation is
|
||||
* created with a {@link ViewProperty} instance, the corresponding property value of the view
|
||||
* will be updated through this ViewProperty instance.
|
||||
*/
|
||||
public abstract static class ViewProperty extends FloatPropertyCompat<View> {
|
||||
private ViewProperty(String name) {
|
||||
super(name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* View's translationX property.
|
||||
*/
|
||||
public static final ViewProperty TRANSLATION_X = new ViewProperty("translationX") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setTranslationX(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getTranslationX();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's translationY property.
|
||||
*/
|
||||
public static final ViewProperty TRANSLATION_Y = new ViewProperty("translationY") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setTranslationY(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getTranslationY();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's translationZ property.
|
||||
*/
|
||||
public static final ViewProperty TRANSLATION_Z = new ViewProperty("translationZ") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
ViewCompat.setTranslationZ(view, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return ViewCompat.getTranslationZ(view);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's scaleX property.
|
||||
*/
|
||||
public static final ViewProperty SCALE_X = new ViewProperty("scaleX") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setScaleX(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getScaleX();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's scaleY property.
|
||||
*/
|
||||
public static final ViewProperty SCALE_Y = new ViewProperty("scaleY") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setScaleY(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getScaleY();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's rotation property.
|
||||
*/
|
||||
public static final ViewProperty ROTATION = new ViewProperty("rotation") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setRotation(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getRotation();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's rotationX property.
|
||||
*/
|
||||
public static final ViewProperty ROTATION_X = new ViewProperty("rotationX") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setRotationX(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getRotationX();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's rotationY property.
|
||||
*/
|
||||
public static final ViewProperty ROTATION_Y = new ViewProperty("rotationY") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setRotationY(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getRotationY();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's x property.
|
||||
*/
|
||||
public static final ViewProperty X = new ViewProperty("x") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setX(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getX();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's y property.
|
||||
*/
|
||||
public static final ViewProperty Y = new ViewProperty("y") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setY(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getY();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's z property.
|
||||
*/
|
||||
public static final ViewProperty Z = new ViewProperty("z") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
ViewCompat.setZ(view, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return ViewCompat.getZ(view);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's alpha property.
|
||||
*/
|
||||
public static final ViewProperty ALPHA = new ViewProperty("alpha") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setAlpha(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getAlpha();
|
||||
}
|
||||
};
|
||||
|
||||
// Properties below are not RenderThread compatible
|
||||
/**
|
||||
* View's scrollX property.
|
||||
*/
|
||||
public static final ViewProperty SCROLL_X = new ViewProperty("scrollX") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setScrollX((int) value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getScrollX();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* View's scrollY property.
|
||||
*/
|
||||
public static final ViewProperty SCROLL_Y = new ViewProperty("scrollY") {
|
||||
@Override
|
||||
public void setValue(View view, float value) {
|
||||
view.setScrollY((int) value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getValue(View view) {
|
||||
return view.getScrollY();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The minimum visible change in pixels that can be visible to users.
|
||||
*/
|
||||
@SuppressLint("MinMaxConstant")
|
||||
public static final float MIN_VISIBLE_CHANGE_PIXELS = 1f;
|
||||
/**
|
||||
* The minimum visible change in degrees that can be visible to users.
|
||||
*/
|
||||
@SuppressLint("MinMaxConstant")
|
||||
public static final float MIN_VISIBLE_CHANGE_ROTATION_DEGREES = 1f / 10f;
|
||||
/**
|
||||
* The minimum visible change in alpha that can be visible to users.
|
||||
*/
|
||||
@SuppressLint("MinMaxConstant")
|
||||
public static final float MIN_VISIBLE_CHANGE_ALPHA = 1f / 256f;
|
||||
/**
|
||||
* The minimum visible change in scale that can be visible to users.
|
||||
*/
|
||||
@SuppressLint("MinMaxConstant")
|
||||
public static final float MIN_VISIBLE_CHANGE_SCALE = 1f / 500f;
|
||||
|
||||
// Use the max value of float to indicate an unset state.
|
||||
private static final float UNSET = Float.MAX_VALUE;
|
||||
|
||||
// Multiplier to the min visible change value for value threshold
|
||||
private static final float THRESHOLD_MULTIPLIER = 0.75f;
|
||||
|
||||
// Internal tracking for velocity.
|
||||
float mVelocity = 0;
|
||||
|
||||
// Internal tracking for value.
|
||||
float mValue = UNSET;
|
||||
|
||||
// Tracks whether start value is set. If not, the animation will obtain the value at the time
|
||||
// of starting through the getter and use that as the starting value of the animation.
|
||||
boolean mStartValueIsSet = false;
|
||||
|
||||
// Target to be animated.
|
||||
final Object mTarget;
|
||||
|
||||
// View property id.
|
||||
final FloatPropertyCompat mProperty;
|
||||
|
||||
// Package private tracking of animation lifecycle state. Visible to subclass animations.
|
||||
boolean mRunning = false;
|
||||
|
||||
// Min and max values that defines the range of the animation values.
|
||||
float mMaxValue = Float.MAX_VALUE;
|
||||
float mMinValue = -mMaxValue;
|
||||
|
||||
// Last frame time. Always gets reset to -1 at the end of the animation.
|
||||
private long mLastFrameTime = 0;
|
||||
|
||||
private float mMinVisibleChange;
|
||||
|
||||
// List of end listeners
|
||||
private final ArrayList<OnAnimationEndListener> mEndListeners = new ArrayList<>();
|
||||
|
||||
// List of update listeners
|
||||
private final ArrayList<OnAnimationUpdateListener> mUpdateListeners = new ArrayList<>();
|
||||
|
||||
// Animation handler used to schedule updates for this animation.
|
||||
private AnimationHandler mAnimationHandler;
|
||||
|
||||
// Internal state for value/velocity pair.
|
||||
static class MassState {
|
||||
float mValue;
|
||||
float mVelocity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dynamic animation with the given FloatValueHolder instance.
|
||||
*
|
||||
* @param floatValueHolder the FloatValueHolder instance to be animated.
|
||||
*/
|
||||
DynamicAnimation(final FloatValueHolder floatValueHolder) {
|
||||
mTarget = null;
|
||||
mProperty = new FloatPropertyCompat("FloatValueHolder") {
|
||||
@Override
|
||||
public float getValue(Object object) {
|
||||
return floatValueHolder.getValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(Object object, float value) {
|
||||
floatValueHolder.setValue(value);
|
||||
}
|
||||
};
|
||||
mMinVisibleChange = MIN_VISIBLE_CHANGE_PIXELS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dynamic animation to animate the given property for the given {@link View}
|
||||
*
|
||||
* @param object the Object whose property is to be animated
|
||||
* @param property the property to be animated
|
||||
*/
|
||||
|
||||
<K> DynamicAnimation(K object, FloatPropertyCompat<K> property) {
|
||||
mTarget = object;
|
||||
mProperty = property;
|
||||
if (mProperty == ROTATION || mProperty == ROTATION_X
|
||||
|| mProperty == ROTATION_Y) {
|
||||
mMinVisibleChange = MIN_VISIBLE_CHANGE_ROTATION_DEGREES;
|
||||
} else if (mProperty == ALPHA) {
|
||||
mMinVisibleChange = MIN_VISIBLE_CHANGE_ALPHA;
|
||||
} else if (mProperty == SCALE_X || mProperty == SCALE_Y) {
|
||||
mMinVisibleChange = MIN_VISIBLE_CHANGE_SCALE;
|
||||
} else {
|
||||
mMinVisibleChange = MIN_VISIBLE_CHANGE_PIXELS;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the start value of the animation. If start value is not set, the animation will get
|
||||
* the current value for the view's property, and use that as the start value.
|
||||
*
|
||||
* @param startValue start value for the animation
|
||||
* @return the Animation whose start value is being set
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T setStartValue(float startValue) {
|
||||
mValue = startValue;
|
||||
mStartValueIsSet = true;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start velocity of the animation. Default velocity is 0. Unit: change in property per
|
||||
* second (e.g. pixels per second, scale/alpha value change per second).
|
||||
*
|
||||
* <p>Note when using a fixed value as the start velocity (as opposed to getting the velocity
|
||||
* through touch events), it is recommended to define such a value in dp/second and convert it
|
||||
* to pixel/second based on the density of the screen to achieve a consistent look across
|
||||
* different screens.
|
||||
*
|
||||
* <p>To convert from dp/second to pixel/second:
|
||||
* <pre class="prettyprint">
|
||||
* float pixelPerSecond = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpPerSecond,
|
||||
* getResources().getDisplayMetrics());
|
||||
* </pre>
|
||||
*
|
||||
* @param startVelocity start velocity of the animation
|
||||
* @return the Animation whose start velocity is being set
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T setStartVelocity(float startVelocity) {
|
||||
mVelocity = startVelocity;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the max value of the animation. Animations will not animate beyond their max value.
|
||||
* Whether or not animation will come to an end when max value is reached is dependent on the
|
||||
* child animation's implementation.
|
||||
*
|
||||
* @param max maximum value of the property to be animated
|
||||
* @return the Animation whose max value is being set
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T setMaxValue(float max) {
|
||||
// This max value should be checked and handled in the subclass animations, instead of
|
||||
// assuming the end of the animations when the max/min value is hit in the base class.
|
||||
// The reason is that hitting max/min value may just be a transient state, such as during
|
||||
// the spring oscillation.
|
||||
mMaxValue = max;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the min value of the animation. Animations will not animate beyond their min value.
|
||||
* Whether or not animation will come to an end when min value is reached is dependent on the
|
||||
* child animation's implementation.
|
||||
*
|
||||
* @param min minimum value of the property to be animated
|
||||
* @return the Animation whose min value is being set
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T setMinValue(float min) {
|
||||
mMinValue = min;
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an end listener to the animation for receiving onAnimationEnd callbacks. If the listener
|
||||
* is {@code null} or has already been added to the list of listeners for the animation, no op.
|
||||
*
|
||||
* @param listener the listener to be added
|
||||
* @return the animation to which the listener is added
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T addEndListener(OnAnimationEndListener listener) {
|
||||
if (!mEndListeners.contains(listener)) {
|
||||
mEndListeners.add(listener);
|
||||
}
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the end listener from the animation, so as to stop receiving animation end callbacks.
|
||||
*
|
||||
* @param listener the listener to be removed
|
||||
*/
|
||||
public void removeEndListener(OnAnimationEndListener listener) {
|
||||
removeEntry(mEndListeners, listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an update listener to the animation for receiving per-frame animation update callbacks.
|
||||
* If the listener is {@code null} or has already been added to the list of listeners for the
|
||||
* animation, no op.
|
||||
*
|
||||
* <p>Note that update listener should only be added before the start of the animation.
|
||||
*
|
||||
* @param listener the listener to be added
|
||||
* @return the animation to which the listener is added
|
||||
* @throws UnsupportedOperationException if the update listener is added after the animation has
|
||||
* started
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T addUpdateListener(OnAnimationUpdateListener listener) {
|
||||
if (isRunning()) {
|
||||
// Require update listener to be added before the animation, such as when we start
|
||||
// the animation, we know whether the animation is RenderThread compatible.
|
||||
throw new UnsupportedOperationException("Error: Update listeners must be added before"
|
||||
+ "the animation.");
|
||||
}
|
||||
if (!mUpdateListeners.contains(listener)) {
|
||||
mUpdateListeners.add(listener);
|
||||
}
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the update listener from the animation, so as to stop receiving animation update
|
||||
* callbacks.
|
||||
*
|
||||
* @param listener the listener to be removed
|
||||
*/
|
||||
public void removeUpdateListener(OnAnimationUpdateListener listener) {
|
||||
removeEntry(mUpdateListeners, listener);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This method sets the minimal change of animation value that is visible to users, which helps
|
||||
* determine a reasonable threshold for the animation's termination condition. It is critical
|
||||
* to set the minimal visible change for custom properties (i.e. non-<code>ViewProperty</code>s)
|
||||
* unless the custom property is in pixels.
|
||||
*
|
||||
* <p>For custom properties, this minimum visible change defaults to change in pixel
|
||||
* (i.e. {@link #MIN_VISIBLE_CHANGE_PIXELS}. It is recommended to adjust this value that is
|
||||
* reasonable for the property to be animated. A general rule of thumb to calculate such a value
|
||||
* is: minimum visible change = range of custom property value / corresponding pixel range. For
|
||||
* example, if the property to be animated is a progress (from 0 to 100) that corresponds to a
|
||||
* 200-pixel change. Then the min visible change should be 100 / 200. (i.e. 0.5).
|
||||
*
|
||||
* <p>It's not necessary to call this method when animating {@link ViewProperty}s, as the
|
||||
* minimum visible change will be derived from the property. For example, if the property to be
|
||||
* animated is in pixels (i.e. {@link #TRANSLATION_X}, {@link #TRANSLATION_Y},
|
||||
* {@link #TRANSLATION_Z}, @{@link #SCROLL_X} or {@link #SCROLL_Y}), the default minimum visible
|
||||
* change is 1 (pixel). For {@link #ROTATION}, {@link #ROTATION_X} or {@link #ROTATION_Y}, the
|
||||
* animation will use {@link #MIN_VISIBLE_CHANGE_ROTATION_DEGREES} as the min visible change,
|
||||
* which is 1/10. Similarly, the minimum visible change for alpha (
|
||||
* i.e. {@link #MIN_VISIBLE_CHANGE_ALPHA} is defined as 1 / 256.
|
||||
*
|
||||
* @param minimumVisibleChange minimum change in property value that is visible to users
|
||||
* @return the animation whose min visible change is being set
|
||||
* @throws IllegalArgumentException if the given threshold is not positive
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public T setMinimumVisibleChange(@FloatRange(from = 0.0, fromInclusive = false)
|
||||
float minimumVisibleChange) {
|
||||
if (minimumVisibleChange <= 0) {
|
||||
throw new IllegalArgumentException("Minimum visible change must be positive.");
|
||||
}
|
||||
mMinVisibleChange = minimumVisibleChange;
|
||||
setValueThreshold(minimumVisibleChange * THRESHOLD_MULTIPLIER);
|
||||
return (T) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum change in the animation property that could be visibly different to
|
||||
* users.
|
||||
*
|
||||
* @return minimum change in property value that is visible to users
|
||||
*/
|
||||
public float getMinimumVisibleChange() {
|
||||
return mMinVisibleChange;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove {@code null} entries from the list.
|
||||
*/
|
||||
private static <T> void removeNullEntries(ArrayList<T> list) {
|
||||
// Clean up null entries
|
||||
for (int i = list.size() - 1; i >= 0; i--) {
|
||||
if (list.get(i) == null) {
|
||||
list.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an entry from the list by marking it {@code null} and clean up later.
|
||||
*/
|
||||
private static <T> void removeEntry(ArrayList<T> list, T entry) {
|
||||
int id = list.indexOf(entry);
|
||||
if (id >= 0) {
|
||||
list.set(id, null);
|
||||
}
|
||||
}
|
||||
|
||||
/****************Animation Lifecycle Management***************/
|
||||
|
||||
/**
|
||||
* Starts an animation. If the animation has already been started, no op. Note that calling
|
||||
* {@link #start()} will not immediately set the property value to start value of the animation.
|
||||
* The property values will be changed at each animation pulse, which happens before the draw
|
||||
* pass. As a result, the changes will be reflected in the next frame, the same as if the values
|
||||
* were set immediately. This method should only be called on main thread.
|
||||
*
|
||||
* Unless a AnimationHandler is provided via setAnimationHandler, a default AnimationHandler
|
||||
* is created on the same thread as the first call to start/cancel an animation. All the
|
||||
* subsequent animation lifecycle manipulations need to be on that same thread, until the
|
||||
* AnimationHandler is reset (using [setAnimationHandler]).
|
||||
*
|
||||
* @throws AndroidRuntimeException if this method is not called on the same thread as the
|
||||
* animation handler
|
||||
*/
|
||||
@MainThread
|
||||
public void start() {
|
||||
if (!getAnimationHandler().isCurrentThread()) {
|
||||
throw new AndroidRuntimeException("Animations may only be started on the same thread "
|
||||
+ "as the animation handler");
|
||||
}
|
||||
if (!mRunning) {
|
||||
startAnimationInternal();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels the on-going animation. If the animation hasn't started, no op.
|
||||
*
|
||||
* Unless a AnimationHandler is provided via setAnimationHandler, a default AnimationHandler
|
||||
* is created on the same thread as the first call to start/cancel an animation. All the
|
||||
* subsequent animation lifecycle manipulations need to be on that same thread, until the
|
||||
* AnimationHandler is reset (using [setAnimationHandler]).
|
||||
*
|
||||
* @throws AndroidRuntimeException if this method is not called on the same thread as the
|
||||
* animation handler
|
||||
*/
|
||||
@MainThread
|
||||
public void cancel() {
|
||||
if (!getAnimationHandler().isCurrentThread()) {
|
||||
throw new AndroidRuntimeException("Animations may only be canceled from the same "
|
||||
+ "thread as the animation handler");
|
||||
}
|
||||
if (mRunning) {
|
||||
endAnimationInternal(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the animation is currently running.
|
||||
*
|
||||
* @return {@code true} if the animation is currently running, {@code false} otherwise
|
||||
*/
|
||||
public boolean isRunning() {
|
||||
return mRunning;
|
||||
}
|
||||
|
||||
/************************** Private APIs below ********************************/
|
||||
|
||||
// This gets called when the animation is started, to finish the setup of the animation
|
||||
// before the animation pulsing starts.
|
||||
private void startAnimationInternal() {
|
||||
if (!mRunning) {
|
||||
mRunning = true;
|
||||
if (!mStartValueIsSet) {
|
||||
mValue = getPropertyValue();
|
||||
}
|
||||
// Sanity check:
|
||||
if (mValue > mMaxValue || mValue < mMinValue) {
|
||||
throw new IllegalArgumentException("Starting value need to be in between min"
|
||||
+ " value and max value");
|
||||
}
|
||||
getAnimationHandler().addAnimationFrameCallback(this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This gets call on each frame of the animation. Animation value and velocity are updated
|
||||
* in this method based on the new frame time. The property value of the view being animated
|
||||
* is then updated. The animation's ending conditions are also checked in this method. Once
|
||||
* the animation reaches equilibrium, the animation will come to its end, and end listeners
|
||||
* will be notified, if any.
|
||||
*
|
||||
*/
|
||||
@RestrictTo(RestrictTo.Scope.LIBRARY)
|
||||
@Override
|
||||
public boolean doAnimationFrame(long frameTime) {
|
||||
if (mLastFrameTime == 0) {
|
||||
// First frame.
|
||||
mLastFrameTime = frameTime;
|
||||
setPropertyValue(mValue);
|
||||
return false;
|
||||
}
|
||||
long deltaT = frameTime - mLastFrameTime;
|
||||
mLastFrameTime = frameTime;
|
||||
float durationScale = getAnimationHandler().getDurationScale();
|
||||
deltaT = durationScale == 0.0f ? Integer.MAX_VALUE : (long) (deltaT / durationScale);
|
||||
boolean finished = updateValueAndVelocity(deltaT);
|
||||
// Clamp value & velocity.
|
||||
mValue = Math.min(mValue, mMaxValue);
|
||||
mValue = Math.max(mValue, mMinValue);
|
||||
|
||||
setPropertyValue(mValue);
|
||||
|
||||
if (finished) {
|
||||
endAnimationInternal(false);
|
||||
}
|
||||
return finished;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the animation state (i.e. value and velocity). This method is package private, so
|
||||
* subclasses can override this method to calculate the new value and velocity in their custom
|
||||
* way.
|
||||
*
|
||||
* @param deltaT time elapsed in millisecond since last frame
|
||||
* @return whether the animation has finished
|
||||
*/
|
||||
abstract boolean updateValueAndVelocity(long deltaT);
|
||||
|
||||
/**
|
||||
* Internal method to reset the animation states when animation is finished/canceled.
|
||||
*/
|
||||
private void endAnimationInternal(boolean canceled) {
|
||||
mRunning = false;
|
||||
getAnimationHandler().removeCallback(this);
|
||||
mLastFrameTime = 0;
|
||||
mStartValueIsSet = false;
|
||||
for (int i = 0; i < mEndListeners.size(); i++) {
|
||||
if (mEndListeners.get(i) != null) {
|
||||
mEndListeners.get(i).onAnimationEnd(this, canceled, mValue, mVelocity);
|
||||
}
|
||||
}
|
||||
removeNullEntries(mEndListeners);
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the property value through the corresponding setter.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
void setPropertyValue(float value) {
|
||||
mProperty.setValue(mTarget, value);
|
||||
for (int i = 0; i < mUpdateListeners.size(); i++) {
|
||||
if (mUpdateListeners.get(i) != null) {
|
||||
mUpdateListeners.get(i).onAnimationUpdate(this, mValue, mVelocity);
|
||||
}
|
||||
}
|
||||
removeNullEntries(mUpdateListeners);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default threshold.
|
||||
*/
|
||||
float getValueThreshold() {
|
||||
return mMinVisibleChange * THRESHOLD_MULTIPLIER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain the property value through the corresponding getter.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private float getPropertyValue() {
|
||||
return mProperty.getValue(mTarget);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link AnimationHandler} used to schedule updates for this animator.
|
||||
*
|
||||
* @return the {@link AnimationHandler} for this animator.
|
||||
*/
|
||||
@NonNull
|
||||
@VisibleForTesting
|
||||
public AnimationHandler getAnimationHandler() {
|
||||
return mAnimationHandler != null ? mAnimationHandler : AnimationHandler.getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@link FrameCallbackScheduler} used to schedule updates for this animator.
|
||||
*
|
||||
* If not already set using {@link #setScheduler(FrameCallbackScheduler)}, this is initialized
|
||||
* to an {@link FrameCallbackScheduler} that uses the caller thread's {@link Choreographer}.
|
||||
* Otherwise, return the scheduler set via the previous
|
||||
* {@link #setScheduler(FrameCallbackScheduler)} call.
|
||||
*
|
||||
* @return the {@link FrameCallbackScheduler} for this animator.
|
||||
*/
|
||||
@NonNull
|
||||
public FrameCallbackScheduler getScheduler() {
|
||||
return mAnimationHandler != null ? mAnimationHandler.getScheduler()
|
||||
: AnimationHandler.getInstance().getScheduler();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the frame scheduler used to schedule updates for this animator. Note this should
|
||||
* be called before animation running, as it would lead to discontinuity in animations.
|
||||
*
|
||||
* @param scheduler The {@link FrameCallbackScheduler} that will be used to schedule updates
|
||||
* for this animator.
|
||||
* @throws AndroidRuntimeException if this method called when animation running
|
||||
*/
|
||||
public void setScheduler(@NonNull FrameCallbackScheduler scheduler) {
|
||||
if (mAnimationHandler != null && mAnimationHandler.getScheduler() == scheduler) {
|
||||
return;
|
||||
}
|
||||
if (mRunning) {
|
||||
throw new AndroidRuntimeException("Animations are still running and the animation"
|
||||
+ "handler should not be set at this timming");
|
||||
}
|
||||
|
||||
mAnimationHandler = new AnimationHandler(scheduler);
|
||||
}
|
||||
|
||||
/****************Sub class animations**************/
|
||||
/**
|
||||
* Returns the acceleration at the given value with the given velocity.
|
||||
*/
|
||||
abstract float getAcceleration(float value, float velocity);
|
||||
|
||||
/**
|
||||
* Returns whether the animation has reached equilibrium.
|
||||
*/
|
||||
abstract boolean isAtEquilibrium(float value, float velocity);
|
||||
|
||||
/**
|
||||
* Updates the default value threshold for the animation based on the property to be animated.
|
||||
*/
|
||||
abstract void setValueThreshold(float threshold);
|
||||
|
||||
/**
|
||||
* An animation listener that receives end notifications from an animation.
|
||||
*/
|
||||
public interface OnAnimationEndListener {
|
||||
/**
|
||||
* Notifies the end of an animation. Note that this callback will be invoked not only when
|
||||
* an animation reach equilibrium, but also when the animation is canceled.
|
||||
*
|
||||
* @param animation animation that has ended or was canceled
|
||||
* @param canceled whether the animation has been canceled
|
||||
* @param value the final value when the animation stopped
|
||||
* @param velocity the final velocity when the animation stopped
|
||||
*/
|
||||
void onAnimationEnd(DynamicAnimation animation, boolean canceled, float value,
|
||||
float velocity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementors of this interface can add themselves as update listeners
|
||||
* to an <code>DynamicAnimation</code> instance to receive callbacks on every animation
|
||||
* frame, after the current frame's values have been calculated for that
|
||||
* <code>DynamicAnimation</code>.
|
||||
*/
|
||||
public interface OnAnimationUpdateListener {
|
||||
|
||||
/**
|
||||
* Notifies the occurrence of another frame of the animation.
|
||||
*
|
||||
* @param animation animation that the update listener is added to
|
||||
* @param value the current value of the animation
|
||||
* @param velocity the current velocity of the animation
|
||||
*/
|
||||
void onAnimationUpdate(DynamicAnimation animation, float value, float velocity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.dynamicanimation.animation;
|
||||
|
||||
import androidx.annotation.FloatRange;
|
||||
|
||||
/**
|
||||
* <p>Fling animation is an animation that continues an initial momentum (most often from gesture
|
||||
* velocity) and gradually slows down. The fling animation will come to a stop when the velocity of
|
||||
* the animation is below the threshold derived from {@link #setMinimumVisibleChange(float)},
|
||||
* or when the value of the animation has gone beyond the min or max value defined via
|
||||
* {@link DynamicAnimation#setMinValue(float)} or {@link DynamicAnimation#setMaxValue(float)}.
|
||||
* It is recommended to restrict the fling animation with min and/or max value, such that the
|
||||
* animation can end when it goes beyond screen bounds, thus preserving CPU cycles and resources.
|
||||
*
|
||||
* <p>For example, you can create a fling animation that animates the translationX of a view:
|
||||
* <pre class="prettyprint">
|
||||
* FlingAnimation flingAnim = new FlingAnimation(view, DynamicAnimation.TRANSLATION_X)
|
||||
* // Sets the start velocity to -2000 (pixel/s)
|
||||
* .setStartVelocity(-2000)
|
||||
* // Optional but recommended to set a reasonable min and max range for the animation.
|
||||
* // In this particular case, we set the min and max to -200 and 2000 respectively.
|
||||
* .setMinValue(-200).setMaxValue(2000);
|
||||
* flingAnim.start();
|
||||
* </pre>
|
||||
*/
|
||||
public final class FlingAnimation extends DynamicAnimation<FlingAnimation> {
|
||||
|
||||
private final DragForce mFlingForce = new DragForce();
|
||||
|
||||
/**
|
||||
* <p>This creates a FlingAnimation that animates a {@link FloatValueHolder} instance. During
|
||||
* the animation, the {@link FloatValueHolder} instance will be updated via
|
||||
* {@link FloatValueHolder#setValue(float)} each frame. The caller can obtain the up-to-date
|
||||
* animation value via {@link FloatValueHolder#getValue()}.
|
||||
*
|
||||
* <p><strong>Note:</strong> changing the value in the {@link FloatValueHolder} via
|
||||
* {@link FloatValueHolder#setValue(float)} outside of the animation during an
|
||||
* animation run will not have any effect on the on-going animation.
|
||||
*
|
||||
* @param floatValueHolder the property to be animated
|
||||
*/
|
||||
public FlingAnimation(FloatValueHolder floatValueHolder) {
|
||||
super(floatValueHolder);
|
||||
mFlingForce.setValueThreshold(getValueThreshold());
|
||||
}
|
||||
|
||||
/**
|
||||
* This creates a FlingAnimation that animates the property of the given object.
|
||||
*
|
||||
* @param object the Object whose property will be animated
|
||||
* @param property the property to be animated
|
||||
* @param <K> the class on which the property is declared
|
||||
*/
|
||||
public <K> FlingAnimation(K object, FloatPropertyCompat<K> property) {
|
||||
super(object, property);
|
||||
mFlingForce.setValueThreshold(getValueThreshold());
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the friction for the fling animation. The greater the friction is, the sooner the
|
||||
* animation will slow down. When not set, the friction defaults to 1.
|
||||
*
|
||||
* @param friction the friction used in the animation
|
||||
* @return the animation whose friction will be scaled
|
||||
* @throws IllegalArgumentException if the input friction is not positive
|
||||
*/
|
||||
public FlingAnimation setFriction(
|
||||
@FloatRange(from = 0.0, fromInclusive = false) float friction) {
|
||||
if (friction <= 0) {
|
||||
throw new IllegalArgumentException("Friction must be positive");
|
||||
}
|
||||
mFlingForce.setFrictionScalar(friction);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the friction being set on the animation via {@link #setFriction(float)}. If the
|
||||
* friction has not been set, the default friction of 1 will be returned.
|
||||
*
|
||||
* @return friction being used in the animation
|
||||
*/
|
||||
public float getFriction() {
|
||||
return mFlingForce.getFrictionScalar();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the min value of the animation. When a fling animation reaches the min value, the
|
||||
* animation will end immediately. Animations will not animate beyond the min value.
|
||||
*
|
||||
* @param minValue minimum value of the property to be animated
|
||||
* @return the Animation whose min value is being set
|
||||
*/
|
||||
@Override
|
||||
public FlingAnimation setMinValue(float minValue) {
|
||||
super.setMinValue(minValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the max value of the animation. When a fling animation reaches the max value, the
|
||||
* animation will end immediately. Animations will not animate beyond the max value.
|
||||
*
|
||||
* @param maxValue maximum value of the property to be animated
|
||||
* @return the Animation whose max value is being set
|
||||
*/
|
||||
@Override
|
||||
public FlingAnimation setMaxValue(float maxValue) {
|
||||
super.setMaxValue(maxValue);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Start velocity of the animation. Default velocity is 0. Unit: pixel/second
|
||||
*
|
||||
* <p>A <b>non-zero</b> start velocity is required for a FlingAnimation. If no start velocity is
|
||||
* set through {@link #setStartVelocity(float)}, the start velocity defaults to 0. In that
|
||||
* case, the fling animation will consider itself done in the next frame.
|
||||
*
|
||||
* <p>Note when using a fixed value as the start velocity (as opposed to getting the velocity
|
||||
* through touch events), it is recommended to define such a value in dp/second and convert it
|
||||
* to pixel/second based on the density of the screen to achieve a consistent look across
|
||||
* different screens.
|
||||
*
|
||||
* <p>To convert from dp/second to pixel/second:
|
||||
* <pre class="prettyprint">
|
||||
* float pixelPerSecond = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpPerSecond,
|
||||
* getResources().getDisplayMetrics());
|
||||
* </pre>
|
||||
*
|
||||
* @param startVelocity start velocity of the animation in pixel/second
|
||||
* @return the Animation whose start velocity is being set
|
||||
*/
|
||||
@Override
|
||||
public FlingAnimation setStartVelocity(float startVelocity) {
|
||||
super.setStartVelocity(startVelocity);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean updateValueAndVelocity(long deltaT) {
|
||||
|
||||
MassState state = mFlingForce.updateValueAndVelocity(mValue, mVelocity, deltaT);
|
||||
mValue = state.mValue;
|
||||
mVelocity = state.mVelocity;
|
||||
|
||||
// When the animation hits the max/min value, consider animation done.
|
||||
if (mValue < mMinValue) {
|
||||
mValue = mMinValue;
|
||||
return true;
|
||||
}
|
||||
if (mValue > mMaxValue) {
|
||||
mValue = mMaxValue;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (isAtEquilibrium(mValue, mVelocity)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
float getAcceleration(float value, float velocity) {
|
||||
return mFlingForce.getAcceleration(value, velocity);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isAtEquilibrium(float value, float velocity) {
|
||||
return value >= mMaxValue
|
||||
|| value <= mMinValue
|
||||
|| mFlingForce.isAtEquilibrium(value, velocity);
|
||||
}
|
||||
|
||||
@Override
|
||||
void setValueThreshold(float threshold) {
|
||||
mFlingForce.setValueThreshold(threshold);
|
||||
}
|
||||
|
||||
static final class DragForce implements Force {
|
||||
|
||||
private static final float DEFAULT_FRICTION = -4.2f;
|
||||
|
||||
// This multiplier is used to calculate the velocity threshold given a certain value
|
||||
// threshold. The idea is that if it takes >= 1 frame to move the value threshold amount,
|
||||
// then the velocity is a reasonable threshold.
|
||||
private static final float VELOCITY_THRESHOLD_MULTIPLIER = 1000f / 16f;
|
||||
private float mFriction = DEFAULT_FRICTION;
|
||||
private float mVelocityThreshold;
|
||||
|
||||
// Internal state to hold a value/velocity pair.
|
||||
private final DynamicAnimation.MassState mMassState = new DynamicAnimation.MassState();
|
||||
|
||||
void setFrictionScalar(float frictionScalar) {
|
||||
mFriction = frictionScalar * DEFAULT_FRICTION;
|
||||
}
|
||||
|
||||
float getFrictionScalar() {
|
||||
return mFriction / DEFAULT_FRICTION;
|
||||
}
|
||||
|
||||
MassState updateValueAndVelocity(float value, float velocity, long deltaT) {
|
||||
mMassState.mVelocity = (float) (velocity * Math.exp((deltaT / 1000f) * mFriction));
|
||||
mMassState.mValue = (float) (value + (mMassState.mVelocity - velocity) / mFriction);
|
||||
if (isAtEquilibrium(mMassState.mValue, mMassState.mVelocity)) {
|
||||
mMassState.mVelocity = 0f;
|
||||
}
|
||||
return mMassState;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getAcceleration(float position, float velocity) {
|
||||
return velocity * mFriction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAtEquilibrium(float value, float velocity) {
|
||||
return Math.abs(velocity) < mVelocityThreshold;
|
||||
}
|
||||
|
||||
void setValueThreshold(float threshold) {
|
||||
mVelocityThreshold = threshold * VELOCITY_THRESHOLD_MULTIPLIER;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.dynamicanimation.animation;
|
||||
|
||||
import android.util.FloatProperty;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
/**
|
||||
* <p>FloatPropertyCompat is an abstraction that can be used to represent a mutable float value that
|
||||
* is held in a host object. To access this float value, {@link #setValue(Object, float)} and getter
|
||||
* {@link #getValue(Object)} need to be implemented. Both the setter and the getter take the
|
||||
* primitive <code>float</code> type and avoids autoboxing and other overhead associated with the
|
||||
* <code>Float</code> class.
|
||||
*
|
||||
* <p>For API 24 and later, {@link FloatProperty} instances can be converted to
|
||||
* {@link FloatPropertyCompat} through
|
||||
* {@link FloatPropertyCompat#createFloatPropertyCompat(FloatProperty)}.
|
||||
*
|
||||
* @param <T> the class on which the Property is declared
|
||||
*/
|
||||
public abstract class FloatPropertyCompat<T> {
|
||||
final String mPropertyName;
|
||||
|
||||
/**
|
||||
* A constructor that takes an identifying name.
|
||||
*/
|
||||
public FloatPropertyCompat(String name) {
|
||||
mPropertyName = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link FloatPropertyCompat} wrapper for a {@link FloatProperty} object. The new
|
||||
* {@link FloatPropertyCompat} instance will access and modify the property value of
|
||||
* {@link FloatProperty} through the {@link FloatProperty} instance's setter and getter.
|
||||
*
|
||||
* @param property FloatProperty instance to be wrapped
|
||||
* @param <T> the class on which the Property is declared
|
||||
* @return a new {@link FloatPropertyCompat} wrapper for the given {@link FloatProperty} object
|
||||
*/
|
||||
@RequiresApi(24)
|
||||
public static <T> FloatPropertyCompat<T> createFloatPropertyCompat(
|
||||
final FloatProperty<T> property) {
|
||||
return new FloatPropertyCompat<T>(property.getName()) {
|
||||
@Override
|
||||
public float getValue(T object) {
|
||||
return property.get(object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(T object, float value) {
|
||||
property.setValue(object, value);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current value that this property represents on the given <code>object</code>.
|
||||
*
|
||||
* @param object object which this property represents
|
||||
* @return the current property value of the given object
|
||||
*/
|
||||
public abstract float getValue(T object);
|
||||
|
||||
/**
|
||||
* Sets the value on <code>object</code> which this property represents.
|
||||
*
|
||||
* @param object object which this property represents
|
||||
* @param value new value of the property
|
||||
*/
|
||||
public abstract void setValue(T object, float value);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.dynamicanimation.animation;
|
||||
|
||||
/**
|
||||
* <p>FloatValueHolder holds a float value. FloatValueHolder provides a setter and a getter (
|
||||
* i.e. {@link #setValue(float)} and {@link #getValue()}) to access this float value. Animations can
|
||||
* be performed on a FloatValueHolder instance. During each frame of the animation, the
|
||||
* FloatValueHolder will have its value updated via {@link #setValue(float)}. The caller can
|
||||
* obtain the up-to-date animation value via {@link FloatValueHolder#getValue()}.
|
||||
*
|
||||
* <p> Here is an example for creating a {@link FlingAnimation} with a FloatValueHolder:
|
||||
* <pre class="prettyprint">
|
||||
* // Create a fling animation with an initial velocity of 5000 (pixel/s) and an initial position
|
||||
* // of 20f.
|
||||
* FloatValueHolder floatValueHolder = new FloatValueHolder(20f);
|
||||
* FlingAnimation anim = new FlingAnimation(floatValueHolder).setStartVelocity(5000);
|
||||
* anim.start();
|
||||
* </pre>
|
||||
*
|
||||
* @see SpringAnimation#SpringAnimation(FloatValueHolder)
|
||||
* @see FlingAnimation#FlingAnimation(FloatValueHolder)
|
||||
*/
|
||||
|
||||
public class FloatValueHolder {
|
||||
private float mValue = 0.0f;
|
||||
|
||||
/**
|
||||
* Constructs a holder for a float value that is initialized to 0.
|
||||
*/
|
||||
public FloatValueHolder() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a holder for a float value that is initialized to the input value.
|
||||
*
|
||||
* @param value the value to initialize the value held in the FloatValueHolder
|
||||
*/
|
||||
public FloatValueHolder(float value) {
|
||||
setValue(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value held in the FloatValueHolder instance.
|
||||
*
|
||||
* @param value float value held in the FloatValueHolder instance
|
||||
*/
|
||||
public void setValue(float value) {
|
||||
mValue = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the float value held in the FloatValueHolder instance.
|
||||
*
|
||||
* @return float value held in the FloatValueHolder instance
|
||||
*/
|
||||
public float getValue() {
|
||||
return mValue;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.dynamicanimation.animation;
|
||||
|
||||
/**
|
||||
* Hide this for now, in case we want to change the API.
|
||||
*/
|
||||
interface Force {
|
||||
// Acceleration based on position.
|
||||
float getAcceleration(float position, float velocity);
|
||||
|
||||
boolean isAtEquilibrium(float value, float velocity);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.dynamicanimation.animation;
|
||||
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* A scheduler that runs the given Runnable on the next frame.
|
||||
*/
|
||||
public interface FrameCallbackScheduler {
|
||||
/**
|
||||
* Callbacks on new frame arrived.
|
||||
*
|
||||
* @param frameCallback The runnable of new frame should be posted
|
||||
*/
|
||||
void postFrameCallback(@NonNull Runnable frameCallback);
|
||||
|
||||
/**
|
||||
* Returns whether the current thread is the same as the thread that the scheduler is
|
||||
* running on.
|
||||
*
|
||||
* @return true if the scheduler is running on the same thread as the current thread.
|
||||
*/
|
||||
boolean isCurrentThread();
|
||||
}
|
||||
@@ -0,0 +1,317 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.dynamicanimation.animation;
|
||||
|
||||
import android.util.AndroidRuntimeException;
|
||||
|
||||
import androidx.annotation.MainThread;
|
||||
|
||||
/**
|
||||
* SpringAnimation is an animation that is driven by a {@link SpringForce}. The spring force defines
|
||||
* the spring's stiffness, damping ratio, as well as the rest position. Once the SpringAnimation is
|
||||
* started, on each frame the spring force will update the animation's value and velocity.
|
||||
* The animation will continue to run until the spring force reaches equilibrium. If the spring used
|
||||
* in the animation is undamped, the animation will never reach equilibrium. Instead, it will
|
||||
* oscillate forever.
|
||||
*
|
||||
* <div class="special reference">
|
||||
* <h3>Developer Guides</h3>
|
||||
* </div>
|
||||
*
|
||||
* <p>To create a simple {@link SpringAnimation} that uses the default {@link SpringForce}:</p>
|
||||
* <pre class="prettyprint">
|
||||
* // Create an animation to animate view's X property, set the rest position of the
|
||||
* // default spring to 0, and start the animation with a starting velocity of 5000 (pixel/s).
|
||||
* final SpringAnimation anim = new SpringAnimation(view, DynamicAnimation.X, 0)
|
||||
* .setStartVelocity(5000);
|
||||
* anim.start();
|
||||
* </pre>
|
||||
*
|
||||
* <p>Alternatively, a {@link SpringAnimation} can take a pre-configured {@link SpringForce}, and
|
||||
* use that to drive the animation. </p>
|
||||
* <pre class="prettyprint">
|
||||
* // Create a low stiffness, low bounce spring at position 0.
|
||||
* SpringForce spring = new SpringForce(0)
|
||||
* .setDampingRatio(SpringForce.DAMPING_RATIO_LOW_BOUNCY)
|
||||
* .setStiffness(SpringForce.STIFFNESS_LOW);
|
||||
* // Create an animation to animate view's scaleY property, and start the animation using
|
||||
* // the spring above and a starting value of 0.5. Additionally, constrain the range of value for
|
||||
* // the animation to be non-negative, effectively preventing any spring overshoot.
|
||||
* final SpringAnimation anim = new SpringAnimation(view, DynamicAnimation.SCALE_Y)
|
||||
* .setMinValue(0).setSpring(spring).setStartValue(1);
|
||||
* anim.start();
|
||||
* </pre>
|
||||
*/
|
||||
public final class SpringAnimation extends DynamicAnimation<SpringAnimation> {
|
||||
|
||||
private SpringForce mSpring = null;
|
||||
private float mPendingPosition = UNSET;
|
||||
private static final float UNSET = Float.MAX_VALUE;
|
||||
private boolean mEndRequested = false;
|
||||
|
||||
/**
|
||||
* <p>This creates a SpringAnimation that animates a {@link FloatValueHolder} instance. During
|
||||
* the animation, the {@link FloatValueHolder} instance will be updated via
|
||||
* {@link FloatValueHolder#setValue(float)} each frame. The caller can obtain the up-to-date
|
||||
* animation value via {@link FloatValueHolder#getValue()}.
|
||||
*
|
||||
* <p><strong>Note:</strong> changing the value in the {@link FloatValueHolder} via
|
||||
* {@link FloatValueHolder#setValue(float)} outside of the animation during an
|
||||
* animation run will not have any effect on the on-going animation.
|
||||
*
|
||||
* @param floatValueHolder the property to be animated
|
||||
*/
|
||||
public SpringAnimation(FloatValueHolder floatValueHolder) {
|
||||
super(floatValueHolder);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>This creates a SpringAnimation that animates a {@link FloatValueHolder} instance. During
|
||||
* the animation, the {@link FloatValueHolder} instance will be updated via
|
||||
* {@link FloatValueHolder#setValue(float)} each frame. The caller can obtain the up-to-date
|
||||
* animation value via {@link FloatValueHolder#getValue()}.
|
||||
*
|
||||
* A Spring will be created with the given final position and default stiffness and damping
|
||||
* ratio. This spring can be accessed and reconfigured through {@link #setSpring(SpringForce)}.
|
||||
*
|
||||
* <p><strong>Note:</strong> changing the value in the {@link FloatValueHolder} via
|
||||
* {@link FloatValueHolder#setValue(float)} outside of the animation during an
|
||||
* animation run will not have any effect on the on-going animation.
|
||||
*
|
||||
* @param floatValueHolder the property to be animated
|
||||
* @param finalPosition the final position of the spring to be created.
|
||||
*/
|
||||
public SpringAnimation(FloatValueHolder floatValueHolder, float finalPosition) {
|
||||
super(floatValueHolder);
|
||||
mSpring = new SpringForce(finalPosition);
|
||||
}
|
||||
|
||||
/**
|
||||
* This creates a SpringAnimation that animates the property of the given object.
|
||||
* Note, a spring will need to setup through {@link #setSpring(SpringForce)} before
|
||||
* the animation starts.
|
||||
*
|
||||
* @param object the Object whose property will be animated
|
||||
* @param property the property to be animated
|
||||
* @param <K> the class on which the Property is declared
|
||||
*/
|
||||
public <K> SpringAnimation(K object, FloatPropertyCompat<K> property) {
|
||||
super(object, property);
|
||||
}
|
||||
|
||||
/**
|
||||
* This creates a SpringAnimation that animates the property of the given object. A Spring will
|
||||
* be created with the given final position and default stiffness and damping ratio.
|
||||
* This spring can be accessed and reconfigured through {@link #setSpring(SpringForce)}.
|
||||
*
|
||||
* @param object the Object whose property will be animated
|
||||
* @param property the property to be animated
|
||||
* @param finalPosition the final position of the spring to be created.
|
||||
* @param <K> the class on which the Property is declared
|
||||
*/
|
||||
public <K> SpringAnimation(K object, FloatPropertyCompat<K> property,
|
||||
float finalPosition) {
|
||||
super(object, property);
|
||||
mSpring = new SpringForce(finalPosition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the spring that the animation uses for animations.
|
||||
*
|
||||
* @return the spring that the animation uses for animations
|
||||
*/
|
||||
public SpringForce getSpring() {
|
||||
return mSpring;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses the given spring as the force that drives this animation. If this spring force has its
|
||||
* parameters re-configured during the animation, the new configuration will be reflected in the
|
||||
* animation immediately.
|
||||
*
|
||||
* @param force a pre-defined spring force that drives the animation
|
||||
* @return the animation that the spring force is set on
|
||||
*/
|
||||
public SpringAnimation setSpring(SpringForce force) {
|
||||
mSpring = force;
|
||||
return this;
|
||||
}
|
||||
|
||||
@MainThread
|
||||
@Override
|
||||
public void start() {
|
||||
sanityCheck();
|
||||
mSpring.setValueThreshold(getValueThreshold());
|
||||
super.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the final position of the spring.
|
||||
* <p/>
|
||||
* When the animation is running, calling this method would assume the position change of the
|
||||
* spring as a continuous movement since last frame, which yields more accurate results than
|
||||
* changing the spring position directly through {@link SpringForce#setFinalPosition(float)}.
|
||||
* <p/>
|
||||
* If the animation hasn't started, calling this method will change the spring position, and
|
||||
* immediately start the animation.
|
||||
*
|
||||
* @param finalPosition rest position of the spring
|
||||
*/
|
||||
public void animateToFinalPosition(float finalPosition) {
|
||||
if (isRunning()) {
|
||||
mPendingPosition = finalPosition;
|
||||
} else {
|
||||
if (mSpring == null) {
|
||||
mSpring = new SpringForce(finalPosition);
|
||||
}
|
||||
mSpring.setFinalPosition(finalPosition);
|
||||
start();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancels the on-going animation. If the animation hasn't started, no op. Note that this method
|
||||
* should only be called on main thread.
|
||||
*
|
||||
* @throws AndroidRuntimeException if this method is not called on the main thread
|
||||
*/
|
||||
@MainThread
|
||||
@Override
|
||||
public void cancel() {
|
||||
super.cancel();
|
||||
if (mPendingPosition != UNSET) {
|
||||
if (mSpring == null) {
|
||||
mSpring = new SpringForce(mPendingPosition);
|
||||
} else {
|
||||
mSpring.setFinalPosition(mPendingPosition);
|
||||
}
|
||||
mPendingPosition = UNSET;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Skips to the end of the animation. If the spring is undamped, an
|
||||
* {@link IllegalStateException} will be thrown, as the animation would never reach to an end.
|
||||
* It is recommended to check {@link #canSkipToEnd()} before calling this method. If animation
|
||||
* is not running, no-op.
|
||||
*
|
||||
* Unless a AnimationHandler is provided via setAnimationHandler, a default AnimationHandler
|
||||
* is created on the same thread as the first call to start/cancel an animation. All the
|
||||
* subsequent animation lifecycle manipulations need to be on that same thread, until the
|
||||
* AnimationHandler is reset (using [setAnimationHandler]).
|
||||
*
|
||||
* @throws IllegalStateException if the spring is undamped (i.e. damping ratio = 0)
|
||||
* @throws AndroidRuntimeException if this method is not called on the same thread as the
|
||||
* animation handler
|
||||
*/
|
||||
public void skipToEnd() {
|
||||
if (!canSkipToEnd()) {
|
||||
throw new UnsupportedOperationException("Spring animations can only come to an end"
|
||||
+ " when there is damping");
|
||||
}
|
||||
if (!getAnimationHandler().isCurrentThread()) {
|
||||
throw new AndroidRuntimeException("Animations may only be started on the same thread "
|
||||
+ "as the animation handler");
|
||||
}
|
||||
if (mRunning) {
|
||||
mEndRequested = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries whether the spring can eventually come to the rest position.
|
||||
*
|
||||
* @return {@code true} if the spring is damped, otherwise {@code false}
|
||||
*/
|
||||
public boolean canSkipToEnd() {
|
||||
return mSpring.mDampingRatio > 0;
|
||||
}
|
||||
|
||||
/************************ Below are private APIs *************************/
|
||||
|
||||
private void sanityCheck() {
|
||||
if (mSpring == null) {
|
||||
throw new UnsupportedOperationException("Incomplete SpringAnimation: Either final"
|
||||
+ " position or a spring force needs to be set.");
|
||||
}
|
||||
double finalPosition = mSpring.getFinalPosition();
|
||||
if (finalPosition > mMaxValue) {
|
||||
throw new UnsupportedOperationException("Final position of the spring cannot be greater"
|
||||
+ " than the max value.");
|
||||
} else if (finalPosition < mMinValue) {
|
||||
throw new UnsupportedOperationException("Final position of the spring cannot be less"
|
||||
+ " than the min value.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean updateValueAndVelocity(long deltaT) {
|
||||
// If user had requested end, then update the value and velocity to end state and consider
|
||||
// animation done.
|
||||
if (mEndRequested) {
|
||||
if (mPendingPosition != UNSET) {
|
||||
mSpring.setFinalPosition(mPendingPosition);
|
||||
mPendingPosition = UNSET;
|
||||
}
|
||||
mValue = mSpring.getFinalPosition();
|
||||
mVelocity = 0;
|
||||
mEndRequested = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mPendingPosition != UNSET) {
|
||||
// Approximate by considering half of the time spring position stayed at the old
|
||||
// position, half of the time it's at the new position.
|
||||
MassState massState = mSpring.updateValues(mValue, mVelocity, deltaT / 2);
|
||||
mSpring.setFinalPosition(mPendingPosition);
|
||||
mPendingPosition = UNSET;
|
||||
|
||||
massState = mSpring.updateValues(massState.mValue, massState.mVelocity, deltaT / 2);
|
||||
mValue = massState.mValue;
|
||||
mVelocity = massState.mVelocity;
|
||||
|
||||
} else {
|
||||
MassState massState = mSpring.updateValues(mValue, mVelocity, deltaT);
|
||||
mValue = massState.mValue;
|
||||
mVelocity = massState.mVelocity;
|
||||
}
|
||||
|
||||
mValue = Math.max(mValue, mMinValue);
|
||||
mValue = Math.min(mValue, mMaxValue);
|
||||
|
||||
if (isAtEquilibrium(mValue, mVelocity)) {
|
||||
mValue = mSpring.getFinalPosition();
|
||||
mVelocity = 0f;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
float getAcceleration(float value, float velocity) {
|
||||
return mSpring.getAcceleration(value, velocity);
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean isAtEquilibrium(float value, float velocity) {
|
||||
return mSpring.isAtEquilibrium(value, velocity);
|
||||
}
|
||||
|
||||
@Override
|
||||
void setValueThreshold(float threshold) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package androidx.dynamicanimation.animation;
|
||||
|
||||
import androidx.annotation.FloatRange;
|
||||
import androidx.annotation.RestrictTo;
|
||||
|
||||
/**
|
||||
* Spring Force defines the characteristics of the spring being used in the animation.
|
||||
* <p>
|
||||
* By configuring the stiffness and damping ratio, callers can create a spring with the look and
|
||||
* feel suits their use case. Stiffness corresponds to the spring constant. The stiffer the spring
|
||||
* is, the harder it is to stretch it, the faster it undergoes dampening.
|
||||
* <p>
|
||||
* Spring damping ratio describes how oscillations in a system decay after a disturbance.
|
||||
* When damping ratio > 1* (i.e. over-damped), the object will quickly return to the rest position
|
||||
* without overshooting. If damping ratio equals to 1 (i.e. critically damped), the object will
|
||||
* return to equilibrium within the shortest amount of time. When damping ratio is less than 1
|
||||
* (i.e. under-damped), the mass tends to overshoot, and return, and overshoot again. Without any
|
||||
* damping (i.e. damping ratio = 0), the mass will oscillate forever.
|
||||
*/
|
||||
public final class SpringForce implements Force {
|
||||
/**
|
||||
* Stiffness constant for extremely stiff spring.
|
||||
*/
|
||||
public static final float STIFFNESS_HIGH = 10_000f;
|
||||
/**
|
||||
* Stiffness constant for medium stiff spring. This is the default stiffness for spring force.
|
||||
*/
|
||||
public static final float STIFFNESS_MEDIUM = 1500f;
|
||||
/**
|
||||
* Stiffness constant for a spring with low stiffness.
|
||||
*/
|
||||
public static final float STIFFNESS_LOW = 200f;
|
||||
/**
|
||||
* Stiffness constant for a spring with very low stiffness.
|
||||
*/
|
||||
public static final float STIFFNESS_VERY_LOW = 50f;
|
||||
|
||||
/**
|
||||
* Damping ratio for a very bouncy spring. Note for under-damped springs
|
||||
* (i.e. damping ratio < 1), the lower the damping ratio, the more bouncy the spring.
|
||||
*/
|
||||
public static final float DAMPING_RATIO_HIGH_BOUNCY = 0.2f;
|
||||
/**
|
||||
* Damping ratio for a medium bouncy spring. This is also the default damping ratio for spring
|
||||
* force. Note for under-damped springs (i.e. damping ratio < 1), the lower the damping ratio,
|
||||
* the more bouncy the spring.
|
||||
*/
|
||||
public static final float DAMPING_RATIO_MEDIUM_BOUNCY = 0.5f;
|
||||
/**
|
||||
* Damping ratio for a spring with low bounciness. Note for under-damped springs
|
||||
* (i.e. damping ratio < 1), the lower the damping ratio, the higher the bounciness.
|
||||
*/
|
||||
public static final float DAMPING_RATIO_LOW_BOUNCY = 0.75f;
|
||||
/**
|
||||
* Damping ratio for a spring with no bounciness. This damping ratio will create a critically
|
||||
* damped spring that returns to equilibrium within the shortest amount of time without
|
||||
* oscillating.
|
||||
*/
|
||||
public static final float DAMPING_RATIO_NO_BOUNCY = 1f;
|
||||
|
||||
// This multiplier is used to calculate the velocity threshold given a certain value threshold.
|
||||
// The idea is that if it takes >= 1 frame to move the value threshold amount, then the velocity
|
||||
// is a reasonable threshold.
|
||||
private static final double VELOCITY_THRESHOLD_MULTIPLIER = 1000.0 / 16.0;
|
||||
|
||||
// Natural frequency
|
||||
double mNaturalFreq = Math.sqrt(STIFFNESS_MEDIUM);
|
||||
// Damping ratio.
|
||||
double mDampingRatio = DAMPING_RATIO_MEDIUM_BOUNCY;
|
||||
|
||||
// Value to indicate an unset state.
|
||||
private static final double UNSET = Double.MAX_VALUE;
|
||||
|
||||
// Indicates whether the spring has been initialized
|
||||
private boolean mInitialized = false;
|
||||
|
||||
// Threshold for velocity and value to determine when it's reasonable to assume that the spring
|
||||
// is approximately at rest.
|
||||
private double mValueThreshold;
|
||||
private double mVelocityThreshold;
|
||||
|
||||
// Intermediate values to simplify the spring function calculation per frame.
|
||||
private double mGammaPlus;
|
||||
private double mGammaMinus;
|
||||
private double mDampedFreq;
|
||||
|
||||
// Final position of the spring. This must be set before the start of the animation.
|
||||
private double mFinalPosition = UNSET;
|
||||
|
||||
// Internal state to hold a value/velocity pair.
|
||||
private final DynamicAnimation.MassState mMassState = new DynamicAnimation.MassState();
|
||||
|
||||
/**
|
||||
* Creates a spring force. Note that final position of the spring must be set through
|
||||
* {@link #setFinalPosition(float)} before the spring animation starts.
|
||||
*/
|
||||
public SpringForce() {
|
||||
// No op.
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a spring with a given final rest position.
|
||||
*
|
||||
* @param finalPosition final position of the spring when it reaches equilibrium
|
||||
*/
|
||||
public SpringForce(float finalPosition) {
|
||||
mFinalPosition = finalPosition;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the stiffness of a spring. The more stiff a spring is, the more force it applies to
|
||||
* the object attached when the spring is not at the final position. Default stiffness is
|
||||
* {@link #STIFFNESS_MEDIUM}.
|
||||
*
|
||||
* @param stiffness non-negative stiffness constant of a spring
|
||||
* @return the spring force that the given stiffness is set on
|
||||
* @throws IllegalArgumentException if the given spring stiffness is not positive
|
||||
*/
|
||||
public SpringForce setStiffness(
|
||||
@FloatRange(from = 0.0, fromInclusive = false) float stiffness) {
|
||||
if (stiffness <= 0) {
|
||||
throw new IllegalArgumentException("Spring stiffness constant must be positive.");
|
||||
}
|
||||
mNaturalFreq = Math.sqrt(stiffness);
|
||||
// All the intermediate values need to be recalculated.
|
||||
mInitialized = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the stiffness of the spring.
|
||||
*
|
||||
* @return the stiffness of the spring
|
||||
*/
|
||||
public float getStiffness() {
|
||||
return (float) (mNaturalFreq * mNaturalFreq);
|
||||
}
|
||||
|
||||
/**
|
||||
* Spring damping ratio describes how oscillations in a system decay after a disturbance.
|
||||
* <p>
|
||||
* When damping ratio > 1 (over-damped), the object will quickly return to the rest position
|
||||
* without overshooting. If damping ratio equals to 1 (i.e. critically damped), the object will
|
||||
* return to equilibrium within the shortest amount of time. When damping ratio is less than 1
|
||||
* (i.e. under-damped), the mass tends to overshoot, and return, and overshoot again. Without
|
||||
* any damping (i.e. damping ratio = 0), the mass will oscillate forever.
|
||||
* <p>
|
||||
* Default damping ratio is {@link #DAMPING_RATIO_MEDIUM_BOUNCY}.
|
||||
*
|
||||
* @param dampingRatio damping ratio of the spring, it should be non-negative
|
||||
* @return the spring force that the given damping ratio is set on
|
||||
* @throws IllegalArgumentException if the {@param dampingRatio} is negative.
|
||||
*/
|
||||
public SpringForce setDampingRatio(@FloatRange(from = 0.0) float dampingRatio) {
|
||||
if (dampingRatio < 0) {
|
||||
throw new IllegalArgumentException("Damping ratio must be non-negative");
|
||||
}
|
||||
mDampingRatio = dampingRatio;
|
||||
// All the intermediate values need to be recalculated.
|
||||
mInitialized = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the damping ratio of the spring.
|
||||
*
|
||||
* @return damping ratio of the spring
|
||||
*/
|
||||
public float getDampingRatio() {
|
||||
return (float) mDampingRatio;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the rest position of the spring.
|
||||
*
|
||||
* @param finalPosition rest position of the spring
|
||||
* @return the spring force that the given final position is set on
|
||||
*/
|
||||
public SpringForce setFinalPosition(float finalPosition) {
|
||||
mFinalPosition = finalPosition;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rest position of the spring.
|
||||
*
|
||||
* @return rest position of the spring
|
||||
*/
|
||||
public float getFinalPosition() {
|
||||
return (float) mFinalPosition;
|
||||
}
|
||||
|
||||
/*********************** Below are private APIs *********************/
|
||||
|
||||
/**
|
||||
*/
|
||||
@RestrictTo(RestrictTo.Scope.LIBRARY)
|
||||
@Override
|
||||
public float getAcceleration(float lastDisplacement, float lastVelocity) {
|
||||
|
||||
lastDisplacement -= getFinalPosition();
|
||||
|
||||
double k = mNaturalFreq * mNaturalFreq;
|
||||
double c = 2 * mNaturalFreq * mDampingRatio;
|
||||
|
||||
return (float) (-k * lastDisplacement - c * lastVelocity);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
@RestrictTo(RestrictTo.Scope.LIBRARY)
|
||||
@Override
|
||||
public boolean isAtEquilibrium(float value, float velocity) {
|
||||
if (Math.abs(velocity) < mVelocityThreshold
|
||||
&& Math.abs(value - getFinalPosition()) < mValueThreshold) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the string by doing the necessary pre-calculation as well as some sanity check
|
||||
* on the setup.
|
||||
*
|
||||
* @throws IllegalStateException if the final position is not yet set by the time the spring
|
||||
* animation has started
|
||||
*/
|
||||
private void init() {
|
||||
if (mInitialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mFinalPosition == UNSET) {
|
||||
throw new IllegalStateException("Error: Final position of the spring must be"
|
||||
+ " set before the animation starts");
|
||||
}
|
||||
|
||||
if (mDampingRatio > 1) {
|
||||
// Over damping
|
||||
mGammaPlus = -mDampingRatio * mNaturalFreq
|
||||
+ mNaturalFreq * Math.sqrt(mDampingRatio * mDampingRatio - 1);
|
||||
mGammaMinus = -mDampingRatio * mNaturalFreq
|
||||
- mNaturalFreq * Math.sqrt(mDampingRatio * mDampingRatio - 1);
|
||||
} else if (mDampingRatio >= 0 && mDampingRatio < 1) {
|
||||
// Under damping
|
||||
mDampedFreq = mNaturalFreq * Math.sqrt(1 - mDampingRatio * mDampingRatio);
|
||||
}
|
||||
|
||||
mInitialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Internal only call for Spring to calculate the spring position/velocity using
|
||||
* an analytical approach.
|
||||
*/
|
||||
DynamicAnimation.MassState updateValues(double lastDisplacement, double lastVelocity,
|
||||
long timeElapsed) {
|
||||
init();
|
||||
|
||||
double deltaT = timeElapsed / 1000d; // unit: seconds
|
||||
lastDisplacement -= mFinalPosition;
|
||||
double displacement;
|
||||
double currentVelocity;
|
||||
if (mDampingRatio > 1) {
|
||||
// Overdamped
|
||||
double coeffA = lastDisplacement - (mGammaMinus * lastDisplacement - lastVelocity)
|
||||
/ (mGammaMinus - mGammaPlus);
|
||||
double coeffB = (mGammaMinus * lastDisplacement - lastVelocity)
|
||||
/ (mGammaMinus - mGammaPlus);
|
||||
displacement = coeffA * Math.pow(Math.E, mGammaMinus * deltaT)
|
||||
+ coeffB * Math.pow(Math.E, mGammaPlus * deltaT);
|
||||
currentVelocity = coeffA * mGammaMinus * Math.pow(Math.E, mGammaMinus * deltaT)
|
||||
+ coeffB * mGammaPlus * Math.pow(Math.E, mGammaPlus * deltaT);
|
||||
} else if (mDampingRatio == 1) {
|
||||
// Critically damped
|
||||
double coeffA = lastDisplacement;
|
||||
double coeffB = lastVelocity + mNaturalFreq * lastDisplacement;
|
||||
displacement = (coeffA + coeffB * deltaT) * Math.pow(Math.E, -mNaturalFreq * deltaT);
|
||||
currentVelocity = (coeffA + coeffB * deltaT) * Math.pow(Math.E, -mNaturalFreq * deltaT)
|
||||
* -mNaturalFreq + coeffB * Math.pow(Math.E, -mNaturalFreq * deltaT);
|
||||
} else {
|
||||
// Underdamped
|
||||
double cosCoeff = lastDisplacement;
|
||||
double sinCoeff = (1 / mDampedFreq) * (mDampingRatio * mNaturalFreq
|
||||
* lastDisplacement + lastVelocity);
|
||||
displacement = Math.pow(Math.E, -mDampingRatio * mNaturalFreq * deltaT)
|
||||
* (cosCoeff * Math.cos(mDampedFreq * deltaT)
|
||||
+ sinCoeff * Math.sin(mDampedFreq * deltaT));
|
||||
currentVelocity = displacement * -mNaturalFreq * mDampingRatio
|
||||
+ Math.pow(Math.E, -mDampingRatio * mNaturalFreq * deltaT)
|
||||
* (-mDampedFreq * cosCoeff * Math.sin(mDampedFreq * deltaT)
|
||||
+ mDampedFreq * sinCoeff * Math.cos(mDampedFreq * deltaT));
|
||||
}
|
||||
|
||||
mMassState.mValue = (float) (displacement + mFinalPosition);
|
||||
mMassState.mVelocity = (float) currentVelocity;
|
||||
return mMassState;
|
||||
}
|
||||
|
||||
/**
|
||||
* This threshold defines how close the animation value needs to be before the animation can
|
||||
* finish. This default value is based on the property being animated, e.g. animations on alpha,
|
||||
* scale, translation or rotation would have different thresholds. This value should be small
|
||||
* enough to avoid visual glitch of "jumping to the end". But it shouldn't be so small that
|
||||
* animations take seconds to finish.
|
||||
*
|
||||
* @param threshold the difference between the animation value and final spring position that
|
||||
* is allowed to end the animation when velocity is very low
|
||||
*/
|
||||
void setValueThreshold(double threshold) {
|
||||
mValueThreshold = Math.abs(threshold);
|
||||
mVelocityThreshold = mValueThreshold * VELOCITY_THRESHOLD_MULTIPLIER;
|
||||
}
|
||||
}
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
171450807
|
||||
170675311
|
||||
170338029
|
||||
170338170
|
||||
160544577
|
||||
171171594
|
||||
170488559
|
||||
171131394
|
||||
171131394
|
||||
171026321
|
||||
170648272
|
||||
170752716
|
||||
170611866
|
||||
170702596
|
||||
170487752
|
||||
170665892
|
||||
168608912
|
||||
170636685
|
||||
169771796
|
||||
141126144
|
||||
166614700
|
||||
168805872
|
||||
170263425
|
||||
169221288
|
||||
143965596
|
||||
169221287
|
||||
167259591
|
||||
156044202
|
||||
169438169
|
||||
164926736
|
||||
168653219
|
||||
169963211
|
||||
170121063
|
||||
169988381
|
||||
169980192
|
||||
169221288
|
||||
169385783
|
||||
168167693
|
||||
169796517
|
||||
169330678
|
||||
168818961
|
||||
168608912
|
||||
@@ -1,39 +0,0 @@
|
||||
141126144
|
||||
143965596
|
||||
156044202
|
||||
160544577
|
||||
164926736
|
||||
166614700
|
||||
167259591
|
||||
168167693
|
||||
168608912
|
||||
168653219
|
||||
168805872
|
||||
168818961
|
||||
169221287
|
||||
169221288
|
||||
169330678
|
||||
169385783
|
||||
169438169
|
||||
169771796
|
||||
169796517
|
||||
169963211
|
||||
169980192
|
||||
169988381
|
||||
170121063
|
||||
170263425
|
||||
170338029
|
||||
170338170
|
||||
170487752
|
||||
170488559
|
||||
170611866
|
||||
170636685
|
||||
170648272
|
||||
170665892
|
||||
170675311
|
||||
170702596
|
||||
170752716
|
||||
171026321
|
||||
171131394
|
||||
171171594
|
||||
171450807
|
||||
+20
-10
@@ -19,6 +19,7 @@ plugins {
|
||||
id 'com.diffplug.spotless' version '6.25.0'
|
||||
}
|
||||
|
||||
|
||||
allprojects {
|
||||
plugins.withType(AndroidBasePlugin).configureEach {
|
||||
apply plugin: 'org.gradle.android.cache-fix'
|
||||
@@ -27,7 +28,7 @@ allprojects {
|
||||
compileSdk 35
|
||||
defaultConfig {
|
||||
minSdk 26
|
||||
targetSdk 34
|
||||
targetSdk 35
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
}
|
||||
lint {
|
||||
@@ -101,7 +102,8 @@ allprojects {
|
||||
dependencies {
|
||||
compileOnly fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'SystemUI-core.jar')
|
||||
compileOnly fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'SystemUI-statsd.jar')
|
||||
compileOnly fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'WindowManager-Shell-14.jar')
|
||||
compileOnly fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'WindowManager-Shell-15.jar')
|
||||
// compileOnly fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'QuickstepResLib.jar')
|
||||
|
||||
compileOnly projects.compatLib
|
||||
compileOnly projects.compatLib.compatLibVQ
|
||||
@@ -109,6 +111,7 @@ allprojects {
|
||||
compileOnly projects.compatLib.compatLibVS
|
||||
compileOnly projects.compatLib.compatLibVT
|
||||
compileOnly projects.compatLib.compatLibVU
|
||||
compileOnly projects.compatLib.compatLibVV
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -123,7 +126,7 @@ final def ciRef = System.getenv("GITHUB_REF") ?: ""
|
||||
final def ciRunNumber = System.getenv("GITHUB_RUN_NUMBER") ?: ""
|
||||
final def isReleaseBuild = ciBuild && ciRef.contains("beta")
|
||||
final def devReleaseName = ciBuild ? "Dev.(#${ciRunNumber})" : "Dev.(${buildCommit})"
|
||||
final def version = "14"
|
||||
final def version = "15"
|
||||
final def releaseName = "Beta 3"
|
||||
final def versionDisplayName = "${version}.${isReleaseBuild ? releaseName : devReleaseName}"
|
||||
final def majorVersion = versionDisplayName.split("\\.")[0]
|
||||
@@ -136,7 +139,7 @@ android {
|
||||
defaultConfig {
|
||||
// Lawnchair Launcher 14.0 Beta 3
|
||||
// See CONTRIBUTING.md#versioning-scheme
|
||||
versionCode 14_00_02_03
|
||||
versionCode 15_00_00_00
|
||||
versionName "${versionDisplayName}"
|
||||
buildConfigField "String", "VERSION_DISPLAY_NAME", "\"${versionDisplayName}\""
|
||||
buildConfigField "String", "MAJOR_VERSION", "\"${majorVersion}\""
|
||||
@@ -323,7 +326,7 @@ composeCompiler {
|
||||
reportsDestination = layout.buildDirectory.dir("compose_build_reports")
|
||||
}
|
||||
|
||||
addFrameworkJar('framework-14.jar')
|
||||
addFrameworkJar('framework-15.jar')
|
||||
|
||||
dependencies {
|
||||
implementation projects.iconloaderlib
|
||||
@@ -348,18 +351,21 @@ dependencies {
|
||||
withQuickstepImplementation projects.compatLib.compatLibVS
|
||||
withQuickstepImplementation projects.compatLib.compatLibVT
|
||||
withQuickstepImplementation projects.compatLib.compatLibVU
|
||||
withQuickstepImplementation projects.compatLib.compatLibVV
|
||||
withQuickstepImplementation projects.wmshell
|
||||
withQuickstepImplementation projects.flags
|
||||
// withQuickstepImplementation projects.androidxLib
|
||||
implementation 'androidx.dynamicanimation:dynamicanimation:1.0.0'
|
||||
|
||||
implementation fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'SystemUI-statsd-14.jar')
|
||||
|
||||
implementation fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'WindowManager-Shell-14.jar')
|
||||
withQuickstepCompileOnly fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'framework-14.jar')
|
||||
implementation fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'SystemUI-statsd-15.jar')
|
||||
implementation fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'WindowManager-Shell-15.jar')
|
||||
withQuickstepCompileOnly fileTree(dir: FRAMEWORK_PREBUILTS_DIR, include: 'framework-15.jar')
|
||||
|
||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.2'
|
||||
|
||||
implementation 'androidx.profileinstaller:profileinstaller:1.4.1'
|
||||
baselineProfile projects.baselineProfile
|
||||
|
||||
implementation "androidx.dynamicanimation:dynamicanimation:1.0.0"
|
||||
implementation "androidx.recyclerview:recyclerview:1.3.2"
|
||||
implementation "androidx.preference:preference-ktx:1.2.1"
|
||||
|
||||
@@ -409,6 +415,9 @@ dependencies {
|
||||
implementation "androidx.room:room-ktx:$roomVersion"
|
||||
ksp "androidx.room:room-compiler:$roomVersion"
|
||||
|
||||
def core_version = "1.13.1"
|
||||
implementation "androidx.core:core:$core_version"
|
||||
|
||||
implementation "com.github.topjohnwu.libsu:service:6.0.0"
|
||||
|
||||
// Persian Date
|
||||
@@ -433,6 +442,7 @@ ksp {
|
||||
arg("room.incremental", "true")
|
||||
}
|
||||
|
||||
|
||||
spotless {
|
||||
java {
|
||||
target("compatLib/**/src/**/*.java")
|
||||
|
||||
-934
@@ -1,934 +0,0 @@
|
||||
[34mCOMMAND>> git log f99351888c3e5a128559678304fefd647472bc7f..4c3952dc60fc78d3816012a86d7e71747ef34c74[m
|
||||
commit 4c3952dc60fc78d3816012a86d7e71747ef34c74
|
||||
Merge: cb403d9e5 70e8b1572
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Fri Oct 23 00:27:39 2020 +0000
|
||||
|
||||
Merge "Minor stylistic changes in Workspace.java." into ub-launcher3-master
|
||||
|
||||
commit cb403d9e5235c7323bc2fdffe6a264d17bb6d0a6
|
||||
Author: Pinyao Ting <pinyaoting@google.com>
|
||||
Date: Thu Oct 22 16:07:08 2020 -0700
|
||||
|
||||
flip default value of minimal device feature flag
|
||||
|
||||
Test: manual
|
||||
Change-Id: Iaf46dffb935bdf4b46e7c57d547bdc697250ec56
|
||||
|
||||
commit a97557a15eb111616d868120a9f4659f1b451fa2
|
||||
Merge: f5ce80b8a 932a327eb
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Thu Oct 22 18:22:56 2020 +0000
|
||||
|
||||
Merge "Consider overscroll adjustment of RecentsView for live tile" into ub-launcher3-master
|
||||
|
||||
commit 932a327ebf0587b8324b9fea7d31328b2f6719a8
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Wed Oct 21 23:29:00 2020 -0700
|
||||
|
||||
Consider overscroll adjustment of RecentsView for live tile
|
||||
|
||||
Fixes: 171450807
|
||||
Test: manual
|
||||
Change-Id: I83eebf1f6b61c67f289db51aabe5a971815d0df1
|
||||
|
||||
commit f5ce80b8a0a1636fc8159475177a07b281492c88
|
||||
Author: Hilary Huo <hhuo@google.com>
|
||||
Date: Wed Oct 14 16:35:55 2020 -0700
|
||||
|
||||
[pixel-search] Latency analysis, add logging statement in launcher
|
||||
|
||||
Bug: b/170675311
|
||||
Change-Id: I229ace399085bea1c3f9535eb713edd329dff8bd
|
||||
|
||||
commit 31b03941ef3aa17edc08c1b509d4fa23766f2d2c
|
||||
Merge: e0a50c9e3 0731273d5
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Wed Oct 21 20:03:57 2020 +0000
|
||||
|
||||
Merge "Track live tile better by considering resistance animation" into ub-launcher3-master
|
||||
|
||||
commit 0731273d5409149fca32dfb2ad76eab45f6ea79a
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Wed Oct 21 12:03:40 2020 -0700
|
||||
|
||||
Track live tile better by considering resistance animation
|
||||
|
||||
Fixes: 170338029
|
||||
Test: Manual
|
||||
Change-Id: I66536bae567aa94385d5e0352cec9d46d512927a
|
||||
|
||||
commit e0a50c9e3f1d4b9f113d6afae01ff2c4ed452fba
|
||||
Merge: d2c27a595 acfac6187
|
||||
Author: Alex Chau <alexchau@google.com>
|
||||
Date: Wed Oct 21 17:02:57 2020 +0000
|
||||
|
||||
Merge "Use Diplay.getMetrics in DisplayController" into ub-launcher3-master
|
||||
|
||||
commit d2c27a595065d43bbea37dd2a512d37080f5233e
|
||||
Merge: ff8febabb 8b488ccc2
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Wed Oct 21 07:19:48 2020 +0000
|
||||
|
||||
Merge "[Live Tile] Support launching running task animation" into ub-launcher3-master
|
||||
|
||||
commit 8b488ccc2e433a708c8b06f0b6866f2a305e4b0a
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Wed Oct 14 12:13:04 2020 -0700
|
||||
|
||||
[Live Tile] Support launching running task animation
|
||||
|
||||
Fixes: 170338170
|
||||
Test: manual
|
||||
Change-Id: I2526b7cfbacaea7899b8e2ed233f913630071d36
|
||||
|
||||
commit 70e8b157219e9090ba5e47fdfa51b2b92e98449d
|
||||
Author: Andy Wickham <awickham@google.com>
|
||||
Date: Wed Oct 7 23:00:06 2020 -0700
|
||||
|
||||
Minor stylistic changes in Workspace.java.
|
||||
|
||||
Change-Id: Ib07611f27cbc427d11abccd8b74ea144485752f7
|
||||
|
||||
commit acfac6187dd9d13d55b566a77a5da867a1813573
|
||||
Author: Alex Chau <alexchau@google.com>
|
||||
Date: Mon Oct 19 18:00:39 2020 +0100
|
||||
|
||||
Use Diplay.getMetrics in DisplayController
|
||||
|
||||
- This is a workaround of b/163815566, where DisplayMetrics is stale
|
||||
when onDisplayChanged is called.
|
||||
- Instead of relying on stale DisplayConext, get the DisplayMetrics
|
||||
from the Display directly.
|
||||
- Also optimized how DisplayController.Info is created by passing in
|
||||
Display only
|
||||
- Use mDisplayContext.getDisplay directly if availalbe
|
||||
|
||||
Bug: 163815566, 160544577
|
||||
Test: DPI looks correct on device boot
|
||||
Change-Id: I2a7454bb8cf2073ce592e8662781b87fc998444f
|
||||
(cherry picked from commit 177c38243dc3bf245d1f7db3c265dfb56522f441)
|
||||
|
||||
commit ff8febabb039a3c27ee068f85119860a048b917c
|
||||
Merge: b03d2b416 102746823
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Tue Oct 20 17:46:09 2020 +0000
|
||||
|
||||
Merge "Makes Plugin Settings gear adjust to dark mode." into ub-launcher3-master
|
||||
|
||||
commit b03d2b41616d479ba360fa4f97e57722c7f57b8e
|
||||
Merge: fb79f5541 caa1e9c39
|
||||
Author: Hyunyoung Song <hyunyoungs@google.com>
|
||||
Date: Tue Oct 20 15:25:56 2020 +0000
|
||||
|
||||
Merge "Search query method should support multiple consumers" into ub-launcher3-master
|
||||
|
||||
commit fb79f5541dcbe587002756bb40a3c632d38cc25a
|
||||
Merge: f6b05068d cf0b275a4
|
||||
Author: Schneider Victor-tulias <victortulias@google.com>
|
||||
Date: Tue Oct 20 13:51:06 2020 +0000
|
||||
|
||||
Merge "Add the ability to specify a list of tutorial steps in the gesture sandbox tutorial intent." into ub-launcher3-master
|
||||
|
||||
commit f6b05068d901d4e989b2e107c06f9c7a6e7b113f
|
||||
Author: Hyunyoung Song <hyunyoungs@google.com>
|
||||
Date: Tue Oct 20 00:19:29 2020 -0700
|
||||
|
||||
Invert the badging
|
||||
|
||||
Bug: 171171594
|
||||
Change-Id: If84fdc03254105c843e16f39f479505b16e1cd5f
|
||||
|
||||
commit caa1e9c39978cb3b467b5ac441eb39b5e883fa2e
|
||||
Author: Hyunyoung Song <hyunyoungs@google.com>
|
||||
Date: Mon Oct 12 13:56:02 2020 -0700
|
||||
|
||||
Search query method should support multiple consumers
|
||||
|
||||
Bug: 170488559
|
||||
Change-Id: I64bef9523d3c3950c4ca3a4b9ce1d506d1672200
|
||||
|
||||
commit 10274682339bb60cb24c50536b4f48f921970f3c
|
||||
Author: Andy Wickham <awickham@google.com>
|
||||
Date: Mon Oct 19 19:06:52 2020 -0700
|
||||
|
||||
Makes Plugin Settings gear adjust to dark mode.
|
||||
|
||||
It wasn't visible in dark mode before because it was
|
||||
black on black. This makes it adjust automatically.
|
||||
|
||||
Change-Id: I5176cffc01842509ddafc4f30ff5029a0c4b8050
|
||||
|
||||
commit 744a0fbeae8efaa942d21c61e25012d86f5ff81e
|
||||
Merge: 29c79947e 71f24588c
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Mon Oct 19 22:17:26 2020 +0000
|
||||
|
||||
Merge "Call click event on IME quick select for SearchResultIcon" into ub-launcher3-master
|
||||
|
||||
commit 29c79947ecf82f662d02004ba9a7289017fc0783
|
||||
Merge: 13a2a010d a68ac3e5d
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Mon Oct 19 18:42:05 2020 +0000
|
||||
|
||||
Merge "Removing condition for CUJ tracing/metrics" into ub-launcher3-master
|
||||
|
||||
commit 71f24588c0a66449a0c68bcb360a8c671914ce75
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Mon Oct 19 10:19:31 2020 -0700
|
||||
|
||||
Call click event on IME quick select for SearchResultIcon
|
||||
|
||||
Bug: 171131394
|
||||
Change-Id: I8a703e8d0ca10570e3f774510610d3fb4c0eaab8
|
||||
|
||||
commit 13a2a010decd87eeaf8932430c692f587d2de165
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Sun Oct 18 21:19:57 2020 -0700
|
||||
|
||||
Handle IME event for SearchResultIcon
|
||||
|
||||
Bug: 171131394
|
||||
Test: Manual
|
||||
Change-Id: I2ed1c61053c78aaecc3324418229d69634a72ae4
|
||||
|
||||
commit 1f79eeda76246534697e92740defc7f73c3c8d14
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Fri Oct 16 02:01:31 2020 -0700
|
||||
|
||||
Remove hardcoded itemTypes from SearchTarget
|
||||
|
||||
- Introduces componentName and userHandle members to SearchTarget
|
||||
- SearchTargetEvent now has searchTarget member
|
||||
- Builder pattern for SearchTarget and SearchTargetEvent
|
||||
- Search backend should add headers manually instead of launcher inferring sections
|
||||
|
||||
Bug: 171026321
|
||||
Test: Manual
|
||||
Change-Id: I28e0455e82b925277a17703b9aa061c8f9f15262
|
||||
|
||||
commit a68ac3e5dd23095cea7c872c0ff1c5042d1695ba
|
||||
Author: vadimt <vadimt@google.com>
|
||||
Date: Fri Oct 16 10:48:28 2020 -0700
|
||||
|
||||
Removing condition for CUJ tracing/metrics
|
||||
|
||||
Is doesn't reflect whether jank monitors is collecting metrics,
|
||||
which will eventually be always true anyways.
|
||||
|
||||
Change-Id: Iaebdc838ed2b2cebd32c8c48d7e45bdd93f76fb4
|
||||
|
||||
commit 9228ff53c2fb26850b7bd92d86214a6aaebb11d3
|
||||
Author: Sunny Goyal <sunnygoyal@google.com>
|
||||
Date: Mon Oct 12 13:43:51 2020 -0700
|
||||
|
||||
Trimming activity and task label
|
||||
|
||||
Bug: 170648272
|
||||
Change-Id: Icd099acee65305e0aa0f98a2a301a0df8a27cf07
|
||||
|
||||
commit 7a09177e500a53205f9969bb6cbd4251d54e8fde
|
||||
Merge: 37ed5ead3 314761a80
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Thu Oct 15 22:36:14 2020 +0000
|
||||
|
||||
Merge "Setup SearchResultIcon for single cell results" into ub-launcher3-master
|
||||
|
||||
commit 37ed5ead391df5747003b2d3a345be0347362f19
|
||||
Merge: d5bbe6809 702ed2788
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Thu Oct 15 22:06:12 2020 +0000
|
||||
|
||||
Merge "Fix the issue where shortcuts are removed in minimal device mode" into ub-launcher3-master
|
||||
|
||||
commit 314761a80819a6e64a136161f51eebb0f0528c4d
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Wed Oct 14 10:15:07 2020 -0700
|
||||
|
||||
Setup SearchResultIcon for single cell results
|
||||
|
||||
SearchResultIcon will be able to render apps, shortcuts and remote actions. It can also handle its own focused state drawing.
|
||||
|
||||
Screenshot: https://screenshot.googleplex.com/C3KgjJtLQTBPgaf
|
||||
|
||||
Bug: 170752716
|
||||
Test: Manual
|
||||
Change-Id: I460a9c128ea3f5814784e342c5d5fa5b7e310882
|
||||
|
||||
commit 702ed2788678ac744c768aad6a6302e7cf91a26b
|
||||
Author: Pinyao Ting <pinyaoting@google.com>
|
||||
Date: Wed Oct 14 11:17:04 2020 -0700
|
||||
|
||||
Fix the issue where shortcuts are removed in minimal device mode
|
||||
|
||||
When loading the workspace, Launcher pins/unpins shortcuts in comply
|
||||
with the loaded workspace. Since minimal device mode creates a mostly
|
||||
empty workspace, existing shortcuts are getting unpinned as a result.
|
||||
|
||||
To mitigate the issue this CL compares the db name and only invoke
|
||||
sanitizeData when it matches the one defined in InvariantDeviceProfile.
|
||||
|
||||
Bug: 170611866
|
||||
Test: manual
|
||||
1. add some deep shortcut in workspace (e.g. long tap on chrome, drag
|
||||
"incognito tab" to workspace)
|
||||
2. opt-in to sunshine fishfood (g/sunshine-teamfood)
|
||||
3. enable bedtime mode with minimal device in Settings -> Digital
|
||||
Wellbeing -> Show Your Data -> Bedtime mode -> Customize -> minimal
|
||||
device
|
||||
4. toggle bedtime mode, wait for apps in minimal device to show, then
|
||||
toggle off bedtime mode
|
||||
5. verify the deep shortcut still exist
|
||||
|
||||
Change-Id: Ie18216ecb288e7481aa2404c4cb3ea418aee85cb
|
||||
|
||||
commit cf0b275a48d3c9f91a346f7fc24b9604f6dde25a
|
||||
Author: Schneider Victor-tulias <victortulias@google.com>
|
||||
Date: Tue Oct 6 09:33:40 2020 -0400
|
||||
|
||||
Add the ability to specify a list of tutorial steps in the gesture sandbox tutorial intent.
|
||||
|
||||
Added tutorial_steps string array in the intent to allow specifying an ordered list of tutorial steps.
|
||||
|
||||
Change-Id: Ic42a65598a74a64f8441a22f58c6cd988a5762e3
|
||||
|
||||
commit d5bbe6809dcc056fbfc307909b171651f0fb3044
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Wed Oct 14 15:39:38 2020 -0700
|
||||
|
||||
Rename shrotcut container to deep-shrotcuts
|
||||
|
||||
Change-Id: If94f0dfa447235f3b1a652f7b6c749695b42d97c
|
||||
|
||||
commit 26c1105fa04c2bcc156051e51df90a6a253349bb
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Tue Oct 13 01:12:03 2020 -0700
|
||||
|
||||
[search api part 1] Setup centralized SearchEventTracker
|
||||
|
||||
- Rename AdapterItemWIthPayload to SearchAdapterItem, PayloadResultHandler to SearchTargetHandler
|
||||
- Setup SliceViewWrapper for self contained slices
|
||||
|
||||
Bug: 170702596
|
||||
Change-Id: I0baf984ec8123c95011abcc17372f8d055e98ad7
|
||||
|
||||
commit 057f2d0d7df67e3680e479ac76b48b30d8bcf884
|
||||
Merge: 4bb65ff51 9a6145efb
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Tue Oct 13 01:57:47 2020 +0000
|
||||
|
||||
Merge "Introduce shortcut container for hotseat event reporting" into ub-launcher3-master
|
||||
|
||||
commit 4bb65ff516c6d9a429971ab7e04780792d5cb751
|
||||
Merge: 69740e62b 2afcab804
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Tue Oct 13 00:07:36 2020 +0000
|
||||
|
||||
Merge "Search UI clean up" into ub-launcher3-master
|
||||
|
||||
commit 2afcab804b638ff3b9da5bad40c8f70bdcaae78d
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Mon Oct 12 15:38:14 2020 -0700
|
||||
|
||||
Search UI clean up
|
||||
|
||||
- Resolve spacing issue when work profile is installed
|
||||
- Cache play icons and use icon shape
|
||||
- Only draw focus indicator for the first result
|
||||
|
||||
Bug: 170487752
|
||||
Bug: 170665892
|
||||
Change-Id: I864d2e796786637132e127ef9b418c0a76c74d6e
|
||||
|
||||
commit 69740e62be3800fc918648009645f7a8e52cb73d
|
||||
Merge: 2d7bfc878 979da64d8
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Mon Oct 12 20:53:29 2020 +0000
|
||||
|
||||
Merge "Add app start source info of apps launched from launcher" into ub-launcher3-master
|
||||
|
||||
commit 2d7bfc8782e9ed01178672aeb09ba2a6a07f4f4c
|
||||
Author: Jon Miranda <jonmiranda@google.com>
|
||||
Date: Mon Oct 12 12:09:22 2020 -0700
|
||||
|
||||
Fix shadowRadius not being used in swipe up animation.
|
||||
|
||||
Bug: 168608912
|
||||
Change-Id: I08f7bb057237e5061d5f1fc29afb488b204ee385
|
||||
|
||||
commit a433fe1fb34715efb38ed094f39da49fce8cd51e
|
||||
Merge: 2de606fe7 0471b9836
|
||||
Author: Sunny Goyal <sunnygoyal@google.com>
|
||||
Date: Mon Oct 12 18:08:35 2020 +0000
|
||||
|
||||
Merge "Using FrameCallbacks instead of windowCallbacks for surface removal" into ub-launcher3-master
|
||||
|
||||
commit 9a6145efb85f2bbdaccc07166a55e22c15fe27db
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Mon Oct 12 09:33:00 2020 -0700
|
||||
|
||||
Introduce shortcut container for hotseat event reporting
|
||||
|
||||
Bug: 170636685
|
||||
Test: Manual
|
||||
Change-Id: I5abeb17976bbafdc8cc74fb8b9a586d544c682fc
|
||||
|
||||
commit 2de606fe731573c081fd2d6ba166e21ea6aa2e9c
|
||||
Author: Yogisha Dixit <ydixit@google.com>
|
||||
Date: Mon Oct 12 15:36:07 2020 +0100
|
||||
|
||||
Delete the minimal database to force refresh.
|
||||
|
||||
Bug: 169771796
|
||||
Test: manual
|
||||
Change-Id: Ic2188bb162f295c208346861fddc137ace19ddcb
|
||||
|
||||
commit 0471b9836c9e382dc14bdc3abdf8502fb2b9f266
|
||||
Author: Sunny Goyal <sunnygoyal@google.com>
|
||||
Date: Wed Sep 23 13:54:37 2020 -0700
|
||||
|
||||
Using FrameCallbacks instead of windowCallbacks for surface removal
|
||||
|
||||
WindowCallbacks is called during the draw pass, before the frame has
|
||||
been sent to the surfaceFlinger. Frame callback will provide a closer
|
||||
approximation for when the frame is actually rendered on screen.
|
||||
|
||||
Bug: 141126144
|
||||
Change-Id: I62aab526c2ca24b00b5e7b312b36080f26c7b439
|
||||
|
||||
commit 2727434c44d06882925369bf4b43687a06be4a3f
|
||||
Merge: 59f532fe9 1b9e199b3
|
||||
Author: Schneider Victor-tulias <victortulias@google.com>
|
||||
Date: Fri Oct 9 20:09:08 2020 +0000
|
||||
|
||||
Merge "Fix hotseat and prediction row to allow updates when empty." into ub-launcher3-master
|
||||
|
||||
commit 59f532fe9e2b1817c094641f3c7c517f42e4faf0
|
||||
Merge: d2bfce71f b5334e3f0
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Fri Oct 9 19:52:54 2020 +0000
|
||||
|
||||
Merge "Improve search section header" into ub-launcher3-master
|
||||
|
||||
commit 979da64d8254599c332d83bf94f3f1fc3fe45fef
|
||||
Author: Riddle Hsu <riddlehsu@google.com>
|
||||
Date: Tue Sep 22 21:52:40 2020 +0800
|
||||
|
||||
Add app start source info of apps launched from launcher
|
||||
|
||||
Bug: 166614700
|
||||
Test: Enable statsd log: "adb shell cmd stats print-logs"
|
||||
adb logcat | grep statsd | grep "(48)"
|
||||
The line may contain 0x100000->1[I] 0x110000->10[I]
|
||||
that means 1=from launcher and 10=latency 10ms.
|
||||
Change-Id: Iddaff7066b66e241ba58ec87129ddbe2c531dc7e
|
||||
(cherry picked from commit 7bdf3574a3bff06a377b4364877687bfa7619d06)
|
||||
|
||||
commit d2bfce71f776fd05633dfd915dfc664309274677
|
||||
Merge: ed4530fed 222afb970
|
||||
Author: Winson Chung <winsonc@google.com>
|
||||
Date: Fri Oct 9 16:39:06 2020 +0000
|
||||
|
||||
Merge "Comply with the ISystemUiProxy.aidl change" into ub-launcher3-master
|
||||
|
||||
commit ed4530fedda0bf876f91d0745fc70d0f30d42991
|
||||
Merge: 692d2109a 9d4a96ed0
|
||||
Author: Winson Chung <winsonc@google.com>
|
||||
Date: Fri Oct 9 16:39:06 2020 +0000
|
||||
|
||||
Merge "Add latency metrics for recents gesture" into ub-launcher3-master
|
||||
|
||||
commit 1b9e199b3d9c81c793758d96bb03e0c51c1b3fb1
|
||||
Author: Schneider Victor-tulias <victortulias@google.com>
|
||||
Date: Thu Oct 8 15:50:22 2020 -0400
|
||||
|
||||
Fix hotseat and prediction row to allow updates when empty.
|
||||
|
||||
Rotating the screen in the homescreen empties the hotseat, however it does not get populated while it is visible to the user. The user should not be able to see an empty hotseat or prediction row if predictions are available. It should therefore be possible to populate these when they are empty even if they are visible to the user.
|
||||
|
||||
Change-Id: I8e5252bd29050c2cd9d443aedcb3f3e305c0e2d7
|
||||
|
||||
commit b5334e3f07f0561808a2d6e9bba55f1e3a89191e
|
||||
Author: Hyunyoung Song <hyunyoungs@google.com>
|
||||
Date: Fri Oct 9 00:50:48 2020 -0700
|
||||
|
||||
Improve search section header
|
||||
|
||||
Change-Id: I47cf207f0d0ab792c0e7a47c9d1185eec087ec88
|
||||
|
||||
commit 692d2109a6702706d24b3b819d115882f7362509
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Thu Oct 8 18:42:48 2020 -0700
|
||||
|
||||
invalidate itemDecoration on predictedRow focus draw
|
||||
|
||||
Change-Id: I66c731f00ae1c1292c51ff281957f05fd2d70dfa
|
||||
|
||||
commit 8d5b118060bff7f7518a9a14c0be5d265621f14c
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Thu Oct 8 13:11:25 2020 -0700
|
||||
|
||||
Revert PredictionRow shuoldDraw check
|
||||
|
||||
+ Show Rounded play result icons
|
||||
|
||||
Bug: 168805872
|
||||
Test: Manual
|
||||
Change-Id: I663c7f7ca1f1ac072e5e9c441deabef7c3fbd97b
|
||||
|
||||
commit 86f8df6cf954ac27ab092b9ef8a4db3c9979c4cb
|
||||
Merge: 4d19854b2 16045060c
|
||||
Author: Hilary Huo <hhuo@google.com>
|
||||
Date: Thu Oct 8 18:43:51 2020 +0000
|
||||
|
||||
Merge "[pixel-search] add escape hatch" into ub-launcher3-master
|
||||
|
||||
commit 4d19854b25a54599fe9b0ac8be9d60cf6c21d7ba
|
||||
Merge: 0827e1e32 ab9ad20be
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Thu Oct 8 18:40:56 2020 +0000
|
||||
|
||||
Merge "Search UI cleanup" into ub-launcher3-master
|
||||
|
||||
commit 16045060c35639aea85afc572bea768d16e6c9f9
|
||||
Author: Hilary Huo <hhuo@google.com>
|
||||
Date: Thu Oct 8 10:18:41 2020 -0700
|
||||
|
||||
[pixel-search] add escape hatch
|
||||
|
||||
Change-Id: I33ffea1fc0859564955380d7d1db317293d1a2cb
|
||||
|
||||
commit 0827e1e32a5f99fa02418dae37270c6db8c989d2
|
||||
Merge: 3463f0a87 68d7a6e5b
|
||||
Author: Andy Wickham <awickham@google.com>
|
||||
Date: Thu Oct 8 16:53:29 2020 +0000
|
||||
|
||||
Merge "Adds feature flag for BC Smartspace." into ub-launcher3-master
|
||||
|
||||
commit ab9ad20be600d1cbdc6b54a491d5fbb4c2cf9c16
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Wed Oct 7 15:18:24 2020 -0700
|
||||
|
||||
Search UI cleanup
|
||||
|
||||
- offset all apps header padding with search input margin
|
||||
- avoid check shouldDraw check on HeaderRow. (race condition)
|
||||
|
||||
Bug: 170263425
|
||||
Change-Id: I11a1fbb448aa6afd18ec0984af9bb8b1d7600f69
|
||||
|
||||
commit 68d7a6e5b28af8cc55bdae7efc24cc7ebee81257
|
||||
Author: Andy Wickham <awickham@google.com>
|
||||
Date: Wed Oct 7 14:27:17 2020 -0700
|
||||
|
||||
Adds feature flag for BC Smartspace.
|
||||
|
||||
Change-Id: Iaf9fb7507d0ccd004a4e00188c75dadd6a059246
|
||||
|
||||
commit 3463f0a876ff486ce03e160134e0504158271a92
|
||||
Merge: 2470d812a 4b7f38b8f
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Wed Oct 7 20:09:04 2020 +0000
|
||||
|
||||
Merge "Align fallback result query with result text" into ub-launcher3-master
|
||||
|
||||
commit 2470d812a1ae989e67781e5056b534ad9a960819
|
||||
Merge: cae7d74d8 7a6e4c931
|
||||
Author: Vadim Tryshev <vadimt@google.com>
|
||||
Date: Wed Oct 7 20:04:09 2020 +0000
|
||||
|
||||
Merge "Annotating Quick Switch CUJ for 3-button mode" into ub-launcher3-master
|
||||
|
||||
commit cae7d74d898769727105850ea5473c2c0ae25fdb
|
||||
Merge: e9bf2bd14 1fddddb4f
|
||||
Author: Tony Wickham <twickham@google.com>
|
||||
Date: Wed Oct 7 18:32:48 2020 +0000
|
||||
|
||||
Merge "Update launcher_trace.proto for quick switch" into ub-launcher3-master
|
||||
|
||||
commit 7a6e4c931f13b369bfa4328196b4632d6d848a19
|
||||
Author: vadimt <vadimt@google.com>
|
||||
Date: Tue Oct 6 14:09:16 2020 -0700
|
||||
|
||||
Annotating Quick Switch CUJ for 3-button mode
|
||||
|
||||
Bug: 169221288
|
||||
Change-Id: Ief62345fe6004dde699f44aa0c90329b7cd84e8b
|
||||
|
||||
commit 4b7f38b8fa004b514244304fcc07ff514a2fa46b
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Tue Oct 6 18:37:46 2020 -0700
|
||||
|
||||
Align fallback result query with result text
|
||||
|
||||
screenshot: https://screenshot.googleplex.com/6Daj5vdmz2jmznX
|
||||
bug: 169438169
|
||||
test: Manual
|
||||
Change-Id: Ie621ed3c834aec5e9467607da4f685d05d152183
|
||||
|
||||
commit 222afb970434c7972589adfc509bd2c256ca6556
|
||||
Author: Hongwei Wang <hwwang@google.com>
|
||||
Date: Fri Oct 2 13:51:36 2020 -0700
|
||||
|
||||
Comply with the ISystemUiProxy.aidl change
|
||||
|
||||
Two methods are added to support communications between Launcher and
|
||||
SysUI when user swipes an auto PiP-able Activity to home.
|
||||
|
||||
Bug: 143965596
|
||||
Test: N/A
|
||||
Change-Id: I2c73a287a094e882bde3cd71c27f9f66ae20e64a
|
||||
(cherry picked from commit 88ddae38db924f700082a113670ce5a719116a95)
|
||||
|
||||
commit 9d4a96ed029fdad1e369d5eedd082938f0dc9e01
|
||||
Author: Riddle Hsu <riddlehsu@google.com>
|
||||
Date: Wed Sep 30 00:32:04 2020 +0800
|
||||
|
||||
Add latency metrics for recents gesture
|
||||
|
||||
Pass the touch down time to RecentsAnimation#startRecentsActivity.
|
||||
|
||||
Bug: 169221287
|
||||
Test: Enable statsd log: "adb shell cmd stats print-logs"
|
||||
Touch gesture navigation bar.
|
||||
adb logcat | grep statsd | grep "(48)"
|
||||
The line may contain 0x100000->4[I] 0x110000->20[I]
|
||||
that means 4=by recents and 20=latency 20ms.
|
||||
Change-Id: I81ee804895b7712f4d925736f5b4694c11a12cbe
|
||||
(cherry picked from commit 63623967b83edad56db58173ebb6687c685b9177)
|
||||
|
||||
commit e9bf2bd14c9a7a48f8f93687932d41b1418cf4e4
|
||||
Merge: 73ae75474 d028937e7
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Wed Oct 7 02:19:04 2020 +0000
|
||||
|
||||
Merge "[Live tile] Finish recents animation when the phone goes to sleep in live tile mode" into ub-launcher3-master
|
||||
|
||||
commit 1fddddb4f30505e0fc9bb2e7c0d88b38ad900e54
|
||||
Author: Tony Wickham <twickham@google.com>
|
||||
Date: Tue Sep 29 17:29:06 2020 -0700
|
||||
|
||||
Update launcher_trace.proto for quick switch
|
||||
|
||||
Sample output from one entry:
|
||||
entry {
|
||||
elapsed_realtime_nanos: 440461382888540
|
||||
launcher {
|
||||
touch_interaction_service {
|
||||
service_connected: true
|
||||
overview_component_obvserver {
|
||||
overview_activity_started: true
|
||||
overview_activity_resumed: false
|
||||
}
|
||||
input_consumer {
|
||||
name: "TYPE_OTHER_ACTIVITY:TYPE_ONE_HANDED"
|
||||
swipe_handler {
|
||||
gesture_state {
|
||||
endTarget: NEW_TASK
|
||||
}
|
||||
is_recents_attached_to_app_window: true
|
||||
scroll_offset: 846
|
||||
app_to_overview_progress: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Bug: 167259591
|
||||
Change-Id: I7f199d88f1d736efcea6b9165b8c4b77a5d27c58
|
||||
|
||||
commit 73ae75474ec1dd8807d814ea6c22323905d2070c
|
||||
Merge: 8a6f3e40d 0ebbc1880
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Tue Oct 6 23:18:44 2020 +0000
|
||||
|
||||
Merge "Removing tracing for a gone flake" into ub-launcher3-master
|
||||
|
||||
commit 8a6f3e40d0321217c624055db7929c397e455e0c
|
||||
Merge: e29a9f796 565ed4ff6
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Tue Oct 6 22:49:40 2020 +0000
|
||||
|
||||
Merge "Update Search UI" into ub-launcher3-master
|
||||
|
||||
commit 0ebbc18803aaf8ef2f6db7d628d7ae1ce322e842
|
||||
Author: vadimt <vadimt@google.com>
|
||||
Date: Tue Oct 6 14:52:27 2020 -0700
|
||||
|
||||
Removing tracing for a gone flake
|
||||
|
||||
Bug: 156044202
|
||||
Change-Id: Ice142bb941fee7b731f46c2073fab17d83bbc871
|
||||
|
||||
commit 565ed4ff69b534812818a2b9aa8789a1aea210eb
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Wed Sep 30 10:42:07 2020 -0700
|
||||
|
||||
Update Search UI
|
||||
|
||||
[preview attached to bug]
|
||||
|
||||
Bug: 169438169
|
||||
Test: Manual
|
||||
Change-Id: I085f3dd38ac373c1afab82a637ec08715a6e0cc5
|
||||
|
||||
commit e29a9f7961e6db0915bc028ef7e871dcb2c8bde0
|
||||
Merge: 2c5ed10ff be17bdcd2
|
||||
Author: Jayaprakash Sundararaj <jayaprakashs@google.com>
|
||||
Date: Tue Oct 6 21:00:20 2020 +0000
|
||||
|
||||
Merge "[Search] Add logging to People and badding as to icons." into ub-launcher3-master
|
||||
|
||||
commit be17bdcd221f501c45876abe2249c1007858d0c0
|
||||
Author: jayaprakashs <jayaprakashs@google.com>
|
||||
Date: Mon Oct 5 09:01:52 2020 -0700
|
||||
|
||||
[Search] Add logging to People and badding as to icons.
|
||||
|
||||
Change-Id: I65948a2faca436216a94aa46139d425b8eade827
|
||||
|
||||
commit 2c5ed10ffa1a870de35f9b3c0c558270aff498dd
|
||||
Merge: b2b65a1ef 8ed9707cf
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Tue Oct 6 18:40:57 2020 +0000
|
||||
|
||||
Merge "[Live Tile] Support launching another task (other than the current running task) in Overview" into ub-launcher3-master
|
||||
|
||||
commit b2b65a1ef58b020923d112051535b6eb83b582df
|
||||
Merge: 3cf264f49 4c14f4b9e
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Tue Oct 6 17:45:35 2020 +0000
|
||||
|
||||
Merge "Avoid double search item highlight" into ub-launcher3-master
|
||||
|
||||
commit 8ed9707cf3a4300cb61942f08f0752c80eed086b
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Mon Sep 14 23:25:37 2020 -0700
|
||||
|
||||
[Live Tile] Support launching another task (other than the current running task) in Overview
|
||||
|
||||
- Get rid of the defer cancelation logic
|
||||
- Render animation on the task view of the task being launched upon task view appeared callback
|
||||
- Finish the recents animation upon the end of the recents window animation
|
||||
|
||||
Fixes: 164926736
|
||||
Test: manual
|
||||
Change-Id: Ibffb6a9c74c235efc8615a22b0306551532c7b61
|
||||
|
||||
commit 3cf264f498e37c482fa4c559bf48ffa791279585
|
||||
Author: Schneider Victor-tulias <victortulias@google.com>
|
||||
Date: Tue Sep 22 12:58:38 2020 -0700
|
||||
|
||||
Prevent hotseat updates if it is visible to the user.
|
||||
|
||||
Test: manual
|
||||
|
||||
Fixes: 168653219
|
||||
|
||||
Changing app icons under the user's finger could be disruptive. Added a checks for whether the hotseatand all apps predictions are visible and callbacks to update them when they become hidden.
|
||||
|
||||
Change-Id: Ib9e6e904e9f662ecfaeea6a2fe21d1d81ba39b96
|
||||
|
||||
commit b6aff1f56d55a36256446ec3970d92e9da39b98c
|
||||
Author: Hyunyoung Song <hyunyoungs@google.com>
|
||||
Date: Mon Oct 5 16:08:35 2020 -0700
|
||||
|
||||
Fix NPE inside RecentsOrientedState
|
||||
|
||||
Bug: 169963211
|
||||
Change-Id: I86dd337dc1b862f3fa99b91b47fa250076233f96
|
||||
|
||||
commit eab40983b9a48b933bde5ca95a82ebd4d83b233d
|
||||
Merge: 83ce7c0b5 020e628f2
|
||||
Author: Jonathan Miranda <jonmiranda@google.com>
|
||||
Date: Mon Oct 5 22:20:27 2020 +0000
|
||||
|
||||
Merge "Add shadow radius to windows during app launch / close animations." into ub-launcher3-master
|
||||
|
||||
commit 83ce7c0b5e461386bb92883a8d6cefe8365cd9ae
|
||||
Merge: 679d920bf d6b1f3c08
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Mon Oct 5 19:18:39 2020 +0000
|
||||
|
||||
Merge "Action icon should be used as a badge instead of main icon" into ub-launcher3-master
|
||||
|
||||
commit 679d920bf5151cffed4e8186c12c25d8d7907af9
|
||||
Merge: e108cc609 0c943966d
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Mon Oct 5 19:13:50 2020 +0000
|
||||
|
||||
Merge "Add null check for input receiver before updating batching" into ub-launcher3-master
|
||||
|
||||
commit e108cc609d0a7fd58f0c7e16ce45fa79be6dd272
|
||||
Merge: 470403eb5 f622e42bf
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Mon Oct 5 18:39:58 2020 +0000
|
||||
|
||||
Merge "Removing unused proto extensions" into ub-launcher3-master
|
||||
|
||||
commit 470403eb58879380e2edac2262dc7f40327b2a15
|
||||
Merge: a5130482a 1d7ed30db
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Mon Oct 5 18:29:54 2020 +0000
|
||||
|
||||
Merge "Remove widgets that no longer fit the workspace in their current spans." into ub-launcher3-master
|
||||
|
||||
commit 4c14f4b9eda8332347c81e0cf51c5de4dbc06399
|
||||
Author: Samuel Fufa <sfufa@google.com>
|
||||
Date: Mon Oct 5 10:50:00 2020 -0700
|
||||
|
||||
Avoid double search item highlight
|
||||
|
||||
Change-Id: Ic2e28b18f6d5e3ed32cd5646bc3bb4789c378e57
|
||||
|
||||
commit 0c943966d373d8ae7eef2b08e88ac44bf57d8a8d
|
||||
Author: Winson Chung <winsonc@google.com>
|
||||
Date: Mon Oct 5 10:23:27 2020 -0700
|
||||
|
||||
Add null check for input receiver before updating batching
|
||||
|
||||
- A change in the system (ie. sysui crash or nav mode change) could
|
||||
cause the input monitor to be disposed before the swipe animation
|
||||
settles
|
||||
|
||||
Bug: 170121063
|
||||
Test: Kill sysui while swiping up
|
||||
|
||||
Change-Id: I1417b109fecdb98fae6197c7038dbe9307470853
|
||||
|
||||
commit a5130482aee1b0592661bc1c6e178a0de7a163da
|
||||
Merge: b21819e18 7fcd74abb
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Mon Oct 5 17:14:21 2020 +0000
|
||||
|
||||
Merge "Suggest result should launch Bug: 169980192" into ub-launcher3-master
|
||||
|
||||
commit d028937e74a9ea6d36e463de4c87ed37283bbdf6
|
||||
Author: Tracy Zhou <tracyzhou@google.com>
|
||||
Date: Sat Oct 3 00:36:53 2020 -0700
|
||||
|
||||
[Live tile] Finish recents animation when the phone goes to sleep in live tile mode
|
||||
|
||||
Fixes: 169988381
|
||||
Test: manual
|
||||
Change-Id: Ic71d3e6767eadb6854dbd46581bf9d3242c161a4
|
||||
|
||||
commit 7fcd74abb399100ac8243be6ca28c09cc8adc8c8
|
||||
Author: Hyunyoung Song <hyunyoungs@google.com>
|
||||
Date: Fri Oct 2 19:20:11 2020 -0700
|
||||
|
||||
Suggest result should launch
|
||||
Bug: 169980192
|
||||
|
||||
Change-Id: I762245a5cc4740d093c9cb3b44a508e9e3f2b763
|
||||
|
||||
commit b21819e181e99504c22c6ca028261a1f2665c6f9
|
||||
Merge: 931bce369 a762b0241
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Fri Oct 2 22:07:12 2020 +0000
|
||||
|
||||
Merge "Annotating Quick Switch CUJ for non-3-button modes" into ub-launcher3-master
|
||||
|
||||
commit a762b02418695f5a1ff2f96586660de8c3610280
|
||||
Author: vadimt <vadimt@google.com>
|
||||
Date: Fri Oct 2 13:56:28 2020 -0700
|
||||
|
||||
Annotating Quick Switch CUJ for non-3-button modes
|
||||
|
||||
Bug: 169221288
|
||||
Change-Id: I7145a9e28a2f0a789d19d2a0e3d15630c6e50f6a
|
||||
|
||||
commit 931bce3697595a214023bc72923dad47a61d5711
|
||||
Merge: c935ba6b8 733e3c609
|
||||
Author: TreeHugger Robot <treehugger-gerrit@google.com>
|
||||
Date: Fri Oct 2 19:19:50 2020 +0000
|
||||
|
||||
Merge "Moving some initializations to the background thread" into ub-launcher3-master
|
||||
|
||||
commit c935ba6b8a2ec163533c0b19309dacb6199e6552
|
||||
Merge: a4111f250 58804ac52
|
||||
Author: Sunny Goyal <sunnygoyal@google.com>
|
||||
Date: Fri Oct 2 18:26:06 2020 +0000
|
||||
|
||||
Merge "Adding stats log for add item flow" into ub-launcher3-master
|
||||
|
||||
commit 733e3c609b7653a36e58747c881458ec00d98df8
|
||||
Author: Sunny Goyal <sunnygoyal@google.com>
|
||||
Date: Tue Sep 29 10:32:32 2020 -0700
|
||||
|
||||
Moving some initializations to the background thread
|
||||
|
||||
HandlerThread.getLooper blocks until the thread is ready. Instead
|
||||
moving all looper dependency to the new thread itself.
|
||||
|
||||
Change-Id: I240e8c56b855a991433a7fe93875059e6dab146b
|
||||
|
||||
commit 58804ac5257f45dddbf7a6db35cf8f369ee1e88e
|
||||
Author: Sunny Goyal <sunnygoyal@google.com>
|
||||
Date: Wed Sep 16 16:27:40 2020 -0700
|
||||
|
||||
Adding stats log for add item flow
|
||||
|
||||
Bug: 169385783
|
||||
Bug: 168167693
|
||||
Change-Id: I37395f1b118727f67e0f14c02f945b8213b165c8
|
||||
|
||||
commit a4111f250003328d1aef8bbaab59512208ec46cb
|
||||
Merge: 8d14dbe04 f6b72c4ad
|
||||
Author: Hilary Huo <hhuo@google.com>
|
||||
Date: Fri Oct 2 17:41:22 2020 +0000
|
||||
|
||||
Merge "[pixel-search] Bug fix: automatically launch screenshot + center&crop remoteaction icon" into ub-launcher3-master
|
||||
|
||||
commit f622e42bf6983d3adb95386bfd6375d281f1d4f2
|
||||
Author: Sunny Goyal <sunnygoyal@google.com>
|
||||
Date: Fri Oct 2 10:35:56 2020 -0700
|
||||
|
||||
Removing unused proto extensions
|
||||
|
||||
Change-Id: I6d0319c99934dad5176b6f70b895a4ca772ec45f
|
||||
|
||||
commit d6b1f3c086f9ac097cd03e1ee898b153478ec11a
|
||||
Author: Hyunyoung Song <hyunyoungs@google.com>
|
||||
Date: Fri Oct 2 00:26:35 2020 -0700
|
||||
|
||||
Action icon should be used as a badge instead of main icon
|
||||
|
||||
Bug: 169796517
|
||||
Change-Id: I3f07fdc2ae6e1af463701f942c26c3ca5d836ee2
|
||||
|
||||
commit f6b72c4ad1d2e082441a64c4d6a5a02ee8a251ca
|
||||
Author: Hilary Huo <hhuo@google.com>
|
||||
Date: Thu Oct 1 12:26:48 2020 -0700
|
||||
|
||||
[pixel-search] Bug fix: automatically launch screenshot + center&crop remoteaction icon
|
||||
|
||||
Bug: b/169330678
|
||||
Change-Id: Id5f8a0ce6d68f7ed9e4d1ff258ee3772229eb63b
|
||||
|
||||
commit 1d7ed30dba4b2c71fc7b0981532a872a13e5aedb
|
||||
Author: Jon Miranda <jonmiranda@google.com>
|
||||
Date: Wed Sep 23 12:15:43 2020 -0700
|
||||
|
||||
Remove widgets that no longer fit the workspace in their current spans.
|
||||
|
||||
This can happen when display size changes.
|
||||
We compare span sizes of widget in the db to the min sizes of the widget
|
||||
in the current display size. If the widget can no longer fit in its existing
|
||||
spans, we remove it.
|
||||
|
||||
Also update test widgets to have minWidth/minHeight of 1dp. This ensures that
|
||||
the spanX, spanY, min* values remain consistent between different test devices.
|
||||
|
||||
Bug: 168818961
|
||||
Change-Id: I723372e4582658f78b2f23ced9073cb77977a6b8
|
||||
|
||||
commit 020e628f22cc7975beab439c6da26af2f9ebc15b
|
||||
Author: Jon Miranda <jonmiranda@google.com>
|
||||
Date: Mon Sep 28 17:01:42 2020 -0700
|
||||
|
||||
Add shadow radius to windows during app launch / close animations.
|
||||
|
||||
Bug: 168608912
|
||||
Change-Id: I2ec50b0b3711c0861659f9c641bbc05fcdeaab45
|
||||
@@ -16,4 +16,4 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
addFrameworkJar('framework-14.jar')
|
||||
addFrameworkJar('framework-15.jar')
|
||||
@@ -0,0 +1,13 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace 'app.lawnchair.compatlib.fifteen'
|
||||
}
|
||||
|
||||
addFrameworkJar('framework-15.jar')
|
||||
|
||||
dependencies {
|
||||
api projects.compatLib.compatLibVU
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package app.lawnchair.compatlib.fifteen;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
import app.lawnchair.compatlib.fourteen.ActivityManagerCompatVU;
|
||||
|
||||
@RequiresApi(35)
|
||||
public class ActivityManagerCompatVV extends ActivityManagerCompatVU {}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package app.lawnchair.compatlib.fifteen;
|
||||
|
||||
import android.app.ActivityOptions;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import app.lawnchair.compatlib.fourteen.ActivityOptionsCompatVU;
|
||||
|
||||
@RequiresApi(35)
|
||||
public class ActivityOptionsCompatVV extends ActivityOptionsCompatVU {
|
||||
@NonNull
|
||||
@Override
|
||||
public ActivityOptions makeCustomAnimation(
|
||||
@NonNull Context context,
|
||||
int enterResId,
|
||||
int exitResId,
|
||||
@NonNull final Handler callbackHandler,
|
||||
@Nullable final Runnable startedListener,
|
||||
@Nullable final Runnable finishedListener) {
|
||||
return ActivityOptions.makeCustomAnimation(
|
||||
context,
|
||||
enterResId,
|
||||
exitResId,
|
||||
0,
|
||||
callbackHandler,
|
||||
new ActivityOptions.OnAnimationStartedListener() {
|
||||
@Override
|
||||
public void onAnimationStarted(long elapsedRealTime) {
|
||||
if (startedListener != null) {
|
||||
startedListener.run();
|
||||
}
|
||||
}
|
||||
},
|
||||
new ActivityOptions.OnAnimationFinishedListener() {
|
||||
@Override
|
||||
public void onAnimationFinished(long elapsedRealTime) {
|
||||
if (finishedListener != null) {
|
||||
finishedListener.run();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package app.lawnchair.compatlib.fifteen;
|
||||
|
||||
import android.window.RemoteTransition;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import app.lawnchair.compatlib.ActivityManagerCompat;
|
||||
import app.lawnchair.compatlib.ActivityOptionsCompat;
|
||||
import app.lawnchair.compatlib.RemoteTransitionCompat;
|
||||
import app.lawnchair.compatlib.fourteen.QuickstepCompatFactoryVU;
|
||||
|
||||
@RequiresApi(35)
|
||||
public class QuickstepCompatFactoryVV extends QuickstepCompatFactoryVU {
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ActivityManagerCompat getActivityManagerCompat() {
|
||||
return new ActivityManagerCompatVV();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ActivityOptionsCompat getActivityOptionsCompat() {
|
||||
return new ActivityOptionsCompatVV();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RemoteTransitionCompat getRemoteTransitionCompat() {
|
||||
return RemoteTransition::new;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="test_information_handler_class" translatable="false">com.android.launcher3.testing.DebugTestInformationHandler</string>
|
||||
</resources>
|
||||
|
||||
@@ -1,255 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.launcher3.testing;
|
||||
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.os.Binder;
|
||||
import android.os.Bundle;
|
||||
import android.system.Os;
|
||||
|
||||
import androidx.annotation.Keep;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.LauncherModel;
|
||||
import com.android.launcher3.ShortcutAndWidgetContainer;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* Class to handle requests from tests, including debug ones.
|
||||
*/
|
||||
public class DebugTestInformationHandler extends TestInformationHandler {
|
||||
private static Collection<String> sEvents;
|
||||
private static Application.ActivityLifecycleCallbacks sActivityLifecycleCallbacks;
|
||||
private static final Map<Activity, Boolean> sActivities =
|
||||
Collections.synchronizedMap(new WeakHashMap<>());
|
||||
private static int sActivitiesCreatedCount = 0;
|
||||
|
||||
public DebugTestInformationHandler(Context context) {
|
||||
init(context);
|
||||
if (sActivityLifecycleCallbacks == null) {
|
||||
sActivityLifecycleCallbacks = new Application.ActivityLifecycleCallbacks() {
|
||||
@Override
|
||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
sActivities.put(activity, true);
|
||||
++sActivitiesCreatedCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResumed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityStopped(Activity activity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
}
|
||||
};
|
||||
((Application) context.getApplicationContext())
|
||||
.registerActivityLifecycleCallbacks(sActivityLifecycleCallbacks);
|
||||
}
|
||||
}
|
||||
|
||||
private static void runGcAndFinalizersSync() {
|
||||
Runtime.getRuntime().gc();
|
||||
Runtime.getRuntime().runFinalization();
|
||||
|
||||
final CountDownLatch fence = new CountDownLatch(1);
|
||||
createFinalizationObserver(fence);
|
||||
try {
|
||||
do {
|
||||
Runtime.getRuntime().gc();
|
||||
Runtime.getRuntime().runFinalization();
|
||||
} while (!fence.await(100, TimeUnit.MILLISECONDS));
|
||||
} catch (InterruptedException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
// Create the observer in the scope of a method to minimize the chance that
|
||||
// it remains live in a DEX/machine register at the point of the fence guard.
|
||||
// This must be kept to avoid R8 inlining it.
|
||||
@Keep
|
||||
private static void createFinalizationObserver(CountDownLatch fence) {
|
||||
new Object() {
|
||||
@Override
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
fence.countDown();
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Bundle call(String method, String arg, @Nullable Bundle extras) {
|
||||
final Bundle response = new Bundle();
|
||||
switch (method) {
|
||||
case TestProtocol.REQUEST_APP_LIST_FREEZE_FLAGS: {
|
||||
return getLauncherUIProperty(Bundle::putInt,
|
||||
l -> l.getAppsView().getAppsStore().getDeferUpdatesFlags());
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_ENABLE_DEBUG_TRACING:
|
||||
TestProtocol.sDebugTracing = true;
|
||||
return response;
|
||||
|
||||
case TestProtocol.REQUEST_DISABLE_DEBUG_TRACING:
|
||||
TestProtocol.sDebugTracing = false;
|
||||
return response;
|
||||
|
||||
case TestProtocol.REQUEST_PID: {
|
||||
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, Os.getpid());
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_FORCE_GC: {
|
||||
runGcAndFinalizersSync();
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_START_EVENT_LOGGING: {
|
||||
sEvents = new ArrayList<>();
|
||||
TestLogging.setEventConsumer(
|
||||
(sequence, event) -> {
|
||||
final Collection<String> events = sEvents;
|
||||
if (events != null) {
|
||||
synchronized (events) {
|
||||
events.add(sequence + '/' + event);
|
||||
}
|
||||
}
|
||||
});
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_STOP_EVENT_LOGGING: {
|
||||
TestLogging.setEventConsumer(null);
|
||||
sEvents = null;
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_GET_TEST_EVENTS: {
|
||||
if (sEvents == null) {
|
||||
// sEvents can be null if Launcher died and restarted after
|
||||
// REQUEST_START_EVENT_LOGGING.
|
||||
return response;
|
||||
}
|
||||
|
||||
synchronized (sEvents) {
|
||||
response.putStringArrayList(
|
||||
TestProtocol.TEST_INFO_RESPONSE_FIELD, new ArrayList<>(sEvents));
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_REINITIALIZE_DATA: {
|
||||
final long identity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
MODEL_EXECUTOR.execute(() -> {
|
||||
LauncherModel model = LauncherAppState.getInstance(mContext).getModel();
|
||||
model.getModelDbController().createEmptyDB();
|
||||
MAIN_EXECUTOR.execute(model::forceReload);
|
||||
});
|
||||
return response;
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(identity);
|
||||
}
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_CLEAR_DATA: {
|
||||
final long identity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
MODEL_EXECUTOR.execute(() -> {
|
||||
LauncherModel model = LauncherAppState.getInstance(mContext).getModel();
|
||||
model.getModelDbController().createEmptyDB();
|
||||
model.getModelDbController().clearEmptyDbFlag();
|
||||
MAIN_EXECUTOR.execute(model::forceReload);
|
||||
});
|
||||
return response;
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(identity);
|
||||
}
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_HOTSEAT_ICON_NAMES: {
|
||||
return getLauncherUIProperty(Bundle::putStringArrayList, l -> {
|
||||
ShortcutAndWidgetContainer hotseatIconsContainer =
|
||||
l.getHotseat().getShortcutsAndWidgets();
|
||||
ArrayList<String> hotseatIconNames = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < hotseatIconsContainer.getChildCount(); i++) {
|
||||
// Use unchecked cast to catch changes in hotseat layout
|
||||
BubbleTextView icon = (BubbleTextView) hotseatIconsContainer.getChildAt(i);
|
||||
hotseatIconNames.add((String) icon.getText());
|
||||
}
|
||||
|
||||
return hotseatIconNames;
|
||||
});
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_GET_ACTIVITIES_CREATED_COUNT: {
|
||||
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, sActivitiesCreatedCount);
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_GET_ACTIVITIES: {
|
||||
response.putStringArray(TestProtocol.TEST_INFO_RESPONSE_FIELD,
|
||||
sActivities.keySet().stream().map(
|
||||
a -> a.getClass().getSimpleName() + " ("
|
||||
+ (a.isDestroyed() ? "destroyed" : "current") + ")")
|
||||
.toArray(String[]::new));
|
||||
return response;
|
||||
}
|
||||
|
||||
case TestProtocol.REQUEST_MODEL_QUEUE_CLEARED:
|
||||
return getFromExecutorSync(MODEL_EXECUTOR, Bundle::new);
|
||||
|
||||
default:
|
||||
return super.call(method, arg, extras);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "com.android.launcher3.flags"
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDirs = ['src']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addFrameworkJar('framework-15.jar')
|
||||
compileOnlyCommonJars()
|
||||
@@ -0,0 +1,391 @@
|
||||
package com.android.launcher3;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** @hide */
|
||||
public class CustomFeatureFlags implements FeatureFlags {
|
||||
|
||||
private BiPredicate<String, Predicate<FeatureFlags>> mGetValueImpl;
|
||||
|
||||
public CustomFeatureFlags(BiPredicate<String, Predicate<FeatureFlags>> getValueImpl) {
|
||||
mGetValueImpl = getValueImpl;
|
||||
}
|
||||
@Override
|
||||
public boolean enableAddAppWidgetViaConfigActivityV2() {
|
||||
return getValue(Flags.FLAG_ENABLE_ADD_APP_WIDGET_VIA_CONFIG_ACTIVITY_V2,
|
||||
FeatureFlags::enableAddAppWidgetViaConfigActivityV2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableAdditionalHomeAnimations() {
|
||||
return getValue(Flags.FLAG_ENABLE_ADDITIONAL_HOME_ANIMATIONS,
|
||||
FeatureFlags::enableAdditionalHomeAnimations);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableCategorizedWidgetSuggestions() {
|
||||
return getValue(Flags.FLAG_ENABLE_CATEGORIZED_WIDGET_SUGGESTIONS,
|
||||
FeatureFlags::enableCategorizedWidgetSuggestions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableCursorHoverStates() {
|
||||
return getValue(Flags.FLAG_ENABLE_CURSOR_HOVER_STATES,
|
||||
FeatureFlags::enableCursorHoverStates);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableExpandingPauseWorkButton() {
|
||||
return getValue(Flags.FLAG_ENABLE_EXPANDING_PAUSE_WORK_BUTTON,
|
||||
FeatureFlags::enableExpandingPauseWorkButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableFallbackOverviewInWindow() {
|
||||
return getValue(Flags.FLAG_ENABLE_FALLBACK_OVERVIEW_IN_WINDOW,
|
||||
FeatureFlags::enableFallbackOverviewInWindow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableFirstScreenBroadcastArchivingExtras() {
|
||||
return getValue(Flags.FLAG_ENABLE_FIRST_SCREEN_BROADCAST_ARCHIVING_EXTRAS,
|
||||
FeatureFlags::enableFirstScreenBroadcastArchivingExtras);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableFocusOutline() {
|
||||
return getValue(Flags.FLAG_ENABLE_FOCUS_OUTLINE,
|
||||
FeatureFlags::enableFocusOutline);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableGeneratedPreviews() {
|
||||
return getValue(Flags.FLAG_ENABLE_GENERATED_PREVIEWS,
|
||||
FeatureFlags::enableGeneratedPreviews);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableGridMigrationFix() {
|
||||
return getValue(Flags.FLAG_ENABLE_GRID_MIGRATION_FIX,
|
||||
FeatureFlags::enableGridMigrationFix);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableGridOnlyOverview() {
|
||||
return getValue(Flags.FLAG_ENABLE_GRID_ONLY_OVERVIEW,
|
||||
FeatureFlags::enableGridOnlyOverview);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableHandleDelayedGestureCallbacks() {
|
||||
return getValue(Flags.FLAG_ENABLE_HANDLE_DELAYED_GESTURE_CALLBACKS,
|
||||
FeatureFlags::enableHandleDelayedGestureCallbacks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableHomeTransitionListener() {
|
||||
return getValue(Flags.FLAG_ENABLE_HOME_TRANSITION_LISTENER,
|
||||
FeatureFlags::enableHomeTransitionListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableLauncherBrMetricsFixed() {
|
||||
return getValue(Flags.FLAG_ENABLE_LAUNCHER_BR_METRICS_FIXED,
|
||||
FeatureFlags::enableLauncherBrMetricsFixed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableNarrowGridRestore() {
|
||||
return getValue(Flags.FLAG_ENABLE_NARROW_GRID_RESTORE,
|
||||
FeatureFlags::enableNarrowGridRestore);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableOverviewIconMenu() {
|
||||
return getValue(Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU,
|
||||
FeatureFlags::enableOverviewIconMenu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enablePredictiveBackGesture() {
|
||||
return getValue(Flags.FLAG_ENABLE_PREDICTIVE_BACK_GESTURE,
|
||||
FeatureFlags::enablePredictiveBackGesture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enablePrivateSpace() {
|
||||
return getValue(Flags.FLAG_ENABLE_PRIVATE_SPACE,
|
||||
FeatureFlags::enablePrivateSpace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enablePrivateSpaceInstallShortcut() {
|
||||
return getValue(Flags.FLAG_ENABLE_PRIVATE_SPACE_INSTALL_SHORTCUT,
|
||||
FeatureFlags::enablePrivateSpaceInstallShortcut);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableRebootUnlockAnimation() {
|
||||
return getValue(Flags.FLAG_ENABLE_REBOOT_UNLOCK_ANIMATION,
|
||||
FeatureFlags::enableRebootUnlockAnimation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableRecentsInTaskbar() {
|
||||
return getValue(Flags.FLAG_ENABLE_RECENTS_IN_TASKBAR,
|
||||
FeatureFlags::enableRecentsInTaskbar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableRefactorTaskThumbnail() {
|
||||
return getValue(Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL,
|
||||
FeatureFlags::enableRefactorTaskThumbnail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableResponsiveWorkspace() {
|
||||
return getValue(Flags.FLAG_ENABLE_RESPONSIVE_WORKSPACE,
|
||||
FeatureFlags::enableResponsiveWorkspace);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableScalingRevealHomeAnimation() {
|
||||
return getValue(Flags.FLAG_ENABLE_SCALING_REVEAL_HOME_ANIMATION,
|
||||
FeatureFlags::enableScalingRevealHomeAnimation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableShortcutDontSuggestApp() {
|
||||
return getValue(Flags.FLAG_ENABLE_SHORTCUT_DONT_SUGGEST_APP,
|
||||
FeatureFlags::enableShortcutDontSuggestApp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableSmartspaceAsAWidget() {
|
||||
return getValue(Flags.FLAG_ENABLE_SMARTSPACE_AS_A_WIDGET,
|
||||
FeatureFlags::enableSmartspaceAsAWidget);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableSmartspaceRemovalToggle() {
|
||||
return getValue(Flags.FLAG_ENABLE_SMARTSPACE_REMOVAL_TOGGLE,
|
||||
FeatureFlags::enableSmartspaceRemovalToggle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableSupportForArchiving() {
|
||||
return getValue(Flags.FLAG_ENABLE_SUPPORT_FOR_ARCHIVING,
|
||||
FeatureFlags::enableSupportForArchiving);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTabletTwoPanePickerV2() {
|
||||
return getValue(Flags.FLAG_ENABLE_TABLET_TWO_PANE_PICKER_V2,
|
||||
FeatureFlags::enableTabletTwoPanePickerV2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTaskbarCustomization() {
|
||||
return getValue(Flags.FLAG_ENABLE_TASKBAR_CUSTOMIZATION,
|
||||
FeatureFlags::enableTaskbarCustomization);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTaskbarNoRecreate() {
|
||||
return getValue(Flags.FLAG_ENABLE_TASKBAR_NO_RECREATE,
|
||||
FeatureFlags::enableTaskbarNoRecreate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTaskbarPinning() {
|
||||
return getValue(Flags.FLAG_ENABLE_TASKBAR_PINNING,
|
||||
FeatureFlags::enableTaskbarPinning);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTwoPaneLauncherSettings() {
|
||||
return getValue(Flags.FLAG_ENABLE_TWO_PANE_LAUNCHER_SETTINGS,
|
||||
FeatureFlags::enableTwoPaneLauncherSettings);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTwolineAllapps() {
|
||||
return getValue(Flags.FLAG_ENABLE_TWOLINE_ALLAPPS,
|
||||
FeatureFlags::enableTwolineAllapps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTwolineToggle() {
|
||||
return getValue(Flags.FLAG_ENABLE_TWOLINE_TOGGLE,
|
||||
FeatureFlags::enableTwolineToggle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableUnfoldStateAnimation() {
|
||||
return getValue(Flags.FLAG_ENABLE_UNFOLD_STATE_ANIMATION,
|
||||
FeatureFlags::enableUnfoldStateAnimation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableUnfoldedTwoPanePicker() {
|
||||
return getValue(Flags.FLAG_ENABLE_UNFOLDED_TWO_PANE_PICKER,
|
||||
FeatureFlags::enableUnfoldedTwoPanePicker);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableWidgetTapToAdd() {
|
||||
return getValue(Flags.FLAG_ENABLE_WIDGET_TAP_TO_ADD,
|
||||
FeatureFlags::enableWidgetTapToAdd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableWorkspaceInflation() {
|
||||
return getValue(Flags.FLAG_ENABLE_WORKSPACE_INFLATION,
|
||||
FeatureFlags::enableWorkspaceInflation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enabledFoldersInAllApps() {
|
||||
return getValue(Flags.FLAG_ENABLED_FOLDERS_IN_ALL_APPS,
|
||||
FeatureFlags::enabledFoldersInAllApps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean floatingSearchBar() {
|
||||
return getValue(Flags.FLAG_FLOATING_SEARCH_BAR,
|
||||
FeatureFlags::floatingSearchBar);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean forceMonochromeAppIcons() {
|
||||
return getValue(Flags.FLAG_FORCE_MONOCHROME_APP_ICONS,
|
||||
FeatureFlags::forceMonochromeAppIcons);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceAddFloatingMaskView() {
|
||||
return getValue(Flags.FLAG_PRIVATE_SPACE_ADD_FLOATING_MASK_VIEW,
|
||||
FeatureFlags::privateSpaceAddFloatingMaskView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceAnimation() {
|
||||
return getValue(Flags.FLAG_PRIVATE_SPACE_ANIMATION,
|
||||
FeatureFlags::privateSpaceAnimation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceAppInstallerButton() {
|
||||
return getValue(Flags.FLAG_PRIVATE_SPACE_APP_INSTALLER_BUTTON,
|
||||
FeatureFlags::privateSpaceAppInstallerButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceRestrictAccessibilityDrag() {
|
||||
return getValue(Flags.FLAG_PRIVATE_SPACE_RESTRICT_ACCESSIBILITY_DRAG,
|
||||
FeatureFlags::privateSpaceRestrictAccessibilityDrag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceRestrictItemDrag() {
|
||||
return getValue(Flags.FLAG_PRIVATE_SPACE_RESTRICT_ITEM_DRAG,
|
||||
FeatureFlags::privateSpaceRestrictItemDrag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceSysAppsSeparation() {
|
||||
return getValue(Flags.FLAG_PRIVATE_SPACE_SYS_APPS_SEPARATION,
|
||||
FeatureFlags::privateSpaceSysAppsSeparation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useActivityOverlay() {
|
||||
return getValue(Flags.FLAG_USE_ACTIVITY_OVERLAY,
|
||||
FeatureFlags::useActivityOverlay);
|
||||
}
|
||||
|
||||
public boolean isFlagReadOnlyOptimized(String flagName) {
|
||||
if (mReadOnlyFlagsSet.contains(flagName) &&
|
||||
isOptimizationEnabled()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isOptimizationEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) {
|
||||
return mGetValueImpl.test(flagName, getter);
|
||||
}
|
||||
|
||||
public List<String> getFlagNames() {
|
||||
return Arrays.asList(
|
||||
Flags.FLAG_ENABLE_ADD_APP_WIDGET_VIA_CONFIG_ACTIVITY_V2,
|
||||
Flags.FLAG_ENABLE_ADDITIONAL_HOME_ANIMATIONS,
|
||||
Flags.FLAG_ENABLE_CATEGORIZED_WIDGET_SUGGESTIONS,
|
||||
Flags.FLAG_ENABLE_CURSOR_HOVER_STATES,
|
||||
Flags.FLAG_ENABLE_EXPANDING_PAUSE_WORK_BUTTON,
|
||||
Flags.FLAG_ENABLE_FALLBACK_OVERVIEW_IN_WINDOW,
|
||||
Flags.FLAG_ENABLE_FIRST_SCREEN_BROADCAST_ARCHIVING_EXTRAS,
|
||||
Flags.FLAG_ENABLE_FOCUS_OUTLINE,
|
||||
Flags.FLAG_ENABLE_GENERATED_PREVIEWS,
|
||||
Flags.FLAG_ENABLE_GRID_MIGRATION_FIX,
|
||||
Flags.FLAG_ENABLE_GRID_ONLY_OVERVIEW,
|
||||
Flags.FLAG_ENABLE_HANDLE_DELAYED_GESTURE_CALLBACKS,
|
||||
Flags.FLAG_ENABLE_HOME_TRANSITION_LISTENER,
|
||||
Flags.FLAG_ENABLE_LAUNCHER_BR_METRICS_FIXED,
|
||||
Flags.FLAG_ENABLE_NARROW_GRID_RESTORE,
|
||||
Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU,
|
||||
Flags.FLAG_ENABLE_PREDICTIVE_BACK_GESTURE,
|
||||
Flags.FLAG_ENABLE_PRIVATE_SPACE,
|
||||
Flags.FLAG_ENABLE_PRIVATE_SPACE_INSTALL_SHORTCUT,
|
||||
Flags.FLAG_ENABLE_REBOOT_UNLOCK_ANIMATION,
|
||||
Flags.FLAG_ENABLE_RECENTS_IN_TASKBAR,
|
||||
Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL,
|
||||
Flags.FLAG_ENABLE_RESPONSIVE_WORKSPACE,
|
||||
Flags.FLAG_ENABLE_SCALING_REVEAL_HOME_ANIMATION,
|
||||
Flags.FLAG_ENABLE_SHORTCUT_DONT_SUGGEST_APP,
|
||||
Flags.FLAG_ENABLE_SMARTSPACE_AS_A_WIDGET,
|
||||
Flags.FLAG_ENABLE_SMARTSPACE_REMOVAL_TOGGLE,
|
||||
Flags.FLAG_ENABLE_SUPPORT_FOR_ARCHIVING,
|
||||
Flags.FLAG_ENABLE_TABLET_TWO_PANE_PICKER_V2,
|
||||
Flags.FLAG_ENABLE_TASKBAR_CUSTOMIZATION,
|
||||
Flags.FLAG_ENABLE_TASKBAR_NO_RECREATE,
|
||||
Flags.FLAG_ENABLE_TASKBAR_PINNING,
|
||||
Flags.FLAG_ENABLE_TWO_PANE_LAUNCHER_SETTINGS,
|
||||
Flags.FLAG_ENABLE_TWOLINE_ALLAPPS,
|
||||
Flags.FLAG_ENABLE_TWOLINE_TOGGLE,
|
||||
Flags.FLAG_ENABLE_UNFOLD_STATE_ANIMATION,
|
||||
Flags.FLAG_ENABLE_UNFOLDED_TWO_PANE_PICKER,
|
||||
Flags.FLAG_ENABLE_WIDGET_TAP_TO_ADD,
|
||||
Flags.FLAG_ENABLE_WORKSPACE_INFLATION,
|
||||
Flags.FLAG_ENABLED_FOLDERS_IN_ALL_APPS,
|
||||
Flags.FLAG_FLOATING_SEARCH_BAR,
|
||||
Flags.FLAG_FORCE_MONOCHROME_APP_ICONS,
|
||||
Flags.FLAG_PRIVATE_SPACE_ADD_FLOATING_MASK_VIEW,
|
||||
Flags.FLAG_PRIVATE_SPACE_ANIMATION,
|
||||
Flags.FLAG_PRIVATE_SPACE_APP_INSTALLER_BUTTON,
|
||||
Flags.FLAG_PRIVATE_SPACE_RESTRICT_ACCESSIBILITY_DRAG,
|
||||
Flags.FLAG_PRIVATE_SPACE_RESTRICT_ITEM_DRAG,
|
||||
Flags.FLAG_PRIVATE_SPACE_SYS_APPS_SEPARATION,
|
||||
Flags.FLAG_USE_ACTIVITY_OVERLAY
|
||||
);
|
||||
}
|
||||
|
||||
private Set<String> mReadOnlyFlagsSet = new HashSet<>(
|
||||
Arrays.asList(
|
||||
Flags.FLAG_ENABLE_FIRST_SCREEN_BROADCAST_ARCHIVING_EXTRAS,
|
||||
Flags.FLAG_ENABLE_GRID_MIGRATION_FIX,
|
||||
Flags.FLAG_ENABLE_LAUNCHER_BR_METRICS_FIXED,
|
||||
Flags.FLAG_ENABLE_NARROW_GRID_RESTORE,
|
||||
""
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.android.launcher3;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** @hide */
|
||||
public class FakeFeatureFlagsImpl extends CustomFeatureFlags {
|
||||
private final Map<String, Boolean> mFlagMap = new HashMap<>();
|
||||
private final FeatureFlags mDefaults;
|
||||
|
||||
public FakeFeatureFlagsImpl() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public FakeFeatureFlagsImpl(FeatureFlags defaults) {
|
||||
super(null);
|
||||
mDefaults = defaults;
|
||||
// Initialize the map with null values
|
||||
for (String flagName : getFlagNames()) {
|
||||
mFlagMap.put(flagName, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) {
|
||||
Boolean value = this.mFlagMap.get(flagName);
|
||||
if (value != null) {
|
||||
return value;
|
||||
}
|
||||
if (mDefaults != null) {
|
||||
return getter.test(mDefaults);
|
||||
}
|
||||
throw new IllegalArgumentException(flagName + " is not set");
|
||||
}
|
||||
|
||||
public void setFlag(String flagName, boolean value) {
|
||||
if (!this.mFlagMap.containsKey(flagName)) {
|
||||
throw new IllegalArgumentException("no such flag " + flagName);
|
||||
}
|
||||
this.mFlagMap.put(flagName, value);
|
||||
}
|
||||
|
||||
public void resetAll() {
|
||||
for (Map.Entry entry : mFlagMap.entrySet()) {
|
||||
entry.setValue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.android.launcher3;
|
||||
/** @hide */
|
||||
public interface FeatureFlags {
|
||||
|
||||
|
||||
boolean enableAddAppWidgetViaConfigActivityV2();
|
||||
|
||||
boolean enableAdditionalHomeAnimations();
|
||||
|
||||
boolean enableCategorizedWidgetSuggestions();
|
||||
|
||||
boolean enableCursorHoverStates();
|
||||
|
||||
boolean enableExpandingPauseWorkButton();
|
||||
|
||||
boolean enableFallbackOverviewInWindow();
|
||||
|
||||
boolean enableFirstScreenBroadcastArchivingExtras();
|
||||
|
||||
boolean enableFocusOutline();
|
||||
|
||||
boolean enableGeneratedPreviews();
|
||||
|
||||
boolean enableGridMigrationFix();
|
||||
|
||||
boolean enableGridOnlyOverview();
|
||||
|
||||
boolean enableHandleDelayedGestureCallbacks();
|
||||
|
||||
boolean enableHomeTransitionListener();
|
||||
|
||||
boolean enableLauncherBrMetricsFixed();
|
||||
|
||||
boolean enableNarrowGridRestore();
|
||||
|
||||
boolean enableOverviewIconMenu();
|
||||
|
||||
boolean enablePredictiveBackGesture();
|
||||
|
||||
boolean enablePrivateSpace();
|
||||
|
||||
boolean enablePrivateSpaceInstallShortcut();
|
||||
|
||||
boolean enableRebootUnlockAnimation();
|
||||
|
||||
boolean enableRecentsInTaskbar();
|
||||
|
||||
boolean enableRefactorTaskThumbnail();
|
||||
|
||||
boolean enableResponsiveWorkspace();
|
||||
|
||||
boolean enableScalingRevealHomeAnimation();
|
||||
|
||||
boolean enableShortcutDontSuggestApp();
|
||||
|
||||
boolean enableSmartspaceAsAWidget();
|
||||
|
||||
boolean enableSmartspaceRemovalToggle();
|
||||
|
||||
boolean enableSupportForArchiving();
|
||||
|
||||
boolean enableTabletTwoPanePickerV2();
|
||||
|
||||
boolean enableTaskbarCustomization();
|
||||
|
||||
boolean enableTaskbarNoRecreate();
|
||||
|
||||
boolean enableTaskbarPinning();
|
||||
|
||||
boolean enableTwoPaneLauncherSettings();
|
||||
|
||||
boolean enableTwolineAllapps();
|
||||
|
||||
boolean enableTwolineToggle();
|
||||
|
||||
boolean enableUnfoldStateAnimation();
|
||||
|
||||
boolean enableUnfoldedTwoPanePicker();
|
||||
|
||||
boolean enableWidgetTapToAdd();
|
||||
|
||||
boolean enableWorkspaceInflation();
|
||||
|
||||
boolean enabledFoldersInAllApps();
|
||||
|
||||
boolean floatingSearchBar();
|
||||
|
||||
boolean forceMonochromeAppIcons();
|
||||
|
||||
boolean privateSpaceAddFloatingMaskView();
|
||||
|
||||
boolean privateSpaceAnimation();
|
||||
|
||||
boolean privateSpaceAppInstallerButton();
|
||||
|
||||
boolean privateSpaceRestrictAccessibilityDrag();
|
||||
|
||||
boolean privateSpaceRestrictItemDrag();
|
||||
|
||||
boolean privateSpaceSysAppsSeparation();
|
||||
|
||||
boolean useActivityOverlay();
|
||||
}
|
||||
@@ -0,0 +1,885 @@
|
||||
package com.android.launcher3;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
import com.android.quickstep.util.DeviceConfigHelper;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
/** @hide */
|
||||
public final class FeatureFlagsImpl implements FeatureFlags {
|
||||
private static final boolean isReadFromNew = Files.exists(Paths.get("/metadata/aconfig/boot/enable_only_new_storage"));
|
||||
private static volatile boolean isCached = false;
|
||||
private static volatile boolean launcher_is_cached = false;
|
||||
private static volatile boolean launcher_search_is_cached = false;
|
||||
private static boolean enableAddAppWidgetViaConfigActivityV2 = true;
|
||||
private static boolean enableAdditionalHomeAnimations = true;
|
||||
private static boolean enableCategorizedWidgetSuggestions = true;
|
||||
private static boolean enableCursorHoverStates = true;
|
||||
private static boolean enableExpandingPauseWorkButton = true;
|
||||
private static boolean enableFallbackOverviewInWindow = false;
|
||||
private static boolean enableFocusOutline = true;
|
||||
private static boolean enableGeneratedPreviews = true;
|
||||
private static boolean enableGridOnlyOverview = false;
|
||||
private static boolean enableHandleDelayedGestureCallbacks = true;
|
||||
private static boolean enableHomeTransitionListener = true;
|
||||
private static boolean enableOverviewIconMenu = false;
|
||||
private static boolean enablePredictiveBackGesture = true;
|
||||
private static boolean enablePrivateSpace = true;
|
||||
private static boolean enablePrivateSpaceInstallShortcut = true;
|
||||
private static boolean enableRebootUnlockAnimation = false;
|
||||
private static boolean enableRecentsInTaskbar = false;
|
||||
private static boolean enableRefactorTaskThumbnail = false;
|
||||
private static boolean enableResponsiveWorkspace = true;
|
||||
private static boolean enableScalingRevealHomeAnimation = true;
|
||||
private static boolean enableShortcutDontSuggestApp = true;
|
||||
private static boolean enableSmartspaceAsAWidget = false;
|
||||
private static boolean enableSmartspaceRemovalToggle = false;
|
||||
private static boolean enableSupportForArchiving = false;
|
||||
private static boolean enableTabletTwoPanePickerV2 = false;
|
||||
private static boolean enableTaskbarCustomization = false;
|
||||
private static boolean enableTaskbarNoRecreate = false;
|
||||
private static boolean enableTaskbarPinning = true;
|
||||
private static boolean enableTwoPaneLauncherSettings = false;
|
||||
private static boolean enableTwolineAllapps = false;
|
||||
private static boolean enableTwolineToggle = true;
|
||||
private static boolean enableUnfoldStateAnimation = false;
|
||||
private static boolean enableUnfoldedTwoPanePicker = true;
|
||||
private static boolean enableWidgetTapToAdd = true;
|
||||
private static boolean enableWorkspaceInflation = true;
|
||||
private static boolean enabledFoldersInAllApps = false;
|
||||
private static boolean floatingSearchBar = false;
|
||||
private static boolean forceMonochromeAppIcons = false;
|
||||
private static boolean privateSpaceAddFloatingMaskView = false;
|
||||
private static boolean privateSpaceAnimation = true;
|
||||
private static boolean privateSpaceAppInstallerButton = true;
|
||||
private static boolean privateSpaceRestrictAccessibilityDrag = true;
|
||||
private static boolean privateSpaceRestrictItemDrag = true;
|
||||
private static boolean privateSpaceSysAppsSeparation = true;
|
||||
private static boolean useActivityOverlay = true;
|
||||
|
||||
|
||||
private void init() {
|
||||
isCached = true;
|
||||
}
|
||||
|
||||
private void load_overrides_launcher() {
|
||||
try {
|
||||
var properties = DeviceConfigHelper.Companion.getPrefs();
|
||||
enableAddAppWidgetViaConfigActivityV2 =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_ADD_APP_WIDGET_VIA_CONFIG_ACTIVITY_V2, true);
|
||||
enableAdditionalHomeAnimations =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_ADDITIONAL_HOME_ANIMATIONS, true);
|
||||
enableCategorizedWidgetSuggestions =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_CATEGORIZED_WIDGET_SUGGESTIONS, true);
|
||||
enableCursorHoverStates =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_CURSOR_HOVER_STATES, true);
|
||||
enableExpandingPauseWorkButton =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_EXPANDING_PAUSE_WORK_BUTTON, true);
|
||||
enableFallbackOverviewInWindow =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_FALLBACK_OVERVIEW_IN_WINDOW, false);
|
||||
enableFocusOutline =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_FOCUS_OUTLINE, true);
|
||||
enableGeneratedPreviews =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_GENERATED_PREVIEWS, true);
|
||||
enableGridOnlyOverview =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_GRID_ONLY_OVERVIEW, false);
|
||||
enableHandleDelayedGestureCallbacks =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_HANDLE_DELAYED_GESTURE_CALLBACKS, true);
|
||||
enableHomeTransitionListener =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_HOME_TRANSITION_LISTENER, true);
|
||||
enableOverviewIconMenu =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU, false);
|
||||
enablePredictiveBackGesture =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_PREDICTIVE_BACK_GESTURE, true);
|
||||
enablePrivateSpaceInstallShortcut =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_PRIVATE_SPACE_INSTALL_SHORTCUT, true);
|
||||
enableRebootUnlockAnimation =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_REBOOT_UNLOCK_ANIMATION, false);
|
||||
enableRecentsInTaskbar =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_RECENTS_IN_TASKBAR, false);
|
||||
enableRefactorTaskThumbnail =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL, false);
|
||||
enableResponsiveWorkspace =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_RESPONSIVE_WORKSPACE, true);
|
||||
enableScalingRevealHomeAnimation =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_SCALING_REVEAL_HOME_ANIMATION, true);
|
||||
enableShortcutDontSuggestApp =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_SHORTCUT_DONT_SUGGEST_APP, true);
|
||||
enableSmartspaceAsAWidget =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_SMARTSPACE_AS_A_WIDGET, false);
|
||||
enableSmartspaceRemovalToggle =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_SMARTSPACE_REMOVAL_TOGGLE, false);
|
||||
enableSupportForArchiving =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_SUPPORT_FOR_ARCHIVING, false);
|
||||
enableTabletTwoPanePickerV2 =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_TABLET_TWO_PANE_PICKER_V2, false);
|
||||
enableTaskbarCustomization =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_TASKBAR_CUSTOMIZATION, false);
|
||||
enableTaskbarNoRecreate =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_TASKBAR_NO_RECREATE, false);
|
||||
enableTaskbarPinning =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_TASKBAR_PINNING, true);
|
||||
enableTwoPaneLauncherSettings =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_TWO_PANE_LAUNCHER_SETTINGS, false);
|
||||
enableTwolineAllapps =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_TWOLINE_ALLAPPS, false);
|
||||
enableTwolineToggle =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_TWOLINE_TOGGLE, true);
|
||||
enableUnfoldStateAnimation =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_UNFOLD_STATE_ANIMATION, false);
|
||||
enableUnfoldedTwoPanePicker =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_UNFOLDED_TWO_PANE_PICKER, true);
|
||||
enableWidgetTapToAdd =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_WIDGET_TAP_TO_ADD, true);
|
||||
enableWorkspaceInflation =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_WORKSPACE_INFLATION, true);
|
||||
enabledFoldersInAllApps =
|
||||
properties.getBoolean(Flags.FLAG_ENABLED_FOLDERS_IN_ALL_APPS, false);
|
||||
floatingSearchBar =
|
||||
properties.getBoolean(Flags.FLAG_FLOATING_SEARCH_BAR, false);
|
||||
forceMonochromeAppIcons =
|
||||
properties.getBoolean(Flags.FLAG_FORCE_MONOCHROME_APP_ICONS, false);
|
||||
useActivityOverlay =
|
||||
properties.getBoolean(Flags.FLAG_USE_ACTIVITY_OVERLAY, true);
|
||||
} catch (NullPointerException e) {
|
||||
throw new RuntimeException(
|
||||
"Cannot read value from namespace launcher "
|
||||
+ "from DeviceConfig. It could be that the code using flag "
|
||||
+ "executed before SettingsProvider initialization. Please use "
|
||||
+ "fixed read-only flag by adding is_fixed_read_only: true in "
|
||||
+ "flag declaration.",
|
||||
e
|
||||
);
|
||||
}
|
||||
launcher_is_cached = true;
|
||||
}
|
||||
|
||||
private void load_overrides_launcher_search() {
|
||||
try {
|
||||
var properties = DeviceConfigHelper.Companion.getPrefs();
|
||||
enablePrivateSpace =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_PRIVATE_SPACE, true);
|
||||
privateSpaceAddFloatingMaskView =
|
||||
properties.getBoolean(Flags.FLAG_PRIVATE_SPACE_ADD_FLOATING_MASK_VIEW, false);
|
||||
privateSpaceAnimation =
|
||||
properties.getBoolean(Flags.FLAG_PRIVATE_SPACE_ANIMATION, true);
|
||||
privateSpaceAppInstallerButton =
|
||||
properties.getBoolean(Flags.FLAG_PRIVATE_SPACE_APP_INSTALLER_BUTTON, true);
|
||||
privateSpaceRestrictAccessibilityDrag =
|
||||
properties.getBoolean(Flags.FLAG_PRIVATE_SPACE_RESTRICT_ACCESSIBILITY_DRAG, true);
|
||||
privateSpaceRestrictItemDrag =
|
||||
properties.getBoolean(Flags.FLAG_PRIVATE_SPACE_RESTRICT_ITEM_DRAG, true);
|
||||
privateSpaceSysAppsSeparation =
|
||||
properties.getBoolean(Flags.FLAG_PRIVATE_SPACE_SYS_APPS_SEPARATION, true);
|
||||
} catch (NullPointerException e) {
|
||||
throw new RuntimeException(
|
||||
"Cannot read value from namespace launcher_search "
|
||||
+ "from DeviceConfig. It could be that the code using flag "
|
||||
+ "executed before SettingsProvider initialization. Please use "
|
||||
+ "fixed read-only flag by adding is_fixed_read_only: true in "
|
||||
+ "flag declaration.",
|
||||
e
|
||||
);
|
||||
}
|
||||
launcher_search_is_cached = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableAddAppWidgetViaConfigActivityV2() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableAddAppWidgetViaConfigActivityV2;
|
||||
|
||||
}
|
||||
|
||||
public boolean enableAdditionalHomeAnimations() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableAdditionalHomeAnimations;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableCategorizedWidgetSuggestions() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableCategorizedWidgetSuggestions;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableCursorHoverStates() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableCursorHoverStates;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableExpandingPauseWorkButton() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableExpandingPauseWorkButton;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableFallbackOverviewInWindow() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableFallbackOverviewInWindow;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableFirstScreenBroadcastArchivingExtras() {
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableFocusOutline() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableFocusOutline;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableGeneratedPreviews() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableGeneratedPreviews;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableGridMigrationFix() {
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableGridOnlyOverview() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableGridOnlyOverview;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableHandleDelayedGestureCallbacks() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableHandleDelayedGestureCallbacks;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableHomeTransitionListener() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableHomeTransitionListener;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableLauncherBrMetricsFixed() {
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableNarrowGridRestore() {
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableOverviewIconMenu() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableOverviewIconMenu;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enablePredictiveBackGesture() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enablePredictiveBackGesture;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enablePrivateSpace() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_search_is_cached) {
|
||||
load_overrides_launcher_search();
|
||||
}
|
||||
}
|
||||
return enablePrivateSpace;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enablePrivateSpaceInstallShortcut() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enablePrivateSpaceInstallShortcut;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableRebootUnlockAnimation() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableRebootUnlockAnimation;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableRecentsInTaskbar() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableRecentsInTaskbar;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableRefactorTaskThumbnail() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableRefactorTaskThumbnail;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableResponsiveWorkspace() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableResponsiveWorkspace;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableScalingRevealHomeAnimation() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableScalingRevealHomeAnimation;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableShortcutDontSuggestApp() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableShortcutDontSuggestApp;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableSmartspaceAsAWidget() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableSmartspaceAsAWidget;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableSmartspaceRemovalToggle() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableSmartspaceRemovalToggle;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableSupportForArchiving() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableSupportForArchiving;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTabletTwoPanePickerV2() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableTabletTwoPanePickerV2;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTaskbarCustomization() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableTaskbarCustomization;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTaskbarNoRecreate() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableTaskbarNoRecreate;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTaskbarPinning() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableTaskbarPinning;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTwoPaneLauncherSettings() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableTwoPaneLauncherSettings;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTwolineAllapps() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableTwolineAllapps;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableTwolineToggle() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableTwolineToggle;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableUnfoldStateAnimation() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableUnfoldStateAnimation;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableUnfoldedTwoPanePicker() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableUnfoldedTwoPanePicker;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableWidgetTapToAdd() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableWidgetTapToAdd;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enableWorkspaceInflation() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enableWorkspaceInflation;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enabledFoldersInAllApps() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return enabledFoldersInAllApps;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean floatingSearchBar() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return floatingSearchBar;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean forceMonochromeAppIcons() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return forceMonochromeAppIcons;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceAddFloatingMaskView() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_search_is_cached) {
|
||||
load_overrides_launcher_search();
|
||||
}
|
||||
}
|
||||
return privateSpaceAddFloatingMaskView;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceAnimation() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_search_is_cached) {
|
||||
load_overrides_launcher_search();
|
||||
}
|
||||
}
|
||||
return privateSpaceAnimation;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceAppInstallerButton() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_search_is_cached) {
|
||||
load_overrides_launcher_search();
|
||||
}
|
||||
}
|
||||
return privateSpaceAppInstallerButton;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceRestrictAccessibilityDrag() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_search_is_cached) {
|
||||
load_overrides_launcher_search();
|
||||
}
|
||||
}
|
||||
return privateSpaceRestrictAccessibilityDrag;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceRestrictItemDrag() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_search_is_cached) {
|
||||
load_overrides_launcher_search();
|
||||
}
|
||||
}
|
||||
return privateSpaceRestrictItemDrag;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean privateSpaceSysAppsSeparation() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_search_is_cached) {
|
||||
load_overrides_launcher_search();
|
||||
}
|
||||
}
|
||||
return privateSpaceSysAppsSeparation;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean useActivityOverlay() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!launcher_is_cached) {
|
||||
load_overrides_launcher();
|
||||
}
|
||||
}
|
||||
return useActivityOverlay;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,302 @@
|
||||
package com.android.launcher3;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
/** @hide */
|
||||
public final class Flags {
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_ADD_APP_WIDGET_VIA_CONFIG_ACTIVITY_V2 = "com.android.launcher3.enable_add_app_widget_via_config_activity_v2";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_ADDITIONAL_HOME_ANIMATIONS = "com.android.launcher3.enable_additional_home_animations";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_CATEGORIZED_WIDGET_SUGGESTIONS = "com.android.launcher3.enable_categorized_widget_suggestions";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_CURSOR_HOVER_STATES = "com.android.launcher3.enable_cursor_hover_states";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_EXPANDING_PAUSE_WORK_BUTTON = "com.android.launcher3.enable_expanding_pause_work_button";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_FALLBACK_OVERVIEW_IN_WINDOW = "com.android.launcher3.enable_fallback_overview_in_window";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_FIRST_SCREEN_BROADCAST_ARCHIVING_EXTRAS = "com.android.launcher3.enable_first_screen_broadcast_archiving_extras";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_FOCUS_OUTLINE = "com.android.launcher3.enable_focus_outline";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_GENERATED_PREVIEWS = "com.android.launcher3.enable_generated_previews";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_GRID_MIGRATION_FIX = "com.android.launcher3.enable_grid_migration_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_GRID_ONLY_OVERVIEW = "com.android.launcher3.enable_grid_only_overview";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_HANDLE_DELAYED_GESTURE_CALLBACKS = "com.android.launcher3.enable_handle_delayed_gesture_callbacks";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_HOME_TRANSITION_LISTENER = "com.android.launcher3.enable_home_transition_listener";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_LAUNCHER_BR_METRICS_FIXED = "com.android.launcher3.enable_launcher_br_metrics_fixed";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_NARROW_GRID_RESTORE = "com.android.launcher3.enable_narrow_grid_restore";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_OVERVIEW_ICON_MENU = "com.android.launcher3.enable_overview_icon_menu";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_PREDICTIVE_BACK_GESTURE = "com.android.launcher3.enable_predictive_back_gesture";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_PRIVATE_SPACE = "com.android.launcher3.enable_private_space";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_PRIVATE_SPACE_INSTALL_SHORTCUT = "com.android.launcher3.enable_private_space_install_shortcut";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_REBOOT_UNLOCK_ANIMATION = "com.android.launcher3.enable_reboot_unlock_animation";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_RECENTS_IN_TASKBAR = "com.android.launcher3.enable_recents_in_taskbar";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_REFACTOR_TASK_THUMBNAIL = "com.android.launcher3.enable_refactor_task_thumbnail";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_RESPONSIVE_WORKSPACE = "com.android.launcher3.enable_responsive_workspace";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_SCALING_REVEAL_HOME_ANIMATION = "com.android.launcher3.enable_scaling_reveal_home_animation";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_SHORTCUT_DONT_SUGGEST_APP = "com.android.launcher3.enable_shortcut_dont_suggest_app";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_SMARTSPACE_AS_A_WIDGET = "com.android.launcher3.enable_smartspace_as_a_widget";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_SMARTSPACE_REMOVAL_TOGGLE = "com.android.launcher3.enable_smartspace_removal_toggle";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_SUPPORT_FOR_ARCHIVING = "com.android.launcher3.enable_support_for_archiving";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TABLET_TWO_PANE_PICKER_V2 = "com.android.launcher3.enable_tablet_two_pane_picker_v2";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TASKBAR_CUSTOMIZATION = "com.android.launcher3.enable_taskbar_customization";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TASKBAR_NO_RECREATE = "com.android.launcher3.enable_taskbar_no_recreate";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TASKBAR_PINNING = "com.android.launcher3.enable_taskbar_pinning";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TWO_PANE_LAUNCHER_SETTINGS = "com.android.launcher3.enable_two_pane_launcher_settings";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TWOLINE_ALLAPPS = "com.android.launcher3.enable_twoline_allapps";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TWOLINE_TOGGLE = "com.android.launcher3.enable_twoline_toggle";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_UNFOLD_STATE_ANIMATION = "com.android.launcher3.enable_unfold_state_animation";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_UNFOLDED_TWO_PANE_PICKER = "com.android.launcher3.enable_unfolded_two_pane_picker";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_WIDGET_TAP_TO_ADD = "com.android.launcher3.enable_widget_tap_to_add";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_WORKSPACE_INFLATION = "com.android.launcher3.enable_workspace_inflation";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLED_FOLDERS_IN_ALL_APPS = "com.android.launcher3.enabled_folders_in_all_apps";
|
||||
/** @hide */
|
||||
public static final String FLAG_FLOATING_SEARCH_BAR = "com.android.launcher3.floating_search_bar";
|
||||
/** @hide */
|
||||
public static final String FLAG_FORCE_MONOCHROME_APP_ICONS = "com.android.launcher3.force_monochrome_app_icons";
|
||||
/** @hide */
|
||||
public static final String FLAG_PRIVATE_SPACE_ADD_FLOATING_MASK_VIEW = "com.android.launcher3.private_space_add_floating_mask_view";
|
||||
/** @hide */
|
||||
public static final String FLAG_PRIVATE_SPACE_ANIMATION = "com.android.launcher3.private_space_animation";
|
||||
/** @hide */
|
||||
public static final String FLAG_PRIVATE_SPACE_APP_INSTALLER_BUTTON = "com.android.launcher3.private_space_app_installer_button";
|
||||
/** @hide */
|
||||
public static final String FLAG_PRIVATE_SPACE_RESTRICT_ACCESSIBILITY_DRAG = "com.android.launcher3.private_space_restrict_accessibility_drag";
|
||||
/** @hide */
|
||||
public static final String FLAG_PRIVATE_SPACE_RESTRICT_ITEM_DRAG = "com.android.launcher3.private_space_restrict_item_drag";
|
||||
/** @hide */
|
||||
public static final String FLAG_PRIVATE_SPACE_SYS_APPS_SEPARATION = "com.android.launcher3.private_space_sys_apps_separation";
|
||||
/** @hide */
|
||||
public static final String FLAG_USE_ACTIVITY_OVERLAY = "com.android.launcher3.use_activity_overlay";
|
||||
|
||||
public static boolean enableAddAppWidgetViaConfigActivityV2() {
|
||||
return FEATURE_FLAGS.enableAddAppWidgetViaConfigActivityV2();
|
||||
}
|
||||
|
||||
public static boolean enableAdditionalHomeAnimations() {
|
||||
return FEATURE_FLAGS.enableAdditionalHomeAnimations();
|
||||
}
|
||||
|
||||
public static boolean enableCategorizedWidgetSuggestions() {
|
||||
return FEATURE_FLAGS.enableCategorizedWidgetSuggestions();
|
||||
}
|
||||
|
||||
public static boolean enableCursorHoverStates() {
|
||||
return FEATURE_FLAGS.enableCursorHoverStates();
|
||||
}
|
||||
|
||||
public static boolean enableExpandingPauseWorkButton() {
|
||||
return FEATURE_FLAGS.enableExpandingPauseWorkButton();
|
||||
}
|
||||
|
||||
public static boolean enableFallbackOverviewInWindow() {
|
||||
return FEATURE_FLAGS.enableFallbackOverviewInWindow();
|
||||
}
|
||||
|
||||
public static boolean enableFirstScreenBroadcastArchivingExtras() {
|
||||
return FEATURE_FLAGS.enableFirstScreenBroadcastArchivingExtras();
|
||||
}
|
||||
|
||||
public static boolean enableFocusOutline() {
|
||||
return FEATURE_FLAGS.enableFocusOutline();
|
||||
}
|
||||
|
||||
public static boolean enableGeneratedPreviews() {
|
||||
return FEATURE_FLAGS.enableGeneratedPreviews();
|
||||
}
|
||||
|
||||
public static boolean enableGridMigrationFix() {
|
||||
return FEATURE_FLAGS.enableGridMigrationFix();
|
||||
}
|
||||
|
||||
public static boolean enableGridOnlyOverview() {
|
||||
return FEATURE_FLAGS.enableGridOnlyOverview();
|
||||
}
|
||||
|
||||
public static boolean enableHandleDelayedGestureCallbacks() {
|
||||
return FEATURE_FLAGS.enableHandleDelayedGestureCallbacks();
|
||||
}
|
||||
|
||||
public static boolean enableHomeTransitionListener() {
|
||||
return FEATURE_FLAGS.enableHomeTransitionListener();
|
||||
}
|
||||
|
||||
public static boolean enableLauncherBrMetricsFixed() {
|
||||
return FEATURE_FLAGS.enableLauncherBrMetricsFixed();
|
||||
}
|
||||
|
||||
public static boolean enableNarrowGridRestore() {
|
||||
return FEATURE_FLAGS.enableNarrowGridRestore();
|
||||
}
|
||||
|
||||
public static boolean enableOverviewIconMenu() {
|
||||
return FEATURE_FLAGS.enableOverviewIconMenu();
|
||||
}
|
||||
|
||||
public static boolean enablePredictiveBackGesture() {
|
||||
return FEATURE_FLAGS.enablePredictiveBackGesture();
|
||||
}
|
||||
|
||||
public static boolean enablePrivateSpace() {
|
||||
return FEATURE_FLAGS.enablePrivateSpace();
|
||||
}
|
||||
|
||||
public static boolean enablePrivateSpaceInstallShortcut() {
|
||||
return FEATURE_FLAGS.enablePrivateSpaceInstallShortcut();
|
||||
}
|
||||
|
||||
public static boolean enableRebootUnlockAnimation() {
|
||||
return FEATURE_FLAGS.enableRebootUnlockAnimation();
|
||||
}
|
||||
|
||||
public static boolean enableRecentsInTaskbar() {
|
||||
return FEATURE_FLAGS.enableRecentsInTaskbar();
|
||||
}
|
||||
|
||||
public static boolean enableRefactorTaskThumbnail() {
|
||||
return FEATURE_FLAGS.enableRefactorTaskThumbnail();
|
||||
}
|
||||
|
||||
public static boolean enableResponsiveWorkspace() {
|
||||
return FEATURE_FLAGS.enableResponsiveWorkspace();
|
||||
}
|
||||
|
||||
public static boolean enableScalingRevealHomeAnimation() {
|
||||
return FEATURE_FLAGS.enableScalingRevealHomeAnimation();
|
||||
}
|
||||
|
||||
public static boolean enableShortcutDontSuggestApp() {
|
||||
return FEATURE_FLAGS.enableShortcutDontSuggestApp();
|
||||
}
|
||||
|
||||
public static boolean enableSmartspaceAsAWidget() {
|
||||
return FEATURE_FLAGS.enableSmartspaceAsAWidget();
|
||||
}
|
||||
|
||||
public static boolean enableSmartspaceRemovalToggle() {
|
||||
return FEATURE_FLAGS.enableSmartspaceRemovalToggle();
|
||||
}
|
||||
|
||||
public static boolean enableSupportForArchiving() {
|
||||
return FEATURE_FLAGS.enableSupportForArchiving();
|
||||
}
|
||||
|
||||
public static boolean enableTabletTwoPanePickerV2() {
|
||||
return FEATURE_FLAGS.enableTabletTwoPanePickerV2();
|
||||
}
|
||||
|
||||
public static boolean enableTaskbarCustomization() {
|
||||
return FEATURE_FLAGS.enableTaskbarCustomization();
|
||||
}
|
||||
|
||||
public static boolean enableTaskbarNoRecreate() {
|
||||
return FEATURE_FLAGS.enableTaskbarNoRecreate();
|
||||
}
|
||||
|
||||
public static boolean enableTaskbarPinning() {
|
||||
return FEATURE_FLAGS.enableTaskbarPinning();
|
||||
}
|
||||
|
||||
public static boolean enableTwoPaneLauncherSettings() {
|
||||
return FEATURE_FLAGS.enableTwoPaneLauncherSettings();
|
||||
}
|
||||
|
||||
public static boolean enableTwolineAllapps() {
|
||||
return FEATURE_FLAGS.enableTwolineAllapps();
|
||||
}
|
||||
|
||||
public static boolean enableTwolineToggle() {
|
||||
return FEATURE_FLAGS.enableTwolineToggle();
|
||||
}
|
||||
|
||||
public static boolean enableUnfoldStateAnimation() {
|
||||
return FEATURE_FLAGS.enableUnfoldStateAnimation();
|
||||
}
|
||||
|
||||
public static boolean enableUnfoldedTwoPanePicker() {
|
||||
return FEATURE_FLAGS.enableUnfoldedTwoPanePicker();
|
||||
}
|
||||
|
||||
public static boolean enableWidgetTapToAdd() {
|
||||
return FEATURE_FLAGS.enableWidgetTapToAdd();
|
||||
}
|
||||
|
||||
public static boolean enableWorkspaceInflation() {
|
||||
return FEATURE_FLAGS.enableWorkspaceInflation();
|
||||
}
|
||||
|
||||
public static boolean enabledFoldersInAllApps() {
|
||||
return FEATURE_FLAGS.enabledFoldersInAllApps();
|
||||
}
|
||||
|
||||
public static boolean floatingSearchBar() {
|
||||
return FEATURE_FLAGS.floatingSearchBar();
|
||||
}
|
||||
|
||||
public static boolean forceMonochromeAppIcons() {
|
||||
return FEATURE_FLAGS.forceMonochromeAppIcons();
|
||||
}
|
||||
|
||||
public static boolean privateSpaceAddFloatingMaskView() {
|
||||
return FEATURE_FLAGS.privateSpaceAddFloatingMaskView();
|
||||
}
|
||||
|
||||
public static boolean privateSpaceAnimation() {
|
||||
return FEATURE_FLAGS.privateSpaceAnimation();
|
||||
}
|
||||
|
||||
public static boolean privateSpaceAppInstallerButton() {
|
||||
return FEATURE_FLAGS.privateSpaceAppInstallerButton();
|
||||
}
|
||||
|
||||
public static boolean privateSpaceRestrictAccessibilityDrag() {
|
||||
return FEATURE_FLAGS.privateSpaceRestrictAccessibilityDrag();
|
||||
}
|
||||
|
||||
public static boolean privateSpaceRestrictItemDrag() {
|
||||
return FEATURE_FLAGS.privateSpaceRestrictItemDrag();
|
||||
}
|
||||
|
||||
public static boolean privateSpaceSysAppsSeparation() {
|
||||
return FEATURE_FLAGS.privateSpaceSysAppsSeparation();
|
||||
}
|
||||
|
||||
public static boolean useActivityOverlay() {
|
||||
return FEATURE_FLAGS.useActivityOverlay();
|
||||
}
|
||||
|
||||
private static FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright (C) 2024 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.quickstep.util
|
||||
|
||||
import android.app.ActivityThread
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.content.SharedPreferences.OnSharedPreferenceChangeListener
|
||||
import androidx.annotation.WorkerThread
|
||||
|
||||
/** Utility class to manage a set of device configurations */
|
||||
class DeviceConfigHelper<ConfigType>(private val factory: (PropReader) -> ConfigType) {
|
||||
|
||||
var config: ConfigType
|
||||
private set
|
||||
private val allKeys: Set<String>
|
||||
private val sharedPrefChangeListener = OnSharedPreferenceChangeListener { _, _ ->
|
||||
recreateConfig()
|
||||
}
|
||||
|
||||
private val changeListeners = mutableListOf<Runnable>()
|
||||
|
||||
init {
|
||||
// Initialize the default config once.
|
||||
allKeys = HashSet()
|
||||
config = factory(
|
||||
PropReader(
|
||||
object : PropProvider {
|
||||
override fun <T : Any> get(key: String, fallback: T): T {
|
||||
val prefs = prefs
|
||||
allKeys.add(key)
|
||||
return when (fallback) {
|
||||
is Int -> prefs.getInt(key, fallback) as T
|
||||
is Boolean -> prefs.getBoolean(key, fallback) as T
|
||||
else -> fallback
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
prefs.registerOnSharedPreferenceChangeListener(sharedPrefChangeListener)
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private fun onDevicePropsChanges() {
|
||||
recreateConfig()
|
||||
}
|
||||
|
||||
private fun recreateConfig() {
|
||||
config = factory(
|
||||
PropReader(
|
||||
object : PropProvider {
|
||||
override fun <T : Any> get(key: String, fallback: T): T {
|
||||
return when (fallback) {
|
||||
is Int -> prefs.getInt(key, fallback) as T
|
||||
is Boolean -> prefs.getBoolean(key, fallback) as T
|
||||
else -> fallback
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/** Adds a listener for property changes */
|
||||
fun addChangeListener(r: Runnable) = changeListeners.add(r)
|
||||
|
||||
/** Removes a previously added listener */
|
||||
fun removeChangeListener(r: Runnable) = changeListeners.remove(r)
|
||||
|
||||
fun close() {
|
||||
prefs.unregisterOnSharedPreferenceChangeListener(sharedPrefChangeListener)
|
||||
}
|
||||
|
||||
internal interface PropProvider {
|
||||
fun <T : Any> get(key: String, fallback: T): T
|
||||
}
|
||||
|
||||
/** The reader is sent to the config for initialization */
|
||||
class PropReader internal constructor(private val f: PropProvider) {
|
||||
|
||||
@JvmOverloads
|
||||
fun <T : Any> get(key: String, fallback: T, desc: String? = null): T {
|
||||
val v = f.get(key, fallback)
|
||||
if (desc != null) {
|
||||
if (v is Int) {
|
||||
allProps[key] = DebugInfo(key, desc, true, fallback)
|
||||
return prefs.getInt(key, v) as T
|
||||
} else if (v is Boolean) {
|
||||
allProps[key] = DebugInfo(key, desc, false, fallback)
|
||||
return prefs.getBoolean(key, v) as T
|
||||
}
|
||||
}
|
||||
return v
|
||||
}
|
||||
}
|
||||
|
||||
class DebugInfo<T>(
|
||||
val key: String,
|
||||
val desc: String,
|
||||
val isInt: Boolean,
|
||||
val valueInCode: T,
|
||||
)
|
||||
|
||||
companion object {
|
||||
const val NAMESPACE_LAUNCHER = "launcher"
|
||||
|
||||
val allProps = mutableMapOf<String, DebugInfo<*>>()
|
||||
|
||||
private const val FLAGS_PREF_NAME = "featureFlags"
|
||||
|
||||
val prefs: SharedPreferences by lazy {
|
||||
ActivityThread.currentApplication()
|
||||
.createDeviceProtectedStorageContext()
|
||||
.getSharedPreferences(FLAGS_PREF_NAME, Context.MODE_PRIVATE)
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,49 @@
|
||||
package com.android.systemui;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** @hide */
|
||||
public class FakeFeatureFlagsImpl extends CustomFeatureFlags {
|
||||
private final Map<String, Boolean> mFlagMap = new HashMap<>();
|
||||
private final FeatureFlags mDefaults;
|
||||
|
||||
public FakeFeatureFlagsImpl() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public FakeFeatureFlagsImpl(FeatureFlags defaults) {
|
||||
super(null);
|
||||
mDefaults = defaults;
|
||||
// Initialize the map with null values
|
||||
for (String flagName : getFlagNames()) {
|
||||
mFlagMap.put(flagName, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) {
|
||||
Boolean value = this.mFlagMap.get(flagName);
|
||||
if (value != null) {
|
||||
return value;
|
||||
}
|
||||
if (mDefaults != null) {
|
||||
return getter.test(mDefaults);
|
||||
}
|
||||
throw new IllegalArgumentException(flagName + " is not set");
|
||||
}
|
||||
|
||||
public void setFlag(String flagName, boolean value) {
|
||||
if (!this.mFlagMap.containsKey(flagName)) {
|
||||
throw new IllegalArgumentException("no such flag " + flagName);
|
||||
}
|
||||
this.mFlagMap.put(flagName, value);
|
||||
}
|
||||
|
||||
public void resetAll() {
|
||||
for (Map.Entry entry : mFlagMap.entrySet()) {
|
||||
entry.setValue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
package com.android.systemui;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
/** @hide */
|
||||
public interface FeatureFlags {
|
||||
|
||||
|
||||
boolean activityTransitionUseLargestWindow();
|
||||
|
||||
boolean ambientTouchMonitorListenToDisplayChanges();
|
||||
|
||||
boolean appClipsBacklinks();
|
||||
|
||||
boolean bindKeyguardMediaVisibility();
|
||||
|
||||
boolean bpTalkback();
|
||||
|
||||
boolean brightnessSliderFocusState();
|
||||
|
||||
boolean centralizedStatusBarHeightFix();
|
||||
|
||||
boolean clipboardNoninteractiveOnLockscreen();
|
||||
|
||||
boolean clockReactiveVariants();
|
||||
|
||||
boolean communalBouncerDoNotModifyPluginOpen();
|
||||
|
||||
boolean communalHub();
|
||||
|
||||
boolean composeBouncer();
|
||||
|
||||
boolean composeLockscreen();
|
||||
|
||||
boolean confineNotificationTouchToViewWidth();
|
||||
|
||||
boolean constraintBp();
|
||||
|
||||
boolean contextualTipsAssistantDismissFix();
|
||||
|
||||
boolean coroutineTracing();
|
||||
|
||||
boolean createWindowlessWindowMagnifier();
|
||||
|
||||
boolean dedicatedNotifInflationThread();
|
||||
|
||||
boolean delayShowMagnificationButton();
|
||||
|
||||
boolean delayedWakelockReleaseOnBackgroundThread();
|
||||
|
||||
boolean deviceEntryUdfpsRefactor();
|
||||
|
||||
boolean disableContextualTipsFrequencyCheck();
|
||||
|
||||
boolean disableContextualTipsIosSwitcherCheck();
|
||||
|
||||
boolean dozeuiSchedulingAlarmsBackgroundExecution();
|
||||
|
||||
boolean dreamInputSessionPilferOnce();
|
||||
|
||||
boolean dreamOverlayBouncerSwipeDirectionFiltering();
|
||||
|
||||
boolean dualShade();
|
||||
|
||||
boolean edgeBackGestureHandlerThread();
|
||||
|
||||
boolean edgebackGestureHandlerGetRunningTasksBackground();
|
||||
|
||||
boolean enableBackgroundKeyguardOndrawnCallback();
|
||||
|
||||
boolean enableContextualTipForMuteVolume();
|
||||
|
||||
boolean enableContextualTipForPowerOff();
|
||||
|
||||
boolean enableContextualTipForTakeScreenshot();
|
||||
|
||||
boolean enableContextualTips();
|
||||
|
||||
boolean enableEfficientDisplayRepository();
|
||||
|
||||
boolean enableLayoutTracing();
|
||||
|
||||
boolean enableViewCaptureTracing();
|
||||
|
||||
boolean enableWidgetPickerSizeFilter();
|
||||
|
||||
boolean enforceBrightnessBaseUserRestriction();
|
||||
|
||||
boolean exampleFlag();
|
||||
|
||||
boolean fastUnlockTransition();
|
||||
|
||||
boolean fixImageWallpaperCrashSurfaceAlreadyReleased();
|
||||
|
||||
boolean fixScreenshotActionDismissSystemWindows();
|
||||
|
||||
boolean floatingMenuAnimatedTuck();
|
||||
|
||||
boolean floatingMenuDragToEdit();
|
||||
|
||||
boolean floatingMenuDragToHide();
|
||||
|
||||
boolean floatingMenuImeDisplacementAnimation();
|
||||
|
||||
boolean floatingMenuNarrowTargetContentObserver();
|
||||
|
||||
boolean floatingMenuOverlapsNavBarsFlag();
|
||||
|
||||
boolean floatingMenuRadiiAnimation();
|
||||
|
||||
boolean getConnectedDeviceNameUnsynchronized();
|
||||
|
||||
boolean glanceableHubAllowKeyguardWhenDreaming();
|
||||
|
||||
boolean glanceableHubFullscreenSwipe();
|
||||
|
||||
boolean glanceableHubGestureHandle();
|
||||
|
||||
boolean glanceableHubShortcutButton();
|
||||
|
||||
boolean hapticBrightnessSlider();
|
||||
|
||||
boolean hapticVolumeSlider();
|
||||
|
||||
boolean hearingAidsQsTileDialog();
|
||||
|
||||
boolean hearingDevicesDialogRelatedTools();
|
||||
|
||||
boolean keyboardDockingIndicator();
|
||||
|
||||
boolean keyboardShortcutHelperRewrite();
|
||||
|
||||
boolean keyguardBottomAreaRefactor();
|
||||
|
||||
boolean keyguardWmStateRefactor();
|
||||
|
||||
boolean lightRevealMigration();
|
||||
|
||||
boolean mediaControlsLockscreenShadeBugFix();
|
||||
|
||||
boolean mediaControlsRefactor();
|
||||
|
||||
boolean mediaControlsUserInitiatedDeleteintent();
|
||||
|
||||
boolean migrateClocksToBlueprint();
|
||||
|
||||
boolean newAodTransition();
|
||||
|
||||
boolean newTouchpadGesturesTutorial();
|
||||
|
||||
boolean newVolumePanel();
|
||||
|
||||
boolean notificationAsyncGroupHeaderInflation();
|
||||
|
||||
boolean notificationAsyncHybridViewInflation();
|
||||
|
||||
boolean notificationAvalancheSuppression();
|
||||
|
||||
boolean notificationAvalancheThrottleHun();
|
||||
|
||||
boolean notificationBackgroundTintOptimization();
|
||||
|
||||
boolean notificationColorUpdateLogger();
|
||||
|
||||
boolean notificationContentAlphaOptimization();
|
||||
|
||||
boolean notificationFooterBackgroundTintOptimization();
|
||||
|
||||
boolean notificationMediaManagerBackgroundExecution();
|
||||
|
||||
boolean notificationMinimalismPrototype();
|
||||
|
||||
boolean notificationOverExpansionClippingFix();
|
||||
|
||||
boolean notificationPulsingFix();
|
||||
|
||||
boolean notificationRowContentBinderRefactor();
|
||||
|
||||
boolean notificationRowUserContext();
|
||||
|
||||
boolean notificationViewFlipperPausingV2();
|
||||
|
||||
boolean notificationsBackgroundIcons();
|
||||
|
||||
boolean notificationsFooterViewRefactor();
|
||||
|
||||
boolean notificationsHeadsUpRefactor();
|
||||
|
||||
boolean notificationsHideOnDisplaySwitch();
|
||||
|
||||
boolean notificationsIconContainerRefactor();
|
||||
|
||||
boolean notificationsImprovedHunAnimation();
|
||||
|
||||
boolean notificationsLiveDataStoreRefactor();
|
||||
|
||||
boolean notifyPowerManagerUserActivityBackground();
|
||||
|
||||
boolean pinInputFieldStyledFocusState();
|
||||
|
||||
boolean predictiveBackAnimateBouncer();
|
||||
|
||||
boolean predictiveBackAnimateDialogs();
|
||||
|
||||
boolean predictiveBackAnimateShade();
|
||||
|
||||
boolean predictiveBackSysui();
|
||||
|
||||
boolean priorityPeopleSection();
|
||||
|
||||
boolean privacyDotUnfoldWrongCornerFix();
|
||||
|
||||
boolean pssAppSelectorAbruptExitFix();
|
||||
|
||||
boolean pssAppSelectorRecentsSplitScreen();
|
||||
|
||||
boolean pssTaskSwitcher();
|
||||
|
||||
boolean qsCustomTileClickGuaranteedBugFix();
|
||||
|
||||
boolean qsNewPipeline();
|
||||
|
||||
boolean qsNewTiles();
|
||||
|
||||
boolean qsNewTilesFuture();
|
||||
|
||||
boolean qsTileFocusState();
|
||||
|
||||
boolean qsUiRefactor();
|
||||
|
||||
boolean quickSettingsVisualHapticsLongpress();
|
||||
|
||||
boolean recordIssueQsTile();
|
||||
|
||||
boolean refactorGetCurrentUser();
|
||||
|
||||
boolean registerBatteryControllerReceiversInCorestartable();
|
||||
|
||||
boolean registerNewWalletCardInBackground();
|
||||
|
||||
boolean registerWallpaperNotifierBackground();
|
||||
|
||||
boolean registerZenModeContentObserverBackground();
|
||||
|
||||
boolean removeDreamOverlayHideOnTouch();
|
||||
|
||||
boolean restToUnlock();
|
||||
|
||||
boolean restartDreamOnUnocclude();
|
||||
|
||||
boolean revampedBouncerMessages();
|
||||
|
||||
boolean runFingerprintDetectOnDismissibleKeyguard();
|
||||
|
||||
boolean saveAndRestoreMagnificationSettingsButtons();
|
||||
|
||||
boolean sceneContainer();
|
||||
|
||||
boolean screenshareNotificationHidingBugFix();
|
||||
|
||||
boolean screenshotActionDismissSystemWindows();
|
||||
|
||||
boolean screenshotPrivateProfileAccessibilityAnnouncementFix();
|
||||
|
||||
boolean screenshotPrivateProfileBehaviorFix();
|
||||
|
||||
boolean screenshotScrollCropViewCrashFix();
|
||||
|
||||
boolean screenshotShelfUi2();
|
||||
|
||||
boolean shadeCollapseActivityLaunchFix();
|
||||
|
||||
boolean shaderlibLoadingEffectRefactor();
|
||||
|
||||
boolean sliceBroadcastRelayInBackground();
|
||||
|
||||
boolean sliceManagerBinderCallBackground();
|
||||
|
||||
boolean smartspaceLockscreenViewmodel();
|
||||
|
||||
boolean smartspaceRelocateToBottom();
|
||||
|
||||
boolean smartspaceRemoteviewsRendering();
|
||||
|
||||
boolean statusBarMonochromeIconsFix();
|
||||
|
||||
boolean statusBarScreenSharingChips();
|
||||
|
||||
boolean statusBarStaticInoutIndicators();
|
||||
|
||||
boolean switchUserOnBg();
|
||||
|
||||
boolean sysuiTeamfood();
|
||||
|
||||
boolean themeOverlayControllerWakefulnessDeprecation();
|
||||
|
||||
boolean translucentOccludingActivityFix();
|
||||
|
||||
boolean truncatedStatusBarIconsFix();
|
||||
|
||||
boolean udfpsViewPerformance();
|
||||
|
||||
boolean unfoldAnimationBackgroundProgress();
|
||||
|
||||
boolean updateUserSwitcherBackground();
|
||||
|
||||
boolean validateKeyboardShortcutHelperIconUri();
|
||||
|
||||
boolean visualInterruptionsRefactor();
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,914 @@
|
||||
package com.android.systemui;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
/** @hide */
|
||||
public final class Flags {
|
||||
/** @hide */
|
||||
public static final String FLAG_ACTIVITY_TRANSITION_USE_LARGEST_WINDOW = "com.android.systemui.activity_transition_use_largest_window";
|
||||
/** @hide */
|
||||
public static final String FLAG_AMBIENT_TOUCH_MONITOR_LISTEN_TO_DISPLAY_CHANGES = "com.android.systemui.ambient_touch_monitor_listen_to_display_changes";
|
||||
/** @hide */
|
||||
public static final String FLAG_APP_CLIPS_BACKLINKS = "com.android.systemui.app_clips_backlinks";
|
||||
/** @hide */
|
||||
public static final String FLAG_BIND_KEYGUARD_MEDIA_VISIBILITY = "com.android.systemui.bind_keyguard_media_visibility";
|
||||
/** @hide */
|
||||
public static final String FLAG_BP_TALKBACK = "com.android.systemui.bp_talkback";
|
||||
/** @hide */
|
||||
public static final String FLAG_BRIGHTNESS_SLIDER_FOCUS_STATE = "com.android.systemui.brightness_slider_focus_state";
|
||||
/** @hide */
|
||||
public static final String FLAG_CENTRALIZED_STATUS_BAR_HEIGHT_FIX = "com.android.systemui.centralized_status_bar_height_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_CLIPBOARD_NONINTERACTIVE_ON_LOCKSCREEN = "com.android.systemui.clipboard_noninteractive_on_lockscreen";
|
||||
/** @hide */
|
||||
public static final String FLAG_CLOCK_REACTIVE_VARIANTS = "com.android.systemui.clock_reactive_variants";
|
||||
/** @hide */
|
||||
public static final String FLAG_COMMUNAL_BOUNCER_DO_NOT_MODIFY_PLUGIN_OPEN = "com.android.systemui.communal_bouncer_do_not_modify_plugin_open";
|
||||
/** @hide */
|
||||
public static final String FLAG_COMMUNAL_HUB = "com.android.systemui.communal_hub";
|
||||
/** @hide */
|
||||
public static final String FLAG_COMPOSE_BOUNCER = "com.android.systemui.compose_bouncer";
|
||||
/** @hide */
|
||||
public static final String FLAG_COMPOSE_LOCKSCREEN = "com.android.systemui.compose_lockscreen";
|
||||
/** @hide */
|
||||
public static final String FLAG_CONFINE_NOTIFICATION_TOUCH_TO_VIEW_WIDTH = "com.android.systemui.confine_notification_touch_to_view_width";
|
||||
/** @hide */
|
||||
public static final String FLAG_CONSTRAINT_BP = "com.android.systemui.constraint_bp";
|
||||
/** @hide */
|
||||
public static final String FLAG_CONTEXTUAL_TIPS_ASSISTANT_DISMISS_FIX = "com.android.systemui.contextual_tips_assistant_dismiss_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_COROUTINE_TRACING = "com.android.systemui.coroutine_tracing";
|
||||
/** @hide */
|
||||
public static final String FLAG_CREATE_WINDOWLESS_WINDOW_MAGNIFIER = "com.android.systemui.create_windowless_window_magnifier";
|
||||
/** @hide */
|
||||
public static final String FLAG_DEDICATED_NOTIF_INFLATION_THREAD = "com.android.systemui.dedicated_notif_inflation_thread";
|
||||
/** @hide */
|
||||
public static final String FLAG_DELAY_SHOW_MAGNIFICATION_BUTTON = "com.android.systemui.delay_show_magnification_button";
|
||||
/** @hide */
|
||||
public static final String FLAG_DELAYED_WAKELOCK_RELEASE_ON_BACKGROUND_THREAD = "com.android.systemui.delayed_wakelock_release_on_background_thread";
|
||||
/** @hide */
|
||||
public static final String FLAG_DEVICE_ENTRY_UDFPS_REFACTOR = "com.android.systemui.device_entry_udfps_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_DISABLE_CONTEXTUAL_TIPS_FREQUENCY_CHECK = "com.android.systemui.disable_contextual_tips_frequency_check";
|
||||
/** @hide */
|
||||
public static final String FLAG_DISABLE_CONTEXTUAL_TIPS_IOS_SWITCHER_CHECK = "com.android.systemui.disable_contextual_tips_ios_switcher_check";
|
||||
/** @hide */
|
||||
public static final String FLAG_DOZEUI_SCHEDULING_ALARMS_BACKGROUND_EXECUTION = "com.android.systemui.dozeui_scheduling_alarms_background_execution";
|
||||
/** @hide */
|
||||
public static final String FLAG_DREAM_INPUT_SESSION_PILFER_ONCE = "com.android.systemui.dream_input_session_pilfer_once";
|
||||
/** @hide */
|
||||
public static final String FLAG_DREAM_OVERLAY_BOUNCER_SWIPE_DIRECTION_FILTERING = "com.android.systemui.dream_overlay_bouncer_swipe_direction_filtering";
|
||||
/** @hide */
|
||||
public static final String FLAG_DUAL_SHADE = "com.android.systemui.dual_shade";
|
||||
/** @hide */
|
||||
public static final String FLAG_EDGE_BACK_GESTURE_HANDLER_THREAD = "com.android.systemui.edge_back_gesture_handler_thread";
|
||||
/** @hide */
|
||||
public static final String FLAG_EDGEBACK_GESTURE_HANDLER_GET_RUNNING_TASKS_BACKGROUND = "com.android.systemui.edgeback_gesture_handler_get_running_tasks_background";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_BACKGROUND_KEYGUARD_ONDRAWN_CALLBACK = "com.android.systemui.enable_background_keyguard_ondrawn_callback";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_CONTEXTUAL_TIP_FOR_MUTE_VOLUME = "com.android.systemui.enable_contextual_tip_for_mute_volume";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_CONTEXTUAL_TIP_FOR_POWER_OFF = "com.android.systemui.enable_contextual_tip_for_power_off";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_CONTEXTUAL_TIP_FOR_TAKE_SCREENSHOT = "com.android.systemui.enable_contextual_tip_for_take_screenshot";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_CONTEXTUAL_TIPS = "com.android.systemui.enable_contextual_tips";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_EFFICIENT_DISPLAY_REPOSITORY = "com.android.systemui.enable_efficient_display_repository";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_LAYOUT_TRACING = "com.android.systemui.enable_layout_tracing";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_VIEW_CAPTURE_TRACING = "com.android.systemui.enable_view_capture_tracing";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_WIDGET_PICKER_SIZE_FILTER = "com.android.systemui.enable_widget_picker_size_filter";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENFORCE_BRIGHTNESS_BASE_USER_RESTRICTION = "com.android.systemui.enforce_brightness_base_user_restriction";
|
||||
/** @hide */
|
||||
public static final String FLAG_EXAMPLE_FLAG = "com.android.systemui.example_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_FAST_UNLOCK_TRANSITION = "com.android.systemui.fast_unlock_transition";
|
||||
/** @hide */
|
||||
public static final String FLAG_FIX_IMAGE_WALLPAPER_CRASH_SURFACE_ALREADY_RELEASED = "com.android.systemui.fix_image_wallpaper_crash_surface_already_released";
|
||||
/** @hide */
|
||||
public static final String FLAG_FIX_SCREENSHOT_ACTION_DISMISS_SYSTEM_WINDOWS = "com.android.systemui.fix_screenshot_action_dismiss_system_windows";
|
||||
/** @hide */
|
||||
public static final String FLAG_FLOATING_MENU_ANIMATED_TUCK = "com.android.systemui.floating_menu_animated_tuck";
|
||||
/** @hide */
|
||||
public static final String FLAG_FLOATING_MENU_DRAG_TO_EDIT = "com.android.systemui.floating_menu_drag_to_edit";
|
||||
/** @hide */
|
||||
public static final String FLAG_FLOATING_MENU_DRAG_TO_HIDE = "com.android.systemui.floating_menu_drag_to_hide";
|
||||
/** @hide */
|
||||
public static final String FLAG_FLOATING_MENU_IME_DISPLACEMENT_ANIMATION = "com.android.systemui.floating_menu_ime_displacement_animation";
|
||||
/** @hide */
|
||||
public static final String FLAG_FLOATING_MENU_NARROW_TARGET_CONTENT_OBSERVER = "com.android.systemui.floating_menu_narrow_target_content_observer";
|
||||
/** @hide */
|
||||
public static final String FLAG_FLOATING_MENU_OVERLAPS_NAV_BARS_FLAG = "com.android.systemui.floating_menu_overlaps_nav_bars_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_FLOATING_MENU_RADII_ANIMATION = "com.android.systemui.floating_menu_radii_animation";
|
||||
/** @hide */
|
||||
public static final String FLAG_GET_CONNECTED_DEVICE_NAME_UNSYNCHRONIZED = "com.android.systemui.get_connected_device_name_unsynchronized";
|
||||
/** @hide */
|
||||
public static final String FLAG_GLANCEABLE_HUB_ALLOW_KEYGUARD_WHEN_DREAMING = "com.android.systemui.glanceable_hub_allow_keyguard_when_dreaming";
|
||||
/** @hide */
|
||||
public static final String FLAG_GLANCEABLE_HUB_FULLSCREEN_SWIPE = "com.android.systemui.glanceable_hub_fullscreen_swipe";
|
||||
/** @hide */
|
||||
public static final String FLAG_GLANCEABLE_HUB_GESTURE_HANDLE = "com.android.systemui.glanceable_hub_gesture_handle";
|
||||
/** @hide */
|
||||
public static final String FLAG_GLANCEABLE_HUB_SHORTCUT_BUTTON = "com.android.systemui.glanceable_hub_shortcut_button";
|
||||
/** @hide */
|
||||
public static final String FLAG_HAPTIC_BRIGHTNESS_SLIDER = "com.android.systemui.haptic_brightness_slider";
|
||||
/** @hide */
|
||||
public static final String FLAG_HAPTIC_VOLUME_SLIDER = "com.android.systemui.haptic_volume_slider";
|
||||
/** @hide */
|
||||
public static final String FLAG_HEARING_AIDS_QS_TILE_DIALOG = "com.android.systemui.hearing_aids_qs_tile_dialog";
|
||||
/** @hide */
|
||||
public static final String FLAG_HEARING_DEVICES_DIALOG_RELATED_TOOLS = "com.android.systemui.hearing_devices_dialog_related_tools";
|
||||
/** @hide */
|
||||
public static final String FLAG_KEYBOARD_DOCKING_INDICATOR = "com.android.systemui.keyboard_docking_indicator";
|
||||
/** @hide */
|
||||
public static final String FLAG_KEYBOARD_SHORTCUT_HELPER_REWRITE = "com.android.systemui.keyboard_shortcut_helper_rewrite";
|
||||
/** @hide */
|
||||
public static final String FLAG_KEYGUARD_BOTTOM_AREA_REFACTOR = "com.android.systemui.keyguard_bottom_area_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_KEYGUARD_WM_STATE_REFACTOR = "com.android.systemui.keyguard_wm_state_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_LIGHT_REVEAL_MIGRATION = "com.android.systemui.light_reveal_migration";
|
||||
/** @hide */
|
||||
public static final String FLAG_MEDIA_CONTROLS_LOCKSCREEN_SHADE_BUG_FIX = "com.android.systemui.media_controls_lockscreen_shade_bug_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_MEDIA_CONTROLS_REFACTOR = "com.android.systemui.media_controls_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_MEDIA_CONTROLS_USER_INITIATED_DELETEINTENT = "com.android.systemui.media_controls_user_initiated_deleteintent";
|
||||
/** @hide */
|
||||
public static final String FLAG_MIGRATE_CLOCKS_TO_BLUEPRINT = "com.android.systemui.migrate_clocks_to_blueprint";
|
||||
/** @hide */
|
||||
public static final String FLAG_NEW_AOD_TRANSITION = "com.android.systemui.new_aod_transition";
|
||||
/** @hide */
|
||||
public static final String FLAG_NEW_TOUCHPAD_GESTURES_TUTORIAL = "com.android.systemui.new_touchpad_gestures_tutorial";
|
||||
/** @hide */
|
||||
public static final String FLAG_NEW_VOLUME_PANEL = "com.android.systemui.new_volume_panel";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_ASYNC_GROUP_HEADER_INFLATION = "com.android.systemui.notification_async_group_header_inflation";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_ASYNC_HYBRID_VIEW_INFLATION = "com.android.systemui.notification_async_hybrid_view_inflation";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_AVALANCHE_SUPPRESSION = "com.android.systemui.notification_avalanche_suppression";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_AVALANCHE_THROTTLE_HUN = "com.android.systemui.notification_avalanche_throttle_hun";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_BACKGROUND_TINT_OPTIMIZATION = "com.android.systemui.notification_background_tint_optimization";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_COLOR_UPDATE_LOGGER = "com.android.systemui.notification_color_update_logger";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_CONTENT_ALPHA_OPTIMIZATION = "com.android.systemui.notification_content_alpha_optimization";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_FOOTER_BACKGROUND_TINT_OPTIMIZATION = "com.android.systemui.notification_footer_background_tint_optimization";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_MEDIA_MANAGER_BACKGROUND_EXECUTION = "com.android.systemui.notification_media_manager_background_execution";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_MINIMALISM_PROTOTYPE = "com.android.systemui.notification_minimalism_prototype";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_OVER_EXPANSION_CLIPPING_FIX = "com.android.systemui.notification_over_expansion_clipping_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_PULSING_FIX = "com.android.systemui.notification_pulsing_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_ROW_CONTENT_BINDER_REFACTOR = "com.android.systemui.notification_row_content_binder_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_ROW_USER_CONTEXT = "com.android.systemui.notification_row_user_context";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATION_VIEW_FLIPPER_PAUSING_V2 = "com.android.systemui.notification_view_flipper_pausing_v2";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATIONS_BACKGROUND_ICONS = "com.android.systemui.notifications_background_icons";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATIONS_FOOTER_VIEW_REFACTOR = "com.android.systemui.notifications_footer_view_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATIONS_HEADS_UP_REFACTOR = "com.android.systemui.notifications_heads_up_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATIONS_HIDE_ON_DISPLAY_SWITCH = "com.android.systemui.notifications_hide_on_display_switch";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATIONS_ICON_CONTAINER_REFACTOR = "com.android.systemui.notifications_icon_container_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATIONS_IMPROVED_HUN_ANIMATION = "com.android.systemui.notifications_improved_hun_animation";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFICATIONS_LIVE_DATA_STORE_REFACTOR = "com.android.systemui.notifications_live_data_store_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_NOTIFY_POWER_MANAGER_USER_ACTIVITY_BACKGROUND = "com.android.systemui.notify_power_manager_user_activity_background";
|
||||
/** @hide */
|
||||
public static final String FLAG_PIN_INPUT_FIELD_STYLED_FOCUS_STATE = "com.android.systemui.pin_input_field_styled_focus_state";
|
||||
/** @hide */
|
||||
public static final String FLAG_PREDICTIVE_BACK_ANIMATE_BOUNCER = "com.android.systemui.predictive_back_animate_bouncer";
|
||||
/** @hide */
|
||||
public static final String FLAG_PREDICTIVE_BACK_ANIMATE_DIALOGS = "com.android.systemui.predictive_back_animate_dialogs";
|
||||
/** @hide */
|
||||
public static final String FLAG_PREDICTIVE_BACK_ANIMATE_SHADE = "com.android.systemui.predictive_back_animate_shade";
|
||||
/** @hide */
|
||||
public static final String FLAG_PREDICTIVE_BACK_SYSUI = "com.android.systemui.predictive_back_sysui";
|
||||
/** @hide */
|
||||
public static final String FLAG_PRIORITY_PEOPLE_SECTION = "com.android.systemui.priority_people_section";
|
||||
/** @hide */
|
||||
public static final String FLAG_PRIVACY_DOT_UNFOLD_WRONG_CORNER_FIX = "com.android.systemui.privacy_dot_unfold_wrong_corner_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_PSS_APP_SELECTOR_ABRUPT_EXIT_FIX = "com.android.systemui.pss_app_selector_abrupt_exit_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_PSS_APP_SELECTOR_RECENTS_SPLIT_SCREEN = "com.android.systemui.pss_app_selector_recents_split_screen";
|
||||
/** @hide */
|
||||
public static final String FLAG_PSS_TASK_SWITCHER = "com.android.systemui.pss_task_switcher";
|
||||
/** @hide */
|
||||
public static final String FLAG_QS_CUSTOM_TILE_CLICK_GUARANTEED_BUG_FIX = "com.android.systemui.qs_custom_tile_click_guaranteed_bug_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_QS_NEW_PIPELINE = "com.android.systemui.qs_new_pipeline";
|
||||
/** @hide */
|
||||
public static final String FLAG_QS_NEW_TILES = "com.android.systemui.qs_new_tiles";
|
||||
/** @hide */
|
||||
public static final String FLAG_QS_NEW_TILES_FUTURE = "com.android.systemui.qs_new_tiles_future";
|
||||
/** @hide */
|
||||
public static final String FLAG_QS_TILE_FOCUS_STATE = "com.android.systemui.qs_tile_focus_state";
|
||||
/** @hide */
|
||||
public static final String FLAG_QS_UI_REFACTOR = "com.android.systemui.qs_ui_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_QUICK_SETTINGS_VISUAL_HAPTICS_LONGPRESS = "com.android.systemui.quick_settings_visual_haptics_longpress";
|
||||
/** @hide */
|
||||
public static final String FLAG_RECORD_ISSUE_QS_TILE = "com.android.systemui.record_issue_qs_tile";
|
||||
/** @hide */
|
||||
public static final String FLAG_REFACTOR_GET_CURRENT_USER = "com.android.systemui.refactor_get_current_user";
|
||||
/** @hide */
|
||||
public static final String FLAG_REGISTER_BATTERY_CONTROLLER_RECEIVERS_IN_CORESTARTABLE = "com.android.systemui.register_battery_controller_receivers_in_corestartable";
|
||||
/** @hide */
|
||||
public static final String FLAG_REGISTER_NEW_WALLET_CARD_IN_BACKGROUND = "com.android.systemui.register_new_wallet_card_in_background";
|
||||
/** @hide */
|
||||
public static final String FLAG_REGISTER_WALLPAPER_NOTIFIER_BACKGROUND = "com.android.systemui.register_wallpaper_notifier_background";
|
||||
/** @hide */
|
||||
public static final String FLAG_REGISTER_ZEN_MODE_CONTENT_OBSERVER_BACKGROUND = "com.android.systemui.register_zen_mode_content_observer_background";
|
||||
/** @hide */
|
||||
public static final String FLAG_REMOVE_DREAM_OVERLAY_HIDE_ON_TOUCH = "com.android.systemui.remove_dream_overlay_hide_on_touch";
|
||||
/** @hide */
|
||||
public static final String FLAG_REST_TO_UNLOCK = "com.android.systemui.rest_to_unlock";
|
||||
/** @hide */
|
||||
public static final String FLAG_RESTART_DREAM_ON_UNOCCLUDE = "com.android.systemui.restart_dream_on_unocclude";
|
||||
/** @hide */
|
||||
public static final String FLAG_REVAMPED_BOUNCER_MESSAGES = "com.android.systemui.revamped_bouncer_messages";
|
||||
/** @hide */
|
||||
public static final String FLAG_RUN_FINGERPRINT_DETECT_ON_DISMISSIBLE_KEYGUARD = "com.android.systemui.run_fingerprint_detect_on_dismissible_keyguard";
|
||||
/** @hide */
|
||||
public static final String FLAG_SAVE_AND_RESTORE_MAGNIFICATION_SETTINGS_BUTTONS = "com.android.systemui.save_and_restore_magnification_settings_buttons";
|
||||
/** @hide */
|
||||
public static final String FLAG_SCENE_CONTAINER = "com.android.systemui.scene_container";
|
||||
/** @hide */
|
||||
public static final String FLAG_SCREENSHARE_NOTIFICATION_HIDING_BUG_FIX = "com.android.systemui.screenshare_notification_hiding_bug_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_SCREENSHOT_ACTION_DISMISS_SYSTEM_WINDOWS = "com.android.systemui.screenshot_action_dismiss_system_windows";
|
||||
/** @hide */
|
||||
public static final String FLAG_SCREENSHOT_PRIVATE_PROFILE_ACCESSIBILITY_ANNOUNCEMENT_FIX = "com.android.systemui.screenshot_private_profile_accessibility_announcement_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_SCREENSHOT_PRIVATE_PROFILE_BEHAVIOR_FIX = "com.android.systemui.screenshot_private_profile_behavior_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_SCREENSHOT_SCROLL_CROP_VIEW_CRASH_FIX = "com.android.systemui.screenshot_scroll_crop_view_crash_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_SCREENSHOT_SHELF_UI2 = "com.android.systemui.screenshot_shelf_ui2";
|
||||
/** @hide */
|
||||
public static final String FLAG_SHADE_COLLAPSE_ACTIVITY_LAUNCH_FIX = "com.android.systemui.shade_collapse_activity_launch_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_SHADERLIB_LOADING_EFFECT_REFACTOR = "com.android.systemui.shaderlib_loading_effect_refactor";
|
||||
/** @hide */
|
||||
public static final String FLAG_SLICE_BROADCAST_RELAY_IN_BACKGROUND = "com.android.systemui.slice_broadcast_relay_in_background";
|
||||
/** @hide */
|
||||
public static final String FLAG_SLICE_MANAGER_BINDER_CALL_BACKGROUND = "com.android.systemui.slice_manager_binder_call_background";
|
||||
/** @hide */
|
||||
public static final String FLAG_SMARTSPACE_LOCKSCREEN_VIEWMODEL = "com.android.systemui.smartspace_lockscreen_viewmodel";
|
||||
/** @hide */
|
||||
public static final String FLAG_SMARTSPACE_RELOCATE_TO_BOTTOM = "com.android.systemui.smartspace_relocate_to_bottom";
|
||||
/** @hide */
|
||||
public static final String FLAG_SMARTSPACE_REMOTEVIEWS_RENDERING = "com.android.systemui.smartspace_remoteviews_rendering";
|
||||
/** @hide */
|
||||
public static final String FLAG_STATUS_BAR_MONOCHROME_ICONS_FIX = "com.android.systemui.status_bar_monochrome_icons_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_STATUS_BAR_SCREEN_SHARING_CHIPS = "com.android.systemui.status_bar_screen_sharing_chips";
|
||||
/** @hide */
|
||||
public static final String FLAG_STATUS_BAR_STATIC_INOUT_INDICATORS = "com.android.systemui.status_bar_static_inout_indicators";
|
||||
/** @hide */
|
||||
public static final String FLAG_SWITCH_USER_ON_BG = "com.android.systemui.switch_user_on_bg";
|
||||
/** @hide */
|
||||
public static final String FLAG_SYSUI_TEAMFOOD = "com.android.systemui.sysui_teamfood";
|
||||
/** @hide */
|
||||
public static final String FLAG_THEME_OVERLAY_CONTROLLER_WAKEFULNESS_DEPRECATION = "com.android.systemui.theme_overlay_controller_wakefulness_deprecation";
|
||||
/** @hide */
|
||||
public static final String FLAG_TRANSLUCENT_OCCLUDING_ACTIVITY_FIX = "com.android.systemui.translucent_occluding_activity_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_TRUNCATED_STATUS_BAR_ICONS_FIX = "com.android.systemui.truncated_status_bar_icons_fix";
|
||||
/** @hide */
|
||||
public static final String FLAG_UDFPS_VIEW_PERFORMANCE = "com.android.systemui.udfps_view_performance";
|
||||
/** @hide */
|
||||
public static final String FLAG_UNFOLD_ANIMATION_BACKGROUND_PROGRESS = "com.android.systemui.unfold_animation_background_progress";
|
||||
/** @hide */
|
||||
public static final String FLAG_UPDATE_USER_SWITCHER_BACKGROUND = "com.android.systemui.update_user_switcher_background";
|
||||
/** @hide */
|
||||
public static final String FLAG_VALIDATE_KEYBOARD_SHORTCUT_HELPER_ICON_URI = "com.android.systemui.validate_keyboard_shortcut_helper_icon_uri";
|
||||
/** @hide */
|
||||
public static final String FLAG_VISUAL_INTERRUPTIONS_REFACTOR = "com.android.systemui.visual_interruptions_refactor";
|
||||
|
||||
public static boolean activityTransitionUseLargestWindow() {
|
||||
return FEATURE_FLAGS.activityTransitionUseLargestWindow();
|
||||
}
|
||||
|
||||
public static boolean ambientTouchMonitorListenToDisplayChanges() {
|
||||
return FEATURE_FLAGS.ambientTouchMonitorListenToDisplayChanges();
|
||||
}
|
||||
|
||||
public static boolean appClipsBacklinks() {
|
||||
return FEATURE_FLAGS.appClipsBacklinks();
|
||||
}
|
||||
|
||||
public static boolean bindKeyguardMediaVisibility() {
|
||||
return FEATURE_FLAGS.bindKeyguardMediaVisibility();
|
||||
}
|
||||
|
||||
public static boolean bpTalkback() {
|
||||
return FEATURE_FLAGS.bpTalkback();
|
||||
}
|
||||
|
||||
public static boolean brightnessSliderFocusState() {
|
||||
return FEATURE_FLAGS.brightnessSliderFocusState();
|
||||
}
|
||||
|
||||
public static boolean centralizedStatusBarHeightFix() {
|
||||
return FEATURE_FLAGS.centralizedStatusBarHeightFix();
|
||||
}
|
||||
|
||||
public static boolean clipboardNoninteractiveOnLockscreen() {
|
||||
return FEATURE_FLAGS.clipboardNoninteractiveOnLockscreen();
|
||||
}
|
||||
|
||||
public static boolean clockReactiveVariants() {
|
||||
return FEATURE_FLAGS.clockReactiveVariants();
|
||||
}
|
||||
|
||||
public static boolean communalBouncerDoNotModifyPluginOpen() {
|
||||
return FEATURE_FLAGS.communalBouncerDoNotModifyPluginOpen();
|
||||
}
|
||||
|
||||
public static boolean communalHub() {
|
||||
return FEATURE_FLAGS.communalHub();
|
||||
}
|
||||
|
||||
public static boolean composeBouncer() {
|
||||
return FEATURE_FLAGS.composeBouncer();
|
||||
}
|
||||
|
||||
public static boolean composeLockscreen() {
|
||||
return FEATURE_FLAGS.composeLockscreen();
|
||||
}
|
||||
|
||||
public static boolean confineNotificationTouchToViewWidth() {
|
||||
return FEATURE_FLAGS.confineNotificationTouchToViewWidth();
|
||||
}
|
||||
|
||||
public static boolean constraintBp() {
|
||||
return FEATURE_FLAGS.constraintBp();
|
||||
}
|
||||
|
||||
public static boolean contextualTipsAssistantDismissFix() {
|
||||
return FEATURE_FLAGS.contextualTipsAssistantDismissFix();
|
||||
}
|
||||
|
||||
public static boolean coroutineTracing() {
|
||||
return FEATURE_FLAGS.coroutineTracing();
|
||||
}
|
||||
|
||||
public static boolean createWindowlessWindowMagnifier() {
|
||||
return FEATURE_FLAGS.createWindowlessWindowMagnifier();
|
||||
}
|
||||
|
||||
public static boolean dedicatedNotifInflationThread() {
|
||||
return FEATURE_FLAGS.dedicatedNotifInflationThread();
|
||||
}
|
||||
|
||||
public static boolean delayShowMagnificationButton() {
|
||||
return FEATURE_FLAGS.delayShowMagnificationButton();
|
||||
}
|
||||
|
||||
public static boolean delayedWakelockReleaseOnBackgroundThread() {
|
||||
return FEATURE_FLAGS.delayedWakelockReleaseOnBackgroundThread();
|
||||
}
|
||||
|
||||
public static boolean deviceEntryUdfpsRefactor() {
|
||||
return FEATURE_FLAGS.deviceEntryUdfpsRefactor();
|
||||
}
|
||||
|
||||
public static boolean disableContextualTipsFrequencyCheck() {
|
||||
return FEATURE_FLAGS.disableContextualTipsFrequencyCheck();
|
||||
}
|
||||
|
||||
public static boolean disableContextualTipsIosSwitcherCheck() {
|
||||
return FEATURE_FLAGS.disableContextualTipsIosSwitcherCheck();
|
||||
}
|
||||
|
||||
public static boolean dozeuiSchedulingAlarmsBackgroundExecution() {
|
||||
return FEATURE_FLAGS.dozeuiSchedulingAlarmsBackgroundExecution();
|
||||
}
|
||||
|
||||
public static boolean dreamInputSessionPilferOnce() {
|
||||
return FEATURE_FLAGS.dreamInputSessionPilferOnce();
|
||||
}
|
||||
|
||||
public static boolean dreamOverlayBouncerSwipeDirectionFiltering() {
|
||||
return FEATURE_FLAGS.dreamOverlayBouncerSwipeDirectionFiltering();
|
||||
}
|
||||
|
||||
public static boolean dualShade() {
|
||||
return FEATURE_FLAGS.dualShade();
|
||||
}
|
||||
|
||||
public static boolean edgeBackGestureHandlerThread() {
|
||||
return FEATURE_FLAGS.edgeBackGestureHandlerThread();
|
||||
}
|
||||
|
||||
public static boolean edgebackGestureHandlerGetRunningTasksBackground() {
|
||||
return FEATURE_FLAGS.edgebackGestureHandlerGetRunningTasksBackground();
|
||||
}
|
||||
|
||||
public static boolean enableBackgroundKeyguardOndrawnCallback() {
|
||||
return FEATURE_FLAGS.enableBackgroundKeyguardOndrawnCallback();
|
||||
}
|
||||
|
||||
public static boolean enableContextualTipForMuteVolume() {
|
||||
return FEATURE_FLAGS.enableContextualTipForMuteVolume();
|
||||
}
|
||||
|
||||
public static boolean enableContextualTipForPowerOff() {
|
||||
return FEATURE_FLAGS.enableContextualTipForPowerOff();
|
||||
}
|
||||
|
||||
public static boolean enableContextualTipForTakeScreenshot() {
|
||||
return FEATURE_FLAGS.enableContextualTipForTakeScreenshot();
|
||||
}
|
||||
|
||||
public static boolean enableContextualTips() {
|
||||
return FEATURE_FLAGS.enableContextualTips();
|
||||
}
|
||||
|
||||
public static boolean enableEfficientDisplayRepository() {
|
||||
return FEATURE_FLAGS.enableEfficientDisplayRepository();
|
||||
}
|
||||
|
||||
public static boolean enableLayoutTracing() {
|
||||
return FEATURE_FLAGS.enableLayoutTracing();
|
||||
}
|
||||
|
||||
public static boolean enableViewCaptureTracing() {
|
||||
return FEATURE_FLAGS.enableViewCaptureTracing();
|
||||
}
|
||||
|
||||
public static boolean enableWidgetPickerSizeFilter() {
|
||||
return FEATURE_FLAGS.enableWidgetPickerSizeFilter();
|
||||
}
|
||||
|
||||
public static boolean enforceBrightnessBaseUserRestriction() {
|
||||
return FEATURE_FLAGS.enforceBrightnessBaseUserRestriction();
|
||||
}
|
||||
|
||||
public static boolean exampleFlag() {
|
||||
return FEATURE_FLAGS.exampleFlag();
|
||||
}
|
||||
|
||||
public static boolean fastUnlockTransition() {
|
||||
return FEATURE_FLAGS.fastUnlockTransition();
|
||||
}
|
||||
|
||||
public static boolean fixImageWallpaperCrashSurfaceAlreadyReleased() {
|
||||
return FEATURE_FLAGS.fixImageWallpaperCrashSurfaceAlreadyReleased();
|
||||
}
|
||||
|
||||
public static boolean fixScreenshotActionDismissSystemWindows() {
|
||||
return FEATURE_FLAGS.fixScreenshotActionDismissSystemWindows();
|
||||
}
|
||||
|
||||
public static boolean floatingMenuAnimatedTuck() {
|
||||
return FEATURE_FLAGS.floatingMenuAnimatedTuck();
|
||||
}
|
||||
|
||||
public static boolean floatingMenuDragToEdit() {
|
||||
return FEATURE_FLAGS.floatingMenuDragToEdit();
|
||||
}
|
||||
|
||||
public static boolean floatingMenuDragToHide() {
|
||||
return FEATURE_FLAGS.floatingMenuDragToHide();
|
||||
}
|
||||
|
||||
public static boolean floatingMenuImeDisplacementAnimation() {
|
||||
return FEATURE_FLAGS.floatingMenuImeDisplacementAnimation();
|
||||
}
|
||||
|
||||
public static boolean floatingMenuNarrowTargetContentObserver() {
|
||||
return FEATURE_FLAGS.floatingMenuNarrowTargetContentObserver();
|
||||
}
|
||||
|
||||
public static boolean floatingMenuOverlapsNavBarsFlag() {
|
||||
return FEATURE_FLAGS.floatingMenuOverlapsNavBarsFlag();
|
||||
}
|
||||
|
||||
public static boolean floatingMenuRadiiAnimation() {
|
||||
return FEATURE_FLAGS.floatingMenuRadiiAnimation();
|
||||
}
|
||||
|
||||
public static boolean getConnectedDeviceNameUnsynchronized() {
|
||||
return FEATURE_FLAGS.getConnectedDeviceNameUnsynchronized();
|
||||
}
|
||||
|
||||
public static boolean glanceableHubAllowKeyguardWhenDreaming() {
|
||||
return FEATURE_FLAGS.glanceableHubAllowKeyguardWhenDreaming();
|
||||
}
|
||||
|
||||
public static boolean glanceableHubFullscreenSwipe() {
|
||||
return FEATURE_FLAGS.glanceableHubFullscreenSwipe();
|
||||
}
|
||||
|
||||
public static boolean glanceableHubGestureHandle() {
|
||||
return FEATURE_FLAGS.glanceableHubGestureHandle();
|
||||
}
|
||||
|
||||
public static boolean glanceableHubShortcutButton() {
|
||||
return FEATURE_FLAGS.glanceableHubShortcutButton();
|
||||
}
|
||||
|
||||
public static boolean hapticBrightnessSlider() {
|
||||
return FEATURE_FLAGS.hapticBrightnessSlider();
|
||||
}
|
||||
|
||||
public static boolean hapticVolumeSlider() {
|
||||
return FEATURE_FLAGS.hapticVolumeSlider();
|
||||
}
|
||||
|
||||
public static boolean hearingAidsQsTileDialog() {
|
||||
return FEATURE_FLAGS.hearingAidsQsTileDialog();
|
||||
}
|
||||
|
||||
public static boolean hearingDevicesDialogRelatedTools() {
|
||||
return FEATURE_FLAGS.hearingDevicesDialogRelatedTools();
|
||||
}
|
||||
|
||||
public static boolean keyboardDockingIndicator() {
|
||||
return FEATURE_FLAGS.keyboardDockingIndicator();
|
||||
}
|
||||
|
||||
public static boolean keyboardShortcutHelperRewrite() {
|
||||
return FEATURE_FLAGS.keyboardShortcutHelperRewrite();
|
||||
}
|
||||
|
||||
public static boolean keyguardBottomAreaRefactor() {
|
||||
return FEATURE_FLAGS.keyguardBottomAreaRefactor();
|
||||
}
|
||||
|
||||
public static boolean keyguardWmStateRefactor() {
|
||||
return FEATURE_FLAGS.keyguardWmStateRefactor();
|
||||
}
|
||||
|
||||
public static boolean lightRevealMigration() {
|
||||
return FEATURE_FLAGS.lightRevealMigration();
|
||||
}
|
||||
|
||||
public static boolean mediaControlsLockscreenShadeBugFix() {
|
||||
return FEATURE_FLAGS.mediaControlsLockscreenShadeBugFix();
|
||||
}
|
||||
|
||||
public static boolean mediaControlsRefactor() {
|
||||
return FEATURE_FLAGS.mediaControlsRefactor();
|
||||
}
|
||||
|
||||
public static boolean mediaControlsUserInitiatedDeleteintent() {
|
||||
return FEATURE_FLAGS.mediaControlsUserInitiatedDeleteintent();
|
||||
}
|
||||
|
||||
public static boolean migrateClocksToBlueprint() {
|
||||
return FEATURE_FLAGS.migrateClocksToBlueprint();
|
||||
}
|
||||
|
||||
public static boolean newAodTransition() {
|
||||
return FEATURE_FLAGS.newAodTransition();
|
||||
}
|
||||
|
||||
public static boolean newTouchpadGesturesTutorial() {
|
||||
return FEATURE_FLAGS.newTouchpadGesturesTutorial();
|
||||
}
|
||||
|
||||
public static boolean newVolumePanel() {
|
||||
return FEATURE_FLAGS.newVolumePanel();
|
||||
}
|
||||
|
||||
public static boolean notificationAsyncGroupHeaderInflation() {
|
||||
return FEATURE_FLAGS.notificationAsyncGroupHeaderInflation();
|
||||
}
|
||||
|
||||
public static boolean notificationAsyncHybridViewInflation() {
|
||||
return FEATURE_FLAGS.notificationAsyncHybridViewInflation();
|
||||
}
|
||||
|
||||
public static boolean notificationAvalancheSuppression() {
|
||||
return FEATURE_FLAGS.notificationAvalancheSuppression();
|
||||
}
|
||||
|
||||
public static boolean notificationAvalancheThrottleHun() {
|
||||
return FEATURE_FLAGS.notificationAvalancheThrottleHun();
|
||||
}
|
||||
|
||||
public static boolean notificationBackgroundTintOptimization() {
|
||||
return FEATURE_FLAGS.notificationBackgroundTintOptimization();
|
||||
}
|
||||
|
||||
public static boolean notificationColorUpdateLogger() {
|
||||
return FEATURE_FLAGS.notificationColorUpdateLogger();
|
||||
}
|
||||
|
||||
public static boolean notificationContentAlphaOptimization() {
|
||||
return FEATURE_FLAGS.notificationContentAlphaOptimization();
|
||||
}
|
||||
|
||||
public static boolean notificationFooterBackgroundTintOptimization() {
|
||||
return FEATURE_FLAGS.notificationFooterBackgroundTintOptimization();
|
||||
}
|
||||
|
||||
public static boolean notificationMediaManagerBackgroundExecution() {
|
||||
return FEATURE_FLAGS.notificationMediaManagerBackgroundExecution();
|
||||
}
|
||||
|
||||
public static boolean notificationMinimalismPrototype() {
|
||||
return FEATURE_FLAGS.notificationMinimalismPrototype();
|
||||
}
|
||||
|
||||
public static boolean notificationOverExpansionClippingFix() {
|
||||
return FEATURE_FLAGS.notificationOverExpansionClippingFix();
|
||||
}
|
||||
|
||||
public static boolean notificationPulsingFix() {
|
||||
return FEATURE_FLAGS.notificationPulsingFix();
|
||||
}
|
||||
|
||||
public static boolean notificationRowContentBinderRefactor() {
|
||||
return FEATURE_FLAGS.notificationRowContentBinderRefactor();
|
||||
}
|
||||
|
||||
public static boolean notificationRowUserContext() {
|
||||
return FEATURE_FLAGS.notificationRowUserContext();
|
||||
}
|
||||
|
||||
public static boolean notificationViewFlipperPausingV2() {
|
||||
return FEATURE_FLAGS.notificationViewFlipperPausingV2();
|
||||
}
|
||||
|
||||
public static boolean notificationsBackgroundIcons() {
|
||||
return FEATURE_FLAGS.notificationsBackgroundIcons();
|
||||
}
|
||||
|
||||
public static boolean notificationsFooterViewRefactor() {
|
||||
return FEATURE_FLAGS.notificationsFooterViewRefactor();
|
||||
}
|
||||
|
||||
public static boolean notificationsHeadsUpRefactor() {
|
||||
return FEATURE_FLAGS.notificationsHeadsUpRefactor();
|
||||
}
|
||||
|
||||
public static boolean notificationsHideOnDisplaySwitch() {
|
||||
return FEATURE_FLAGS.notificationsHideOnDisplaySwitch();
|
||||
}
|
||||
|
||||
public static boolean notificationsIconContainerRefactor() {
|
||||
return FEATURE_FLAGS.notificationsIconContainerRefactor();
|
||||
}
|
||||
|
||||
public static boolean notificationsImprovedHunAnimation() {
|
||||
return FEATURE_FLAGS.notificationsImprovedHunAnimation();
|
||||
}
|
||||
|
||||
public static boolean notificationsLiveDataStoreRefactor() {
|
||||
return FEATURE_FLAGS.notificationsLiveDataStoreRefactor();
|
||||
}
|
||||
|
||||
public static boolean notifyPowerManagerUserActivityBackground() {
|
||||
return FEATURE_FLAGS.notifyPowerManagerUserActivityBackground();
|
||||
}
|
||||
|
||||
public static boolean pinInputFieldStyledFocusState() {
|
||||
return FEATURE_FLAGS.pinInputFieldStyledFocusState();
|
||||
}
|
||||
|
||||
public static boolean predictiveBackAnimateBouncer() {
|
||||
return FEATURE_FLAGS.predictiveBackAnimateBouncer();
|
||||
}
|
||||
|
||||
public static boolean predictiveBackAnimateDialogs() {
|
||||
return FEATURE_FLAGS.predictiveBackAnimateDialogs();
|
||||
}
|
||||
|
||||
public static boolean predictiveBackAnimateShade() {
|
||||
return FEATURE_FLAGS.predictiveBackAnimateShade();
|
||||
}
|
||||
|
||||
public static boolean predictiveBackSysui() {
|
||||
return FEATURE_FLAGS.predictiveBackSysui();
|
||||
}
|
||||
|
||||
public static boolean priorityPeopleSection() {
|
||||
return FEATURE_FLAGS.priorityPeopleSection();
|
||||
}
|
||||
|
||||
public static boolean privacyDotUnfoldWrongCornerFix() {
|
||||
return FEATURE_FLAGS.privacyDotUnfoldWrongCornerFix();
|
||||
}
|
||||
|
||||
public static boolean pssAppSelectorAbruptExitFix() {
|
||||
return FEATURE_FLAGS.pssAppSelectorAbruptExitFix();
|
||||
}
|
||||
|
||||
public static boolean pssAppSelectorRecentsSplitScreen() {
|
||||
return FEATURE_FLAGS.pssAppSelectorRecentsSplitScreen();
|
||||
}
|
||||
|
||||
public static boolean pssTaskSwitcher() {
|
||||
return FEATURE_FLAGS.pssTaskSwitcher();
|
||||
}
|
||||
|
||||
public static boolean qsCustomTileClickGuaranteedBugFix() {
|
||||
return FEATURE_FLAGS.qsCustomTileClickGuaranteedBugFix();
|
||||
}
|
||||
|
||||
public static boolean qsNewPipeline() {
|
||||
return FEATURE_FLAGS.qsNewPipeline();
|
||||
}
|
||||
|
||||
public static boolean qsNewTiles() {
|
||||
return FEATURE_FLAGS.qsNewTiles();
|
||||
}
|
||||
|
||||
public static boolean qsNewTilesFuture() {
|
||||
return FEATURE_FLAGS.qsNewTilesFuture();
|
||||
}
|
||||
|
||||
public static boolean qsTileFocusState() {
|
||||
return FEATURE_FLAGS.qsTileFocusState();
|
||||
}
|
||||
|
||||
public static boolean qsUiRefactor() {
|
||||
return FEATURE_FLAGS.qsUiRefactor();
|
||||
}
|
||||
|
||||
public static boolean quickSettingsVisualHapticsLongpress() {
|
||||
return FEATURE_FLAGS.quickSettingsVisualHapticsLongpress();
|
||||
}
|
||||
|
||||
public static boolean recordIssueQsTile() {
|
||||
return FEATURE_FLAGS.recordIssueQsTile();
|
||||
}
|
||||
|
||||
public static boolean refactorGetCurrentUser() {
|
||||
return FEATURE_FLAGS.refactorGetCurrentUser();
|
||||
}
|
||||
|
||||
public static boolean registerBatteryControllerReceiversInCorestartable() {
|
||||
return FEATURE_FLAGS.registerBatteryControllerReceiversInCorestartable();
|
||||
}
|
||||
|
||||
public static boolean registerNewWalletCardInBackground() {
|
||||
return FEATURE_FLAGS.registerNewWalletCardInBackground();
|
||||
}
|
||||
|
||||
public static boolean registerWallpaperNotifierBackground() {
|
||||
return FEATURE_FLAGS.registerWallpaperNotifierBackground();
|
||||
}
|
||||
|
||||
public static boolean registerZenModeContentObserverBackground() {
|
||||
return FEATURE_FLAGS.registerZenModeContentObserverBackground();
|
||||
}
|
||||
|
||||
public static boolean removeDreamOverlayHideOnTouch() {
|
||||
return FEATURE_FLAGS.removeDreamOverlayHideOnTouch();
|
||||
}
|
||||
|
||||
public static boolean restToUnlock() {
|
||||
return FEATURE_FLAGS.restToUnlock();
|
||||
}
|
||||
|
||||
public static boolean restartDreamOnUnocclude() {
|
||||
return FEATURE_FLAGS.restartDreamOnUnocclude();
|
||||
}
|
||||
|
||||
public static boolean revampedBouncerMessages() {
|
||||
return FEATURE_FLAGS.revampedBouncerMessages();
|
||||
}
|
||||
|
||||
public static boolean runFingerprintDetectOnDismissibleKeyguard() {
|
||||
return FEATURE_FLAGS.runFingerprintDetectOnDismissibleKeyguard();
|
||||
}
|
||||
|
||||
public static boolean saveAndRestoreMagnificationSettingsButtons() {
|
||||
return FEATURE_FLAGS.saveAndRestoreMagnificationSettingsButtons();
|
||||
}
|
||||
|
||||
public static boolean sceneContainer() {
|
||||
return FEATURE_FLAGS.sceneContainer();
|
||||
}
|
||||
|
||||
public static boolean screenshareNotificationHidingBugFix() {
|
||||
return FEATURE_FLAGS.screenshareNotificationHidingBugFix();
|
||||
}
|
||||
|
||||
public static boolean screenshotActionDismissSystemWindows() {
|
||||
return FEATURE_FLAGS.screenshotActionDismissSystemWindows();
|
||||
}
|
||||
|
||||
public static boolean screenshotPrivateProfileAccessibilityAnnouncementFix() {
|
||||
return FEATURE_FLAGS.screenshotPrivateProfileAccessibilityAnnouncementFix();
|
||||
}
|
||||
|
||||
public static boolean screenshotPrivateProfileBehaviorFix() {
|
||||
return FEATURE_FLAGS.screenshotPrivateProfileBehaviorFix();
|
||||
}
|
||||
|
||||
public static boolean screenshotScrollCropViewCrashFix() {
|
||||
return FEATURE_FLAGS.screenshotScrollCropViewCrashFix();
|
||||
}
|
||||
|
||||
public static boolean screenshotShelfUi2() {
|
||||
return FEATURE_FLAGS.screenshotShelfUi2();
|
||||
}
|
||||
|
||||
public static boolean shadeCollapseActivityLaunchFix() {
|
||||
return FEATURE_FLAGS.shadeCollapseActivityLaunchFix();
|
||||
}
|
||||
|
||||
public static boolean shaderlibLoadingEffectRefactor() {
|
||||
return FEATURE_FLAGS.shaderlibLoadingEffectRefactor();
|
||||
}
|
||||
|
||||
public static boolean sliceBroadcastRelayInBackground() {
|
||||
return FEATURE_FLAGS.sliceBroadcastRelayInBackground();
|
||||
}
|
||||
|
||||
public static boolean sliceManagerBinderCallBackground() {
|
||||
return FEATURE_FLAGS.sliceManagerBinderCallBackground();
|
||||
}
|
||||
|
||||
public static boolean smartspaceLockscreenViewmodel() {
|
||||
return FEATURE_FLAGS.smartspaceLockscreenViewmodel();
|
||||
}
|
||||
|
||||
public static boolean smartspaceRelocateToBottom() {
|
||||
return FEATURE_FLAGS.smartspaceRelocateToBottom();
|
||||
}
|
||||
|
||||
public static boolean smartspaceRemoteviewsRendering() {
|
||||
return FEATURE_FLAGS.smartspaceRemoteviewsRendering();
|
||||
}
|
||||
|
||||
public static boolean statusBarMonochromeIconsFix() {
|
||||
return FEATURE_FLAGS.statusBarMonochromeIconsFix();
|
||||
}
|
||||
|
||||
public static boolean statusBarScreenSharingChips() {
|
||||
return FEATURE_FLAGS.statusBarScreenSharingChips();
|
||||
}
|
||||
|
||||
public static boolean statusBarStaticInoutIndicators() {
|
||||
return FEATURE_FLAGS.statusBarStaticInoutIndicators();
|
||||
}
|
||||
|
||||
public static boolean switchUserOnBg() {
|
||||
return FEATURE_FLAGS.switchUserOnBg();
|
||||
}
|
||||
|
||||
public static boolean sysuiTeamfood() {
|
||||
return FEATURE_FLAGS.sysuiTeamfood();
|
||||
}
|
||||
|
||||
public static boolean themeOverlayControllerWakefulnessDeprecation() {
|
||||
return FEATURE_FLAGS.themeOverlayControllerWakefulnessDeprecation();
|
||||
}
|
||||
|
||||
public static boolean translucentOccludingActivityFix() {
|
||||
return FEATURE_FLAGS.translucentOccludingActivityFix();
|
||||
}
|
||||
|
||||
public static boolean truncatedStatusBarIconsFix() {
|
||||
return FEATURE_FLAGS.truncatedStatusBarIconsFix();
|
||||
}
|
||||
|
||||
public static boolean udfpsViewPerformance() {
|
||||
return FEATURE_FLAGS.udfpsViewPerformance();
|
||||
}
|
||||
|
||||
public static boolean unfoldAnimationBackgroundProgress() {
|
||||
return FEATURE_FLAGS.unfoldAnimationBackgroundProgress();
|
||||
}
|
||||
|
||||
public static boolean updateUserSwitcherBackground() {
|
||||
return FEATURE_FLAGS.updateUserSwitcherBackground();
|
||||
}
|
||||
|
||||
public static boolean validateKeyboardShortcutHelperIconUri() {
|
||||
return FEATURE_FLAGS.validateKeyboardShortcutHelperIconUri();
|
||||
}
|
||||
|
||||
public static boolean visualInterruptionsRefactor() {
|
||||
return FEATURE_FLAGS.visualInterruptionsRefactor();
|
||||
}
|
||||
|
||||
private static FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.android.systemui.shared;
|
||||
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** @hide */
|
||||
public class CustomFeatureFlags implements FeatureFlags {
|
||||
|
||||
private BiPredicate<String, Predicate<FeatureFlags>> mGetValueImpl;
|
||||
|
||||
public CustomFeatureFlags(BiPredicate<String, Predicate<FeatureFlags>> getValueImpl) {
|
||||
mGetValueImpl = getValueImpl;
|
||||
}
|
||||
@Override
|
||||
|
||||
public boolean bouncerAreaExclusion() {
|
||||
return getValue(Flags.FLAG_BOUNCER_AREA_EXCLUSION,
|
||||
FeatureFlags::bouncerAreaExclusion);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableHomeDelay() {
|
||||
return getValue(Flags.FLAG_ENABLE_HOME_DELAY,
|
||||
FeatureFlags::enableHomeDelay);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean exampleSharedFlag() {
|
||||
return getValue(Flags.FLAG_EXAMPLE_SHARED_FLAG,
|
||||
FeatureFlags::exampleSharedFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean returnAnimationFrameworkLibrary() {
|
||||
return getValue(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY,
|
||||
FeatureFlags::returnAnimationFrameworkLibrary);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean shadeAllowBackGesture() {
|
||||
return getValue(Flags.FLAG_SHADE_ALLOW_BACK_GESTURE,
|
||||
FeatureFlags::shadeAllowBackGesture);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean sidefpsControllerRefactor() {
|
||||
return getValue(Flags.FLAG_SIDEFPS_CONTROLLER_REFACTOR,
|
||||
FeatureFlags::sidefpsControllerRefactor);
|
||||
}
|
||||
|
||||
public boolean isFlagReadOnlyOptimized(String flagName) {
|
||||
if (mReadOnlyFlagsSet.contains(flagName) &&
|
||||
isOptimizationEnabled()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private boolean isOptimizationEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) {
|
||||
return mGetValueImpl.test(flagName, getter);
|
||||
}
|
||||
|
||||
public List<String> getFlagNames() {
|
||||
return Arrays.asList(
|
||||
Flags.FLAG_BOUNCER_AREA_EXCLUSION,
|
||||
Flags.FLAG_ENABLE_HOME_DELAY,
|
||||
Flags.FLAG_EXAMPLE_SHARED_FLAG,
|
||||
Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY,
|
||||
Flags.FLAG_SHADE_ALLOW_BACK_GESTURE,
|
||||
Flags.FLAG_SIDEFPS_CONTROLLER_REFACTOR
|
||||
);
|
||||
}
|
||||
|
||||
private Set<String> mReadOnlyFlagsSet = new HashSet<>(
|
||||
Arrays.asList(
|
||||
""
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.android.systemui.shared;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** @hide */
|
||||
public class FakeFeatureFlagsImpl extends CustomFeatureFlags {
|
||||
private final Map<String, Boolean> mFlagMap = new HashMap<>();
|
||||
private final FeatureFlags mDefaults;
|
||||
|
||||
public FakeFeatureFlagsImpl() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public FakeFeatureFlagsImpl(FeatureFlags defaults) {
|
||||
super(null);
|
||||
mDefaults = defaults;
|
||||
// Initialize the map with null values
|
||||
for (String flagName : getFlagNames()) {
|
||||
mFlagMap.put(flagName, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) {
|
||||
Boolean value = this.mFlagMap.get(flagName);
|
||||
if (value != null) {
|
||||
return value;
|
||||
}
|
||||
if (mDefaults != null) {
|
||||
return getter.test(mDefaults);
|
||||
}
|
||||
throw new IllegalArgumentException(flagName + " is not set");
|
||||
}
|
||||
|
||||
public void setFlag(String flagName, boolean value) {
|
||||
if (!this.mFlagMap.containsKey(flagName)) {
|
||||
throw new IllegalArgumentException("no such flag " + flagName);
|
||||
}
|
||||
this.mFlagMap.put(flagName, value);
|
||||
}
|
||||
|
||||
public void resetAll() {
|
||||
for (Map.Entry entry : mFlagMap.entrySet()) {
|
||||
entry.setValue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.android.systemui.shared;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
/** @hide */
|
||||
public interface FeatureFlags {
|
||||
|
||||
|
||||
|
||||
boolean bouncerAreaExclusion();
|
||||
|
||||
|
||||
boolean enableHomeDelay();
|
||||
|
||||
|
||||
boolean exampleSharedFlag();
|
||||
|
||||
|
||||
boolean returnAnimationFrameworkLibrary();
|
||||
|
||||
|
||||
boolean shadeAllowBackGesture();
|
||||
|
||||
|
||||
boolean sidefpsControllerRefactor();
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package com.android.systemui.shared;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
|
||||
import com.android.quickstep.util.DeviceConfigHelper;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
/** @hide */
|
||||
public final class FeatureFlagsImpl implements FeatureFlags {
|
||||
private static final boolean isReadFromNew = Files.exists(Paths.get("/metadata/aconfig/boot/enable_only_new_storage"));
|
||||
private static volatile boolean isCached = false;
|
||||
private static volatile boolean biometrics_framework_is_cached = false;
|
||||
private static volatile boolean systemui_is_cached = false;
|
||||
private static boolean bouncerAreaExclusion = true;
|
||||
private static boolean enableHomeDelay = false;
|
||||
private static boolean exampleSharedFlag = false;
|
||||
private static boolean returnAnimationFrameworkLibrary = false;
|
||||
private static boolean shadeAllowBackGesture = false;
|
||||
private static boolean sidefpsControllerRefactor = true;
|
||||
|
||||
|
||||
private void init() {
|
||||
boolean foundPackage = true;
|
||||
|
||||
sidefpsControllerRefactor = foundPackage;
|
||||
|
||||
|
||||
bouncerAreaExclusion = foundPackage;
|
||||
|
||||
|
||||
enableHomeDelay = foundPackage;
|
||||
|
||||
|
||||
exampleSharedFlag = foundPackage;
|
||||
|
||||
|
||||
returnAnimationFrameworkLibrary = foundPackage ;
|
||||
|
||||
|
||||
shadeAllowBackGesture = foundPackage;
|
||||
|
||||
isCached = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void load_overrides_biometrics_framework() {
|
||||
try {
|
||||
var properties = DeviceConfigHelper.Companion.getPrefs();
|
||||
sidefpsControllerRefactor =
|
||||
properties.getBoolean(Flags.FLAG_SIDEFPS_CONTROLLER_REFACTOR, true);
|
||||
} catch (NullPointerException e) {
|
||||
throw new RuntimeException(
|
||||
"Cannot read value from namespace biometrics_framework "
|
||||
+ "from DeviceConfig. It could be that the code using flag "
|
||||
+ "executed before SettingsProvider initialization. Please use "
|
||||
+ "fixed read-only flag by adding is_fixed_read_only: true in "
|
||||
+ "flag declaration.",
|
||||
e
|
||||
);
|
||||
}
|
||||
biometrics_framework_is_cached = true;
|
||||
}
|
||||
|
||||
private void load_overrides_systemui() {
|
||||
try {
|
||||
var properties = DeviceConfigHelper.Companion.getPrefs();
|
||||
bouncerAreaExclusion =
|
||||
properties.getBoolean(Flags.FLAG_BOUNCER_AREA_EXCLUSION, true);
|
||||
enableHomeDelay =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_HOME_DELAY, false);
|
||||
exampleSharedFlag =
|
||||
properties.getBoolean(Flags.FLAG_EXAMPLE_SHARED_FLAG, false);
|
||||
returnAnimationFrameworkLibrary =
|
||||
properties.getBoolean(Flags.FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY, false);
|
||||
shadeAllowBackGesture =
|
||||
properties.getBoolean(Flags.FLAG_SHADE_ALLOW_BACK_GESTURE, false);
|
||||
} catch (NullPointerException e) {
|
||||
throw new RuntimeException(
|
||||
"Cannot read value from namespace systemui "
|
||||
+ "from DeviceConfig. It could be that the code using flag "
|
||||
+ "executed before SettingsProvider initialization. Please use "
|
||||
+ "fixed read-only flag by adding is_fixed_read_only: true in "
|
||||
+ "flag declaration.",
|
||||
e
|
||||
);
|
||||
}
|
||||
systemui_is_cached = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean bouncerAreaExclusion() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!systemui_is_cached) {
|
||||
load_overrides_systemui();
|
||||
}
|
||||
}
|
||||
return bouncerAreaExclusion;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableHomeDelay() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!systemui_is_cached) {
|
||||
load_overrides_systemui();
|
||||
}
|
||||
}
|
||||
return enableHomeDelay;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean exampleSharedFlag() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!systemui_is_cached) {
|
||||
load_overrides_systemui();
|
||||
}
|
||||
}
|
||||
return exampleSharedFlag;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean returnAnimationFrameworkLibrary() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!systemui_is_cached) {
|
||||
load_overrides_systemui();
|
||||
}
|
||||
}
|
||||
return returnAnimationFrameworkLibrary;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean shadeAllowBackGesture() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!systemui_is_cached) {
|
||||
load_overrides_systemui();
|
||||
}
|
||||
}
|
||||
return shadeAllowBackGesture;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean sidefpsControllerRefactor() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!biometrics_framework_is_cached) {
|
||||
load_overrides_biometrics_framework();
|
||||
}
|
||||
}
|
||||
return sidefpsControllerRefactor;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.android.systemui.shared;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
/** @hide */
|
||||
public final class Flags {
|
||||
/** @hide */
|
||||
public static final String FLAG_BOUNCER_AREA_EXCLUSION = "com.android.systemui.shared.bouncer_area_exclusion";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_HOME_DELAY = "com.android.systemui.shared.enable_home_delay";
|
||||
/** @hide */
|
||||
public static final String FLAG_EXAMPLE_SHARED_FLAG = "com.android.systemui.shared.example_shared_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_RETURN_ANIMATION_FRAMEWORK_LIBRARY = "com.android.systemui.shared.return_animation_framework_library";
|
||||
/** @hide */
|
||||
public static final String FLAG_SHADE_ALLOW_BACK_GESTURE = "com.android.systemui.shared.shade_allow_back_gesture";
|
||||
/** @hide */
|
||||
public static final String FLAG_SIDEFPS_CONTROLLER_REFACTOR = "com.android.systemui.shared.sidefps_controller_refactor";
|
||||
|
||||
|
||||
public static boolean bouncerAreaExclusion() {
|
||||
return FEATURE_FLAGS.bouncerAreaExclusion();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableHomeDelay() {
|
||||
return FEATURE_FLAGS.enableHomeDelay();
|
||||
}
|
||||
|
||||
|
||||
public static boolean exampleSharedFlag() {
|
||||
return FEATURE_FLAGS.exampleSharedFlag();
|
||||
}
|
||||
|
||||
|
||||
public static boolean returnAnimationFrameworkLibrary() {
|
||||
return FEATURE_FLAGS.returnAnimationFrameworkLibrary();
|
||||
}
|
||||
|
||||
|
||||
public static boolean shadeAllowBackGesture() {
|
||||
return FEATURE_FLAGS.shadeAllowBackGesture();
|
||||
}
|
||||
|
||||
|
||||
public static boolean sidefpsControllerRefactor() {
|
||||
return FEATURE_FLAGS.sidefpsControllerRefactor();
|
||||
}
|
||||
|
||||
private static FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,923 @@
|
||||
package com.android.window.flags;
|
||||
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** @hide */
|
||||
public class CustomFeatureFlags implements FeatureFlags {
|
||||
|
||||
private BiPredicate<String, Predicate<FeatureFlags>> mGetValueImpl;
|
||||
|
||||
public CustomFeatureFlags(BiPredicate<String, Predicate<FeatureFlags>> getValueImpl) {
|
||||
mGetValueImpl = getValueImpl;
|
||||
}
|
||||
@Override
|
||||
|
||||
public boolean activityEmbeddingAnimationCustomizationFlag() {
|
||||
return getValue(Flags.FLAG_ACTIVITY_EMBEDDING_ANIMATION_CUSTOMIZATION_FLAG,
|
||||
FeatureFlags::activityEmbeddingAnimationCustomizationFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean activityEmbeddingInteractiveDividerFlag() {
|
||||
return getValue(Flags.FLAG_ACTIVITY_EMBEDDING_INTERACTIVE_DIVIDER_FLAG,
|
||||
FeatureFlags::activityEmbeddingInteractiveDividerFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean activityEmbeddingOverlayPresentationFlag() {
|
||||
return getValue(Flags.FLAG_ACTIVITY_EMBEDDING_OVERLAY_PRESENTATION_FLAG,
|
||||
FeatureFlags::activityEmbeddingOverlayPresentationFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean activitySnapshotByDefault() {
|
||||
return getValue(Flags.FLAG_ACTIVITY_SNAPSHOT_BY_DEFAULT,
|
||||
FeatureFlags::activitySnapshotByDefault);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean activityWindowInfoFlag() {
|
||||
return getValue(Flags.FLAG_ACTIVITY_WINDOW_INFO_FLAG,
|
||||
FeatureFlags::activityWindowInfoFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean allowDisableActivityRecordInputSink() {
|
||||
return getValue(Flags.FLAG_ALLOW_DISABLE_ACTIVITY_RECORD_INPUT_SINK,
|
||||
FeatureFlags::allowDisableActivityRecordInputSink);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean allowHideScmButton() {
|
||||
return getValue(Flags.FLAG_ALLOW_HIDE_SCM_BUTTON,
|
||||
FeatureFlags::allowHideScmButton);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean allowsScreenSizeDecoupledFromStatusBarAndCutout() {
|
||||
return getValue(Flags.FLAG_ALLOWS_SCREEN_SIZE_DECOUPLED_FROM_STATUS_BAR_AND_CUTOUT,
|
||||
FeatureFlags::allowsScreenSizeDecoupledFromStatusBarAndCutout);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean alwaysDeferTransitionWhenApplyWct() {
|
||||
return getValue(Flags.FLAG_ALWAYS_DEFER_TRANSITION_WHEN_APPLY_WCT,
|
||||
FeatureFlags::alwaysDeferTransitionWhenApplyWct);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean alwaysDrawMagnificationFullscreenBorder() {
|
||||
return getValue(Flags.FLAG_ALWAYS_DRAW_MAGNIFICATION_FULLSCREEN_BORDER,
|
||||
FeatureFlags::alwaysDrawMagnificationFullscreenBorder);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean alwaysUpdateWallpaperPermission() {
|
||||
return getValue(Flags.FLAG_ALWAYS_UPDATE_WALLPAPER_PERMISSION,
|
||||
FeatureFlags::alwaysUpdateWallpaperPermission);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean appCompatPropertiesApi() {
|
||||
return getValue(Flags.FLAG_APP_COMPAT_PROPERTIES_API,
|
||||
FeatureFlags::appCompatPropertiesApi);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean appCompatRefactoring() {
|
||||
return getValue(Flags.FLAG_APP_COMPAT_REFACTORING,
|
||||
FeatureFlags::appCompatRefactoring);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean balDontBringExistingBackgroundTaskStackToFg() {
|
||||
return getValue(Flags.FLAG_BAL_DONT_BRING_EXISTING_BACKGROUND_TASK_STACK_TO_FG,
|
||||
FeatureFlags::balDontBringExistingBackgroundTaskStackToFg);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean balImproveRealCallerVisibilityCheck() {
|
||||
return getValue(Flags.FLAG_BAL_IMPROVE_REAL_CALLER_VISIBILITY_CHECK,
|
||||
FeatureFlags::balImproveRealCallerVisibilityCheck);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean balImprovedMetrics() {
|
||||
return getValue(Flags.FLAG_BAL_IMPROVED_METRICS,
|
||||
FeatureFlags::balImprovedMetrics);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean balRequireOptInByPendingIntentCreator() {
|
||||
return getValue(Flags.FLAG_BAL_REQUIRE_OPT_IN_BY_PENDING_INTENT_CREATOR,
|
||||
FeatureFlags::balRequireOptInByPendingIntentCreator);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean balRequireOptInSameUid() {
|
||||
return getValue(Flags.FLAG_BAL_REQUIRE_OPT_IN_SAME_UID,
|
||||
FeatureFlags::balRequireOptInSameUid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean balRespectAppSwitchStateWhenCheckBoundByForegroundUid() {
|
||||
return getValue(Flags.FLAG_BAL_RESPECT_APP_SWITCH_STATE_WHEN_CHECK_BOUND_BY_FOREGROUND_UID,
|
||||
FeatureFlags::balRespectAppSwitchStateWhenCheckBoundByForegroundUid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean balShowToasts() {
|
||||
return getValue(Flags.FLAG_BAL_SHOW_TOASTS,
|
||||
FeatureFlags::balShowToasts);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean balShowToastsBlocked() {
|
||||
return getValue(Flags.FLAG_BAL_SHOW_TOASTS_BLOCKED,
|
||||
FeatureFlags::balShowToastsBlocked);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean blastSyncNotificationShadeOnDisplaySwitch() {
|
||||
return getValue(Flags.FLAG_BLAST_SYNC_NOTIFICATION_SHADE_ON_DISPLAY_SWITCH,
|
||||
FeatureFlags::blastSyncNotificationShadeOnDisplaySwitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean bundleClientTransactionFlag() {
|
||||
return getValue(Flags.FLAG_BUNDLE_CLIENT_TRANSACTION_FLAG,
|
||||
FeatureFlags::bundleClientTransactionFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean cameraCompatForFreeform() {
|
||||
return getValue(Flags.FLAG_CAMERA_COMPAT_FOR_FREEFORM,
|
||||
FeatureFlags::cameraCompatForFreeform);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean closeToSquareConfigIncludesStatusBar() {
|
||||
return getValue(Flags.FLAG_CLOSE_TO_SQUARE_CONFIG_INCLUDES_STATUS_BAR,
|
||||
FeatureFlags::closeToSquareConfigIncludesStatusBar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean configurableFontScaleDefault() {
|
||||
return getValue(Flags.FLAG_CONFIGURABLE_FONT_SCALE_DEFAULT,
|
||||
FeatureFlags::configurableFontScaleDefault);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean coverDisplayOptIn() {
|
||||
return getValue(Flags.FLAG_COVER_DISPLAY_OPT_IN,
|
||||
FeatureFlags::coverDisplayOptIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean deferDisplayUpdates() {
|
||||
return getValue(Flags.FLAG_DEFER_DISPLAY_UPDATES,
|
||||
FeatureFlags::deferDisplayUpdates);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean delayNotificationToMagnificationWhenRecentsWindowToFrontTransition() {
|
||||
return getValue(Flags.FLAG_DELAY_NOTIFICATION_TO_MAGNIFICATION_WHEN_RECENTS_WINDOW_TO_FRONT_TRANSITION,
|
||||
FeatureFlags::delayNotificationToMagnificationWhenRecentsWindowToFrontTransition);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean delegateUnhandledDrags() {
|
||||
return getValue(Flags.FLAG_DELEGATE_UNHANDLED_DRAGS,
|
||||
FeatureFlags::delegateUnhandledDrags);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean deleteCaptureDisplay() {
|
||||
return getValue(Flags.FLAG_DELETE_CAPTURE_DISPLAY,
|
||||
FeatureFlags::deleteCaptureDisplay);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean density390Api() {
|
||||
return getValue(Flags.FLAG_DENSITY_390_API,
|
||||
FeatureFlags::density390Api);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean disableObjectPool() {
|
||||
return getValue(Flags.FLAG_DISABLE_OBJECT_POOL,
|
||||
FeatureFlags::disableObjectPool);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean disableThinLetterboxingPolicy() {
|
||||
return getValue(Flags.FLAG_DISABLE_THIN_LETTERBOXING_POLICY,
|
||||
FeatureFlags::disableThinLetterboxingPolicy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean doNotCheckIntersectionWhenNonMagnifiableWindowTransitions() {
|
||||
return getValue(Flags.FLAG_DO_NOT_CHECK_INTERSECTION_WHEN_NON_MAGNIFIABLE_WINDOW_TRANSITIONS,
|
||||
FeatureFlags::doNotCheckIntersectionWhenNonMagnifiableWindowTransitions);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean drawSnapshotAspectRatioMatch() {
|
||||
return getValue(Flags.FLAG_DRAW_SNAPSHOT_ASPECT_RATIO_MATCH,
|
||||
FeatureFlags::drawSnapshotAspectRatioMatch);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean edgeToEdgeByDefault() {
|
||||
return getValue(Flags.FLAG_EDGE_TO_EDGE_BY_DEFAULT,
|
||||
FeatureFlags::edgeToEdgeByDefault);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean embeddedActivityBackNavFlag() {
|
||||
return getValue(Flags.FLAG_EMBEDDED_ACTIVITY_BACK_NAV_FLAG,
|
||||
FeatureFlags::embeddedActivityBackNavFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableAdditionalWindowsAboveStatusBar() {
|
||||
return getValue(Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR,
|
||||
FeatureFlags::enableAdditionalWindowsAboveStatusBar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableAppHeaderWithTaskDensity() {
|
||||
return getValue(Flags.FLAG_ENABLE_APP_HEADER_WITH_TASK_DENSITY,
|
||||
FeatureFlags::enableAppHeaderWithTaskDensity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableBufferTransformHintFromDisplay() {
|
||||
return getValue(Flags.FLAG_ENABLE_BUFFER_TRANSFORM_HINT_FROM_DISPLAY,
|
||||
FeatureFlags::enableBufferTransformHintFromDisplay);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableCameraCompatForDesktopWindowing() {
|
||||
return getValue(Flags.FLAG_ENABLE_CAMERA_COMPAT_FOR_DESKTOP_WINDOWING,
|
||||
FeatureFlags::enableCameraCompatForDesktopWindowing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableCompatuiSysuiLauncher() {
|
||||
return getValue(Flags.FLAG_ENABLE_COMPATUI_SYSUI_LAUNCHER,
|
||||
FeatureFlags::enableCompatuiSysuiLauncher);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableDesktopWindowingImmersiveHandleHiding() {
|
||||
return getValue(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_IMMERSIVE_HANDLE_HIDING,
|
||||
FeatureFlags::enableDesktopWindowingImmersiveHandleHiding);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableDesktopWindowingModalsPolicy() {
|
||||
return getValue(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODALS_POLICY,
|
||||
FeatureFlags::enableDesktopWindowingModalsPolicy);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableDesktopWindowingMode() {
|
||||
return getValue(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODE,
|
||||
FeatureFlags::enableDesktopWindowingMode);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableDesktopWindowingQuickSwitch() {
|
||||
return getValue(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_QUICK_SWITCH,
|
||||
FeatureFlags::enableDesktopWindowingQuickSwitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableDesktopWindowingScvhCache() {
|
||||
return getValue(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_SCVH_CACHE,
|
||||
FeatureFlags::enableDesktopWindowingScvhCache);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableDesktopWindowingSizeConstraints() {
|
||||
return getValue(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_SIZE_CONSTRAINTS,
|
||||
FeatureFlags::enableDesktopWindowingSizeConstraints);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableDesktopWindowingTaskLimit() {
|
||||
return getValue(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_TASK_LIMIT,
|
||||
FeatureFlags::enableDesktopWindowingTaskLimit);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableDesktopWindowingTaskbarRunningApps() {
|
||||
return getValue(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_TASKBAR_RUNNING_APPS,
|
||||
FeatureFlags::enableDesktopWindowingTaskbarRunningApps);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableDesktopWindowingWallpaperActivity() {
|
||||
return getValue(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY,
|
||||
FeatureFlags::enableDesktopWindowingWallpaperActivity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableScaledResizing() {
|
||||
return getValue(Flags.FLAG_ENABLE_SCALED_RESIZING,
|
||||
FeatureFlags::enableScaledResizing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableTaskStackObserverInShell() {
|
||||
return getValue(Flags.FLAG_ENABLE_TASK_STACK_OBSERVER_IN_SHELL,
|
||||
FeatureFlags::enableTaskStackObserverInShell);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableThemedAppHeaders() {
|
||||
return getValue(Flags.FLAG_ENABLE_THEMED_APP_HEADERS,
|
||||
FeatureFlags::enableThemedAppHeaders);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableWindowingDynamicInitialBounds() {
|
||||
return getValue(Flags.FLAG_ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS,
|
||||
FeatureFlags::enableWindowingDynamicInitialBounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableWindowingEdgeDragResize() {
|
||||
return getValue(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE,
|
||||
FeatureFlags::enableWindowingEdgeDragResize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableWmExtensionsForAllFlag() {
|
||||
return getValue(Flags.FLAG_ENABLE_WM_EXTENSIONS_FOR_ALL_FLAG,
|
||||
FeatureFlags::enableWmExtensionsForAllFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enforceEdgeToEdge() {
|
||||
return getValue(Flags.FLAG_ENFORCE_EDGE_TO_EDGE,
|
||||
FeatureFlags::enforceEdgeToEdge);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean ensureWallpaperInTransitions() {
|
||||
return getValue(Flags.FLAG_ENSURE_WALLPAPER_IN_TRANSITIONS,
|
||||
FeatureFlags::ensureWallpaperInTransitions);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean explicitRefreshRateHints() {
|
||||
return getValue(Flags.FLAG_EXPLICIT_REFRESH_RATE_HINTS,
|
||||
FeatureFlags::explicitRefreshRateHints);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean fifoPriorityForMajorUiProcesses() {
|
||||
return getValue(Flags.FLAG_FIFO_PRIORITY_FOR_MAJOR_UI_PROCESSES,
|
||||
FeatureFlags::fifoPriorityForMajorUiProcesses);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean fixNoContainerUpdateWithoutResize() {
|
||||
return getValue(Flags.FLAG_FIX_NO_CONTAINER_UPDATE_WITHOUT_RESIZE,
|
||||
FeatureFlags::fixNoContainerUpdateWithoutResize);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean fixPipRestoreToOverlay() {
|
||||
return getValue(Flags.FLAG_FIX_PIP_RESTORE_TO_OVERLAY,
|
||||
FeatureFlags::fixPipRestoreToOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean fullscreenDimFlag() {
|
||||
return getValue(Flags.FLAG_FULLSCREEN_DIM_FLAG,
|
||||
FeatureFlags::fullscreenDimFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean getDimmerOnClosing() {
|
||||
return getValue(Flags.FLAG_GET_DIMMER_ON_CLOSING,
|
||||
FeatureFlags::getDimmerOnClosing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean immersiveAppRepositioning() {
|
||||
return getValue(Flags.FLAG_IMMERSIVE_APP_REPOSITIONING,
|
||||
FeatureFlags::immersiveAppRepositioning);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean insetsControlChangedItem() {
|
||||
return getValue(Flags.FLAG_INSETS_CONTROL_CHANGED_ITEM,
|
||||
FeatureFlags::insetsControlChangedItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean insetsControlSeq() {
|
||||
return getValue(Flags.FLAG_INSETS_CONTROL_SEQ,
|
||||
FeatureFlags::insetsControlSeq);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean insetsDecoupledConfiguration() {
|
||||
return getValue(Flags.FLAG_INSETS_DECOUPLED_CONFIGURATION,
|
||||
FeatureFlags::insetsDecoupledConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean introduceSmootherDimmer() {
|
||||
return getValue(Flags.FLAG_INTRODUCE_SMOOTHER_DIMMER,
|
||||
FeatureFlags::introduceSmootherDimmer);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean keyguardAppearTransition() {
|
||||
return getValue(Flags.FLAG_KEYGUARD_APPEAR_TRANSITION,
|
||||
FeatureFlags::keyguardAppearTransition);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean letterboxBackgroundWallpaper() {
|
||||
return getValue(Flags.FLAG_LETTERBOX_BACKGROUND_WALLPAPER,
|
||||
FeatureFlags::letterboxBackgroundWallpaper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean movableCutoutConfiguration() {
|
||||
return getValue(Flags.FLAG_MOVABLE_CUTOUT_CONFIGURATION,
|
||||
FeatureFlags::movableCutoutConfiguration);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean moveAnimationOptionsToChange() {
|
||||
return getValue(Flags.FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE,
|
||||
FeatureFlags::moveAnimationOptionsToChange);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean multiCrop() {
|
||||
return getValue(Flags.FLAG_MULTI_CROP,
|
||||
FeatureFlags::multiCrop);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean navBarTransparentByDefault() {
|
||||
return getValue(Flags.FLAG_NAV_BAR_TRANSPARENT_BY_DEFAULT,
|
||||
FeatureFlags::navBarTransparentByDefault);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean noConsecutiveVisibilityEvents() {
|
||||
return getValue(Flags.FLAG_NO_CONSECUTIVE_VISIBILITY_EVENTS,
|
||||
FeatureFlags::noConsecutiveVisibilityEvents);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean noVisibilityEventOnDisplayStateChange() {
|
||||
return getValue(Flags.FLAG_NO_VISIBILITY_EVENT_ON_DISPLAY_STATE_CHANGE,
|
||||
FeatureFlags::noVisibilityEventOnDisplayStateChange);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean offloadColorExtraction() {
|
||||
return getValue(Flags.FLAG_OFFLOAD_COLOR_EXTRACTION,
|
||||
FeatureFlags::offloadColorExtraction);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean predictiveBackSystemAnims() {
|
||||
return getValue(Flags.FLAG_PREDICTIVE_BACK_SYSTEM_ANIMS,
|
||||
FeatureFlags::predictiveBackSystemAnims);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean rearDisplayDisableForceDesktopSystemDecorations() {
|
||||
return getValue(Flags.FLAG_REAR_DISPLAY_DISABLE_FORCE_DESKTOP_SYSTEM_DECORATIONS,
|
||||
FeatureFlags::rearDisplayDisableForceDesktopSystemDecorations);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean releaseSnapshotAggressively() {
|
||||
return getValue(Flags.FLAG_RELEASE_SNAPSHOT_AGGRESSIVELY,
|
||||
FeatureFlags::releaseSnapshotAggressively);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean removePrepareSurfaceInPlacement() {
|
||||
return getValue(Flags.FLAG_REMOVE_PREPARE_SURFACE_IN_PLACEMENT,
|
||||
FeatureFlags::removePrepareSurfaceInPlacement);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean screenRecordingCallbacks() {
|
||||
return getValue(Flags.FLAG_SCREEN_RECORDING_CALLBACKS,
|
||||
FeatureFlags::screenRecordingCallbacks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean sdkDesiredPresentTime() {
|
||||
return getValue(Flags.FLAG_SDK_DESIRED_PRESENT_TIME,
|
||||
FeatureFlags::sdkDesiredPresentTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean secureWindowState() {
|
||||
return getValue(Flags.FLAG_SECURE_WINDOW_STATE,
|
||||
FeatureFlags::secureWindowState);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean setScPropertiesInClient() {
|
||||
return getValue(Flags.FLAG_SET_SC_PROPERTIES_IN_CLIENT,
|
||||
FeatureFlags::setScPropertiesInClient);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean skipSleepingWhenSwitchingDisplay() {
|
||||
return getValue(Flags.FLAG_SKIP_SLEEPING_WHEN_SWITCHING_DISPLAY,
|
||||
FeatureFlags::skipSleepingWhenSwitchingDisplay);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean supportsMultiInstanceSystemUi() {
|
||||
return getValue(Flags.FLAG_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI,
|
||||
FeatureFlags::supportsMultiInstanceSystemUi);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean surfaceControlInputReceiver() {
|
||||
return getValue(Flags.FLAG_SURFACE_CONTROL_INPUT_RECEIVER,
|
||||
FeatureFlags::surfaceControlInputReceiver);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean surfaceTrustedOverlay() {
|
||||
return getValue(Flags.FLAG_SURFACE_TRUSTED_OVERLAY,
|
||||
FeatureFlags::surfaceTrustedOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean syncScreenCapture() {
|
||||
return getValue(Flags.FLAG_SYNC_SCREEN_CAPTURE,
|
||||
FeatureFlags::syncScreenCapture);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean taskFragmentSystemOrganizerFlag() {
|
||||
return getValue(Flags.FLAG_TASK_FRAGMENT_SYSTEM_ORGANIZER_FLAG,
|
||||
FeatureFlags::taskFragmentSystemOrganizerFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean transitReadyTracking() {
|
||||
return getValue(Flags.FLAG_TRANSIT_READY_TRACKING,
|
||||
FeatureFlags::transitReadyTracking);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean trustedPresentationListenerForWindow() {
|
||||
return getValue(Flags.FLAG_TRUSTED_PRESENTATION_LISTENER_FOR_WINDOW,
|
||||
FeatureFlags::trustedPresentationListenerForWindow);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean untrustedEmbeddingAnyAppPermission() {
|
||||
return getValue(Flags.FLAG_UNTRUSTED_EMBEDDING_ANY_APP_PERMISSION,
|
||||
FeatureFlags::untrustedEmbeddingAnyAppPermission);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean untrustedEmbeddingStateSharing() {
|
||||
return getValue(Flags.FLAG_UNTRUSTED_EMBEDDING_STATE_SHARING,
|
||||
FeatureFlags::untrustedEmbeddingStateSharing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean useWindowOriginalTouchableRegionWhenMagnificationRecomputeBounds() {
|
||||
return getValue(Flags.FLAG_USE_WINDOW_ORIGINAL_TOUCHABLE_REGION_WHEN_MAGNIFICATION_RECOMPUTE_BOUNDS,
|
||||
FeatureFlags::useWindowOriginalTouchableRegionWhenMagnificationRecomputeBounds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean userMinAspectRatioAppDefault() {
|
||||
return getValue(Flags.FLAG_USER_MIN_ASPECT_RATIO_APP_DEFAULT,
|
||||
FeatureFlags::userMinAspectRatioAppDefault);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean waitForTransitionOnDisplaySwitch() {
|
||||
return getValue(Flags.FLAG_WAIT_FOR_TRANSITION_ON_DISPLAY_SWITCH,
|
||||
FeatureFlags::waitForTransitionOnDisplaySwitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean wallpaperOffsetAsync() {
|
||||
return getValue(Flags.FLAG_WALLPAPER_OFFSET_ASYNC,
|
||||
FeatureFlags::wallpaperOffsetAsync);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean windowSessionRelayoutInfo() {
|
||||
return getValue(Flags.FLAG_WINDOW_SESSION_RELAYOUT_INFO,
|
||||
FeatureFlags::windowSessionRelayoutInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean windowTokenConfigThreadSafe() {
|
||||
return getValue(Flags.FLAG_WINDOW_TOKEN_CONFIG_THREAD_SAFE,
|
||||
FeatureFlags::windowTokenConfigThreadSafe);
|
||||
}
|
||||
|
||||
public boolean isFlagReadOnlyOptimized(String flagName) {
|
||||
if (mReadOnlyFlagsSet.contains(flagName) &&
|
||||
isOptimizationEnabled()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isOptimizationEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) {
|
||||
return mGetValueImpl.test(flagName, getter);
|
||||
}
|
||||
|
||||
public List<String> getFlagNames() {
|
||||
return Arrays.asList(
|
||||
Flags.FLAG_ACTIVITY_EMBEDDING_ANIMATION_CUSTOMIZATION_FLAG,
|
||||
Flags.FLAG_ACTIVITY_EMBEDDING_INTERACTIVE_DIVIDER_FLAG,
|
||||
Flags.FLAG_ACTIVITY_EMBEDDING_OVERLAY_PRESENTATION_FLAG,
|
||||
Flags.FLAG_ACTIVITY_SNAPSHOT_BY_DEFAULT,
|
||||
Flags.FLAG_ACTIVITY_WINDOW_INFO_FLAG,
|
||||
Flags.FLAG_ALLOW_DISABLE_ACTIVITY_RECORD_INPUT_SINK,
|
||||
Flags.FLAG_ALLOW_HIDE_SCM_BUTTON,
|
||||
Flags.FLAG_ALLOWS_SCREEN_SIZE_DECOUPLED_FROM_STATUS_BAR_AND_CUTOUT,
|
||||
Flags.FLAG_ALWAYS_DEFER_TRANSITION_WHEN_APPLY_WCT,
|
||||
Flags.FLAG_ALWAYS_DRAW_MAGNIFICATION_FULLSCREEN_BORDER,
|
||||
Flags.FLAG_ALWAYS_UPDATE_WALLPAPER_PERMISSION,
|
||||
Flags.FLAG_APP_COMPAT_PROPERTIES_API,
|
||||
Flags.FLAG_APP_COMPAT_REFACTORING,
|
||||
Flags.FLAG_BAL_DONT_BRING_EXISTING_BACKGROUND_TASK_STACK_TO_FG,
|
||||
Flags.FLAG_BAL_IMPROVE_REAL_CALLER_VISIBILITY_CHECK,
|
||||
Flags.FLAG_BAL_IMPROVED_METRICS,
|
||||
Flags.FLAG_BAL_REQUIRE_OPT_IN_BY_PENDING_INTENT_CREATOR,
|
||||
Flags.FLAG_BAL_REQUIRE_OPT_IN_SAME_UID,
|
||||
Flags.FLAG_BAL_RESPECT_APP_SWITCH_STATE_WHEN_CHECK_BOUND_BY_FOREGROUND_UID,
|
||||
Flags.FLAG_BAL_SHOW_TOASTS,
|
||||
Flags.FLAG_BAL_SHOW_TOASTS_BLOCKED,
|
||||
Flags.FLAG_BLAST_SYNC_NOTIFICATION_SHADE_ON_DISPLAY_SWITCH,
|
||||
Flags.FLAG_BUNDLE_CLIENT_TRANSACTION_FLAG,
|
||||
Flags.FLAG_CAMERA_COMPAT_FOR_FREEFORM,
|
||||
Flags.FLAG_CLOSE_TO_SQUARE_CONFIG_INCLUDES_STATUS_BAR,
|
||||
Flags.FLAG_CONFIGURABLE_FONT_SCALE_DEFAULT,
|
||||
Flags.FLAG_COVER_DISPLAY_OPT_IN,
|
||||
Flags.FLAG_DEFER_DISPLAY_UPDATES,
|
||||
Flags.FLAG_DELAY_NOTIFICATION_TO_MAGNIFICATION_WHEN_RECENTS_WINDOW_TO_FRONT_TRANSITION,
|
||||
Flags.FLAG_DELEGATE_UNHANDLED_DRAGS,
|
||||
Flags.FLAG_DELETE_CAPTURE_DISPLAY,
|
||||
Flags.FLAG_DENSITY_390_API,
|
||||
Flags.FLAG_DISABLE_OBJECT_POOL,
|
||||
Flags.FLAG_DISABLE_THIN_LETTERBOXING_POLICY,
|
||||
Flags.FLAG_DO_NOT_CHECK_INTERSECTION_WHEN_NON_MAGNIFIABLE_WINDOW_TRANSITIONS,
|
||||
Flags.FLAG_DRAW_SNAPSHOT_ASPECT_RATIO_MATCH,
|
||||
Flags.FLAG_EDGE_TO_EDGE_BY_DEFAULT,
|
||||
Flags.FLAG_EMBEDDED_ACTIVITY_BACK_NAV_FLAG,
|
||||
Flags.FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR,
|
||||
Flags.FLAG_ENABLE_APP_HEADER_WITH_TASK_DENSITY,
|
||||
Flags.FLAG_ENABLE_BUFFER_TRANSFORM_HINT_FROM_DISPLAY,
|
||||
Flags.FLAG_ENABLE_CAMERA_COMPAT_FOR_DESKTOP_WINDOWING,
|
||||
Flags.FLAG_ENABLE_COMPATUI_SYSUI_LAUNCHER,
|
||||
Flags.FLAG_ENABLE_DESKTOP_WINDOWING_IMMERSIVE_HANDLE_HIDING,
|
||||
Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODALS_POLICY,
|
||||
Flags.FLAG_ENABLE_DESKTOP_WINDOWING_MODE,
|
||||
Flags.FLAG_ENABLE_DESKTOP_WINDOWING_QUICK_SWITCH,
|
||||
Flags.FLAG_ENABLE_DESKTOP_WINDOWING_SCVH_CACHE,
|
||||
Flags.FLAG_ENABLE_DESKTOP_WINDOWING_SIZE_CONSTRAINTS,
|
||||
Flags.FLAG_ENABLE_DESKTOP_WINDOWING_TASK_LIMIT,
|
||||
Flags.FLAG_ENABLE_DESKTOP_WINDOWING_TASKBAR_RUNNING_APPS,
|
||||
Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY,
|
||||
Flags.FLAG_ENABLE_SCALED_RESIZING,
|
||||
Flags.FLAG_ENABLE_TASK_STACK_OBSERVER_IN_SHELL,
|
||||
Flags.FLAG_ENABLE_THEMED_APP_HEADERS,
|
||||
Flags.FLAG_ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS,
|
||||
Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE,
|
||||
Flags.FLAG_ENABLE_WM_EXTENSIONS_FOR_ALL_FLAG,
|
||||
Flags.FLAG_ENFORCE_EDGE_TO_EDGE,
|
||||
Flags.FLAG_ENSURE_WALLPAPER_IN_TRANSITIONS,
|
||||
Flags.FLAG_EXPLICIT_REFRESH_RATE_HINTS,
|
||||
Flags.FLAG_FIFO_PRIORITY_FOR_MAJOR_UI_PROCESSES,
|
||||
Flags.FLAG_FIX_NO_CONTAINER_UPDATE_WITHOUT_RESIZE,
|
||||
Flags.FLAG_FIX_PIP_RESTORE_TO_OVERLAY,
|
||||
Flags.FLAG_FULLSCREEN_DIM_FLAG,
|
||||
Flags.FLAG_GET_DIMMER_ON_CLOSING,
|
||||
Flags.FLAG_IMMERSIVE_APP_REPOSITIONING,
|
||||
Flags.FLAG_INSETS_CONTROL_CHANGED_ITEM,
|
||||
Flags.FLAG_INSETS_CONTROL_SEQ,
|
||||
Flags.FLAG_INSETS_DECOUPLED_CONFIGURATION,
|
||||
Flags.FLAG_INTRODUCE_SMOOTHER_DIMMER,
|
||||
Flags.FLAG_KEYGUARD_APPEAR_TRANSITION,
|
||||
Flags.FLAG_LETTERBOX_BACKGROUND_WALLPAPER,
|
||||
Flags.FLAG_MOVABLE_CUTOUT_CONFIGURATION,
|
||||
Flags.FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE,
|
||||
Flags.FLAG_MULTI_CROP,
|
||||
Flags.FLAG_NAV_BAR_TRANSPARENT_BY_DEFAULT,
|
||||
Flags.FLAG_NO_CONSECUTIVE_VISIBILITY_EVENTS,
|
||||
Flags.FLAG_NO_VISIBILITY_EVENT_ON_DISPLAY_STATE_CHANGE,
|
||||
Flags.FLAG_OFFLOAD_COLOR_EXTRACTION,
|
||||
Flags.FLAG_PREDICTIVE_BACK_SYSTEM_ANIMS,
|
||||
Flags.FLAG_REAR_DISPLAY_DISABLE_FORCE_DESKTOP_SYSTEM_DECORATIONS,
|
||||
Flags.FLAG_RELEASE_SNAPSHOT_AGGRESSIVELY,
|
||||
Flags.FLAG_REMOVE_PREPARE_SURFACE_IN_PLACEMENT,
|
||||
Flags.FLAG_SCREEN_RECORDING_CALLBACKS,
|
||||
Flags.FLAG_SDK_DESIRED_PRESENT_TIME,
|
||||
Flags.FLAG_SECURE_WINDOW_STATE,
|
||||
Flags.FLAG_SET_SC_PROPERTIES_IN_CLIENT,
|
||||
Flags.FLAG_SKIP_SLEEPING_WHEN_SWITCHING_DISPLAY,
|
||||
Flags.FLAG_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI,
|
||||
Flags.FLAG_SURFACE_CONTROL_INPUT_RECEIVER,
|
||||
Flags.FLAG_SURFACE_TRUSTED_OVERLAY,
|
||||
Flags.FLAG_SYNC_SCREEN_CAPTURE,
|
||||
Flags.FLAG_TASK_FRAGMENT_SYSTEM_ORGANIZER_FLAG,
|
||||
Flags.FLAG_TRANSIT_READY_TRACKING,
|
||||
Flags.FLAG_TRUSTED_PRESENTATION_LISTENER_FOR_WINDOW,
|
||||
Flags.FLAG_UNTRUSTED_EMBEDDING_ANY_APP_PERMISSION,
|
||||
Flags.FLAG_UNTRUSTED_EMBEDDING_STATE_SHARING,
|
||||
Flags.FLAG_USE_WINDOW_ORIGINAL_TOUCHABLE_REGION_WHEN_MAGNIFICATION_RECOMPUTE_BOUNDS,
|
||||
Flags.FLAG_USER_MIN_ASPECT_RATIO_APP_DEFAULT,
|
||||
Flags.FLAG_WAIT_FOR_TRANSITION_ON_DISPLAY_SWITCH,
|
||||
Flags.FLAG_WALLPAPER_OFFSET_ASYNC,
|
||||
Flags.FLAG_WINDOW_SESSION_RELAYOUT_INFO,
|
||||
Flags.FLAG_WINDOW_TOKEN_CONFIG_THREAD_SAFE
|
||||
);
|
||||
}
|
||||
|
||||
private Set<String> mReadOnlyFlagsSet = new HashSet<>(
|
||||
Arrays.asList(
|
||||
Flags.FLAG_ACTIVITY_SNAPSHOT_BY_DEFAULT,
|
||||
Flags.FLAG_ACTIVITY_WINDOW_INFO_FLAG,
|
||||
Flags.FLAG_ALLOW_DISABLE_ACTIVITY_RECORD_INPUT_SINK,
|
||||
Flags.FLAG_ALLOWS_SCREEN_SIZE_DECOUPLED_FROM_STATUS_BAR_AND_CUTOUT,
|
||||
Flags.FLAG_APP_COMPAT_PROPERTIES_API,
|
||||
Flags.FLAG_APP_COMPAT_REFACTORING,
|
||||
Flags.FLAG_BUNDLE_CLIENT_TRANSACTION_FLAG,
|
||||
Flags.FLAG_CAMERA_COMPAT_FOR_FREEFORM,
|
||||
Flags.FLAG_CONFIGURABLE_FONT_SCALE_DEFAULT,
|
||||
Flags.FLAG_COVER_DISPLAY_OPT_IN,
|
||||
Flags.FLAG_DEFER_DISPLAY_UPDATES,
|
||||
Flags.FLAG_DELEGATE_UNHANDLED_DRAGS,
|
||||
Flags.FLAG_DELETE_CAPTURE_DISPLAY,
|
||||
Flags.FLAG_DENSITY_390_API,
|
||||
Flags.FLAG_DISABLE_OBJECT_POOL,
|
||||
Flags.FLAG_DRAW_SNAPSHOT_ASPECT_RATIO_MATCH,
|
||||
Flags.FLAG_ENABLE_BUFFER_TRANSFORM_HINT_FROM_DISPLAY,
|
||||
Flags.FLAG_ENABLE_SCALED_RESIZING,
|
||||
Flags.FLAG_ENABLE_WM_EXTENSIONS_FOR_ALL_FLAG,
|
||||
Flags.FLAG_ENFORCE_EDGE_TO_EDGE,
|
||||
Flags.FLAG_EXPLICIT_REFRESH_RATE_HINTS,
|
||||
Flags.FLAG_FIFO_PRIORITY_FOR_MAJOR_UI_PROCESSES,
|
||||
Flags.FLAG_FIX_NO_CONTAINER_UPDATE_WITHOUT_RESIZE,
|
||||
Flags.FLAG_GET_DIMMER_ON_CLOSING,
|
||||
Flags.FLAG_INSETS_CONTROL_SEQ,
|
||||
Flags.FLAG_INSETS_DECOUPLED_CONFIGURATION,
|
||||
Flags.FLAG_INTRODUCE_SMOOTHER_DIMMER,
|
||||
Flags.FLAG_KEYGUARD_APPEAR_TRANSITION,
|
||||
Flags.FLAG_MOVABLE_CUTOUT_CONFIGURATION,
|
||||
Flags.FLAG_REAR_DISPLAY_DISABLE_FORCE_DESKTOP_SYSTEM_DECORATIONS,
|
||||
Flags.FLAG_RELEASE_SNAPSHOT_AGGRESSIVELY,
|
||||
Flags.FLAG_REMOVE_PREPARE_SURFACE_IN_PLACEMENT,
|
||||
Flags.FLAG_SCREEN_RECORDING_CALLBACKS,
|
||||
Flags.FLAG_SDK_DESIRED_PRESENT_TIME,
|
||||
Flags.FLAG_SECURE_WINDOW_STATE,
|
||||
Flags.FLAG_SET_SC_PROPERTIES_IN_CLIENT,
|
||||
Flags.FLAG_SKIP_SLEEPING_WHEN_SWITCHING_DISPLAY,
|
||||
Flags.FLAG_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI,
|
||||
Flags.FLAG_SURFACE_CONTROL_INPUT_RECEIVER,
|
||||
Flags.FLAG_SURFACE_TRUSTED_OVERLAY,
|
||||
Flags.FLAG_SYNC_SCREEN_CAPTURE,
|
||||
Flags.FLAG_TRUSTED_PRESENTATION_LISTENER_FOR_WINDOW,
|
||||
Flags.FLAG_UNTRUSTED_EMBEDDING_ANY_APP_PERMISSION,
|
||||
Flags.FLAG_UNTRUSTED_EMBEDDING_STATE_SHARING,
|
||||
Flags.FLAG_WALLPAPER_OFFSET_ASYNC,
|
||||
Flags.FLAG_WINDOW_SESSION_RELAYOUT_INFO,
|
||||
""
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.android.window.flags;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** @hide */
|
||||
public class FakeFeatureFlagsImpl extends CustomFeatureFlags {
|
||||
private final Map<String, Boolean> mFlagMap = new HashMap<>();
|
||||
private final FeatureFlags mDefaults;
|
||||
|
||||
public FakeFeatureFlagsImpl() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public FakeFeatureFlagsImpl(FeatureFlags defaults) {
|
||||
super(null);
|
||||
mDefaults = defaults;
|
||||
// Initialize the map with null values
|
||||
for (String flagName : getFlagNames()) {
|
||||
mFlagMap.put(flagName, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) {
|
||||
Boolean value = this.mFlagMap.get(flagName);
|
||||
if (value != null) {
|
||||
return value;
|
||||
}
|
||||
if (mDefaults != null) {
|
||||
return getter.test(mDefaults);
|
||||
}
|
||||
throw new IllegalArgumentException(flagName + " is not set");
|
||||
}
|
||||
|
||||
public void setFlag(String flagName, boolean value) {
|
||||
if (!this.mFlagMap.containsKey(flagName)) {
|
||||
throw new IllegalArgumentException("no such flag " + flagName);
|
||||
}
|
||||
this.mFlagMap.put(flagName, value);
|
||||
}
|
||||
|
||||
public void resetAll() {
|
||||
for (Map.Entry entry : mFlagMap.entrySet()) {
|
||||
entry.setValue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
package com.android.window.flags;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
/** @hide */
|
||||
public interface FeatureFlags {
|
||||
|
||||
|
||||
boolean activityEmbeddingAnimationCustomizationFlag();
|
||||
|
||||
boolean activityEmbeddingInteractiveDividerFlag();
|
||||
|
||||
boolean activityEmbeddingOverlayPresentationFlag();
|
||||
|
||||
boolean activitySnapshotByDefault();
|
||||
|
||||
boolean activityWindowInfoFlag();
|
||||
|
||||
boolean allowDisableActivityRecordInputSink();
|
||||
|
||||
boolean allowHideScmButton();
|
||||
|
||||
boolean allowsScreenSizeDecoupledFromStatusBarAndCutout();
|
||||
|
||||
boolean alwaysDeferTransitionWhenApplyWct();
|
||||
|
||||
boolean alwaysDrawMagnificationFullscreenBorder();
|
||||
|
||||
boolean alwaysUpdateWallpaperPermission();
|
||||
|
||||
boolean appCompatPropertiesApi();
|
||||
|
||||
boolean appCompatRefactoring();
|
||||
|
||||
boolean balDontBringExistingBackgroundTaskStackToFg();
|
||||
|
||||
boolean balImproveRealCallerVisibilityCheck();
|
||||
|
||||
boolean balImprovedMetrics();
|
||||
|
||||
boolean balRequireOptInByPendingIntentCreator();
|
||||
|
||||
boolean balRequireOptInSameUid();
|
||||
|
||||
boolean balRespectAppSwitchStateWhenCheckBoundByForegroundUid();
|
||||
|
||||
boolean balShowToasts();
|
||||
|
||||
boolean balShowToastsBlocked();
|
||||
|
||||
boolean blastSyncNotificationShadeOnDisplaySwitch();
|
||||
|
||||
boolean bundleClientTransactionFlag();
|
||||
|
||||
boolean cameraCompatForFreeform();
|
||||
|
||||
boolean closeToSquareConfigIncludesStatusBar();
|
||||
|
||||
boolean configurableFontScaleDefault();
|
||||
|
||||
boolean coverDisplayOptIn();
|
||||
|
||||
boolean deferDisplayUpdates();
|
||||
|
||||
boolean delayNotificationToMagnificationWhenRecentsWindowToFrontTransition();
|
||||
|
||||
boolean delegateUnhandledDrags();
|
||||
|
||||
boolean deleteCaptureDisplay();
|
||||
|
||||
boolean density390Api();
|
||||
|
||||
boolean disableObjectPool();
|
||||
|
||||
boolean disableThinLetterboxingPolicy();
|
||||
|
||||
boolean doNotCheckIntersectionWhenNonMagnifiableWindowTransitions();
|
||||
|
||||
boolean drawSnapshotAspectRatioMatch();
|
||||
|
||||
boolean edgeToEdgeByDefault();
|
||||
|
||||
boolean embeddedActivityBackNavFlag();
|
||||
|
||||
boolean enableAdditionalWindowsAboveStatusBar();
|
||||
|
||||
boolean enableAppHeaderWithTaskDensity();
|
||||
|
||||
boolean enableBufferTransformHintFromDisplay();
|
||||
|
||||
boolean enableCameraCompatForDesktopWindowing();
|
||||
|
||||
boolean enableCompatuiSysuiLauncher();
|
||||
|
||||
boolean enableDesktopWindowingImmersiveHandleHiding();
|
||||
|
||||
boolean enableDesktopWindowingModalsPolicy();
|
||||
|
||||
boolean enableDesktopWindowingMode();
|
||||
|
||||
boolean enableDesktopWindowingQuickSwitch();
|
||||
|
||||
boolean enableDesktopWindowingScvhCache();
|
||||
|
||||
boolean enableDesktopWindowingSizeConstraints();
|
||||
|
||||
boolean enableDesktopWindowingTaskLimit();
|
||||
|
||||
boolean enableDesktopWindowingTaskbarRunningApps();
|
||||
|
||||
boolean enableDesktopWindowingWallpaperActivity();
|
||||
|
||||
boolean enableScaledResizing();
|
||||
|
||||
boolean enableTaskStackObserverInShell();
|
||||
|
||||
boolean enableThemedAppHeaders();
|
||||
|
||||
boolean enableWindowingDynamicInitialBounds();
|
||||
|
||||
boolean enableWindowingEdgeDragResize();
|
||||
|
||||
boolean enableWmExtensionsForAllFlag();
|
||||
|
||||
boolean enforceEdgeToEdge();
|
||||
|
||||
boolean ensureWallpaperInTransitions();
|
||||
|
||||
boolean explicitRefreshRateHints();
|
||||
|
||||
boolean fifoPriorityForMajorUiProcesses();
|
||||
|
||||
boolean fixNoContainerUpdateWithoutResize();
|
||||
|
||||
boolean fixPipRestoreToOverlay();
|
||||
|
||||
boolean fullscreenDimFlag();
|
||||
|
||||
boolean getDimmerOnClosing();
|
||||
|
||||
boolean immersiveAppRepositioning();
|
||||
|
||||
boolean insetsControlChangedItem();
|
||||
|
||||
boolean insetsControlSeq();
|
||||
|
||||
boolean insetsDecoupledConfiguration();
|
||||
|
||||
boolean introduceSmootherDimmer();
|
||||
|
||||
boolean keyguardAppearTransition();
|
||||
|
||||
boolean letterboxBackgroundWallpaper();
|
||||
|
||||
boolean movableCutoutConfiguration();
|
||||
|
||||
boolean moveAnimationOptionsToChange();
|
||||
|
||||
boolean multiCrop();
|
||||
|
||||
boolean navBarTransparentByDefault();
|
||||
|
||||
boolean noConsecutiveVisibilityEvents();
|
||||
|
||||
boolean noVisibilityEventOnDisplayStateChange();
|
||||
|
||||
boolean offloadColorExtraction();
|
||||
|
||||
boolean predictiveBackSystemAnims();
|
||||
|
||||
boolean rearDisplayDisableForceDesktopSystemDecorations();
|
||||
|
||||
boolean releaseSnapshotAggressively();
|
||||
|
||||
boolean removePrepareSurfaceInPlacement();
|
||||
|
||||
boolean screenRecordingCallbacks();
|
||||
|
||||
boolean sdkDesiredPresentTime();
|
||||
|
||||
boolean secureWindowState();
|
||||
|
||||
boolean setScPropertiesInClient();
|
||||
|
||||
boolean skipSleepingWhenSwitchingDisplay();
|
||||
|
||||
boolean supportsMultiInstanceSystemUi();
|
||||
|
||||
boolean surfaceControlInputReceiver();
|
||||
|
||||
boolean surfaceTrustedOverlay();
|
||||
|
||||
boolean syncScreenCapture();
|
||||
|
||||
boolean taskFragmentSystemOrganizerFlag();
|
||||
|
||||
boolean transitReadyTracking();
|
||||
|
||||
boolean trustedPresentationListenerForWindow();
|
||||
|
||||
boolean untrustedEmbeddingAnyAppPermission();
|
||||
|
||||
boolean untrustedEmbeddingStateSharing();
|
||||
|
||||
boolean useWindowOriginalTouchableRegionWhenMagnificationRecomputeBounds();
|
||||
|
||||
boolean userMinAspectRatioAppDefault();
|
||||
|
||||
boolean waitForTransitionOnDisplaySwitch();
|
||||
|
||||
boolean wallpaperOffsetAsync();
|
||||
|
||||
boolean windowSessionRelayoutInfo();
|
||||
|
||||
boolean windowTokenConfigThreadSafe();
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,632 @@
|
||||
package com.android.window.flags;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
/** @hide */
|
||||
public final class Flags {
|
||||
/** @hide */
|
||||
public static final String FLAG_ACTIVITY_EMBEDDING_ANIMATION_CUSTOMIZATION_FLAG = "com.android.window.flags.activity_embedding_animation_customization_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_ACTIVITY_EMBEDDING_INTERACTIVE_DIVIDER_FLAG = "com.android.window.flags.activity_embedding_interactive_divider_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_ACTIVITY_EMBEDDING_OVERLAY_PRESENTATION_FLAG = "com.android.window.flags.activity_embedding_overlay_presentation_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_ACTIVITY_SNAPSHOT_BY_DEFAULT = "com.android.window.flags.activity_snapshot_by_default";
|
||||
/** @hide */
|
||||
public static final String FLAG_ACTIVITY_WINDOW_INFO_FLAG = "com.android.window.flags.activity_window_info_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_ALLOW_DISABLE_ACTIVITY_RECORD_INPUT_SINK = "com.android.window.flags.allow_disable_activity_record_input_sink";
|
||||
/** @hide */
|
||||
public static final String FLAG_ALLOW_HIDE_SCM_BUTTON = "com.android.window.flags.allow_hide_scm_button";
|
||||
/** @hide */
|
||||
public static final String FLAG_ALLOWS_SCREEN_SIZE_DECOUPLED_FROM_STATUS_BAR_AND_CUTOUT = "com.android.window.flags.allows_screen_size_decoupled_from_status_bar_and_cutout";
|
||||
/** @hide */
|
||||
public static final String FLAG_ALWAYS_DEFER_TRANSITION_WHEN_APPLY_WCT = "com.android.window.flags.always_defer_transition_when_apply_wct";
|
||||
/** @hide */
|
||||
public static final String FLAG_ALWAYS_DRAW_MAGNIFICATION_FULLSCREEN_BORDER = "com.android.window.flags.always_draw_magnification_fullscreen_border";
|
||||
/** @hide */
|
||||
public static final String FLAG_ALWAYS_UPDATE_WALLPAPER_PERMISSION = "com.android.window.flags.always_update_wallpaper_permission";
|
||||
/** @hide */
|
||||
public static final String FLAG_APP_COMPAT_PROPERTIES_API = "com.android.window.flags.app_compat_properties_api";
|
||||
/** @hide */
|
||||
public static final String FLAG_APP_COMPAT_REFACTORING = "com.android.window.flags.app_compat_refactoring";
|
||||
/** @hide */
|
||||
public static final String FLAG_BAL_DONT_BRING_EXISTING_BACKGROUND_TASK_STACK_TO_FG = "com.android.window.flags.bal_dont_bring_existing_background_task_stack_to_fg";
|
||||
/** @hide */
|
||||
public static final String FLAG_BAL_IMPROVE_REAL_CALLER_VISIBILITY_CHECK = "com.android.window.flags.bal_improve_real_caller_visibility_check";
|
||||
/** @hide */
|
||||
public static final String FLAG_BAL_IMPROVED_METRICS = "com.android.window.flags.bal_improved_metrics";
|
||||
/** @hide */
|
||||
public static final String FLAG_BAL_REQUIRE_OPT_IN_BY_PENDING_INTENT_CREATOR = "com.android.window.flags.bal_require_opt_in_by_pending_intent_creator";
|
||||
/** @hide */
|
||||
public static final String FLAG_BAL_REQUIRE_OPT_IN_SAME_UID = "com.android.window.flags.bal_require_opt_in_same_uid";
|
||||
/** @hide */
|
||||
public static final String FLAG_BAL_RESPECT_APP_SWITCH_STATE_WHEN_CHECK_BOUND_BY_FOREGROUND_UID = "com.android.window.flags.bal_respect_app_switch_state_when_check_bound_by_foreground_uid";
|
||||
/** @hide */
|
||||
public static final String FLAG_BAL_SHOW_TOASTS = "com.android.window.flags.bal_show_toasts";
|
||||
/** @hide */
|
||||
public static final String FLAG_BAL_SHOW_TOASTS_BLOCKED = "com.android.window.flags.bal_show_toasts_blocked";
|
||||
/** @hide */
|
||||
public static final String FLAG_BLAST_SYNC_NOTIFICATION_SHADE_ON_DISPLAY_SWITCH = "com.android.window.flags.blast_sync_notification_shade_on_display_switch";
|
||||
/** @hide */
|
||||
public static final String FLAG_BUNDLE_CLIENT_TRANSACTION_FLAG = "com.android.window.flags.bundle_client_transaction_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_CAMERA_COMPAT_FOR_FREEFORM = "com.android.window.flags.camera_compat_for_freeform";
|
||||
/** @hide */
|
||||
public static final String FLAG_CLOSE_TO_SQUARE_CONFIG_INCLUDES_STATUS_BAR = "com.android.window.flags.close_to_square_config_includes_status_bar";
|
||||
/** @hide */
|
||||
public static final String FLAG_CONFIGURABLE_FONT_SCALE_DEFAULT = "com.android.window.flags.configurable_font_scale_default";
|
||||
/** @hide */
|
||||
public static final String FLAG_COVER_DISPLAY_OPT_IN = "com.android.window.flags.cover_display_opt_in";
|
||||
/** @hide */
|
||||
public static final String FLAG_DEFER_DISPLAY_UPDATES = "com.android.window.flags.defer_display_updates";
|
||||
/** @hide */
|
||||
public static final String FLAG_DELAY_NOTIFICATION_TO_MAGNIFICATION_WHEN_RECENTS_WINDOW_TO_FRONT_TRANSITION = "com.android.window.flags.delay_notification_to_magnification_when_recents_window_to_front_transition";
|
||||
/** @hide */
|
||||
public static final String FLAG_DELEGATE_UNHANDLED_DRAGS = "com.android.window.flags.delegate_unhandled_drags";
|
||||
/** @hide */
|
||||
public static final String FLAG_DELETE_CAPTURE_DISPLAY = "com.android.window.flags.delete_capture_display";
|
||||
/** @hide */
|
||||
public static final String FLAG_DENSITY_390_API = "com.android.window.flags.density_390_api";
|
||||
/** @hide */
|
||||
public static final String FLAG_DISABLE_OBJECT_POOL = "com.android.window.flags.disable_object_pool";
|
||||
/** @hide */
|
||||
public static final String FLAG_DISABLE_THIN_LETTERBOXING_POLICY = "com.android.window.flags.disable_thin_letterboxing_policy";
|
||||
/** @hide */
|
||||
public static final String FLAG_DO_NOT_CHECK_INTERSECTION_WHEN_NON_MAGNIFIABLE_WINDOW_TRANSITIONS = "com.android.window.flags.do_not_check_intersection_when_non_magnifiable_window_transitions";
|
||||
/** @hide */
|
||||
public static final String FLAG_DRAW_SNAPSHOT_ASPECT_RATIO_MATCH = "com.android.window.flags.draw_snapshot_aspect_ratio_match";
|
||||
/** @hide */
|
||||
public static final String FLAG_EDGE_TO_EDGE_BY_DEFAULT = "com.android.window.flags.edge_to_edge_by_default";
|
||||
/** @hide */
|
||||
public static final String FLAG_EMBEDDED_ACTIVITY_BACK_NAV_FLAG = "com.android.window.flags.embedded_activity_back_nav_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_ADDITIONAL_WINDOWS_ABOVE_STATUS_BAR = "com.android.window.flags.enable_additional_windows_above_status_bar";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_APP_HEADER_WITH_TASK_DENSITY = "com.android.window.flags.enable_app_header_with_task_density";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_BUFFER_TRANSFORM_HINT_FROM_DISPLAY = "com.android.window.flags.enable_buffer_transform_hint_from_display";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_CAMERA_COMPAT_FOR_DESKTOP_WINDOWING = "com.android.window.flags.enable_camera_compat_for_desktop_windowing";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_COMPATUI_SYSUI_LAUNCHER = "com.android.window.flags.enable_compatui_sysui_launcher";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_DESKTOP_WINDOWING_IMMERSIVE_HANDLE_HIDING = "com.android.window.flags.enable_desktop_windowing_immersive_handle_hiding";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_DESKTOP_WINDOWING_MODALS_POLICY = "com.android.window.flags.enable_desktop_windowing_modals_policy";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_DESKTOP_WINDOWING_MODE = "com.android.window.flags.enable_desktop_windowing_mode";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_DESKTOP_WINDOWING_QUICK_SWITCH = "com.android.window.flags.enable_desktop_windowing_quick_switch";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_DESKTOP_WINDOWING_SCVH_CACHE = "com.android.window.flags.enable_desktop_windowing_scvh_cache";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_DESKTOP_WINDOWING_SIZE_CONSTRAINTS = "com.android.window.flags.enable_desktop_windowing_size_constraints";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_DESKTOP_WINDOWING_TASK_LIMIT = "com.android.window.flags.enable_desktop_windowing_task_limit";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_DESKTOP_WINDOWING_TASKBAR_RUNNING_APPS = "com.android.window.flags.enable_desktop_windowing_taskbar_running_apps";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY = "com.android.window.flags.enable_desktop_windowing_wallpaper_activity";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_SCALED_RESIZING = "com.android.window.flags.enable_scaled_resizing";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TASK_STACK_OBSERVER_IN_SHELL = "com.android.window.flags.enable_task_stack_observer_in_shell";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_THEMED_APP_HEADERS = "com.android.window.flags.enable_themed_app_headers";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS = "com.android.window.flags.enable_windowing_dynamic_initial_bounds";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE = "com.android.window.flags.enable_windowing_edge_drag_resize";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_WM_EXTENSIONS_FOR_ALL_FLAG = "com.android.window.flags.enable_wm_extensions_for_all_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENFORCE_EDGE_TO_EDGE = "com.android.window.flags.enforce_edge_to_edge";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENSURE_WALLPAPER_IN_TRANSITIONS = "com.android.window.flags.ensure_wallpaper_in_transitions";
|
||||
/** @hide */
|
||||
public static final String FLAG_EXPLICIT_REFRESH_RATE_HINTS = "com.android.window.flags.explicit_refresh_rate_hints";
|
||||
/** @hide */
|
||||
public static final String FLAG_FIFO_PRIORITY_FOR_MAJOR_UI_PROCESSES = "com.android.window.flags.fifo_priority_for_major_ui_processes";
|
||||
/** @hide */
|
||||
public static final String FLAG_FIX_NO_CONTAINER_UPDATE_WITHOUT_RESIZE = "com.android.window.flags.fix_no_container_update_without_resize";
|
||||
/** @hide */
|
||||
public static final String FLAG_FIX_PIP_RESTORE_TO_OVERLAY = "com.android.window.flags.fix_pip_restore_to_overlay";
|
||||
/** @hide */
|
||||
public static final String FLAG_FULLSCREEN_DIM_FLAG = "com.android.window.flags.fullscreen_dim_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_GET_DIMMER_ON_CLOSING = "com.android.window.flags.get_dimmer_on_closing";
|
||||
/** @hide */
|
||||
public static final String FLAG_IMMERSIVE_APP_REPOSITIONING = "com.android.window.flags.immersive_app_repositioning";
|
||||
/** @hide */
|
||||
public static final String FLAG_INSETS_CONTROL_CHANGED_ITEM = "com.android.window.flags.insets_control_changed_item";
|
||||
/** @hide */
|
||||
public static final String FLAG_INSETS_CONTROL_SEQ = "com.android.window.flags.insets_control_seq";
|
||||
/** @hide */
|
||||
public static final String FLAG_INSETS_DECOUPLED_CONFIGURATION = "com.android.window.flags.insets_decoupled_configuration";
|
||||
/** @hide */
|
||||
public static final String FLAG_INTRODUCE_SMOOTHER_DIMMER = "com.android.window.flags.introduce_smoother_dimmer";
|
||||
/** @hide */
|
||||
public static final String FLAG_KEYGUARD_APPEAR_TRANSITION = "com.android.window.flags.keyguard_appear_transition";
|
||||
/** @hide */
|
||||
public static final String FLAG_LETTERBOX_BACKGROUND_WALLPAPER = "com.android.window.flags.letterbox_background_wallpaper";
|
||||
/** @hide */
|
||||
public static final String FLAG_MOVABLE_CUTOUT_CONFIGURATION = "com.android.window.flags.movable_cutout_configuration";
|
||||
/** @hide */
|
||||
public static final String FLAG_MOVE_ANIMATION_OPTIONS_TO_CHANGE = "com.android.window.flags.move_animation_options_to_change";
|
||||
/** @hide */
|
||||
public static final String FLAG_MULTI_CROP = "com.android.window.flags.multi_crop";
|
||||
/** @hide */
|
||||
public static final String FLAG_NAV_BAR_TRANSPARENT_BY_DEFAULT = "com.android.window.flags.nav_bar_transparent_by_default";
|
||||
/** @hide */
|
||||
public static final String FLAG_NO_CONSECUTIVE_VISIBILITY_EVENTS = "com.android.window.flags.no_consecutive_visibility_events";
|
||||
/** @hide */
|
||||
public static final String FLAG_NO_VISIBILITY_EVENT_ON_DISPLAY_STATE_CHANGE = "com.android.window.flags.no_visibility_event_on_display_state_change";
|
||||
/** @hide */
|
||||
public static final String FLAG_OFFLOAD_COLOR_EXTRACTION = "com.android.window.flags.offload_color_extraction";
|
||||
/** @hide */
|
||||
public static final String FLAG_PREDICTIVE_BACK_SYSTEM_ANIMS = "com.android.window.flags.predictive_back_system_anims";
|
||||
/** @hide */
|
||||
public static final String FLAG_REAR_DISPLAY_DISABLE_FORCE_DESKTOP_SYSTEM_DECORATIONS = "com.android.window.flags.rear_display_disable_force_desktop_system_decorations";
|
||||
/** @hide */
|
||||
public static final String FLAG_RELEASE_SNAPSHOT_AGGRESSIVELY = "com.android.window.flags.release_snapshot_aggressively";
|
||||
/** @hide */
|
||||
public static final String FLAG_REMOVE_PREPARE_SURFACE_IN_PLACEMENT = "com.android.window.flags.remove_prepare_surface_in_placement";
|
||||
/** @hide */
|
||||
public static final String FLAG_SCREEN_RECORDING_CALLBACKS = "com.android.window.flags.screen_recording_callbacks";
|
||||
/** @hide */
|
||||
public static final String FLAG_SDK_DESIRED_PRESENT_TIME = "com.android.window.flags.sdk_desired_present_time";
|
||||
/** @hide */
|
||||
public static final String FLAG_SECURE_WINDOW_STATE = "com.android.window.flags.secure_window_state";
|
||||
/** @hide */
|
||||
public static final String FLAG_SET_SC_PROPERTIES_IN_CLIENT = "com.android.window.flags.set_sc_properties_in_client";
|
||||
/** @hide */
|
||||
public static final String FLAG_SKIP_SLEEPING_WHEN_SWITCHING_DISPLAY = "com.android.window.flags.skip_sleeping_when_switching_display";
|
||||
/** @hide */
|
||||
public static final String FLAG_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI = "com.android.window.flags.supports_multi_instance_system_ui";
|
||||
/** @hide */
|
||||
public static final String FLAG_SURFACE_CONTROL_INPUT_RECEIVER = "com.android.window.flags.surface_control_input_receiver";
|
||||
/** @hide */
|
||||
public static final String FLAG_SURFACE_TRUSTED_OVERLAY = "com.android.window.flags.surface_trusted_overlay";
|
||||
/** @hide */
|
||||
public static final String FLAG_SYNC_SCREEN_CAPTURE = "com.android.window.flags.sync_screen_capture";
|
||||
/** @hide */
|
||||
public static final String FLAG_TASK_FRAGMENT_SYSTEM_ORGANIZER_FLAG = "com.android.window.flags.task_fragment_system_organizer_flag";
|
||||
/** @hide */
|
||||
public static final String FLAG_TRANSIT_READY_TRACKING = "com.android.window.flags.transit_ready_tracking";
|
||||
/** @hide */
|
||||
public static final String FLAG_TRUSTED_PRESENTATION_LISTENER_FOR_WINDOW = "com.android.window.flags.trusted_presentation_listener_for_window";
|
||||
/** @hide */
|
||||
public static final String FLAG_UNTRUSTED_EMBEDDING_ANY_APP_PERMISSION = "com.android.window.flags.untrusted_embedding_any_app_permission";
|
||||
/** @hide */
|
||||
public static final String FLAG_UNTRUSTED_EMBEDDING_STATE_SHARING = "com.android.window.flags.untrusted_embedding_state_sharing";
|
||||
/** @hide */
|
||||
public static final String FLAG_USE_WINDOW_ORIGINAL_TOUCHABLE_REGION_WHEN_MAGNIFICATION_RECOMPUTE_BOUNDS = "com.android.window.flags.use_window_original_touchable_region_when_magnification_recompute_bounds";
|
||||
/** @hide */
|
||||
public static final String FLAG_USER_MIN_ASPECT_RATIO_APP_DEFAULT = "com.android.window.flags.user_min_aspect_ratio_app_default";
|
||||
/** @hide */
|
||||
public static final String FLAG_WAIT_FOR_TRANSITION_ON_DISPLAY_SWITCH = "com.android.window.flags.wait_for_transition_on_display_switch";
|
||||
/** @hide */
|
||||
public static final String FLAG_WALLPAPER_OFFSET_ASYNC = "com.android.window.flags.wallpaper_offset_async";
|
||||
/** @hide */
|
||||
public static final String FLAG_WINDOW_SESSION_RELAYOUT_INFO = "com.android.window.flags.window_session_relayout_info";
|
||||
/** @hide */
|
||||
public static final String FLAG_WINDOW_TOKEN_CONFIG_THREAD_SAFE = "com.android.window.flags.window_token_config_thread_safe";
|
||||
|
||||
public static boolean activityEmbeddingAnimationCustomizationFlag() {
|
||||
return FEATURE_FLAGS.activityEmbeddingAnimationCustomizationFlag();
|
||||
}
|
||||
|
||||
public static boolean activityEmbeddingInteractiveDividerFlag() {
|
||||
return FEATURE_FLAGS.activityEmbeddingInteractiveDividerFlag();
|
||||
}
|
||||
|
||||
public static boolean activityEmbeddingOverlayPresentationFlag() {
|
||||
return FEATURE_FLAGS.activityEmbeddingOverlayPresentationFlag();
|
||||
}
|
||||
|
||||
public static boolean activitySnapshotByDefault() {
|
||||
return FEATURE_FLAGS.activitySnapshotByDefault();
|
||||
}
|
||||
|
||||
public static boolean activityWindowInfoFlag() {
|
||||
return FEATURE_FLAGS.activityWindowInfoFlag();
|
||||
}
|
||||
|
||||
public static boolean allowDisableActivityRecordInputSink() {
|
||||
return FEATURE_FLAGS.allowDisableActivityRecordInputSink();
|
||||
}
|
||||
|
||||
public static boolean allowHideScmButton() {
|
||||
return FEATURE_FLAGS.allowHideScmButton();
|
||||
}
|
||||
|
||||
public static boolean allowsScreenSizeDecoupledFromStatusBarAndCutout() {
|
||||
return FEATURE_FLAGS.allowsScreenSizeDecoupledFromStatusBarAndCutout();
|
||||
}
|
||||
|
||||
public static boolean alwaysDeferTransitionWhenApplyWct() {
|
||||
return FEATURE_FLAGS.alwaysDeferTransitionWhenApplyWct();
|
||||
}
|
||||
|
||||
public static boolean alwaysDrawMagnificationFullscreenBorder() {
|
||||
return FEATURE_FLAGS.alwaysDrawMagnificationFullscreenBorder();
|
||||
}
|
||||
|
||||
public static boolean alwaysUpdateWallpaperPermission() {
|
||||
return FEATURE_FLAGS.alwaysUpdateWallpaperPermission();
|
||||
}
|
||||
|
||||
public static boolean appCompatPropertiesApi() {
|
||||
return FEATURE_FLAGS.appCompatPropertiesApi();
|
||||
}
|
||||
|
||||
public static boolean appCompatRefactoring() {
|
||||
return FEATURE_FLAGS.appCompatRefactoring();
|
||||
}
|
||||
|
||||
public static boolean balDontBringExistingBackgroundTaskStackToFg() {
|
||||
return FEATURE_FLAGS.balDontBringExistingBackgroundTaskStackToFg();
|
||||
}
|
||||
|
||||
public static boolean balImproveRealCallerVisibilityCheck() {
|
||||
return FEATURE_FLAGS.balImproveRealCallerVisibilityCheck();
|
||||
}
|
||||
|
||||
public static boolean balImprovedMetrics() {
|
||||
return FEATURE_FLAGS.balImprovedMetrics();
|
||||
}
|
||||
|
||||
public static boolean balRequireOptInByPendingIntentCreator() {
|
||||
return FEATURE_FLAGS.balRequireOptInByPendingIntentCreator();
|
||||
}
|
||||
|
||||
public static boolean balRequireOptInSameUid() {
|
||||
return FEATURE_FLAGS.balRequireOptInSameUid();
|
||||
}
|
||||
|
||||
public static boolean balRespectAppSwitchStateWhenCheckBoundByForegroundUid() {
|
||||
return FEATURE_FLAGS.balRespectAppSwitchStateWhenCheckBoundByForegroundUid();
|
||||
}
|
||||
|
||||
public static boolean balShowToasts() {
|
||||
return FEATURE_FLAGS.balShowToasts();
|
||||
}
|
||||
|
||||
public static boolean balShowToastsBlocked() {
|
||||
return FEATURE_FLAGS.balShowToastsBlocked();
|
||||
}
|
||||
|
||||
public static boolean blastSyncNotificationShadeOnDisplaySwitch() {
|
||||
return FEATURE_FLAGS.blastSyncNotificationShadeOnDisplaySwitch();
|
||||
}
|
||||
|
||||
public static boolean bundleClientTransactionFlag() {
|
||||
return FEATURE_FLAGS.bundleClientTransactionFlag();
|
||||
}
|
||||
|
||||
public static boolean cameraCompatForFreeform() {
|
||||
return FEATURE_FLAGS.cameraCompatForFreeform();
|
||||
}
|
||||
|
||||
public static boolean closeToSquareConfigIncludesStatusBar() {
|
||||
return FEATURE_FLAGS.closeToSquareConfigIncludesStatusBar();
|
||||
}
|
||||
|
||||
public static boolean configurableFontScaleDefault() {
|
||||
return FEATURE_FLAGS.configurableFontScaleDefault();
|
||||
}
|
||||
|
||||
public static boolean coverDisplayOptIn() {
|
||||
return FEATURE_FLAGS.coverDisplayOptIn();
|
||||
}
|
||||
|
||||
public static boolean deferDisplayUpdates() {
|
||||
return FEATURE_FLAGS.deferDisplayUpdates();
|
||||
}
|
||||
|
||||
public static boolean delayNotificationToMagnificationWhenRecentsWindowToFrontTransition() {
|
||||
return FEATURE_FLAGS.delayNotificationToMagnificationWhenRecentsWindowToFrontTransition();
|
||||
}
|
||||
|
||||
public static boolean delegateUnhandledDrags() {
|
||||
return FEATURE_FLAGS.delegateUnhandledDrags();
|
||||
}
|
||||
|
||||
public static boolean deleteCaptureDisplay() {
|
||||
return FEATURE_FLAGS.deleteCaptureDisplay();
|
||||
}
|
||||
|
||||
public static boolean density390Api() {
|
||||
return FEATURE_FLAGS.density390Api();
|
||||
}
|
||||
|
||||
public static boolean disableObjectPool() {
|
||||
return FEATURE_FLAGS.disableObjectPool();
|
||||
}
|
||||
|
||||
public static boolean disableThinLetterboxingPolicy() {
|
||||
return FEATURE_FLAGS.disableThinLetterboxingPolicy();
|
||||
}
|
||||
|
||||
public static boolean doNotCheckIntersectionWhenNonMagnifiableWindowTransitions() {
|
||||
return FEATURE_FLAGS.doNotCheckIntersectionWhenNonMagnifiableWindowTransitions();
|
||||
}
|
||||
|
||||
public static boolean drawSnapshotAspectRatioMatch() {
|
||||
return FEATURE_FLAGS.drawSnapshotAspectRatioMatch();
|
||||
}
|
||||
|
||||
public static boolean edgeToEdgeByDefault() {
|
||||
return FEATURE_FLAGS.edgeToEdgeByDefault();
|
||||
}
|
||||
|
||||
public static boolean embeddedActivityBackNavFlag() {
|
||||
return FEATURE_FLAGS.embeddedActivityBackNavFlag();
|
||||
}
|
||||
|
||||
public static boolean enableAdditionalWindowsAboveStatusBar() {
|
||||
return FEATURE_FLAGS.enableAdditionalWindowsAboveStatusBar();
|
||||
}
|
||||
|
||||
public static boolean enableAppHeaderWithTaskDensity() {
|
||||
return FEATURE_FLAGS.enableAppHeaderWithTaskDensity();
|
||||
}
|
||||
|
||||
public static boolean enableBufferTransformHintFromDisplay() {
|
||||
return FEATURE_FLAGS.enableBufferTransformHintFromDisplay();
|
||||
}
|
||||
|
||||
public static boolean enableCameraCompatForDesktopWindowing() {
|
||||
return FEATURE_FLAGS.enableCameraCompatForDesktopWindowing();
|
||||
}
|
||||
|
||||
public static boolean enableCompatuiSysuiLauncher() {
|
||||
return FEATURE_FLAGS.enableCompatuiSysuiLauncher();
|
||||
}
|
||||
|
||||
public static boolean enableDesktopWindowingImmersiveHandleHiding() {
|
||||
return FEATURE_FLAGS.enableDesktopWindowingImmersiveHandleHiding();
|
||||
}
|
||||
|
||||
public static boolean enableDesktopWindowingModalsPolicy() {
|
||||
return FEATURE_FLAGS.enableDesktopWindowingModalsPolicy();
|
||||
}
|
||||
|
||||
public static boolean enableDesktopWindowingMode() {
|
||||
return FEATURE_FLAGS.enableDesktopWindowingMode();
|
||||
}
|
||||
|
||||
public static boolean enableDesktopWindowingQuickSwitch() {
|
||||
return FEATURE_FLAGS.enableDesktopWindowingQuickSwitch();
|
||||
}
|
||||
|
||||
public static boolean enableDesktopWindowingScvhCache() {
|
||||
return FEATURE_FLAGS.enableDesktopWindowingScvhCache();
|
||||
}
|
||||
|
||||
public static boolean enableDesktopWindowingSizeConstraints() {
|
||||
return FEATURE_FLAGS.enableDesktopWindowingSizeConstraints();
|
||||
}
|
||||
|
||||
public static boolean enableDesktopWindowingTaskLimit() {
|
||||
return FEATURE_FLAGS.enableDesktopWindowingTaskLimit();
|
||||
}
|
||||
|
||||
public static boolean enableDesktopWindowingTaskbarRunningApps() {
|
||||
return FEATURE_FLAGS.enableDesktopWindowingTaskbarRunningApps();
|
||||
}
|
||||
|
||||
public static boolean enableDesktopWindowingWallpaperActivity() {
|
||||
return FEATURE_FLAGS.enableDesktopWindowingWallpaperActivity();
|
||||
}
|
||||
|
||||
public static boolean enableScaledResizing() {
|
||||
return FEATURE_FLAGS.enableScaledResizing();
|
||||
}
|
||||
|
||||
public static boolean enableTaskStackObserverInShell() {
|
||||
return FEATURE_FLAGS.enableTaskStackObserverInShell();
|
||||
}
|
||||
|
||||
public static boolean enableThemedAppHeaders() {
|
||||
return FEATURE_FLAGS.enableThemedAppHeaders();
|
||||
}
|
||||
|
||||
public static boolean enableWindowingDynamicInitialBounds() {
|
||||
return FEATURE_FLAGS.enableWindowingDynamicInitialBounds();
|
||||
}
|
||||
|
||||
public static boolean enableWindowingEdgeDragResize() {
|
||||
return FEATURE_FLAGS.enableWindowingEdgeDragResize();
|
||||
}
|
||||
|
||||
public static boolean enableWmExtensionsForAllFlag() {
|
||||
return FEATURE_FLAGS.enableWmExtensionsForAllFlag();
|
||||
}
|
||||
|
||||
public static boolean enforceEdgeToEdge() {
|
||||
return FEATURE_FLAGS.enforceEdgeToEdge();
|
||||
}
|
||||
|
||||
public static boolean ensureWallpaperInTransitions() {
|
||||
return FEATURE_FLAGS.ensureWallpaperInTransitions();
|
||||
}
|
||||
|
||||
public static boolean explicitRefreshRateHints() {
|
||||
return FEATURE_FLAGS.explicitRefreshRateHints();
|
||||
}
|
||||
|
||||
public static boolean fifoPriorityForMajorUiProcesses() {
|
||||
return FEATURE_FLAGS.fifoPriorityForMajorUiProcesses();
|
||||
}
|
||||
|
||||
public static boolean fixNoContainerUpdateWithoutResize() {
|
||||
return FEATURE_FLAGS.fixNoContainerUpdateWithoutResize();
|
||||
}
|
||||
|
||||
public static boolean fixPipRestoreToOverlay() {
|
||||
return FEATURE_FLAGS.fixPipRestoreToOverlay();
|
||||
}
|
||||
|
||||
public static boolean fullscreenDimFlag() {
|
||||
return FEATURE_FLAGS.fullscreenDimFlag();
|
||||
}
|
||||
|
||||
public static boolean getDimmerOnClosing() {
|
||||
return FEATURE_FLAGS.getDimmerOnClosing();
|
||||
}
|
||||
|
||||
public static boolean immersiveAppRepositioning() {
|
||||
return FEATURE_FLAGS.immersiveAppRepositioning();
|
||||
}
|
||||
|
||||
public static boolean insetsControlChangedItem() {
|
||||
return FEATURE_FLAGS.insetsControlChangedItem();
|
||||
}
|
||||
|
||||
public static boolean insetsControlSeq() {
|
||||
return FEATURE_FLAGS.insetsControlSeq();
|
||||
}
|
||||
|
||||
public static boolean insetsDecoupledConfiguration() {
|
||||
return FEATURE_FLAGS.insetsDecoupledConfiguration();
|
||||
}
|
||||
|
||||
public static boolean introduceSmootherDimmer() {
|
||||
return FEATURE_FLAGS.introduceSmootherDimmer();
|
||||
}
|
||||
|
||||
public static boolean keyguardAppearTransition() {
|
||||
return FEATURE_FLAGS.keyguardAppearTransition();
|
||||
}
|
||||
|
||||
public static boolean letterboxBackgroundWallpaper() {
|
||||
return FEATURE_FLAGS.letterboxBackgroundWallpaper();
|
||||
}
|
||||
|
||||
public static boolean movableCutoutConfiguration() {
|
||||
return FEATURE_FLAGS.movableCutoutConfiguration();
|
||||
}
|
||||
|
||||
public static boolean moveAnimationOptionsToChange() {
|
||||
return FEATURE_FLAGS.moveAnimationOptionsToChange();
|
||||
}
|
||||
|
||||
public static boolean multiCrop() {
|
||||
return FEATURE_FLAGS.multiCrop();
|
||||
}
|
||||
|
||||
public static boolean navBarTransparentByDefault() {
|
||||
return FEATURE_FLAGS.navBarTransparentByDefault();
|
||||
}
|
||||
|
||||
public static boolean noConsecutiveVisibilityEvents() {
|
||||
return FEATURE_FLAGS.noConsecutiveVisibilityEvents();
|
||||
}
|
||||
|
||||
public static boolean noVisibilityEventOnDisplayStateChange() {
|
||||
return FEATURE_FLAGS.noVisibilityEventOnDisplayStateChange();
|
||||
}
|
||||
|
||||
public static boolean offloadColorExtraction() {
|
||||
return FEATURE_FLAGS.offloadColorExtraction();
|
||||
}
|
||||
|
||||
public static boolean predictiveBackSystemAnims() {
|
||||
return FEATURE_FLAGS.predictiveBackSystemAnims();
|
||||
}
|
||||
|
||||
public static boolean rearDisplayDisableForceDesktopSystemDecorations() {
|
||||
return FEATURE_FLAGS.rearDisplayDisableForceDesktopSystemDecorations();
|
||||
}
|
||||
|
||||
public static boolean releaseSnapshotAggressively() {
|
||||
return FEATURE_FLAGS.releaseSnapshotAggressively();
|
||||
}
|
||||
|
||||
public static boolean removePrepareSurfaceInPlacement() {
|
||||
return FEATURE_FLAGS.removePrepareSurfaceInPlacement();
|
||||
}
|
||||
|
||||
public static boolean screenRecordingCallbacks() {
|
||||
return FEATURE_FLAGS.screenRecordingCallbacks();
|
||||
}
|
||||
|
||||
public static boolean sdkDesiredPresentTime() {
|
||||
return FEATURE_FLAGS.sdkDesiredPresentTime();
|
||||
}
|
||||
|
||||
public static boolean secureWindowState() {
|
||||
return FEATURE_FLAGS.secureWindowState();
|
||||
}
|
||||
|
||||
public static boolean setScPropertiesInClient() {
|
||||
return FEATURE_FLAGS.setScPropertiesInClient();
|
||||
}
|
||||
|
||||
public static boolean skipSleepingWhenSwitchingDisplay() {
|
||||
return FEATURE_FLAGS.skipSleepingWhenSwitchingDisplay();
|
||||
}
|
||||
|
||||
public static boolean supportsMultiInstanceSystemUi() {
|
||||
return FEATURE_FLAGS.supportsMultiInstanceSystemUi();
|
||||
}
|
||||
|
||||
public static boolean surfaceControlInputReceiver() {
|
||||
return FEATURE_FLAGS.surfaceControlInputReceiver();
|
||||
}
|
||||
|
||||
public static boolean surfaceTrustedOverlay() {
|
||||
return FEATURE_FLAGS.surfaceTrustedOverlay();
|
||||
}
|
||||
|
||||
public static boolean syncScreenCapture() {
|
||||
return FEATURE_FLAGS.syncScreenCapture();
|
||||
}
|
||||
|
||||
public static boolean taskFragmentSystemOrganizerFlag() {
|
||||
return FEATURE_FLAGS.taskFragmentSystemOrganizerFlag();
|
||||
}
|
||||
|
||||
public static boolean transitReadyTracking() {
|
||||
return FEATURE_FLAGS.transitReadyTracking();
|
||||
}
|
||||
|
||||
public static boolean trustedPresentationListenerForWindow() {
|
||||
return FEATURE_FLAGS.trustedPresentationListenerForWindow();
|
||||
}
|
||||
|
||||
public static boolean untrustedEmbeddingAnyAppPermission() {
|
||||
return FEATURE_FLAGS.untrustedEmbeddingAnyAppPermission();
|
||||
}
|
||||
|
||||
public static boolean untrustedEmbeddingStateSharing() {
|
||||
return FEATURE_FLAGS.untrustedEmbeddingStateSharing();
|
||||
}
|
||||
|
||||
public static boolean useWindowOriginalTouchableRegionWhenMagnificationRecomputeBounds() {
|
||||
return FEATURE_FLAGS.useWindowOriginalTouchableRegionWhenMagnificationRecomputeBounds();
|
||||
}
|
||||
|
||||
public static boolean userMinAspectRatioAppDefault() {
|
||||
return FEATURE_FLAGS.userMinAspectRatioAppDefault();
|
||||
}
|
||||
|
||||
public static boolean waitForTransitionOnDisplaySwitch() {
|
||||
return FEATURE_FLAGS.waitForTransitionOnDisplaySwitch();
|
||||
}
|
||||
|
||||
public static boolean wallpaperOffsetAsync() {
|
||||
return FEATURE_FLAGS.wallpaperOffsetAsync();
|
||||
}
|
||||
|
||||
public static boolean windowSessionRelayoutInfo() {
|
||||
return FEATURE_FLAGS.windowSessionRelayoutInfo();
|
||||
}
|
||||
|
||||
public static boolean windowTokenConfigThreadSafe() {
|
||||
return FEATURE_FLAGS.windowTokenConfigThreadSafe();
|
||||
}
|
||||
|
||||
private static FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
package com.android.wm.shell;
|
||||
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.BiPredicate;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** @hide */
|
||||
public class CustomFeatureFlags implements FeatureFlags {
|
||||
|
||||
private BiPredicate<String, Predicate<FeatureFlags>> mGetValueImpl;
|
||||
|
||||
public CustomFeatureFlags(BiPredicate<String, Predicate<FeatureFlags>> getValueImpl) {
|
||||
mGetValueImpl = getValueImpl;
|
||||
}
|
||||
@Override
|
||||
|
||||
public boolean animateBubbleSizeChange() {
|
||||
return getValue(Flags.FLAG_ANIMATE_BUBBLE_SIZE_CHANGE,
|
||||
FeatureFlags::animateBubbleSizeChange);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableAppPairs() {
|
||||
return getValue(Flags.FLAG_ENABLE_APP_PAIRS,
|
||||
FeatureFlags::enableAppPairs);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableBubbleAnything() {
|
||||
return getValue(Flags.FLAG_ENABLE_BUBBLE_ANYTHING,
|
||||
FeatureFlags::enableBubbleAnything);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableBubbleBar() {
|
||||
return getValue(Flags.FLAG_ENABLE_BUBBLE_BAR,
|
||||
FeatureFlags::enableBubbleBar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableBubbleStashing() {
|
||||
return getValue(Flags.FLAG_ENABLE_BUBBLE_STASHING,
|
||||
FeatureFlags::enableBubbleStashing);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableBubblesLongPressNavHandle() {
|
||||
return getValue(Flags.FLAG_ENABLE_BUBBLES_LONG_PRESS_NAV_HANDLE,
|
||||
FeatureFlags::enableBubblesLongPressNavHandle);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableLeftRightSplitInPortrait() {
|
||||
return getValue(Flags.FLAG_ENABLE_LEFT_RIGHT_SPLIT_IN_PORTRAIT,
|
||||
FeatureFlags::enableLeftRightSplitInPortrait);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableNewBubbleAnimations() {
|
||||
return getValue(Flags.FLAG_ENABLE_NEW_BUBBLE_ANIMATIONS,
|
||||
FeatureFlags::enableNewBubbleAnimations);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableOptionalBubbleOverflow() {
|
||||
return getValue(Flags.FLAG_ENABLE_OPTIONAL_BUBBLE_OVERFLOW,
|
||||
FeatureFlags::enableOptionalBubbleOverflow);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enablePip2Implementation() {
|
||||
return getValue(Flags.FLAG_ENABLE_PIP2_IMPLEMENTATION,
|
||||
FeatureFlags::enablePip2Implementation);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enablePipUmoExperience() {
|
||||
return getValue(Flags.FLAG_ENABLE_PIP_UMO_EXPERIENCE,
|
||||
FeatureFlags::enablePipUmoExperience);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableRetrievableBubbles() {
|
||||
return getValue(Flags.FLAG_ENABLE_RETRIEVABLE_BUBBLES,
|
||||
FeatureFlags::enableRetrievableBubbles);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableSplitContextual() {
|
||||
return getValue(Flags.FLAG_ENABLE_SPLIT_CONTEXTUAL,
|
||||
FeatureFlags::enableSplitContextual);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableTaskbarNavbarUnification() {
|
||||
return getValue(Flags.FLAG_ENABLE_TASKBAR_NAVBAR_UNIFICATION,
|
||||
FeatureFlags::enableTaskbarNavbarUnification);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean enableTinyTaskbar() {
|
||||
return getValue(Flags.FLAG_ENABLE_TINY_TASKBAR,
|
||||
FeatureFlags::enableTinyTaskbar);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public boolean onlyReuseBubbledTaskWhenLaunchedFromBubble() {
|
||||
return getValue(Flags.FLAG_ONLY_REUSE_BUBBLED_TASK_WHEN_LAUNCHED_FROM_BUBBLE,
|
||||
FeatureFlags::onlyReuseBubbledTaskWhenLaunchedFromBubble);
|
||||
}
|
||||
|
||||
public boolean isFlagReadOnlyOptimized(String flagName) {
|
||||
if (mReadOnlyFlagsSet.contains(flagName) &&
|
||||
isOptimizationEnabled()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isOptimizationEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) {
|
||||
return mGetValueImpl.test(flagName, getter);
|
||||
}
|
||||
|
||||
public List<String> getFlagNames() {
|
||||
return Arrays.asList(
|
||||
Flags.FLAG_ANIMATE_BUBBLE_SIZE_CHANGE,
|
||||
Flags.FLAG_ENABLE_APP_PAIRS,
|
||||
Flags.FLAG_ENABLE_BUBBLE_ANYTHING,
|
||||
Flags.FLAG_ENABLE_BUBBLE_BAR,
|
||||
Flags.FLAG_ENABLE_BUBBLE_STASHING,
|
||||
Flags.FLAG_ENABLE_BUBBLES_LONG_PRESS_NAV_HANDLE,
|
||||
Flags.FLAG_ENABLE_LEFT_RIGHT_SPLIT_IN_PORTRAIT,
|
||||
Flags.FLAG_ENABLE_NEW_BUBBLE_ANIMATIONS,
|
||||
Flags.FLAG_ENABLE_OPTIONAL_BUBBLE_OVERFLOW,
|
||||
Flags.FLAG_ENABLE_PIP2_IMPLEMENTATION,
|
||||
Flags.FLAG_ENABLE_PIP_UMO_EXPERIENCE,
|
||||
Flags.FLAG_ENABLE_RETRIEVABLE_BUBBLES,
|
||||
Flags.FLAG_ENABLE_SPLIT_CONTEXTUAL,
|
||||
Flags.FLAG_ENABLE_TASKBAR_NAVBAR_UNIFICATION,
|
||||
Flags.FLAG_ENABLE_TINY_TASKBAR,
|
||||
Flags.FLAG_ONLY_REUSE_BUBBLED_TASK_WHEN_LAUNCHED_FROM_BUBBLE
|
||||
);
|
||||
}
|
||||
|
||||
private Set<String> mReadOnlyFlagsSet = new HashSet<>(
|
||||
Arrays.asList(
|
||||
Flags.FLAG_ENABLE_PIP2_IMPLEMENTATION,
|
||||
""
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.android.wm.shell;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
/** @hide */
|
||||
public class FakeFeatureFlagsImpl extends CustomFeatureFlags {
|
||||
private final Map<String, Boolean> mFlagMap = new HashMap<>();
|
||||
private final FeatureFlags mDefaults;
|
||||
|
||||
public FakeFeatureFlagsImpl() {
|
||||
this(null);
|
||||
}
|
||||
|
||||
public FakeFeatureFlagsImpl(FeatureFlags defaults) {
|
||||
super(null);
|
||||
mDefaults = defaults;
|
||||
// Initialize the map with null values
|
||||
for (String flagName : getFlagNames()) {
|
||||
mFlagMap.put(flagName, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) {
|
||||
Boolean value = this.mFlagMap.get(flagName);
|
||||
if (value != null) {
|
||||
return value;
|
||||
}
|
||||
if (mDefaults != null) {
|
||||
return getter.test(mDefaults);
|
||||
}
|
||||
throw new IllegalArgumentException(flagName + " is not set");
|
||||
}
|
||||
|
||||
public void setFlag(String flagName, boolean value) {
|
||||
if (!this.mFlagMap.containsKey(flagName)) {
|
||||
throw new IllegalArgumentException("no such flag " + flagName);
|
||||
}
|
||||
this.mFlagMap.put(flagName, value);
|
||||
}
|
||||
|
||||
public void resetAll() {
|
||||
for (Map.Entry entry : mFlagMap.entrySet()) {
|
||||
entry.setValue(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.android.wm.shell;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
/** @hide */
|
||||
public interface FeatureFlags {
|
||||
|
||||
|
||||
|
||||
boolean animateBubbleSizeChange();
|
||||
|
||||
|
||||
boolean enableAppPairs();
|
||||
|
||||
|
||||
boolean enableBubbleAnything();
|
||||
|
||||
|
||||
boolean enableBubbleBar();
|
||||
|
||||
|
||||
boolean enableBubbleStashing();
|
||||
|
||||
|
||||
boolean enableBubblesLongPressNavHandle();
|
||||
|
||||
|
||||
boolean enableLeftRightSplitInPortrait();
|
||||
|
||||
|
||||
boolean enableNewBubbleAnimations();
|
||||
|
||||
|
||||
boolean enableOptionalBubbleOverflow();
|
||||
|
||||
boolean enablePip2Implementation();
|
||||
|
||||
|
||||
boolean enablePipUmoExperience();
|
||||
|
||||
|
||||
boolean enableRetrievableBubbles();
|
||||
|
||||
|
||||
boolean enableSplitContextual();
|
||||
|
||||
|
||||
boolean enableTaskbarNavbarUnification();
|
||||
|
||||
|
||||
boolean enableTinyTaskbar();
|
||||
|
||||
|
||||
boolean onlyReuseBubbledTaskWhenLaunchedFromBubble();
|
||||
}
|
||||
@@ -0,0 +1,394 @@
|
||||
package com.android.wm.shell;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
|
||||
import com.android.quickstep.util.DeviceConfigHelper;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
/** @hide */
|
||||
public final class FeatureFlagsImpl implements FeatureFlags {
|
||||
private static final boolean isReadFromNew = Files.exists(Paths.get("/metadata/aconfig/boot/enable_only_new_storage"));
|
||||
private static volatile boolean isCached = false;
|
||||
private static volatile boolean multitasking_is_cached = false;
|
||||
private static boolean animateBubbleSizeChange = false;
|
||||
private static boolean enableAppPairs = true;
|
||||
private static boolean enableBubbleAnything = false;
|
||||
private static boolean enableBubbleBar = false;
|
||||
private static boolean enableBubbleStashing = false;
|
||||
private static boolean enableBubblesLongPressNavHandle = false;
|
||||
private static boolean enableLeftRightSplitInPortrait = true;
|
||||
private static boolean enableNewBubbleAnimations = false;
|
||||
private static boolean enableOptionalBubbleOverflow = true;
|
||||
private static boolean enablePipUmoExperience = false;
|
||||
private static boolean enableRetrievableBubbles = false;
|
||||
private static boolean enableSplitContextual = true;
|
||||
private static boolean enableTaskbarNavbarUnification = true;
|
||||
private static boolean enableTinyTaskbar = false;
|
||||
private static boolean onlyReuseBubbledTaskWhenLaunchedFromBubble = false;
|
||||
|
||||
|
||||
private void init() {
|
||||
boolean foundPackage = true;
|
||||
|
||||
animateBubbleSizeChange = foundPackage;
|
||||
|
||||
|
||||
enableAppPairs = foundPackage;
|
||||
|
||||
|
||||
enableBubbleAnything = foundPackage;
|
||||
|
||||
|
||||
enableBubbleBar = foundPackage;
|
||||
|
||||
|
||||
enableBubbleStashing = foundPackage;
|
||||
|
||||
|
||||
enableBubblesLongPressNavHandle = foundPackage ;
|
||||
|
||||
|
||||
enableLeftRightSplitInPortrait = foundPackage;
|
||||
|
||||
|
||||
enableNewBubbleAnimations = foundPackage;
|
||||
|
||||
|
||||
enableOptionalBubbleOverflow = foundPackage;
|
||||
|
||||
|
||||
|
||||
enablePipUmoExperience = foundPackage;
|
||||
|
||||
|
||||
enableRetrievableBubbles = foundPackage;
|
||||
|
||||
|
||||
enableSplitContextual = foundPackage;
|
||||
|
||||
|
||||
enableTaskbarNavbarUnification = foundPackage;
|
||||
|
||||
|
||||
enableTinyTaskbar = foundPackage;
|
||||
|
||||
|
||||
onlyReuseBubbledTaskWhenLaunchedFromBubble = foundPackage ;
|
||||
|
||||
isCached = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void load_overrides_multitasking() {
|
||||
try {
|
||||
var properties = DeviceConfigHelper.Companion.getPrefs();
|
||||
animateBubbleSizeChange =
|
||||
properties.getBoolean(Flags.FLAG_ANIMATE_BUBBLE_SIZE_CHANGE, false);
|
||||
enableAppPairs =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_APP_PAIRS, true);
|
||||
enableBubbleAnything =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_BUBBLE_ANYTHING, false);
|
||||
enableBubbleBar =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_BUBBLE_BAR, false);
|
||||
enableBubbleStashing =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_BUBBLE_STASHING, false);
|
||||
enableBubblesLongPressNavHandle =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_BUBBLES_LONG_PRESS_NAV_HANDLE, false);
|
||||
enableLeftRightSplitInPortrait =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_LEFT_RIGHT_SPLIT_IN_PORTRAIT, true);
|
||||
enableNewBubbleAnimations =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_NEW_BUBBLE_ANIMATIONS, false);
|
||||
enableOptionalBubbleOverflow =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_OPTIONAL_BUBBLE_OVERFLOW, true);
|
||||
enablePipUmoExperience =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_PIP_UMO_EXPERIENCE, false);
|
||||
enableRetrievableBubbles =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_RETRIEVABLE_BUBBLES, false);
|
||||
enableSplitContextual =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_SPLIT_CONTEXTUAL, true);
|
||||
enableTaskbarNavbarUnification =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_TASKBAR_NAVBAR_UNIFICATION, true);
|
||||
enableTinyTaskbar =
|
||||
properties.getBoolean(Flags.FLAG_ENABLE_TINY_TASKBAR, false);
|
||||
onlyReuseBubbledTaskWhenLaunchedFromBubble =
|
||||
properties.getBoolean(Flags.FLAG_ONLY_REUSE_BUBBLED_TASK_WHEN_LAUNCHED_FROM_BUBBLE, false);
|
||||
} catch (NullPointerException e) {
|
||||
throw new RuntimeException(
|
||||
"Cannot read value from namespace multitasking "
|
||||
+ "from DeviceConfig. It could be that the code using flag "
|
||||
+ "executed before SettingsProvider initialization. Please use "
|
||||
+ "fixed read-only flag by adding is_fixed_read_only: true in "
|
||||
+ "flag declaration.",
|
||||
e
|
||||
);
|
||||
}
|
||||
multitasking_is_cached = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean animateBubbleSizeChange() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return animateBubbleSizeChange;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableAppPairs() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableAppPairs;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableBubbleAnything() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableBubbleAnything;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableBubbleBar() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableBubbleBar;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableBubbleStashing() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableBubbleStashing;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableBubblesLongPressNavHandle() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableBubblesLongPressNavHandle;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableLeftRightSplitInPortrait() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableLeftRightSplitInPortrait;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableNewBubbleAnimations() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableNewBubbleAnimations;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableOptionalBubbleOverflow() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableOptionalBubbleOverflow;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enablePip2Implementation() {
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enablePipUmoExperience() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enablePipUmoExperience;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableRetrievableBubbles() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableRetrievableBubbles;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableSplitContextual() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableSplitContextual;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableTaskbarNavbarUnification() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableTaskbarNavbarUnification;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean enableTinyTaskbar() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return enableTinyTaskbar;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
|
||||
public boolean onlyReuseBubbledTaskWhenLaunchedFromBubble() {
|
||||
if (isReadFromNew) {
|
||||
if (!isCached) {
|
||||
init();
|
||||
}
|
||||
} else {
|
||||
if (!multitasking_is_cached) {
|
||||
load_overrides_multitasking();
|
||||
}
|
||||
}
|
||||
return onlyReuseBubbledTaskWhenLaunchedFromBubble;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.android.wm.shell;
|
||||
// TODO(b/303773055): Remove the annotation after access issue is resolved.
|
||||
/** @hide */
|
||||
public final class Flags {
|
||||
/** @hide */
|
||||
public static final String FLAG_ANIMATE_BUBBLE_SIZE_CHANGE = "com.android.wm.shell.animate_bubble_size_change";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_APP_PAIRS = "com.android.wm.shell.enable_app_pairs";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_BUBBLE_ANYTHING = "com.android.wm.shell.enable_bubble_anything";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_BUBBLE_BAR = "com.android.wm.shell.enable_bubble_bar";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_BUBBLE_STASHING = "com.android.wm.shell.enable_bubble_stashing";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_BUBBLES_LONG_PRESS_NAV_HANDLE = "com.android.wm.shell.enable_bubbles_long_press_nav_handle";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_LEFT_RIGHT_SPLIT_IN_PORTRAIT = "com.android.wm.shell.enable_left_right_split_in_portrait";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_NEW_BUBBLE_ANIMATIONS = "com.android.wm.shell.enable_new_bubble_animations";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_OPTIONAL_BUBBLE_OVERFLOW = "com.android.wm.shell.enable_optional_bubble_overflow";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_PIP2_IMPLEMENTATION = "com.android.wm.shell.enable_pip2_implementation";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_PIP_UMO_EXPERIENCE = "com.android.wm.shell.enable_pip_umo_experience";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_RETRIEVABLE_BUBBLES = "com.android.wm.shell.enable_retrievable_bubbles";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_SPLIT_CONTEXTUAL = "com.android.wm.shell.enable_split_contextual";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TASKBAR_NAVBAR_UNIFICATION = "com.android.wm.shell.enable_taskbar_navbar_unification";
|
||||
/** @hide */
|
||||
public static final String FLAG_ENABLE_TINY_TASKBAR = "com.android.wm.shell.enable_tiny_taskbar";
|
||||
/** @hide */
|
||||
public static final String FLAG_ONLY_REUSE_BUBBLED_TASK_WHEN_LAUNCHED_FROM_BUBBLE = "com.android.wm.shell.only_reuse_bubbled_task_when_launched_from_bubble";
|
||||
|
||||
|
||||
public static boolean animateBubbleSizeChange() {
|
||||
return FEATURE_FLAGS.animateBubbleSizeChange();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableAppPairs() {
|
||||
return FEATURE_FLAGS.enableAppPairs();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableBubbleAnything() {
|
||||
return FEATURE_FLAGS.enableBubbleAnything();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableBubbleBar() {
|
||||
return FEATURE_FLAGS.enableBubbleBar();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableBubbleStashing() {
|
||||
return FEATURE_FLAGS.enableBubbleStashing();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableBubblesLongPressNavHandle() {
|
||||
return FEATURE_FLAGS.enableBubblesLongPressNavHandle();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableLeftRightSplitInPortrait() {
|
||||
return FEATURE_FLAGS.enableLeftRightSplitInPortrait();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableNewBubbleAnimations() {
|
||||
return FEATURE_FLAGS.enableNewBubbleAnimations();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableOptionalBubbleOverflow() {
|
||||
return FEATURE_FLAGS.enableOptionalBubbleOverflow();
|
||||
}
|
||||
|
||||
public static boolean enablePip2Implementation() {
|
||||
return FEATURE_FLAGS.enablePip2Implementation();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enablePipUmoExperience() {
|
||||
return FEATURE_FLAGS.enablePipUmoExperience();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableRetrievableBubbles() {
|
||||
return FEATURE_FLAGS.enableRetrievableBubbles();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableSplitContextual() {
|
||||
return FEATURE_FLAGS.enableSplitContextual();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableTaskbarNavbarUnification() {
|
||||
return FEATURE_FLAGS.enableTaskbarNavbarUnification();
|
||||
}
|
||||
|
||||
|
||||
public static boolean enableTinyTaskbar() {
|
||||
return FEATURE_FLAGS.enableTinyTaskbar();
|
||||
}
|
||||
|
||||
|
||||
public static boolean onlyReuseBubbledTaskWhenLaunchedFromBubble() {
|
||||
return FEATURE_FLAGS.onlyReuseBubbledTaskWhenLaunchedFromBubble();
|
||||
}
|
||||
|
||||
private static FeatureFlags FEATURE_FLAGS = new FeatureFlagsImpl();
|
||||
|
||||
}
|
||||
@@ -120,6 +120,19 @@
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- Unused. Included only for compatibility with parent class. -->
|
||||
<Button
|
||||
android:id="@+id/action_save_app_pair"
|
||||
style="@style/GoOverviewActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top|center_horizontal"
|
||||
android:drawableStart="@drawable/ic_save_app_pair_up_down"
|
||||
android:text="@string/action_save_app_pair"
|
||||
android:theme="@style/ThemeControlHighlightWorkspaceColor"
|
||||
android:visibility="gone" />
|
||||
|
||||
</com.android.quickstep.views.GoOverviewActionsView>
|
||||
@@ -14,7 +14,7 @@
|
||||
<string name="assistant_not_selected_text" msgid="3244613673884359276">"برای گوش کردن به نوشتار در صفحهنمایشتان یا ترجمه کردن آن، یکی از برنامههای دستیار دیجیتالی را در «تنظیمات» انتخاب کنید"</string>
|
||||
<string name="assistant_not_supported_title" msgid="1675788067597484142">"برای استفاده از این ویژگی، دستیارتان را تغییر دهید"</string>
|
||||
<string name="assistant_not_supported_text" msgid="1708031078549268884">"برای گوش کردن به نوشتار در صفحهنمایشتان یا ترجمه کردن آن، برنامه دستیار دیجیتالیتان را در «تنظیمات» تغییر دهید"</string>
|
||||
<string name="tooltip_listen" msgid="7634466447860989102">"برای گوش کردن به نوشتار در این صفحه، اینجا ضربه بزنید"</string>
|
||||
<string name="tooltip_translate" msgid="4184845868901542567">"برای ترجمه نوشتار در این صفحه، اینجا ضربه بزنید"</string>
|
||||
<string name="tooltip_listen" msgid="7634466447860989102">"برای گوش کردن به نوشتار در این صفحه، اینجا تکضرب بزنید"</string>
|
||||
<string name="tooltip_translate" msgid="4184845868901542567">"برای ترجمه نوشتار در این صفحه، اینجا تکضرب بزنید"</string>
|
||||
<string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"نمیتوان این برنامه را همرسانی کرد"</string>
|
||||
</resources>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="app_share_drop_target_label" msgid="5804774105974539508">"Partager application"</string>
|
||||
<string name="app_share_drop_target_label" msgid="5804774105974539508">"Partager appli"</string>
|
||||
<string name="action_listen" msgid="2370304050784689486">"Écouter"</string>
|
||||
<string name="action_translate" msgid="8028378961867277746">"Traduire"</string>
|
||||
<string name="action_search" msgid="6269564710943755464">"Lentille"</string>
|
||||
@@ -9,12 +9,12 @@
|
||||
<string name="dialog_cancel" msgid="6464336969134856366">"ANNULER"</string>
|
||||
<string name="dialog_settings" msgid="6564397136021186148">"PARAMÈTRES"</string>
|
||||
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"Traduire ou écouter le texte à l\'écran"</string>
|
||||
<string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Des renseignements comme du texte sur votre écran, des adresses Web et des captures d\'écran peuvent être partagés avec Google.\n\nPour modifier les renseignements que vous partagez, accédez à "<b>"Paramètres > Applications > Applications par défaut > Application d\'assistant numérique"</b>"."</string>
|
||||
<string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Des renseignements comme du texte sur votre écran, des adresses Web et des captures d\'écran peuvent être partagés avec Google.\n\nPour modifier les renseignements que vous partagez, accédez à "<b>"Paramètres > Applis > Applis par défaut > Appli d\'assistant numérique"</b>"."</string>
|
||||
<string name="assistant_not_selected_title" msgid="5017072974603345228">"Choisir un assistant pour utiliser cette fonctionnalité"</string>
|
||||
<string name="assistant_not_selected_text" msgid="3244613673884359276">"Pour écouter ou traduire le texte affiché sur votre écran, choisissez l\'application d\'un assistant numérique dans les paramètres"</string>
|
||||
<string name="assistant_not_selected_text" msgid="3244613673884359276">"Pour écouter ou traduire le texte affiché sur votre écran, choisissez l\'appli d\'un assistant numérique dans les paramètres"</string>
|
||||
<string name="assistant_not_supported_title" msgid="1675788067597484142">"Modifier votre assistant pour utiliser cette fonctionnalité"</string>
|
||||
<string name="assistant_not_supported_text" msgid="1708031078549268884">"Pour écouter ou traduire le texte affiché sur votre écran, modifiez l\'application de votre assistant numérique dans les paramètres"</string>
|
||||
<string name="assistant_not_supported_text" msgid="1708031078549268884">"Pour écouter ou traduire le texte affiché sur votre écran, modifiez l\'appli de votre assistant numérique dans les paramètres"</string>
|
||||
<string name="tooltip_listen" msgid="7634466447860989102">"Touchez ce bouton pour écouter le texte affiché sur cet écran"</string>
|
||||
<string name="tooltip_translate" msgid="4184845868901542567">"Touchez ce bouton pour traduire le texte affiché sur cet écran"</string>
|
||||
<string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"Cette application ne peut pas être partagée"</string>
|
||||
<string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"Cette appli ne peut pas être partagée"</string>
|
||||
</resources>
|
||||
@@ -9,11 +9,11 @@
|
||||
<string name="dialog_cancel" msgid="6464336969134856366">"မလုပ်တော့"</string>
|
||||
<string name="dialog_settings" msgid="6564397136021186148">"ဆက်တင်များ"</string>
|
||||
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"ဖန်သားပြင်ပေါ်ရှိ စာသားကို ဘာသာပြန်ပါ (သို့) နားထောင်ပါ"</string>
|
||||
<string name="niu_actions_confirmation_text" msgid="2105271481950866089">"သင့်ဖန်သားပြင်ပေါ်ရှိ စာသား၊ ဝဘ်လိပ်စာနှင့် ဖန်သားပြင်ဓာတ်ပုံများကဲ့သို့ အချက်အလက်များကို Google နှင့် မျှဝေနိုင်သည်။\n\nသင်မျှဝေသည့် အချက်အလက်များကို ပြောင်းရန် "<b>"ဆက်တင်များ > အက်ပ်များ > မူရင်းအက်ပ်များ > ဒစ်ဂျစ်တယ် Assistant အက်ပ်"</b>" သို့ သွားပါ။"</string>
|
||||
<string name="niu_actions_confirmation_text" msgid="2105271481950866089">"သင့်ဖန်သားပြင်ပေါ်ရှိ စာသား၊ ဝဘ်လိပ်စာနှင့် ဖန်သားပြင်ဓာတ်ပုံများကဲ့သို့ အချက်အလက်များကို Google နှင့် မျှဝေနိုင်သည်။\n\nသင်မျှဝေသည့် အချက်အလက်များကို ပြောင်းရန် "<b>"ဆက်တင်များ > အက်ပ်များ > မူရင်းအက်ပ်များ > ဒစ်ဂျစ်တယ်အထောက်အကူ အက်ပ်"</b>" သို့ သွားပါ။"</string>
|
||||
<string name="assistant_not_selected_title" msgid="5017072974603345228">"ဤဝန်ဆောင်မှုကို အသုံးပြုရန် assistant ရွေးပါ"</string>
|
||||
<string name="assistant_not_selected_text" msgid="3244613673884359276">"ဖန်သားပြင်ပေါ်ရှိ စာသားကို နားထောင်ရန် (သို့) ဘာသာပြန်ဆိုရန် ‘ဆက်တင်များ’ တွင် ဒစ်ဂျစ်တယ် assistant အက်ပ် ရွေးပါ"</string>
|
||||
<string name="assistant_not_selected_text" msgid="3244613673884359276">"ဖန်သားပြင်ပေါ်ရှိ စာသားကို နားထောင်ရန် (သို့) ဘာသာပြန်ဆိုရန် ‘ဆက်တင်များ’ တွင် ဒစ်ဂျစ်တယ်အထောက်အကူ အက်ပ် ရွေးပါ"</string>
|
||||
<string name="assistant_not_supported_title" msgid="1675788067597484142">"ဤဝန်ဆောင်မှုကို သုံးရန် assistant ကို ပြောင်းပါ"</string>
|
||||
<string name="assistant_not_supported_text" msgid="1708031078549268884">"ဖန်သားပြင်ပေါ်ရှိ စာသားကို နားထောင်ရန် (သို့) ဘာသာပြန်ဆိုရန် ‘ဆက်တင်များ’ တွင် ဒစ်ဂျစ်တယ် assistant အက်ပ်ကို ပြောင်းပါ"</string>
|
||||
<string name="assistant_not_supported_text" msgid="1708031078549268884">"ဖန်သားပြင်ပေါ်ရှိ စာသားကို နားထောင်ရန် (သို့) ဘာသာပြန်ဆိုရန် ‘ဆက်တင်များ’ တွင် ဒစ်ဂျစ်တယ်အထောက်အကူ အက်ပ်ကို ပြောင်းပါ"</string>
|
||||
<string name="tooltip_listen" msgid="7634466447860989102">"ဤဖန်သားပြင်ပေါ်ရှိ စာသားကို နားထောင်ရန် ဤနေရာကို တို့ပါ"</string>
|
||||
<string name="tooltip_translate" msgid="4184845868901542567">"ဤဖန်သားပြင်ပေါ်ရှိ စာသားကို ဘာသာပြန်ဆိုရန် ဤနေရာကို တို့ပါ"</string>
|
||||
<string name="toast_p2p_app_not_shareable" msgid="7229739094132131536">"ဤအက်ပ်ကို မျှဝေ၍မရပါ"</string>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<string name="dialog_cancel" msgid="6464336969134856366">"AVBRYT"</string>
|
||||
<string name="dialog_settings" msgid="6564397136021186148">"INNSTILLINGER"</string>
|
||||
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"Oversett eller lytt til tekst på skjermen"</string>
|
||||
<string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Informasjon som tekst på skjermen, nettadresser og skjermdumper kan deles med Google.\n\nFor å endre hvilken informasjon du deler, gå til "<b>"Innstillinger > Apper > Standardapper > Digital assistent-app"</b>"."</string>
|
||||
<string name="niu_actions_confirmation_text" msgid="2105271481950866089">"Informasjon som tekst på skjermen, nettadresser og skjermbilder kan deles med Google.\n\nFor å endre hvilken informasjon du deler, gå til "<b>"Innstillinger > Apper > Standardapper > Digital assistent-app"</b>"."</string>
|
||||
<string name="assistant_not_selected_title" msgid="5017072974603345228">"Velg en assistent for å bruke denne funksjonen"</string>
|
||||
<string name="assistant_not_selected_text" msgid="3244613673884359276">"For å høre eller oversette tekst på skjermen, velg en digital assistent-app i innstillingene"</string>
|
||||
<string name="assistant_not_supported_title" msgid="1675788067597484142">"Endre assistenten for å bruke denne funksjonen"</string>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<string name="dialog_acknowledge" msgid="2804025517675853172">"बुझेँ"</string>
|
||||
<string name="dialog_cancel" msgid="6464336969134856366">"रद्द गर्नुहोस्"</string>
|
||||
<string name="dialog_settings" msgid="6564397136021186148">"सेटिङ"</string>
|
||||
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"स्क्रिनमा देखिने पाठ अनुवाद गरियोस् वा पढेर सुनाइयोस्"</string>
|
||||
<string name="niu_actions_confirmation_title" msgid="3863451714863526143">"स्क्रिनमा देखिने पाठ अनुवाद गर्नुहोस् वा पढेर सुनाउनुहोस्"</string>
|
||||
<string name="niu_actions_confirmation_text" msgid="2105271481950866089">"तपाईंको स्क्रिनमा देखिने पाठ, वेब ठेगाना र स्क्रिनसटलगायतका जानकारी Google सँग सेयर गर्न सकिन्छ।\n\nकुन कुन जानकारी सेयर गर्न दिने भन्ने सेटिङ बदल्न "<b>"सेटिङ > एप > डिफल्ट एप > डिजिटल सहायक एप"</b>" मा जानुहोस्।"</string>
|
||||
<string name="assistant_not_selected_title" msgid="5017072974603345228">"तपाईं यो सुविधा चलाउन चाहनुहुन्छ भने कुनै सहायक छनौट गर्नुहोस्"</string>
|
||||
<string name="assistant_not_selected_text" msgid="3244613673884359276">"तपाईं आफ्नो स्क्रिनमा देखिने पाठ सुन्न वा अनुवाद गर्न चाहनुहुन्छ भने सेटिङमा गई कुनै डिजिटल सहायक एप छनौट गर्नुहोस्"</string>
|
||||
|
||||
@@ -21,4 +21,7 @@
|
||||
<bool name="enable_niu_actions">true</bool>
|
||||
|
||||
<string name="task_overlay_factory_class" translatable="false">com.android.quickstep.TaskOverlayFactoryGo</string>
|
||||
|
||||
<!-- String representing the intent to delete a package. -->
|
||||
<string name="delete_package_intent" translatable="false">#Intent;action=android.intent.action.DELETE;launchFlags=0x10800000;B.android.intent.extra.RETURN_RESULT=true;end</string>
|
||||
</resources>
|
||||
File renamed without changes.
@@ -27,9 +27,12 @@ import android.net.Uri;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
@@ -44,6 +47,9 @@ import com.android.launcher3.popup.SystemShortcut;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
/**
|
||||
* Defines the Share system shortcut and its factory.
|
||||
@@ -64,14 +70,17 @@ public final class AppSharing {
|
||||
|
||||
private static final String TAG = "AppSharing";
|
||||
private static final String FILE_PROVIDER_SUFFIX = ".overview.fileprovider";
|
||||
private static final String APP_EXSTENSION = ".apk";
|
||||
private static final String APP_EXTENSION = ".apk";
|
||||
private static final String APP_MIME_TYPE = "application/application";
|
||||
|
||||
private final String mSharingComponent;
|
||||
private AppShareabilityManager mShareabilityMgr;
|
||||
|
||||
private AppSharing(Launcher launcher) {
|
||||
mSharingComponent = launcher.getText(R.string.app_sharing_component).toString();
|
||||
String sharingComponent = Settings.Secure.getString(launcher.getContentResolver(),
|
||||
Settings.Secure.NEARBY_SHARING_COMPONENT);
|
||||
mSharingComponent = TextUtils.isEmpty(sharingComponent) ? launcher.getText(
|
||||
R.string.app_sharing_component).toString() : sharingComponent;
|
||||
}
|
||||
|
||||
private Uri getShareableUri(Context context, String path, String displayName) {
|
||||
@@ -108,6 +117,9 @@ public final class AppSharing {
|
||||
private final PopupDataProvider mPopupDataProvider;
|
||||
private final boolean mSharingEnabledForUser;
|
||||
|
||||
private final Set<View> mBoundViews = Collections.newSetFromMap(new WeakHashMap<>());
|
||||
private boolean mIsEnabled = true;
|
||||
|
||||
public Share(Launcher target, ItemInfo itemInfo, View originalView) {
|
||||
super(R.drawable.ic_share, R.string.app_share_drop_target_label, target, itemInfo,
|
||||
originalView);
|
||||
@@ -123,11 +135,24 @@ public final class AppSharing {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIconAndLabelFor(View iconView, TextView labelView) {
|
||||
super.setIconAndLabelFor(iconView, labelView);
|
||||
mBoundViews.add(iconView);
|
||||
mBoundViews.add(labelView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIconAndContentDescriptionFor(ImageView view) {
|
||||
super.setIconAndContentDescriptionFor(view);
|
||||
mBoundViews.add(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
ActivityContext.lookupContext(view.getContext())
|
||||
.getStatsLogManager().logger().log(LAUNCHER_SYSTEM_SHORTCUT_APP_SHARE_TAP);
|
||||
if (!isEnabled()) {
|
||||
if (!mIsEnabled) {
|
||||
showCannotShareToast(view.getContext());
|
||||
return;
|
||||
}
|
||||
@@ -147,7 +172,7 @@ public final class AppSharing {
|
||||
PackageInfo packageInfo = packageManager.getPackageInfo(packageName, 0);
|
||||
sourceDir = packageInfo.applicationInfo.sourceDir;
|
||||
appLabel = packageManager.getApplicationLabel(packageInfo.applicationInfo)
|
||||
.toString() + APP_EXSTENSION;
|
||||
+ APP_EXTENSION;
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Could not find info for package \"" + packageName + "\"");
|
||||
return;
|
||||
@@ -175,9 +200,6 @@ public final class AppSharing {
|
||||
return;
|
||||
}
|
||||
checkShareability(/* requestUpdateIfUnknown */ false);
|
||||
mTarget.runOnUiThread(() -> {
|
||||
mPopupDataProvider.redrawSystemShortcuts();
|
||||
});
|
||||
}
|
||||
|
||||
private void checkShareability(boolean requestUpdateIfUnknown) {
|
||||
@@ -207,6 +229,17 @@ public final class AppSharing {
|
||||
int duration = Toast.LENGTH_SHORT;
|
||||
Toast.makeText(context, text, duration).show();
|
||||
}
|
||||
|
||||
public void setEnabled(boolean isEnabled) {
|
||||
if (mIsEnabled != isEnabled) {
|
||||
mIsEnabled = isEnabled;
|
||||
mBoundViews.forEach(v -> v.setEnabled(isEnabled));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return mIsEnabled;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (C) 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.launcher3;
|
||||
|
||||
public final class BuildConfig {
|
||||
public static final String APPLICATION_ID = "com.android.launcher3";
|
||||
|
||||
public static final boolean IS_STUDIO_BUILD = false;
|
||||
/**
|
||||
* Flag to state if the QSB is on the first screen and placed on the top,
|
||||
* this can be overwritten in other launchers with a different value, if needed.
|
||||
*/
|
||||
public static final boolean QSB_ON_FIRST_SCREEN = true;
|
||||
|
||||
/**
|
||||
* Flag to state if the widget on the top of the first screen should be shown.
|
||||
*/
|
||||
public static final boolean WIDGET_ON_FIRST_SCREEN = false;
|
||||
|
||||
/**
|
||||
* Flag to control various developer centric features
|
||||
*/
|
||||
public static final boolean IS_DEBUG_DEVICE = false;
|
||||
|
||||
// Flag to control widgets support in Launcher
|
||||
public static final boolean WIDGETS_ENABLED = false;
|
||||
// Flag to control notification dots support in Launcher
|
||||
public static final boolean NOTIFICATION_DOTS_ENABLED = false;
|
||||
}
|
||||
@@ -35,6 +35,7 @@ import androidx.room.Room;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.launcher3.model.AppShareabilityDatabase.ShareabilityDao;
|
||||
import com.android.launcher3.util.MainThreadInitializedObject;
|
||||
import com.android.launcher3.util.SafeCloseable;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.util.ArrayList;
|
||||
@@ -47,7 +48,7 @@ import java.util.function.Consumer;
|
||||
* Each app's status is retrieved from the Play Store's API. Statuses are cached in order
|
||||
* to limit extraneous calls to that API (which can be time-consuming).
|
||||
*/
|
||||
public class AppShareabilityManager {
|
||||
public class AppShareabilityManager implements SafeCloseable {
|
||||
@Retention(SOURCE)
|
||||
@IntDef({
|
||||
ShareabilityStatus.UNKNOWN,
|
||||
@@ -194,6 +195,11 @@ public class AppShareabilityManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
mDatabase.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides a testable instance of this class
|
||||
* This instance allows database queries on the main thread
|
||||
|
||||
@@ -56,7 +56,7 @@ import com.android.launcher3.views.ArrowTipView;
|
||||
import com.android.quickstep.util.AssistContentRequester;
|
||||
import com.android.quickstep.util.RecentsOrientedState;
|
||||
import com.android.quickstep.views.GoOverviewActionsView;
|
||||
import com.android.quickstep.views.TaskThumbnailView;
|
||||
import com.android.quickstep.views.TaskView.TaskContainer;
|
||||
import com.android.systemui.shared.recents.model.Task;
|
||||
import com.android.systemui.shared.recents.model.ThumbnailData;
|
||||
|
||||
@@ -101,8 +101,8 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory {
|
||||
/**
|
||||
* Create a new overlay instance for the given View
|
||||
*/
|
||||
public TaskOverlayGo createOverlay(TaskThumbnailView thumbnailView) {
|
||||
return new TaskOverlayGo(thumbnailView, mContentRequester);
|
||||
public TaskOverlayGo createOverlay(TaskContainer taskContainer) {
|
||||
return new TaskOverlayGo(taskContainer, mContentRequester);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,9 +120,9 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory {
|
||||
private OverlayDialogGo mDialog;
|
||||
private ArrowTipView mArrowTipView;
|
||||
|
||||
private TaskOverlayGo(TaskThumbnailView taskThumbnailView,
|
||||
private TaskOverlayGo(TaskContainer taskContainer,
|
||||
AssistContentRequester assistContentRequester) {
|
||||
super(taskThumbnailView);
|
||||
super(taskContainer);
|
||||
mFactoryContentRequester = assistContentRequester;
|
||||
mSharedPreferences = LauncherPrefs.getPrefs(mApplicationContext);
|
||||
}
|
||||
@@ -148,7 +148,8 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory {
|
||||
// Disable Overview Actions for Work Profile apps
|
||||
boolean isManagedProfileTask =
|
||||
UserManager.get(mApplicationContext).isManagedProfile(task.key.userId);
|
||||
boolean isAllowedByPolicy = mThumbnailView.isRealSnapshot() && !isManagedProfileTask;
|
||||
boolean isAllowedByPolicy = mTaskContainer.getThumbnailViewDeprecated().isRealSnapshot()
|
||||
&& !isManagedProfileTask;
|
||||
getActionsView().setCallbacks(new OverlayUICallbacksGoImpl(isAllowedByPolicy, task));
|
||||
mTaskPackageName = task.key.getPackageName();
|
||||
mSharedPreferences = LauncherPrefs.getPrefs(mApplicationContext);
|
||||
@@ -162,8 +163,7 @@ public final class TaskOverlayFactoryGo extends TaskOverlayFactory {
|
||||
int taskId = task.key.id;
|
||||
mFactoryContentRequester.requestAssistContent(taskId, this::onAssistContentReceived);
|
||||
|
||||
RecentsOrientedState orientedState =
|
||||
mThumbnailView.getTaskView().getRecentsView().getPagedViewOrientedState();
|
||||
RecentsOrientedState orientedState = mTaskContainer.getTaskView().getOrientedState();
|
||||
boolean isInLandscape = orientedState.getDisplayRotation() != ROTATION_0;
|
||||
|
||||
// show tooltips in portrait mode only
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.launcher3.model;
|
||||
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.model.BgDataModel.Callbacks;
|
||||
|
||||
/**
|
||||
* Binds the results of {@link com.android.launcher3.model.LoaderTask} to the Callbacks objects.
|
||||
*/
|
||||
public class LauncherBinder extends BaseLauncherBinder {
|
||||
|
||||
public LauncherBinder(LauncherAppState app, BgDataModel dataModel,
|
||||
AllAppsList allAppsList, Callbacks[] callbacks) {
|
||||
super(app, dataModel, allAppsList, callbacks, MAIN_EXECUTOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindDeepShortcuts() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindWidgets() {
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.launcher3.model;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.icons.ComponentWithLabelAndIcon;
|
||||
import com.android.launcher3.model.data.PackageItemInfo;
|
||||
import com.android.launcher3.util.PackageUserKey;
|
||||
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Widgets data model that is used by the adapters of the widget views and controllers.
|
||||
*
|
||||
* <p> The widgets and shortcuts are organized using package name as its index.
|
||||
*/
|
||||
public class WidgetsModel {
|
||||
|
||||
// True is the widget support is disabled.
|
||||
public static final boolean GO_DISABLE_WIDGETS = true;
|
||||
public static final boolean GO_DISABLE_NOTIFICATION_DOTS = true;
|
||||
|
||||
private static final ArrayList<WidgetsListBaseEntry> EMPTY_WIDGET_LIST = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Returns a list of {@link WidgetsListBaseEntry}. All {@link WidgetItem} in a single row are
|
||||
* sorted (based on label and user), but the overall list of {@link WidgetsListBaseEntry}s is
|
||||
* not sorted. This list is sorted at the UI when using
|
||||
* {@link com.android.launcher3.widget.picker.WidgetsDiffReporter}
|
||||
*
|
||||
* @see com.android.launcher3.widget.picker.WidgetsListAdapter#setWidgets(List)
|
||||
*/
|
||||
public synchronized ArrayList<WidgetsListBaseEntry> getWidgetsListForPicker(Context context) {
|
||||
return EMPTY_WIDGET_LIST;
|
||||
}
|
||||
|
||||
/** Returns a mapping of packages to their widgets without static shortcuts. */
|
||||
public synchronized Map<PackageUserKey, List<WidgetItem>> getAllWidgetsWithoutShortcuts() {
|
||||
return Map.of();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param packageUser If null, all widgets and shortcuts are updated and returned, otherwise
|
||||
* only widgets and shortcuts associated with the package/user are.
|
||||
*/
|
||||
public List<ComponentWithLabelAndIcon> update(LauncherAppState app,
|
||||
@Nullable PackageUserKey packageUser) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
public void onPackageIconsUpdated(Set<String> packageNames, UserHandle user,
|
||||
LauncherAppState app) {
|
||||
}
|
||||
|
||||
public WidgetItem getWidgetProviderInfoByProviderName(
|
||||
ComponentName providerName, UserHandle user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Returns {@link PackageItemInfo} of a pending widget. */
|
||||
public static PackageItemInfo newPendingItemInfo(
|
||||
Context context, ComponentName provider, UserHandle userHandle) {
|
||||
return new PackageItemInfo(provider.getPackageName(), userHandle);
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2022 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.launcher3.util;
|
||||
|
||||
/**
|
||||
* Defines method to find the next vacant cell on a grid.
|
||||
* This uses the default top-down, left-right approach and can be over-written through
|
||||
* code swaps in different launchers.
|
||||
*/
|
||||
public abstract class AbsGridOccupancy {
|
||||
|
||||
/**
|
||||
* Find the first vacant cell, if there is one.
|
||||
*
|
||||
* @param vacantOut Holds the x and y coordinate of the vacant cell
|
||||
* @param spanX Horizontal cell span.
|
||||
* @param spanY Vertical cell span.
|
||||
*
|
||||
* @return true if a vacant cell was found
|
||||
*/
|
||||
protected boolean findVacantCell(int[] vacantOut, boolean[][] cells, int countX, int countY,
|
||||
int spanX, int spanY) {
|
||||
for (int y = 0; (y + spanY) <= countY; y++) {
|
||||
for (int x = 0; (x + spanX) <= countX; x++) {
|
||||
boolean available = !cells[x][y];
|
||||
out:
|
||||
for (int i = x; i < x + spanX; i++) {
|
||||
for (int j = y; j < y + spanY; j++) {
|
||||
available = available && !cells[i][j];
|
||||
if (!available) break out;
|
||||
}
|
||||
}
|
||||
if (available) {
|
||||
vacantOut[0] = x;
|
||||
vacantOut[1] = y;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@
|
||||
views that do not inherint from TaskView only or create a generic TaskView that have
|
||||
N number of tasks.
|
||||
-->
|
||||
<com.android.quickstep.views.TaskThumbnailView
|
||||
<com.android.quickstep.views.TaskThumbnailViewDeprecated
|
||||
android:id="@+id/snapshot"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2020 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<!-- NOTE! don't add dimensions for margins / gravity to root view in this file, they need to be
|
||||
loaded at runtime. -->
|
||||
<app.lawnchair.overview.LawnchairOverviewActionsView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal|bottom">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/action_buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/overview_actions_height"
|
||||
android:layout_gravity="bottom|center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<app.lawnchair.views.CustomButton
|
||||
android:id="@+id/action_screenshot"
|
||||
style="@style/OverviewActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_screenshot"
|
||||
android:text="@string/action_screenshot" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
|
||||
<app.lawnchair.views.CustomButton
|
||||
android:id="@+id/action_share"
|
||||
style="@style/OverviewActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_share"
|
||||
android:text="@string/action_share" />
|
||||
|
||||
<Space
|
||||
android:id="@+id/oav_three_button_space"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/action_split"
|
||||
style="@style/OverviewActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/action_split"
|
||||
android:theme="@style/ThemeControlHighlightWorkspaceColor"
|
||||
android:visibility="gone" />
|
||||
|
||||
<Space
|
||||
android:id="@+id/action_split_space"
|
||||
android:layout_width="@dimen/overview_actions_button_spacing"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<app.lawnchair.views.CustomButton
|
||||
android:id="@+id/action_lens"
|
||||
style="@style/OverviewActionButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableStart="@drawable/ic_lens"
|
||||
android:text="@string/action_lens" />
|
||||
|
||||
<Space
|
||||
android:id="@+id/lens_space"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
|
||||
<app.lawnchair.views.CustomButton
|
||||
style="@style/OverviewActionButton"
|
||||
android:id="@+id/action_clear_all"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/recents_clear_all"
|
||||
android:drawableStart="@drawable/ic_clear_all_recents"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<Space
|
||||
android:id="@+id/clear_all_space"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
|
||||
<app.lawnchair.views.CustomButton
|
||||
style="@style/OverviewActionButton"
|
||||
android:id="@+id/action_locked"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/action_lock"
|
||||
android:drawableStart="@drawable/ic_locked_recents"
|
||||
android:visibility="gone" />
|
||||
|
||||
<Space
|
||||
android:id="@+id/locked_space"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="1dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
</app.lawnchair.overview.LawnchairOverviewActionsView>
|
||||
@@ -18,6 +18,7 @@
|
||||
<resources>
|
||||
<string name="app_filter_class" translatable="false">app.lawnchair.DefaultAppFilter</string>
|
||||
<string name="calendar_component_name" translatable="false">com.google.android.calendar/com.android.calendar.AllInOneActivity</string>
|
||||
<dimen name="settingslib_preferred_minimum_touch_target">48dp</dimen>
|
||||
<string-array name="dynamic_calendar_components_name">
|
||||
<item>com.android.calendar</item>
|
||||
<item>com.blackberry.calendar</item>
|
||||
@@ -32,11 +33,14 @@
|
||||
<item>org.withouthat.acalendar</item>
|
||||
<item>ws.xsoh.etar</item>
|
||||
</string-array>
|
||||
<!-- String representing the intent for search on the apps market. To specify a query, add
|
||||
q=<query> to the data to the intent -->
|
||||
<string name="market_search_intent" translatable="false">market://search?c=apps</string>
|
||||
<string name="icon_packs_intent_name" translatable="false">app.lawnchair.icons.THEMED_ICON</string>
|
||||
<string name="clock_component_name" translatable="false">com.google.android.deskclock/com.android.deskclock.DeskClock</string>
|
||||
<string name="launcher_activity_logic_class" translatable="false">app.lawnchair.LauncherActivityCachingLogic</string>
|
||||
<string name="main_process_initializer_class" translatable="false">app.lawnchair.LawnchairProcessInitializer</string>
|
||||
<string name="task_overlay_factory_class" translatable="false">app.lawnchair.overview.TaskOverlayFactoryImpl</string>
|
||||
<!-- <string name="task_overlay_factory_class" translatable="false">app.lawnchair.overview.TaskOverlayFactoryImpl</string>-->
|
||||
<string name="wallpaper_picker_package" translatable="false">com.android.wallpaper</string>
|
||||
<string name="wallpaper_picker_package_alt" translatable="false">com.google.android.apps.wallpaper</string>
|
||||
<string name="widget_holder_factory_class" translatable="false">app.lawnchair.factory.LawnchairWidgetHolder$LawnchairHolderFactory</string>
|
||||
@@ -55,6 +59,8 @@
|
||||
<item>@string/launcher_component</item>
|
||||
</string-array>
|
||||
|
||||
<dimen name="page_indicator_dot_size_v2">6dp</dimen>
|
||||
|
||||
<!-- Which QSB search provider to use by default -->
|
||||
<string name="config_default_qsb_search_provider_id" translatable="false">startpage</string>
|
||||
|
||||
|
||||
@@ -168,7 +168,6 @@
|
||||
launcher:numFolderRows="3"
|
||||
launcher:numFolderColumns="3"
|
||||
launcher:numHotseatIcons="6"
|
||||
launcher:hotseatColumnSpanLandscape="4"
|
||||
launcher:numAllAppsColumns="6"
|
||||
launcher:isScalable="true"
|
||||
launcher:inlineNavButtonsEndSpacing="@dimen/taskbar_button_margin_6_5"
|
||||
|
||||
@@ -42,25 +42,12 @@ import dev.kdrag0n.monet.theme.ColorScheme;
|
||||
public class AccentColorExtractor extends LocalColorExtractor implements ThemeProvider.ColorSchemeChangeListener {
|
||||
|
||||
private final ThemeProvider mThemeProvider;
|
||||
private final RectF mTmpRect = new RectF();
|
||||
private Listener mListener;
|
||||
|
||||
@Keep
|
||||
public AccentColorExtractor(Context context) {
|
||||
mThemeProvider = ThemeProvider.INSTANCE.get(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListener(@Nullable Listener listener) {
|
||||
mListener = listener;
|
||||
notifyListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWorkspaceLocation(Rect pos, View child, int screenId) {
|
||||
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected SparseIntArray generateColorsOverride(ColorScheme colorScheme) {
|
||||
SparseIntArray colorRes = new SparseIntArray(5 * 13);
|
||||
@@ -84,15 +71,7 @@ public class AccentColorExtractor extends LocalColorExtractor implements ThemePr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onColorSchemeChanged() {
|
||||
notifyListener();
|
||||
}
|
||||
|
||||
private void notifyListener() {
|
||||
if (mListener != null) {
|
||||
mListener.onColorsChanged(generateColorsOverride(mThemeProvider.getColorScheme()));
|
||||
}
|
||||
}
|
||||
public void onColorSchemeChanged() {}
|
||||
|
||||
// Shade number -> color resource ID maps
|
||||
private static final SparseIntArray ACCENT1_RES = new SparseIntArray(13);
|
||||
|
||||
@@ -10,9 +10,10 @@ import com.android.launcher3.InvariantDeviceProfile.INDEX_LANDSCAPE
|
||||
import com.android.launcher3.InvariantDeviceProfile.INDEX_TWO_PANEL_LANDSCAPE
|
||||
import com.android.launcher3.InvariantDeviceProfile.INDEX_TWO_PANEL_PORTRAIT
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
import com.patrykmichalik.opto.core.firstBlocking
|
||||
|
||||
class DeviceProfileOverrides(context: Context) {
|
||||
class DeviceProfileOverrides(context: Context) : SafeCloseable {
|
||||
private val prefs = PreferenceManager.getInstance(context)
|
||||
private val preferenceManager2 = PreferenceManager2.getInstance(context)
|
||||
|
||||
@@ -56,6 +57,9 @@ class DeviceProfileOverrides(context: Context) {
|
||||
)
|
||||
|
||||
fun getTextFactors() = TextFactors(preferenceManager2)
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
data class DBGridInfo(
|
||||
val numHotseatColumns: Int,
|
||||
@@ -100,8 +104,8 @@ class DeviceProfileOverrides(context: Context) {
|
||||
// apply grid size
|
||||
idp.numAllAppsColumns = numAllAppsColumns
|
||||
idp.numDatabaseAllAppsColumns = numAllAppsColumns
|
||||
idp.numFolderRows = numFolderRows
|
||||
idp.numFolderColumns = numFolderColumns
|
||||
idp.numFolderRows[INDEX_DEFAULT] = numFolderRows
|
||||
idp.numFolderColumns[INDEX_DEFAULT] = numFolderColumns
|
||||
|
||||
// apply icon and text size
|
||||
idp.iconSize[INDEX_DEFAULT] *= iconSizeFactor
|
||||
|
||||
@@ -111,12 +111,12 @@ class FeedBridge(private val context: Context) {
|
||||
val info =
|
||||
context.packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNING_CERTIFICATES)
|
||||
val signingInfo = info.signingInfo
|
||||
if (signingInfo.hasMultipleSigners()) return false
|
||||
if (signingInfo!!.hasMultipleSigners()) return false
|
||||
return signingInfo.signingCertificateHistory.any { it.hashCode() == signatureHash }
|
||||
}
|
||||
else -> {
|
||||
val info = context.packageManager.getPackageInfo(packageName, PackageManager.GET_SIGNATURES)
|
||||
return if (info.signatures.any { it.hashCode() != signatureHash }) false else info.signatures.isNotEmpty()
|
||||
return if (info.signatures!!.any { it.hashCode() != signatureHash }) false else info.signatures!!.isNotEmpty()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ class FeedBridge(private val context: Context) {
|
||||
val info = context.packageManager
|
||||
.getPackageInfo(packageName, PackageManager.GET_SIGNING_CERTIFICATES)
|
||||
val signingInfo = info.signingInfo
|
||||
if (signingInfo.hasMultipleSigners()) return false
|
||||
if (signingInfo!!.hasMultipleSigners()) return false
|
||||
signingInfo.signingCertificateHistory.forEach {
|
||||
val hash = Integer.toHexString(it.hashCode())
|
||||
Log.d(TAG, "Feed provider $packageName(0x$hash) isn't whitelisted")
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.widget.RemoteViews
|
||||
import androidx.core.content.edit
|
||||
import com.android.launcher3.Utilities
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
import kotlinx.coroutines.CoroutineName
|
||||
import kotlinx.coroutines.MainScope
|
||||
import kotlinx.coroutines.channels.awaitClose
|
||||
@@ -22,7 +23,7 @@ import kotlinx.coroutines.flow.onStart
|
||||
import kotlinx.coroutines.flow.shareIn
|
||||
import kotlinx.coroutines.plus
|
||||
|
||||
class HeadlessWidgetsManager(private val context: Context) {
|
||||
class HeadlessWidgetsManager(private val context: Context) : SafeCloseable {
|
||||
|
||||
private val scope = MainScope() + CoroutineName("HeadlessWidgetsManager")
|
||||
private val prefs = Utilities.getDevicePrefs(context)
|
||||
@@ -50,6 +51,10 @@ class HeadlessWidgetsManager(private val context: Context) {
|
||||
return widget.updates
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
private class HeadlessAppWidgetHost(context: Context) : AppWidgetHost(context, 1028) {
|
||||
|
||||
override fun onCreateView(
|
||||
|
||||
@@ -56,6 +56,7 @@ import com.android.launcher3.Utilities
|
||||
import com.android.launcher3.model.data.ItemInfo
|
||||
import com.android.launcher3.popup.SystemShortcut
|
||||
import com.android.launcher3.statemanager.StateManager
|
||||
import com.android.launcher3.statemanager.StateManager.StateHandler
|
||||
import com.android.launcher3.uioverrides.QuickstepLauncher
|
||||
import com.android.launcher3.uioverrides.states.AllAppsState
|
||||
import com.android.launcher3.uioverrides.states.OverviewState
|
||||
@@ -132,7 +133,7 @@ class LawnchairLauncher : QuickstepLauncher() {
|
||||
if (prefs.autoLaunchRoot.get()) {
|
||||
lifecycleScope.launch {
|
||||
try {
|
||||
RootHelperManager.INSTANCE.get(this@LawnchairLauncher).getService()
|
||||
RootHelperManager.INSTANCE.get(this@LawnchairLauncher)
|
||||
} catch (_: RootNotAvailableException) {
|
||||
}
|
||||
}
|
||||
@@ -197,7 +198,7 @@ class LawnchairLauncher : QuickstepLauncher() {
|
||||
reloadIconsIfNeeded()
|
||||
}
|
||||
|
||||
override fun collectStateHandlers(out: MutableList<StateManager.StateHandler<*>>) {
|
||||
override fun collectStateHandlers(out: MutableList<StateHandler<LauncherState>>) {
|
||||
super.collectStateHandlers(out)
|
||||
out.add(SearchBarStateHandler(this))
|
||||
}
|
||||
|
||||
@@ -8,9 +8,10 @@ import android.widget.Button
|
||||
import android.widget.TextView
|
||||
import app.lawnchair.font.FontManager
|
||||
import com.android.launcher3.BubbleTextView
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
import com.android.launcher3.views.DoubleShadowBubbleTextView
|
||||
|
||||
class LawnchairLayoutFactory(context: Context) : LayoutInflater.Factory2 {
|
||||
class LawnchairLayoutFactory(context: Context) : LayoutInflater.Factory2, SafeCloseable {
|
||||
|
||||
private val fontManager by lazy { FontManager.INSTANCE.get(context) }
|
||||
private val constructorMap = mapOf<String, (Context, AttributeSet) -> View>(
|
||||
@@ -36,4 +37,8 @@ class LawnchairLayoutFactory(context: Context) : LayoutInflater.Factory2 {
|
||||
override fun onCreateView(name: String, context: Context, attrs: AttributeSet): View? {
|
||||
return onCreateView(null, name, context, attrs)
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import android.service.notification.StatusBarNotification
|
||||
import app.lawnchair.util.checkPackagePermission
|
||||
import com.android.launcher3.notification.NotificationListener
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.MainScope
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
@@ -13,7 +14,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
class NotificationManager(@Suppress("UNUSED_PARAMETER") context: Context) {
|
||||
class NotificationManager(@Suppress("UNUSED_PARAMETER") context: Context) : SafeCloseable {
|
||||
|
||||
private val scope = MainScope()
|
||||
private val notificationsMap = mutableMapOf<String, StatusBarNotification>()
|
||||
@@ -49,6 +50,10 @@ class NotificationManager(@Suppress("UNUSED_PARAMETER") context: Context) {
|
||||
_notifications.value = notificationsMap.values.toList()
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmField val INSTANCE = MainThreadInitializedObject(::NotificationManager)
|
||||
}
|
||||
|
||||
@@ -99,6 +99,6 @@ class SearchBarStateHandler(private val launcher: LawnchairLauncher) :
|
||||
|
||||
private fun showKeyboard() {
|
||||
val editText = launcher.appsView.searchUiManager.editText ?: return
|
||||
editText.showKeyboard(true)
|
||||
editText.showKeyboard()
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import app.lawnchair.launcher
|
||||
import app.lawnchair.preferences2.PreferenceManager2
|
||||
import com.android.launcher3.allapps.AllAppsStore
|
||||
import com.android.launcher3.allapps.AlphabeticalAppsList
|
||||
import com.android.launcher3.allapps.PrivateProfileManager
|
||||
import com.android.launcher3.allapps.WorkProfileManager
|
||||
import com.android.launcher3.model.data.AppInfo
|
||||
import com.android.launcher3.model.data.ItemInfo
|
||||
@@ -18,7 +19,8 @@ class LawnchairAlphabeticalAppsList<T>(
|
||||
context: T,
|
||||
appsStore: AllAppsStore<T>,
|
||||
workProfileManager: WorkProfileManager?,
|
||||
) : AlphabeticalAppsList<T>(context, appsStore, workProfileManager)
|
||||
privateProfileManager: PrivateProfileManager,
|
||||
) : AlphabeticalAppsList<T>(context, appsStore, workProfileManager, privateProfileManager)
|
||||
where T : Context, T : ActivityContext {
|
||||
|
||||
private var hiddenApps: Set<String> = setOf()
|
||||
|
||||
@@ -11,7 +11,6 @@ import android.view.ViewGroup
|
||||
import androidx.core.view.isInvisible
|
||||
import androidx.core.view.isVisible
|
||||
import app.lawnchair.launcher
|
||||
import app.lawnchair.search.adapter.SHORTCUT
|
||||
import app.lawnchair.search.adapter.SearchTargetCompat
|
||||
import app.lawnchair.search.model.SearchResultActionCallBack
|
||||
import app.lawnchair.util.runOnMainThread
|
||||
@@ -19,6 +18,7 @@ import com.android.launcher3.BubbleTextView
|
||||
import com.android.launcher3.LauncherAppState
|
||||
import com.android.launcher3.LauncherSettings
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.icons.BaseIconFactory
|
||||
import com.android.launcher3.icons.BitmapInfo
|
||||
import com.android.launcher3.icons.IconProvider
|
||||
import com.android.launcher3.icons.LauncherIcons
|
||||
@@ -209,7 +209,7 @@ class SearchResultIcon(context: Context, attrs: AttributeSet?) :
|
||||
info.hasFlags(SearchActionItemInfo.FLAG_PRIMARY_ICON_FROM_TITLE) ->
|
||||
li.createIconBitmap("${info.title}", packageIcon.color)
|
||||
icon == null -> packageIcon
|
||||
else -> li.createBadgedIconBitmap(icon.loadDrawable(context), info.user, target.packageName != SHORTCUT)
|
||||
else -> icon.loadDrawable(context)?.let { li.createBadgedIconBitmap(it, BaseIconFactory.IconOptions().setUser(info.user)) }
|
||||
}
|
||||
if (info.hasFlags(SearchActionItemInfo.FLAG_BADGE_WITH_COMPONENT_NAME) && target.extras.containsKey("class")) {
|
||||
try {
|
||||
@@ -218,7 +218,7 @@ class SearchResultIcon(context: Context, attrs: AttributeSet?) :
|
||||
ComponentName(target.packageName, target.extras.getString("class")!!)
|
||||
val activityInfo = context.packageManager.getActivityInfo(componentName, 0)
|
||||
val activityIcon = iconProvider.getIcon(activityInfo)
|
||||
val bitmap = li.createIconBitmap(activityIcon, 1f, iconSize)
|
||||
val bitmap = li.createIconBitmap(activityIcon, 1f)
|
||||
val bitmapInfo = BitmapInfo.of(bitmap, packageIcon.color)
|
||||
info.bitmap = li.badgeBitmap(info.bitmap.icon, bitmapInfo)
|
||||
} catch (_: PackageManager.NameNotFoundException) {
|
||||
|
||||
@@ -6,10 +6,10 @@ import android.content.Context
|
||||
import android.os.Build
|
||||
import android.util.Log
|
||||
import app.lawnchair.LawnchairApp
|
||||
import app.lawnchair.util.MainThreadInitializedObject
|
||||
import app.lawnchair.util.requireSystemService
|
||||
import com.android.launcher3.BuildConfig
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import java.io.File
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.lawnchair.config
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import app.lawnchair.LawnchairApp
|
||||
import com.android.launcher3.config.FeatureFlags.BooleanFlag
|
||||
|
||||
class DynamicFlag(
|
||||
key: String,
|
||||
private val getValue: (Context?) -> Boolean,
|
||||
defaultValue: Boolean,
|
||||
) : BooleanFlag(defaultValue) {
|
||||
|
||||
override fun get(): Boolean {
|
||||
return try {
|
||||
getValue(LawnchairApp.instance)
|
||||
} catch (t: Throwable) {
|
||||
Log.d("DynamicFlag", "failed to get value for ", t)
|
||||
super.get()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import androidx.room.TypeConverters
|
||||
import androidx.sqlite.db.SimpleSQLiteQuery
|
||||
import app.lawnchair.data.iconoverride.IconOverride
|
||||
import app.lawnchair.data.iconoverride.IconOverrideDao
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import app.lawnchair.util.MainThreadInitializedObject
|
||||
|
||||
@Database(entities = [IconOverride::class], version = 1)
|
||||
@TypeConverters(Converters::class)
|
||||
|
||||
@@ -4,8 +4,11 @@ import android.content.Context
|
||||
import app.lawnchair.data.AppDatabase
|
||||
import app.lawnchair.icons.IconPickerItem
|
||||
import com.android.launcher3.LauncherAppState
|
||||
import com.android.launcher3.pm.PackageInstallInfo
|
||||
import com.android.launcher3.pm.PackageInstallInfo.STATUS_INSTALLED
|
||||
import com.android.launcher3.util.ComponentKey
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
import java.util.concurrent.ConcurrentLinkedQueue
|
||||
import kotlinx.coroutines.CoroutineName
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -14,7 +17,7 @@ import kotlinx.coroutines.flow.flowOn
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.plus
|
||||
|
||||
class IconOverrideRepository(private val context: Context) {
|
||||
class IconOverrideRepository(private val context: Context) : SafeCloseable {
|
||||
|
||||
private val scope = MainScope() + CoroutineName("IconOverrideRepository")
|
||||
private val dao = AppDatabase.INSTANCE.get(context).iconOverrideDao()
|
||||
@@ -61,7 +64,17 @@ class IconOverrideRepository(private val context: Context) {
|
||||
|
||||
private fun updatePackageIcons(target: ComponentKey) {
|
||||
val model = LauncherAppState.getInstance(context).model
|
||||
model.onPackageChanged(target.componentName.packageName, target.user)
|
||||
model.onPackageStateChanged(
|
||||
PackageInstallInfo.fromState(
|
||||
STATUS_INSTALLED,
|
||||
target.componentName.packageName,
|
||||
target.user,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -36,6 +36,7 @@ import app.lawnchair.util.subscribeFiles
|
||||
import app.lawnchair.util.uiHelperHandler
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
import java.io.File
|
||||
import kotlin.coroutines.resume
|
||||
import kotlin.coroutines.suspendCoroutine
|
||||
@@ -49,7 +50,7 @@ import kotlinx.coroutines.plus
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
|
||||
class FontCache private constructor(private val context: Context) {
|
||||
class FontCache private constructor(private val context: Context) : SafeCloseable {
|
||||
|
||||
private val scope = MainScope() + CoroutineName("FontCache")
|
||||
|
||||
@@ -121,6 +122,10 @@ class FontCache private constructor(private val context: Context) {
|
||||
deferredFonts.remove(TTFFont(context, file))
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
class Family(val displayName: String, val variants: Map<String, Font>) {
|
||||
|
||||
constructor(font: Font) : this(font.displayName, mapOf(Pair("regular", font)))
|
||||
|
||||
@@ -13,9 +13,10 @@ import app.lawnchair.util.lookupLifecycleOwner
|
||||
import app.lawnchair.util.runOnMainThread
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class FontManager private constructor(private val context: Context) {
|
||||
class FontManager private constructor(private val context: Context) : SafeCloseable {
|
||||
|
||||
private val fontCache = FontCache.INSTANCE.get(context)
|
||||
|
||||
@@ -81,6 +82,10 @@ class FontManager private constructor(private val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
class FontSpec(val loader: () -> FontCache.Font, val fallback: Typeface) {
|
||||
constructor(pref: BasePreferenceManager.FontPref, fallback: Typeface) : this(pref::get, fallback)
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.content.res.Resources
|
||||
import app.lawnchair.preferences2.PreferenceManager2
|
||||
import app.lawnchair.util.toArrayList
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
import kotlinx.coroutines.CoroutineName
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -29,7 +30,7 @@ import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.flow.first
|
||||
import org.json.JSONObject
|
||||
|
||||
class GoogleFontsListing private constructor(private val context: Context) {
|
||||
class GoogleFontsListing private constructor(private val context: Context) : SafeCloseable {
|
||||
private val scope = CoroutineScope(CoroutineName("GoogleFontsListing"))
|
||||
|
||||
private val dataProvider = MockDataProvider(context.resources)
|
||||
@@ -67,6 +68,10 @@ class GoogleFontsListing private constructor(private val context: Context) {
|
||||
return fonts.await()
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
sealed interface DataProvider {
|
||||
|
||||
fun getFontListing(): JSONObject
|
||||
|
||||
@@ -7,6 +7,6 @@ class OpenAppSearchGestureHandler(context: Context) : OpenAppDrawerGestureHandle
|
||||
|
||||
override suspend fun onTrigger(launcher: LawnchairLauncher) {
|
||||
super.onTrigger(launcher)
|
||||
launcher.appsView.searchUiManager.editText?.showKeyboard(true)
|
||||
launcher.appsView.searchUiManager.editText?.showKeyboard()
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,9 @@ import android.os.UserHandle
|
||||
import com.android.launcher3.icons.ClockDrawableWrapper
|
||||
import com.android.launcher3.icons.ThemedIconDrawable
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
|
||||
class IconPackProvider(private val context: Context) {
|
||||
class IconPackProvider(private val context: Context) : SafeCloseable {
|
||||
|
||||
private val iconPacks = mutableMapOf<String, IconPack?>()
|
||||
|
||||
@@ -112,6 +113,10 @@ class IconPackProvider(private val context: Context) {
|
||||
}
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val INSTANCE = MainThreadInitializedObject(::IconPackProvider)
|
||||
|
||||
@@ -28,9 +28,10 @@ import com.android.launcher3.Utilities
|
||||
import com.android.launcher3.icons.GraphicsUtils
|
||||
import com.android.launcher3.icons.IconProvider
|
||||
import com.android.launcher3.util.MainThreadInitializedObject
|
||||
import com.android.launcher3.util.SafeCloseable
|
||||
import com.patrykmichalik.opto.core.firstBlocking
|
||||
|
||||
class IconShapeManager(private val context: Context) {
|
||||
class IconShapeManager(private val context: Context) : SafeCloseable {
|
||||
|
||||
private val systemIconShape = getSystemShape()
|
||||
|
||||
@@ -84,6 +85,10 @@ class IconShapeManager(private val context: Context) {
|
||||
}!!
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val INSTANCE = MainThreadInitializedObject(::IconShapeManager)
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package app.lawnchair.nexuslauncher
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.pm.ApplicationInfo
|
||||
import android.os.Bundle
|
||||
import app.lawnchair.FeedBridge
|
||||
import app.lawnchair.LawnchairLauncher
|
||||
import app.lawnchair.preferences2.PreferenceManager2
|
||||
@@ -78,32 +76,32 @@ class OverlayCallbackImpl(private val mLauncher: LawnchairLauncher) :
|
||||
mClient.hideOverlay(duration)
|
||||
}
|
||||
|
||||
override fun startSearch(config: ByteArray?, extras: Bundle?): Boolean = false
|
||||
|
||||
override fun onActivityCreated(activity: Activity, bundle: Bundle?) = Unit
|
||||
|
||||
override fun onActivityStarted(activity: Activity) {
|
||||
mClient.onStart()
|
||||
}
|
||||
|
||||
override fun onActivityResumed(activity: Activity) {
|
||||
mClient.onResume()
|
||||
}
|
||||
|
||||
override fun onActivityPaused(activity: Activity) {
|
||||
mClient.onPause()
|
||||
}
|
||||
|
||||
override fun onActivityStopped(activity: Activity) {
|
||||
mClient.onStop()
|
||||
}
|
||||
|
||||
override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) = Unit
|
||||
|
||||
override fun onActivityDestroyed(activity: Activity) {
|
||||
mClient.onDestroy()
|
||||
mClient.mDestroyed = true
|
||||
}
|
||||
// override fun startSearch(config: ByteArray?, extras: Bundle?): Boolean = false
|
||||
//
|
||||
// override fun onActivityCreated(activity: Activity, bundle: Bundle?) = Unit
|
||||
//
|
||||
// override fun onActivityStarted(activity: Activity) {
|
||||
// mClient.onStart()
|
||||
// }
|
||||
//
|
||||
// override fun onActivityResumed(activity: Activity) {
|
||||
// mClient.onResume()
|
||||
// }
|
||||
//
|
||||
// override fun onActivityPaused(activity: Activity) {
|
||||
// mClient.onPause()
|
||||
// }
|
||||
//
|
||||
// override fun onActivityStopped(activity: Activity) {
|
||||
// mClient.onStop()
|
||||
// }
|
||||
//
|
||||
// override fun onActivitySaveInstanceState(activity: Activity, bundle: Bundle) = Unit
|
||||
//
|
||||
// override fun onActivityDestroyed(activity: Activity) {
|
||||
// mClient.onDestroy()
|
||||
// mClient.mDestroyed = true
|
||||
// }
|
||||
|
||||
override fun onOverlayScrollChanged(progress: Float) {
|
||||
mLauncherOverlayCallbacks?.onOverlayScrollChanged(progress)
|
||||
|
||||
@@ -141,7 +141,7 @@ fun CustomizeAppDialog(
|
||||
if (newTitle != previousTitle) {
|
||||
prefs.customAppName[componentKey] = newTitle
|
||||
val model = LauncherAppState.getInstance(context).model
|
||||
model.onPackageChanged(componentKey.componentName.packageName, componentKey.user)
|
||||
model.onAppIconChanged(componentKey.componentName.packageName, componentKey.user)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
package app.lawnchair.overview
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.widget.Button
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.isVisible
|
||||
import app.lawnchair.preferences.PreferenceManager
|
||||
import app.lawnchair.util.RecentHelper
|
||||
import app.lawnchair.util.isDefaultLauncher
|
||||
import app.lawnchair.util.isOnePlusStock
|
||||
import com.android.launcher3.Launcher
|
||||
import com.android.launcher3.LauncherState
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.statemanager.StateManager
|
||||
import com.android.quickstep.views.OverviewActionsView
|
||||
import com.android.quickstep.views.RecentsView
|
||||
import com.android.systemui.shared.recents.model.Task
|
||||
|
||||
class LawnchairOverviewActionsView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0,
|
||||
) : OverviewActionsView<TaskOverlayFactoryImpl.OverlayUICallbacks>(context, attrs, defStyleAttr) {
|
||||
|
||||
private val prefs = PreferenceManager.getInstance(context)
|
||||
private val launcher: Launcher? = if (context.isDefaultLauncher()) Launcher.getLauncher(context) else null
|
||||
private lateinit var container: LinearLayout
|
||||
private lateinit var screenshotAction: Button
|
||||
private lateinit var shareAction: Button
|
||||
private lateinit var lensAction: Button
|
||||
private lateinit var clearAllAction: Button
|
||||
private lateinit var lockedAction: Button
|
||||
private var rv: RecentsView<Launcher, *>? = null
|
||||
|
||||
private val lockedTaskStateLister = object : StateManager.StateListener<LauncherState> {
|
||||
override fun onStateTransitionStart(toState: LauncherState) {
|
||||
rv = launcher?.getOverviewPanel()
|
||||
}
|
||||
|
||||
override fun onStateTransitionComplete(finalState: LauncherState) {
|
||||
if (finalState.overviewUi && context.isDefaultLauncher()) {
|
||||
rv?.addOnScrollChangedListener {
|
||||
val task = rv?.getCurrentPageTaskView()?.task
|
||||
task?.let { updateLockedActionState(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFinishInflate() {
|
||||
super.onFinishInflate()
|
||||
|
||||
container = ViewCompat.requireViewById(this, R.id.action_buttons)
|
||||
clearAllAction = ViewCompat.requireViewById(this, R.id.action_clear_all)
|
||||
shareAction = ViewCompat.requireViewById(this, R.id.action_share)
|
||||
lensAction = ViewCompat.requireViewById(this, R.id.action_lens)
|
||||
screenshotAction = ViewCompat.requireViewById(this, R.id.action_screenshot)
|
||||
lockedAction = ViewCompat.requireViewById(this, R.id.action_locked)
|
||||
|
||||
shareAction.setOnClickListener { mCallbacks?.onShare() }
|
||||
lensAction.setOnClickListener { mCallbacks?.onLens() }
|
||||
if (context.isDefaultLauncher()) {
|
||||
lockedAction.setOnClickListener {
|
||||
rv = launcher?.getOverviewPanel()
|
||||
val task = rv?.getCurrentPageTaskView()?.task
|
||||
if (task != null) {
|
||||
mCallbacks?.onLocked(context, task)
|
||||
updateLockedActionState(task)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prefs.recentsActionClearAll.subscribeChanges(this, ::updateVisibilities)
|
||||
prefs.recentsActionLens.subscribeChanges(this, ::updateVisibilities)
|
||||
prefs.recentsActionScreenshot.subscribeChanges(this, ::updateVisibilities)
|
||||
prefs.recentsActionShare.subscribeChanges(this, ::updateVisibilities)
|
||||
prefs.recentsActionLocked.subscribeChanges(this, ::updateVisibilities)
|
||||
prefs.recentActionOrder.subscribeChanges(this, ::updateVisibilities)
|
||||
|
||||
updateVisibilities()
|
||||
}
|
||||
|
||||
private fun updateVisibilities() {
|
||||
val order = prefs.recentActionOrder.get().split(",").map { it.toInt() }
|
||||
|
||||
val buttonMap = mutableMapOf<Int, View>()
|
||||
if (prefs.recentsActionScreenshot.get() && !isOnePlusStock) {
|
||||
buttonMap[0] = screenshotAction
|
||||
}
|
||||
if (prefs.recentsActionShare.get()) {
|
||||
buttonMap[1] = shareAction
|
||||
}
|
||||
if (prefs.recentsActionLens.get() && isLensAvailable()) {
|
||||
buttonMap[2] = lensAction
|
||||
}
|
||||
if (prefs.recentsActionLocked.get()) {
|
||||
buttonMap[3] = lockedAction
|
||||
}
|
||||
if (prefs.recentsActionClearAll.get()) {
|
||||
buttonMap[4] = clearAllAction
|
||||
}
|
||||
|
||||
val buttonsInOrder = order.mapNotNull { buttonMap[it] }
|
||||
|
||||
container.removeAllViews()
|
||||
container.addView(createSpace())
|
||||
buttonsInOrder.forEach { view ->
|
||||
view.isVisible = true
|
||||
container.addView(view)
|
||||
container.addView(createSpace())
|
||||
}
|
||||
}
|
||||
|
||||
private fun isLensAvailable(): Boolean {
|
||||
val lensIntent = context.packageManager.getLaunchIntentForPackage("com.google.ar.lens")
|
||||
return lensIntent != null
|
||||
}
|
||||
|
||||
private fun updateLockedActionState(task: Task) {
|
||||
lockedAction.post {
|
||||
val isLocked = RecentHelper.isAppLocked(task.key.packageName, context)
|
||||
val drawableResId = if (isLocked) R.drawable.ic_unlocked_recents else R.drawable.ic_locked_recents
|
||||
val textResId = if (isLocked) R.string.action_unlock else R.string.action_lock
|
||||
|
||||
val drawable = ContextCompat.getDrawable(context, drawableResId)
|
||||
lockedAction.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, null)
|
||||
lockedAction.setText(textResId)
|
||||
}
|
||||
}
|
||||
|
||||
private fun createSpace(): View {
|
||||
return Space(context).apply {
|
||||
layoutParams = LinearLayout.LayoutParams(0, 1).apply { weight = 1f }
|
||||
}
|
||||
}
|
||||
|
||||
override fun setClearAllClickListener(clearAllClickListener: OnClickListener?) {
|
||||
clearAllAction.setOnClickListener(clearAllClickListener)
|
||||
}
|
||||
|
||||
override fun removeOnAttachStateChangeListener(listener: OnAttachStateChangeListener?) {
|
||||
super.removeOnAttachStateChangeListener(listener)
|
||||
if (context.isDefaultLauncher() && prefs.recentsActionLocked.get()) {
|
||||
launcher?.stateManager?.removeStateListener(lockedTaskStateLister)
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
override fun addOnAttachStateChangeListener(listener: OnAttachStateChangeListener?) {
|
||||
super.addOnAttachStateChangeListener(listener)
|
||||
if (context.isDefaultLauncher() && prefs.recentsActionLocked.get()) {
|
||||
launcher?.stateManager?.addStateListener(lockedTaskStateLister)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package app.lawnchair.overview
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Matrix
|
||||
import androidx.annotation.Keep
|
||||
import app.lawnchair.util.RecentHelper
|
||||
import app.lawnchair.util.TaskUtilLockState
|
||||
import com.android.quickstep.TaskOverlayFactory
|
||||
import com.android.quickstep.views.OverviewActionsView
|
||||
import com.android.quickstep.views.TaskThumbnailView
|
||||
import com.android.systemui.shared.recents.model.Task
|
||||
import com.android.systemui.shared.recents.model.ThumbnailData
|
||||
|
||||
@Keep
|
||||
class TaskOverlayFactoryImpl(@Suppress("UNUSED_PARAMETER") context: Context) : TaskOverlayFactory() {
|
||||
|
||||
override fun createOverlay(thumbnailView: TaskThumbnailView) = TaskOverlay(thumbnailView)
|
||||
|
||||
class TaskOverlay(
|
||||
taskThumbnailView: TaskThumbnailView,
|
||||
) : TaskOverlayFactory.TaskOverlay<LawnchairOverviewActionsView>(taskThumbnailView) {
|
||||
|
||||
override fun initOverlay(
|
||||
task: Task?,
|
||||
thumbnail: ThumbnailData?,
|
||||
matrix: Matrix,
|
||||
rotated: Boolean,
|
||||
) {
|
||||
actionsView.updateDisabledFlags(
|
||||
OverviewActionsView.DISABLED_NO_THUMBNAIL,
|
||||
thumbnail == null,
|
||||
)
|
||||
|
||||
if (thumbnail != null) {
|
||||
actionsView.updateDisabledFlags(OverviewActionsView.DISABLED_ROTATED, rotated)
|
||||
val isAllowedByPolicy = mThumbnailView.isRealSnapshot
|
||||
actionsView.setCallbacks(OverlayUICallbacksImpl(isAllowedByPolicy, task))
|
||||
}
|
||||
}
|
||||
|
||||
private inner class OverlayUICallbacksImpl(
|
||||
isAllowedByPolicy: Boolean,
|
||||
task: Task?,
|
||||
) : TaskOverlayFactory.TaskOverlay<LawnchairOverviewActionsView>.OverlayUICallbacksImpl(
|
||||
isAllowedByPolicy,
|
||||
task,
|
||||
),
|
||||
OverlayUICallbacks {
|
||||
|
||||
override fun onShare() {
|
||||
if (mIsAllowedByPolicy) {
|
||||
endLiveTileMode { mImageApi.startShareActivity(null) }
|
||||
} else {
|
||||
showBlockedByPolicyMessage()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLens() {
|
||||
if (mIsAllowedByPolicy) {
|
||||
endLiveTileMode { mImageApi.startLensActivity() }
|
||||
} else {
|
||||
showBlockedByPolicyMessage()
|
||||
}
|
||||
}
|
||||
override fun onLocked(context: Context, task: Task) {
|
||||
val isLocked = !RecentHelper.isAppLocked(task.key.packageName, context)
|
||||
TaskUtilLockState.setTaskLockState(
|
||||
context,
|
||||
task.key.component,
|
||||
isLocked,
|
||||
task.key,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sealed interface OverlayUICallbacks : TaskOverlayFactory.OverlayUICallbacks {
|
||||
fun onShare()
|
||||
fun onLens()
|
||||
fun onLocked(context: Context, task: Task)
|
||||
}
|
||||
}
|
||||
@@ -1,206 +1,3 @@
|
||||
package app.lawnchair.overview
|
||||
|
||||
import android.app.ActivityManagerNative
|
||||
import android.app.ActivityOptions
|
||||
import android.graphics.Color
|
||||
import android.graphics.Rect
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.os.RemoteException
|
||||
import android.os.UserHandle
|
||||
import android.util.Log
|
||||
import android.view.Display
|
||||
import android.view.View
|
||||
import android.view.WindowManagerGlobal
|
||||
import android.widget.Toast
|
||||
import app.lawnchair.LawnchairLauncher
|
||||
import app.lawnchair.compat.LawnchairQuickstepCompat
|
||||
import app.lawnchair.compatlib.eleven.WindowManagerCompatVR
|
||||
import com.android.launcher3.BaseDraggingActivity
|
||||
import com.android.launcher3.R
|
||||
import com.android.launcher3.logging.StatsLogManager.LauncherEvent
|
||||
import com.android.launcher3.popup.SystemShortcut
|
||||
import com.android.quickstep.TaskShortcutFactory
|
||||
import com.android.quickstep.views.RecentsView
|
||||
import com.android.quickstep.views.TaskThumbnailView
|
||||
import com.android.quickstep.views.TaskView
|
||||
import com.android.quickstep.views.TaskView.TaskIdAttributeContainer
|
||||
import com.android.systemui.shared.recents.view.AppTransitionAnimationSpecCompat
|
||||
import com.android.systemui.shared.recents.view.AppTransitionAnimationSpecsFuture
|
||||
import com.android.systemui.shared.recents.view.RecentsTransition
|
||||
import com.android.systemui.shared.system.ActivityManagerWrapper
|
||||
|
||||
object TaskShortcutFactory {
|
||||
|
||||
class LegacySplitSystemShortcut(
|
||||
iconRes: Int,
|
||||
textRes: Int,
|
||||
activity: BaseDraggingActivity,
|
||||
taskContainer: TaskIdAttributeContainer,
|
||||
private val mLauncherEvent: LauncherEvent,
|
||||
) : SystemShortcut<BaseDraggingActivity?>(
|
||||
iconRes,
|
||||
textRes,
|
||||
activity,
|
||||
taskContainer.itemInfo,
|
||||
taskContainer.taskView,
|
||||
) {
|
||||
private val mHandler: Handler = Handler(Looper.getMainLooper())
|
||||
private val mRecentsView: RecentsView<*, *> = activity.getOverviewPanel()
|
||||
private val mThumbnailView: TaskThumbnailView = taskContainer.thumbnailView
|
||||
private val mTaskView: TaskView = taskContainer.taskView
|
||||
|
||||
private fun makeLaunchOptions(activity: BaseDraggingActivity): ActivityOptions? {
|
||||
val navBarPosition: Int = WindowManagerCompatVR.getNavBarPosition(activity.displayId)
|
||||
if (navBarPosition == WindowManagerCompatVR.NAV_BAR_POS_INVALID) {
|
||||
return null
|
||||
}
|
||||
val options = ActivityOptions.makeBasic()
|
||||
options.launchWindowingMode = WindowManagerCompatVR.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
|
||||
return options
|
||||
}
|
||||
|
||||
override fun onClick(view: View) {
|
||||
val taskKey = mTaskView.task!!.key
|
||||
val taskId = taskKey.id
|
||||
dismissTaskMenuView(mTarget)
|
||||
val options = makeLaunchOptions(mTarget!!)
|
||||
if (options != null && ActivityManagerWrapper.getInstance().startActivityFromRecents(taskId, options)) {
|
||||
val animStartedListener =
|
||||
Runnable { mRecentsView.dismissTask(mTaskView, false, false) }
|
||||
val position = IntArray(2)
|
||||
mThumbnailView.getLocationOnScreen(position)
|
||||
val width = (mThumbnailView.width * mTaskView.scaleX).toInt()
|
||||
val height = (mThumbnailView.height * mTaskView.scaleY).toInt()
|
||||
val taskBounds = Rect(
|
||||
position[0],
|
||||
position[1],
|
||||
position[0] + width,
|
||||
position[1] + height,
|
||||
)
|
||||
|
||||
// Take the thumbnail of the task without a scrim and apply it back after
|
||||
val alpha = mThumbnailView.dimAlpha
|
||||
mThumbnailView.dimAlpha = 0f
|
||||
val thumbnail = RecentsTransition.drawViewIntoHardwareBitmap(
|
||||
taskBounds.width(),
|
||||
taskBounds.height(),
|
||||
mThumbnailView,
|
||||
1f,
|
||||
Color.BLACK,
|
||||
)
|
||||
mThumbnailView.dimAlpha = alpha
|
||||
val future: AppTransitionAnimationSpecsFuture = object : AppTransitionAnimationSpecsFuture(mHandler) {
|
||||
override fun composeSpecs(): List<AppTransitionAnimationSpecCompat> {
|
||||
return listOf(
|
||||
AppTransitionAnimationSpecCompat(
|
||||
taskId,
|
||||
thumbnail,
|
||||
taskBounds,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
try {
|
||||
WindowManagerGlobal.getWindowManagerService()
|
||||
.overridePendingAppTransitionMultiThumbFuture(
|
||||
future.future,
|
||||
RecentsTransition.wrapStartedListener(
|
||||
mHandler,
|
||||
animStartedListener,
|
||||
),
|
||||
true,
|
||||
taskKey.displayId,
|
||||
)
|
||||
} catch (e: RemoteException) {
|
||||
Log.w("TAG", "Failed to override pending app transition (multi-thumbnail future): ", e)
|
||||
}
|
||||
mTarget.statsLogManager.logger().withItemInfo(mTaskView.itemInfo).log(mLauncherEvent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmField
|
||||
var legacySplit: TaskShortcutFactory = object : TaskShortcutFactory {
|
||||
|
||||
override fun getShortcuts(
|
||||
activity: BaseDraggingActivity,
|
||||
taskContainer: TaskIdAttributeContainer,
|
||||
): List<SystemShortcut<*>>? {
|
||||
val task = taskContainer.task
|
||||
if (!task.isDockable) {
|
||||
return null
|
||||
}
|
||||
return if (isAvailable(activity, task.key.displayId)) {
|
||||
listOf(
|
||||
LegacySplitSystemShortcut(
|
||||
R.drawable.ic_split_vertical,
|
||||
R.string.recent_task_option_split_screen,
|
||||
activity,
|
||||
taskContainer,
|
||||
LauncherEvent.LAUNCHER_SYSTEM_SHORTCUT_SPLIT_SCREEN_TAP,
|
||||
),
|
||||
)
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
private fun isAvailable(activity: BaseDraggingActivity, displayId: Int): Boolean {
|
||||
return if (LawnchairQuickstepCompat.ATLEAST_T) {
|
||||
false
|
||||
} else {
|
||||
(
|
||||
!activity.deviceProfile.isMultiWindowMode &&
|
||||
(displayId == -1 || displayId == Display.DEFAULT_DISPLAY)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class KillSystemShortcut(
|
||||
activity: BaseDraggingActivity,
|
||||
taskContainer: TaskIdAttributeContainer,
|
||||
) : SystemShortcut<BaseDraggingActivity>(
|
||||
R.drawable.ic_close,
|
||||
R.string.task_menu_force_stop,
|
||||
activity,
|
||||
taskContainer.itemInfo,
|
||||
taskContainer.taskView,
|
||||
) {
|
||||
private val mTaskView: TaskView = taskContainer.taskView
|
||||
private val mActivity: BaseDraggingActivity = activity
|
||||
override fun onClick(view: View) {
|
||||
val iam = ActivityManagerNative.getDefault()
|
||||
val task = mTaskView.task
|
||||
if (task != null) {
|
||||
try {
|
||||
iam.forceStopPackage(task.key.packageName, UserHandle.USER_CURRENT)
|
||||
val appKilled = Toast.makeText(
|
||||
mActivity,
|
||||
R.string.task_menu_force_stop,
|
||||
Toast.LENGTH_SHORT,
|
||||
)
|
||||
appKilled.show()
|
||||
val rv: RecentsView<LawnchairLauncher, *> = mActivity.getOverviewPanel()
|
||||
rv.dismissTask(mTaskView, true, true)
|
||||
} catch (e: RemoteException) {
|
||||
Log.e("KillSystemShortcut", "onClick: ", e.cause)
|
||||
}
|
||||
}
|
||||
dismissTaskMenuView(mActivity)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmField
|
||||
var killApp: TaskShortcutFactory = object : TaskShortcutFactory {
|
||||
override fun getShortcuts(
|
||||
activity: BaseDraggingActivity,
|
||||
taskContainer: TaskIdAttributeContainer,
|
||||
): List<SystemShortcut<*>> {
|
||||
return listOf(
|
||||
KillSystemShortcut(activity, taskContainer),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
object TaskShortcutFactory
|
||||
Loaded 100 of 2920 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user