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

Commit 9ba5f6b8 authored by JW Wang's avatar JW Wang
Browse files

Close the returned file descriptior (1/n)

As suggested by the comment:
https://cs.corp.google.com/android/frameworks/base/core/java/android/app/UiAutomation.java?rcl=55a225ade4016b9dde04a3d4b4d25db761b1ccbf&l=1127

Bug: 143211397
Test: atest StagedRollbackTest
Change-Id: I45a5e5fe2188f3172b42f868fe2c4853173451bd
parent d304b60c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageInstaller;
import android.content.rollback.RollbackInfo;
import android.content.rollback.RollbackManager;
import android.os.ParcelFileDescriptor;
import android.provider.DeviceConfig;
import android.text.TextUtils;

@@ -46,6 +47,8 @@ import com.android.cts.rollback.lib.Rollback;
import com.android.cts.rollback.lib.RollbackUtils;
import com.android.internal.R;

import libcore.io.IoUtils;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
@@ -332,7 +335,8 @@ public class StagedRollbackTest {
    }

    private void runShellCommand(String cmd) {
        InstrumentationRegistry.getInstrumentation().getUiAutomation()
        ParcelFileDescriptor pfd = InstrumentationRegistry.getInstrumentation().getUiAutomation()
                .executeShellCommand(cmd);
        IoUtils.closeQuietly(pfd);
    }
}