当前位置: 首页>>代码示例>>Java>>正文


Java IAccountManagerResponse类代码示例

本文整理汇总了Java中android.accounts.IAccountManagerResponse的典型用法代码示例。如果您正苦于以下问题:Java IAccountManagerResponse类的具体用法?Java IAccountManagerResponse怎么用?Java IAccountManagerResponse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IAccountManagerResponse类属于android.accounts包,在下文中一共展示了IAccountManagerResponse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onError

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
@Override
public void onError(int errorCode, String errorMessage) {
	mNumErrors++;
	IAccountManagerResponse response = getResponseAndClose();
	if (response != null) {
		Log.v(TAG, getClass().getSimpleName()
                      + " calling onError() on response " + response);
		try {
			response.onError(errorCode, errorMessage);
		} catch (RemoteException e) {
			Log.v(TAG, "Session.onError: caught RemoteException while responding", e);
		}
	} else {
		Log.v(TAG, "Session.onError: already closed");
	}
}
 
开发者ID:codehz,项目名称:container,代码行数:17,代码来源:VAccountManagerService.java

示例2: Session

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
Session(IAccountManagerResponse response, int userId, AuthenticatorInfo info, boolean expectActivityLaunch, boolean stripAuthTokenFromResult, String accountName, boolean authDetailsRequired, boolean updateLastAuthenticatedTime) {
	if (info == null) throw new IllegalArgumentException("accountType is null");
	this.mStripAuthTokenFromResult = stripAuthTokenFromResult;
	this.mResponse = response;
	this.mUserId = userId;
	this.mAuthenticatorInfo = info;
	this.mExpectActivityLaunch = expectActivityLaunch;
	this.mCreationTime = SystemClock.elapsedRealtime();
	this.mAccountName = accountName;
	this.mAuthDetailsRequired = authDetailsRequired;
	this.mUpdateLastAuthenticatedTime = updateLastAuthenticatedTime;
	synchronized (mSessions) {
		mSessions.put(toString(), this);
	}
	if (response != null) {
		try {
			response.asBinder().linkToDeath(this, 0 /* flags */);
		} catch (RemoteException e) {
			mResponse = null;
			binderDied();
		}
	}
}
 
开发者ID:codehz,项目名称:container,代码行数:24,代码来源:VAccountManagerService.java

