Return null for getSubmitPdu() for encoding failure instead of NPE
It returns null as API description for null message or null destination instead of NPE. Bug: 111731144 Test: atest SmsMessageTest Change-Id: I1dc8537b6d07a43345c266122a1c77e73e58e7e8 Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
@@ -627,7 +627,7 @@ public class SmsMessage {
|
||||
destinationAddress, message, statusReportRequested);
|
||||
}
|
||||
|
||||
return new SubmitPdu(spb);
|
||||
return spb != null ? new SubmitPdu(spb) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -655,7 +655,7 @@ public class SmsMessage {
|
||||
destinationAddress, destinationPort, data, statusReportRequested);
|
||||
}
|
||||
|
||||
return new SubmitPdu(spb);
|
||||
return spb != null ? new SubmitPdu(spb) : null;
|
||||
}
|
||||
|
||||
// TODO: SubmitPdu class is used for SMS-DELIVER also now. Refactor for SubmitPdu and new
|
||||
|
||||
Reference in New Issue
Block a user