Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/ContentBlockerContentProvider.java

Issue 29453722: Noissue - Lint adjustments and optimizations (Closed)
Patch Set: Adjustments based on review comments Created June 13, 2017, 9:23 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/ContentBlockerContentProvider.java
===================================================================
--- a/adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/ContentBlockerContentProvider.java
+++ b/adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/ContentBlockerContentProvider.java
@@ -29,24 +29,25 @@ import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.preference.PreferenceManager;
+import android.support.annotation.NonNull;
import android.util.Log;
public class ContentBlockerContentProvider extends ContentProvider
{
private static final String TAG = ContentBlockerContentProvider.class.getSimpleName();
@Override
- public Bundle call(String method, String arg, Bundle extras)
+ public Bundle call(@NonNull String method, String arg, Bundle extras)
{
// As of SBC interface v1.4 we return `null` here to signal that we do not
// use encryption
return null;
}
private static boolean getBooleanPref(final SharedPreferences prefs, final String key,
final boolean defValue)
@@ -61,27 +62,27 @@ public class ContentBlockerContentProvid
}
}
private void setApplicationActivated()
{
final SharedPreferences prefs = PreferenceManager
.getDefaultSharedPreferences(this.getContext().getApplicationContext());
final String key = this.getContext().getString(R.string.key_application_activated);
- final boolean applicationActived = getBooleanPref(prefs, key, false);
- if (!applicationActived)
+ final boolean applicationActivated = getBooleanPref(prefs, key, false);
+ if (!applicationActivated)
{
prefs.edit()
.putBoolean(key, true)
.commit();
}
}
@Override
- public ParcelFileDescriptor openFile(final Uri uri, final String mode)
+ public ParcelFileDescriptor openFile(@NonNull final Uri uri, @NonNull final String mode)
throws FileNotFoundException
{
try
{
this.setApplicationActivated();
Log.d(TAG, "Writing filters...");
final File filterFile = Engine.getOrCreateCachedFilterFile(getContext());
Log.d(TAG, "Delivering filters...");
@@ -99,39 +100,39 @@ public class ContentBlockerContentProvid
{
Log.i(TAG, "onCreate() called");
getContext().startService(new Intent(getContext(), EngineService.class));
Log.i(TAG, "Requested service startup");
return true;
}
@Override
- public Cursor query(final Uri uri, final String[] projection, final String selection,
+ public Cursor query(@NonNull final Uri uri, final String[] projection, final String selection,
final String[] selectionArgs, final String sortOrder)
{
return null;
}
@Override
- public String getType(final Uri uri)
- {
- return null;
- }
-
- @Override
- public Uri insert(final Uri uri, final ContentValues values)
+ public String getType(@NonNull final Uri uri)
{
return null;
}
@Override
- public int delete(final Uri uri, final String selection, final String[] selectionArgs)
+ public Uri insert(@NonNull final Uri uri, final ContentValues values)
+ {
+ return null;
+ }
+
+ @Override
+ public int delete(@NonNull final Uri uri, final String selection, final String[] selectionArgs)
{
return 0;
}
@Override
- public int update(final Uri uri, final ContentValues values, final String selection,
+ public int update(@NonNull final Uri uri, final ContentValues values, final String selection,
final String[] selectionArgs)
{
return 0;
}
}

Powered by Google App Engine
This is Rietveld