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


Java AuthConstants.DEFAULT_ACCOUNT_TYPE属性代码示例

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


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

示例1: onHandleIntent

@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,代码行数:25,代码来源:CheckinService.java

示例2: checkin

@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,代码行数:25,代码来源:CheckinManager.java

示例3: loadOwners

@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,代码行数:25,代码来源:PeopleServiceImpl.java

示例4: AccountRecoveryGuidanceRequest

public AccountRecoveryGuidanceRequest(String accountName) {
    this.accountName = accountName;
    this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE);
}
 
开发者ID:microg,项目名称:android_external_GmsApi,代码行数:4,代码来源:AccountRecoveryGuidanceRequest.java

示例5: AccountRemovalRequest

public AccountRemovalRequest(String accountName) {
    this.accountName = accountName;
    this.account = new Account(accountName, AuthConstants.DEFAULT_ACCOUNT_TYPE);
}
 
开发者ID:microg,项目名称:android_external_GmsApi,代码行数:4,代码来源:AccountRemovalRequest.java

示例6: AccountAuthenticator

public AccountAuthenticator(Context context) {
    super(context);
    this.context = context;
    this.accountType = AuthConstants.DEFAULT_ACCOUNT_TYPE;
}
 
开发者ID:microg,项目名称:android_packages_apps_GmsCore,代码行数:5,代码来源:AccountAuthenticator.java


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