Skip to content

Commit 27ffebd

Browse files
committed
Merge remote-tracking branch 'upstream/master' into cust_remove_call_confirm
2 parents e217d0f + a3176bb commit 27ffebd

299 files changed

Lines changed: 16901 additions & 18010 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: https://signal.org/donate/

app/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ protobuf {
6161
}
6262
}
6363

64-
def canonicalVersionCode = 772
65-
def canonicalVersionName = "5.2.3"
64+
def canonicalVersionCode = 774
65+
def canonicalVersionName = "5.3.1"
6666

6767
def postFixSize = 100
6868
def abiPostFix = ['universal' : 0,
@@ -340,11 +340,11 @@ dependencies {
340340
implementation project(':video')
341341

342342
implementation 'org.signal:zkgroup-android:0.7.0'
343-
implementation 'org.whispersystems:signal-client-android:0.1.5'
343+
implementation 'org.whispersystems:signal-client-android:0.2.2'
344344
implementation 'com.google.protobuf:protobuf-javalite:3.10.0'
345345
implementation 'org.signal:argon2:13.1@aar'
346346

347-
implementation 'org.signal:ringrtc-android:2.8.9'
347+
implementation 'org.signal:ringrtc-android:2.8.10'
348348

349349
implementation "me.leolin:ShortcutBadger:1.1.16"
350350
implementation 'se.emilsjolander:stickylistheaders:2.7.0'

app/src/main/AndroidManifest.xml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,15 @@
159159
<activity android:name=".preferences.MmsPreferencesActivity"
160160
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
161161

162+
<activity android:name=".sharing.interstitial.ShareInterstitialActivity"
163+
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
164+
android:windowSoftInputMode="adjustResize" />
165+
162166
<activity android:name=".sharing.ShareActivity"
163167
android:theme="@style/Theme.Signal.DayNight.NoActionBar"
164168
android:excludeFromRecents="true"
165169
android:launchMode="singleTask"
166170
android:taskAffinity=""
167-
android:noHistory="true"
168171
android:windowSoftInputMode="stateHidden"
169172
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize">
170173
<intent-filter>
@@ -354,6 +357,16 @@
354357
</intent-filter>
355358
</activity>
356359

360+
<activity android:name=".wallpaper.ChatWallpaperActivity"
361+
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
362+
android:windowSoftInputMode="stateAlwaysHidden">
363+
</activity>
364+
365+
<activity android:name=".wallpaper.ChatWallpaperPreviewActivity"
366+
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
367+
android:windowSoftInputMode="stateAlwaysHidden">
368+
</activity>
369+
357370
<activity android:name=".registration.RegistrationNavigationActivity"
358371
android:launchMode="singleTask"
359372
android:theme="@style/TextSecure.LightRegistrationTheme"
@@ -460,6 +473,10 @@
460473
android:theme="@style/TextSecure.LightRegistrationTheme"
461474
android:windowSoftInputMode="stateVisible|adjustResize" />
462475

476+
<activity android:name=".profiles.manage.ManageProfileActivity"
477+
android:theme="@style/TextSecure.LightTheme"
478+
android:windowSoftInputMode="stateVisible|adjustResize" />
479+
463480
<activity android:name=".lock.v2.CreateKbsPinActivity"
464481
android:theme="@style/TextSecure.LightRegistrationTheme"
465482
android:windowSoftInputMode="adjustResize"
@@ -535,6 +552,15 @@
535552
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize|uiMode"
536553
android:launchMode="singleTask" />
537554

555+
<activity android:name=".wallpaper.crop.WallpaperImageSelectionActivity"
556+
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
557+
android:theme="@style/TextSecure.FullScreenMedia" />
558+
559+
<activity android:name=".wallpaper.crop.WallpaperCropActivity"
560+
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"
561+
android:screenOrientation="portrait"
562+
android:theme="@style/Theme.Signal.WallpaperCropper" />
563+
538564
<service android:enabled="true" android:name=".service.WebRtcCallService"/>
539565
<service android:enabled="true" android:name=".service.ApplicationMigrationService"/>
540566
<service android:enabled="true" android:exported="false" android:name=".service.KeyCachingService"/>

app/src/main/java/org/thoughtcrime/securesms/AppInitialization.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public static void onFirstEverAppLaunch(@NonNull Context context) {
4343
SignalStore.onFirstEverAppLaunch();
4444
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.ZOZO.getPackId(), BlessedPacks.ZOZO.getPackKey(), false));
4545
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.BANDIT.getPackId(), BlessedPacks.BANDIT.getPackKey(), false));
46+
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.DAY_BY_DAY.getPackId(), BlessedPacks.DAY_BY_DAY.getPackKey(), false));
4647
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_HANDS.getPackId(), BlessedPacks.SWOON_HANDS.getPackKey()));
4748
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_FACES.getPackId(), BlessedPacks.SWOON_FACES.getPackKey()));
4849
}
@@ -55,6 +56,7 @@ public static void onPostBackupRestore(@NonNull Context context) {
5556
SignalStore.onboarding().clearAll();
5657
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.ZOZO.getPackId(), BlessedPacks.ZOZO.getPackKey(), false));
5758
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.BANDIT.getPackId(), BlessedPacks.BANDIT.getPackKey(), false));
59+
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.DAY_BY_DAY.getPackId(), BlessedPacks.DAY_BY_DAY.getPackKey(), false));
5860
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_HANDS.getPackId(), BlessedPacks.SWOON_HANDS.getPackKey()));
5961
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_FACES.getPackId(), BlessedPacks.SWOON_FACES.getPackKey()));
6062
}
@@ -76,6 +78,7 @@ public static void onRepairFirstEverAppLaunch(@NonNull Context context) {
7678
SignalStore.onFirstEverAppLaunch();
7779
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.ZOZO.getPackId(), BlessedPacks.ZOZO.getPackKey(), false));
7880
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.BANDIT.getPackId(), BlessedPacks.BANDIT.getPackKey(), false));
81+
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forInstall(BlessedPacks.DAY_BY_DAY.getPackId(), BlessedPacks.DAY_BY_DAY.getPackKey(), false));
7982
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_HANDS.getPackId(), BlessedPacks.SWOON_HANDS.getPackKey()));
8083
ApplicationDependencies.getJobManager().add(StickerPackDownloadJob.forReference(BlessedPacks.SWOON_FACES.getPackId(), BlessedPacks.SWOON_FACES.getPackKey()));
8184
}

