Have I messed up the System_server service?
My phone is continuously outputting Log.d. The next ones are repeated 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, which I understood, manages an array of Android services. In an application I am developing, I am using Alarm Manager and Notification service as shown below. Is there anything I can do to make this service 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);
}
}
source to share
I have a Samsung Galaxy S7 Edge and I noticed that the spam NetworkStatsCollection
in my LogCat started working on my device as well.
As stated in this post , it appears to be a Core OS process. The device manufacturer (Samsung in my case) had to make some changes to their latest OS update and left some debugging. Very annoying that I have to add.
Use this as a temporary workaround, but also report it to your nearest Samsung service center. Hopefully, with enough reporting, they can quickly deploy an OS update that fixes it.
source to share