I always see “E ActivityManager: Sending non-protected broadcast from system” in android 7. What does this mean?

爷,独闯天下 提交于 2019-12-10 18:59:00

问题


I am trying to send an intent from a non system app using the following function.

public static void sendIntent() {
        if (null != _context) {
            Intent intent = new Intent("com.test.testApp.testIntent");
            intent.setPackage(_context.getPackageName());
            _context.sendBroadcast(intent);
        }
    }

But I always see there is an error message from ActivityManager as below. The same intent broadcasting(app) works fine in andorid 6.0 but throws an error in android 7.1.1. I am required to change anything for android 7.1.1?

4-10 15:06:34.423 1615 2921 E ActivityManager: Sending non-protected broadcast com.test.testApp.testIntent from system 2886:com.test.testApp/u0a117 pkg com.test.testApp

In a ListFragment I register the receiver as follows:

 @Override
    public void onStart() {
        super.onStart();
        getActivity().registerReceiver((receiver),
                new IntentFilter(com.test.testApp.testIntent));
        TextView textDownload = (TextView) getActivity().findViewById(R.id.output);
        textDownload.setVisibility(android.view.View.INVISIBLE);
    }

回答1:


This might help,

If you have in your AndroidManifest.xml declared "android:sharedUserId="android.uid.system", then declare the protected broadcast.

Reference : https://stackoverflow.com/a/50240471



来源:https://stackoverflow.com/questions/43354717/i-always-see-e-activitymanager-sending-non-protected-broadcast-from-system-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!