1 /*
2  * Copyright (C) 2021 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.providers.media;
18 
19 import android.net.Uri;
20 import android.os.Bundle;
21 import java.io.PrintWriter;
22 
23 /**
24  * No-op transcode helper to avoid loading MediaTranscodeManager classes in Android R
25  */
26 public class TranscodeHelperNoOp implements TranscodeHelper {
freeCache(long bytes)27     public void freeCache(long bytes) {}
28 
onAnrDelayStarted(String packageName, int uid, int tid, int reason)29     public void onAnrDelayStarted(String packageName, int uid, int tid, int reason) {}
30 
transcode(String src, String dst, int uid, int reason)31     public boolean transcode(String src, String dst, int uid, int reason) {
32         return false;
33     }
34 
getIoPath(String path, int uid)35     public String getIoPath(String path, int uid) {
36         return null;
37     }
38 
shouldTranscode(String path, int uid, Bundle bundle)39     public int shouldTranscode(String path, int uid, Bundle bundle) {
40         return 0;
41     }
42 
supportsTranscode(String path)43     public boolean supportsTranscode(String path) {
44         return false;
45     }
46 
onUriPublished(Uri uri)47     public void onUriPublished(Uri uri) {}
48 
onFileOpen(String path, String ioPath, int uid, int transformsReason)49     public void onFileOpen(String path, String ioPath, int uid, int transformsReason) {}
50 
isTranscodeFileCached(String path, String transcodePath)51     public boolean isTranscodeFileCached(String path, String transcodePath) {
52         return false;
53     }
54 
deleteCachedTranscodeFile(long rowId)55     public boolean deleteCachedTranscodeFile(long rowId) {
56         return false;
57     }
58 
dump(PrintWriter writer)59     public void dump(PrintWriter writer) {}
60 }
61