some music fixes
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user