Merge "transcoding: Allow acquire service on low ram device."

This commit is contained in:
Android Build Prod User
2021-08-26 18:36:07 +00:00
committed by Android (Google) Code Review

View File

@@ -22,7 +22,6 @@ import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.app.ActivityManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
@@ -121,7 +120,6 @@ public final class MediaTranscodingManager {
private final String mPackageName;
private final int mPid;
private final int mUid;
private final boolean mIsLowRamDevice;
private final ExecutorService mExecutor = Executors.newSingleThreadExecutor();
private final HashMap<Integer, TranscodingSession> mPendingTranscodingSessions = new HashMap();
private final Object mLock = new Object();
@@ -208,10 +206,7 @@ public final class MediaTranscodingManager {
if (!SdkLevel.isAtLeastS()) {
return null;
}
// Do not try to get the service on AndroidGo (low-ram) devices.
if (mIsLowRamDevice) {
return null;
}
int retryCount = !retry ? 1 : CONNECT_SERVICE_RETRY_COUNT;
Log.i(TAG, "get service with retry " + retryCount);
for (int count = 1; count <= retryCount; count++) {
@@ -429,7 +424,6 @@ public final class MediaTranscodingManager {
mPackageName = mContext.getPackageName();
mUid = Os.getuid();
mPid = Os.getpid();
mIsLowRamDevice = mContext.getSystemService(ActivityManager.class).isLowRamDevice();
}
/**