make SDK33 happy

We have to upgrade the minsdk level to android 8 - which was released in 2017; 5 years ago.
This commit is contained in:
Adrian Ulrich 2022-09-05 21:18:24 +02:00
parent fcb0941e7b
commit c3175f756d
10 changed files with 59 additions and 46 deletions

View File

@ -29,8 +29,8 @@ android {
dependencies { dependencies {
implementation 'androidx.legacy:legacy-support-core-ui:1.0.0' implementation 'androidx.legacy:legacy-support-core-ui:1.0.0'
implementation 'androidx.media:media:1.2.1' implementation 'androidx.media:media:1.6.0'
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.6.1'
implementation 'junit:junit:4.12' implementation 'junit:junit:4.12'
compileOnly 'androidx.annotation:annotation:1.0.0' compileOnly 'androidx.annotation:annotation:1.0.0'
} }

View File

@ -69,6 +69,7 @@ THE SOFTWARE.
<activity <activity
android:name="LibraryActivity" android:name="LibraryActivity"
android:theme="@style/Library" android:theme="@style/Library"
android:exported="true"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -93,7 +94,8 @@ THE SOFTWARE.
android:launchMode="singleInstance" /> android:launchMode="singleInstance" />
<receiver <receiver
android:name=".OneCellWidget" android:name=".OneCellWidget"
android:label="Vanilla Music 1x1"> android:label="Vanilla Music 1x1"
android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </intent-filter>
@ -103,7 +105,8 @@ THE SOFTWARE.
</receiver> </receiver>
<receiver <receiver
android:name=".FourLongWidget" android:name=".FourLongWidget"
android:label="Vanilla Music 4x1 A"> android:label="Vanilla Music 4x1 A"
android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </intent-filter>
@ -113,7 +116,8 @@ THE SOFTWARE.
</receiver> </receiver>
<receiver <receiver
android:name=".FourWhiteWidget" android:name=".FourWhiteWidget"
android:label="Vanilla Music 4x1 White"> android:label="Vanilla Music 4x1 White"
android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </intent-filter>
@ -123,7 +127,8 @@ THE SOFTWARE.
</receiver> </receiver>
<receiver <receiver
android:name=".WidgetE" android:name=".WidgetE"
android:label="Vanilla Music 4x1 B"> android:label="Vanilla Music 4x1 B"
android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </intent-filter>
@ -133,7 +138,8 @@ THE SOFTWARE.
</receiver> </receiver>
<receiver <receiver
android:name=".FourSquareWidget" android:name=".FourSquareWidget"
android:label="Vanilla Music 2x2 A"> android:label="Vanilla Music 2x2 A"
android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </intent-filter>
@ -143,7 +149,8 @@ THE SOFTWARE.
</receiver> </receiver>
<receiver <receiver
android:name=".WidgetD" android:name=".WidgetD"
android:label="Vanilla Music 2x2 B"> android:label="Vanilla Music 2x2 B"
android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </intent-filter>
@ -151,12 +158,14 @@ THE SOFTWARE.
android:name="android.appwidget.provider" android:name="android.appwidget.provider"
android:resource="@xml/widget_d" /> android:resource="@xml/widget_d" />
</receiver> </receiver>
<receiver android:name="MediaButtonReceiver" > <receiver android:name="MediaButtonReceiver"
android:exported="true">
<intent-filter android:priority="999"> <intent-filter android:priority="999">
<action android:name="android.intent.action.MEDIA_BUTTON" /> <action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter> </intent-filter>
</receiver> </receiver>
<service android:name="PlaybackService"> <service android:name="PlaybackService"
android:exported="false">
<intent-filter> <intent-filter>
<action android:name="ch.blinkenlights.android.vanilla.action.PLAY" /> <action android:name="ch.blinkenlights.android.vanilla.action.PLAY" />
<action android:name="ch.blinkenlights.android.vanilla.action.PAUSE" /> <action android:name="ch.blinkenlights.android.vanilla.action.PAUSE" />
@ -187,14 +196,17 @@ THE SOFTWARE.
<activity <activity
android:name="ShortcutPseudoActivity" android:name="ShortcutPseudoActivity"
android:theme="@android:style/Theme.Translucent.NoTitleBar"> android:theme="@android:style/Theme.Translucent.NoTitleBar"
android:exported="false">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN"/> <action android:name="android.intent.action.MAIN"/>
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="AudioPickerActivity" android:theme="@style/PopupDialog" <activity android:name="AudioPickerActivity"
android:excludeFromRecents="true" android:exported="true" > android:theme="@style/PopupDialog"
android:excludeFromRecents="true"
android:exported="true" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
@ -218,6 +230,7 @@ THE SOFTWARE.
</activity> </activity>
<activity android:name="AudioSearchActivity" android:theme="@style/PopupDialog" <activity android:name="AudioSearchActivity" android:theme="@style/PopupDialog"
android:exported="true"
android:excludeFromRecents="true"> android:excludeFromRecents="true">
<intent-filter> <intent-filter>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" /> <action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH" />

View File

@ -127,16 +127,16 @@ public class FourLongWidget extends AppWidgetProvider {
int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME; int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME;
intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN); intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.cover, pendingIntent); views.setOnClickPendingIntent(R.id.cover, pendingIntent);
views.setOnClickPendingIntent(R.id.text_layout, pendingIntent); views.setOnClickPendingIntent(R.id.text_layout, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.next, pendingIntent); views.setOnClickPendingIntent(R.id.next, pendingIntent);
manager.updateAppWidget(new ComponentName(context, FourLongWidget.class), views); manager.updateAppWidget(new ComponentName(context, FourLongWidget.class), views);