示例3: confirmCredentials

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
public void confirmCredentials(int userId, IAccountManagerResponse response, final Account account, final Bundle options, final boolean expectActivityLaunch) {
	if (response == null) throw new IllegalArgumentException("response is null");
	if (account == null) throw new IllegalArgumentException("account is null");
	AuthenticatorInfo info = getAuthenticatorInfo(account.type);
	if (info == null) {
		try {
			response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist");
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return;
	}
	new Session(response, userId, info, expectActivityLaunch, true, account.name, true, true) {

		@Override
		public void run() throws RemoteException {
			mAuthenticator.confirmCredentials(this, account, options);
		}

	}.bind();

}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:23,代码来源:VAccountManagerService.java

示例4: confirmCredentials

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
public void confirmCredentials(int userId, IAccountManagerResponse response, final Account account, final Bundle options, final boolean expectActivityLaunch) {
	if (response == null) throw new IllegalArgumentException("response is null");
	if (account == null) throw new IllegalArgumentException("account is null");
	AuthenticatorInfo info = getAuthenticatorInfo(account.type);
	if(info == null) {
		try {
			response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist");
		} catch(RemoteException e) {
			e.printStackTrace();
		}
		return;
	}
	new Session(response, userId, info, expectActivityLaunch, true, account.name, true, true) {

		@Override
		public void run() throws RemoteException {
			mAuthenticator.confirmCredentials(this, account, options);
		}

	}.bind();

}
 
开发者ID:codehz,项目名称:container,代码行数:23,代码来源:VAccountManagerService.java

示例5: onError

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
@Override
public void onError(int errorCode, String errorMessage) {
	mNumErrors++;
	IAccountManagerResponse response = getResponseAndClose();
	if (response != null) {
		Log.v(TAG, getClass().getSimpleName()
				+ " calling onError() on response " + response);
		try {
			response.onError(errorCode, errorMessage);
		} catch (RemoteException e) {
			Log.v(TAG, "Session.onError: caught RemoteException while responding", e);
		}
	} else {
		Log.v(TAG, "Session.onError: already closed");
	}
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:17,代码来源:VAccountManagerService.java

示例6: sendResult

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
public void sendResult() {
	IAccountManagerResponse response = getResponseAndClose();
	if (response != null) {
		try {
			Account[] accounts = new Account[mAccountsWithFeatures.size()];
			for (int i = 0; i < accounts.length; i++) {
				accounts[i] = mAccountsWithFeatures.get(i);
			}
			if (Log.isLoggable(TAG, Log.VERBOSE)) {
				Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response "
						+ response);
			}
			Bundle result = new Bundle();
			result.putParcelableArray(AccountManager.KEY_ACCOUNTS, accounts);
			response.onResult(result);
		} catch (RemoteException e) {
			// if the caller is dead then there is no one to care about remote exceptions
			Log.v(TAG, "failure while notifying response", e);
		}
	}
}
 
开发者ID:codehz,项目名称:container,代码行数:22,代码来源:VAccountManagerService.java

示例7: confirmCredentials

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
public void confirmCredentials(int userId, IAccountManagerResponse response, final Account account, final Bundle options, final boolean expectActivityLaunch) {
    if (response == null) throw new IllegalArgumentException("response is null");
    if (account == null) throw new IllegalArgumentException("account is null");
    AuthenticatorInfo info = getAuthenticatorInfo(account.type);
    if (info == null) {
        try {
            response.onError(ERROR_CODE_BAD_ARGUMENTS, "account.type does not exist");
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        return;
    }
    new Session(response, userId, info, expectActivityLaunch, true, account.name, true, true) {

        @Override
        public void run() throws RemoteException {
            mAuthenticator.confirmCredentials(this, account, options);
        }

    }.bind();

}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:23,代码来源:VAccountManagerService.java

示例8: Session

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
Session(IAccountManagerResponse response, int userId, AuthenticatorInfo info, boolean expectActivityLaunch, boolean stripAuthTokenFromResult, String accountName, boolean authDetailsRequired, boolean updateLastAuthenticatedTime) {
    if (info == null) throw new IllegalArgumentException("accountType is null");
    this.mStripAuthTokenFromResult = stripAuthTokenFromResult;
    this.mResponse = response;
    this.mUserId = userId;
    this.mAuthenticatorInfo = info;
    this.mExpectActivityLaunch = expectActivityLaunch;
    this.mCreationTime = SystemClock.elapsedRealtime();
    this.mAccountName = accountName;
    this.mAuthDetailsRequired = authDetailsRequired;
    this.mUpdateLastAuthenticatedTime = updateLastAuthenticatedTime;
    synchronized (mSessions) {
        mSessions.put(toString(), this);
    }
    if (response != null) {
        try {
            response.asBinder().linkToDeath(this, 0 /* flags */);
        } catch (RemoteException e) {
            mResponse = null;
            binderDied();
        }
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:24,代码来源:VAccountManagerService.java

示例9: onError

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
@Override
public void onError(int errorCode, String errorMessage) {
    mNumErrors++;
    IAccountManagerResponse response = getResponseAndClose();
    if (response != null) {
        Log.v(TAG, getClass().getSimpleName()
                + " calling onError() on response " + response);
        try {
            response.onError(errorCode, errorMessage);
        } catch (RemoteException e) {
            Log.v(TAG, "Session.onError: caught RemoteException while responding", e);
        }
    } else {
        Log.v(TAG, "Session.onError: already closed");
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:17,代码来源:VAccountManagerService.java

示例10: sendResult

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
public void sendResult() {
    IAccountManagerResponse response = getResponseAndClose();
    if (response != null) {
        try {
            Account[] accounts = new Account[mAccountsWithFeatures.size()];
            for (int i = 0; i < accounts.length; i++) {
                accounts[i] = mAccountsWithFeatures.get(i);
            }
            if (Log.isLoggable(TAG, Log.VERBOSE)) {
                Log.v(TAG, getClass().getSimpleName() + " calling onResult() on response "
                        + response);
            }
            Bundle result = new Bundle();
            result.putParcelableArray(AccountManager.KEY_ACCOUNTS, accounts);
            response.onResult(result);
        } catch (RemoteException e) {
            // if the caller is dead then there is no one to care about remote exceptions
            Log.v(TAG, "failure while notifying response", e);
        }
    }
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:22,代码来源:VAccountManagerService.java

示例11: call

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
	IAccountManagerResponse response = (IAccountManagerResponse) args[0];
	Account account = (Account) args[1];
	String[] features = (String[]) args[2];
	Mgr.hasFeatures(response, account, features);
	return 0;
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:9,代码来源:AccountManagerStub.java

示例12: removeAccount

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
public void removeAccount(IAccountManagerResponse response, Account account, boolean expectActivityLaunch) {
	try {
		getRemote().removeAccount(VUserHandle.myUserId(), response, account, expectActivityLaunch);
	} catch (RemoteException e) {
		e.printStackTrace();
	}
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:8,代码来源:VAccountManager.java

示例13: getAuthToken

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
public void getAuthToken(IAccountManagerResponse response, Account account, String authTokenType, boolean notifyOnAuthFailure, boolean expectActivityLaunch, Bundle loginOptions) {
	try {
		getRemote().getAuthToken(VUserHandle.myUserId(), response, account, authTokenType, notifyOnAuthFailure, expectActivityLaunch, loginOptions);
	} catch (RemoteException e) {
		e.printStackTrace();
	}
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:8,代码来源:VAccountManager.java

示例14: hasFeatures

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
public void hasFeatures(IAccountManagerResponse response, Account account, String[] features) {
	try {
		getRemote().hasFeatures(VUserHandle.myUserId(), response, account, features);
	} catch (RemoteException e) {
		e.printStackTrace();
	}
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:8,代码来源:VAccountManager.java

示例15: addAccount

import android.accounts.IAccountManagerResponse; //导入依赖的package包/类
public void addAccount(IAccountManagerResponse response, String accountType, String authTokenType, String[] requiredFeatures, boolean expectActivityLaunch, Bundle optionsIn) {
	try {
		getRemote().addAccount(VUserHandle.myUserId(), response, accountType, authTokenType, requiredFeatures, expectActivityLaunch, optionsIn);
	} catch (RemoteException e) {
		e.printStackTrace();
	}
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:8,代码来源:VAccountManager.java


注:本文中的android.accounts.IAccountManagerResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。