Move RingBuffer to SystemUICommon.
This change adds a new module SystemUICommon and moves RingBuffer to it. This is to prepare introducing a new logging library which would depend on it. Bug: 276475093 Test: RingBuffer does not have existing tests, so just verified LogBuffer works correctly on device Change-Id: Ib71fcf8526021be1ac3fe279210c54cb7d4cd0e6
This commit is contained in:
@@ -156,9 +156,10 @@ android_library {
|
||||
"WifiTrackerLib",
|
||||
"WindowManager-Shell",
|
||||
"SystemUIAnimationLib",
|
||||
"SystemUICommon",
|
||||
"SystemUICustomizationLib",
|
||||
"SystemUIPluginLib",
|
||||
"SystemUISharedLib",
|
||||
"SystemUICustomizationLib",
|
||||
"SystemUI-statsd",
|
||||
"SettingsLib",
|
||||
"androidx.core_core-ktx",
|
||||
|
||||
9
packages/SystemUI/common/.gitignore
vendored
Normal file
9
packages/SystemUI/common/.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
.idea/
|
||||
.gradle/
|
||||
gradle/
|
||||
build/
|
||||
gradlew*
|
||||
local.properties
|
||||
*.iml
|
||||
android.properties
|
||||
buildSrc
|
||||
39
packages/SystemUI/common/Android.bp
Normal file
39
packages/SystemUI/common/Android.bp
Normal file
@@ -0,0 +1,39 @@
|
||||
// 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
|
||||
// A large-scale-change added 'default_applicable_licenses' to import
|
||||
// all of the 'license_kinds' from "frameworks_base_packages_SystemUI_license"
|
||||
// to get the below license kinds:
|
||||
// SPDX-license-identifier-Apache-2.0
|
||||
default_applicable_licenses: ["frameworks_base_packages_SystemUI_license"],
|
||||
}
|
||||
|
||||
android_library {
|
||||
|
||||
name: "SystemUICommon",
|
||||
|
||||
srcs: [
|
||||
"src/**/*.java",
|
||||
"src/**/*.kt",
|
||||
],
|
||||
|
||||
static_libs: [
|
||||
"androidx.core_core-ktx",
|
||||
],
|
||||
|
||||
manifest: "AndroidManifest.xml",
|
||||
kotlincflags: ["-Xjvm-default=all"],
|
||||
}
|
||||
21
packages/SystemUI/common/AndroidManifest.xml
Normal file
21
packages/SystemUI/common/AndroidManifest.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.android.systemui.common">
|
||||
|
||||
</manifest>
|
||||
2
packages/SystemUI/common/OWNERS
Normal file
2
packages/SystemUI/common/OWNERS
Normal file
@@ -0,0 +1,2 @@
|
||||
darrellshi@google.com
|
||||
evanlaird@google.com
|
||||
5
packages/SystemUI/common/README.md
Normal file
5
packages/SystemUI/common/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# SystemUICommon
|
||||
|
||||
`SystemUICommon` is a module within SystemUI that hosts standalone helper libraries. It is intended to be used by other modules, and therefore should not have other SystemUI dependencies to avoid circular dependencies.
|
||||
|
||||
To maintain the structure of this module, please refrain from adding components at the top level. Instead, add them to specific sub-packages, such as `systemui/common/buffer/`. This will help to keep the module organized and easy to navigate.
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.plugins.util
|
||||
package com.android.systemui.common.buffer
|
||||
|
||||
import kotlin.math.max
|
||||
|
||||
@@ -37,6 +37,7 @@ java_library {
|
||||
"error_prone_annotations",
|
||||
"PluginCoreLib",
|
||||
"SystemUIAnimationLib",
|
||||
"SystemUICommon",
|
||||
],
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.android.systemui.plugins.log
|
||||
|
||||
import android.os.Trace
|
||||
import android.util.Log
|
||||
import com.android.systemui.plugins.util.RingBuffer
|
||||
import com.android.systemui.common.buffer.RingBuffer
|
||||
import com.google.errorprone.annotations.CompileTimeConstant
|
||||
import java.io.PrintWriter
|
||||
import java.util.concurrent.ArrayBlockingQueue
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package com.android.keyguard
|
||||
|
||||
import android.annotation.CurrentTimeMillisLong
|
||||
import com.android.systemui.common.buffer.RingBuffer
|
||||
import com.android.systemui.dump.DumpsysTableLogger
|
||||
import com.android.systemui.dump.Row
|
||||
import com.android.systemui.plugins.util.RingBuffer
|
||||
|
||||
/** Verbose debug information. */
|
||||
data class KeyguardActiveUnlockModel(
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package com.android.keyguard
|
||||
|
||||
import android.annotation.CurrentTimeMillisLong
|
||||
import com.android.systemui.common.buffer.RingBuffer
|
||||
import com.android.systemui.dump.DumpsysTableLogger
|
||||
import com.android.systemui.dump.Row
|
||||
import com.android.systemui.plugins.util.RingBuffer
|
||||
|
||||
/** Verbose debug information associated. */
|
||||
data class KeyguardFaceListenModel(
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
package com.android.keyguard
|
||||
|
||||
import android.annotation.CurrentTimeMillisLong
|
||||
import com.android.systemui.common.buffer.RingBuffer
|
||||
import com.android.systemui.dump.DumpsysTableLogger
|
||||
import com.android.systemui.dump.Row
|
||||
import com.android.systemui.plugins.util.RingBuffer
|
||||
|
||||
/** Verbose debug information. */
|
||||
data class KeyguardFingerprintListenModel(
|
||||
|
||||
@@ -18,7 +18,7 @@ package com.android.systemui.log.table
|
||||
|
||||
import android.os.Trace
|
||||
import com.android.systemui.Dumpable
|
||||
import com.android.systemui.plugins.util.RingBuffer
|
||||
import com.android.systemui.common.buffer.RingBuffer
|
||||
import com.android.systemui.util.time.SystemClock
|
||||
import java.io.PrintWriter
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
package com.android.systemui.shade
|
||||
|
||||
import android.view.MotionEvent
|
||||
import com.android.systemui.common.buffer.RingBuffer
|
||||
import com.android.systemui.dump.DumpsysTableLogger
|
||||
import com.android.systemui.dump.Row
|
||||
import com.android.systemui.plugins.util.RingBuffer
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
|
||||
package com.android.systemui.shade
|
||||
|
||||
import com.android.systemui.common.buffer.RingBuffer
|
||||
import com.android.systemui.dump.DumpsysTableLogger
|
||||
import com.android.systemui.dump.Row
|
||||
import com.android.systemui.plugins.util.RingBuffer
|
||||
import com.android.systemui.shade.NotificationShadeWindowState.Buffer
|
||||
import com.android.systemui.statusbar.StatusBarState
|
||||
|
||||
|
||||
Reference in New Issue
Block a user