Allow submitting a debug log during registration.

pull/1/head
Greyson Parrelli 6 years ago
parent a1b2887bf3
commit 440ad70d79

@ -527,6 +527,10 @@
<string name="RegistrationActivity_signal_needs_access_to_your_contacts_and_media_in_order_to_connect_with_friends">Signal needs access to your contacts and media in order to connect with friends, exchange messages, and make secure calls</string>
<string name="RegistrationActivity_unable_to_connect_to_service">Unable to connect to service. Please check network connection and try again.</string>
<string name="RegistrationActivity_to_easily_verify_your_phone_number_signal_can_automatically_detect_your_verification_code">To easily verify your phone number, Signal can automatically detect your verification code if you allow Signal to view SMS messages.</string>
<plurals name="RegistrationActivity_debug_log_hint">
<item quantity="one">You are now %d step away from submitting a debug log.</item>
<item quantity="other">You are now %d steps away from submitting a debug log.</item>
</plurals>
<!-- ScribbleActivity -->
<string name="ScribbleActivity_save_failure">Failed to save image changes</string>

@ -109,6 +109,8 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
private static final int PICK_COUNTRY = 1;
private static final int SCENE_TRANSITION_DURATION = 250;
private static final int DEBUG_TAP_TARGET = 8;
private static final int DEBUG_TAP_ANNOUNCE = 4;
public static final String CHALLENGE_EVENT = "org.thoughtcrime.securesms.CHALLENGE_EVENT";
public static final String CHALLENGE_EXTRA = "CAAChallenge";
public static final String RE_REGISTRATION_EXTRA = "re_registration";
@ -148,6 +150,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
private RegistrationState registrationState;
private ChallengeReceiver challengeReceiver;
private SignalServiceAccountManager accountManager;
private int debugTapCounter;
@Override
@ -240,10 +243,24 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
else verificationCodeView.delete();
});
fab.setOnClickListener(this::onDebugClick);
fab.setRippleColor(Color.TRANSPARENT);
this.verificationCodeView.setOnCompleteListener(this);
EventBus.getDefault().register(this);
}
private void onDebugClick(View view) {
debugTapCounter++;
if (debugTapCounter >= DEBUG_TAP_TARGET) {
startActivity(new Intent(this, LogSubmitActivity.class));
} else if (debugTapCounter >= DEBUG_TAP_ANNOUNCE) {
int remaining = DEBUG_TAP_TARGET - debugTapCounter;
Toast.makeText(this, getResources().getQuantityString(R.plurals.RegistrationActivity_debug_log_hint, remaining, remaining), Toast.LENGTH_SHORT).show();
}
}
@SuppressLint("ClickableViewAccessibility")
private void initializeSpinner() {
this.countrySpinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item);

Loading…
Cancel
Save