Skip to content
Snippets Groups Projects
Commit 59facef6 authored by Ayush Sharma's avatar Ayush Sharma
Browse files

Handle null component name for default sms app

Bug: 336726661
Test: atest android.devicepolicy.cts.PersonalAppsSuspensionTest
Change-Id: Ib721b73347160935479bc55ebf604f22c67239de
parent b0f4faad
No related branches found
No related tags found
No related merge requests found
......@@ -202,9 +202,9 @@ public final class PersonalAppsSuspensionHelper {
private String getDefaultSmsPackage() {
//TODO(b/319449037): Unflag the following change.
if (Flags.defaultSmsPersonalAppSuspensionFixEnabled()) {
return SmsApplication.getDefaultSmsApplicationAsUser(
mContext, /*updateIfNeeded=*/ false, mContext.getUser())
.getPackageName();
ComponentName defaultSmsApp = SmsApplication.getDefaultSmsApplicationAsUser(
mContext, /*updateIfNeeded=*/ false, mContext.getUser());
return defaultSmsApp != null ? defaultSmsApp.getPackageName() : null;
} else {
return Telephony.Sms.getDefaultSmsPackage(mContext);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment