Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/LSShadeTransitionLogger.kt +4 −4 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class LSShadeTransitionLogger @Inject constructor( private val displayMetrics: DisplayMetrics ) { fun logUnSuccessfulDragDown(startingChild: View?) { val entry = (startingChild as ExpandableNotificationRow?)?.entry val entry = (startingChild as? ExpandableNotificationRow)?.entry buffer.log(TAG, LogLevel.INFO, { str1 = entry?.key ?: "no entry" }, { Loading @@ -49,7 +49,7 @@ class LSShadeTransitionLogger @Inject constructor( } fun logDragDownStarted(startingChild: ExpandableView?) { val entry = (startingChild as ExpandableNotificationRow?)?.entry val entry = (startingChild as? ExpandableNotificationRow)?.entry buffer.log(TAG, LogLevel.INFO, { str1 = entry?.key ?: "no entry" }, { Loading @@ -58,7 +58,7 @@ class LSShadeTransitionLogger @Inject constructor( } fun logDraggedDownLockDownShade(startingChild: View?) { val entry = (startingChild as ExpandableNotificationRow?)?.entry val entry = (startingChild as? ExpandableNotificationRow)?.entry buffer.log(TAG, LogLevel.INFO, { str1 = entry?.key ?: "no entry" }, { Loading @@ -67,7 +67,7 @@ class LSShadeTransitionLogger @Inject constructor( } fun logDraggedDown(startingChild: View?, dragLengthY: Int) { val entry = (startingChild as ExpandableNotificationRow?)?.entry val entry = (startingChild as? ExpandableNotificationRow)?.entry buffer.log(TAG, LogLevel.INFO, { str1 = entry?.key ?: "no entry" }, { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/LSShadeTransitionLoggerTest.kt 0 → 100644 +44 −0 Original line number Diff line number Diff line package com.android.systemui.statusbar import android.testing.AndroidTestingRunner import android.util.DisplayMetrics import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.log.LogBuffer import com.android.systemui.statusbar.notification.row.ExpandableView import com.android.systemui.statusbar.phone.LSShadeTransitionLogger import com.android.systemui.statusbar.phone.LockscreenGestureLogger import com.android.systemui.util.mockito.mock import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mock import org.mockito.junit.MockitoJUnit @RunWith(AndroidTestingRunner::class) @SmallTest class LSShadeTransitionLoggerTest : SysuiTestCase() { lateinit var logger: LSShadeTransitionLogger @Mock lateinit var gestureLogger: LockscreenGestureLogger @Mock lateinit var displayMetrics: DisplayMetrics @JvmField @Rule val mockito = MockitoJUnit.rule() @Before fun setup() { logger = LSShadeTransitionLogger( LogBuffer("Test", 10, 10, mock()), gestureLogger, displayMetrics) } @Test fun testLogDragDownStarted() { val view: ExpandableView = mock() // log a non-null, non row, ensure no crash logger.logDragDownStarted(view) } } No newline at end of file Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/LSShadeTransitionLogger.kt +4 −4 Original line number Diff line number Diff line Loading @@ -34,7 +34,7 @@ class LSShadeTransitionLogger @Inject constructor( private val displayMetrics: DisplayMetrics ) { fun logUnSuccessfulDragDown(startingChild: View?) { val entry = (startingChild as ExpandableNotificationRow?)?.entry val entry = (startingChild as? ExpandableNotificationRow)?.entry buffer.log(TAG, LogLevel.INFO, { str1 = entry?.key ?: "no entry" }, { Loading @@ -49,7 +49,7 @@ class LSShadeTransitionLogger @Inject constructor( } fun logDragDownStarted(startingChild: ExpandableView?) { val entry = (startingChild as ExpandableNotificationRow?)?.entry val entry = (startingChild as? ExpandableNotificationRow)?.entry buffer.log(TAG, LogLevel.INFO, { str1 = entry?.key ?: "no entry" }, { Loading @@ -58,7 +58,7 @@ class LSShadeTransitionLogger @Inject constructor( } fun logDraggedDownLockDownShade(startingChild: View?) { val entry = (startingChild as ExpandableNotificationRow?)?.entry val entry = (startingChild as? ExpandableNotificationRow)?.entry buffer.log(TAG, LogLevel.INFO, { str1 = entry?.key ?: "no entry" }, { Loading @@ -67,7 +67,7 @@ class LSShadeTransitionLogger @Inject constructor( } fun logDraggedDown(startingChild: View?, dragLengthY: Int) { val entry = (startingChild as ExpandableNotificationRow?)?.entry val entry = (startingChild as? ExpandableNotificationRow)?.entry buffer.log(TAG, LogLevel.INFO, { str1 = entry?.key ?: "no entry" }, { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/LSShadeTransitionLoggerTest.kt 0 → 100644 +44 −0 Original line number Diff line number Diff line package com.android.systemui.statusbar import android.testing.AndroidTestingRunner import android.util.DisplayMetrics import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.log.LogBuffer import com.android.systemui.statusbar.notification.row.ExpandableView import com.android.systemui.statusbar.phone.LSShadeTransitionLogger import com.android.systemui.statusbar.phone.LockscreenGestureLogger import com.android.systemui.util.mockito.mock import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith import org.mockito.Mock import org.mockito.junit.MockitoJUnit @RunWith(AndroidTestingRunner::class) @SmallTest class LSShadeTransitionLoggerTest : SysuiTestCase() { lateinit var logger: LSShadeTransitionLogger @Mock lateinit var gestureLogger: LockscreenGestureLogger @Mock lateinit var displayMetrics: DisplayMetrics @JvmField @Rule val mockito = MockitoJUnit.rule() @Before fun setup() { logger = LSShadeTransitionLogger( LogBuffer("Test", 10, 10, mock()), gestureLogger, displayMetrics) } @Test fun testLogDragDownStarted() { val view: ExpandableView = mock() // log a non-null, non row, ensure no crash logger.logDragDownStarted(view) } } No newline at end of file