Harden against jobscheduler client app misbehavior

Client apps can supply a ParcelableBundle of extras as part of their
job parameters.  Make sure we don't blow up if those extras turn out
to be malformed.

Bug 34050090

Change-Id: I196a5ede7230aa93a971bd9fb87d032730d2f296
This commit is contained in:
Christopher Tate
2017-01-04 11:18:22 -08:00
parent 73dcab62b7
commit a8e8e4a34f

View File

@@ -445,7 +445,10 @@ public class JobServiceContext extends IJobCallback.Stub implements ServiceConne
mVerb = VERB_STARTING;
scheduleOpTimeOut();
service.startJob(mParams);
} catch (RemoteException e) {
} catch (Exception e) {
// We catch 'Exception' because client-app malice or bugs might induce a wide
// range of possible exception-throw outcomes from startJob() and its handling
// of the client's ParcelableBundle extras.
Slog.e(TAG, "Error sending onStart message to '" +
mRunningJob.getServiceComponent().getShortClassName() + "' ", e);
}