我的开发者控制台中有一个错误,它说它无法启动RingTonePickerActivity
,因为我没有WRITE_SETTINGS
清单中的权限。为什么我需要该权限才能显示RingTonePicker
?我在几台设备上测试了这个,而清单中没有,而且根本没有问题,所以什么给出了?
java.lang.RuntimeException: Unable to start activity ComponentInfo{android/com.android.internal.app.RingtonePickerActivity}:
java.lang.SecurityException: Permission Denial: writing com.android.providers.settings.SettingsProvider uri content://settings/system from pid=24760, uid=10108 requires android.permission.WRITE_SETTINGS
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
at android.app.ActivityThread.access$1500(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.SecurityException: Permission Denial: writing com.android.providers.settings.SettingsProvider uri content://settings/system from pid=24760, uid=10108 requires android.permission.WRITE_SETTINGS
at android.os.Parcel.readException(Parcel.java:1322)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:160)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:408)
at android.content.ContentResolver.insert(ContentResolver.java:604)
at android.provider.Settings$NameValueTable.putString(Settings.java:576)
at android.provider.Settings$System.putString(Settings.java:772)
at android.media.RingtoneManager.setActualDefaultRingtoneUri(RingtoneManager.java:655)
at android.media.RingtoneManager.setDefaultNotificationToProvider(RingtoneManager.java:764)
at com.android.internal.app.RingtonePickerActivity.onCreate(RingtonePickerActivity.java:166)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)