我是否搞砸了System_server服务? [英] Did I screw up my System_server service?

查看:103
本文介绍了我是否搞砸了System_server服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的手机正在产生不间断的Log.d输出.以下内容每秒重复一次 1200次.

My phone is producing a non-stop Log.d output. The following repeats over and over again about 1200 times per second.

04-25 15:58:04.883 1542-5012/? D/NetworkStatsCollection: getHistory:mUID 10266 isVideoCallUID: false

PID 1542是System_server,据我了解,它管理一系列Android服务.在我正在开发的应用程序中,我使用警报管理器和通知服务,如下所示.我可以做些什么来使该服务按原样做出反应吗?

PID 1542 is System_server which I've come to understand manages an array of Android services. In the app I'm developing, I use the Alarm Manager and Notification service as seen below. Is there anything I could have done to cause this service to react the way it is?

public void scheduleNotification(Context context, long alarmTime, int notificationId, String setOrCancel) {
    EditText questionView = (EditText)findViewById(R.id.question);
    String questionText = questionView.getText().toString();
    NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
            .setContentTitle(context.getString(R.string.app_name))
            .setContentText(questionText)
            .setAutoCancel(true)
            .setSmallIcon(R.mipmap.ic_launcher)
            .setLargeIcon(((BitmapDrawable) context.getResources().getDrawable(R.mipmap.ic_launcher)).getBitmap())
            .setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));

    Intent intent = new Intent(context, DashboardActivity.class);
    PendingIntent activity = PendingIntent.getActivity(context, notificationId, intent, PendingIntent.FLAG_CANCEL_CURRENT);
    builder.setContentIntent(activity);

    Notification notification = builder.build();

    Intent notificationIntent = new Intent(context, TrackerNotificationService.class);
    notificationIntent.putExtra(TrackerNotificationService.NOTIFICATION_ID, notificationId);
    notificationIntent.putExtra(TrackerNotificationService.NOTIFICATION, notification);
    PendingIntent pendingIntent = PendingIntent.getBroadcast(context, notificationId,
            notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);

    AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

    if (setOrCancel.equals("set")) {
        alarmManager.set(AlarmManager.RTC_WAKEUP, alarmTime, pendingIntent);
        Log.d("Check it", "scheduleNotification: " + alarmTime);
    }else{
        alarmManager.cancel(pendingIntent);
    }

}

TrackerNotificationService.java

import android.app.Notification;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class TrackerNotificationService extends BroadcastReceiver {


    public static String NOTIFICATION_ID = "notification_id";
    public static String NOTIFICATION = "notification";

    @Override
    public void onReceive(final Context context, Intent intent) {

        NotificationManager notificationManager = (NotificationManager) 
                context.getSystemService(Context.NOTIFICATION_SERVICE);

        Notification notification = intent.getParcelableExtra(NOTIFICATION);
        int notificationId = intent.getIntExtra(NOTIFICATION_ID, 0);
        notificationManager.notify(notificationId, notification);
    }
}

推荐答案

我有一个Samsung Galaxy S7 Edge,我注意到LogCat中的NetworkStatsCollection垃圾邮件也开始在我的设备上发生.

I have a Samsung Galaxy S7 Edge and I've noticed that the NetworkStatsCollection spam in my LogCat started happening on my device as well.

帖子所述,这似乎是一个核心操作系统进程. 设备制造商(在我的情况下为三星)必须在其最新的操作系统更新中进行了一些修改,并保留了一些调试功能. 非常烦人,我必须添加.

As indicated by this post, this appears to be a Core OS process. The device manufacturer (Samsung in my case) must have done some modifications in their latest OS update and left some debugging on. Very annoying I must add.

使用作为临时解决方法,但也应将其报告给离您最近的三星服务中心.希望有了足够的报告,他们可以快速部署可修复该问题的操作系统更新

Use this as a temporary workaround, but also report it to your nearest Samsung service Center. Hopefully with enough reports they can quickly deploy an OS update that fixes it

这篇关于我是否搞砸了System_server服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