當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。