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

Commit ee274b6e authored by Duke Lee's avatar Duke Lee Committed by Sungcheol Ahn
Browse files

Add notification when satellite availability changes

When satellite availaibility changes, we need to notify the state to users so that they're aware of it.
Specifically, when the satellite connectivity is not available, we need to show users the reason so that
they can act accordingly. For example, if we show that satellite connectivity is not available because
location settings is disabled, users can enable location settings and check availability again.

UX slides: https://docs.google.com/presentation/d/1V8gbbqRL29HXUKYEaSFKUaHRUeA_x0q_nZBgwDUU0uE/edit?resourcekey=0-53MTCEBrU5ruyn4df0-p1A#slide=id.g310714dd279_2_0



Test: Manual
Bug: 376694756
Flag: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn

Change-Id: I55739750614b41c1966a4adda4f76dffb2b27a71
Signed-off-by: default avatarDuke Lee <deukmo.lee@samsung.corp-partner.google.com>
parent 146fcf97
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -472,10 +472,13 @@
    <integer name="config_mt_sms_polling_throttle_millis">300000</integer>
    <java-symbol type="integer" name="config_mt_sms_polling_throttle_millis" />


    <!-- The receiver class of the intent that hidden menu sends to start satellite non-emergency mode -->
    <string name="config_satellite_carrier_roaming_non_emergency_session_class" translatable="false"></string>
    <java-symbol type="string" name="config_satellite_carrier_roaming_non_emergency_session_class" />

    <!-- Whether to show the system notification to users whenever there is a change
     in the satellite availability state at the current location. -->
    <bool name="config_satellite_should_notify_availability">false</bool>
    <java-symbol type="bool" name="config_satellite_should_notify_availability" />

