dependency updates and compatibility fixes

This commit is contained in:
dkanada 2022-08-27 10:10:34 +09:00
commit fb3102c06b
16 changed files with 57 additions and 47 deletions

View file

@ -27,7 +27,7 @@ jobs:
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
with: with:
arguments: assemble arguments: assemble
gradle-version: 7.0.2 gradle-version: 7.3.3
- name: Move - name: Move
run: mv app/build/outputs/apk/release/*.apk gelli-release-${version}.apk run: mv app/build/outputs/apk/release/*.apk gelli-release-${version}.apk
env: env:

View file

@ -2,11 +2,11 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
android { android {
compileSdkVersion 30 compileSdkVersion 32
defaultConfig { defaultConfig {
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 30 targetSdkVersion 32
versionCode 16 versionCode 16
versionName '1.3.3' versionName '1.3.3'
@ -44,7 +44,7 @@ android {
viewBinding true viewBinding true
} }
lintOptions { lint {
disable 'MissingTranslation' disable 'MissingTranslation'
abortOnError false abortOnError false
} }
@ -52,33 +52,33 @@ android {
compileOptions { compileOptions {
coreLibraryDesugaringEnabled true coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_11
} }
} }
dependencies { dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.21' implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1'
implementation 'com.github.jellyfin.jellyfin-apiclient-java:android:0.7.3' implementation 'com.github.jellyfin.jellyfin-apiclient-java:android:0.7.3'
implementation 'com.github.woltapp:blurhash:f41a23cc50' implementation 'com.github.woltapp:blurhash:f41a23cc50'
implementation 'com.google.android.exoplayer:exoplayer:2.12.2' implementation 'com.google.android.exoplayer:exoplayer:2.14.2'
implementation 'com.google.android.material:material:1.4.0' implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.core:core-ktx:1.6.0' implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.media:media:1.4.1' implementation 'androidx.media:media:1.6.0'
implementation 'androidx.fragment:fragment-ktx:1.3.6' implementation 'androidx.fragment:fragment-ktx:1.5.2'
implementation 'androidx.legacy:legacy-support-v13:1.0.0' implementation 'androidx.legacy:legacy-support-v13:1.0.0'
implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1' implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.gridlayout:gridlayout:1.0.0' implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.palette:palette-ktx:1.0.0' implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'androidx.annotation:annotation:1.2.0' implementation 'androidx.annotation:annotation:1.4.0'
implementation 'androidx.percentlayout:percentlayout:1.0.0' implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'androidx.preference:preference-ktx:1.1.1' implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.github.kabouzeid:RecyclerView-FastScroll:1.0.16-kmod' implementation 'com.github.kabouzeid:RecyclerView-FastScroll:1.0.16-kmod'
implementation 'com.github.kabouzeid:SeekArc:1.2-kmod' implementation 'com.github.kabouzeid:SeekArc:1.2-kmod'
@ -101,8 +101,8 @@ dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
annotationProcessor 'androidx.room:room-compiler:2.3.0' annotationProcessor 'androidx.room:room-compiler:2.4.3'
implementation 'androidx.room:room-runtime:2.3.0' implementation 'androidx.room:room-runtime:2.4.3'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.github.bumptech.glide:annotations:4.12.0' implementation 'com.github.bumptech.glide:annotations:4.12.0'

View file

@ -30,7 +30,7 @@
<activity android:name=".activities.details.GenreDetailActivity" /> <activity android:name=".activities.details.GenreDetailActivity" />
<activity android:name=".activities.details.PlaylistDetailActivity" /> <activity android:name=".activities.details.PlaylistDetailActivity" />
<activity android:name=".activities.SearchActivity" /> <activity android:name=".activities.SearchActivity" />
<activity android:name=".activities.SplashActivity"> <activity android:name=".activities.SplashActivity" android:exported="true">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MUSIC_PLAYER" /> <action android:name="android.intent.action.MUSIC_PLAYER" />
@ -70,7 +70,7 @@
<service android:name=".service.LoginService" /> <service android:name=".service.LoginService" />
<service android:name=".service.MusicService" /> <service android:name=".service.MusicService" />
<receiver android:name=".service.receivers.MediaButtonIntentReceiver"> <receiver android:name=".service.receivers.MediaButtonIntentReceiver" android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" /> <action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter> </intent-filter>
@ -83,7 +83,7 @@
android:name="com.lge.support.SPLIT_WINDOW" android:name="com.lge.support.SPLIT_WINDOW"
android:value="true" /> android:value="true" />
<receiver android:name=".views.widgets.BootReceiver"> <receiver android:name=".views.widgets.BootReceiver" android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" /> <action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" /> <action android:name="android.intent.action.QUICKBOOT_POWERON" />

View file

@ -95,9 +95,18 @@ public class SettingsActivity extends AbsBaseActivity {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
downloadLocationPreference.setEnabled(false); downloadLocationPreference.setEnabled(false);
// stock Android 11 removed the album cover on lock screens
// supported on LineageOS so we might want to add a check at some point
showAlbumCoverPreference.setEnabled(false); showAlbumCoverPreference.setEnabled(false);
} }
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) {
// custom notification layouts were removed entirely in Android 12
classicNotification.setEnabled(false);
coloredNotification.setEnabled(false);
}
categoryPreference.setOnPreferenceClickListener(preference -> { categoryPreference.setOnPreferenceClickListener(preference -> {
CategoryPreferenceDialog.create().show(getParentFragmentManager(), CategoryPreferenceDialog.TAG); CategoryPreferenceDialog.create().show(getParentFragmentManager(), CategoryPreferenceDialog.TAG);
return false; return false;

View file

@ -55,7 +55,7 @@ public class SleepTimerDialog extends DialogFragment {
final int minutes = seekArcProgress; final int minutes = seekArcProgress;
PendingIntent pi = makeTimerPendingIntent(PendingIntent.FLAG_CANCEL_CURRENT); PendingIntent pi = makeTimerPendingIntent(PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);
final long nextSleepTimerElapsedTime = SystemClock.elapsedRealtime() + minutes * 60 * 1000; final long nextSleepTimerElapsedTime = SystemClock.elapsedRealtime() + minutes * 60 * 1000;
PreferenceUtil.getInstance(getActivity()).setNextSleepTimerElapsedRealtime(nextSleepTimerElapsedTime); PreferenceUtil.getInstance(getActivity()).setNextSleepTimerElapsedRealtime(nextSleepTimerElapsedTime);
@ -65,7 +65,7 @@ public class SleepTimerDialog extends DialogFragment {
Toast.makeText(getActivity(), requireActivity().getResources().getString(R.string.sleep_timer_set, minutes), Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), requireActivity().getResources().getString(R.string.sleep_timer_set, minutes), Toast.LENGTH_SHORT).show();
}) })
.onNeutral((dialog, which) -> { .onNeutral((dialog, which) -> {
final PendingIntent previous = makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE); final PendingIntent previous = makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE | PendingIntent.FLAG_IMMUTABLE);
if (previous != null) { if (previous != null) {
AlarmManager am = (AlarmManager) requireActivity().getSystemService(Context.ALARM_SERVICE); AlarmManager am = (AlarmManager) requireActivity().getSystemService(Context.ALARM_SERVICE);
am.cancel(previous); am.cancel(previous);
@ -80,7 +80,7 @@ public class SleepTimerDialog extends DialogFragment {
} }
}) })
.showListener(dialog -> { .showListener(dialog -> {
if (makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE) != null) { if (makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE | PendingIntent.FLAG_IMMUTABLE) != null) {
timerUpdater.start(); timerUpdater.start();
} }
}) })

View file

@ -269,7 +269,7 @@ public class MusicService extends Service implements SharedPreferences.OnSharedP
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON); Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(mediaButtonReceiverComponentName); mediaButtonIntent.setComponent(mediaButtonReceiverComponentName);
PendingIntent mediaButtonReceiverPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, mediaButtonIntent, 0); PendingIntent mediaButtonReceiverPendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, mediaButtonIntent, PendingIntent.FLAG_IMMUTABLE);
mediaSession = new MediaSessionCompat(this, getResources().getString(R.string.app_name), mediaButtonReceiverComponentName, mediaButtonReceiverPendingIntent); mediaSession = new MediaSessionCompat(this, getResources().getString(R.string.app_name), mediaButtonReceiverComponentName, mediaButtonReceiverPendingIntent);
mediaSession.setCallback(new MediaSessionCompat.Callback() { mediaSession.setCallback(new MediaSessionCompat.Callback() {

View file

@ -53,10 +53,10 @@ public class DownloadNotification {
this.maximum += maximum; this.maximum += maximum;
Intent action = new Intent(context, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); Intent action = new Intent(context, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent clickIntent = PendingIntent.getActivity(context, 0, action, 0); PendingIntent clickIntent = PendingIntent.getActivity(context, 0, action, PendingIntent.FLAG_IMMUTABLE);
Intent cancel = new Intent(context, DownloadService.class).setAction(DownloadService.ACTION_CANCEL); Intent cancel = new Intent(context, DownloadService.class).setAction(DownloadService.ACTION_CANCEL);
PendingIntent pendingCancel = PendingIntent.getService(context, 0, cancel, 0); PendingIntent pendingCancel = PendingIntent.getService(context, 0, cancel, PendingIntent.FLAG_IMMUTABLE);
NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle(); NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle();
for (Song item : songs.stream().limit(5).collect(Collectors.toList())) { for (Song item : songs.stream().limit(5).collect(Collectors.toList())) {

View file

@ -66,7 +66,7 @@ public class PlayingNotificationMarshmallow extends PlayingNotification {
Intent action = new Intent(service, MainActivity.class); Intent action = new Intent(service, MainActivity.class);
action.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); action.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
final PendingIntent clickIntent = PendingIntent.getActivity(service, 0, action, 0); final PendingIntent clickIntent = PendingIntent.getActivity(service, 0, action, PendingIntent.FLAG_IMMUTABLE);
final PendingIntent deleteIntent = buildPendingIntent(service, MusicService.ACTION_QUIT, null); final PendingIntent deleteIntent = buildPendingIntent(service, MusicService.ACTION_QUIT, null);
final Notification notification = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL_ID) final Notification notification = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL_ID)
@ -185,6 +185,6 @@ public class PlayingNotificationMarshmallow extends PlayingNotification {
Intent intent = new Intent(action); Intent intent = new Intent(action);
intent.setComponent(serviceName); intent.setComponent(serviceName);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
return PendingIntent.getService(context, 0, intent, 0); return PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} }
} }

View file

@ -41,12 +41,12 @@ public class PlayingNotificationNougat extends PlayingNotification {
Intent action = new Intent(service, MainActivity.class); Intent action = new Intent(service, MainActivity.class);
action.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); action.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
final PendingIntent clickIntent = PendingIntent.getActivity(service, 0, action, 0); final PendingIntent clickIntent = PendingIntent.getActivity(service, 0, action, PendingIntent.FLAG_IMMUTABLE);
final ComponentName serviceName = new ComponentName(service, MusicService.class); final ComponentName serviceName = new ComponentName(service, MusicService.class);
Intent intent = new Intent(MusicService.ACTION_QUIT); Intent intent = new Intent(MusicService.ACTION_QUIT);
intent.setComponent(serviceName); intent.setComponent(serviceName);
final PendingIntent deleteIntent = PendingIntent.getService(service, 0, intent, 0); final PendingIntent deleteIntent = PendingIntent.getService(service, 0, intent, PendingIntent.FLAG_IMMUTABLE);
final int bigNotificationImageSize = service.getResources().getDimensionPixelSize(R.dimen.notification_big_image_size); final int bigNotificationImageSize = service.getResources().getDimensionPixelSize(R.dimen.notification_big_image_size);
service.runOnUiThread(() -> CustomGlideRequest.Builder service.runOnUiThread(() -> CustomGlideRequest.Builder
@ -114,6 +114,6 @@ public class PlayingNotificationNougat extends PlayingNotification {
Intent intent = new Intent(action); Intent intent = new Intent(action);
intent.setComponent(serviceName); intent.setComponent(serviceName);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
return PendingIntent.getService(service, 0, intent, 0); return PendingIntent.getService(service, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} }
} }

View file

@ -101,6 +101,7 @@ public class LocalPlayer implements Playback {
.build(); .build();
exoPlayer.addListener(eventListener); exoPlayer.addListener(eventListener);
exoPlayer.setThrowsWhenUsingWrongThread(false);
exoPlayer.prepare(); exoPlayer.prepare();
long cacheSize = PreferenceUtil.getInstance(context).getMediaCacheSize(); long cacheSize = PreferenceUtil.getInstance(context).getMediaCacheSize();

View file

@ -227,11 +227,11 @@ public final class PreferenceUtil {
} }
public final boolean getColoredNotification() { public final boolean getColoredNotification() {
return mPreferences.getBoolean(COLORED_NOTIFICATION, true); return mPreferences.getBoolean(COLORED_NOTIFICATION, false);
} }
public final boolean getClassicNotification() { public final boolean getClassicNotification() {
return mPreferences.getBoolean(CLASSIC_NOTIFICATION, Build.VERSION.SDK_INT <= Build.VERSION_CODES.O); return mPreferences.getBoolean(CLASSIC_NOTIFICATION, false);
} }
public final boolean getColoredShortcuts() { public final boolean getColoredShortcuts() {
@ -255,11 +255,11 @@ public final class PreferenceUtil {
} }
public final boolean getShowAlbumCover() { public final boolean getShowAlbumCover() {
return mPreferences.getBoolean(SHOW_ALBUM_COVER, true); return mPreferences.getBoolean(SHOW_ALBUM_COVER, false);
} }
public final boolean getBlurAlbumCover() { public final boolean getBlurAlbumCover() {
return mPreferences.getBoolean(BLUR_ALBUM_COVER, true); return mPreferences.getBoolean(BLUR_ALBUM_COVER, false);
} }
public final SortOrder getAlbumSortOrder() { public final SortOrder getAlbumSortOrder() {

View file

@ -83,7 +83,7 @@ public abstract class BaseAppWidget extends AppWidgetProvider {
ComponentName serviceName = new ComponentName(context, MusicService.class); ComponentName serviceName = new ComponentName(context, MusicService.class);
Intent action = new Intent(context, MainActivity.class); Intent action = new Intent(context, MainActivity.class);
PendingIntent open = PendingIntent.getActivity(context, 0, action, 0); PendingIntent open = PendingIntent.getActivity(context, 0, action, PendingIntent.FLAG_IMMUTABLE);
for (int id : clickableViews) { for (int id : clickableViews) {
views.setOnClickPendingIntent(id, open); views.setOnClickPendingIntent(id, open);
@ -104,9 +104,9 @@ public abstract class BaseAppWidget extends AppWidgetProvider {
intent.setComponent(serviceName); intent.setComponent(serviceName);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
return PendingIntent.getForegroundService(context, 0, intent, 0); return PendingIntent.getForegroundService(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} else { } else {
return PendingIntent.getService(context, 0, intent, 0); return PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} }
} }

View file

@ -5,14 +5,14 @@
<SwitchPreference <SwitchPreference
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
android:defaultValue="true" android:defaultValue="false"
android:key="show_album_cover" android:key="show_album_cover"
android:summary="@string/pref_summary_show_album_art" android:summary="@string/pref_summary_show_album_art"
android:title="@string/pref_title_show_album_art" /> android:title="@string/pref_title_show_album_art" />
<SwitchPreference <SwitchPreference
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
android:defaultValue="true" android:defaultValue="false"
android:dependency="show_album_cover" android:dependency="show_album_cover"
android:key="blur_album_cover" android:key="blur_album_cover"
android:summary="@string/pref_summary_blur_album_art" android:summary="@string/pref_summary_blur_album_art"

View file

@ -5,14 +5,14 @@
<SwitchPreference <SwitchPreference
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
android:defaultValue="true" android:defaultValue="false"
android:key="classic_notification" android:key="classic_notification"
android:summary="@string/pref_summary_classic_notification" android:summary="@string/pref_summary_classic_notification"
android:title="@string/pref_title_classic_notification" /> android:title="@string/pref_title_classic_notification" />
<SwitchPreference <SwitchPreference
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
android:defaultValue="true" android:defaultValue="false"
android:key="colored_notification" android:key="colored_notification"
android:summary="@string/pref_summary_colored_notification" android:summary="@string/pref_summary_colored_notification"
android:title="@string/pref_title_colored_notification" /> android:title="@string/pref_title_colored_notification" />

View file

@ -5,9 +5,9 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.0.0' classpath 'com.android.tools.build:gradle:7.2.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21' classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'
} }
} }

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip