Search in sources :

Example 1 with PackageInstallObserverAdapter

use of com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter in project platform_frameworks_base by android.

the class PackageInstallerSession method commit.

@Override
public void commit(IntentSender statusReceiver) {
    Preconditions.checkNotNull(statusReceiver);
    final boolean wasSealed;
    synchronized (mLock) {
        wasSealed = mSealed;
        if (!mSealed) {
            // Verify that all writers are hands-off
            for (FileBridge bridge : mBridges) {
                if (!bridge.isClosed()) {
                    throw new SecurityException("Files still open");
                }
            }
            mSealed = true;
        }
        // Client staging is fully done at this point
        mClientProgress = 1f;
        computeProgressLocked(true);
    }
    if (!wasSealed) {
        // Persist the fact that we've sealed ourselves to prevent
        // mutations of any hard links we create. We do this without holding
        // the session lock, since otherwise it's a lock inversion.
        mCallback.onSessionSealedBlocking(this);
    }
    // This ongoing commit should keep session active, even though client
    // will probably close their end.
    mActiveCount.incrementAndGet();
    final PackageInstallObserverAdapter adapter = new PackageInstallObserverAdapter(mContext, statusReceiver, sessionId, mIsInstallerDeviceOwner, userId);
    mHandler.obtainMessage(MSG_COMMIT, adapter.getBinder()).sendToTarget();
}
Also used : PackageInstallObserverAdapter(com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter) FileBridge(android.os.FileBridge)

Example 2 with PackageInstallObserverAdapter

use of com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter in project android_frameworks_base by DirtyUnicorns.

the class PackageInstallerSession method commit.

@Override
public void commit(IntentSender statusReceiver) {
    Preconditions.checkNotNull(statusReceiver);
    final boolean wasSealed;
    synchronized (mLock) {
        wasSealed = mSealed;
        if (!mSealed) {
            // Verify that all writers are hands-off
            for (FileBridge bridge : mBridges) {
                if (!bridge.isClosed()) {
                    throw new SecurityException("Files still open");
                }
            }
            mSealed = true;
        }
        // Client staging is fully done at this point
        mClientProgress = 1f;
        computeProgressLocked(true);
    }
    if (!wasSealed) {
        // Persist the fact that we've sealed ourselves to prevent
        // mutations of any hard links we create. We do this without holding
        // the session lock, since otherwise it's a lock inversion.
        mCallback.onSessionSealedBlocking(this);
    }
    // This ongoing commit should keep session active, even though client
    // will probably close their end.
    mActiveCount.incrementAndGet();
    final PackageInstallObserverAdapter adapter = new PackageInstallObserverAdapter(mContext, statusReceiver, sessionId, mIsInstallerDeviceOwner, userId);
    mHandler.obtainMessage(MSG_COMMIT, adapter.getBinder()).sendToTarget();
}
Also used : PackageInstallObserverAdapter(com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter) FileBridge(android.os.FileBridge)

Example 3 with PackageInstallObserverAdapter

use of com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter in project android_frameworks_base by AOSPA.

the class PackageInstallerSession method commit.

@Override
public void commit(IntentSender statusReceiver) {
    Preconditions.checkNotNull(statusReceiver);
    final boolean wasSealed;
    synchronized (mLock) {
        wasSealed = mSealed;
        if (!mSealed) {
            // Verify that all writers are hands-off
            for (FileBridge bridge : mBridges) {
                if (!bridge.isClosed()) {
                    throw new SecurityException("Files still open");
                }
            }
            mSealed = true;
        }
        // Client staging is fully done at this point
        mClientProgress = 1f;
        computeProgressLocked(true);
    }
    if (!wasSealed) {
        // Persist the fact that we've sealed ourselves to prevent
        // mutations of any hard links we create. We do this without holding
        // the session lock, since otherwise it's a lock inversion.
        mCallback.onSessionSealedBlocking(this);
    }
    // This ongoing commit should keep session active, even though client
    // will probably close their end.
    mActiveCount.incrementAndGet();
    final PackageInstallObserverAdapter adapter = new PackageInstallObserverAdapter(mContext, statusReceiver, sessionId, mIsInstallerDeviceOwner, userId);
    mHandler.obtainMessage(MSG_COMMIT, adapter.getBinder()).sendToTarget();
}
Also used : PackageInstallObserverAdapter(com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter) FileBridge(android.os.FileBridge)

Example 4 with PackageInstallObserverAdapter

use of com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter in project android_frameworks_base by crdroidandroid.

the class PackageInstallerSession method commit.

@Override
public void commit(IntentSender statusReceiver) {
    Preconditions.checkNotNull(statusReceiver);
    final boolean wasSealed;
    synchronized (mLock) {
        wasSealed = mSealed;
        if (!mSealed) {
            // Verify that all writers are hands-off
            for (FileBridge bridge : mBridges) {
                if (!bridge.isClosed()) {
                    throw new SecurityException("Files still open");
                }
            }
            mSealed = true;
        }
        // Client staging is fully done at this point
        mClientProgress = 1f;
        computeProgressLocked(true);
    }
    if (!wasSealed) {
        // Persist the fact that we've sealed ourselves to prevent
        // mutations of any hard links we create. We do this without holding
        // the session lock, since otherwise it's a lock inversion.
        mCallback.onSessionSealedBlocking(this);
    }
    // This ongoing commit should keep session active, even though client
    // will probably close their end.
    mActiveCount.incrementAndGet();
    final PackageInstallObserverAdapter adapter = new PackageInstallObserverAdapter(mContext, statusReceiver, sessionId, mIsInstallerDeviceOwner, userId);
    mHandler.obtainMessage(MSG_COMMIT, adapter.getBinder()).sendToTarget();
}
Also used : PackageInstallObserverAdapter(com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter) FileBridge(android.os.FileBridge)

Example 5 with PackageInstallObserverAdapter

use of com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter in project android_frameworks_base by ResurrectionRemix.

the class PackageInstallerSession method commit.

@Override
public void commit(IntentSender statusReceiver) {
    Preconditions.checkNotNull(statusReceiver);
    final boolean wasSealed;
    synchronized (mLock) {
        wasSealed = mSealed;
        if (!mSealed) {
            // Verify that all writers are hands-off
            for (FileBridge bridge : mBridges) {
                if (!bridge.isClosed()) {
                    throw new SecurityException("Files still open");
                }
            }
            mSealed = true;
        }
        // Client staging is fully done at this point
        mClientProgress = 1f;
        computeProgressLocked(true);
    }
    if (!wasSealed) {
        // Persist the fact that we've sealed ourselves to prevent
        // mutations of any hard links we create. We do this without holding
        // the session lock, since otherwise it's a lock inversion.
        mCallback.onSessionSealedBlocking(this);
    }
    // This ongoing commit should keep session active, even though client
    // will probably close their end.
    mActiveCount.incrementAndGet();
    final PackageInstallObserverAdapter adapter = new PackageInstallObserverAdapter(mContext, statusReceiver, sessionId, mIsInstallerDeviceOwner, userId);
    mHandler.obtainMessage(MSG_COMMIT, adapter.getBinder()).sendToTarget();
}
Also used : PackageInstallObserverAdapter(com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter) FileBridge(android.os.FileBridge)

Aggregations

FileBridge (android.os.FileBridge)5 PackageInstallObserverAdapter (com.android.server.pm.PackageInstallerService.PackageInstallObserverAdapter)5