Code Cleanup
This commit is contained in:
parent
6ff3eb2e2a
commit
520b6b74ca
22 changed files with 155 additions and 139 deletions
|
@ -146,7 +146,7 @@ public class AutoGeneratedPlaylistBitmap {
|
|||
try {
|
||||
return Glide.with(context)
|
||||
.asBitmap()
|
||||
.load(MusicUtil.INSTANCE.getMediaStoreAlbumCoverUri(id))
|
||||
.load(MusicUtil.getMediaStoreAlbumCoverUri(id))
|
||||
.submit(200, 200)
|
||||
.get();
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -22,7 +22,7 @@ public class CalendarUtil {
|
|||
private static final long MS_PER_MINUTE = 60 * 1000;
|
||||
private static final long MS_PER_DAY = 24 * 60 * MS_PER_MINUTE;
|
||||
|
||||
private Calendar calendar;
|
||||
private final Calendar calendar;
|
||||
|
||||
public CalendarUtil() {
|
||||
this.calendar = Calendar.getInstance();
|
||||
|
|
|
@ -34,6 +34,8 @@ import org.xmlpull.v1.XmlPullParserException
|
|||
import java.io.IOException
|
||||
import java.security.MessageDigest
|
||||
import java.security.NoSuchAlgorithmException
|
||||
import java.util.*
|
||||
import kotlin.collections.LinkedHashMap
|
||||
|
||||
/**
|
||||
* Validates that the calling package is authorized to browse a [MediaBrowserServiceCompat].
|
||||
|
@ -274,7 +276,8 @@ class PackageValidator(
|
|||
var eventType = parser.next()
|
||||
while (eventType != XmlResourceParser.END_TAG) {
|
||||
val isRelease = parser.getAttributeBooleanValue(null, "release", false)
|
||||
val signature = parser.nextText().replace(WHITESPACE_REGEX, "").toLowerCase()
|
||||
val signature = parser.nextText().replace(WHITESPACE_REGEX, "")
|
||||
.lowercase(Locale.getDefault())
|
||||
callerSignatures += KnownSignature(signature, isRelease)
|
||||
|
||||
eventType = parser.next()
|
||||
|
@ -319,14 +322,14 @@ class PackageValidator(
|
|||
}
|
||||
|
||||
private data class KnownCallerInfo(
|
||||
internal val name: String,
|
||||
internal val packageName: String,
|
||||
internal val signatures: MutableSet<KnownSignature>
|
||||
val name: String,
|
||||
val packageName: String,
|
||||
val signatures: MutableSet<KnownSignature>
|
||||
)
|
||||
|
||||
private data class KnownSignature(
|
||||
internal val signature: String,
|
||||
internal val release: Boolean
|
||||
val signature: String,
|
||||
val release: Boolean
|
||||
)
|
||||
|
||||
/**
|
||||
|
@ -334,11 +337,11 @@ class PackageValidator(
|
|||
* to see if it's a known caller.
|
||||
*/
|
||||
private data class CallerPackageInfo(
|
||||
internal val name: String,
|
||||
internal val packageName: String,
|
||||
internal val uid: Int,
|
||||
internal val signature: String?,
|
||||
internal val permissions: Set<String>
|
||||
val name: String,
|
||||
val packageName: String,
|
||||
val uid: Int,
|
||||
val signature: String?,
|
||||
val permissions: Set<String>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
|
||||
public class SwipeAndDragHelper extends ItemTouchHelper.Callback {
|
||||
|
||||
private ActionCompletionContract contract;
|
||||
private final ActionCompletionContract contract;
|
||||
|
||||
public SwipeAndDragHelper(@NonNull ActionCompletionContract contract) {
|
||||
this.contract = contract;
|
||||
|
|
|
@ -77,7 +77,7 @@ public class MediaNotificationProcessor {
|
|||
|
||||
private static final String TAG = "ColorPicking";
|
||||
private float[] mFilteredBackgroundHsl = null;
|
||||
private Palette.Filter mBlackWhiteFilter =
|
||||
private final Palette.Filter mBlackWhiteFilter =
|
||||
(rgb, hsl) -> !isWhiteOrBlack(hsl);
|
||||
private boolean mIsLowPriority;
|
||||
private int backgroundColor;
|
||||
|
@ -85,7 +85,7 @@ public class MediaNotificationProcessor {
|
|||
private int primaryTextColor;
|
||||
private int actionBarColor;
|
||||
private Drawable drawable;
|
||||
private Context context;
|
||||
private final Context context;
|
||||
|
||||
public MediaNotificationProcessor(Context context, Drawable drawable) {
|
||||
this.context = context;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue