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