View File

@ -129,16 +129,16 @@ public class FourSquareWidget extends AppWidgetProvider {
int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME; int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME;
intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN); intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.title, pendingIntent); views.setOnClickPendingIntent(R.id.title, pendingIntent);
views.setOnClickPendingIntent(R.id.artist, pendingIntent); views.setOnClickPendingIntent(R.id.artist, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.next, pendingIntent); views.setOnClickPendingIntent(R.id.next, pendingIntent);
manager.updateAppWidget(new ComponentName(context, FourSquareWidget.class), views); manager.updateAppWidget(new ComponentName(context, FourSquareWidget.class), views);

View File

@ -131,20 +131,20 @@ public class FourWhiteWidget extends AppWidgetProvider {
int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME; int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME;
intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN); intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.cover, pendingIntent); views.setOnClickPendingIntent(R.id.cover, pendingIntent);
views.setOnClickPendingIntent(R.id.text_layout, pendingIntent); views.setOnClickPendingIntent(R.id.text_layout, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.next, pendingIntent); views.setOnClickPendingIntent(R.id.next, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_PREVIOUS_SONG); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_PREVIOUS_SONG);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.previous, pendingIntent); views.setOnClickPendingIntent(R.id.previous, pendingIntent);
manager.updateAppWidget(new ComponentName(context, FourWhiteWidget.class), views); manager.updateAppWidget(new ComponentName(context, FourWhiteWidget.class), views);

View File

@ -103,11 +103,11 @@ public class OneCellWidget extends AppWidgetProvider {
int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME; int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME;
intent = ShortcutPseudoActivity.getIntent(context, doubleTap ? PlaybackService.ACTION_TOGGLE_PLAYBACK_DELAYED : PlaybackService.ACTION_TOGGLE_PLAYBACK); intent = ShortcutPseudoActivity.getIntent(context, doubleTap ? PlaybackService.ACTION_TOGGLE_PLAYBACK_DELAYED : PlaybackService.ACTION_TOGGLE_PLAYBACK);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, doubleTap ? PlaybackService.ACTION_NEXT_SONG_DELAYED : PlaybackService.ACTION_NEXT_SONG); intent = ShortcutPseudoActivity.getIntent(context, doubleTap ? PlaybackService.ACTION_NEXT_SONG_DELAYED : PlaybackService.ACTION_NEXT_SONG);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.next, pendingIntent); views.setOnClickPendingIntent(R.id.next, pendingIntent);

View File

