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.
This commit is contained in:
Greyson Parrelli
2022-03-07 09:58:48 -05:00
committed by Alex Hart
parent 8a75d78ce7
commit c0e1507ef4

View File

@@ -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) {