• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ActivityStatus类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: start

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
/**
 * Start listening for location updates.
 * @param gpsEnabled Whether or not we're interested in high accuracy GPS.
 */
private void start(boolean gpsEnabled) {
    if (!mIsRunning && !mShouldRunAfterActivityResume) {
        // Currently idle so start listening to activity status changes.
        ActivityStatus.registerStateListener(this);
    }
    mIsGpsEnabled = gpsEnabled;

    int activityState = ActivityStatus.getState();
    if (activityState == ActivityStatus.PAUSED
            || activityState == ActivityStatus.STOPPED
            || activityState == ActivityStatus.DESTROYED) {
        mShouldRunAfterActivityResume = true;
    } else {
        unregisterFromLocationUpdates();
        registerForLocationUpdates();
    }
}
 
开发者ID:mogoweb,项目名称:chromium_webview,代码行数:22,代码来源:LocationProvider.java


示例2: start

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
/**
 * Start listening for location updates.
 * @param gpsEnabled Whether or not we're interested in high accuracy GPS.
 */
private void start(boolean gpsEnabled) {
    if (!mIsRunning && !mShouldRunAfterActivityResume) {
        // Currently idle so start listening to activity status changes.
        ActivityStatus.registerStateListener(this);
    }
    mIsGpsEnabled = gpsEnabled;
    if (ActivityStatus.isPaused()) {
        mShouldRunAfterActivityResume = true;
    } else {
        unregisterFromLocationUpdates();
        registerForLocationUpdates();
    }
}
 
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:18,代码来源:LocationProvider.java


示例3: NetworkChangeNotifierAutoDetect

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
public NetworkChangeNotifierAutoDetect(Observer observer, Context context) {
    mObserver = observer;
    mContext = context.getApplicationContext();
    mConnectivityManagerDelegate = new ConnectivityManagerDelegate(context);
    mConnectionType = getCurrentConnectionType();
    ActivityStatus.registerStateListener(this);
}
 
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:8,代码来源:NetworkChangeNotifierAutoDetect.java


示例4: onActivityStateChange

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
@Override
public void onActivityStateChange(int state) {
    if (state == ActivityStatus.RESUMED) {
        // Note that this also covers the case where the main activity is created. The CREATED
        // event is always followed by the RESUMED event. This is a temporary "hack" until
        // http://crbug.com/176837 is fixed. The CREATED event can't be used reliably for now
        // since its notification is deferred. This means that it can immediately follow a
        // DESTROYED/STOPPED/... event which is problematic.
        // TODO(pliard): fix http://crbug.com/176837.
        connectionTypeChanged();
        registerReceiver();
    } else if (state == ActivityStatus.PAUSED) {
        unregisterReceiver();
    }
}
 
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:16,代码来源:NetworkChangeNotifierAutoDetect.java


示例5: selectClientCertificate

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
/**
 * Create a new asynchronous request to select a client certificate.
 *
 * @param nativePtr The native object responsible for this request.
 * @param keyTypes The list of supported key exchange types.
 * @param encodedPrincipals The list of CA DistinguishedNames.
 * @param host_name The server host name is available (empty otherwise).
 * @param port The server port if available (0 otherwise).
 * @return true on success.
 * Note that nativeOnSystemRequestComplete will be called iff this method returns true.
 */
