Commit 803ab392 authored by Geoffrey Métais's avatar Geoffrey Métais

Remove references to FROYO

parent 7255a35c
......@@ -146,7 +146,6 @@ public class VideoView extends SurfaceView
public void stopPlayback() {
}
@TargetApi(Build.VERSION_CODES.FROYO)
public void suspend() {
}
......
......@@ -59,13 +59,10 @@ public class VLCUtil {
}
@SuppressWarnings("deprecation")
@TargetApi(Build.VERSION_CODES.FROYO)
public static String[] getABIList() {
final boolean hasABI2 = Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO;
final String[] abis = new String[hasABI2 ? 2 : 1];
final String[] abis = new String[2];
abis[0] = android.os.Build.CPU_ABI;
if (hasABI2)
abis[1] = android.os.Build.CPU_ABI2;
abis[1] = android.os.Build.CPU_ABI2;
return abis;
}
......
......@@ -325,7 +325,6 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
private final OnAudioFocusChangeListener mAudioFocusListener = createOnAudioFocusChangeListener();
@TargetApi(Build.VERSION_CODES.FROYO)
private OnAudioFocusChangeListener createOnAudioFocusChangeListener() {
return new OnAudioFocusChangeListener() {
private boolean mLossTransient = false;
......@@ -377,7 +376,6 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
};
}
@TargetApi(Build.VERSION_CODES.FROYO)
private void changeAudioFocus(boolean acquire) {
final AudioManager am = (AudioManager)getSystemService(AUDIO_SERVICE);
if (am == null)
......@@ -394,7 +392,7 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
}
} else {
if (mHasAudioFocus) {
final int result = am.abandonAudioFocus(mAudioFocusListener);
am.abandonAudioFocus(mAudioFocusListener);
am.setParameters("bgm_state=false");
mHasAudioFocus = false;
}
......
......@@ -92,7 +92,6 @@ import org.videolan.vlc.media.MediaDatabase;
import org.videolan.vlc.media.MediaLibrary;
import org.videolan.vlc.media.MediaUtils;
import org.videolan.vlc.util.Permissions;
import org.videolan.vlc.util.Util;
import org.videolan.vlc.util.VLCInstance;
import org.videolan.vlc.util.WeakHandler;
......@@ -521,7 +520,6 @@ public class MainActivity extends AudioPlayerContainerActivity implements Filter
/** Create menu from XML
*/
@TargetApi(Build.VERSION_CODES.FROYO)
@Override
public boolean onCreateOptionsMenu(Menu menu) {
mMenu = menu;
......
......@@ -689,7 +689,6 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
mHelper.onStop();
}
@TargetApi(android.os.Build.VERSION_CODES.FROYO)
private void restoreBrightness() {
if (mRestoreAutoBrightness != -1f) {
int brightness = (int) (mRestoreAutoBrightness*255f);
......@@ -3072,15 +3071,11 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
private int getScreenRotation(){
WindowManager wm = (WindowManager) VLCApplication.getAppContext().getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO /* Android 2.2 has getRotation */) {
try {
Method m = display.getClass().getDeclaredMethod("getRotation");
return (Integer) m.invoke(display);
} catch (Exception e) {
return Surface.ROTATION_0;
}
} else {
return display.getOrientation();
try {
Method m = display.getClass().getDeclaredMethod("getRotation");
return (Integer) m.invoke(display);
} catch (Exception e) {
return Surface.ROTATION_0;
}
}
......
......@@ -24,7 +24,6 @@ import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.AssetManager;
import android.os.Build;
import android.util.Log;
import org.videolan.libvlc.LibVLC;
......@@ -34,11 +33,6 @@ import org.videolan.vlc.VLCCrashHandler;
import org.videolan.vlc.gui.CompatErrorActivity;
import org.videolan.vlc.gui.NativeCrashActivity;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
public class VLCInstance {
public final static String TAG = "VLC/UiTools/VLCInstance";
......@@ -54,49 +48,6 @@ public class VLCInstance {
}
};
public static void linkCompatLib(Context context) {
final File outDir = new File(context.getFilesDir(), "compat");
if (!outDir.exists())
outDir.mkdir();
final File outFile = new File(outDir, "libcompat.7.so");
/* The file may had been already copied from the asset, try to load it */
if (outFile.exists()) {
try {
System.load(outFile.getPath());
return;
} catch (UnsatisfiedLinkError ule) {
/* the file can be invalid, try to copy it again */
}
}
/* copy libcompat.7.so from assert to a data dir */
InputStream is = null;
FileOutputStream fos = null;
boolean success = false;
try {
is = VLCApplication.getAppResources().getAssets().open("libcompat.7.so");
fos = new FileOutputStream(outFile);
final byte[] buffer = new byte[16*1024];
int read;
while ((read = is.read(buffer)) != -1)
fos.write(buffer, 0, read);
success = true;
} catch (IOException e) {
} finally {
Util.close(is);
Util.close(fos);
}
/* load the lib coming from the asset */
if (success) {
try {
System.load(outFile.getPath());
} catch (UnsatisfiedLinkError ule) {
}
}
}
/** A set of utility functions for the VLC application */
public synchronized static LibVLC get() throws IllegalStateException {
if (sLibVLC == null) {
......@@ -107,10 +58,6 @@ public class VLCInstance {
Log.e(TAG, VLCUtil.getErrorMsg());
throw new IllegalStateException("LibVLC initialisation failed: " + VLCUtil.getErrorMsg());
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.FROYO) {
Log.w(TAG, "linking with true compat lib...");
linkCompatLib(context);
}
sLibVLC = new LibVLC(context, VLCOptions.getLibOptions());
LibVLC.setOnNativeCrashListener(new LibVLC.OnNativeCrashListener() {
......
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