get rid of some content resolver leftovers
This commit is contained in:
parent
29c6dd9916
commit
2f477c65d4
@ -18,7 +18,6 @@
|
||||
package ch.blinkenlights.android.medialibrary;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentValues;
|
||||
import android.database.ContentObserver;
|
||||
import android.database.DatabaseUtils;
|
||||
|
@ -33,7 +33,6 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Message;
|
||||
import android.util.Log;
|
||||
import android.content.ContentResolver;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Menu;
|
||||
|
@ -26,7 +26,6 @@ package ch.blinkenlights.android.vanilla;
|
||||
import ch.blinkenlights.android.medialibrary.MediaLibrary;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -39,7 +39,6 @@ import android.util.Log;
|
||||
import junit.framework.Assert;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.database.Cursor;
|
||||
@ -405,7 +404,7 @@ public class MediaUtils {
|
||||
/**
|
||||
* Returns the first matching song (or NULL) of given type + id combination
|
||||
*
|
||||
* @param resolver A ContentResolver to use.
|
||||
* @param context A Context to use.
|
||||
* @param type The MediaTye to query
|
||||
* @param id The id of given type to query
|
||||
*/
|
||||
|
@ -33,7 +33,6 @@ import android.app.backup.BackupManager;
|
||||
import android.appwidget.AppWidgetManager;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentName;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
@ -1568,12 +1567,12 @@ public final class PlaybackService extends Service
|
||||
PlayCountsHelper.countSong(getApplicationContext(), song, played);
|
||||
// Update the playcounts playlist in ~20% of all cases if enabled
|
||||
if (mAutoPlPlaycounts > 0 && Math.random() > 0.8) {
|
||||
ContentResolver resolver = getContentResolver();
|
||||
Context context = getApplicationContext();
|
||||
// Add an invisible whitespace to adjust our sorting
|
||||
String playlistName = getString(R.string.autoplaylist_playcounts_name, mAutoPlPlaycounts);
|
||||
long id = Playlist.createPlaylist(getApplicationContext(), playlistName);
|
||||
ArrayList<Long> items = PlayCountsHelper.getTopSongs(getApplicationContext(), mAutoPlPlaycounts);
|
||||
Playlist.addToPlaylist(getApplicationContext(), id, items);
|
||||
long id = Playlist.createPlaylist(context, playlistName);
|
||||
ArrayList<Long> items = PlayCountsHelper.getTopSongs(context, mAutoPlPlaycounts);
|
||||
Playlist.addToPlaylist(context, id, items);
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,10 +31,6 @@ import android.database.Cursor;
|
||||
import android.text.TextUtils;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentUris;
|
||||
import android.net.Uri;
|
||||
import android.provider.MediaStore;
|
||||
/**
|
||||
* Provides various playlist-related utility functions.
|
||||
*/
|
||||
@ -47,7 +43,7 @@ public class Playlist {
|
||||
*/
|
||||
public static Cursor queryPlaylists(Context context) {
|
||||
final String[] projection = { MediaLibrary.PlaylistColumns._ID, MediaLibrary.PlaylistColumns.NAME };
|
||||
final String sort = MediaStore.Audio.Playlists.NAME;
|
||||
final String sort = MediaLibrary.PlaylistColumns.NAME;
|
||||
return MediaLibrary.queryLibrary(context, MediaLibrary.TABLE_PLAYLISTS, projection, null, null, sort);
|
||||
}
|
||||
|
||||
@ -99,7 +95,7 @@ public class Playlist {
|
||||
* run on a background thread.
|
||||
*
|
||||
* @param context the context to use
|
||||
* @param playlistId The MediaStore.Audio.Playlist id of the playlist to
|
||||
* @param playlistId The playlist id of the playlist to
|
||||
* modify.
|
||||
* @param query The query to run. The audio id should be the first column.
|
||||
* @return The number of songs that were added to the playlist.
|
||||
@ -120,7 +116,7 @@ public class Playlist {
|
||||
* run on a background thread.
|
||||
*
|
||||
* @param context the context to use
|
||||
* @param playlistId The MediaStore.Audio.Playlist id of the playlist to
|
||||
* @param playlistId The playlist id of the playlist to
|
||||
* modify.
|
||||
* @param audioIds An ArrayList with all IDs to add
|
||||
* @return The number of songs that were added to the playlist.
|
||||
|
@ -25,8 +25,6 @@ package ch.blinkenlights.android.vanilla;
|
||||
|
||||
import ch.blinkenlights.android.medialibrary.MediaLibrary;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.ContentUris;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
@ -34,7 +32,6 @@ import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@ -42,7 +39,7 @@ import android.widget.CursorAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
/**
|
||||
* CursorAdapter backed by MediaStore playlists.
|
||||
* CursorAdapter backed by MediaLibrary playlists.
|
||||
*/
|
||||
public class PlaylistAdapter extends CursorAdapter implements Handler.Callback {
|
||||
|
||||
@ -83,7 +80,7 @@ public class PlaylistAdapter extends CursorAdapter implements Handler.Callback {
|
||||
/**
|
||||
* Set the id of the backing playlist.
|
||||
*
|
||||
* @param id The MediaStore id of a playlist.
|
||||
* @param id The id of a playlist.
|
||||
*/
|
||||
public void setPlaylistId(long id)
|
||||
{
|
||||
|
@ -25,7 +25,6 @@ package ch.blinkenlights.android.vanilla;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
@ -52,7 +52,7 @@ public class QueryTask {
|
||||
|
||||
/**
|
||||
* Create the tasks. All arguments are passed directly to
|
||||
* ContentResolver.query().
|
||||
* MediaLibrary.runQuery().
|
||||
*/
|
||||
public QueryTask(String table, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
|
||||
this.table = table;
|
||||
|
@ -25,7 +25,6 @@ package ch.blinkenlights.android.vanilla;
|
||||
|
||||
import ch.blinkenlights.android.medialibrary.MediaLibrary;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
|
Loading…
x
Reference in New Issue
Block a user