Backed out 2 changesets (bug 984503) for android build bustage

Backed out changeset 579667582c6a (bug 984503)
Backed out changeset 56c4334e838f (bug 984503)
This commit is contained in:
Wes Kocher 2014-08-29 12:30:33 -07:00
parent 0992863beb
commit 7cfba5fa6e
12 changed files with 8 additions and 132 deletions

View File

@ -4,33 +4,18 @@
package org.mozilla.gecko.fxa.activities;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.R;
import org.mozilla.gecko.background.common.log.Logger;
import org.mozilla.gecko.fxa.FirefoxAccounts;
import org.mozilla.gecko.fxa.authenticator.AndroidFxAccount;
import org.mozilla.gecko.sync.Utils;
import org.mozilla.gecko.sync.setup.activities.LocaleAware.LocaleAwareFragmentActivity;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;
/**
* Activity which displays account status.
@ -108,63 +93,6 @@ public class FxAccountStatusActivity extends LocaleAwareFragmentActivity {
return new AndroidFxAccount(this, account);
}
/**
* Helper function to maybe remove the given Android account.
*/
@SuppressLint("InlinedApi")
public void maybeDeleteAndroidAccount(final Account account) {
if (account == null) {
Logger.warn(LOG_TAG, "Trying to delete null account; ignoring request.");
return;
}
final AccountManagerCallback<Boolean> callback = new AccountManagerCallback<Boolean>() {
@Override
public void run(AccountManagerFuture<Boolean> future) {
Logger.info(LOG_TAG, "Account " + Utils.obfuscateEmail(account.name) + " removed.");
final Activity activity = FxAccountStatusActivity.this;
final String text = activity.getResources().getString(R.string.fxaccount_remove_account_toast, account.name);
Toast.makeText(activity, text, Toast.LENGTH_LONG).show();
finish();
}
};
/*
* Get the best dialog icon from the theme on v11+.
* See http://stackoverflow.com/questions/14910536/android-dialog-theme-makes-icon-too-light/14910945#14910945.
*/
final int icon;
if (AppConstants.Versions.feature11Plus) {
final TypedValue typedValue = new TypedValue();
getTheme().resolveAttribute(android.R.attr.alertDialogIcon, typedValue, true);
icon = typedValue.resourceId;
} else {
icon = android.R.drawable.ic_dialog_alert;
}
final AlertDialog dialog = new AlertDialog.Builder(this)
.setTitle(R.string.fxaccount_remove_account_dialog_title)
.setIcon(icon)
.setMessage(R.string.fxaccount_remove_account_dialog_message)
.setPositiveButton(android.R.string.ok, new Dialog.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
AccountManager.get(FxAccountStatusActivity.this).removeAccount(account, callback, null);
}
})
.setNegativeButton(android.R.string.cancel, new Dialog.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
})
.create();
dialog.show();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
@ -172,17 +100,7 @@ public class FxAccountStatusActivity extends LocaleAwareFragmentActivity {
case android.R.id.home:
finish();
return true;
case R.id.remove_account:
maybeDeleteAndroidAccount(FirefoxAccounts.getFirefoxAccount(this));
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
final MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.fxaccount_status_menu, menu);
return super.onCreateOptionsMenu(menu);
};
}

View File

