Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3567f2be authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Skip registering callback for appop changes if fuse is enabled.

The work done in StorageManagerService when opChanged() callback
gets triggered is causing delay in sending onLockedBootCompleted()
callback during the user switch. Given that opChanged() computes
the mount mode but does not use it for anything, this change skips
listening to these appop changes to speed up the user switch
process.

Bug: 134624284
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ExternalStorageHostTest.java
      (Same P/F with and without this change)
Change-Id: I4bbdfa7954ab0499e4828f4bff0b2ce80444471b
parent b80a55cd
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1941,12 +1941,15 @@ class StorageManagerService extends IStorageManager.Stub
            mDownloadsAuthorityAppId = UserHandle.getAppId(provider.applicationInfo.uid);
        }

        if (!mIsFuseEnabled) {
            try {
            mIAppOpsService.startWatchingMode(OP_REQUEST_INSTALL_PACKAGES, null, mAppOpsCallback);
                mIAppOpsService.startWatchingMode(OP_REQUEST_INSTALL_PACKAGES, null,
                        mAppOpsCallback);
                mIAppOpsService.startWatchingMode(OP_LEGACY_STORAGE, null, mAppOpsCallback);
            } catch (RemoteException e) {
            }
        }
    }

    private void updateLegacyStorageApps(String packageName, int uid, boolean hasLegacy) {
        synchronized (mLock) {