Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
| 17 | package com.android.server.wm; |
| 18 | |
| 19 | import static android.app.ActivityManager.START_SUCCESS; |
| 20 | import static android.app.ActivityManager.START_TASK_TO_FRONT; |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 21 | |
Tadashi G. Takaoka | a7a6695 | 2018-11-16 15:04:21 +0900 | [diff] [blame] | 22 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock; |
| 23 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify; |
| 24 | import static com.android.dx.mockito.inline.extended.ExtendedMockito.verifyNoMoreInteractions; |
Yunfan Chen | d552c16 | 2019-02-08 16:51:28 +0900 | [diff] [blame] | 25 | |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 26 | import static com.google.common.truth.Truth.assertWithMessage; |
Tadashi G. Takaoka | a7a6695 | 2018-11-16 15:04:21 +0900 | [diff] [blame] | 27 | |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 28 | import static org.mockito.ArgumentMatchers.anyInt; |
Yan Wang | 9eac5ec | 2019-09-30 15:42:18 -0700 | [diff] [blame] | 29 | import static org.mockito.ArgumentMatchers.anyLong; |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 30 | import static org.mockito.ArgumentMatchers.argThat; |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 31 | import static org.mockito.ArgumentMatchers.eq; |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 32 | import static org.mockito.Mockito.timeout; |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 33 | |
| 34 | import android.content.Intent; |
| 35 | import android.os.SystemClock; |
| 36 | import android.platform.test.annotations.Presubmit; |
| 37 | import android.util.SparseIntArray; |
| 38 | |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 39 | import androidx.test.filters.SmallTest; |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 40 | |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 41 | import com.android.server.wm.ActivityMetricsLaunchObserver.ActivityRecordProto; |
| 42 | |
| 43 | import org.junit.After; |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 44 | import org.junit.Before; |
| 45 | import org.junit.Test; |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 46 | import org.mockito.ArgumentMatcher; |
| 47 | |
| 48 | import java.util.Arrays; |
Riddle Hsu | 7a2fec5 | 2019-09-04 00:12:08 +0800 | [diff] [blame] | 49 | import java.util.concurrent.TimeUnit; |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * Tests for the {@link ActivityMetricsLaunchObserver} class. |
| 53 | * |
| 54 | * Build/Install/Run: |
| 55 | * atest WmTests:ActivityMetricsLaunchObserverTests |
| 56 | */ |
| 57 | @SmallTest |
| 58 | @Presubmit |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 59 | public class ActivityMetricsLaunchObserverTests extends ActivityTestsBase { |
| 60 | private ActivityMetricsLogger mActivityMetricsLogger; |
| 61 | private ActivityMetricsLaunchObserver mLaunchObserver; |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 62 | private ActivityMetricsLaunchObserverRegistry mLaunchObserverRegistry; |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 63 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 64 | private ActivityRecord mTrampolineActivity; |
| 65 | private ActivityRecord mTopActivity; |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 66 | |
| 67 | @Before |
Wale Ogunwale | 8a1860a | 2019-06-05 08:57:19 -0700 | [diff] [blame] | 68 | public void setUpAMLO() { |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 69 | mLaunchObserver = mock(ActivityMetricsLaunchObserver.class); |
| 70 | |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 71 | // ActivityStackSupervisor always creates its own instance of ActivityMetricsLogger. |
| 72 | mActivityMetricsLogger = mSupervisor.getActivityMetricsLogger(); |
| 73 | |
| 74 | mLaunchObserverRegistry = mActivityMetricsLogger.getLaunchObserverRegistry(); |
| 75 | mLaunchObserverRegistry.registerLaunchObserver(mLaunchObserver); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 76 | |
| 77 | // Sometimes we need an ActivityRecord for ActivityMetricsLogger to do anything useful. |
| 78 | // This seems to be the easiest way to create an ActivityRecord. |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 79 | mTrampolineActivity = new ActivityBuilder(mService).setCreateTask(true).build(); |
| 80 | mTopActivity = new ActivityBuilder(mService) |
Louis Chang | cdec080 | 2019-11-11 11:45:07 +0800 | [diff] [blame] | 81 | .setTask(mTrampolineActivity.getTask()) |
Wale Ogunwale | 8a1860a | 2019-06-05 08:57:19 -0700 | [diff] [blame] | 82 | .build(); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 83 | } |
| 84 | |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 85 | @After |
Wale Ogunwale | 8a1860a | 2019-06-05 08:57:19 -0700 | [diff] [blame] | 86 | public void tearDownAMLO() { |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 87 | if (mLaunchObserverRegistry != null) { // Don't NPE if setUp failed. |
| 88 | mLaunchObserverRegistry.unregisterLaunchObserver(mLaunchObserver); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | static class ActivityRecordMatcher implements ArgumentMatcher</*@ActivityRecordProto*/ byte[]> { |
| 93 | private final @ActivityRecordProto byte[] mExpected; |
| 94 | |
| 95 | public ActivityRecordMatcher(ActivityRecord activityRecord) { |
| 96 | mExpected = activityRecordToProto(activityRecord); |
| 97 | } |
| 98 | |
| 99 | public boolean matches(@ActivityRecordProto byte[] actual) { |
| 100 | return Arrays.equals(mExpected, actual); |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | static @ActivityRecordProto byte[] activityRecordToProto(ActivityRecord record) { |
| 105 | return ActivityMetricsLogger.convertActivityRecordToProto(record); |
| 106 | } |
| 107 | |
| 108 | static @ActivityRecordProto byte[] eqProto(ActivityRecord record) { |
| 109 | return argThat(new ActivityRecordMatcher(record)); |
| 110 | } |
| 111 | |
| 112 | static <T> T verifyAsync(T mock) { |
| 113 | // AMLO callbacks happen on a separate thread than AML calls, so we need to use a timeout. |
Riddle Hsu | 7a2fec5 | 2019-09-04 00:12:08 +0800 | [diff] [blame] | 114 | return verify(mock, timeout(TimeUnit.SECONDS.toMillis(5))); |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 115 | } |
| 116 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 117 | private void onIntentStarted() { |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 118 | Intent intent = new Intent("action 1"); |
| 119 | |
| 120 | mActivityMetricsLogger.notifyActivityLaunching(intent); |
| 121 | |
Yan Wang | d47f90b | 2019-10-03 19:17:15 -0700 | [diff] [blame] | 122 | verifyAsync(mLaunchObserver).onIntentStarted(eq(intent), anyLong()); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 123 | verifyNoMoreInteractions(mLaunchObserver); |
| 124 | } |
| 125 | |
| 126 | @Test |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 127 | public void testOnIntentFailed() { |
| 128 | onIntentStarted(); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 129 | |
| 130 | // Bringing an intent that's already running 'to front' is not considered |
| 131 | // as an ACTIVITY_LAUNCHED state transition. |
| 132 | mActivityMetricsLogger.notifyActivityLaunched(START_TASK_TO_FRONT, |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 133 | null /* launchedActivity */); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 134 | |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 135 | verifyAsync(mLaunchObserver).onIntentFailed(); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 136 | verifyNoMoreInteractions(mLaunchObserver); |
| 137 | } |
| 138 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 139 | private void onActivityLaunched() { |
| 140 | onIntentStarted(); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 141 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 142 | mActivityMetricsLogger.notifyActivityLaunched(START_SUCCESS, mTopActivity); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 143 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 144 | verifyAsync(mLaunchObserver).onActivityLaunched(eqProto(mTopActivity), anyInt()); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 145 | verifyNoMoreInteractions(mLaunchObserver); |
| 146 | } |
| 147 | |
| 148 | @Test |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 149 | public void testOnActivityLaunchFinished() { |
| 150 | onActivityLaunched(); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 151 | |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 152 | notifyTransitionStarting(); |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 153 | notifyWindowsDrawn(mTopActivity); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 154 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 155 | verifyAsync(mLaunchObserver).onActivityLaunchFinished(eqProto(mTopActivity), anyLong()); |
Yan Wang | 9eac5ec | 2019-09-30 15:42:18 -0700 | [diff] [blame] | 156 | verifyNoMoreInteractions(mLaunchObserver); |
| 157 | } |
| 158 | |
| 159 | @Test |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 160 | public void testOnActivityLaunchCancelled_hasDrawn() { |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 161 | onActivityLaunched(); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 162 | |
Issei Suzuki | 1669ea4 | 2019-11-06 14:20:59 +0100 | [diff] [blame] | 163 | mTopActivity.mVisibleRequested = mTopActivity.mDrawn = true; |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 164 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 165 | // Cannot time already-visible activities. |
| 166 | mActivityMetricsLogger.notifyActivityLaunched(START_TASK_TO_FRONT, mTopActivity); |
| 167 | |
| 168 | verifyAsync(mLaunchObserver).onActivityLaunchCancelled(eqProto(mTopActivity)); |
| 169 | verifyNoMoreInteractions(mLaunchObserver); |
| 170 | } |
| 171 | |
| 172 | @Test |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 173 | public void testOnActivityLaunchCancelled_finishedBeforeDrawn() { |
Issei Suzuki | 1669ea4 | 2019-11-06 14:20:59 +0100 | [diff] [blame] | 174 | mTopActivity.mVisibleRequested = mTopActivity.mDrawn = true; |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 175 | |
| 176 | // Suppress resume when creating the record because we want to notify logger manually. |
| 177 | mSupervisor.beginDeferResume(); |
| 178 | // Create an activity with different process that meets process switch. |
| 179 | final ActivityRecord noDrawnActivity = new ActivityBuilder(mService) |
Louis Chang | cdec080 | 2019-11-11 11:45:07 +0800 | [diff] [blame] | 180 | .setTask(mTopActivity.getTask()) |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 181 | .setProcessName("other") |
| 182 | .build(); |
| 183 | mSupervisor.readyToResume(); |
| 184 | |
| 185 | mActivityMetricsLogger.notifyActivityLaunching(noDrawnActivity.intent); |
| 186 | mActivityMetricsLogger.notifyActivityLaunched(START_SUCCESS, noDrawnActivity); |
| 187 | |
| 188 | noDrawnActivity.destroyIfPossible("test"); |
| 189 | mActivityMetricsLogger.notifyVisibilityChanged(noDrawnActivity); |
| 190 | |
| 191 | verifyAsync(mLaunchObserver).onActivityLaunchCancelled(eqProto(noDrawnActivity)); |
| 192 | } |
| 193 | |
| 194 | @Test |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 195 | public void testOnReportFullyDrawn() { |
| 196 | onActivityLaunched(); |
| 197 | |
Riddle Hsu | c1f8f9c | 2019-10-25 16:54:33 +0800 | [diff] [blame] | 198 | // The activity reports fully drawn before windows drawn, then the fully drawn event will |
| 199 | // be pending (see {@link WindowingModeTransitionInfo#pendingFullyDrawn}). |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 200 | mActivityMetricsLogger.logAppTransitionReportedDrawn(mTopActivity, false); |
Riddle Hsu | c1f8f9c | 2019-10-25 16:54:33 +0800 | [diff] [blame] | 201 | notifyTransitionStarting(); |
| 202 | // The pending fully drawn event should send when the actual windows drawn event occurs. |
| 203 | notifyWindowsDrawn(mTopActivity); |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 204 | |
| 205 | verifyAsync(mLaunchObserver).onReportFullyDrawn(eqProto(mTopActivity), anyLong()); |
Riddle Hsu | c1f8f9c | 2019-10-25 16:54:33 +0800 | [diff] [blame] | 206 | verifyAsync(mLaunchObserver).onActivityLaunchFinished(eqProto(mTopActivity), anyLong()); |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 207 | verifyNoMoreInteractions(mLaunchObserver); |
| 208 | } |
| 209 | |
| 210 | private void onActivityLaunchedTrampoline() { |
| 211 | onIntentStarted(); |
| 212 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 213 | mActivityMetricsLogger.notifyActivityLaunched(START_SUCCESS, mTrampolineActivity); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 214 | |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 215 | verifyAsync(mLaunchObserver).onActivityLaunched(eqProto(mTrampolineActivity), anyInt()); |
| 216 | |
| 217 | // A second, distinct, activity launch is coalesced into the current app launch sequence. |
| 218 | mActivityMetricsLogger.notifyActivityLaunched(START_SUCCESS, mTopActivity); |
| 219 | |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 220 | verifyNoMoreInteractions(mLaunchObserver); |
| 221 | } |
| 222 | |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 223 | private void notifyTransitionStarting() { |
| 224 | mActivityMetricsLogger.notifyTransitionStarting(new SparseIntArray(), |
| 225 | SystemClock.elapsedRealtimeNanos()); |
| 226 | } |
| 227 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 228 | private void notifyWindowsDrawn(ActivityRecord r) { |
| 229 | mActivityMetricsLogger.notifyWindowsDrawn(r.getWindowingMode(), |
| 230 | SystemClock.elapsedRealtimeNanos()); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | @Test |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 234 | public void testOnActivityLaunchFinishedTrampoline() { |
| 235 | onActivityLaunchedTrampoline(); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 236 | |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 237 | notifyTransitionStarting(); |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 238 | notifyWindowsDrawn(mTrampolineActivity); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 239 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 240 | notifyWindowsDrawn(mTopActivity); |
| 241 | |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 242 | verifyAsync(mLaunchObserver).onActivityLaunchFinished(eqProto(mTopActivity), anyLong()); |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 243 | verifyNoMoreInteractions(mLaunchObserver); |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 244 | } |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 245 | |
| 246 | @Test |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 247 | public void testOnActivityLaunchCancelledTrampoline() { |
| 248 | onActivityLaunchedTrampoline(); |
| 249 | |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 250 | mTopActivity.mDrawn = true; |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 251 | |
| 252 | // Cannot time already-visible activities. |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 253 | mActivityMetricsLogger.notifyActivityLaunched(START_TASK_TO_FRONT, mTopActivity); |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 254 | |
Riddle Hsu | 1063b51 | 2019-10-22 21:12:23 +0800 | [diff] [blame] | 255 | verifyAsync(mLaunchObserver).onActivityLaunchCancelled(eqProto(mTopActivity)); |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 256 | verifyNoMoreInteractions(mLaunchObserver); |
| 257 | } |
| 258 | |
| 259 | @Test |
| 260 | public void testActivityRecordProtoIsNotTooBig() { |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 261 | // The ActivityRecordProto must not be too big, otherwise converting it at runtime |
| 262 | // will become prohibitively expensive. |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 263 | assertWithMessage("mTopActivity: %s", mTopActivity) |
| 264 | .that(activityRecordToProto(mTopActivity).length) |
| 265 | .isAtMost(ActivityMetricsLogger.LAUNCH_OBSERVER_ACTIVITY_RECORD_PROTO_CHUNK_SIZE); |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 266 | |
Riddle Hsu | 1c5d72e | 2019-10-09 20:54:26 +0800 | [diff] [blame] | 267 | assertWithMessage("mTrampolineActivity: %s", mTrampolineActivity) |
| 268 | .that(activityRecordToProto(mTrampolineActivity).length) |
| 269 | .isAtMost(ActivityMetricsLogger.LAUNCH_OBSERVER_ACTIVITY_RECORD_PROTO_CHUNK_SIZE); |
Igor Murashkin | c0b47e4 | 2018-11-07 15:54:18 -0800 | [diff] [blame] | 270 | } |
Igor Murashkin | cb76aac | 2018-11-02 14:46:28 -0700 | [diff] [blame] | 271 | } |