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

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

mercurial