Commit 0484d7b0 authored by Geoffrey Métais's avatar Geoffrey Métais

Extract TV UI check to prevent race condition

parent 7a66fbdd
......@@ -29,6 +29,7 @@ import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.util.Log;
......@@ -63,12 +64,17 @@ public class StartActivity extends Activity {
else
MediaUtils.openMediaNoUi(intent.getData());
} else if (intent != null && TextUtils.equals(intent.getAction(), AudioPlayerContainerActivity.ACTION_SHOW_PLAYER)) {
startActivity(new Intent(this, VLCApplication.showTvUi() ? AudioPlayerActivity.class : MainActivity.class));
startActivity(new Intent(this, showTvUi() ? AudioPlayerActivity.class : MainActivity.class));
} else
startActivity(new Intent(this, VLCApplication.showTvUi() ? MainTvActivity.class : MainActivity.class));
startActivity(new Intent(this, showTvUi() ? MainTvActivity.class : MainActivity.class));
finish();
}
private boolean showTvUi() {
return AndroidUtil.isJellyBeanMR1OrLater() && (AndroidDevices.isAndroidTv() || !AndroidDevices.hasTsp() ||
PreferenceManager.getDefaultSharedPreferences(this).getBoolean("tv_ui", false));
}
private Uri getUri(Intent intent) {
Uri mUri = null, data = intent.getData();
if (data != null && TextUtils.equals(data.getScheme(), "content")) {
......
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