Java 类android.content.pm.IPackageInstallerCallback 实例源码

项目:VirtualHook    文件:VPackageInstallerService.java   
@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();
}
项目:VirtualHook    文件:VPackageInstallerService.java   
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;
    }
}
项目:TPlayer    文件:VPackageInstallerService.java   
@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();
}
项目:TPlayer    文件:VPackageInstallerService.java   
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;
    }
}
项目:container    文件:VPackageInstallerService.java   
@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();
}
项目:container    文件:VPackageInstallerService.java   
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;
    }
}
项目:VirtualHook    文件:VPackageInstallerService.java   
@Override
public void registerCallback(IPackageInstallerCallback callback, int userId) throws RemoteException {
    mCallbacks.register(callback, userId);
}
项目:VirtualHook    文件:VPackageInstallerService.java   
@Override
public void unregisterCallback(IPackageInstallerCallback callback) throws RemoteException {
    mCallbacks.unregister(callback);
}
项目:VirtualHook    文件:VPackageInstallerService.java   
public void register(IPackageInstallerCallback callback, int userId) {
    mCallbacks.register(callback, new VUserHandle(userId));
}
项目:VirtualHook    文件:VPackageInstallerService.java   
public void unregister(IPackageInstallerCallback callback) {
    mCallbacks.unregister(callback);
}
项目:TPlayer    文件:VPackageInstallerService.java   
@Override
public void registerCallback(IPackageInstallerCallback callback, int userId) throws RemoteException {
    mCallbacks.register(callback, userId);
}
项目:TPlayer    文件:VPackageInstallerService.java   
@Override
public void unregisterCallback(IPackageInstallerCallback callback) throws RemoteException {
    mCallbacks.unregister(callback);
}
项目:TPlayer    文件:VPackageInstallerService.java   
public void register(IPackageInstallerCallback callback, int userId) {
    mCallbacks.register(callback, new VUserHandle(userId));
}
项目:TPlayer    文件:VPackageInstallerService.java   
public void unregister(IPackageInstallerCallback callback) {
    mCallbacks.unregister(callback);
}
项目:container    文件:VPackageInstallerService.java   
public void register(IPackageInstallerCallback callback, int userId) {
    mCallbacks.register(callback, new VUserHandle(userId));
}
项目:container    文件:VPackageInstallerService.java   
public void unregister(IPackageInstallerCallback callback) {
    mCallbacks.unregister(callback);
}
项目:container    文件:VPackageInstallerService.java   
@Override
public void registerCallback(IPackageInstallerCallback callback, int userId) throws RemoteException {
    mCallbacks.register(callback, userId);
}
项目:container    文件:VPackageInstallerService.java   
@Override
public void unregisterCallback(IPackageInstallerCallback callback) throws RemoteException {
    mCallbacks.unregister(callback);
}