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


Java NotificationManagerProxy类代码示例

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


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

示例1: createBroadcastNotification

import org.chromium.chrome.browser.notifications.NotificationManagerProxy; //导入依赖的package包/类
/**
 * Surfaces a notification to the user that the Physical Web is broadcasting.
 * The notification specifies the URL that is being broadcast. It cannot be swiped away,
 * but broadcasting can be terminated with the stop button on the notification.
 */
private void createBroadcastNotification(String displayUrl) {
    Context context = getApplicationContext();
    PendingIntent stopPendingIntent = PendingIntent.getBroadcast(
            context, 0, new Intent(STOP_SERVICE), PendingIntent.FLAG_UPDATE_CURRENT);
    NotificationManagerProxy notificationManager = new NotificationManagerProxyImpl(
            (NotificationManager) getSystemService(NOTIFICATION_SERVICE));
    ChromeNotificationBuilder notificationBuilder =
            NotificationBuilderFactory
                    .createChromeNotificationBuilder(
                            true /* preferCompat */, ChannelDefinitions.CHANNEL_ID_BROWSER)
                    .setSmallIcon(R.drawable.ic_image_white_24dp)
                    .setContentTitle(getString(R.string.physical_web_broadcast_notification))
                    .setContentText(displayUrl)
                    .setOngoing(true)
                    .addAction(android.R.drawable.ic_menu_close_clear_cancel,
                            getString(R.string.physical_web_stop_broadcast), stopPendingIntent);
    notificationManager.notify(
            NotificationConstants.NOTIFICATION_ID_PHYSICAL_WEB, notificationBuilder.build());
    NotificationUmaTracker.getInstance().onNotificationShown(
            NotificationUmaTracker.PHYSICAL_WEB, ChannelDefinitions.CHANNEL_ID_BROWSER);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:27,代码来源:PhysicalWebBroadcastService.java

示例2: overrideNotificationManagerForTesting

import org.chromium.chrome.browser.notifications.NotificationManagerProxy; //导入依赖的package包/类
@VisibleForTesting
void overrideNotificationManagerForTesting(
        NotificationManagerProxy notificationManager) {
    mNotificationManager = notificationManager;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:6,代码来源:UrlManager.java

示例3: ChannelsInitializer

import org.chromium.chrome.browser.notifications.NotificationManagerProxy; //导入依赖的package包/类
public ChannelsInitializer(
        NotificationManagerProxy notificationManagerProxy, Resources resources) {
    mNotificationManager = notificationManagerProxy;
    mResources = resources;
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:6,代码来源:ChannelsInitializer.java

示例4: disableUrlBroadcasting

import org.chromium.chrome.browser.notifications.NotificationManagerProxy; //导入依赖的package包/类
/** Turns off URL broadcasting. */
private void disableUrlBroadcasting() {
    NotificationManagerProxy notificationManager = new NotificationManagerProxyImpl(
            (NotificationManager) getSystemService(NOTIFICATION_SERVICE));
    notificationManager.cancel(NotificationConstants.NOTIFICATION_ID_PHYSICAL_WEB);
}
 
开发者ID:mogoweb,项目名称:365browser,代码行数:7,代码来源:PhysicalWebBroadcastService.java


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