</resources>
+48 −0
Original line number Diff line number Diff line
@@ -6522,6 +6522,54 @@ ul.</string>
    <string name="satellite_manual_selection_state_popup_cancel">Go back</string>
    <!-- Initial/System provided label shown for an app which gets unarchived. [CHAR LIMIT=64]. -->
    <string name="unarchival_session_app_label">Pending...</string>
    <!-- Notification title when satellite service is available. -->
    <string name="satellite_sos_available_notification_title">Satellite SOS is now available</string>
    <!-- Notification summary when satellite service is available. [CHAR LIMIT=NONE] -->
    <string name="satellite_sos_available_notification_summary">You can message emergency services if there\'s no mobile or Wi-Fi network. Google Messages must be your default messaging app.</string>
    <!-- Notification title when satellite service is not supported by device. -->
    <string name="satellite_sos_not_supported_notification_title">Satellite SOS isn\'t supported</string>
    <!-- Notification summary when satellite service is not supported by device. [CHAR LIMIT=NONE] -->
    <string name="satellite_sos_not_supported_notification_summary">Satellite SOS isn\'t supported on this device</string>
    <!-- Notification title when satellite service is not provisioned. [CHAR LIMIT=NONE] -->
    <string name="satellite_sos_not_provisioned_notification_title">Satellite SOS isn\'t set up</string>
    <!-- Notification summary when satellite service is not provisioned. [CHAR LIMIT=NONE] -->
    <string name="satellite_sos_not_provisioned_notification_summary">Make sure you\'re connected to the internet and try setup again</string>
    <!-- Notification title when satellite service is not allowed at current location. -->
    <string name="satellite_sos_not_in_allowed_region_notification_title">Satellite SOS isn\'t available</string>
    <!-- Notification summary when satellite service is not allowed at current location. [CHAR LIMIT=NONE] -->
    <string name="satellite_sos_not_in_allowed_region_notification_summary">Satellite SOS isn\'t available in this country or region</string>
    <!-- Notification title when default messaging app does not support satellite. [CHAR LIMIT=NONE] -->
    <string name="satellite_sos_unsupported_default_sms_app_notification_title">Satellite SOS not set up</string>
    <!-- Notification summary when default messaging app does not support satellite. [CHAR LIMIT=NONE] -->
    <string name="satellite_sos_unsupported_default_sms_app_notification_summary">To message by satellite, set Google Messages as your default messaging app</string>
    <!-- Notification title when location settings is disabled. -->
    <string name="satellite_sos_location_disabled_notification_title">Satellite SOS isn\'t available</string>
    <!-- Notification summary when location settings is disabled. [CHAR LIMIT=NONE] -->
    <string name="satellite_sos_location_disabled_notification_summary">To check if satellite SOS is available in this country or region, turn on location settings</string>
    <!-- Notification title when satellite service is available. -->
    <string name="satellite_messaging_available_notification_title">Satellite messaging available</string>
    <!-- Notification summary when satellite service is available. [CHAR LIMIT=NONE] -->
    <string name="satellite_messaging_available_notification_summary">You can message by satellite if there\'s no mobile or Wi-Fi network. Google Messages must be your default messaging app.</string>
    <!-- Notification title when satellite service is not supported by device. -->
    <string name="satellite_messaging_not_supported_notification_title">Satellite messaging not supported</string>
    <!-- Notification summary when satellite service is not supported by device. [CHAR LIMIT=NONE] -->
    <string name="satellite_messaging_not_supported_notification_summary">Satellite messaging isn\'t supported on this device</string>
    <!-- Notification title when satellite service is not provisioned. [CHAR LIMIT=NONE] -->
    <string name="satellite_messaging_not_provisioned_notification_title">Satellite messaging not set up</string>
    <!-- Notification summary when satellite service is not provisioned. [CHAR LIMIT=NONE] -->
    <string name="satellite_messaging_not_provisioned_notification_summary">Make sure you\'re connected to the internet and try setup again</string>
    <!-- Notification title when satellite service is not allowed at current location. -->
    <string name="satellite_messaging_not_in_allowed_region_notification_title">Satellite messaging not available</string>
    <!-- Notification summary when satellite service is not allowed at current location. [CHAR LIMIT=NONE] -->
    <string name="satellite_messaging_not_in_allowed_region_notification_summary">Satellite messaging isn\'t available in this country or region</string>
    <!-- Notification title when default messaging app does not support satellite. [CHAR LIMIT=NONE] -->
    <string name="satellite_messaging_unsupported_default_sms_app_notification_title">Satellite messaging not set up</string>
    <!-- Notification summary when default messaging app does not support satellite. [CHAR LIMIT=NONE] -->
    <string name="satellite_messaging_unsupported_default_sms_app_notification_summary">To message by satellite, set Google Messages as your default messaging app</string>
    <!-- Notification title when location settings is disabled. -->
    <string name="satellite_messaging_location_disabled_notification_title">Satellite messaging not available</string>
    <!-- Notification summary when location settings is disabled. [CHAR LIMIT=NONE] -->
    <string name="satellite_messaging_location_disabled_notification_summary">To check if satellite messaging is available in this country or region, turn on location settings</string>

    <!-- Fingerprint dangling notification title -->
    <string name="fingerprint_dangling_notification_title">Set up Fingerprint Unlock again</string>
