mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
df6f6ffb85
========3cd96669bc
Author: Nick Alexander <nalexander@mozilla.com> Date: Mon Aug 18 17:43:24 2014 -0700 Bug 1026005 - Review comments. ========5aefe1f716
Author: Nick Alexander <nalexander@mozilla.com> Date: Mon Jun 16 11:16:16 2014 -0700 Bug 1026005 - Part 2: Add AccountLoader. ========61bc36bd7d
Author: Nick Alexander <nalexander@mozilla.com> Date: Mon Jun 16 11:12:37 2014 -0700 Bug 1026005 - Part 1: Add and broadcast ACCOUNT_STATE_CHANGED_ACTION. ========9d80df0aa7
Author: Nick Alexander <nalexander@mozilla.com> Date: Mon Aug 18 17:42:11 2014 -0700 Bug 1026005 - Pre: Allow testing with |mvn integration-test|. This avoids errors like: W dalvikvm(24082) Class resolved by unexpected DEX: Lorg/mozilla/gecko/fxa/AccountLoader;(0x42c13358):0x75440000 ref [Landroid/support/v4/content/AsyncTaskLoader;] Landroid/support/v4/content/AsyncTaskLoader;(0x42c13358):0x74a71000 W dalvikvm(24082) (Lorg/mozilla/gecko/fxa/AccountLoader; had used a different Landroid/support/v4/content/AsyncTaskLoader; during pre-verification) W dalvikvm(24082) Unable to resolve superclass of Lorg/mozilla/gecko/fxa/AccountLoader; (247) W dalvikvm(24082) Link of class 'Lorg/mozilla/gecko/fxa/AccountLoader;' failed E dalvikvm(24082) Could not find class 'org.mozilla.gecko.fxa.AccountLoader', referenced from method org.mozilla.gecko.background.fxa.TestAccountLoader.testInitialLoad W dalvikvm(24082) VFY: unable to resolve new-instance 1299 (Lorg/mozilla/gecko/fxa/AccountLoader;) in Lorg/mozilla/gecko/background/fxa/TestAccountLoader; D dalvikvm(24082) VFY: replacing opcode 0x22 at 0x0005 W dalvikvm(24082) Class resolved by unexpected DEX: Lorg/mozilla/gecko/fxa/AccountLoader;(0x42c13358):0x75440000 ref [Landroid/support/v4/content/AsyncTaskLoader;] Landroid/support/v4/content/AsyncTaskLoader;(0x42c13358):0x74a71000 W dalvikvm(24082) (Lorg/mozilla/gecko/fxa/AccountLoader; had used a different Landroid/support/v4/content/AsyncTaskLoader; during pre-verification) W dalvikvm(24082) Unable to resolve superclass of Lorg/mozilla/gecko/fxa/AccountLoader; (247) W dalvikvm(24082) Link of class 'Lorg/mozilla/gecko/fxa/AccountLoader;' failed D dalvikvm(24082) DexOpt: unable to opt direct call 0x1df8 at 0x07 in Lorg/mozilla/gecko/background/fxa/TestAccountLoader;.testInitialLoad I TestRunner(24082) started: testInitialLoad(org.mozilla.gecko.background.fxa.TestAccountLoader) I TestRunner(24082) failed: testInitialLoad(org.mozilla.gecko.background.fxa.TestAccountLoader) I TestRunner(24082) ----- begin exception ----- I TestRunner(24082) I TestRunner(24082) java.lang.NoClassDefFoundError: org.mozilla.gecko.fxa.AccountLoader I TestRunner(24082) at org.mozilla.gecko.background.fxa.TestAccountLoader.testInitialLoad(TestAccountLoader.java:145) I TestRunner(24082) at java.lang.reflect.Method.invokeNative(Native Method) I TestRunner(24082) at java.lang.reflect.Method.invoke(Method.java:525) I TestRunner(24082) at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214) I TestRunner(24082) at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199) I TestRunner(24082) at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192) I TestRunner(24082) at junit.framework.TestCase.runBare(TestCase.java:134) I TestRunner(24082) at junit.framework.TestResult$1.protect(TestResult.java:115) I TestRunner(24082) at junit.framework.TestResult.runProtected(TestResult.java:133) I TestRunner(24082) at junit.framework.TestResult.run(TestResult.java:118) I TestRunner(24082) at junit.framework.TestCase.run(TestCase.java:124) I TestRunner(24082) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:191) I TestRunner(24082) at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:176) I TestRunner(24082) at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:554) I TestRunner(24082) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1738) I TestRunner(24082) ----- end exception ----- I TestRunner(24082) finished: testInitialLoad(org.mozilla.gecko.background.fxa.TestAccountLoader)
81 lines
3.6 KiB
Java
81 lines
3.6 KiB
Java
#filter substitution
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
package org.mozilla.gecko.fxa;
|
|
|
|
import org.mozilla.gecko.background.common.GlobalConstants;
|
|
import org.mozilla.gecko.background.common.log.Logger;
|
|
|
|
public class FxAccountConstants {
|
|
public static final String GLOBAL_LOG_TAG = "FxAccounts";
|
|
public static final String ACCOUNT_TYPE = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@";
|
|
|
|
public static final String DEFAULT_AUTH_SERVER_ENDPOINT = "https://api.accounts.firefox.com/v1";
|
|
public static final String DEFAULT_TOKEN_SERVER_ENDPOINT = "https://token.services.mozilla.com/1.0/sync/1.5";
|
|
|
|
public static final String STAGE_AUTH_SERVER_ENDPOINT = "https://api-accounts.stage.mozaws.net/v1";
|
|
public static final String STAGE_TOKEN_SERVER_ENDPOINT = "https://token.stage.mozaws.net/1.0/sync/1.5";
|
|
|
|
// For extra debugging. Not final so it can be changed from Fennec, or from
|
|
// an add-on.
|
|
public static boolean LOG_PERSONAL_INFORMATION = false;
|
|
|
|
public static void pii(String tag, String message) {
|
|
if (LOG_PERSONAL_INFORMATION) {
|
|
Logger.info(tag, "$$FxA PII$$: " + message);
|
|
}
|
|
}
|
|
|
|
// You must be at least 14 years old to create a Firefox Account.
|
|
public static final int MINIMUM_AGE_TO_CREATE_AN_ACCOUNT = 14;
|
|
|
|
// 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;
|
|
|
|
public static final String USER_AGENT = "Firefox-Android-FxAccounts/" + GlobalConstants.MOZ_APP_VERSION + " (" + GlobalConstants.MOZ_APP_DISPLAYNAME + ")";
|
|
|
|
public static final String ACCOUNT_PICKLE_FILENAME = "fxa.account.json";
|
|
|
|
/**
|
|
* This action is broadcast when an Android Firefox Account is deleted.
|
|
* This allows each installed Firefox to delete any Firefox Account pickle
|
|
* file.
|
|
* <p>
|
|
* It is protected by signing-level permission PER_ACCOUNT_TYPE_PERMISSION and
|
|
* can be received only by Firefox channels sharing the same Android Firefox
|
|
* Account type.
|
|
* <p>
|
|
* See {@link org.mozilla.gecko.fxa.AndroidFxAccount#makeDeletedAccountIntent(android.content.Context, android.accounts.Account)}
|
|
* for contents of the intent.
|
|
*
|
|
* See bug 790931 for additional information in the context of Sync.
|
|
*/
|
|
public static final String ACCOUNT_DELETED_ACTION = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@.accounts.ACCOUNT_DELETED_ACTION";
|
|
|
|
/**
|
|
* Version number of contents of SYNC_ACCOUNT_DELETED_ACTION intent.
|
|
*/
|
|
public static final long ACCOUNT_DELETED_INTENT_VERSION = 1;
|
|
|
|
public static final String ACCOUNT_DELETED_INTENT_VERSION_KEY = "account_deleted_intent_version";
|
|
public static final String ACCOUNT_DELETED_INTENT_ACCOUNT_KEY = "account_deleted_intent_account";
|
|
|
|
/**
|
|
* This signing-level permission protects broadcast intents that should be
|
|
* received only by Firefox channels sharing the same Android Firefox Account type.
|
|
*/
|
|
public static final String PER_ACCOUNT_TYPE_PERMISSION = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@.permission.PER_ACCOUNT_TYPE";
|
|
|
|
/**
|
|
* This action is broadcast when an Android Firefox Account's internal state
|
|
* is changed.
|
|
* <p>
|
|
* It is protected by signing-level permission PER_ACCOUNT_TYPE_PERMISSION and
|
|
* can be received only by Firefox versions sharing the same Android Firefox
|
|
* Account type.
|
|
*/
|
|
public static final String ACCOUNT_STATE_CHANGED_ACTION = "@MOZ_ANDROID_SHARED_FXACCOUNT_TYPE@.accounts.ACCOUNT_STATE_CHANGED_ACTION";
|
|
}
|