@ -2088,11 +2088,11 @@ public final class PlaybackService extends Service
case NOT_ACTION_NEXT_SONG: { case NOT_ACTION_NEXT_SONG: {
Intent intent = new Intent(this, PlaybackService.class); Intent intent = new Intent(this, PlaybackService.class);
intent.setAction(PlaybackService.ACTION_NEXT_SONG_AUTOPLAY); intent.setAction(PlaybackService.ACTION_NEXT_SONG_AUTOPLAY);
return PendingIntent.getService(this, 0, intent, 0); return PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} }
case NOT_ACTION_MINI_ACTIVITY: { case NOT_ACTION_MINI_ACTIVITY: {
Intent intent = new Intent(this, MiniPlaybackActivity.class); Intent intent = new Intent(this, MiniPlaybackActivity.class);
return PendingIntent.getActivity(this, 0, intent, 0); return PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} }
default: default:
Log.w("VanillaMusic", "Unknown value for notification_action. Defaulting to 0."); Log.w("VanillaMusic", "Unknown value for notification_action. Defaulting to 0.");
@ -2100,12 +2100,12 @@ public final class PlaybackService extends Service
case NOT_ACTION_MAIN_ACTIVITY: { case NOT_ACTION_MAIN_ACTIVITY: {
Intent intent = new Intent(this, LibraryActivity.class); Intent intent = new Intent(this, LibraryActivity.class);
intent.setAction(Intent.ACTION_MAIN); intent.setAction(Intent.ACTION_MAIN);
return PendingIntent.getActivity(this, 0, intent, 0); return PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} }
case NOT_ACTION_FULL_ACTIVITY: { case NOT_ACTION_FULL_ACTIVITY: {
Intent intent = new Intent(this, FullPlaybackActivity.class); Intent intent = new Intent(this, FullPlaybackActivity.class);
intent.setAction(Intent.ACTION_MAIN); intent.setAction(Intent.ACTION_MAIN);
return PendingIntent.getActivity(this, 0, intent, 0); return PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE);
} }
} }
} }
@ -2146,11 +2146,11 @@ public final class PlaybackService extends Service
.setSubText(song.artist) .setSubText(song.artist)
.setContentIntent(mNotificationAction) .setContentIntent(mNotificationAction)
.addAction(new NotificationCompat.Action(R.drawable.previous, .addAction(new NotificationCompat.Action(R.drawable.previous,
getString(R.string.previous_song), PendingIntent.getService(this, 0, previous, 0))) getString(R.string.previous_song), PendingIntent.getService(this, 0, previous, PendingIntent.FLAG_IMMUTABLE)))
.addAction(new NotificationCompat.Action(playButton, .addAction(new NotificationCompat.Action(playButton,
getString(R.string.play_pause), PendingIntent.getService(this, 0, playPause, 0))) getString(R.string.play_pause), PendingIntent.getService(this, 0, playPause, PendingIntent.FLAG_IMMUTABLE)))
.addAction(new NotificationCompat.Action(R.drawable.next, .addAction(new NotificationCompat.Action(R.drawable.next,
getString(R.string.next_song), PendingIntent.getService(this, 0, next, 0))) getString(R.string.next_song), PendingIntent.getService(this, 0, next, PendingIntent.FLAG_IMMUTABLE)))
.setStyle(new androidx.media.app.NotificationCompat.MediaStyle() .setStyle(new androidx.media.app.NotificationCompat.MediaStyle()
.setMediaSession(mMediaSessionTracker.getSessionToken()) .setMediaSession(mMediaSessionTracker.getSessionToken())
.setShowActionsInCompactView(0, 1, 2)) .setShowActionsInCompactView(0, 1, 2))

View File

@ -124,27 +124,27 @@ public class WidgetD extends AppWidgetProvider {
int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME; int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME;
intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN); intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.cover, pendingIntent); views.setOnClickPendingIntent(R.id.cover, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.next, pendingIntent); views.setOnClickPendingIntent(R.id.next, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_PREVIOUS_SONG); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_PREVIOUS_SONG);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.previous, pendingIntent); views.setOnClickPendingIntent(R.id.previous, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_SHUFFLE); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_SHUFFLE);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.shuffle, pendingIntent); views.setOnClickPendingIntent(R.id.shuffle, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_REPEAT); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_REPEAT);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.end_action, pendingIntent); views.setOnClickPendingIntent(R.id.end_action, pendingIntent);
manager.updateAppWidget(new ComponentName(context, WidgetD.class), views); manager.updateAppWidget(new ComponentName(context, WidgetD.class), views);

View File

@ -114,28 +114,28 @@ public class WidgetE extends AppWidgetProvider {
int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME; int flags = Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME;
intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN); intent = new Intent(context, LibraryActivity.class).setAction(Intent.ACTION_MAIN);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.title, pendingIntent); views.setOnClickPendingIntent(R.id.title, pendingIntent);
views.setOnClickPendingIntent(R.id.artist, pendingIntent); views.setOnClickPendingIntent(R.id.artist, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_TOGGLE_PLAYBACK);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.play_pause, pendingIntent); views.setOnClickPendingIntent(R.id.play_pause, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_NEXT_SONG);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.next, pendingIntent); views.setOnClickPendingIntent(R.id.next, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_PREVIOUS_SONG); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_PREVIOUS_SONG);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.previous, pendingIntent); views.setOnClickPendingIntent(R.id.previous, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_SHUFFLE); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_SHUFFLE);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.shuffle, pendingIntent); views.setOnClickPendingIntent(R.id.shuffle, pendingIntent);
intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_REPEAT); intent = ShortcutPseudoActivity.getIntent(context, PlaybackService.ACTION_CYCLE_REPEAT);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE);
views.setOnClickPendingIntent(R.id.end_action, pendingIntent); views.setOnClickPendingIntent(R.id.end_action, pendingIntent);
manager.updateAppWidget(new ComponentName(context, WidgetE.class), views); manager.updateAppWidget(new ComponentName(context, WidgetE.class), views);

View File

@ -16,5 +16,5 @@ allprojects {
ext { ext {
compileSdkVersion = 33 compileSdkVersion = 33
targetSdkVersion = 33 targetSdkVersion = 33
minSdkVersion = 15 minSdkVersion = 26
} }