fix(android): harden VPN runtime integration
This commit is contained in:
1 parent
e15744db99
commit
9f248eb218
6 files changed
+233
-276
No files matched your search
@@ -16,16 +16,17 @@ class NotificationService {
|
||||
/// Sets the notification's content text to [text].
|
||||
///
|
||||
/// The native side rebuilds the whole notification, so skip the round-trip
|
||||
/// when the text has not changed.
|
||||
/// when the text has not changed. A failed native update is intentionally
|
||||
/// not cached so the next tick can retry it.
|
||||
static Future<void> updateTimer(String text) async {
|
||||
if (text == _lastText) return;
|
||||
_lastText = text;
|
||||
try {
|
||||
await _channel.invokeMethod<void>('updateNotificationText', {
|
||||
'title': 'Revolt VPN',
|
||||
'text': text,
|
||||
'disconnectLabel': 'Disconnect',
|
||||
});
|
||||
_lastText = text;
|
||||
} catch (_) {
|
||||
// Cosmetic.
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user