android:exported=“true”
外部通过packageName和className就可以调用了:
Intent intentRoute = new Intent();
intentRoute.setClassName(“com.tchip.route”,
“com.tchip.route.service.RouteRecordService”);
startService(intentRoute);
3.设备首次开机Pico TTS概率性停止运行的问题
相关代码位置:
external/svox/pico/src/com/svox/pico/LangPackUninstaller.java
关键Log:
AndroidRuntime: java.lang.RuntimeException: Unable to start receiver com.svox.pico.LangPackUninstaller: java.lang.SecurityException: Neither user 10060 nor current process has android.permission.DELETE_PACKAGES.
原因是首次开机时,Pico TTS会根据时区删除一些语言包,然而没有DELETE_PACKAGES权限,抛出SecurityException安全异常。虽然已经声明DELETE_PACKAGES了权限,但是没有system的sharedUserId,添加就可以了:
android:sharedUserId=“android.uid.system”
这样编译的时候,系统会使用platform.x509.pem和platform.pk8对生成的APK进行签名。
4.too many libraries