I'm have a handler thread with thread priority set to background,
myHandlerThread = new HandlerThread(HANDLER_THREAD_NAME, Process.THREAD_PRIORITY_BACKGROUND);
On this myHandlerThread
I'm doing some operation to alter system property by invoking
SystemProperties.set(property, propertyValue);
I'm facing this exception frequently,
[Events]
java.lang.RuntimeException: failed to set system property
at android.os.SystemProperties.native_set(Native Method)
at android.os.SystemProperties.set(SystemProperties.java:130)
There can be multiple reasons which can cause this
1) The native code might have timed out when executing this code.
2) Since the thread is given with priority BACKGROUND
it might not have time to execute when the CPU is busy and might have timed out at the end.
Will increasing the thread priority to NORMAL
would help? Or how the thread will get timed out? Or what are the other reasons which could cause this issue?