Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 package org.mozilla.gecko.fxa.authenticator;
7 import org.mozilla.gecko.background.common.log.Logger;
9 import android.app.Service;
10 import android.content.Intent;
11 import android.os.IBinder;
13 public class FxAccountAuthenticatorService extends Service {
14 public static final String LOG_TAG = FxAccountAuthenticatorService.class.getSimpleName();
16 // Lazily initialized by <code>getAuthenticator</code>.
17 protected FxAccountAuthenticator accountAuthenticator = null;
19 protected FxAccountAuthenticator getAuthenticator() {
20 if (accountAuthenticator == null) {
21 accountAuthenticator = new FxAccountAuthenticator(this);
22 }
24 return accountAuthenticator;
25 }
27 @Override
28 public void onCreate() {
29 Logger.debug(LOG_TAG, "onCreate");
31 accountAuthenticator = getAuthenticator();
32 }
34 @Override
35 public IBinder onBind(Intent intent) {
36 Logger.debug(LOG_TAG, "onBind");
38 if (intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTICATOR_INTENT)) {
39 return getAuthenticator().getIBinder();
40 }
42 return null;
43 }
44 }