Point Mobile devices running Android 6.0 and above
Try as follow code:
Intent intent = new Intent("device.common.ENABLED_SCANNER");
intent.putExtra("EXTRA_ENABLED_SCANNER",1);
context.sendBroadcast(intent);
Intent intent = new Intent("device.common.ENABLED_SCANNER");
intent.putExtra("EXTRA_ENABLED_SCANNER",0);
context.sendBroadcast(intent);