Commit 9ad60177 authored by Geoffrey Métais's avatar Geoffrey Métais

Deactivate mediarouter callbacks in benchmark

parent 0f388166
......@@ -57,8 +57,8 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) {
}}
init {
presentation = if (AndroidUtil.isJellyBeanMR1OrLater) createPresentation(cloneMode) else null
displayType = getCurrentType()
presentation = if (AndroidUtil.isJellyBeanMR1OrLater && !cloneMode) createPresentation() else null
displayType = if (cloneMode) DisplayType.PRIMARY else getCurrentType()
if (!AndroidDevices.isChromeBook) RendererDelegate.selectedRenderer.observeForever(rendererObs)
}
......@@ -85,8 +85,8 @@ class DisplayManager(private val activity: Activity, cloneMode: Boolean) {
}
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
private fun createPresentation(cloneMode: Boolean): SecondaryDisplay? {
if (mediaRouter === null || cloneMode) return null
private fun createPresentation(): SecondaryDisplay? {
if (mediaRouter === null) return null
// Get the current route and its presentation display.
val route = mediaRouter?.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO)
......
......@@ -324,7 +324,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
audioBoostEnabled = mSettings.getBoolean("audio_boost", false);
mEnableCloneMode = mSettings.getBoolean("enable_clone_mode", false);
mDisplayManager = new DisplayManager(this, mEnableCloneMode);
mDisplayManager = new DisplayManager(this, mEnableCloneMode || mIsBenchmark);
setContentView(mDisplayManager.isPrimary() ? R.layout.player : R.layout.player_remote_control);
/** initialize Views an their Events */
......@@ -777,7 +777,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
surfaceFrameAddLayoutListener(true);
/* Listen for changes to media routes. */
mDisplayManager.mediaRouterAddCallback(true);
if (!mIsBenchmark) mDisplayManager.mediaRouterAddCallback(true);
if (mRootView != null) mRootView.setKeepScreenOn(true);
}
......@@ -845,7 +845,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
if (mRootView != null) mRootView.setKeepScreenOn(false);
/* Stop listening for changes to media routes. */
mDisplayManager.mediaRouterAddCallback(false);
if (!mIsBenchmark) mDisplayManager.mediaRouterAddCallback(false);
surfaceFrameAddLayoutListener(false);
......@@ -933,7 +933,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
}
};
public void exit(int resultCode){
public void exit(int resultCode) {
if (isFinishing()) return;
final Intent resultIntent = new Intent(ACTION_RESULT);
if (mUri != null && mService != null) {
......
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 to comment