Remove deprecated API-level related code
This commit is contained in:
parent
cab37665c6
commit
75ad0a0239
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package net.nullsum.audinaut.activity;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
|
@ -32,7 +31,6 @@ public class SettingsActivity extends SubsonicActivity {
|
|||
private static final String TAG = SettingsActivity.class.getSimpleName();
|
||||
private PreferenceCompatFragment fragment;
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
|
|
@ -832,14 +832,11 @@ public class SubsonicActivity extends AppCompatActivity implements OnItemSelecte
|
|||
private void applyFullscreen() {
|
||||
fullScreen = Util.getPreferences(this).getBoolean(Constants.PREFERENCES_KEY_FULL_SCREEN, false);
|
||||
if(fullScreen ) {
|
||||
// Hide additional elements on higher Android versions
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
int flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||
|
||||
getWindow().getDecorView().setSystemUiVisibility(flags);
|
||||
}
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.io.Serializable;
|
|||
import android.content.Context;
|
||||
import android.media.audiofx.BassBoost;
|
||||
import android.media.audiofx.Equalizer;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import net.nullsum.audinaut.util.FileUtil;
|
||||
|
||||
|
@ -54,11 +53,9 @@ public class EqualizerController {
|
|||
private void init() {
|
||||
equalizer = new Equalizer(0, audioSessionId);
|
||||
bass = new BassBoost(0, audioSessionId);
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
loudnessAvailable = true;
|
||||
loudnessEnhancerController = new LoudnessEnhancerController(context, audioSessionId);
|
||||
}
|
||||
}
|
||||
|
||||
public void saveSettings() {
|
||||
try {
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package net.nullsum.audinaut.domain;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.media.MediaMetadataRetriever;
|
||||
|
@ -256,7 +255,6 @@ public class MusicDirectory implements Serializable {
|
|||
this.linkedArtist = artist;
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.GINGERBREAD_MR1)
|
||||
public void loadMetadata(File file) {
|
||||
try {
|
||||
MediaMetadataRetriever metadata = new MediaMetadataRetriever();
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.util.concurrent.Executors;
|
|||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
@ -711,7 +710,6 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis
|
|||
}
|
||||
|
||||
// Scroll to current playing/downloading.
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private void scrollToCurrent() {
|
||||
if (getDownloadService() == null || songListAdapter == null) {
|
||||
scrollWhenLoaded = true;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.nullsum.audinaut.fragments;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -57,7 +56,6 @@ public class SelectArtistFragment extends SelectRecyclerFragment<Serializable> i
|
|||
outState.putSerializable(Constants.FRAGMENT_LIST2, (Serializable) musicFolders);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
|
||||
Bundle args = getArguments();
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.nullsum.audinaut.fragments;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package net.nullsum.audinaut.fragments;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.app.SearchManager;
|
||||
import android.app.SearchableInfo;
|
||||
|
|
|
@ -58,7 +58,6 @@ import java.util.Date;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Service;
|
||||
import android.content.ComponentCallbacks2;
|
||||
import android.content.ComponentName;
|
||||
|
@ -186,12 +185,8 @@ public class DownloadService extends Service {
|
|||
|
||||
if(audioSessionId == -1) {
|
||||
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
|
||||
try {
|
||||
audioSessionId = mediaPlayer.getAudioSessionId();
|
||||
prefs.edit().putInt(Constants.CACHE_AUDIO_SESSION_ID, audioSessionId).apply();
|
||||
} catch (Throwable t) {
|
||||
// Froyo or lower
|
||||
}
|
||||
}
|
||||
|
||||
mediaPlayer.setOnErrorListener(new MediaPlayer.OnErrorListener() {
|
||||
|
@ -202,15 +197,6 @@ public class DownloadService extends Service {
|
|||
}
|
||||
});
|
||||
|
||||
/*try {
|
||||
Intent i = new Intent(AudioEffect.ACTION_OPEN_AUDIO_EFFECT_CONTROL_SESSION);
|
||||
i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, audioSessionId);
|
||||
i.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
|
||||
sendBroadcast(i);
|
||||
} catch(Throwable e) {
|
||||
// Froyo or lower
|
||||
}*/
|
||||
|
||||
effectsController = new AudioEffectsController(DownloadService.this, audioSessionId);
|
||||
if(prefs.getBoolean(Constants.PREFERENCES_EQUALIZER_ON, false)) {
|
||||
getEqualizerController();
|
||||
|
@ -285,14 +271,10 @@ public class DownloadService extends Service {
|
|||
if(currentPlaying != null) currentPlaying.setPlaying(false);
|
||||
lifecycleSupport.onDestroy();
|
||||
|
||||
try {
|
||||
Intent i = new Intent(AudioEffect.ACTION_CLOSE_AUDIO_EFFECT_CONTROL_SESSION);
|
||||
i.putExtra(AudioEffect.EXTRA_AUDIO_SESSION, audioSessionId);
|
||||
i.putExtra(AudioEffect.EXTRA_PACKAGE_NAME, getPackageName());
|
||||
sendBroadcast(i);
|
||||
} catch(Throwable e) {
|
||||
// Froyo or lower
|
||||
}
|
||||
|
||||
mediaPlayer.release();
|
||||
if(nextMediaPlayer != null) {
|
||||
|
|
|
@ -37,7 +37,6 @@ import java.util.List;
|
|||
import java.util.zip.DeflaterOutputStream;
|
||||
import java.util.zip.InflaterInputStream;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
|
@ -775,7 +774,6 @@ public class FileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
|
||||
public static <T extends Serializable> T deserializeCompressed(Context context, String fileName, Class<T> tClass) {
|
||||
Input in = null;
|
||||
try {
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package net.nullsum.audinaut.util;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
|
|
|
@ -56,7 +56,6 @@ public class CacheLocationPreference extends EditTextPreference {
|
|||
protected void onBindDialogView(View view) {
|
||||
super.onBindDialogView(view);
|
||||
|
||||
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
view.setLayoutParams(new ViewGroup.LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT, android.view.ViewGroup.LayoutParams.WRAP_CONTENT));
|
||||
|
||||
final EditText editText = (EditText) view.findViewById(android.R.id.edit);
|
||||
|
@ -141,5 +140,4 @@ public class CacheLocationPreference extends EditTextPreference {
|
|||
externalLocation.setEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package net.nullsum.audinaut.view;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Path;
|
||||
|
@ -32,7 +31,6 @@ public class CardView extends FrameLayout{
|
|||
init(context);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public CardView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
init(context);
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
package net.nullsum.audinaut.view;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
|
|
Loading…
Reference in New Issue