本文整理汇总了Java中org.chromium.base.ApiCompatibilityUtils.isDemoUser方法的典型用法代码示例。如果您正苦于以下问题:Java ApiCompatibilityUtils.isDemoUser方法的具体用法?Java ApiCompatibilityUtils.isDemoUser怎么用?Java ApiCompatibilityUtils.isDemoUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.chromium.base.ApiCompatibilityUtils
的用法示例。
在下文中一共展示了ApiCompatibilityUtils.isDemoUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.chromium.base.ApiCompatibilityUtils; //导入方法依赖的package包/类
/**
* Starts determining parameters for the First Run.
* Once finished, calls onFlowIsKnown().
*/
public void start() {
if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE)
|| ApiCompatibilityUtils.isDemoUser(mActivity)) {
onFlowIsKnown(null);
return;
}
if (!mLaunchProperties.getBoolean(FirstRunActivity.EXTRA_USE_FRE_FLOW_SEQUENCER)) {
onFlowIsKnown(mLaunchProperties);
return;
}
new AndroidEduAndChildAccountHelper() {
@Override
public void onParametersReady() {
processFreEnvironment(isAndroidEduDevice(), hasChildAccount());
}
}.start(mActivity.getApplicationContext());
}
示例2: checkIfFirstRunIsNecessary
import org.chromium.base.ApiCompatibilityUtils; //导入方法依赖的package包/类
/**
* Checks if the First Run needs to be launched.
* @return The intent to launch the First Run Experience if necessary, or null.
* @param context The context.
* @param fromIntent The intent that was used to launch Chrome.
* @param forLightweightFre Whether this is a check for the Lightweight First Run Experience.
*/
public static Intent checkIfFirstRunIsNecessary(
Context context, Intent fromIntent, boolean forLightweightFre) {
// If FRE is disabled (e.g. in tests), proceed directly to the intent handling.
if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE)
|| ApiCompatibilityUtils.isDemoUser(context)) {
return null;
}
if (fromIntent != null && fromIntent.getBooleanExtra(SKIP_FIRST_RUN_EXPERIENCE, false)) {
return null;
}
// If Chrome isn't opened via the Chrome icon, and the user accepted the ToS
// in the Setup Wizard, skip any First Run Experience screens and proceed directly
// to the intent handling.
final boolean fromChromeIcon =
fromIntent != null && TextUtils.equals(fromIntent.getAction(), Intent.ACTION_MAIN);
if (!fromChromeIcon && ToSAckedReceiver.checkAnyUserHasSeenToS(context)) return null;
final boolean baseFreComplete = FirstRunStatus.getFirstRunFlowComplete();
if (!baseFreComplete) {
if (forLightweightFre
&& CommandLine.getInstance().hasSwitch(
ChromeSwitches.ENABLE_LIGHTWEIGHT_FIRST_RUN_EXPERIENCE)) {
if (!FirstRunStatus.shouldSkipWelcomePage()
&& !FirstRunStatus.getLightweightFirstRunFlowComplete()) {
return createLightweightFirstRunIntent(context, fromChromeIcon);
}
} else {
return createGenericFirstRunIntent(context, fromChromeIcon);
}
}
// Promo pages are removed, so there is nothing else to show in FRE.
return null;
}
示例3: isSigninSupported
import org.chromium.base.ApiCompatibilityUtils; //导入方法依赖的package包/类
/**
* @return Whether true if the current user is not demo user and the user has a reasonable
* Google Play Services installed.
*/
public boolean isSigninSupported() {
return !ApiCompatibilityUtils.isDemoUser(mContext)
&& !ExternalAuthUtils.getInstance().isGooglePlayServicesMissing(mContext);
}
示例4: start
import org.chromium.base.ApiCompatibilityUtils; //导入方法依赖的package包/类
/**
* Initiates the automatic sign-in process in background.
*
* @param activity The context for the FRE parameters processor.
*/
public static void start(final Activity activity) {
SigninManager signinManager = SigninManager.get(activity.getApplicationContext());
signinManager.onFirstRunCheckDone();
boolean firstRunFlowComplete = FirstRunStatus.getFirstRunFlowComplete();
// We skip signin and the FRE if
// - FRE is disabled, or
// - FRE hasn't been completed, but the user has already seen the ToS in the Setup Wizard.
if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE)
|| ApiCompatibilityUtils.isDemoUser(activity)
|| (!firstRunFlowComplete && ToSAckedReceiver.checkAnyUserHasSeenToS(activity))) {
return;
}
// Force trigger the FRE if the Lightweight FRE is disabled or Chrome is started via Chrome
// icon or via intent from GSA. Otherwise, skip signin.
if (!firstRunFlowComplete) {
if (!CommandLine.getInstance().hasSwitch(
ChromeSwitches.ENABLE_LIGHTWEIGHT_FIRST_RUN_EXPERIENCE)
|| TextUtils.equals(activity.getIntent().getAction(), Intent.ACTION_MAIN)
|| IntentHandler.determineExternalIntentSource(
activity.getPackageName(), activity.getIntent())
== ExternalAppId.GSA) {
requestToFireIntentAndFinish(activity);
}
return;
}
// We are only processing signin from the FRE.
if (getFirstRunFlowSignInComplete(activity)) {
return;
}
final String accountName = getFirstRunFlowSignInAccountName(activity);
if (!FeatureUtilities.canAllowSync(activity) || !signinManager.isSignInAllowed()
|| TextUtils.isEmpty(accountName)) {
setFirstRunFlowSignInComplete(activity, true);
return;
}
final boolean setUp = getFirstRunFlowSignInSetup(activity);
signinManager.signIn(accountName, activity, new SignInCallback() {
@Override
public void onSignInComplete() {
// Show sync settings if user pressed the "Settings" button.
if (setUp) {
openSignInSettings(activity);
}
setFirstRunFlowSignInComplete(activity, true);
}
@Override
public void onSignInAborted() {
// Set FRE as complete even if signin fails because the user has already seen and
// accepted the terms of service.
setFirstRunFlowSignInComplete(activity, true);
}
});
}