mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-08 09:18:39 +01:00
Specify exported status and PendingIntent mutability.
Also reduce shake sampling frequency, add coarse location permission. Random things for targetSdk 32.
This commit is contained in:
committed by
Cody Henthorne
parent
2566d6f61f
commit
b9f4dc3fe9
@@ -155,7 +155,8 @@
|
|||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
|
||||||
<activity android:name=".DeviceProvisioningActivity"
|
<activity android:name=".DeviceProvisioningActivity"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
@@ -181,10 +182,10 @@
|
|||||||
|
|
||||||
<activity android:name=".sharing.v2.ShareActivity"
|
<activity android:name=".sharing.v2.ShareActivity"
|
||||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||||
|
android:exported="true"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:taskAffinity=""
|
android:taskAffinity=""
|
||||||
android:windowSoftInputMode="stateHidden"
|
android:windowSoftInputMode="stateHidden"
|
||||||
android:exported="true"
|
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEND" />
|
<action android:name="android.intent.action.SEND" />
|
||||||
@@ -212,13 +213,14 @@
|
|||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name=".stickers.StickerPackPreviewActivity"
|
<activity android:name=".stickers.StickerPackPreviewActivity"
|
||||||
|
android:exported="true"
|
||||||
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:windowSoftInputMode="stateHidden"
|
android:windowSoftInputMode="stateHidden"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" android:exported="true" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<data android:scheme="sgnl"
|
<data android:scheme="sgnl"
|
||||||
@@ -255,6 +257,7 @@
|
|||||||
</activity-alias>
|
</activity-alias>
|
||||||
|
|
||||||
<activity android:name=".deeplinks.DeepLinkEntryActivity"
|
<activity android:name=".deeplinks.DeepLinkEntryActivity"
|
||||||
|
android:exported="true"
|
||||||
android:noHistory="true"
|
android:noHistory="true"
|
||||||
android:theme="@style/Signal.Transparent">
|
android:theme="@style/Signal.Transparent">
|
||||||
|
|
||||||
@@ -386,10 +389,12 @@
|
|||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
|
||||||
<activity android:name=".verify.VerifyIdentityActivity"
|
<activity android:name=".verify.VerifyIdentityActivity"
|
||||||
|
android:exported="false"
|
||||||
android:theme="@style/Signal.DayNight.NoActionBar"
|
android:theme="@style/Signal.DayNight.NoActionBar"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
|
||||||
<activity android:name=".components.settings.app.AppSettingsActivity"
|
<activity android:name=".components.settings.app.AppSettingsActivity"
|
||||||
|
android:exported="true"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
|
||||||
android:theme="@style/Signal.DayNight.NoActionBar"
|
android:theme="@style/Signal.DayNight.NoActionBar"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:windowSoftInputMode="adjustResize">
|
||||||
@@ -517,10 +522,11 @@
|
|||||||
android:finishOnTaskLaunch="true" />
|
android:finishOnTaskLaunch="true" />
|
||||||
|
|
||||||
<activity android:name=".PlayServicesProblemActivity"
|
<activity android:name=".PlayServicesProblemActivity"
|
||||||
|
android:exported="false"
|
||||||
android:theme="@style/TextSecure.DialogActivity"
|
android:theme="@style/TextSecure.DialogActivity"
|
||||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||||
|
|
||||||
<activity android:name=".SmsSendtoActivity">
|
<activity android:name=".SmsSendtoActivity" android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SENDTO" />
|
<action android:name="android.intent.action.SENDTO" />
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
@@ -539,6 +545,7 @@
|
|||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity android:name="org.thoughtcrime.securesms.webrtc.VoiceCallShare"
|
<activity android:name="org.thoughtcrime.securesms.webrtc.VoiceCallShare"
|
||||||
|
android:exported="true"
|
||||||
android:excludeFromRecents="true"
|
android:excludeFromRecents="true"
|
||||||
android:permission="android.permission.CALL_PHONE"
|
android:permission="android.permission.CALL_PHONE"
|
||||||
android:theme="@style/NoAnimation.Theme.BlackScreen"
|
android:theme="@style/NoAnimation.Theme.BlackScreen"
|
||||||
@@ -691,13 +698,13 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<service android:name=".components.voice.VoiceNotePlaybackService">
|
<service android:name=".components.voice.VoiceNotePlaybackService" android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.media.browse.MediaBrowserService" />
|
<action android:name="android.media.browse.MediaBrowserService" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service>
|
</service>
|
||||||
|
|
||||||
<receiver android:name="androidx.media.session.MediaButtonReceiver" >
|
<receiver android:name="androidx.media.session.MediaButtonReceiver" android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
@@ -737,7 +744,7 @@
|
|||||||
|
|
||||||
<service android:name=".gcm.FcmFetchForegroundService" />
|
<service android:name=".gcm.FcmFetchForegroundService" />
|
||||||
|
|
||||||
<service android:name=".gcm.FcmReceiveService">
|
<service android:name=".gcm.FcmReceiveService" android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
<action android:name="com.google.firebase.MESSAGING_EVENT" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
@@ -828,51 +835,51 @@
|
|||||||
|
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
<receiver android:name=".service.BootReceiver">
|
<receiver android:name=".service.BootReceiver" android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||||
<action android:name="org.thoughtcrime.securesms.RESTART"/>
|
<action android:name="org.thoughtcrime.securesms.RESTART"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".service.DirectoryRefreshListener">
|
<receiver android:name=".service.DirectoryRefreshListener" android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".service.RotateSignedPreKeyListener">
|
<receiver android:name=".service.RotateSignedPreKeyListener" android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".service.RotateSenderCertificateListener">
|
<receiver android:name=".service.RotateSenderCertificateListener" android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".messageprocessingalarm.MessageProcessReceiver">
|
<receiver android:name=".messageprocessingalarm.MessageProcessReceiver" android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
<action android:name="org.thoughtcrime.securesms.action.PROCESS_MESSAGES" />
|
<action android:name="org.thoughtcrime.securesms.action.PROCESS_MESSAGES" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".service.LocalBackupListener">
|
<receiver android:name=".service.LocalBackupListener" android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".service.PersistentConnectionBootListener">
|
<receiver android:name=".service.PersistentConnectionBootListener" android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<receiver android:name=".notifications.LocaleChangedReceiver">
|
<receiver android:name=".notifications.LocaleChangedReceiver" android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.LOCALE_CHANGED"/>
|
<action android:name="android.intent.action.LOCALE_CHANGED"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
@@ -880,7 +887,7 @@
|
|||||||
|
|
||||||
<receiver android:name=".notifications.MessageNotifier$ReminderReceiver"/>
|
<receiver android:name=".notifications.MessageNotifier$ReminderReceiver"/>
|
||||||
|
|
||||||
<receiver android:name=".notifications.DeleteNotificationReceiver">
|
<receiver android:name=".notifications.DeleteNotificationReceiver" android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="org.thoughtcrime.securesms.DELETE_NOTIFICATION"/>
|
<action android:name="org.thoughtcrime.securesms.DELETE_NOTIFICATION"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
@@ -908,16 +915,19 @@
|
|||||||
|
|
||||||
<service
|
<service
|
||||||
android:name=".jobmanager.KeepAliveService"
|
android:name=".jobmanager.KeepAliveService"
|
||||||
android:enabled="@bool/enable_alarm_manager" />
|
android:enabled="@bool/enable_alarm_manager"
|
||||||
|
android:exported="false"/>
|
||||||
|
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".jobmanager.AlarmManagerScheduler$RetryReceiver"
|
android:name=".jobmanager.AlarmManagerScheduler$RetryReceiver"
|
||||||
android:enabled="@bool/enable_alarm_manager" />
|
android:enabled="@bool/enable_alarm_manager"
|
||||||
|
android:exported="false"/>
|
||||||
|
|
||||||
<!-- Probably don't need this one -->
|
<!-- Probably don't need this one -->
|
||||||
<receiver
|
<receiver
|
||||||
android:name=".jobmanager.BootReceiver"
|
android:name=".jobmanager.BootReceiver"
|
||||||
android:enabled="true">
|
android:enabled="true"
|
||||||
|
android:exported="false">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import androidx.annotation.StringRes;
|
|||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.core.app.NotificationManagerCompat;
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity;
|
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity;
|
||||||
import org.thoughtcrime.securesms.notifications.NotificationCancellationHelper;
|
import org.thoughtcrime.securesms.notifications.NotificationCancellationHelper;
|
||||||
@@ -40,7 +41,7 @@ public enum BackupFileIOError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void postNotification(@NonNull Context context) {
|
public void postNotification(@NonNull Context context) {
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, -1, AppSettingsActivity.backups(context), 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, -1, AppSettingsActivity.backups(context), PendingIntentFlags.mutable());
|
||||||
Notification backupFailedNotification = new NotificationCompat.Builder(context, NotificationChannels.FAILURES)
|
Notification backupFailedNotification = new NotificationCompat.Builder(context, NotificationChannels.FAILURES)
|
||||||
.setSmallIcon(R.drawable.ic_signal_backup)
|
.setSmallIcon(R.drawable.ic_signal_backup)
|
||||||
.setContentTitle(context.getString(titleId))
|
.setContentTitle(context.getString(titleId))
|
||||||
|
|||||||
+2
-1
@@ -7,6 +7,7 @@ import android.net.Uri
|
|||||||
import android.os.Build
|
import android.os.Build
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
import androidx.core.app.NotificationManagerCompat
|
import androidx.core.app.NotificationManagerCompat
|
||||||
|
import org.signal.core.util.PendingIntentFlags
|
||||||
import org.thoughtcrime.securesms.R
|
import org.thoughtcrime.securesms.R
|
||||||
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity
|
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity
|
||||||
import org.thoughtcrime.securesms.help.HelpFragment
|
import org.thoughtcrime.securesms.help.HelpFragment
|
||||||
@@ -90,7 +91,7 @@ object DonationErrorNotifications {
|
|||||||
context,
|
context,
|
||||||
0,
|
0,
|
||||||
actionIntent,
|
actionIntent,
|
||||||
if (Build.VERSION.SDK_INT >= 23) PendingIntent.FLAG_ONE_SHOT else 0
|
if (Build.VERSION.SDK_INT >= 23) PendingIntentFlags.oneShot() else PendingIntentFlags.mutable()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
+2
-1
@@ -13,6 +13,7 @@ import androidx.annotation.Nullable;
|
|||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.ui.PlayerNotificationManager;
|
import com.google.android.exoplayer2.ui.PlayerNotificationManager;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.concurrent.SignalExecutors;
|
import org.signal.core.util.concurrent.SignalExecutors;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.conversation.ConversationIntents;
|
import org.thoughtcrime.securesms.conversation.ConversationIntents;
|
||||||
@@ -107,7 +108,7 @@ class VoiceNoteNotificationManager {
|
|||||||
return PendingIntent.getActivity(context,
|
return PendingIntent.getActivity(context,
|
||||||
0,
|
0,
|
||||||
conversationActivity,
|
conversationActivity,
|
||||||
PendingIntent.FLAG_CANCEL_CURRENT);
|
PendingIntentFlags.cancelCurrent());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
-1
@@ -9,6 +9,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.core.app.NotificationManagerCompat;
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.WebRtcCallActivity;
|
import org.thoughtcrime.securesms.WebRtcCallActivity;
|
||||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||||
@@ -28,7 +29,7 @@ public final class GroupCallSafetyNumberChangeNotificationUtil {
|
|||||||
Intent contentIntent = new Intent(context, WebRtcCallActivity.class);
|
Intent contentIntent = new Intent(context, WebRtcCallActivity.class);
|
||||||
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
Notification safetyNumberChangeNotification = new NotificationCompat.Builder(context, NotificationChannels.CALLS)
|
Notification safetyNumberChangeNotification = new NotificationCompat.Builder(context, NotificationChannels.CALLS)
|
||||||
.setSmallIcon(R.drawable.ic_notification)
|
.setSmallIcon(R.drawable.ic_notification)
|
||||||
|
|||||||
+2
-1
@@ -101,6 +101,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
|||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
import org.greenrobot.eventbus.Subscribe;
|
import org.greenrobot.eventbus.Subscribe;
|
||||||
import org.greenrobot.eventbus.ThreadMode;
|
import org.greenrobot.eventbus.ThreadMode;
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.StringUtil;
|
import org.signal.core.util.StringUtil;
|
||||||
import org.signal.core.util.ThreadUtil;
|
import org.signal.core.util.ThreadUtil;
|
||||||
import org.signal.core.util.concurrent.SignalExecutors;
|
import org.signal.core.util.concurrent.SignalExecutors;
|
||||||
@@ -1381,7 +1382,7 @@ public class ConversationParentFragment extends Fragment
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
Intent callbackIntent = new Intent(ACTION_PINNED_SHORTCUT);
|
Intent callbackIntent = new Intent(ACTION_PINNED_SHORTCUT);
|
||||||
PendingIntent shortcutPinnedCallback = PendingIntent.getBroadcast(context, REQUEST_CODE_PIN_SHORTCUT, callbackIntent, 0);
|
PendingIntent shortcutPinnedCallback = PendingIntent.getBroadcast(context, REQUEST_CODE_PIN_SHORTCUT, callbackIntent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
ShortcutManagerCompat.requestPinShortcut(context, shortcutInfoCompat, shortcutPinnedCallback.getIntentSender());
|
ShortcutManagerCompat.requestPinShortcut(context, shortcutInfoCompat, shortcutPinnedCallback.getIntentSender());
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.StringRes;
|
import androidx.annotation.StringRes;
|
||||||
import androidx.navigation.fragment.NavHostFragment;
|
import androidx.navigation.fragment.NavHostFragment;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.devicetransfer.DeviceToDeviceTransferService;
|
import org.signal.devicetransfer.DeviceToDeviceTransferService;
|
||||||
import org.signal.devicetransfer.DeviceToDeviceTransferService.TransferNotificationData;
|
import org.signal.devicetransfer.DeviceToDeviceTransferService.TransferNotificationData;
|
||||||
import org.thoughtcrime.securesms.MainActivity;
|
import org.thoughtcrime.securesms.MainActivity;
|
||||||
@@ -82,7 +83,7 @@ public final class NewDeviceTransferSetupFragment extends DeviceTransferSetupFra
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startTransfer() {
|
protected void startTransfer() {
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(requireContext(), 0, MainActivity.clearTop(requireContext()), 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(requireContext(), 0, MainActivity.clearTop(requireContext()), PendingIntentFlags.mutable());
|
||||||
|
|
||||||
TransferNotificationData notificationData = new TransferNotificationData(NotificationIds.DEVICE_TRANSFER, NotificationChannels.BACKUPS, R.drawable.ic_signal_backup);
|
TransferNotificationData notificationData = new TransferNotificationData(NotificationIds.DEVICE_TRANSFER, NotificationChannels.BACKUPS, R.drawable.ic_signal_backup);
|
||||||
DeviceToDeviceTransferService.startServer(requireContext(), new NewDeviceServerTask(), notificationData, pendingIntent);
|
DeviceToDeviceTransferService.startServer(requireContext(), new NewDeviceServerTask(), notificationData, pendingIntent);
|
||||||
|
|||||||
+2
-1
@@ -10,6 +10,7 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.annotation.StringRes;
|
import androidx.annotation.StringRes;
|
||||||
import androidx.navigation.fragment.NavHostFragment;
|
import androidx.navigation.fragment.NavHostFragment;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.devicetransfer.DeviceToDeviceTransferService;
|
import org.signal.devicetransfer.DeviceToDeviceTransferService;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity;
|
import org.thoughtcrime.securesms.components.settings.app.AppSettingsActivity;
|
||||||
@@ -55,7 +56,7 @@ public final class OldDeviceTransferSetupFragment extends DeviceTransferSetupFra
|
|||||||
protected void startTransfer() {
|
protected void startTransfer() {
|
||||||
Intent intent = new Intent(requireContext(), OldDeviceTransferActivity.class);
|
Intent intent = new Intent(requireContext(), OldDeviceTransferActivity.class);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(requireContext(), 0, intent, 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(requireContext(), 0, intent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
DeviceToDeviceTransferService.TransferNotificationData notificationData = new DeviceToDeviceTransferService.TransferNotificationData(NotificationIds.DEVICE_TRANSFER, NotificationChannels.BACKUPS, R.drawable.ic_signal_backup);
|
DeviceToDeviceTransferService.TransferNotificationData notificationData = new DeviceToDeviceTransferService.TransferNotificationData(NotificationIds.DEVICE_TRANSFER, NotificationChannels.BACKUPS, R.drawable.ic_signal_backup);
|
||||||
DeviceToDeviceTransferService.startClient(requireContext(), new OldDeviceClientTask(), notificationData, pendingIntent);
|
DeviceToDeviceTransferService.startClient(requireContext(), new OldDeviceClientTask(), notificationData, pendingIntent);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.IBinder
|
import android.os.IBinder
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
|
import org.signal.core.util.PendingIntentFlags
|
||||||
import org.signal.core.util.logging.Log
|
import org.signal.core.util.logging.Log
|
||||||
import org.thoughtcrime.securesms.MainActivity
|
import org.thoughtcrime.securesms.MainActivity
|
||||||
import org.thoughtcrime.securesms.R
|
import org.thoughtcrime.securesms.R
|
||||||
@@ -42,7 +43,7 @@ class FcmFetchForegroundService : Service() {
|
|||||||
.setContentTitle(getString(R.string.BackgroundMessageRetriever_checking_for_messages))
|
.setContentTitle(getString(R.string.BackgroundMessageRetriever_checking_for_messages))
|
||||||
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
.setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||||
.setProgress(0, 0, true)
|
.setProgress(0, 0, true)
|
||||||
.setContentIntent(PendingIntent.getActivity(this, 0, MainActivity.clearTop(this), 0))
|
.setContentIntent(PendingIntent.getActivity(this, 0, MainActivity.clearTop(this), PendingIntentFlags.mutable()))
|
||||||
.setVibrate(longArrayOf(0))
|
.setVibrate(longArrayOf(0))
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import androidx.annotation.NonNull;
|
|||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.BuildConfig;
|
import org.thoughtcrime.securesms.BuildConfig;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
@@ -52,7 +53,7 @@ public class AlarmManagerScheduler implements Scheduler {
|
|||||||
Intent intent = new Intent(context, RetryReceiver.class);
|
Intent intent = new Intent(context, RetryReceiver.class);
|
||||||
|
|
||||||
intent.setAction(BuildConfig.APPLICATION_ID + UUID.randomUUID().toString());
|
intent.setAction(BuildConfig.APPLICATION_ID + UUID.randomUUID().toString());
|
||||||
alarmManager.set(AlarmManager.RTC_WAKEUP, time, PendingIntent.getBroadcast(context, 0, intent, 0));
|
alarmManager.set(AlarmManager.RTC_WAKEUP, time, PendingIntent.getBroadcast(context, 0, intent, PendingIntentFlags.mutable()));
|
||||||
|
|
||||||
Log.i(TAG, "Set an alarm to retry a job in " + (time - System.currentTimeMillis()) + " ms.");
|
Log.i(TAG, "Set an alarm to retry a job in " + (time - System.currentTimeMillis()) + " ms.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import androidx.core.app.NotificationCompat;
|
|||||||
import com.google.android.gms.common.ConnectionResult;
|
import com.google.android.gms.common.ConnectionResult;
|
||||||
import com.google.android.gms.common.GoogleApiAvailability;
|
import com.google.android.gms.common.GoogleApiAvailability;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.PlayServicesProblemActivity;
|
import org.thoughtcrime.securesms.PlayServicesProblemActivity;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
@@ -120,7 +121,7 @@ public class FcmRefreshJob extends BaseJob {
|
|||||||
|
|
||||||
private void notifyFcmFailure() {
|
private void notifyFcmFailure() {
|
||||||
Intent intent = new Intent(context, PlayServicesProblemActivity.class);
|
Intent intent = new Intent(context, PlayServicesProblemActivity.class);
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 1122, intent, PendingIntent.FLAG_CANCEL_CURRENT);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 1122, intent, PendingIntentFlags.cancelCurrent());
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.FAILURES);
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, NotificationChannels.FAILURES);
|
||||||
|
|
||||||
builder.setSmallIcon(R.drawable.ic_notification);
|
builder.setSmallIcon(R.drawable.ic_notification);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.core.app.NotificationManagerCompat;
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.signal.libsignal.protocol.IdentityKey;
|
import org.signal.libsignal.protocol.IdentityKey;
|
||||||
import org.signal.libsignal.protocol.SignalProtocolAddress;
|
import org.signal.libsignal.protocol.SignalProtocolAddress;
|
||||||
@@ -182,7 +183,7 @@ public final class PushDecryptMessageJob extends BaseJob {
|
|||||||
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
|
.setCategory(NotificationCompat.CATEGORY_MESSAGE)
|
||||||
.setContentTitle(context.getString(R.string.PushDecryptJob_new_locked_message))
|
.setContentTitle(context.getString(R.string.PushDecryptJob_new_locked_message))
|
||||||
.setContentText(context.getString(R.string.PushDecryptJob_unlock_to_view_pending_messages))
|
.setContentText(context.getString(R.string.PushDecryptJob_unlock_to_view_pending_messages))
|
||||||
.setContentIntent(PendingIntent.getActivity(context, 0, MainActivity.clearTop(context), 0))
|
.setContentIntent(PendingIntent.getActivity(context, 0, MainActivity.clearTop(context), PendingIntentFlags.mutable()))
|
||||||
.setDefaults(NotificationCompat.DEFAULT_SOUND | NotificationCompat.DEFAULT_VIBRATE)
|
.setDefaults(NotificationCompat.DEFAULT_SOUND | NotificationCompat.DEFAULT_VIBRATE)
|
||||||
.build());
|
.build());
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import android.telephony.SmsManager;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.database.MessageDatabase;
|
import org.thoughtcrime.securesms.database.MessageDatabase;
|
||||||
import org.thoughtcrime.securesms.database.NoSuchMessageException;
|
import org.thoughtcrime.securesms.database.NoSuchMessageException;
|
||||||
@@ -182,7 +183,7 @@ public class SmsSendJob extends SendJob {
|
|||||||
for (String ignored : messages) {
|
for (String ignored : messages) {
|
||||||
sentIntents.add(PendingIntent.getBroadcast(context, 0,
|
sentIntents.add(PendingIntent.getBroadcast(context, 0,
|
||||||
constructSentIntent(context, messageId, type, isMultipart),
|
constructSentIntent(context, messageId, type, isMultipart),
|
||||||
0));
|
PendingIntentFlags.mutable()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return sentIntents;
|
return sentIntents;
|
||||||
@@ -199,7 +200,7 @@ public class SmsSendJob extends SendJob {
|
|||||||
for (String ignored : messages) {
|
for (String ignored : messages) {
|
||||||
deliveredIntents.add(PendingIntent.getBroadcast(context, 0,
|
deliveredIntents.add(PendingIntent.getBroadcast(context, 0,
|
||||||
constructDeliveredIntent(context, messageId, type, isMultipart),
|
constructDeliveredIntent(context, messageId, type, isMultipart),
|
||||||
0));
|
PendingIntentFlags.mutable()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return deliveredIntents;
|
return deliveredIntents;
|
||||||
|
|||||||
+2
-1
@@ -12,6 +12,7 @@ import android.os.SystemClock;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.concurrent.SignalExecutors;
|
import org.signal.core.util.concurrent.SignalExecutors;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
@@ -71,7 +72,7 @@ public final class MessageProcessReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
alarmIntent.setAction(MessageProcessReceiver.BROADCAST_ACTION);
|
alarmIntent.setAction(MessageProcessReceiver.BROADCAST_ACTION);
|
||||||
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 123, alarmIntent, PendingIntent.FLAG_UPDATE_CURRENT);
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 123, alarmIntent, PendingIntentFlags.updateCurrent());
|
||||||
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
||||||
|
|
||||||
long interval = FeatureFlags.getBackgroundMessageProcessInterval();
|
long interval = FeatureFlags.getBackgroundMessageProcessInterval();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.core.app.NotificationManagerCompat;
|
import androidx.core.app.NotificationManagerCompat;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.signal.libsignal.metadata.InvalidMetadataMessageException;
|
import org.signal.libsignal.metadata.InvalidMetadataMessageException;
|
||||||
import org.signal.libsignal.metadata.InvalidMetadataVersionException;
|
import org.signal.libsignal.metadata.InvalidMetadataVersionException;
|
||||||
@@ -239,7 +240,7 @@ public final class MessageDecryptionUtil {
|
|||||||
.setSmallIcon(R.drawable.ic_notification)
|
.setSmallIcon(R.drawable.ic_notification)
|
||||||
.setContentTitle(context.getString(R.string.MessageDecryptionUtil_failed_to_decrypt_message))
|
.setContentTitle(context.getString(R.string.MessageDecryptionUtil_failed_to_decrypt_message))
|
||||||
.setContentText(context.getString(R.string.MessageDecryptionUtil_tap_to_send_a_debug_log))
|
.setContentText(context.getString(R.string.MessageDecryptionUtil_tap_to_send_a_debug_log))
|
||||||
.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, SubmitDebugLogActivity.class), 0))
|
.setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, SubmitDebugLogActivity.class), PendingIntentFlags.mutable()))
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.util.Util;
|
import org.thoughtcrime.securesms.util.Util;
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@ public abstract class LollipopMmsConnection extends BroadcastReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected PendingIntent getPendingIntent() {
|
protected PendingIntent getPendingIntent() {
|
||||||
return PendingIntent.getBroadcast(getContext(), 1, new Intent(action), PendingIntent.FLAG_ONE_SHOT);
|
return PendingIntent.getBroadcast(getContext(), 1, new Intent(action), PendingIntentFlags.oneShot());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Context getContext() {
|
protected Context getContext() {
|
||||||
|
|||||||
+2
-1
@@ -15,6 +15,7 @@ import androidx.core.app.NotificationCompat
|
|||||||
import androidx.core.app.RemoteInput
|
import androidx.core.app.RemoteInput
|
||||||
import androidx.core.content.LocusIdCompat
|
import androidx.core.content.LocusIdCompat
|
||||||
import androidx.core.graphics.drawable.IconCompat
|
import androidx.core.graphics.drawable.IconCompat
|
||||||
|
import org.signal.core.util.PendingIntentFlags.mutable
|
||||||
import org.thoughtcrime.securesms.R
|
import org.thoughtcrime.securesms.R
|
||||||
import org.thoughtcrime.securesms.conversation.ConversationIntents
|
import org.thoughtcrime.securesms.conversation.ConversationIntents
|
||||||
import org.thoughtcrime.securesms.database.GroupDatabase
|
import org.thoughtcrime.securesms.database.GroupDatabase
|
||||||
@@ -341,7 +342,7 @@ sealed class NotificationBuilder(protected val context: Context) {
|
|||||||
context,
|
context,
|
||||||
0,
|
0,
|
||||||
ConversationIntents.createBubbleIntent(context, conversation.recipient.id, conversation.thread.threadId),
|
ConversationIntents.createBubbleIntent(context, conversation.recipient.id, conversation.thread.threadId),
|
||||||
0
|
mutable()
|
||||||
)
|
)
|
||||||
|
|
||||||
val bubbleMetadata = NotificationCompat.BubbleMetadata.Builder(intent, AvatarUtil.getIconCompatForShortcut(context, conversation.recipient))
|
val bubbleMetadata = NotificationCompat.BubbleMetadata.Builder(intent, AvatarUtil.getIconCompatForShortcut(context, conversation.recipient))
|
||||||
|
|||||||
+1
-1
@@ -136,7 +136,7 @@ data class NotificationConversation(
|
|||||||
return try {
|
return try {
|
||||||
TaskStackBuilder.create(context)
|
TaskStackBuilder.create(context)
|
||||||
.addNextIntentWithParentStack(intent)
|
.addNextIntentWithParentStack(intent)
|
||||||
.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT)
|
.getPendingIntent(0, PendingIntentFlags.updateCurrent())
|
||||||
} catch (e: NullPointerException) {
|
} catch (e: NullPointerException) {
|
||||||
Log.w(NotificationFactory.TAG, "Vivo device quirk sometimes throws NPE", e)
|
Log.w(NotificationFactory.TAG, "Vivo device quirk sometimes throws NPE", e)
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
|
|||||||
+4
-3
@@ -15,6 +15,7 @@ import android.os.TransactionTooLargeException
|
|||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
import androidx.core.app.NotificationManagerCompat
|
import androidx.core.app.NotificationManagerCompat
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import org.signal.core.util.PendingIntentFlags
|
||||||
import org.signal.core.util.concurrent.SignalExecutors
|
import org.signal.core.util.concurrent.SignalExecutors
|
||||||
import org.signal.core.util.logging.Log
|
import org.signal.core.util.logging.Log
|
||||||
import org.thoughtcrime.securesms.MainActivity
|
import org.thoughtcrime.securesms.MainActivity
|
||||||
@@ -239,7 +240,7 @@ object NotificationFactory {
|
|||||||
setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
|
setGroupAlertBehavior(NotificationCompat.GROUP_ALERT_CHILDREN)
|
||||||
setChannelId(NotificationChannels.getMessagesChannel(context))
|
setChannelId(NotificationChannels.getMessagesChannel(context))
|
||||||
setContentTitle(context.getString(R.string.app_name))
|
setContentTitle(context.getString(R.string.app_name))
|
||||||
setContentIntent(PendingIntent.getActivity(context, 0, MainActivity.clearTop(context), 0))
|
setContentIntent(PendingIntent.getActivity(context, 0, MainActivity.clearTop(context), PendingIntentFlags.mutable()))
|
||||||
setGroupSummary(true)
|
setGroupSummary(true)
|
||||||
setSubText(context.getString(R.string.MessageNotifier_d_new_messages_in_d_conversations, state.messageCount, state.threadCount))
|
setSubText(context.getString(R.string.MessageNotifier_d_new_messages_in_d_conversations, state.messageCount, state.threadCount))
|
||||||
setContentInfo(state.messageCount.toString())
|
setContentInfo(state.messageCount.toString())
|
||||||
@@ -320,7 +321,7 @@ object NotificationFactory {
|
|||||||
setContentTitle(context.getString(R.string.MessageNotifier_message_delivery_failed))
|
setContentTitle(context.getString(R.string.MessageNotifier_message_delivery_failed))
|
||||||
setContentText(context.getString(R.string.MessageNotifier_failed_to_deliver_message))
|
setContentText(context.getString(R.string.MessageNotifier_failed_to_deliver_message))
|
||||||
setTicker(context.getString(R.string.MessageNotifier_error_delivering_message))
|
setTicker(context.getString(R.string.MessageNotifier_error_delivering_message))
|
||||||
setContentIntent(PendingIntent.getActivity(context, 0, intent, 0))
|
setContentIntent(PendingIntent.getActivity(context, 0, intent, PendingIntentFlags.mutable()))
|
||||||
setAutoCancel(true)
|
setAutoCancel(true)
|
||||||
setAlarms(recipient)
|
setAlarms(recipient)
|
||||||
setChannelId(NotificationChannels.FAILURES)
|
setChannelId(NotificationChannels.FAILURES)
|
||||||
@@ -349,7 +350,7 @@ object NotificationFactory {
|
|||||||
setLargeIcon(BitmapFactory.decodeResource(context.resources, R.drawable.ic_info_outline))
|
setLargeIcon(BitmapFactory.decodeResource(context.resources, R.drawable.ic_info_outline))
|
||||||
setContentTitle(context.getString(R.string.MessageNotifier_message_delivery_paused))
|
setContentTitle(context.getString(R.string.MessageNotifier_message_delivery_paused))
|
||||||
setContentText(context.getString(R.string.MessageNotifier_verify_to_continue_messaging_on_signal))
|
setContentText(context.getString(R.string.MessageNotifier_verify_to_continue_messaging_on_signal))
|
||||||
setContentIntent(PendingIntent.getActivity(context, 0, intent, 0))
|
setContentIntent(PendingIntent.getActivity(context, 0, intent, PendingIntentFlags.mutable()))
|
||||||
setOnlyAlertOnce(true)
|
setOnlyAlertOnce(true)
|
||||||
setAutoCancel(true)
|
setAutoCancel(true)
|
||||||
setAlarms(recipient)
|
setAlarms(recipient)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.notifications.v2
|
|||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import org.signal.core.util.PendingIntentFlags
|
||||||
import org.thoughtcrime.securesms.notifications.DeleteNotificationReceiver
|
import org.thoughtcrime.securesms.notifications.DeleteNotificationReceiver
|
||||||
import org.thoughtcrime.securesms.notifications.MarkReadReceiver
|
import org.thoughtcrime.securesms.notifications.MarkReadReceiver
|
||||||
import org.thoughtcrime.securesms.notifications.NotificationIds
|
import org.thoughtcrime.securesms.notifications.NotificationIds
|
||||||
@@ -67,7 +68,7 @@ data class NotificationState(val conversations: List<NotificationConversation>,
|
|||||||
.putParcelableArrayListExtra(DeleteNotificationReceiver.EXTRA_THREADS, ArrayList(threads))
|
.putParcelableArrayListExtra(DeleteNotificationReceiver.EXTRA_THREADS, ArrayList(threads))
|
||||||
.makeUniqueToPreventMerging()
|
.makeUniqueToPreventMerging()
|
||||||
|
|
||||||
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
return PendingIntent.getBroadcast(context, 0, intent, PendingIntentFlags.updateCurrent())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getMarkAsReadIntent(context: Context): PendingIntent? {
|
fun getMarkAsReadIntent(context: Context): PendingIntent? {
|
||||||
@@ -76,7 +77,7 @@ data class NotificationState(val conversations: List<NotificationConversation>,
|
|||||||
.putExtra(MarkReadReceiver.NOTIFICATION_ID_EXTRA, NotificationIds.MESSAGE_SUMMARY)
|
.putExtra(MarkReadReceiver.NOTIFICATION_ID_EXTRA, NotificationIds.MESSAGE_SUMMARY)
|
||||||
.makeUniqueToPreventMerging()
|
.makeUniqueToPreventMerging()
|
||||||
|
|
||||||
return PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
return PendingIntent.getBroadcast(context, 0, intent, PendingIntentFlags.updateCurrent())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getThreadsWithMostRecentNotificationFromSelf(): Set<ConversationId> {
|
fun getThreadsWithMostRecentNotificationFromSelf(): Set<ConversationId> {
|
||||||
|
|||||||
+2
-1
@@ -22,6 +22,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.annimon.stream.Stream;
|
import com.annimon.stream.Stream;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||||
import org.thoughtcrime.securesms.payments.Mnemonic;
|
import org.thoughtcrime.securesms.payments.Mnemonic;
|
||||||
@@ -95,7 +96,7 @@ public class PaymentsRecoveryPhraseFragment extends Fragment {
|
|||||||
|
|
||||||
AlarmManager alarmManager = ServiceUtil.getAlarmManager(requireContext());
|
AlarmManager alarmManager = ServiceUtil.getAlarmManager(requireContext());
|
||||||
Intent alarmIntent = new Intent(requireContext(), ClearClipboardAlarmReceiver.class);
|
Intent alarmIntent = new Intent(requireContext(), ClearClipboardAlarmReceiver.class);
|
||||||
PendingIntent pendingAlarmIntent = PendingIntent.getBroadcast(requireContext(), 0, alarmIntent, 0);
|
PendingIntent pendingAlarmIntent = PendingIntent.getBroadcast(requireContext(), 0, alarmIntent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(30), pendingAlarmIntent);
|
alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(30), pendingAlarmIntent);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -17,6 +17,7 @@ import android.os.PowerManager.WakeLock;
|
|||||||
|
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.MainActivity;
|
import org.thoughtcrime.securesms.MainActivity;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
@@ -137,7 +138,7 @@ public class ApplicationMigrationService extends Service
|
|||||||
builder.setOngoing(true);
|
builder.setOngoing(true);
|
||||||
builder.setProgress(100, 0, false);
|
builder.setProgress(100, 0, false);
|
||||||
// TODO [greyson] Navigation
|
// TODO [greyson] Navigation
|
||||||
builder.setContentIntent(PendingIntent.getActivity(this, 0, MainActivity.clearTop(this), 0));
|
builder.setContentIntent(PendingIntent.getActivity(this, 0, MainActivity.clearTop(this), PendingIntentFlags.mutable()));
|
||||||
|
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
startForeground(NotificationIds.APPLICATION_MIGRATION, builder.build());
|
startForeground(NotificationIds.APPLICATION_MIGRATION, builder.build());
|
||||||
@@ -189,7 +190,7 @@ public class ApplicationMigrationService extends Service
|
|||||||
builder.setContentTitle(context.getString(R.string.ApplicationMigrationService_import_complete));
|
builder.setContentTitle(context.getString(R.string.ApplicationMigrationService_import_complete));
|
||||||
builder.setContentText(context.getString(R.string.ApplicationMigrationService_system_database_import_is_complete));
|
builder.setContentText(context.getString(R.string.ApplicationMigrationService_system_database_import_is_complete));
|
||||||
// TODO [greyson] Navigation
|
// TODO [greyson] Navigation
|
||||||
builder.setContentIntent(PendingIntent.getActivity(context, 0, MainActivity.clearTop(context), 0));
|
builder.setContentIntent(PendingIntent.getActivity(context, 0, MainActivity.clearTop(context), PendingIntentFlags.mutable()));
|
||||||
builder.setWhen(System.currentTimeMillis());
|
builder.setWhen(System.currentTimeMillis());
|
||||||
builder.setDefaults(Notification.DEFAULT_VIBRATE);
|
builder.setDefaults(Notification.DEFAULT_VIBRATE);
|
||||||
builder.setAutoCancel(true);
|
builder.setAutoCancel(true);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import android.content.BroadcastReceiver;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||||
|
|
||||||
public class ExpirationListener extends BroadcastReceiver {
|
public class ExpirationListener extends BroadcastReceiver {
|
||||||
@@ -17,7 +18,7 @@ public class ExpirationListener extends BroadcastReceiver {
|
|||||||
|
|
||||||
public static void setAlarm(Context context, long waitTimeMillis) {
|
public static void setAlarm(Context context, long waitTimeMillis) {
|
||||||
Intent intent = new Intent(context, ExpirationListener.class);
|
Intent intent = new Intent(context, ExpirationListener.class);
|
||||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntentFlags.mutable());
|
||||||
AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
|
AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
|
||||||
|
|
||||||
alarmManager.cancel(pendingIntent);
|
alarmManager.cancel(pendingIntent);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import androidx.annotation.Nullable;
|
|||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
import androidx.core.content.ContextCompat;
|
import androidx.core.content.ContextCompat;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.MainActivity;
|
import org.thoughtcrime.securesms.MainActivity;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
@@ -111,7 +112,7 @@ public final class GenericForegroundService extends Service {
|
|||||||
.setSmallIcon(active.iconRes)
|
.setSmallIcon(active.iconRes)
|
||||||
.setContentTitle(active.title)
|
.setContentTitle(active.title)
|
||||||
.setProgress(active.progressMax, active.progress, active.indeterminate)
|
.setProgress(active.progressMax, active.progress, active.indeterminate)
|
||||||
.setContentIntent(PendingIntent.getActivity(this, 0, MainActivity.clearTop(this), 0))
|
.setContentIntent(PendingIntent.getActivity(this, 0, MainActivity.clearTop(this), PendingIntentFlags.mutable()))
|
||||||
.setVibrate(new long[]{0})
|
.setVibrate(new long[]{0})
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -7,6 +7,7 @@ import android.content.BroadcastReceiver;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
|
|
||||||
public abstract class PersistentAlarmManagerListener extends BroadcastReceiver {
|
public abstract class PersistentAlarmManagerListener extends BroadcastReceiver {
|
||||||
@@ -23,7 +24,8 @@ public abstract class PersistentAlarmManagerListener extends BroadcastReceiver {
|
|||||||
long scheduledTime = getNextScheduledExecutionTime(context);
|
long scheduledTime = getNextScheduledExecutionTime(context);
|
||||||
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
|
||||||
Intent alarmIntent = new Intent(context, getClass());
|
Intent alarmIntent = new Intent(context, getClass());
|
||||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, alarmIntent, 0);
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, alarmIntent, PendingIntentFlags.immutable());
|
||||||
|
|
||||||
|
|
||||||
if (System.currentTimeMillis() >= scheduledTime) {
|
if (System.currentTimeMillis() >= scheduledTime) {
|
||||||
scheduledTime = onAlarm(context, scheduledTime);
|
scheduledTime = onAlarm(context, scheduledTime);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.WorkerThread;
|
import androidx.annotation.WorkerThread;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.thoughtcrime.securesms.util.ServiceUtil;
|
import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,7 +85,7 @@ public abstract class TimedEventManager<E> {
|
|||||||
*/
|
*/
|
||||||
protected static void setAlarm(@NonNull Context context, long delay, @NonNull Class alarmClass) {
|
protected static void setAlarm(@NonNull Context context, long delay, @NonNull Class alarmClass) {
|
||||||
Intent intent = new Intent(context, alarmClass);
|
Intent intent = new Intent(context, alarmClass);
|
||||||
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
|
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, PendingIntentFlags.mutable());
|
||||||
AlarmManager alarmManager = ServiceUtil.getAlarmManager(context);
|
AlarmManager alarmManager = ServiceUtil.getAlarmManager(context);
|
||||||
|
|
||||||
alarmManager.cancel(pendingIntent);
|
alarmManager.cancel(pendingIntent);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import android.net.Uri;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.signal.core.util.logging.Log;
|
import org.signal.core.util.logging.Log;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
import org.thoughtcrime.securesms.notifications.NotificationChannels;
|
||||||
@@ -61,7 +62,7 @@ public class UpdateApkReadyListener extends BroadcastReceiver {
|
|||||||
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
intent.setData(uri);
|
intent.setData(uri);
|
||||||
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
Notification notification = new NotificationCompat.Builder(context, NotificationChannels.APP_UPDATES)
|
Notification notification = new NotificationCompat.Builder(context, NotificationChannels.APP_UPDATES)
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.annotation.StringRes;
|
import androidx.annotation.StringRes;
|
||||||
import androidx.core.app.NotificationCompat;
|
import androidx.core.app.NotificationCompat;
|
||||||
|
|
||||||
|
import org.signal.core.util.PendingIntentFlags;
|
||||||
import org.thoughtcrime.securesms.MainActivity;
|
import org.thoughtcrime.securesms.MainActivity;
|
||||||
import org.thoughtcrime.securesms.R;
|
import org.thoughtcrime.securesms.R;
|
||||||
import org.thoughtcrime.securesms.WebRtcCallActivity;
|
import org.thoughtcrime.securesms.WebRtcCallActivity;
|
||||||
@@ -41,7 +42,7 @@ public class CallNotificationBuilder {
|
|||||||
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
contentIntent.putExtra(WebRtcCallActivity.EXTRA_STARTED_FROM_FULLSCREEN, true);
|
contentIntent.putExtra(WebRtcCallActivity.EXTRA_STARTED_FROM_FULLSCREEN, true);
|
||||||
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, getNotificationChannel(type))
|
NotificationCompat.Builder builder = new NotificationCompat.Builder(context, getNotificationChannel(type))
|
||||||
.setSmallIcon(R.drawable.ic_call_secure_white_24dp)
|
.setSmallIcon(R.drawable.ic_call_secure_white_24dp)
|
||||||
@@ -86,7 +87,7 @@ public class CallNotificationBuilder {
|
|||||||
Intent contentIntent = new Intent(context, MainActivity.class);
|
Intent contentIntent = new Intent(context, MainActivity.class);
|
||||||
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
return new NotificationCompat.Builder(context, NotificationChannels.CALL_STATUS).setSmallIcon(R.drawable.ic_call_secure_white_24dp)
|
return new NotificationCompat.Builder(context, NotificationChannels.CALL_STATUS).setSmallIcon(R.drawable.ic_call_secure_white_24dp)
|
||||||
.setContentIntent(pendingIntent)
|
.setContentIntent(pendingIntent)
|
||||||
@@ -100,7 +101,7 @@ public class CallNotificationBuilder {
|
|||||||
Intent contentIntent = new Intent(context, MainActivity.class);
|
Intent contentIntent = new Intent(context, MainActivity.class);
|
||||||
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
contentIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
|
||||||
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, contentIntent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
return new NotificationCompat.Builder(context, NotificationChannels.CALL_STATUS).setSmallIcon(R.drawable.ic_call_secure_white_24dp)
|
return new NotificationCompat.Builder(context, NotificationChannels.CALL_STATUS).setSmallIcon(R.drawable.ic_call_secure_white_24dp)
|
||||||
.setContentIntent(pendingIntent)
|
.setContentIntent(pendingIntent)
|
||||||
@@ -128,8 +129,8 @@ public class CallNotificationBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static NotificationCompat.Action getServiceNotificationAction(Context context, Intent intent, int iconResId, int titleResId) {
|
private static NotificationCompat.Action getServiceNotificationAction(Context context, Intent intent, int iconResId, int titleResId) {
|
||||||
PendingIntent pendingIntent = Build.VERSION.SDK_INT >= 26 ? PendingIntent.getForegroundService(context, 0, intent, 0)
|
PendingIntent pendingIntent = Build.VERSION.SDK_INT >= 26 ? PendingIntent.getForegroundService(context, 0, intent, PendingIntentFlags.mutable())
|
||||||
: PendingIntent.getService(context, 0, intent, 0);
|
: PendingIntent.getService(context, 0, intent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
return new NotificationCompat.Action(iconResId, context.getString(titleResId), pendingIntent);
|
return new NotificationCompat.Action(iconResId, context.getString(titleResId), pendingIntent);
|
||||||
}
|
}
|
||||||
@@ -140,7 +141,7 @@ public class CallNotificationBuilder {
|
|||||||
Intent intent = new Intent(context, WebRtcCallActivity.class);
|
Intent intent = new Intent(context, WebRtcCallActivity.class);
|
||||||
intent.setAction(action);
|
intent.setAction(action);
|
||||||
|
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntentFlags.mutable());
|
||||||
|
|
||||||
return new NotificationCompat.Action(iconResId, context.getString(titleResId), pendingIntent);
|
return new NotificationCompat.Action(iconResId, context.getString(titleResId), pendingIntent);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,18 +13,31 @@ import android.os.Build
|
|||||||
*/
|
*/
|
||||||
object PendingIntentFlags {
|
object PendingIntentFlags {
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
fun updateCurrent(): Int {
|
fun updateCurrent(): Int {
|
||||||
return mutable() or PendingIntent.FLAG_UPDATE_CURRENT
|
return mutable() or PendingIntent.FLAG_UPDATE_CURRENT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
fun cancelCurrent(): Int {
|
fun cancelCurrent(): Int {
|
||||||
return mutable() or PendingIntent.FLAG_CANCEL_CURRENT
|
return mutable() or PendingIntent.FLAG_CANCEL_CURRENT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun oneShot(): Int {
|
||||||
|
return mutable() or PendingIntent.FLAG_ONE_SHOT
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The backwards compatible "default" value for pending intent flags.
|
* The backwards compatible "default" value for pending intent flags.
|
||||||
*/
|
*/
|
||||||
|
@JvmStatic
|
||||||
fun mutable(): Int {
|
fun mutable(): Int {
|
||||||
return if (Build.VERSION.SDK_INT >= 31) PendingIntent.FLAG_MUTABLE else 0
|
return if (Build.VERSION.SDK_INT >= 31) PendingIntent.FLAG_MUTABLE else 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@JvmStatic
|
||||||
|
fun immutable(): Int {
|
||||||
|
return if (Build.VERSION.SDK_INT >= 23) PendingIntent.FLAG_IMMUTABLE else 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class ShakeDetector implements SensorEventListener {
|
|||||||
|
|
||||||
if (accelerometer != null) {
|
if (accelerometer != null) {
|
||||||
this.sensorManager = sensorManager;
|
this.sensorManager = sensorManager;
|
||||||
sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_FASTEST);
|
sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return accelerometer != null;
|
return accelerometer != null;
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ dependencyResolutionManagement {
|
|||||||
alias('androidx-concurrent-futures').to('androidx.concurrent:concurrent-futures:1.0.0')
|
alias('androidx-concurrent-futures').to('androidx.concurrent:concurrent-futures:1.0.0')
|
||||||
alias('androidx-autofill').to('androidx.autofill:autofill:1.0.0')
|
alias('androidx-autofill').to('androidx.autofill:autofill:1.0.0')
|
||||||
alias('androidx-biometric').to('androidx.biometric:biometric:1.1.0')
|
alias('androidx-biometric').to('androidx.biometric:biometric:1.1.0')
|
||||||
alias('androidx-sharetarget').to('androidx.sharetarget:sharetarget:1.1.0')
|
alias('androidx-sharetarget').to('androidx.sharetarget:sharetarget:1.2.0-rc02')
|
||||||
alias('androidx-sqlite').to('androidx.sqlite:sqlite:2.1.0')
|
alias('androidx-sqlite').to('androidx.sqlite:sqlite:2.1.0')
|
||||||
alias('androidx-core-role').to('androidx.core:core-role:1.0.0')
|
alias('androidx-core-role').to('androidx.core:core-role:1.0.0')
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.DeviceTransferTest">
|
android:theme="@style/Theme.DeviceTransferTest">
|
||||||
<activity android:name=".MainActivity">
|
<activity android:name=".MainActivity"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.DeviceTransferTest">
|
android:theme="@style/Theme.DeviceTransferTest">
|
||||||
<activity android:name=".MainActivity">
|
<activity android:name=".MainActivity"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|||||||
@@ -761,6 +761,14 @@ https://docs.gradle.org/current/userguide/dependency_verification.html
|
|||||||
<sha256 value="25715ba5648065f810ae38956d30fa9cd778fe34538c7bc4fe6911dba53ef73b" origin="Generated by Gradle"/>
|
<sha256 value="25715ba5648065f810ae38956d30fa9cd778fe34538c7bc4fe6911dba53ef73b" origin="Generated by Gradle"/>
|
||||||
</artifact>
|
</artifact>
|
||||||
</component>
|
</component>
|
||||||
|
<component group="androidx.sharetarget" name="sharetarget" version="1.2.0-rc02">
|
||||||
|
<artifact name="sharetarget-1.2.0-rc02.aar">
|
||||||
|
<sha256 value="adbfcc4e46b85303cf6ef7d9eec02bc19c34459b33a928159a05c4a86dc96aa9" origin="Generated by Gradle"/>
|
||||||
|
</artifact>
|
||||||
|
<artifact name="sharetarget-1.2.0-rc02.module">
|
||||||
|
<sha256 value="d67917c9023eb61574a69c5ee0f4ab2f1292c25ed8f2fa58bfd44a8aa4f1aa34" origin="Generated by Gradle"/>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
||||||
<component group="androidx.slidingpanelayout" name="slidingpanelayout" version="1.2.0">
|
<component group="androidx.slidingpanelayout" name="slidingpanelayout" version="1.2.0">
|
||||||
<artifact name="slidingpanelayout-1.2.0.aar">
|
<artifact name="slidingpanelayout-1.2.0.aar">
|
||||||
<sha256 value="5f53339be2a4f90a9abea3571dd59e70a8a49e7f15dd82974a3898b4652e8714" origin="Generated by Gradle"/>
|
<sha256 value="5f53339be2a4f90a9abea3571dd59e70a8a49e7f15dd82974a3898b4652e8714" origin="Generated by Gradle"/>
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.PagingTest">
|
android:theme="@style/Theme.PagingTest">
|
||||||
<activity android:name=".MainActivity">
|
<activity android:name=".MainActivity"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ RUN docker/print-versions.sh docker/dependencies.txt
|
|||||||
|
|
||||||
ENV ANDROID_COMMAND_LINE_TOOLS_FILENAME commandlinetools-linux-7583922_latest.zip
|
ENV ANDROID_COMMAND_LINE_TOOLS_FILENAME commandlinetools-linux-7583922_latest.zip
|
||||||
ENV ANDROID_API_LEVELS android-32
|
ENV ANDROID_API_LEVELS android-32
|
||||||
ENV ANDROID_BUILD_TOOLS_VERSION 31.0.0
|
ENV ANDROID_BUILD_TOOLS_VERSION 32.0.0
|
||||||
|
|
||||||
ENV ANDROID_HOME /usr/local/android-sdk-linux
|
ENV ANDROID_HOME /usr/local/android-sdk-linux
|
||||||
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/bin
|
ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/cmdline-tools/bin
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.PagingTest">
|
android:theme="@style/Theme.PagingTest">
|
||||||
<activity android:name=".MainActivity">
|
<activity android:name=".MainActivity"
|
||||||
|
android:exported="true">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user