Bug 1178378 - Enable profile click action based on native accounts UI r=nalexander

--HG--
extra : commitid : AtIRplgWF9O
extra : rebase_source : 9ccd0809733de5b0d7c78540b9622a17635b7d97
This commit is contained in:
vivek 2015-09-22 22:02:40 +03:00
parent 8556917eae
commit e1f1409f3d
3 changed files with 9 additions and 8 deletions

View File

@ -32,7 +32,7 @@ public class FxAccountConstants {
// Key for avatar URI in profile JSON.
public static final String KEY_PROFILE_JSON_AVATAR = "avatar";
// Key for username in profile JSON.
public static final String KEY_PROFILE_JSON_USERNAME = "username";
public static final String KEY_PROFILE_JSON_USERNAME = "displayName";
// You must wait 15 minutes after failing an age check before trying to create a different account.
public static final long MINIMUM_TIME_TO_WAIT_AFTER_AGE_CHECK_FAILED_IN_MILLISECONDS = 15 * 60 * 1000;

View File

@ -242,6 +242,13 @@ public class FxAccountStatusFragment
@Override
public boolean onPreferenceClick(Preference preference) {
if (preference == profilePreference) {
if (!AppConstants.MOZ_ANDROID_NATIVE_ACCOUNT_UI) {
// There is no native equivalent, bind the click action to fire an intent.
ActivityUtils.openURLInFennec(getActivity().getApplicationContext(), "about:accounts?action=avatar");
}
}
if (preference == manageAccountPreference) {
// There's no native equivalent, so no need to re-direct through an Intent filter.
ActivityUtils.openURLInFennec(getActivity().getApplicationContext(), "about:accounts?action=manage");
@ -482,7 +489,6 @@ public class FxAccountStatusFragment
FxAccountSyncStatusHelper.getInstance().startObserving(syncStatusDelegate);
if (AppConstants.MOZ_ANDROID_FIREFOX_ACCOUNT_PROFILES) {
profilePreference.getIntent().setData(Uri.parse("about:accounts?action=avatar"));
// Register a local broadcast receiver to get profile cached notification.
final IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(FxAccountConstants.ACCOUNT_PROFILE_JSON_UPDATED_ACTION);

View File

@ -10,12 +10,7 @@
android:key="profile"
android:icon="@drawable/sync_avatar_default"
android:persistent="false"
android:title="" >
<intent
android:action="android.intent.action.VIEW"
android:targetClass="@string/browser_intent_class"
android:targetPackage="@string/browser_intent_package" />
</Preference>
android:title="" />
<Preference
android:editable="false"
android:key="email"