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 android.util.imagepool; 18 19 /** 20 * Keeps track of statistics. Some are purely for debugging purposes in which case it's wrapped 21 * around DEBUG check. 22 */ 23 interface ImagePoolStats { 24 25 void recordBucketCreation(int widthBucket, int heightBucket); 26 27 boolean fitsMaxCacheSize(int width, int height, long maxCacheSize); 28 29 void clear(); 30 31 void recordBucketRequest(int w, int h); 32 33 void recordAllocOutsidePool(int width, int height); 34 35 void tooBigForCache(); 36 37 void acquiredImage(Integer imageHash); 38 39 void disposeImage(Integer imageHash); 40 41 void start(); 42 43 String getStatistic(); 44 } 45