Fix java.lang.ArrayIndexOutOfBoundsException in RemoteVolumeGroupController

-Caused by removing and adding preference at the same time
-Make preference operation method synchronized
-Not to update preference by removing and adding. To check session status and update its content to preference
-Post to UI thread to handle the onDeviceListUpdate() callback from framework

Bug: 170049403
Test: make -j50 RunSettingsRoboTests
Merged-In: Ibfc11e1bd99ba2e578b5d9e7dcc9132e372b68dd
Change-Id: Ibfc11e1bd99ba2e578b5d9e7dcc9132e372b68dd
(cherry picked from commit 1268629fda99896bda747a2531c6c3a4480d8cb1)
1 file changed