Android 具有浮动图标的前台\u服务的网络优先级

Android 具有浮动图标的前台\u服务的网络优先级,android,networking,overlay,foreground-service,xiaomi,Android,Networking,Overlay,Foreground Service,Xiaomi,我有前台服务和通知集: Notification notification = notificationBuilder.setOngoing(true) .setSmallIcon(R.mipmap.ic_launcher) .setContentTitle("Title") .setContentText("Desc") .setPriority(NotificationCompat.PRIORITY_MAX) .setCa

我有前台服务和通知集:

Notification notification = notificationBuilder.setOngoing(true)
   .setSmallIcon(R.mipmap.ic_launcher)
   .setContentTitle("Title")
   .setContentText("Desc")
   .setPriority(NotificationCompat.PRIORITY_MAX)
   .setCategory(NotificationCompat.CATEGORY_SERVICE)
   .build();
在前台服务中,我正在创建覆盖图标:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
   LAYOUT_FLAG = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
else
   LAYOUT_FLAG = WindowManager.LayoutParams.TYPE_PHONE;

final WindowManager.LayoutParams paramsF = new WindowManager.LayoutParams(
   WindowManager.LayoutParams.WRAP_CONTENT,
   WindowManager.LayoutParams.WRAP_CONTENT,
   LAYOUT_FLAG,
   WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
   PixelFormat.TRANSLUCENT);

mWindowManager.addView(layout, paramsF);
在前台服务中,我连接到内联网上用于测试的服务器套接字。当我在游戏中激活浮动图标时,ping消息有4ms延迟,这很好。现在,当我转到主屏幕时,延迟是cca 140ms,这是一个非常糟糕的结果,因为服务器位于intranet上

如何将前台服务的网络优先级设置为最大值,以便始终保持4ms的延迟?还是因为操作系统资源管理而无法实现

安卓API:29

测试电话:小米米10 5g