Don't cancel KeyCachingService if not necessary.

This relates to #12043. There's some xiaomi-specific issue, and this
code was causing a pending intent creation on every app startup,
preventing it from opening. This call shouldn't be necessary unless
screenlock is active.
fork-5.53.8
Greyson Parrelli 2022-03-07 09:58:48 -05:00 zatwierdzone przez Alex Hart
rodzic 8a75d78ce7
commit c0e1507ef4
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -103,7 +103,9 @@ public class KeyCachingService extends Service {
}
public static void onAppForegrounded(@NonNull Context context) {
ServiceUtil.getAlarmManager(context).cancel(buildExpirationPendingIntent(context));
if (TextSecurePreferences.isScreenLockEnabled(context) || !TextSecurePreferences.isPasswordDisabled(context)) {
ServiceUtil.getAlarmManager(context).cancel(buildExpirationPendingIntent(context));
}
}
public static void onAppBackgrounded(@NonNull Context context) {