1/*
2 * Copyright (C) 2017 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
17package com.android.tv.perf;
18
19import android.app.Application;
20import android.content.Context;
21
22/** Do nothing implementation of {@link PerformanceMonitor}. */
23public final class StubPerformanceMonitor implements PerformanceMonitor {
24
25    private static final TimerEvent TIMER_EVENT = new TimerEvent() {};
26
27    public static PerformanceMonitor initialize(Application app) {
28        return new StubPerformanceMonitor();
29    }
30
31    @Override
32    public void startMemoryMonitor() {}
33
34    @Override
35    public void recordMemory(String customEventName) {}
36
37    @Override
38    public void startGlobalTimer(String customEventName) {}
39
40    @Override
41    public void stopGlobalTimer(String customEventName) {}
42
43    @Override
44    public TimerEvent startTimer() {
45        return TIMER_EVENT;
46    }
47
48    @Override
49    public void stopTimer(TimerEvent event, String name) {}
50
51    @Override
52    public void startJankRecorder(String eventName) {}
53
54    @Override
55    public void stopJankRecorder(String eventName) {}
56
57    @Override
58    public boolean startPerformanceMonitorEventDebugActivity(Context context) {
59        return false;
60    }
61
62    public static TimerEvent startBootstrapTimer() {
63        return new TimerEvent() {};
64    }
65}
66