2015-01-20 04:24:10 +00:00
|
|
|
package org.thoughtcrime.securesms;
|
|
|
|
|
2015-01-24 04:38:45 +00:00
|
|
|
import android.content.DialogInterface;
|
2015-12-03 22:39:13 +00:00
|
|
|
import android.content.Intent;
|
2015-01-20 04:24:10 +00:00
|
|
|
import android.os.Bundle;
|
2014-12-15 20:25:55 +00:00
|
|
|
import android.support.annotation.NonNull;
|
2015-05-20 21:36:30 +00:00
|
|
|
import android.support.v7.app.AlertDialog;
|
2015-01-24 04:38:45 +00:00
|
|
|
import android.view.Window;
|
2015-01-20 04:24:10 +00:00
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.MasterSecret;
|
2015-01-24 04:38:45 +00:00
|
|
|
|
2015-01-20 04:24:10 +00:00
|
|
|
public class DeviceProvisioningActivity extends PassphraseRequiredActionBarActivity {
|
|
|
|
|
|
|
|
private static final String TAG = DeviceProvisioningActivity.class.getSimpleName();
|
|
|
|
|
|
|
|
@Override
|
2014-12-15 20:25:55 +00:00
|
|
|
protected void onPreCreate() {
|
2015-01-24 04:38:45 +00:00
|
|
|
supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
|
2014-12-15 20:25:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void onCreate(Bundle bundle, @NonNull MasterSecret masterSecret) {
|
2015-01-24 04:38:45 +00:00
|
|
|
getSupportActionBar().hide();
|
|
|
|
|
2015-12-03 22:39:13 +00: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))
|
|
|
|
.setPositiveButton(R.string.DeviceProvisioningActivity_continue, new DialogInterface.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
Intent intent = new Intent(DeviceProvisioningActivity.this, DeviceActivity.class);
|
|
|
|
intent.putExtra("add", true);
|
|
|
|
startActivity(intent);
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.setNegativeButton(R.string.DeviceProvisioningActivity_cancel, new DialogInterface.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
public void onClick(DialogInterface dialog, int which) {
|
|
|
|
dialog.dismiss();
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
|
|
|
@Override
|
|
|
|
public void onDismiss(DialogInterface dialog) {
|
|
|
|
finish();
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.create();
|
|
|
|
|
|
|
|
dialog.setIcon(getResources().getDrawable(R.drawable.icon_dialog));
|
2015-05-20 21:36:30 +00:00
|
|
|
dialog.show();
|
2015-01-20 04:24:10 +00:00
|
|
|
}
|
|
|
|
}
|