Skip to content
Snippets Groups Projects
Commit 6e5709d9 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

preferences: fix ringtone size check, increase limit

Change-Id: Ib3d6a608ca1791291aa1f572ddcf8a4ff9abe1db
parent d502b0fd
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,7 @@ public class MediaPreferencePresenter extends RootPresenter<MediaPreferenceView>
public static final String MPEG3 = "audio/mpeg3";
public static final String XMPEG3 = "audio/x-mpeg-3";
public static final int MAX_SIZE_RINGTONE = 800;
public static final int MAX_SIZE_RINGTONE = 64 * 1024;
protected AccountService mAccountService;
protected DeviceRuntimeService mDeviceRuntimeService;
......@@ -74,10 +74,12 @@ public class MediaPreferencePresenter extends RootPresenter<MediaPreferenceView>
void init(String accountId) {
mAccount = mAccountService.getAccount(accountId);
mCompositeDisposable.clear();
mCompositeDisposable.add(mAccountService.getObservableAccount(accountId)
.subscribe(account -> mCompositeDisposable.add(mAccountService.getCodecList(accountId)
mCompositeDisposable.add(mAccountService
.getObservableAccount(accountId)
.switchMapSingle(account -> mAccountService
.getCodecList(accountId)
.observeOn(mUiScheduler)
.subscribe(codecList -> {
.doOnSuccess(codecList -> {
final ArrayList<Codec> audioCodec = new ArrayList<>();
final ArrayList<Codec> videoCodec = new ArrayList<>();
for (Codec codec : codecList) {
......@@ -88,7 +90,8 @@ public class MediaPreferencePresenter extends RootPresenter<MediaPreferenceView>
}
}
getView().accountChanged(account, audioCodec, videoCodec);
}))));
}))
.subscribe());
}
void onFileFound(String type, String path) {
......
......@@ -94,7 +94,7 @@
<string name="permission_dialog_camera_message">Les conversations vidéos requièrent les droits d\'accès à la caméra pour fonctionner. S.v.p. envisager d\'octroyer ces droits.</string>
<string name="ringtone_error_title">Erreur</string>
<string name="ringtone_error_format_not_supported">Ce format n\'est pas supporté.</string>
<string name="ringtone_error_size_too_big">Ce fichier est trop volumineux. Le volume maximal accepté est de %1$ikB</string>
<string name="ringtone_error_size_too_big">Ce fichier est trop volumineux. Le volume maximal accepté est de %1$dkB</string>
<!--Read contacts permission-->
<string name="permission_dialog_read_contacts_message">Ring requiert les droits de lecture des contacts pour activer cette fonction. S.v.p. les accorder.</string>
<!--Write call log permission-->
......
......@@ -105,7 +105,7 @@
<string name="permission_dialog_camera_message">Les conversation vidéo nécessitent la permission d\'utiliser l\'objectif. Merci de l\'autoriser.</string>
<string name="ringtone_error_title">Erreur</string>
<string name="ringtone_error_format_not_supported">Ce format de fichier n\'est pas supporté.</string>
<string name="ringtone_error_size_too_big">Ce fichier est trop gros. La taille maximale est de %1$iko.</string>
<string name="ringtone_error_size_too_big">Ce fichier est trop gros. La taille maximale est de %1$dko.</string>
<!--Read contacts permission-->
<string name="permission_dialog_read_contacts_message">Ring a besoin d\'accéder en lecture à votre liste de contact. SVP autorisez-le.</string>
<!--Write call log permission-->
......
......@@ -152,7 +152,7 @@ along with this program; if not, write to the Free Software
<string name="permission_dialog_camera_message">Video conversations require the camera permission to work. Please consider enabling it.</string>
<string name="ringtone_error_title">Error</string>
<string name="ringtone_error_format_not_supported">This format is not supported.</string>
<string name="ringtone_error_size_too_big">This file is too big. The maximum size is %1$ikB.</string>
<string name="ringtone_error_size_too_big">This file is too big. The maximum size is %1$dkB.</string>
<!-- Read contacts permission -->
<string name="permission_dialog_read_contacts_message">Ring needs the "Read contacts" permission to enable this feature. Please grant it.</string>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment