OSDN Git Service

Don't automatically start user 0.
authorMartijn Coenen <maco@google.com>
Mon, 18 Nov 2019 13:26:54 +0000 (14:26 +0100)
committerMartijn Coenen <maco@google.com>
Fri, 22 Nov 2019 16:06:07 +0000 (17:06 +0100)
It's the responsibility of the StorageManagerService to send down
started users after a reset(); and with the latest multi-user FUSE
changes, the manual start is no longer necessary.

Bug: 135341433
Test: atest AdoptableHostTest

Change-Id: I3c9c1d7c25ad10787212d7902fa3f1878ee5f896

VolumeManager.cpp

index 546f802..3b7e6e1 100644 (file)
@@ -697,12 +697,6 @@ int VolumeManager::reset() {
         vol->destroy();
     }
     mInternalEmulatedVolumes.clear();
-    // Add user 0 cos it's always running and started
-    auto vol = std::shared_ptr<android::vold::VolumeBase>(
-            new android::vold::EmulatedVolume("/data/media", 0));
-    vol->setMountUserId(0);
-    vol->create();
-    mInternalEmulatedVolumes.push_back(vol);
 
     for (const auto& disk : mDisks) {
         disk->destroy();
@@ -711,8 +705,6 @@ int VolumeManager::reset() {
     updateVirtualDisk();
     mAddedUsers.clear();
     mStartedUsers.clear();
-
-    mStartedUsers.insert(0);
     return 0;
 }