Search code examples
javaandroidandroid-activityandroid-sourceandroid-file

How to read/write to a file from ActivityThread in android?


I am working my personal project and making some framework changes in Android OS code (AOSP). I want to write/read from a single file before an app is launched. I am making changes in framework/base/core/java/android/app/applications/ActivityThread.java, where it launches activity to run the app.

Each app is launched as a separate process and android expects me to add permission in AndroidManifest.xml, but I am not reading/writing file from the app, I am reading from the framework, before the app is launched.

Is there any way to create a single file which can be used by all users in ActivityThread?


Solution

  • Framework code running in app's process haven't any special privileges. Your need to put such code somewhere in system services.