OSDN Git Service

Fix multi-user and multi-storage with FUSE
authorZim <zezeozue@google.com>
Wed, 25 Sep 2019 13:37:38 +0000 (14:37 +0100)
committerZim <zezeozue@google.com>
Mon, 11 Nov 2019 20:24:49 +0000 (20:24 +0000)
commita438b2436886a9d1dbb865c891cc5ec9ececba09
tree8717e9a392b74e108a7195467b0bd7ee90ba4714
parent0ddfc941b854cb59472bb4420c1fe22d2dba1c87
Fix multi-user and multi-storage with FUSE

Up until now, the FUSE mount logic has made two assumptions:
1. The primary external volume is an emulated volume on /data/media
2. Only the primary user is running, as user zero

These assumptions are fixed by the following changes
creating an EmulatedVolume per Android user and changing the
VolumeBase id format to append the user to the id, so
s/emulated/emulated-0/. This allows us mount separate volumes per user

Some additional refactorings to re-use/clean up code.

Test: adb shell sm set-virtual-disk and partition disk operations work
even after setting up a work profile
Bug: 135341433

Change-Id: Ifabaa12368e5a591fbcdce4ee71c83ff35fdac6b
13 files changed:
Utils.cpp
Utils.h
VoldNativeService.cpp
VolumeManager.cpp
VolumeManager.h
binder/android/os/IVoldListener.aidl
model/EmulatedVolume.cpp
model/EmulatedVolume.h
model/PrivateVolume.cpp
model/PrivateVolume.h
model/PublicVolume.cpp
model/VolumeBase.cpp
model/VolumeBase.h