1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/fxa/FxAccountConstants.java.in Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,69 @@ 1.4 +#filter substitution 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +package org.mozilla.gecko.fxa; 1.10 + 1.11 +import org.mozilla.gecko.background.common.GlobalConstants; 1.12 +import org.mozilla.gecko.background.common.log.Logger; 1.13 + 1.14 +public class FxAccountConstants { 1.15 + public static final String GLOBAL_LOG_TAG = "FxAccounts"; 1.16 + public static final String ACCOUNT_TYPE = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@"; 1.17 + 1.18 + public static final String DEFAULT_AUTH_SERVER_ENDPOINT = "https://api.accounts.firefox.com/v1"; 1.19 + public static final String DEFAULT_TOKEN_SERVER_ENDPOINT = "https://token.services.mozilla.com/1.0/sync/1.5"; 1.20 + 1.21 + public static final String STAGE_TOKEN_SERVER_ENDPOINT = "https://token.stage.mozaws.net/1.0/sync/1.5"; 1.22 + 1.23 + // For extra debugging. Not final so it can be changed from Fennec, or from 1.24 + // an add-on. 1.25 + public static boolean LOG_PERSONAL_INFORMATION = false; 1.26 + 1.27 + public static void pii(String tag, String message) { 1.28 + if (LOG_PERSONAL_INFORMATION) { 1.29 + Logger.info(tag, "$$FxA PII$$: " + message); 1.30 + } 1.31 + } 1.32 + 1.33 + // You must be at least 14 years old to create a Firefox Account. 1.34 + public static final int MINIMUM_AGE_TO_CREATE_AN_ACCOUNT = 14; 1.35 + 1.36 + // You must wait 15 minutes after failing an age check before trying to create a different account. 1.37 + public static final long MINIMUM_TIME_TO_WAIT_AFTER_AGE_CHECK_FAILED_IN_MILLISECONDS = 15 * 60 * 1000; 1.38 + 1.39 + public static final String USER_AGENT = "Firefox-Android-FxAccounts/" + GlobalConstants.MOZ_APP_VERSION + " (" + GlobalConstants.MOZ_APP_DISPLAYNAME + ")"; 1.40 + 1.41 + public static final String ACCOUNT_PICKLE_FILENAME = "fxa.account.json"; 1.42 + 1.43 + /** 1.44 + * This action is broadcast when an Android Firefox Account is deleted. 1.45 + * This allows each installed Firefox to delete any Firefox Account pickle 1.46 + * file. 1.47 + * <p> 1.48 + * It is protected by signing-level permission PER_ACCOUNT_TYPE_PERMISSION and 1.49 + * can be received only by Firefox channels sharing the same Android Firefox 1.50 + * Account type. 1.51 + * <p> 1.52 + * See {@link org.mozilla.gecko.fxa.AndroidFxAccount#makeDeletedAccountIntent(android.content.Context, android.accounts.Account)} 1.53 + * for contents of the intent. 1.54 + * 1.55 + * See bug 790931 for additional information in the context of Sync. 1.56 + */ 1.57 + public static final String ACCOUNT_DELETED_ACTION = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@.accounts.ACCOUNT_DELETED_ACTION"; 1.58 + 1.59 + /** 1.60 + * Version number of contents of SYNC_ACCOUNT_DELETED_ACTION intent. 1.61 + */ 1.62 + public static final long ACCOUNT_DELETED_INTENT_VERSION = 1; 1.63 + 1.64 + public static final String ACCOUNT_DELETED_INTENT_VERSION_KEY = "account_deleted_intent_version"; 1.65 + public static final String ACCOUNT_DELETED_INTENT_ACCOUNT_KEY = "account_deleted_intent_account"; 1.66 + 1.67 + /** 1.68 + * This signing-level permission protects broadcast intents that should be 1.69 + * received only by Firefox channels sharing the same Android Firefox Account type. 1.70 + */ 1.71 + public static final String PER_ACCOUNT_TYPE_PERMISSION = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@.permission.PER_ACCOUNT_TYPE"; 1.72 +}