Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2272f0a1 authored by Android Build Prod User's avatar Android Build Prod User Committed by Android (Google) Code Review
Browse files

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

parents 5dc64f79 71dec41c
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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();
    }

    /**