Merge "Forward the ResultReceiver to Tethering Entitlement app"
diff --git a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
index 8b06975..f3c029f 100644
--- a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
+++ b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
@@ -288,7 +288,7 @@
             // setup.
             final String supervisor = getString(
                     com.android.internal.R.string.config_defaultSupervisionProfileOwnerComponent);
-            if (supervisor == null) {
+            if (TextUtils.isEmpty(supervisor)) {
                 Log.w(TAG, "Unable to set profile owner post-setup, no default supervisor"
                         + "profile owner defined");
                 finish();
@@ -297,7 +297,7 @@
 
             final ComponentName supervisorComponent = ComponentName.unflattenFromString(
                     supervisor);
-            if (who.compareTo(supervisorComponent) != 0) {
+            if (supervisorComponent == null || who.compareTo(supervisorComponent) != 0) {
                 Log.w(TAG, "Unable to set non-default profile owner post-setup " + who);
                 finish();
                 return;
diff --git a/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceController.java b/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceController.java
index 880c444..6eebe6b 100644
--- a/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceController.java
+++ b/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceController.java
@@ -98,7 +98,7 @@
     @Override
     public int getAvailabilityStatus(int subId) {
         PersistableBundle bundle = mCarrierConfigManager.getConfigForSubId(subId);
-        boolean shouldShowPresence = bundle.getBoolean(
+        boolean shouldShowPresence = bundle != null && bundle.getBoolean(
                 CarrierConfigManager.KEY_USE_RCS_PRESENCE_BOOL, false /*default*/);
         return shouldShowPresence ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
     }