Hi
I have created a new service launched in SystemServer.java:
try {
Slog.i(TAG, "xxxx Service");
ServiceManager.addService("xxxx", new
xxxxService(context));
} catch (Throwable e) {
Slog.e(TAG, "Failure starting xxxx Service", e);
}
Everything is fine except I cannot write to or read from the SDCARD. I
need to create directories and write files based on a HTTP feed. This
files are the read back for display and other purposes. I understand
that in a stand-alone app the permission mus be set in
AndroidMAnifest.xml. But this is the OS. I would have thought that the
SystemServer would have such permission.
in my code the call to
mContext.checkCallingOrSelfPermission("android.permission.WRITE_EXTERNAL_STORAGE");
returns 0 which is permission denied.
I have tried the following
mContext.enforcePermission("android.permission.WRITE_EXTERNAL_STORAGE",
Binder.getCallingPid(), 0, "xxxCache enforcing sdcard write");
which does not help
I have tried
File sdcard = new
File(Environment.getExternalStorageDirectory().toString());
sdcard.setWritable(true);
this also fails.
So I assume I do not have the permission to write (an read) to the
SDCard
BTW this is done on the emulator.
Can someone please point me in the right direction. I have scoured the
framework source code and cannot find where permissions are set.
Thanks in Advance
Jean-Pierre
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting