Я создаю приложение, которое записывает GPS-трек. На некоторых устройствах есть проблема (Google Pixel 4a, Android 14) что приложение вылетает после долгой работы (~4 часа)
Сначала думал, что проблема в энергосбережение, я добавил это в AndroidManifest REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
Но проблема не исчезла. На данный момент известно, что оно появляется в основном на Android 14; на версиях = Build.VERSION_CODES.O) {
CharSequence name = CHANNEL_ID;
String description = "coords";
int importance = NotificationManager.IMPORTANCE_LOW;
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
channel.setDescription(description);
channel.setSound(null, null);
NotificationManager notificationManager = this.getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
}
}
private void checkPremissions(){
//code
}
}
Разрешения
Сервис
Подробнее здесь: https://stackoverflow.com/questions/785 ... me-4-hours