some music fixes
This commit is contained in:
@@ -23,8 +23,7 @@ public class OTADownloader{
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent){
|
||||
var extras = intent.getExtras();
|
||||
if(extras == null
|
||||
|| !intent.getAction().equals(DownloadManager.ACTION_DOWNLOAD_COMPLETE))
|
||||
if(extras == null || !intent.getAction().equals(DownloadManager.ACTION_DOWNLOAD_COMPLETE))
|
||||
return;
|
||||
|
||||
var query = new DownloadManager.Query();
|
||||
|
||||
@@ -317,22 +317,12 @@ public class Globals{
|
||||
} // Network check
|
||||
|
||||
public static void fixGapps(){
|
||||
try {
|
||||
if(Build.VERSION.SDK_INT >= 26){
|
||||
NotificationManager notificationManager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
boolean hasMusicChannel = false;
|
||||
if(Build.VERSION.SDK_INT >= 26){
|
||||
NotificationManager notificationManager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
|
||||
try {
|
||||
if(notificationManager.getNotificationChannel("audio_playback_channel") != null){
|
||||
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));
|
||||
}
|
||||
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));
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
} // 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 String VERSIONNAME = "Beta";
|
||||
|
||||
public static void init(Application application){
|
||||
public static void init(Application application) throws Exception{
|
||||
setupFilters();
|
||||
fixGapps();
|
||||
setProxy();
|
||||
|
||||
Reference in New Issue
Block a user