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 import java.util.List;
23 
24 /** Interface over MediaTranscodeManager access */
25 public interface TranscodeHelper {
freeCache(long bytes)26     public void freeCache(long bytes);
27 
onAnrDelayStarted(String packageName, int uid, int tid, int reason)28     public void onAnrDelayStarted(String packageName, int uid, int tid, int reason);
29 
transcode(String src, String dst, int uid, int reason)30     public boolean transcode(String src, String dst, int uid, int reason);
31 
prepareIoPath(String path, int uid)32     public String prepareIoPath(String path, int uid);
33 
shouldTranscode(String path, int uid, Bundle bundle)34     public int shouldTranscode(String path, int uid, Bundle bundle);
35 
supportsTranscode(String path)36     public boolean supportsTranscode(String path);
37 
onUriPublished(Uri uri)38     public void onUriPublished(Uri uri);
39 
onFileOpen(String path, String ioPath, int uid, int transformsReason)40     public void onFileOpen(String path, String ioPath, int uid, int transformsReason);
41 
isTranscodeFileCached(String path, String transcodePath)42     public boolean isTranscodeFileCached(String path, String transcodePath);
43 
deleteCachedTranscodeFile(long rowId)44     public boolean deleteCachedTranscodeFile(long rowId);
45 
dump(PrintWriter writer)46     public void dump(PrintWriter writer);
47 
getSupportedRelativePaths()48     public List<String> getSupportedRelativePaths();
49 }
50