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


Java AuthConstants类代码示例

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


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

示例1: onHandleIntent

import org.microg.gms.auth.AuthConstants; //导入依赖的package包/类
@SuppressWarnings("MissingPermission")
@Override
protected void onHandleIntent(Intent intent) {
    try {
        if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(PREF_ENABLE_CHECKIN, false)) {
            LastCheckinInfo info = CheckinManager.checkin(this, intent.getBooleanExtra(EXTRA_FORCE_CHECKIN, false));
            if (info != null) {
                Log.d(TAG, "Checked in as " + Long.toHexString(info.androidId));
                String accountType = AuthConstants.DEFAULT_ACCOUNT_TYPE;
                for (Account account : AccountManager.get(this).getAccountsByType(accountType)) {
                    PeopleManager.loadUserInfo(this, account);
                }
                McsService.scheduleReconnect(this);
                if (intent.hasExtra(EXTRA_CALLBACK_INTENT)) {
                    startService((Intent) intent.getParcelableExtra(EXTRA_CALLBACK_INTENT));
                }
            }
        }
    } catch (Exception e) {
        Log.w(TAG, e);
    } finally {
        WakefulBroadcastReceiver.completeWakefulIntent(intent);
        stopSelf();
    }
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:26,代码来源:CheckinService.java

示例2: checkin

import org.microg.gms.auth.AuthConstants; //导入依赖的package包/类
@SuppressWarnings("MissingPermission")
public static synchronized LastCheckinInfo checkin(Context context, boolean force) throws IOException {
    LastCheckinInfo info = LastCheckinInfo.read(context);
    if (!force && info.lastCheckin > System.currentTimeMillis() - MIN_CHECKIN_INTERVAL)
        return null;
    if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean(PREF_ENABLE_CHECKIN, false))
        return null;
    List<CheckinClient.Account> accounts = new ArrayList<CheckinClient.Account>();
    AccountManager accountManager = AccountManager.get(context);
    String accountType = AuthConstants.DEFAULT_ACCOUNT_TYPE;
    for (Account account : accountManager.getAccountsByType(accountType)) {
        String token = new AuthRequest()
                .email(account.name).token(accountManager.getPassword(account))
                .hasPermission().service("ac2dm")
                .app("com.google.android.gsf", Constants.GMS_PACKAGE_SIGNATURE_SHA1)
                .getResponse().LSid;
        if (token != null) {
            accounts.add(new CheckinClient.Account(account.name, token));
        }
    }
    CheckinRequest request = CheckinClient.makeRequest(Utils.getBuild(context),
            new DeviceConfiguration(context), Utils.getDeviceIdentifier(context),
            Utils.getPhoneInfo(context), info, Utils.getLocale(context), accounts);
    return handleResponse(context, CheckinClient.request(request));
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:26,代码来源:CheckinManager.java

示例3: loadOwners

import org.microg.gms.auth.AuthConstants; //导入依赖的package包/类
@SuppressWarnings("MissingPermission")
@Override
public void loadOwners(final IPeopleCallbacks callbacks, boolean var2, boolean var3, final String accountName, String var5, int sortOrder) {
    Log.d(TAG, "loadOwners: " + var2 + ", " + var3 + ", " + accountName + ", " + var5 + ", " + sortOrder);
    PackageUtils.assertExtendedAccess(context);
    AccountManager accountManager = AccountManager.get(context);
    Bundle accountMetadata = new Bundle();
    String accountType = AuthConstants.DEFAULT_ACCOUNT_TYPE;
    for (Account account : accountManager.getAccountsByType(accountType)) {
        if (accountName == null || account.name.equals(accountName)) {
            accountMetadata.putParcelable(account.name, new AccountMetadata());
        }
    }
    Bundle extras = new Bundle();
    extras.putBundle("account_metadata", accountMetadata);
    try {
        DatabaseHelper databaseHelper = new DatabaseHelper(context);
        DataHolder dataHolder = new DataHolder(databaseHelper.getOwners(), 0, extras);
        Log.d(TAG, "loadOwners[result]: " + dataHolder);
        callbacks.onDataHolder(0, extras, dataHolder);
        databaseHelper.close();
    } catch (Exception e) {
        Log.w(TAG, e);
    }
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:26,代码来源:PeopleServiceImpl.java

示例4: AccountRecoveryGuidanceRequest

import org.microg.gms.auth.AuthConstants; //导入依赖的package包/类
public AccountRecoveryGuidanceRequest(String accountName) {
    this.accountName = accountName;
    this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE);
}
 
开发者ID:microg,项目名称:android_external_GmsApi,代码行数:5,代码来源:AccountRecoveryGuidanceRequest.java

示例5: AccountRemovalRequest

import org.microg.gms.auth.AuthConstants; //导入依赖的package包/类
public AccountRemovalRequest(String accountName) {
    this.accountName = accountName;
    this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE);
}
 
开发者ID:microg,项目名称:android_external_GmsApi,代码行数:5,代码来源:AccountRemovalRequest.java

示例6: useDefaultAccount

import org.microg.gms.auth.AuthConstants; //导入依赖的package包/类
/**
 * Specify that the default account should be used when connecting to services.
 */
public Builder useDefaultAccount() {
    this.accountName = AuthConstants.DEFAULT_ACCOUNT;
    return this;
}
 
开发者ID:microg,项目名称:android_external_GmsLib,代码行数:8,代码来源:GoogleApiClient.java

示例7: AccountAuthenticator

import org.microg.gms.auth.AuthConstants; //导入依赖的package包/类
public AccountAuthenticator(Context context) {
    super(context);
    this.context = context;
    this.accountType = AuthConstants.DEFAULT_ACCOUNT_TYPE;
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:6,代码来源:AccountAuthenticator.java

示例8: create

import org.microg.gms.auth.AuthConstants; //导入依赖的package包/类
@Override
public IObjectWrapper create(IObjectWrapper context, int size, int annotation, String url, int activityRequestCode) throws RemoteException {
	Context ctx = (Context) ObjectWrapper.unwrap(context);
	return ObjectWrapper.wrap(new PlusOneButtonImpl(ctx, size, annotation, url, AuthConstants.DEFAULT_ACCOUNT));
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:6,代码来源:PlusOneButtonCreatorImpl.java


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