mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Fix recipient prefrence display problem on Android P.
Android P's new ringtone selector is a whole new activity that can cause RecipientPreferenceActivity to go through the full onCreate() flow after the ringtone selection. This could cause a race between setting the preference and reading the preference from the notification channel. Just threw them on a serial executor to guarantee ordering.
This commit is contained in:
parent
4a0ea0c51c
commit
0dd7b39bb1
@ -282,7 +282,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
|||||||
db.setMessageVibrate(recipient, NotificationChannels.getMessageVibrate(context, recipient) ? VibrateState.ENABLED : VibrateState.DISABLED);
|
db.setMessageVibrate(recipient, NotificationChannels.getMessageVibrate(context, recipient) ? VibrateState.ENABLED : VibrateState.DISABLED);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}.execute();
|
}.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
customNotificationsPref.setVisible(false);
|
customNotificationsPref.setVisible(false);
|
||||||
@ -493,7 +493,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, value);
|
}.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, value);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -562,7 +562,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
}.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user