@CalledByNative
static private boolean selectClientCertificate(
        int nativePtr, String[] keyTypes, byte[][] encodedPrincipals, String hostName,
        int port) {
    ThreadUtils.assertOnUiThread();

    Activity activity = ActivityStatus.getActivity();
    if (activity == null) {
        Log.w(TAG, "No active Chromium main activity!?");
        return false;
    }

    // Build the list of principals from encoded versions.
    Principal[] principals = null;
    if (encodedPrincipals.length > 0) {
        principals = new X500Principal[encodedPrincipals.length];
        try {
            for (int n = 0; n < encodedPrincipals.length; n++) {
                principals[n] = new X500Principal(encodedPrincipals[n]);
            }
        } catch (Exception e) {
            // Bail on error.
            Log.w(TAG, "Exception while decoding issuers list: " + e);
            return false;
        }
    }

    // All good, create new request, add it to our list and launch the certificate selection
    // activity.
    SSLClientCertificateRequest request = new SSLClientCertificateRequest(nativePtr);

    KeyChain.choosePrivateKeyAlias(
            activity, request, keyTypes, principals, hostName, port, null);
    return true;
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:47,代码来源:SSLClientCertificateRequest.java


示例6: shouldPerformSync

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
@VisibleForTesting
boolean shouldPerformSync(Context ctx, Bundle extras, Account account) {
    boolean manualSync = isManualSync(extras);

    if (manualSync || ActivityStatus.isApplicationVisible()) {
        clearDelayedSyncs(ctx);
        return true;
    } else {
        Log.d(TAG, "Delaying sync.");
        setDelayedSync(ctx, account.name);
        return false;
    }
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:14,代码来源:DelayedSyncController.java


示例7: onActivityStateChange

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
@Override
public void onActivityStateChange(int newState) {
    if (SyncStatusHelper.get(mContext).isSyncEnabled()) {
        if (newState == ActivityStatus.PAUSED) {
            stop();
        } else if (newState == ActivityStatus.RESUMED) {
            start();
        }
    }
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:11,代码来源:InvalidationController.java


示例8: start

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
/**
 * Start listening for location updates.
 * @param gpsEnabled Whether or not we're interested in high accuracy GPS.
 */
private void start(boolean gpsEnabled) {
    if (!mIsRunning && !mShouldRunAfterActivityResume) {
        // Currently idle so start listening to activity status changes.
        ActivityStatus.registerStateListener(this);
    }
    mIsGpsEnabled = gpsEnabled;

    if (ActivityStatus.getState() != ActivityStatus.RESUMED) {
        mShouldRunAfterActivityResume = true;
    } else {
        unregisterFromLocationUpdates();
        registerForLocationUpdates();
    }
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:19,代码来源:LocationProvider.java


示例9: NetworkChangeNotifierAutoDetect

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
public NetworkChangeNotifierAutoDetect(Observer observer, Context context) {
    mObserver = observer;
    mContext = context.getApplicationContext();
    mConnectivityManagerDelegate = new ConnectivityManagerDelegate(context);
    mWifiManagerDelegate = new WifiManagerDelegate(context);
    mConnectionType = getCurrentConnectionType();
    mWifiSSID = getCurrentWifiSSID();
    ActivityStatus.registerStateListener(this);
}
 
开发者ID:mogoweb,项目名称:chromium_webview,代码行数:10,代码来源:NetworkChangeNotifierAutoDetect.java


示例10: stop

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
/**
 * Stop listening for location updates.
 */
private void stop() {
    unregisterFromLocationUpdates();
    ActivityStatus.unregisterStateListener(this);
    mShouldRunAfterActivityResume = false;
}
 
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:9,代码来源:LocationProvider.java


示例11: InvalidationController

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
/**
 * Creates an instance using {@code context} to send intents.
 */
@VisibleForTesting
InvalidationController(Context context) {
    mContext = Preconditions.checkNotNull(context.getApplicationContext());
    ActivityStatus.registerStateListener(this);
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:9,代码来源:InvalidationController.java


示例12: isChromeInForeground

import org.chromium.base.ActivityStatus; //导入依赖的package包/类
/**
 * Returns whether Chrome is in the foreground. Local method so it can be overridden in tests.
 */
@VisibleForTesting
boolean isChromeInForeground() {
    return ActivityStatus.isApplicationVisible();
}
 
开发者ID:morristech,项目名称:android-chromium,代码行数:8,代码来源:InvalidationService.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java YoutubeAudioSourceManager类代码示例发布时间:2022-05-22
下一篇:
Java SAMLContextProviderImpl类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap