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:
Greyson Parrelli 2018-10-20 22:42:35 -07:00
parent 4a0ea0c51c
commit 0dd7b39bb1

View File

@ -282,7 +282,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
db.setMessageVibrate(recipient, NotificationChannels.getMessageVibrate(context, recipient) ? VibrateState.ENABLED : VibrateState.DISABLED);
return null;
}
}.execute();
}.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
}
} else {
customNotificationsPref.setVisible(false);
@ -493,7 +493,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
}
return null;
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, value);
}.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR, value);
return false;
}
@ -562,7 +562,7 @@ public class RecipientPreferenceActivity extends PassphraseRequiredActionBarActi
}
return null;
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}.executeOnExecutor(AsyncTask.SERIAL_EXECUTOR);
return false;
}