Commit 0ad39c64 by olly Committed by Oliver Woodman

Relax test termination for API level 23 and above

This allows test runs to continue when the activity
is paused (but not stopped), which is in line with
what we do in the demo app's PlayerActivity.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168699521
parent f2aed718
...@@ -31,6 +31,7 @@ import android.view.SurfaceHolder; ...@@ -31,6 +31,7 @@ import android.view.SurfaceHolder;
import android.view.SurfaceView; import android.view.SurfaceView;
import android.view.Window; import android.view.Window;
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Assertions;
import com.google.android.exoplayer2.util.Util;
/** /**
* A host activity for performing playback tests. * A host activity for performing playback tests.
...@@ -179,12 +180,17 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba ...@@ -179,12 +180,17 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
if (Util.SDK_INT <= 23) {
maybeStopHostedTest(); maybeStopHostedTest();
} }
}
@Override @Override
public void onStop() { public void onStop() {
super.onStop(); super.onStop();
if (Util.SDK_INT > 23) {
maybeStopHostedTest();
}
wakeLock.release(); wakeLock.release();
wakeLock = null; wakeLock = null;
wifiLock.release(); wifiLock.release();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment