2015-01-19 20:24:10 -08:00
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
2015-12-03 14:39:13 -08:00
|
|
|
import android.content.Intent;
|
2015-01-19 20:24:10 -08:00
|
|
|
import android.os.Bundle;
|
2020-08-19 10:06:26 +10:00
|
|
|
import androidx.appcompat.app.AlertDialog;
|
2015-01-23 18:38:45 -10:00
|
|
|
import android.view.Window;
|
2015-01-19 20:24:10 -08:00
|
|
|
|
2019-07-24 12:30:23 +10:00
|
|
|
import network.loki.messenger.R;
|
|
|
|
|
2015-01-19 20:24:10 -08:00
|
|
|
public class DeviceProvisioningActivity extends PassphraseRequiredActionBarActivity {
|
|
|
|
|
2018-02-01 19:22:48 -08:00
|
|
|
@SuppressWarnings("unused")
|
2015-01-19 20:24:10 -08:00
|
|
|
private static final String TAG = DeviceProvisioningActivity.class.getSimpleName();
|
|
|
|
|
|
|
|
@Override
|
2014-12-15 12:25:55 -08:00
|
|
|
protected void onPreCreate() {
|
2015-01-23 18:38:45 -10:00
|
|
|
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
|
2014-12-15 12:25:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2018-02-01 19:22:48 -08:00
|
|
|
protected void onCreate(Bundle bundle, boolean ready) {
|
|
|
|
assert getSupportActionBar() != null;
|
2015-01-23 18:38:45 -10:00
|
|
|
getSupportActionBar().hide();
|
|
|
|
|
2015-12-03 14:39:13 -08:00
|
|
|
AlertDialog dialog = new AlertDialog.Builder(this)
|
|
|
|
.setTitle(getString(R.string.DeviceProvisioningActivity_link_a_signal_device))
|
|
|
|
.setMessage(getString(R.string.DeviceProvisioningActivity_it_looks_like_youre_trying_to_link_a_signal_device_using_a_3rd_party_scanner))
|
2018-02-01 19:22:48 -08:00
|
|
|
.setPositiveButton(R.string.DeviceProvisioningActivity_continue, (dialog1, which) -> {
|
|
|
|
Intent intent = new Intent(DeviceProvisioningActivity.this, DeviceActivity.class);
|
|
|
|
intent.putExtra("add", true);
|
|
|
|
startActivity(intent);
|
|
|
|
finish();
|
2015-12-03 14:39:13 -08:00
|
|
|
})
|
2018-02-01 19:22:48 -08:00
|
|
|
.setNegativeButton(R.string.DeviceProvisioningActivity_cancel, (dialog12, which) -> {
|
|
|
|
dialog12.dismiss();
|
|
|
|
finish();
|
2015-12-03 14:39:13 -08:00
|
|
|
})
|
2018-02-01 19:22:48 -08:00
|
|
|
.setOnDismissListener(dialog13 -> finish())
|
2015-12-03 14:39:13 -08:00
|
|
|
.create();
|
|
|
|
|
|
|
|
dialog.setIcon(getResources().getDrawable(R.drawable.icon_dialog));
|
2015-05-20 23:36:30 +02:00
|
|
|
dialog.show();
|
2015-01-19 20:24:10 -08:00
|
|
|
}
|
|
|
|
}
|