@ -21,7 +21,6 @@ import org.mozilla.gecko.fxa.tasks.FxAccountCodeResender;
import org.mozilla.gecko.sync.ExtendedJSONObject;
import org.mozilla.gecko.sync.SharedPreferencesClientsDataDelegate;
import org.mozilla.gecko.sync.SyncConfiguration;
import org.mozilla.gecko.util.HardwareUtils;
import android.accounts.Account;
import android.content.ContentResolver;
@ -85,7 +84,6 @@ public class FxAccountStatusFragment
protected EditTextPreference deviceNamePreference;
protected Preference syncServerPreference;
protected Preference morePreference;
protected volatile AndroidFxAccount fxAccount;
// The contract is: when fxAccount is non-null, then clientsDataDelegate is
@ -113,13 +111,6 @@ public class FxAccountStatusFragment
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// We need to do this before we can query the hardware menu button state.
// We're guaranteed to have an activity at this point (onAttach is called
// before onCreate). It's okay to call this multiple times (with different
// contexts).
HardwareUtils.init(getActivity());
addPreferences();
}
@ -164,12 +155,6 @@ public class FxAccountStatusFragment
deviceNamePreference.setOnPreferenceChangeListener(this);
syncServerPreference = ensureFindPreference("sync_server");
morePreference = ensureFindPreference("more");
morePreference.setOnPreferenceClickListener(this);
if (HardwareUtils.hasMenuButton()) {
syncCategory.removePreference(morePreference);
}
}
/**
@ -224,11 +209,6 @@ public class FxAccountStatusFragment
return true;
}
if (preference == morePreference) {
getActivity().openOptionsMenu();
return true;
}
return false;
}

View File

@ -206,15 +206,6 @@
the two uses differently. -->
<!ENTITY fxaccount_status_linktos 'Terms of Service'>
<!ENTITY fxaccount_status_linkprivacy 'Privacy Notice'>
<!ENTITY fxaccount_status_more 'More&ellipsis;'>
<!ENTITY fxaccount_remove_account_dialog_title 'Remove Firefox Account?'>
<!ENTITY fxaccount_remove_account_dialog_message '&brandShortName; will stop syncing with your account, but wont delete any of your browsing data on this device.'>
<!-- Localization note: format string below will be replaced
with the Firefox Account's email address. -->
<!ENTITY fxaccount_remove_account_toast 'Firefox Account &formatS; removed.'>
<!ENTITY fxaccount_remove_account_menu_item 'Remove Account'>
<!-- Localization note: this is the name shown by the Android system
itself for a Firefox Account. Don't localize this. -->
@ -244,6 +235,6 @@
<!ENTITY fxaccount_remote_error_COULD_NOT_CONNECT 'Cannot connect to network'>
<!ENTITY fxaccount_sync_sign_in_error_notification_title2 '&syncBrand.shortName.label; is not connected'>
<!-- Localization note: the format string below will be replaced
<!-- Note to translators: the format string below will be replaced
with the Firefox Account's email address. -->
<!ENTITY fxaccount_sync_sign_in_error_notification_text2 'Tap to sign in as &formatS;'>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/remove_account"
android:title="@string/fxaccount_remove_account_menu_item" />
</menu>

View File

@ -78,18 +78,12 @@
android:persistent="false"
android:title="@string/fxaccount_status_device_name" />
<Preference
<Preference
android:editable="false"
android:key="sync_server"
android:persistent="false"
android:title="@string/fxaccount_status_sync_server" />
<Preference
android:editable="false"
android:key="more"
android:persistent="false"
android:title="@string/fxaccount_status_more" />
</PreferenceCategory>
<PreferenceCategory
android:key="legal_category"

View File

@ -190,7 +190,6 @@
<string name="fxaccount_status_legal">&fxaccount_status_legal;</string>
<string name="fxaccount_status_linktos">&fxaccount_status_linktos;</string>
<string name="fxaccount_status_linkprivacy">&fxaccount_status_linkprivacy;</string>
<string name="fxaccount_status_more">&fxaccount_status_more;</string>
<string name="fxaccount_label">&fxaccount_account_type_label;</string>
@ -209,9 +208,3 @@
<string name="fxaccount_sync_sign_in_error_notification_title">&fxaccount_sync_sign_in_error_notification_title2;</string>
<string name="fxaccount_sync_sign_in_error_notification_text">&fxaccount_sync_sign_in_error_notification_text2;</string>
<!-- Remove Account -->
<string name="fxaccount_remove_account_dialog_title">&fxaccount_remove_account_dialog_title;</string>
<string name="fxaccount_remove_account_dialog_message">&fxaccount_remove_account_dialog_message;</string>
<string name="fxaccount_remove_account_toast">&fxaccount_remove_account_toast;</string>
<string name="fxaccount_remove_account_menu_item">&fxaccount_remove_account_menu_item;</string>

View File

@ -60,3 +60,4 @@ public final class AuthOption {
}
}

View File

@ -226,3 +226,4 @@ public class DeflateInputStream extends InputStream
}
}

View File

@ -45,3 +45,4 @@ public interface HttpExecutionAware {
void setCancellable(Cancellable cancellable);
}

View File

@ -129,3 +129,4 @@ final class DistinguishedNameParser {
}
}

View File

@ -142,3 +142,4 @@ public class Header implements Iterable<MinimalField> {
}
}

View File

@ -326,3 +326,4 @@ public class PoolingClientConnectionManager implements ClientConnectionManager,
}
}