Merge "transcoding: Allow acquire service on low ram device."
This commit is contained in:
committed by
Android (Google) Code Review
commit
2272f0a1b7
@@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user