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

Commit 7bfd87f1 authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Merge "Add null checks to EMBMS AIDL impls"

am: 9e93a651

Change-Id: I888b5772fca069b638f1c2d0f803cf3863b7ff85
parents 0bfb717a 9e93a651
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -113,6 +113,10 @@ public class MbmsDownloadServiceBase extends IMbmsDownloadService.Stub {
    @Override
    public final int initialize(final int subscriptionId,
            final IMbmsDownloadSessionCallback callback) throws RemoteException {
        if (callback == null) {
            throw new NullPointerException("Callback must not be null");
        }

        final int uid = Binder.getCallingUid();
        callback.asBinder().linkToDeath(new DeathRecipient() {
            @Override
@@ -240,6 +244,13 @@ public class MbmsDownloadServiceBase extends IMbmsDownloadService.Stub {
    public final int registerStateCallback(final DownloadRequest downloadRequest,
            final IDownloadStateCallback callback, int flags) throws RemoteException {
        final int uid = Binder.getCallingUid();
        if (downloadRequest == null) {
            throw new NullPointerException("Download request must not be null");
        }
        if (callback == null) {
            throw new NullPointerException("Callback must not be null");
        }

        DeathRecipient deathRecipient = new DeathRecipient() {
            @Override
            public void binderDied() {
@@ -292,6 +303,13 @@ public class MbmsDownloadServiceBase extends IMbmsDownloadService.Stub {
    public final int unregisterStateCallback(
            final DownloadRequest downloadRequest, final IDownloadStateCallback callback)
            throws RemoteException {
        if (downloadRequest == null) {
            throw new NullPointerException("Download request must not be null");
        }
        if (callback == null) {
            throw new NullPointerException("Callback must not be null");
        }

        DeathRecipient deathRecipient =
                mDownloadCallbackDeathRecipients.remove(callback.asBinder());
        if (deathRecipient == null) {
+8 −0
Original line number Diff line number Diff line
@@ -65,6 +65,10 @@ public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub {
    @Override
    public final int initialize(final IMbmsStreamingSessionCallback callback,
            final int subscriptionId) throws RemoteException {
        if (callback == null) {
            throw new NullPointerException("Callback must not be null");
        }

        final int uid = Binder.getCallingUid();
        callback.asBinder().linkToDeath(new DeathRecipient() {
            @Override
@@ -152,6 +156,10 @@ public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub {
    @Override
    public int startStreaming(final int subscriptionId, String serviceId,
            final IStreamingServiceCallback callback) throws RemoteException {
        if (callback == null) {
            throw new NullPointerException("Callback must not be null");
        }

        final int uid = Binder.getCallingUid();
        callback.asBinder().linkToDeath(new DeathRecipient() {
            @Override