some music fixes

This commit is contained in:
gdlbo
2022-07-06 11:40:02 +03:00
parent 39dae8f8e8
commit 837a888b37
3 changed files with 6 additions and 17 deletions
@@ -23,8 +23,7 @@ public class OTADownloader{
@Override @Override
public void onReceive(Context context, Intent intent){ public void onReceive(Context context, Intent intent){
var extras = intent.getExtras(); var extras = intent.getExtras();
if(extras == null if(extras == null || !intent.getAction().equals(DownloadManager.ACTION_DOWNLOAD_COMPLETE))
|| !intent.getAction().equals(DownloadManager.ACTION_DOWNLOAD_COMPLETE))
return; return;
var query = new DownloadManager.Query(); var query = new DownloadManager.Query();
@@ -317,22 +317,12 @@ public class Globals{
} // Network check } // Network check
public static void fixGapps(){ public static void fixGapps(){
try { if(Build.VERSION.SDK_INT >= 26){
if(Build.VERSION.SDK_INT >= 26){ NotificationManager notificationManager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
NotificationManager notificationManager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
boolean hasMusicChannel = false;
try { if(notificationManager.getNotificationChannel("audio_playback_channel") == null){
if(notificationManager.getNotificationChannel("audio_playback_channel") != null){ notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", getResources().getString(getIdentifier("audio_message_play_error", "string")), NotificationManager.IMPORTANCE_LOW));
hasMusicChannel = true;
}
} catch (Exception ignored) {
}
if(!hasMusicChannel){
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", getResources().getString(getIdentifier("audio_message_play_error", "string")), NotificationManager.IMPORTANCE_LOW));
}
} }
} catch (Exception ignored) {
} }
} // Music channels fix } // Music channels fix
@@ -36,7 +36,7 @@ public class Preferences{
public static SharedPreferences preferences = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE); public static SharedPreferences preferences = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
public static String VERSIONNAME = "Beta"; public static String VERSIONNAME = "Beta";
public static void init(Application application){ public static void init(Application application) throws Exception{
setupFilters(); setupFilters();
fixGapps(); fixGapps();
setProxy(); setProxy();