Java Code Examples for android.content.pm.IPackageInstallerCallback

The following are top voted examples for showing how to use android.content.pm.IPackageInstallerCallback. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: container   File: VPackageInstallerService.java   View source code 9 votes vote down vote up
@Override
public void handleMessage(Message msg) {
    final int userId = msg.arg2;
    final int n = mCallbacks.beginBroadcast();
    for (int i = 0; i < n; i++) {
        final IPackageInstallerCallback callback = mCallbacks.getBroadcastItem(i);
        final VUserHandle user = (VUserHandle) mCallbacks.getBroadcastCookie(i);
        // TODO: dispatch notifications for slave profiles
        if (userId == user.getIdentifier()) {
            try {
                invokeCallback(callback, msg);
            } catch (RemoteException ignored) {
            }
        }
    }
    mCallbacks.finishBroadcast();
}
 
Example 2
Project: VirtualHook   File: VPackageInstallerService.java   View source code 6 votes vote down vote up
@Override
public void handleMessage(Message msg) {
    final int userId = msg.arg2;
    final int n = mCallbacks.beginBroadcast();
    for (int i = 0; i < n; i++) {
        final IPackageInstallerCallback callback = mCallbacks.getBroadcastItem(i);
        final VUserHandle user = (VUserHandle) mCallbacks.getBroadcastCookie(i);
        // TODO: dispatch notifications for slave profiles
        if (userId == user.getIdentifier()) {
            try {
                invokeCallback(callback, msg);
            } catch (RemoteException ignored) {
            }
        }
    }
    mCallbacks.finishBroadcast();
}
 
Example 3
Project: VirtualHook   File: VPackageInstallerService.java   View source code 6 votes vote down vote up
private void invokeCallback(IPackageInstallerCallback callback, Message msg)
        throws RemoteException {
    final int sessionId = msg.arg1;
    switch (msg.what) {
        case MSG_SESSION_CREATED:
            callback.onSessionCreated(sessionId);
            break;
        case MSG_SESSION_BADGING_CHANGED:
            callback.onSessionBadgingChanged(sessionId);
            break;
        case MSG_SESSION_ACTIVE_CHANGED:
            callback.onSessionActiveChanged(sessionId, (boolean) msg.obj);
            break;
        case MSG_SESSION_PROGRESS_CHANGED:
            callback.onSessionProgressChanged(sessionId, (float) msg.obj);
            break;
        case MSG_SESSION_FINISHED:
            callback.onSessionFinished(sessionId, (boolean) msg.obj);
            break;
    }
}
 
Example 4
Project: TPlayer   File: VPackageInstallerService.java   View source code 6 votes vote down vote up
@Override
public void handleMessage(Message msg) {
    final int userId = msg.arg2;
    final int n = mCallbacks.beginBroadcast();
    for (int i = 0; i < n; i++) {
        final IPackageInstallerCallback callback = mCallbacks.getBroadcastItem(i);
        final VUserHandle user = (VUserHandle) mCallbacks.getBroadcastCookie(i);
        // TODO: dispatch notifications for slave profiles
        if (userId == user.getIdentifier()) {
            try {
                invokeCallback(callback, msg);
            } catch (RemoteException ignored) {
            }
        }
    }
    mCallbacks.finishBroadcast();
}
 
Example 5
Project: TPlayer   File: VPackageInstallerService.java   View source code 6 votes vote down vote up
private void invokeCallback(IPackageInstallerCallback callback, Message msg)
        throws RemoteException {
    final int sessionId = msg.arg1;
    switch (msg.what) {
        case MSG_SESSION_CREATED:
            callback.onSessionCreated(sessionId);
            break;
        case MSG_SESSION_BADGING_CHANGED:
            callback.onSessionBadgingChanged(sessionId);
            break;
        case MSG_SESSION_ACTIVE_CHANGED:
            callback.onSessionActiveChanged(sessionId, (boolean) msg.obj);
            break;
        case MSG_SESSION_PROGRESS_CHANGED:
            callback.onSessionProgressChanged(sessionId, (float) msg.obj);
            break;
        case MSG_SESSION_FINISHED:
            callback.onSessionFinished(sessionId, (boolean) msg.obj);
            break;
    }
}
 
Example 6
Project: container   File: VPackageInstallerService.java   View source code 6 votes vote down vote up
private void invokeCallback(IPackageInstallerCallback callback, Message msg)
        throws RemoteException {
    final int sessionId = msg.arg1;
    switch (msg.what) {
        case MSG_SESSION_CREATED:
            callback.onSessionCreated(sessionId);
            break;
        case MSG_SESSION_BADGING_CHANGED:
            callback.onSessionBadgingChanged(sessionId);
            break;
        case MSG_SESSION_ACTIVE_CHANGED:
            callback.onSessionActiveChanged(sessionId, (boolean) msg.obj);
            break;
        case MSG_SESSION_PROGRESS_CHANGED:
            callback.onSessionProgressChanged(sessionId, (float) msg.obj);
            break;
        case MSG_SESSION_FINISHED:
            callback.onSessionFinished(sessionId, (boolean) msg.obj);
            break;
    }
}
 
Example 7
Project: VirtualHook   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
@Override
public void registerCallback(IPackageInstallerCallback callback, int userId) throws RemoteException {
    mCallbacks.register(callback, userId);
}
 
Example 8
Project: VirtualHook   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
@Override
public void unregisterCallback(IPackageInstallerCallback callback) throws RemoteException {
    mCallbacks.unregister(callback);
}
 
Example 9
Project: VirtualHook   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
public void register(IPackageInstallerCallback callback, int userId) {
    mCallbacks.register(callback, new VUserHandle(userId));
}
 
Example 10
Project: VirtualHook   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
public void unregister(IPackageInstallerCallback callback) {
    mCallbacks.unregister(callback);
}
 
Example 11
Project: TPlayer   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
@Override
public void registerCallback(IPackageInstallerCallback callback, int userId) throws RemoteException {
    mCallbacks.register(callback, userId);
}
 
Example 12
Project: TPlayer   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
@Override
public void unregisterCallback(IPackageInstallerCallback callback) throws RemoteException {
    mCallbacks.unregister(callback);
}
 
Example 13
Project: TPlayer   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
public void register(IPackageInstallerCallback callback, int userId) {
    mCallbacks.register(callback, new VUserHandle(userId));
}
 
Example 14
Project: TPlayer   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
public void unregister(IPackageInstallerCallback callback) {
    mCallbacks.unregister(callback);
}
 
Example 15
Project: container   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
public void register(IPackageInstallerCallback callback, int userId) {
    mCallbacks.register(callback, new VUserHandle(userId));
}
 
Example 16
Project: container   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
public void unregister(IPackageInstallerCallback callback) {
    mCallbacks.unregister(callback);
}
 
Example 17
Project: container   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
@Override
public void registerCallback(IPackageInstallerCallback callback, int userId) throws RemoteException {
    mCallbacks.register(callback, userId);
}
 
Example 18
Project: container   File: VPackageInstallerService.java   View source code 4 votes vote down vote up
@Override
public void unregisterCallback(IPackageInstallerCallback callback) throws RemoteException {
    mCallbacks.unregister(callback);
}