mobile/android/base/fxa/FxAccountConstants.java.in

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 #filter substitution
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 package org.mozilla.gecko.fxa;
michael@0 7
michael@0 8 import org.mozilla.gecko.background.common.GlobalConstants;
michael@0 9 import org.mozilla.gecko.background.common.log.Logger;
michael@0 10
michael@0 11 public class FxAccountConstants {
michael@0 12 public static final String GLOBAL_LOG_TAG = "FxAccounts";
michael@0 13 public static final String ACCOUNT_TYPE = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@";
michael@0 14
michael@0 15 public static final String DEFAULT_AUTH_SERVER_ENDPOINT = "https://api.accounts.firefox.com/v1";
michael@0 16 public static final String DEFAULT_TOKEN_SERVER_ENDPOINT = "https://token.services.mozilla.com/1.0/sync/1.5";
michael@0 17
michael@0 18 public static final String STAGE_TOKEN_SERVER_ENDPOINT = "https://token.stage.mozaws.net/1.0/sync/1.5";
michael@0 19
michael@0 20 // For extra debugging. Not final so it can be changed from Fennec, or from
michael@0 21 // an add-on.
michael@0 22 public static boolean LOG_PERSONAL_INFORMATION = false;
michael@0 23
michael@0 24 public static void pii(String tag, String message) {
michael@0 25 if (LOG_PERSONAL_INFORMATION) {
michael@0 26 Logger.info(tag, "$$FxA PII$$: " + message);
michael@0 27 }
michael@0 28 }
michael@0 29
michael@0 30 // You must be at least 14 years old to create a Firefox Account.
michael@0 31 public static final int MINIMUM_AGE_TO_CREATE_AN_ACCOUNT = 14;
michael@0 32
michael@0 33 // You must wait 15 minutes after failing an age check before trying to create a different account.
michael@0 34 public static final long MINIMUM_TIME_TO_WAIT_AFTER_AGE_CHECK_FAILED_IN_MILLISECONDS = 15 * 60 * 1000;
michael@0 35
michael@0 36 public static final String USER_AGENT = "Firefox-Android-FxAccounts/" + GlobalConstants.MOZ_APP_VERSION + " (" + GlobalConstants.MOZ_APP_DISPLAYNAME + ")";
michael@0 37
michael@0 38 public static final String ACCOUNT_PICKLE_FILENAME = "fxa.account.json";
michael@0 39
michael@0 40 /**
michael@0 41 * This action is broadcast when an Android Firefox Account is deleted.
michael@0 42 * This allows each installed Firefox to delete any Firefox Account pickle
michael@0 43 * file.
michael@0 44 * <p>
michael@0 45 * It is protected by signing-level permission PER_ACCOUNT_TYPE_PERMISSION and
michael@0 46 * can be received only by Firefox channels sharing the same Android Firefox
michael@0 47 * Account type.
michael@0 48 * <p>
michael@0 49 * See {@link org.mozilla.gecko.fxa.AndroidFxAccount#makeDeletedAccountIntent(android.content.Context, android.accounts.Account)}
michael@0 50 * for contents of the intent.
michael@0 51 *
michael@0 52 * See bug 790931 for additional information in the context of Sync.
michael@0 53 */
michael@0 54 public static final String ACCOUNT_DELETED_ACTION = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@.accounts.ACCOUNT_DELETED_ACTION";
michael@0 55
michael@0 56 /**
michael@0 57 * Version number of contents of SYNC_ACCOUNT_DELETED_ACTION intent.
michael@0 58 */
michael@0 59 public static final long ACCOUNT_DELETED_INTENT_VERSION = 1;
michael@0 60
michael@0 61 public static final String ACCOUNT_DELETED_INTENT_VERSION_KEY = "account_deleted_intent_version";
michael@0 62 public static final String ACCOUNT_DELETED_INTENT_ACCOUNT_KEY = "account_deleted_intent_account";
michael@0 63
michael@0 64 /**
michael@0 65 * This signing-level permission protects broadcast intents that should be
michael@0 66 * received only by Firefox channels sharing the same Android Firefox Account type.
michael@0 67 */
michael@0 68 public static final String PER_ACCOUNT_TYPE_PERMISSION = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@.permission.PER_ACCOUNT_TYPE";
michael@0 69 }

mercurial