app/src/main/java/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import org.thoughtcrime.securesms.preferences.widgets.ProfilePreference;
4646
import org.thoughtcrime.securesms.preferences.widgets.UsernamePreference;
4747
import org.thoughtcrime.securesms.profiles.edit.EditProfileActivity;
48+
import org.thoughtcrime.securesms.profiles.manage.ManageProfileActivity;
4849
import org.thoughtcrime.securesms.recipients.Recipient;
4950
import org.thoughtcrime.securesms.service.KeyCachingService;
5051
import org.thoughtcrime.securesms.util.CachedInflater;
@@ -345,15 +346,15 @@ public boolean onPreferenceClick(Preference preference) {
345346
private class ProfileClickListener implements Preference.OnPreferenceClickListener {
346347
@Override
347348
public boolean onPreferenceClick(Preference preference) {
348-
requireActivity().startActivity(EditProfileActivity.getIntentForUserProfileEdit(preference.getContext()));
349+
requireActivity().startActivity(ManageProfileActivity.getIntent(requireActivity()));
349350
return true;
350351
}
351352
}
352353

353354
private class UsernameClickListener implements Preference.OnPreferenceClickListener {
354355
@Override
355356
public boolean onPreferenceClick(Preference preference) {
356-
requireActivity().startActivity(EditProfileActivity.getIntentForUsernameEdit(preference.getContext()));
357+
requireActivity().startActivity(ManageProfileActivity.getIntentForUsernameEdit(preference.getContext()));
357358
return true;
358359
}
359360
}

app/src/main/java/org/thoughtcrime/securesms/BindableConversationItem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ void bind(@NonNull LifecycleOwner lifecycleOwner,
3636
@NonNull Set<ConversationMessage> batchSelected,
3737
@NonNull Recipient recipients,
3838
@Nullable String searchQuery,
39-
boolean pulseMention);
39+
boolean pulseMention,
40+
boolean hasWallpaper);
4041