+24 −0
Original line number Diff line number Diff line
@@ -5551,6 +5551,30 @@
  <java-symbol type="string" name="satellite_manual_selection_state_popup_cancel" />
  <java-symbol type="drawable" name="ic_satellite_alt_24px" />
  <java-symbol type="drawable" name="ic_android_satellite_24px" />
  <java-symbol type="string" name="satellite_sos_available_notification_title" />
  <java-symbol type="string" name="satellite_sos_available_notification_summary" />
  <java-symbol type="string" name="satellite_sos_not_in_allowed_region_notification_title" />
  <java-symbol type="string" name="satellite_sos_not_in_allowed_region_notification_summary" />
  <java-symbol type="string" name="satellite_sos_not_supported_notification_title" />
  <java-symbol type="string" name="satellite_sos_not_supported_notification_summary" />
  <java-symbol type="string" name="satellite_sos_not_provisioned_notification_title" />
  <java-symbol type="string" name="satellite_sos_not_provisioned_notification_summary" />
  <java-symbol type="string" name="satellite_sos_unsupported_default_sms_app_notification_title" />
  <java-symbol type="string" name="satellite_sos_unsupported_default_sms_app_notification_summary" />
  <java-symbol type="string" name="satellite_sos_location_disabled_notification_title" />
  <java-symbol type="string" name="satellite_sos_location_disabled_notification_summary" />
  <java-symbol type="string" name="satellite_messaging_available_notification_title" />
  <java-symbol type="string" name="satellite_messaging_available_notification_summary" />
  <java-symbol type="string" name="satellite_messaging_not_in_allowed_region_notification_title" />
  <java-symbol type="string" name="satellite_messaging_not_in_allowed_region_notification_summary" />
  <java-symbol type="string" name="satellite_messaging_not_supported_notification_title" />
  <java-symbol type="string" name="satellite_messaging_not_supported_notification_summary" />
  <java-symbol type="string" name="satellite_messaging_not_provisioned_notification_title" />
  <java-symbol type="string" name="satellite_messaging_not_provisioned_notification_summary" />
  <java-symbol type="string" name="satellite_messaging_unsupported_default_sms_app_notification_title" />
  <java-symbol type="string" name="satellite_messaging_unsupported_default_sms_app_notification_summary" />
  <java-symbol type="string" name="satellite_messaging_location_disabled_notification_title" />
  <java-symbol type="string" name="satellite_messaging_location_disabled_notification_summary" />

  <!-- DisplayManager configs. -->
  <java-symbol type="bool" name="config_evenDimmerEnabled" />
+7 −3
Original line number Diff line number Diff line
@@ -47,8 +47,6 @@ import android.telephony.TelephonyManager;
import android.util.Log;
import android.util.SparseArray;

import com.android.internal.annotations.VisibleForTesting;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -538,7 +536,13 @@ public final class SmsApplication {
    }

    private static String getDefaultSmsPackage(Context context, int userId) {
        return context.getSystemService(RoleManager.class).getSmsRoleHolder(userId);
        // RoleManager might be null in unit tests running older mockito versions that do not
        // support mocking final classes.
        RoleManager roleManager = context.getSystemService(RoleManager.class);
        if (roleManager == null) {
            return "";
        }
        return roleManager.getSmsRoleHolder(userId);
    }

    /**
+13 −0
Original line number Diff line number Diff line
@@ -10152,6 +10152,17 @@ public class CarrierConfigManager {
    public static final String KEY_SATELLITE_ROAMING_ESOS_INACTIVITY_TIMEOUT_SEC_INT =
            "satellite_roaming_esos_inactivity_timeout_sec_int";
    /**
     * A string array containing the list of messaging apps that support satellite.
     *
     * The default value contains only "com.google.android.apps.messaging"
     *
     * @hide
     */
    @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
    public static final String KEY_SATELLITE_SUPPORTED_MSG_APPS_STRING_ARRAY =
            "satellite_supported_msg_apps_string_array";
    /**
     * Indicating whether DUN APN should be disabled when the device is roaming. In that case,
     * the default APN (i.e. internet) will be used for tethering.
@@ -11304,6 +11315,8 @@ public class CarrierConfigManager {
                        NetworkRegistrationInfo.SERVICE_TYPE_SMS,
                        NetworkRegistrationInfo.SERVICE_TYPE_MMS
                });
        sDefaults.putStringArray(KEY_SATELLITE_SUPPORTED_MSG_APPS_STRING_ARRAY, new String[]{
                "com.google.android.apps.messaging"});
        sDefaults.putBoolean(KEY_DISABLE_DUN_APN_WHILE_ROAMING_WITH_PRESET_APN_BOOL, false);
        sDefaults.putBoolean(KEY_EMERGENCY_MESSAGING_SUPPORTED_BOOL, false);
        sDefaults.putInt(KEY_EMERGENCY_CALL_TO_SATELLITE_T911_HANDOVER_TIMEOUT_MILLIS_INT,
Loading