(bug 44247) Do not write to storage if read-only mode is on

Change-Id: I2e41cef0b5952c43cbba3374ac4da431b81c18ba
Merge "(bug 44247) Do not write to storage if read-only mode is on"