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

Commit 67a08c31 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Update process mount points when appop gets updated."

parents c60fbd4f ff971bc3
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ import android.util.TimeUtils;
import android.util.Xml;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.IAppOpsCallback;
import com.android.internal.app.IAppOpsService;
import com.android.internal.os.AppFuseMount;
import com.android.internal.os.BackgroundThread;
@@ -1709,6 +1710,10 @@ class StorageManagerService extends IStorageManager.Stub
                ServiceManager.getService("package"));
        mIAppOpsService = IAppOpsService.Stub.asInterface(
                ServiceManager.getService(Context.APP_OPS_SERVICE));
        try {
            mIAppOpsService.startWatchingMode(OP_REQUEST_INSTALL_PACKAGES, null, mAppOpsCallback);
        } catch (RemoteException e) {
        }
        mHandler.obtainMessage(H_SYSTEM_READY).sendToTarget();
    }

@@ -3240,6 +3245,15 @@ class StorageManagerService extends IStorageManager.Stub
        }
    }

    private IAppOpsCallback.Stub mAppOpsCallback = new IAppOpsCallback.Stub() {
        @Override
        public void opChanged(int op, int uid, String packageName) throws RemoteException {
            if (!ENABLE_ISOLATED_STORAGE) return;

            remountUidExternalStorage(uid, getMountMode(uid, packageName));
        }
    };

    private static final Pattern PATTERN_TRANSLATE = Pattern.compile(
            "(?i)^(/storage/[^/]+/(?:[0-9]+/)?)(.*)");