HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Android 10
|
10.0.0_r6
下载
查看原文件
收藏
根目录
frameworks
base
services
core
java
com
android
server
notification
NotificationShellCmd.java
/* * Copyright (C) 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.notification; import android.app.ActivityManager; import android.app.INotificationManager; import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Person; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ParceledListSlice; import android.content.res.Resources; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.Icon; import android.net.Uri; import android.os.Binder; import android.os.RemoteException; import android.os.ShellCommand; import android.os.UserHandle; import android.text.TextUtils; import android.util.Slog; import java.io.PrintWriter; import java.net.URISyntaxException; import java.util.Collections; /** * Implementation of `cmd notification` in NotificationManagerService. */ public class NotificationShellCmd extends ShellCommand { private static final String USAGE = "usage: cmd notification SUBCMD [args]\n\n" + "SUBCMDs:\n" + " allow_listener COMPONENT [user_id (current user if not specified)]\n" + " disallow_listener COMPONENT [user_id (current user if not specified)]\n" + " allow_assistant COMPONENT [user_id (current user if not specified)]\n" + " remove_assistant COMPONENT [user_id (current user if not specified)]\n" + " allow_dnd PACKAGE [user_id (current user if not specified)]\n" + " disallow_dnd PACKAGE [user_id (current user if not specified)]\n" + " suspend_package PACKAGE\n" + " unsuspend_package PACKAGE\n" + " reset_assistant_user_set [user_id (current user if not specified)]\n" + " get_approved_assistant [user_id (current user if not specified)]\n" + " post [--help | flags] TAG TEXT"; private static final String NOTIFY_USAGE = "usage: cmd notification post [flags]
\n\n" + "flags:\n" + " -h|--help\n" + " -v|--verbose\n" + " -t|--title
\n" + " -i|--icon
\n" + " -I|--large-icon
\n" + " -S|--style