4142
ConversationMessage getConversationMessage();
4243

app/src/main/java/org/thoughtcrime/securesms/ContactSelectionActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ private void initializeToolbar() {
9999

100100
private void initializeResources() {
101101
contactsFragment = (ContactSelectionListFragment) getSupportFragmentManager().findFragmentById(R.id.contact_selection_list_fragment);
102-
contactsFragment.setOnContactSelectedListener(this);
103102
contactsFragment.setOnRefreshListener(this);
104103
}
105104

app/src/main/java/org/thoughtcrime/securesms/ContactSelectionListFragment.java

Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -110,22 +110,26 @@ public final class ContactSelectionListFragment extends LoggingFragment
110110
public static final String SELECTION_LIMITS = "selection_limits";
111111
public static final String CURRENT_SELECTION = "current_selection";
112112
public static final String HIDE_COUNT = "hide_count";
113+
public static final String CAN_SELECT_SELF = "can_select_self";
114+
public static final String DISPLAY_CHIPS = "display_chips";
115+
116+
private ConstraintLayout constraintLayout;
117+
private TextView emptyText;
118+
private OnContactSelectedListener onContactSelectedListener;
119+
private SwipeRefreshLayout swipeRefresh;
120+
private View showContactsLayout;
121+
private Button showContactsButton;
122+
private TextView showContactsDescription;
123+
private ProgressWheel showContactsProgress;
124+
private String cursorFilter;
125+
private RecyclerView recyclerView;
126+
private RecyclerViewFastScroller fastScroller;
127+
private ContactSelectionListAdapter cursorRecyclerViewAdapter;
128+
private ChipGroup chipGroup;
129+
private HorizontalScrollView chipGroupScrollContainer;
130+
private WarningTextView groupLimit;
131+
private OnSelectionLimitReachedListener onSelectionLimitReachedListener;
113132

114-
private ConstraintLayout constraintLayout;
115-
private TextView emptyText;
116-
private OnContactSelectedListener onContactSelectedListener;
117-
private SwipeRefreshLayout swipeRefresh;
118-
private View showContactsLayout;
119-
private Button showContactsButton;
120-
private TextView showContactsDescription;
121-
private ProgressWheel showContactsProgress;
122-
private String cursorFilter;
123-
private RecyclerView recyclerView;
124-
private RecyclerViewFastScroller fastScroller;
125-
private ContactSelectionListAdapter cursorRecyclerViewAdapter;
126-
private ChipGroup chipGroup;
127-
private HorizontalScrollView chipGroupScrollContainer;
128-
private WarningTextView groupLimit;
129133

130134
@Nullable private FixedViewsAdapter headerAdapter;
131135
@Nullable private FixedViewsAdapter footerAdapter;
@@ -136,6 +140,7 @@ public final class ContactSelectionListFragment extends LoggingFragment
136140
private Set<RecipientId> currentSelection;
137141
private boolean isMulti;
138142
private boolean hideCount;
143+
private boolean canSelectSelf;
139144

140145
@Override
141146
public void onAttach(@NonNull Context context) {
@@ -148,6 +153,14 @@ public void onAttach(@NonNull Context context) {
148153
if (context instanceof ScrollCallback) {
149154
scrollCallback = (ScrollCallback) context;
150155
}
156+
157+
if (context instanceof OnContactSelectedListener) {
158+
onContactSelectedListener = (OnContactSelectedListener) context;
159+
}
160+
161+
if (context instanceof OnSelectionLimitReachedListener) {
162+
onSelectionLimitReachedListener = (OnSelectionLimitReachedListener) context;
163+
}
151164
}
152165

153166
@Override
@@ -217,6 +230,7 @@ public boolean canReuseUpdatedViewHolder(@NonNull RecyclerView.ViewHolder viewHo
217230
hideCount = intent.getBooleanExtra(HIDE_COUNT, false);
218231
selectionLimit = intent.getParcelableExtra(SELECTION_LIMITS);
219232
isMulti = selectionLimit != null;
233+
canSelectSelf = intent.getBooleanExtra(CAN_SELECT_SELF, !isMulti);
220234

221235
if (!isMulti) {
222236
selectionLimit = SelectionLimits.NO_LIMITS;
@@ -295,7 +309,7 @@ private void initializeCursor() {
295309
}
296310

297311
recyclerView.setAdapter(concatenateAdapter);
298-
recyclerView.addItemDecoration(new StickyHeaderDecoration(concatenateAdapter, true, true));
312+
recyclerView.addItemDecoration(new StickyHeaderDecoration(concatenateAdapter, true, true, 0));
299313
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
300314
@Override
301315
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
@@ -464,14 +478,18 @@ public void onItemClick(ContactSelectionListItem contact) {
464478
SelectedContact selectedContact = contact.isUsernameType() ? SelectedContact.forUsername(contact.getRecipientId().orNull(), contact.getNumber())
465479
: SelectedContact.forPhone(contact.getRecipientId().orNull(), contact.getNumber());
466480

467-
if (isMulti && Recipient.self().getId().equals(selectedContact.getOrCreateRecipientId(requireContext()))) {
481+
if (!canSelectSelf && Recipient.self().getId().equals(selectedContact.getOrCreateRecipientId(requireContext()))) {
468482
Toast.makeText(requireContext(), R.string.ContactSelectionListFragment_you_do_not_need_to_add_yourself_to_the_group, Toast.LENGTH_SHORT).show();
469483
return;
470484
}
471485

472486
if (!isMulti || !cursorRecyclerViewAdapter.isSelectedContact(selectedContact)) {
473487
if (selectionHardLimitReached()) {
474-
GroupLimitDialog.showHardLimitMessage(requireContext());
488+
if (onSelectionLimitReachedListener != null) {
489+
onSelectionLimitReachedListener.onHardLimitReached(selectionLimit.getHardLimit());
490+
} else {
491+
GroupLimitDialog.showHardLimitMessage(requireContext());
492+
}
475493
return;
476494
}
477495

@@ -489,11 +507,11 @@ public void onItemClick(ContactSelectionListItem contact) {
489507
if (onContactSelectedListener != null) {
490508
if (onContactSelectedListener.onBeforeContactSelected(Optional.of(recipient.getId()), null)) {
491509
markContactSelected(selected);
492-
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
510+
cursorRecyclerViewAdapter.notifyItemRangeChanged(0, cursorRecyclerViewAdapter.getItemCount(), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
493511
}
494512
} else {
495513
markContactSelected(selected);
496-
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
514+
cursorRecyclerViewAdapter.notifyItemRangeChanged(0, cursorRecyclerViewAdapter.getItemCount(), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
497515
}
498516
} else {
499517
new AlertDialog.Builder(requireContext())
@@ -507,16 +525,16 @@ public void onItemClick(ContactSelectionListItem contact) {
507525
if (onContactSelectedListener != null) {
508526
if (onContactSelectedListener.onBeforeContactSelected(contact.getRecipientId(), contact.getNumber())) {
509527
markContactSelected(selectedContact);
510-
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
528+
cursorRecyclerViewAdapter.notifyItemRangeChanged(0, cursorRecyclerViewAdapter.getItemCount(), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
511529
}
512530
} else {
513531
markContactSelected(selectedContact);
514-
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
532+
cursorRecyclerViewAdapter.notifyItemRangeChanged(0, cursorRecyclerViewAdapter.getItemCount(), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
515533
}
516534
}
517535
} else {
518536
markContactUnselected(selectedContact);
519-
cursorRecyclerViewAdapter.notifyItemChanged(recyclerView.getChildAdapterPosition(contact), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
537+
cursorRecyclerViewAdapter.notifyItemRangeChanged(0, cursorRecyclerViewAdapter.getItemCount(), ContactSelectionListAdapter.PAYLOAD_SELECTION_CHANGE);
520538

521539
if (onContactSelectedListener != null) {
522540
onContactSelectedListener.onContactDeselected(contact.getRecipientId(), contact.getNumber());
@@ -611,7 +629,11 @@ private void addChip(@NonNull ContactChip chip) {
611629
chipGroup.addView(chip);
612630
updateGroupLimit(getChipCount());
613631
if (selectionWarningLimitReachedExactly()) {
614-
GroupLimitDialog.showRecommendedLimitMessage(requireContext());
632+
if (onSelectionLimitReachedListener != null) {
633+
onSelectionLimitReachedListener.onSuggestedLimitReached(selectionLimit.getRecommendedLimit());
634+
} else {
635+
GroupLimitDialog.showRecommendedLimitMessage(requireContext());
636+
}
615637
}
616638
}
617639

@@ -633,6 +655,10 @@ private void registerChipRecipientObserver(@NonNull ContactChip chip, @Nullable
633655
}
634656

635657
private void setChipGroupVisibility(int visibility) {
658+
if (!requireActivity().getIntent().getBooleanExtra(DISPLAY_CHIPS, true)) {
659+
return;
660+
}
661+
636662
TransitionManager.beginDelayedTransition(constraintLayout, new AutoTransition().setDuration(CHIP_GROUP_REVEAL_DURATION_MS));
637663

638664
ConstraintSet constraintSet = new ConstraintSet();
@@ -641,10 +667,6 @@ private void setChipGroupVisibility(int visibility) {
641667
constraintSet.applyTo(constraintLayout);
642668
}
643669

644-
public void setOnContactSelectedListener(OnContactSelectedListener onContactSelectedListener) {
645-
this.onContactSelectedListener = onContactSelectedListener;
646-
}
647-
648670
public void setOnRefreshListener(SwipeRefreshLayout.OnRefreshListener onRefreshListener) {
649671
this.swipeRefresh.setOnRefreshListener(onRefreshListener);
650672
}
@@ -660,6 +682,11 @@ public interface OnContactSelectedListener {
660682
void onContactDeselected(Optional<RecipientId> recipientId, String number);
661683
}
662684

685+
public interface OnSelectionLimitReachedListener {
686+
void onSuggestedLimitReached(int limit);
687+
void onHardLimitReached(int limit);
688+
}
689+
663690
public interface ListCallback {
664691
void onInvite();
665692
void onNewGroup(boolean forceV1);

app/src/main/java/org/thoughtcrime/securesms/InviteActivity.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ private void initializeResources() {
107107
inviteText.setText(getString(R.string.InviteActivity_lets_switch_to_signal, getString(R.string.install_url)));
108108
updateSmsButtonText(contactsFragment.getSelectedContacts().size());
109109

110-
contactsFragment.setOnContactSelectedListener(this);
111110
smsCancelButton.setOnClickListener(new SmsCancelClickListener());
112111
smsSendButton.setOnClickListener(new SmsSendClickListener());
113112
contactFilter.setOnFilterChangedListener(new ContactFilterChangedListener());

app/src/main/java/org/thoughtcrime/securesms/blocked/BlockedUsersActivity.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ public void handleAddUserToBlockedList() {
124124
ContactSelectionListFragment fragment = new ContactSelectionListFragment();
125125
Intent intent = getIntent();
126126

127-
fragment.setOnContactSelectedListener(this);
128-
129127
intent.putExtra(ContactSelectionListFragment.REFRESHABLE, false);
130128
intent.putExtra(ContactSelectionListFragment.SELECTION_LIMITS, 1);
131129
intent.putExtra(ContactSelectionListFragment.HIDE_COUNT, true);

0 commit comments

Comments
 (0)