1 /*
2  * Copyright (C) 2020 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.systemui.log.dagger;
18 
19 import android.os.Build;
20 
21 import com.android.systemui.common.data.repository.PackageChangeRepository;
22 import com.android.systemui.dagger.SysUISingleton;
23 import com.android.systemui.deviceentry.data.repository.DeviceEntryFaceAuthRepositoryImpl;
24 import com.android.systemui.log.LogBuffer;
25 import com.android.systemui.log.LogBufferFactory;
26 import com.android.systemui.log.LogcatEchoTracker;
27 import com.android.systemui.log.echo.LogcatEchoTrackerDebug;
28 import com.android.systemui.log.echo.LogcatEchoTrackerProd;
29 import com.android.systemui.log.table.TableLogBuffer;
30 import com.android.systemui.log.table.TableLogBufferFactory;
31 import com.android.systemui.plugins.clocks.ClockMessageBuffers;
32 import com.android.systemui.qs.QSFragmentLegacy;
33 import com.android.systemui.qs.pipeline.shared.QSPipelineFlagsRepository;
34 import com.android.systemui.qs.pipeline.shared.TileSpec;
35 import com.android.systemui.statusbar.notification.NotifPipelineFlags;
36 import com.android.systemui.util.Compile;
37 import com.android.systemui.util.wakelock.WakeLockLog;
38 
39 import dagger.Lazy;
40 import dagger.Module;
41 import dagger.Provides;
42 
43 import java.util.HashMap;
44 import java.util.Map;
45 
46 /**
47  * Dagger module for providing instances of {@link LogBuffer}.
48  */
49 @Module
50 public class LogModule {
51     /** Provides a logging buffer for doze-related logs. */
52     @Provides
53     @SysUISingleton
54     @DozeLog
provideDozeLogBuffer(LogBufferFactory factory)55     public static LogBuffer provideDozeLogBuffer(LogBufferFactory factory) {
56         return factory.create("DozeLog", 150);
57     }
58 
59     /** Provides a logging buffer for all logs related to the data layer of notifications. */
60     @Provides
61     @SysUISingleton
62     @NotificationLog
provideNotificationsLogBuffer( LogBufferFactory factory, NotifPipelineFlags notifPipelineFlags)63     public static LogBuffer provideNotificationsLogBuffer(
64             LogBufferFactory factory,
65             NotifPipelineFlags notifPipelineFlags) {
66         int maxSize = 1000;
67         if (Compile.IS_DEBUG && notifPipelineFlags.isDevLoggingEnabled()) {
68             maxSize *= 10;
69         }
70         return factory.create("NotifLog", maxSize, Compile.IS_DEBUG /* systrace */);
71     }
72 
73     /** Provides a logging buffer for all logs related to notifications on the lockscreen. */
74     @Provides
75     @SysUISingleton
76     @NotificationLockscreenLog
provideNotificationLockScreenLogBuffer( LogBufferFactory factory)77     public static LogBuffer provideNotificationLockScreenLogBuffer(
78             LogBufferFactory factory) {
79         return factory.create("NotifLockscreenLog", 50, false /* systrace */);
80     }
81 
82     /** Provides a logging buffer for logs related to heads up presentation of notifications. */
83     @Provides
84     @SysUISingleton
85     @NotificationHeadsUpLog
provideNotificationHeadsUpLogBuffer(LogBufferFactory factory)86     public static LogBuffer provideNotificationHeadsUpLogBuffer(LogBufferFactory factory) {
87         return factory.create("NotifHeadsUpLog", 1000);
88     }
89 
90     /** Provides a logging buffer for logs related to inflation of notifications. */
91     @Provides
92     @SysUISingleton
93     @NotifInflationLog
provideNotifInflationLogBuffer(LogBufferFactory factory)94     public static LogBuffer provideNotifInflationLogBuffer(LogBufferFactory factory) {
95         return factory.create("NotifInflationLog", 250);
96     }
97 
98     /** Provides a logging buffer for notification interruption calculations. */
99     @Provides
100     @SysUISingleton
101     @NotificationInterruptLog
provideNotificationInterruptLogBuffer(LogBufferFactory factory)102     public static LogBuffer provideNotificationInterruptLogBuffer(LogBufferFactory factory) {
103         return factory.create("NotifInterruptLog", 100);
104     }
105 
106     /** Provides a logging buffer for notification rendering events. */
107     @Provides
108     @SysUISingleton
109     @NotificationRenderLog
provideNotificationRenderLogBuffer(LogBufferFactory factory)110     public static LogBuffer provideNotificationRenderLogBuffer(LogBufferFactory factory) {
111         return factory.create("NotifRenderLog", 100);
112     }
113 
114     /** Provides a logging buffer for all logs for lockscreen to shade transition events. */
115     @Provides
116     @SysUISingleton
117     @LSShadeTransitionLog
provideLSShadeTransitionControllerBuffer(LogBufferFactory factory)118     public static LogBuffer provideLSShadeTransitionControllerBuffer(LogBufferFactory factory) {
119         return factory.create("LSShadeTransitionLog", 50);
120     }
121 
122     /** */
123     @Provides
124     @SysUISingleton
125     @SensitiveNotificationProtectionLog
provideSensitiveNotificationProtectionLogBuffer( LogBufferFactory factory )126     public static LogBuffer provideSensitiveNotificationProtectionLogBuffer(
127             LogBufferFactory factory
128     ) {
129         return factory.create("SensitiveNotificationProtectionLog", 10);
130     }
131 
132     /** Provides a logging buffer for shade window messages. */
133     @Provides
134     @SysUISingleton
135     @ShadeWindowLog
provideShadeWindowLogBuffer(LogBufferFactory factory)136     public static LogBuffer provideShadeWindowLogBuffer(LogBufferFactory factory) {
137         return factory.create("ShadeWindowLog", 600, false);
138     }
139 
140     /** Provides a logging buffer for Shade messages. */
141     @Provides
142     @SysUISingleton
143     @ShadeLog
provideShadeLogBuffer(LogBufferFactory factory)144     public static LogBuffer provideShadeLogBuffer(LogBufferFactory factory) {
145         return factory.create("ShadeLog", 500, false);
146     }
147 
148     /** Provides a logging buffer for Shade messages. */
149     @Provides
150     @SysUISingleton
151     @ShadeTouchLog
provideShadeTouchLogBuffer(LogBufferFactory factory)152     public static LogBuffer provideShadeTouchLogBuffer(LogBufferFactory factory) {
153         return factory.create("ShadeTouchLog", 500, false);
154     }
155 
156     /** Provides a logging buffer for all logs related to managing notification sections. */
157     @Provides
158     @SysUISingleton
159     @NotificationSectionLog
provideNotificationSectionLogBuffer(LogBufferFactory factory)160     public static LogBuffer provideNotificationSectionLogBuffer(LogBufferFactory factory) {
161         return factory.create("NotifSectionLog", 1000 /* maxSize */, false /* systrace */);
162     }
163 
164     /** Provides a logging buffer for all logs related to remote input controller. */
165     @Provides
166     @SysUISingleton
167     @NotificationRemoteInputLog
provideNotificationRemoteInputLogBuffer(LogBufferFactory factory)168     public static LogBuffer provideNotificationRemoteInputLogBuffer(LogBufferFactory factory) {
169         return factory.create("NotifRemoteInputLog", 50 /* maxSize */, false /* systrace */);
170     }
171 
172     /** Provides a logging buffer for all logs related to keyguard media controller. */
173     @Provides
174     @SysUISingleton
175     @KeyguardMediaControllerLog
provideKeyguardMediaControllerLogBuffer(LogBufferFactory factory)176     public static LogBuffer provideKeyguardMediaControllerLogBuffer(LogBufferFactory factory) {
177         return factory.create("KeyguardMediaControllerLog", 50 /* maxSize */, false /* systrace */);
178     }
179 
180     /** Provides a logging buffer for all logs related to unseen notifications. */
181     @Provides
182     @SysUISingleton
183     @UnseenNotificationLog
provideUnseenNotificationLogBuffer(LogBufferFactory factory)184     public static LogBuffer provideUnseenNotificationLogBuffer(LogBufferFactory factory) {
185         return factory.create("UnseenNotifLog", 20 /* maxSize */, false /* systrace */);
186     }
187 
188     /** Provides a logging buffer for all logs related to the data layer of notifications. */
189     @Provides
190     @SysUISingleton
191     @NotifInteractionLog
provideNotifInteractionLogBuffer(LogBufferFactory factory)192     public static LogBuffer provideNotifInteractionLogBuffer(LogBufferFactory factory) {
193         return factory.create("NotifInteractionLog", 50);
194     }
195 
196     /** Provides a logging buffer for all logs related to Quick Settings. */
197     @Provides
198     @SysUISingleton
199     @QSLog
provideQuickSettingsLogBuffer( LogBufferFactory factory, QSPipelineFlagsRepository flags )200     public static LogBuffer provideQuickSettingsLogBuffer(
201             LogBufferFactory factory,
202             QSPipelineFlagsRepository flags
203     ) {
204         if (flags.getTilesEnabled()) {
205             // we use
206             return factory.create("QSLog", 450 /* maxSize */, false /* systrace */);
207         } else {
208             return factory.create("QSLog", 700 /* maxSize */, false /* systrace */);
209         }
210     }
211 
212     @Provides
213     @QSTilesLogBuffers
provideQuickSettingsTilesLogBufferCache()214     public static Map<TileSpec, LogBuffer> provideQuickSettingsTilesLogBufferCache() {
215         final Map<TileSpec, LogBuffer> buffers = new HashMap<>();
216         // Add chatty buffers here
217         return buffers;
218     }
219 
220     /** Provides a logging buffer for logs related to Quick Settings configuration. */
221     @Provides
222     @SysUISingleton
223     @QSConfigLog
provideQSConfigLogBuffer(LogBufferFactory factory)224     public static LogBuffer provideQSConfigLogBuffer(LogBufferFactory factory) {
225         return factory.create("QSConfigLog", 100 /* maxSize */, true /* systrace */);
226     }
227 
228     /** Provides a logging buffer for {@link com.android.systemui.broadcast.BroadcastDispatcher} */
229     @Provides
230     @SysUISingleton
231     @BroadcastDispatcherLog
provideBroadcastDispatcherLogBuffer(LogBufferFactory factory)232     public static LogBuffer provideBroadcastDispatcherLogBuffer(LogBufferFactory factory) {
233         return factory.create("BroadcastDispatcherLog", 500 /* maxSize */,
234                 false /* systrace */);
235     }
236 
237     /** Provides a logging buffer for {@link com.android.systemui.broadcast.BroadcastSender} */
238     @Provides
239     @SysUISingleton
240     @WakeLockLog
provideWakeLockLog(LogBufferFactory factory)241     public static LogBuffer provideWakeLockLog(LogBufferFactory factory) {
242         return factory.create("WakeLockLog", 500 /* maxSize */, false /* systrace */);
243     }
244 
245     /** Provides a logging buffer for all logs related to Toasts shown by SystemUI. */
246     @Provides
247     @SysUISingleton
248     @ToastLog
provideToastLogBuffer(LogBufferFactory factory)249     public static LogBuffer provideToastLogBuffer(LogBufferFactory factory) {
250         return factory.create("ToastLog", 50);
251     }
252 
253     /** Provides a logging buffer for all logs related to privacy indicators in SystemUI. */
254     @Provides
255     @SysUISingleton
256     @PrivacyLog
providePrivacyLogBuffer(LogBufferFactory factory)257     public static LogBuffer providePrivacyLogBuffer(LogBufferFactory factory) {
258         return factory.create("PrivacyLog", 100);
259     }
260 
261     /**
262      * Provides a logging buffer for
263      * {@link com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment}.
264      */
265     @Provides
266     @SysUISingleton
267     @CollapsedSbFragmentLog
provideCollapsedSbFragmentLogBuffer(LogBufferFactory factory)268     public static LogBuffer provideCollapsedSbFragmentLogBuffer(LogBufferFactory factory) {
269         return factory.create("CollapsedSbFragmentLog", 40);
270     }
271 
272     /**
273      * Provides a logging buffer for logs related to {@link QSFragmentLegacy}'s
274      * disable flag adjustments.
275      */
276     @Provides
277     @SysUISingleton
278     @QSDisableLog
provideQSFragmentDisableLogBuffer(LogBufferFactory factory)279     public static LogBuffer provideQSFragmentDisableLogBuffer(LogBufferFactory factory) {
280         return factory.create("QSFragmentDisableFlagsLog", 10 /* maxSize */,
281                 false /* systrace */);
282     }
283 
284     /** Provides a logging buffer for the disable flags repository. */
285     @Provides
286     @SysUISingleton
287     @DisableFlagsRepositoryLog
provideDisableFlagsRepositoryLogBuffer(LogBufferFactory factory)288     public static LogBuffer provideDisableFlagsRepositoryLogBuffer(LogBufferFactory factory) {
289         return factory.create("DisableFlagsRepository", 40 /* maxSize */,
290                 false /* systrace */);
291     }
292 
293     /** Provides a logging buffer for logs related to swipe up gestures. */
294     @Provides
295     @SysUISingleton
296     @SwipeUpLog
provideSwipeUpLogBuffer(LogBufferFactory factory)297     public static LogBuffer provideSwipeUpLogBuffer(LogBufferFactory factory) {
298         return factory.create("SwipeUpLog", 30);
299     }
300 
301     /**
302      * Provides a logging buffer for logs related to the media mute-await connections. See
303      * {@link com.android.systemui.media.muteawait.MediaMuteAwaitConnectionManager}.
304      */
305     @Provides
306     @SysUISingleton
307     @MediaMuteAwaitLog
provideMediaMuteAwaitLogBuffer(LogBufferFactory factory)308     public static LogBuffer provideMediaMuteAwaitLogBuffer(LogBufferFactory factory) {
309         return factory.create("MediaMuteAwaitLog", 20);
310     }
311 
312     /**
313      * Provides a logging buffer for logs related to the media mute-await connections. See
314      * {@link com.android.systemui.media.nearby.NearbyMediaDevicesManager}.
315      */
316     @Provides
317     @SysUISingleton
318     @NearbyMediaDevicesLog
provideNearbyMediaDevicesLogBuffer(LogBufferFactory factory)319     public static LogBuffer provideNearbyMediaDevicesLogBuffer(LogBufferFactory factory) {
320         return factory.create("NearbyMediaDevicesLog", 20);
321     }
322 
323     /**
324      * Provides a buffer for logs related to media view events
325      */
326     @Provides
327     @SysUISingleton
328     @MediaViewLog
provideMediaViewLogBuffer(LogBufferFactory factory)329     public static LogBuffer provideMediaViewLogBuffer(LogBufferFactory factory) {
330         return factory.create("MediaView", 100);
331     }
332 
333     /**
334      * Provides a buffer for media playback state changes
335      */
336     @Provides
337     @SysUISingleton
338     @MediaTimeoutListenerLog
providesMediaTimeoutListenerLogBuffer(LogBufferFactory factory)339     public static LogBuffer providesMediaTimeoutListenerLogBuffer(LogBufferFactory factory) {
340         return factory.create("MediaTimeout", 100);
341     }
342 
343     /**
344      * Provides a buffer for our connections and disconnections to MediaBrowserService.
345      *
346      * See {@link com.android.systemui.media.controls.domain.resume.ResumeMediaBrowser}.
347      */
348     @Provides
349     @SysUISingleton
350     @MediaBrowserLog
provideMediaBrowserBuffer(LogBufferFactory factory)351     public static LogBuffer provideMediaBrowserBuffer(LogBufferFactory factory) {
352         return factory.create("MediaBrowser", 100);
353     }
354 
355     /**
356      * Provides a buffer for updates to the media carousel.
357      *
358      * See {@link com.android.systemui.media.controls.ui.controller.MediaCarouselController}.
359      */
360     @Provides
361     @SysUISingleton
362     @MediaCarouselControllerLog
provideMediaCarouselControllerBuffer(LogBufferFactory factory)363     public static LogBuffer provideMediaCarouselControllerBuffer(LogBufferFactory factory) {
364         return factory.create("MediaCarouselCtlrLog", 20);
365     }
366 
367     /**
368      * Provides a buffer for media loading changes
369      */
370     @Provides
371     @SysUISingleton
372     @MediaLoadingLog
providesMediaLoadingLogBuffer(LogBufferFactory factory)373     public static LogBuffer providesMediaLoadingLogBuffer(LogBufferFactory factory) {
374         return factory.create("MediaLoadingLog", 20);
375     }
376 
377     /** Allows logging buffers to be tweaked via adb on debug builds but not on prod builds. */
378     @Provides
379     @SysUISingleton
provideLogcatEchoTracker( Lazy<LogcatEchoTrackerDebug> lazyTrackerDebug)380     public static LogcatEchoTracker provideLogcatEchoTracker(
381             Lazy<LogcatEchoTrackerDebug> lazyTrackerDebug) {
382         if (Build.isDebuggable()) {
383             LogcatEchoTrackerDebug trackerDebug = lazyTrackerDebug.get();
384             trackerDebug.start();
385             return trackerDebug;
386         } else {
387             return new LogcatEchoTrackerProd();
388         }
389     }
390 
391     /**
392      * Provides a {@link LogBuffer} for use by
393      * {@link com.android.systemui.biometrics.FaceHelpMessageDeferral}.
394      */
395     @Provides
396     @SysUISingleton
397     @BiometricLog
provideBiometricLogBuffer(LogBufferFactory factory)398     public static LogBuffer provideBiometricLogBuffer(LogBufferFactory factory) {
399         return factory.create("BiometricLog", 200);
400     }
401 
402     /**
403      * Provides a {@link LogBuffer} for use by the status bar network controller.
404      */
405     @Provides
406     @SysUISingleton
407     @StatusBarNetworkControllerLog
provideStatusBarNetworkControllerBuffer(LogBufferFactory factory)408     public static LogBuffer provideStatusBarNetworkControllerBuffer(LogBufferFactory factory) {
409         return factory.create("StatusBarNetworkControllerLog", 20);
410     }
411 
412     /**
413      * Provides a {@link LogBuffer} for general keyguard clock logs.
414      */
415     @Provides
416     @SysUISingleton
417     @KeyguardClockLog
provideKeyguardClockLog(LogBufferFactory factory)418     public static LogBuffer provideKeyguardClockLog(LogBufferFactory factory) {
419         return factory.create("KeyguardClockLog", 100);
420     }
421 
422     /**
423      * Provides a {@link LogBuffer} for keyguard small clock logs.
424      */
425     @Provides
426     @SysUISingleton
427     @KeyguardSmallClockLog
provideKeyguardSmallClockLog(LogBufferFactory factory)428     public static LogBuffer provideKeyguardSmallClockLog(LogBufferFactory factory) {
429         return factory.create("KeyguardSmallClockLog", 100);
430     }
431 
432     /**
433      * Provides a {@link LogBuffer} for keyguard large clock logs.
434      */
435     @Provides
436     @SysUISingleton
437     @KeyguardLargeClockLog
provideKeyguardLargeClockLog(LogBufferFactory factory)438     public static LogBuffer provideKeyguardLargeClockLog(LogBufferFactory factory) {
439         return factory.create("KeyguardLargeClockLog", 100);
440     }
441 
442     /**
443      * Provides a {@link ClockMessageBuffers} which contains the keyguard clock message buffers.
444      */
445     @Provides
provideKeyguardClockMessageBuffers( @eyguardClockLog LogBuffer infraClockLog, @KeyguardSmallClockLog LogBuffer smallClockLog, @KeyguardLargeClockLog LogBuffer largeClockLog )446     public static ClockMessageBuffers provideKeyguardClockMessageBuffers(
447             @KeyguardClockLog LogBuffer infraClockLog,
448             @KeyguardSmallClockLog LogBuffer smallClockLog,
449             @KeyguardLargeClockLog LogBuffer largeClockLog
450     ) {
451         return new ClockMessageBuffers(infraClockLog, smallClockLog, largeClockLog);
452     }
453 
454     /**
455      * Provides a {@link LogBuffer} for use by {@link com.android.keyguard.KeyguardUpdateMonitor}.
456      */
457     @Provides
458     @SysUISingleton
459     @KeyguardUpdateMonitorLog
provideKeyguardUpdateMonitorLogBuffer(LogBufferFactory factory)460     public static LogBuffer provideKeyguardUpdateMonitorLogBuffer(LogBufferFactory factory) {
461         return factory.create("KeyguardUpdateMonitorLog", 400);
462     }
463 
464     /**
465      * Provides a {@link LogBuffer} for use by {@link com.android.keyguard.KeyguardUpdateMonitor}.
466      */
467     @Provides
468     @SysUISingleton
469     @CarrierTextManagerLog
provideCarrierTextManagerLog(LogBufferFactory factory)470     public static LogBuffer provideCarrierTextManagerLog(LogBufferFactory factory) {
471         return factory.create("CarrierTextManagerLog", 400);
472     }
473 
474     /**
475      * Provides a {@link LogBuffer} for use by {@link com.android.systemui.ScreenDecorations}.
476      */
477     @Provides
478     @SysUISingleton
479     @ScreenDecorationsLog
provideScreenDecorationsLog(LogBufferFactory factory)480     public static LogBuffer provideScreenDecorationsLog(LogBufferFactory factory) {
481         return factory.create("ScreenDecorationsLog", 200);
482     }
483 
484     /**
485      * Provides a {@link LogBuffer} for use by
486      * {@link DeviceEntryFaceAuthRepositoryImpl}.
487      */
488     @Provides
489     @SysUISingleton
490     @FaceAuthLog
provideFaceAuthLog(LogBufferFactory factory)491     public static LogBuffer provideFaceAuthLog(LogBufferFactory factory) {
492         return factory.create("DeviceEntryFaceAuthRepositoryLog", 300);
493     }
494 
495     /**
496      * Provides a {@link LogBuffer} for use by classes in the
497      * {@link com.android.systemui.keyguard.bouncer} package.
498      */
499     @Provides
500     @SysUISingleton
501     @BouncerLog
provideBouncerLog(LogBufferFactory factory)502     public static LogBuffer provideBouncerLog(LogBufferFactory factory) {
503         return factory.create("BouncerLog", 100);
504     }
505 
506     /**
507      * Provides a {@link LogBuffer} for Device State Auto-Rotation logs.
508      */
509     @Provides
510     @SysUISingleton
511     @DeviceStateAutoRotationLog
provideDeviceStateAutoRotationLogBuffer(LogBufferFactory factory)512     public static LogBuffer provideDeviceStateAutoRotationLogBuffer(LogBufferFactory factory) {
513         return factory.create("DeviceStateAutoRotationLog", 100);
514     }
515 
516     /**
517      * Provides a {@link LogBuffer} for bluetooth-related logs.
518      */
519     @Provides
520     @SysUISingleton
521     @BluetoothLog
providerBluetoothLogBuffer(LogBufferFactory factory)522     public static LogBuffer providerBluetoothLogBuffer(LogBufferFactory factory) {
523         return factory.create("BluetoothLog", 50);
524     }
525 
526     /** Provides a logging buffer for the primary bouncer. */
527     @Provides
528     @SysUISingleton
529     @BouncerTableLog
provideBouncerLogBuffer(TableLogBufferFactory factory)530     public static TableLogBuffer provideBouncerLogBuffer(TableLogBufferFactory factory) {
531         return factory.create("BouncerTableLog", 250);
532     }
533 
534     /** Provides a table logging buffer for the Monitor. */
535     @Provides
536     @SysUISingleton
537     @MonitorLog
provideMonitorTableLogBuffer(TableLogBufferFactory factory)538     public static TableLogBuffer provideMonitorTableLogBuffer(TableLogBufferFactory factory) {
539         return factory.create("MonitorLog", 250);
540     }
541 
542     /**
543      * Provides a {@link LogBuffer} for Udfps logs.
544      */
545     @Provides
546     @SysUISingleton
547     @UdfpsLog
provideUdfpsLogBuffer(LogBufferFactory factory)548     public static LogBuffer provideUdfpsLogBuffer(LogBufferFactory factory) {
549         return factory.create("UdfpsLog", 1000);
550     }
551 
552     /**
553      * Provides a {@link LogBuffer} for general keyguard-related logs.
554      */
555     @Provides
556     @SysUISingleton
557     @KeyguardLog
provideKeyguardLogBuffer(LogBufferFactory factory)558     public static LogBuffer provideKeyguardLogBuffer(LogBufferFactory factory) {
559         return factory.create("KeyguardLog", 500);
560     }
561 
562     /**
563      * Provides a {@link LogBuffer} for keyguard transition animation logs.
564      */
565     @Provides
566     @SysUISingleton
567     @KeyguardTransitionAnimationLog
provideKeyguardTransitionAnimationLogBuffer(LogBufferFactory factory)568     public static LogBuffer provideKeyguardTransitionAnimationLogBuffer(LogBufferFactory factory) {
569         return factory.create("KeyguardTransitionAnimationLog", 250);
570     }
571 
572     /**
573      * Provides a {@link LogBuffer} for Scrims like LightRevealScrim.
574      */
575     @Provides
576     @SysUISingleton
577     @ScrimLog
provideScrimLogBuffer(LogBufferFactory factory)578     public static LogBuffer provideScrimLogBuffer(LogBufferFactory factory) {
579         return factory.create("ScrimLog", 100);
580     }
581 
582     /**
583      * Provides a {@link LogBuffer} for dream-related logs.
584      */
585     @Provides
586     @SysUISingleton
587     @DreamLog
provideDreamLogBuffer(LogBufferFactory factory)588     public static LogBuffer provideDreamLogBuffer(LogBufferFactory factory) {
589         return factory.create("DreamLog", 250);
590     }
591 
592     /**
593      * Provides a {@link LogBuffer} for communal-related logs.
594      */
595     @Provides
596     @SysUISingleton
597     @CommunalLog
provideCommunalLogBuffer(LogBufferFactory factory)598     public static LogBuffer provideCommunalLogBuffer(LogBufferFactory factory) {
599         return factory.create("CommunalLog", 250);
600     }
601 
602     /**
603      * Provides a {@link TableLogBuffer} for communal-related logs.
604      */
605     @Provides
606     @SysUISingleton
607     @CommunalTableLog
provideCommunalTableLogBuffer(TableLogBufferFactory factory)608     public static TableLogBuffer provideCommunalTableLogBuffer(TableLogBufferFactory factory) {
609         return factory.create("CommunalTableLog", 250);
610     }
611 
612     /** Provides a {@link LogBuffer} for display metrics related logs. */
613     @Provides
614     @SysUISingleton
615     @DisplayMetricsRepoLog
provideDisplayMetricsRepoLogBuffer(LogBufferFactory factory)616     public static LogBuffer provideDisplayMetricsRepoLogBuffer(LogBufferFactory factory) {
617         return factory.create("DisplayMetricsRepo", 50);
618     }
619 
620     /** Provides a {@link LogBuffer} for the scene framework. */
621     @Provides
622     @SysUISingleton
623     @SceneFrameworkLog
provideSceneFrameworkLogBuffer(LogBufferFactory factory)624     public static LogBuffer provideSceneFrameworkLogBuffer(LogBufferFactory factory) {
625         return factory.create("SceneFramework", 50);
626     }
627 
628     /** Provides a {@link LogBuffer} for the bluetooth QS tile dialog. */
629     @Provides
630     @SysUISingleton
631     @BluetoothTileDialogLog
provideQBluetoothTileDialogLogBuffer(LogBufferFactory factory)632     public static LogBuffer provideQBluetoothTileDialogLogBuffer(LogBufferFactory factory) {
633         return factory.create("BluetoothTileDialogLog", 50);
634     }
635 
636     /** Provides a {@link LogBuffer} for the keyboard functionalities. */
637     @Provides
638     @SysUISingleton
639     @KeyboardLog
provideKeyboardLogBuffer(LogBufferFactory factory)640     public static LogBuffer provideKeyboardLogBuffer(LogBufferFactory factory) {
641         return factory.create("KeyboardLog", 50);
642     }
643 
644     /** Provides a {@link LogBuffer} for {@link PackageChangeRepository} */
645     @Provides
646     @SysUISingleton
647     @PackageChangeRepoLog
providePackageChangeRepoLogBuffer(LogBufferFactory factory)648     public static LogBuffer providePackageChangeRepoLogBuffer(LogBufferFactory factory) {
649         return factory.create("PackageChangeRepo", 50);
650     }
651 
652     /** Provides a {@link LogBuffer} for NavBarButtonClicks. */
653     @Provides
654     @SysUISingleton
655     @NavBarButtonClickLog
provideNavBarButtonClickLogBuffer(LogBufferFactory factory)656     public static LogBuffer provideNavBarButtonClickLogBuffer(LogBufferFactory factory) {
657         return factory.create("NavBarButtonClick", 50);
658     }
659 
660     /** Provides a {@link LogBuffer} for NavBar Orientation Tracking. */
661     @Provides
662     @SysUISingleton
663     @NavbarOrientationTrackingLog
provideNavbarOrientationTrackingLogBuffer(LogBufferFactory factory)664     public static LogBuffer provideNavbarOrientationTrackingLogBuffer(LogBufferFactory factory) {
665         return factory.create("NavbarOrientationTrackingLog", 50);
666     }
667 
668     /** Provides a {@link LogBuffer} for use by the DeviceEntryIcon and related classes. */
669     @Provides
670     @SysUISingleton
671     @DeviceEntryIconLog
provideDeviceEntryIconLogBuffer(LogBufferFactory factory)672     public static LogBuffer provideDeviceEntryIconLogBuffer(LogBufferFactory factory) {
673         return factory.create("DeviceEntryIconLog", 100);
674     }
675 
676 }
677