Skip to content

Commit

Permalink
dependency updates and compatibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dkanada committed Aug 27, 2022
1 parent 344a877 commit fb3102c
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
with:
arguments: assemble
gradle-version: 7.0.2
gradle-version: 7.3.3
- name: Move
run: mv app/build/outputs/apk/release/*.apk gelli-release-${version}.apk
env:
Expand Down
36 changes: 18 additions & 18 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 30
compileSdkVersion 32

defaultConfig {
minSdkVersion 19
targetSdkVersion 30
targetSdkVersion 32

versionCode 16
versionName '1.3.3'
Expand Down Expand Up @@ -44,41 +44,41 @@ android {
viewBinding true
}

lintOptions {
lint {
disable 'MissingTranslation'
abortOnError false
}

compileOptions {
coreLibraryDesugaringEnabled true

sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.21'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1'

implementation 'com.github.jellyfin.jellyfin-apiclient-java:android:0.7.3'
implementation 'com.github.woltapp:blurhash:f41a23cc50'
implementation 'com.google.android.exoplayer:exoplayer:2.12.2'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.android.exoplayer:exoplayer:2.14.2'
implementation 'com.google.android.material:material:1.6.1'

implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.media:media:1.4.1'
implementation 'androidx.fragment:fragment-ktx:1.3.6'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.media:media:1.6.0'
implementation 'androidx.fragment:fragment-ktx:1.5.2'
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.gridlayout:gridlayout:1.0.0'
implementation 'androidx.cardview:cardview: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.preference:preference-ktx:1.1.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

implementation 'com.github.kabouzeid:RecyclerView-FastScroll:1.0.16-kmod'
implementation 'com.github.kabouzeid:SeekArc:1.2-kmod'
Expand All @@ -101,8 +101,8 @@ dependencies {

coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

annotationProcessor 'androidx.room:room-compiler:2.3.0'
implementation 'androidx.room:room-runtime:2.3.0'
annotationProcessor 'androidx.room:room-compiler:2.4.3'
implementation 'androidx.room:room-runtime:2.4.3'

annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'com.github.bumptech.glide:annotations:4.12.0'
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<activity android:name=".activities.details.GenreDetailActivity" />
<activity android:name=".activities.details.PlaylistDetailActivity" />
<activity android:name=".activities.SearchActivity" />
<activity android:name=".activities.SplashActivity">
<activity android:name=".activities.SplashActivity" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MUSIC_PLAYER" />
Expand Down Expand Up @@ -70,7 +70,7 @@
<service android:name=".service.LoginService" />
<service android:name=".service.MusicService" />

<receiver android:name=".service.receivers.MediaButtonIntentReceiver">
<receiver android:name=".service.receivers.MediaButtonIntentReceiver" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
Expand All @@ -83,7 +83,7 @@
android:name="com.lge.support.SPLIT_WINDOW"
android:value="true" />

<receiver android:name=".views.widgets.BootReceiver">
<receiver android:name=".views.widgets.BootReceiver" android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,18 @@ private void invalidateSettings() {

if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
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);
}

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 -> {
CategoryPreferenceDialog.create().show(getParentFragmentManager(), CategoryPreferenceDialog.TAG);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {

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;
PreferenceUtil.getInstance(getActivity()).setNextSleepTimerElapsedRealtime(nextSleepTimerElapsedTime);
Expand All @@ -65,7 +65,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
Toast.makeText(getActivity(), requireActivity().getResources().getString(R.string.sleep_timer_set, minutes), Toast.LENGTH_SHORT).show();
})
.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) {
AlarmManager am = (AlarmManager) requireActivity().getSystemService(Context.ALARM_SERVICE);
am.cancel(previous);
Expand All @@ -80,7 +80,7 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
}
})
.showListener(dialog -> {
if (makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE) != null) {
if (makeTimerPendingIntent(PendingIntent.FLAG_NO_CREATE | PendingIntent.FLAG_IMMUTABLE) != null) {
timerUpdater.start();
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ private void initMediaSession() {
Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
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.setCallback(new MediaSessionCompat.Callback() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ public synchronized void update(int current, int maximum) {
this.maximum += maximum;

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);
PendingIntent pendingCancel = PendingIntent.getService(context, 0, cancel, 0);
PendingIntent pendingCancel = PendingIntent.getService(context, 0, cancel, PendingIntent.FLAG_IMMUTABLE);

NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle();
for (Song item : songs.stream().limit(5).collect(Collectors.toList())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public synchronized void update() {

Intent action = new Intent(service, MainActivity.class);
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 Notification notification = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL_ID)
Expand Down Expand Up @@ -185,6 +185,6 @@ private PendingIntent buildPendingIntent(Context context, final String action, f
Intent intent = new Intent(action);
intent.setComponent(serviceName);
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public synchronized void update() {

Intent action = new Intent(service, MainActivity.class);
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);
Intent intent = new Intent(MusicService.ACTION_QUIT);
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);
service.runOnUiThread(() -> CustomGlideRequest.Builder
Expand Down Expand Up @@ -114,6 +114,6 @@ private PendingIntent retrievePlaybackAction(final String action) {
Intent intent = new Intent(action);
intent.setComponent(serviceName);
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public LocalPlayer(Context context) {
.build();

exoPlayer.addListener(eventListener);
exoPlayer.setThrowsWhenUsingWrongThread(false);
exoPlayer.prepare();

long cacheSize = PreferenceUtil.getInstance(context).getMediaCacheSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ public void setNowPlayingScreen(NowPlayingScreen nowPlayingScreen) {
}

public final boolean getColoredNotification() {
return mPreferences.getBoolean(COLORED_NOTIFICATION, true);
return mPreferences.getBoolean(COLORED_NOTIFICATION, false);
}

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() {
Expand All @@ -255,11 +255,11 @@ public final boolean getRememberQueue() {
}

public final boolean getShowAlbumCover() {
return mPreferences.getBoolean(SHOW_ALBUM_COVER, true);
return mPreferences.getBoolean(SHOW_ALBUM_COVER, false);
}

public final boolean getBlurAlbumCover() {
return mPreferences.getBoolean(BLUR_ALBUM_COVER, true);
return mPreferences.getBoolean(BLUR_ALBUM_COVER, false);
}

public final SortOrder getAlbumSortOrder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected void linkButtons(Context context, RemoteViews views, Integer... clicka
ComponentName serviceName = new ComponentName(context, MusicService.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) {
views.setOnClickPendingIntent(id, open);
Expand All @@ -104,9 +104,9 @@ protected PendingIntent buildPendingIntent(Context context, final String action,

intent.setComponent(serviceName);
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 {
return PendingIntent.getService(context, 0, intent, 0);
return PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/xml/pref_lock_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="true"
android:defaultValue="false"
android:key="show_album_cover"
android:summary="@string/pref_summary_show_album_art"
android:title="@string/pref_title_show_album_art" />

<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="true"
android:defaultValue="false"
android:dependency="show_album_cover"
android:key="blur_album_cover"
android:summary="@string/pref_summary_blur_album_art"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/xml/pref_notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="true"
android:defaultValue="false"
android:key="classic_notification"
android:summary="@string/pref_summary_classic_notification"
android:title="@string/pref_title_classic_notification" />

<SwitchPreference
app:iconSpaceReserved="false"
android:defaultValue="true"
android:defaultValue="false"
android:key="colored_notification"
android:summary="@string/pref_summary_colored_notification"
android:title="@string/pref_title_colored_notification" />
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ buildscript {
}

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 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10'
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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

0 comments on commit fb3102c

Please sign in to comment.