Commit ee6f5f8c authored by ar-arvind's avatar ar-arvind Committed by Simon Xu
Browse files

Fixed lint warnings.

parent 805c206c
......@@ -23,8 +23,8 @@ import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
public abstract class AddStickerPackActivity extends BaseActivity {
public static final int ADD_PACK = 200;
public static final String TAG = "AddStickerPackActivity";
private static final int ADD_PACK = 200;
private static final String TAG = "AddStickerPackActivity";
protected void addStickerPackToWhatsApp(String identifier, String stickerPackName) {
try {
......
......@@ -14,8 +14,8 @@ import android.os.Parcelable;
import java.util.List;
class Sticker implements Parcelable {
String imageFileName;
List<String> emojis;
final String imageFileName;
final List<String> emojis;
long size;
Sticker(String imageFileName, List<String> emojis) {
......
......@@ -51,15 +51,15 @@ public class StickerContentProvider extends ContentProvider {
public static final String STICKER_FILE_NAME_IN_QUERY = "sticker_file_name";
public static final String STICKER_FILE_EMOJI_IN_QUERY = "sticker_emoji";
public static final String CONTENT_FILE_NAME = "contents.json";
private static final String CONTENT_FILE_NAME = "contents.json";
public static Uri AUTHORITY_URI = new Uri.Builder().scheme(ContentResolver.SCHEME_CONTENT).authority(BuildConfig.CONTENT_PROVIDER_AUTHORITY).appendPath(StickerContentProvider.METADATA).build();
public static final Uri AUTHORITY_URI = new Uri.Builder().scheme(ContentResolver.SCHEME_CONTENT).authority(BuildConfig.CONTENT_PROVIDER_AUTHORITY).appendPath(StickerContentProvider.METADATA).build();
/**
* Do not change the values in the UriMatcher because otherwise, WhatsApp will not be able to fetch the stickers from the ContentProvider.
*/
private static final UriMatcher MATCHER = new UriMatcher(UriMatcher.NO_MATCH);
static final String METADATA = "metadata";
private static final String METADATA = "metadata";
private static final int METADATA_CODE = 1;
private static final int METADATA_CODE_FOR_SINGLE_PACK = 2;
......@@ -153,7 +153,7 @@ public class StickerContentProvider extends ContentProvider {
}
}
public List<StickerPack> getStickerPackList() {
private List<StickerPack> getStickerPackList() {
if (stickerPackList == null) {
readContentFile(Objects.requireNonNull(getContext()));
}
......
......@@ -14,10 +14,10 @@ import android.os.Parcelable;
import java.util.List;
class StickerPack implements Parcelable {
String identifier;
String name;
String publisher;
String trayImageFile;
final String identifier;
final String name;
final String publisher;
final String trayImageFile;
final String publisherEmail;
final String publisherWebsite;
final String privacyPolicyWebsite;
......@@ -52,7 +52,7 @@ class StickerPack implements Parcelable {
return isWhitelisted;
}
protected StickerPack(Parcel in) {
private StickerPack(Parcel in) {
identifier = in.readString();
name = in.readString();
publisher = in.readString();
......
......@@ -190,7 +190,6 @@ public class StickerPackDetailsActivity extends AddStickerPackActivity {
protected final Boolean doInBackground(StickerPack... stickerPacks) {
StickerPack stickerPack = stickerPacks[0];
final StickerPackDetailsActivity stickerPackDetailsActivity = stickerPackDetailsActivityWeakReference.get();
//noinspection SimplifiableIfStatement
if (stickerPackDetailsActivity == null) {
return false;
}
......
......@@ -17,12 +17,12 @@ import androidx.recyclerview.widget.RecyclerView;
class StickerPackListItemViewHolder extends RecyclerView.ViewHolder {
View container;
TextView titleView;
TextView publisherView;
TextView filesizeView;
ImageView addButton;
LinearLayout imageRowView;
final View container;
final TextView titleView;
final TextView publisherView;
final TextView filesizeView;
final ImageView addButton;
final LinearLayout imageRowView;
StickerPackListItemViewHolder(final View itemView) {
super(itemView);
......
......@@ -18,11 +18,11 @@ import androidx.recyclerview.widget.RecyclerView;
public class StickerPreviewAdapter extends RecyclerView.Adapter<StickerPreviewViewHolder> {
@NonNull
private StickerPack stickerPack;
private final StickerPack stickerPack;
private final int cellSize;
private int cellLimit;
private int cellPadding;
private final int cellLimit;
private final int cellPadding;
private final int errorResource;
private final LayoutInflater layoutInflater;
......
......@@ -18,16 +18,15 @@ import android.net.Uri;
import androidx.annotation.NonNull;
@SuppressWarnings("FieldCanBeLocal")
class WhitelistCheck {
private static final String AUTHORITY_QUERY_PARAM = "authority";
private static final String IDENTIFIER_QUERY_PARAM = "identifier";
private static String STICKER_APP_AUTHORITY = BuildConfig.CONTENT_PROVIDER_AUTHORITY;
private static final String STICKER_APP_AUTHORITY = BuildConfig.CONTENT_PROVIDER_AUTHORITY;
static final String CONSUMER_WHATSAPP_PACKAGE_NAME = "com.whatsapp";
static final String SMB_WHATSAPP_PACKAGE_NAME = "com.whatsapp.w4b";
private static String CONTENT_PROVIDER = ".provider.sticker_whitelist_check";
private static String QUERY_PATH = "is_whitelisted";
private static String QUERY_RESULT_COLUMN_NAME = "result";
private static final String CONTENT_PROVIDER = ".provider.sticker_whitelist_check";
private static final String QUERY_PATH = "is_whitelisted";
private static final String QUERY_RESULT_COLUMN_NAME = "result";
static boolean isWhitelisted(@NonNull Context context, @NonNull String identifier) {
try {
......@@ -65,7 +64,7 @@ class WhitelistCheck {
return false;
}
public static boolean isPackageInstalled(String packageName, PackageManager packageManager) {
static boolean isPackageInstalled(String packageName, PackageManager packageManager) {
try {
final ApplicationInfo applicationInfo = packageManager.getApplicationInfo(packageName, 0);
//noinspection SimplifiableIfStatement
......
Supports Markdown
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