Bug 738676 - Pair a device not working a second time. r=rnewman, a=blocking-fennec

This commit is contained in:
Chenxia Liu 2012-05-08 15:14:48 -07:00
Родитель 355b1a1c9a
Коммит 964bf555d3
3 изменённых файлов: 19 добавлений и 4 удалений

Просмотреть файл

@ -38,6 +38,7 @@
package org.mozilla.gecko.sync.setup.activities; package org.mozilla.gecko.sync.setup.activities;
import org.mozilla.gecko.R; import org.mozilla.gecko.R;
import org.mozilla.gecko.sync.Logger;
import org.mozilla.gecko.sync.setup.Constants; import org.mozilla.gecko.sync.setup.Constants;
import android.app.Activity; import android.app.Activity;
@ -49,7 +50,6 @@ import android.view.View;
import android.widget.TextView; import android.widget.TextView;
public class SetupSuccessActivity extends Activity { public class SetupSuccessActivity extends Activity {
@SuppressWarnings("unused")
private final static String LOG_TAG = "SetupSuccessActivity"; private final static String LOG_TAG = "SetupSuccessActivity";
private TextView setupSubtitle; private TextView setupSubtitle;
private Context mContext; private Context mContext;
@ -70,12 +70,17 @@ public class SetupSuccessActivity extends Activity {
} }
} }
@Override
public void onDestroy() {
Logger.debug(LOG_TAG, "onDestroy() called.");
super.onDestroy();
}
/* Click Handlers */ /* Click Handlers */
public void settingsClickHandler(View target) { public void settingsClickHandler(View target) {
Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS); Intent intent = new Intent(Settings.ACTION_SYNC_SETTINGS);
intent.setFlags(Constants.FLAG_ACTIVITY_REORDER_TO_FRONT_NO_ANIMATION); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
startActivity(intent); startActivity(intent);
finish();
} }
public void pairClickHandler(View target) { public void pairClickHandler(View target) {

Просмотреть файл

@ -153,13 +153,21 @@ public class SetupSyncActivity extends AccountAuthenticatorActivity {
if (jClient != null) { if (jClient != null) {
jClient.abort(Constants.JPAKE_ERROR_USERABORT); jClient.abort(Constants.JPAKE_ERROR_USERABORT);
} }
if (pairWithPin) {
finish();
}
} }
@Override @Override
public void onNewIntent(Intent intent) { public void onNewIntent(Intent intent) {
Logger.debug(LOG_TAG, "Started SetupSyncActivity with new intent."); Logger.debug(LOG_TAG, "Started SetupSyncActivity with new intent.");
setIntent(intent); setIntent(intent);
onResume(); }
@Override
public void onDestroy() {
Logger.debug(LOG_TAG, "onDestroy() called.");
super.onDestroy();
} }
/* Click Handlers */ /* Click Handlers */

Просмотреть файл

@ -15,8 +15,10 @@
android:name="org.mozilla.gecko.sync.setup.activities.AccountActivity" android:name="org.mozilla.gecko.sync.setup.activities.AccountActivity"
android:windowSoftInputMode="adjustPan|stateHidden"/> android:windowSoftInputMode="adjustPan|stateHidden"/>
<activity <activity
android:noHistory="true"
android:name="org.mozilla.gecko.sync.setup.activities.SetupFailureActivity" /> android:name="org.mozilla.gecko.sync.setup.activities.SetupFailureActivity" />
<activity <activity
android:noHistory="true"
android:name="org.mozilla.gecko.sync.setup.activities.SetupSuccessActivity" /> android:name="org.mozilla.gecko.sync.setup.activities.SetupSuccessActivity" />
<receiver <receiver
android:name="org.mozilla.gecko.sync.receivers.UpgradeReceiver"> android:name="org.mozilla.gecko.sync.receivers.UpgradeReceiver">