I have Android device with root. When I use permission INJECT_EVENTS from Activity itself it's OK. But I started IntentService from activity and inside IntentService I want to use the permission, but it gives message that service requires INJECT_EVENTS permission. What am I doing wrong? How can I start IntentService with same priveleges as the application itself?
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Intent intent = new Intent(MainActivity.this, backgroundService.class);
startService(intent);
........