Back to project page hubroid.
The source code is released under:
Copyright (c) 2011 Eddie Ringle. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistribution...
If you think the Android project hubroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * Copyright 2012 GitHub Inc./*from w w w. j ava2s . c o m*/ * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.idlesoft.android.apps.github.authenticator; import android.app.Service; import android.content.Intent; import android.os.IBinder; import static android.accounts.AccountManager.ACTION_AUTHENTICATOR_INTENT; /** * Authenticator service that returns a subclass of AbstractAccountAuthenticator in onBind() */ public class AccountAuthenticatorService extends Service { private static GitHubAccountAuthenticator sAccountAuthenticator = null; public IBinder onBind(Intent intent) { return intent.getAction().equals(ACTION_AUTHENTICATOR_INTENT) ? getAuthenticator() .getIBinder() : null; } private GitHubAccountAuthenticator getAuthenticator() { if (sAccountAuthenticator == null) { sAccountAuthenticator = new GitHubAccountAuthenticator(this); } return sAccountAuthenticator; } }