diff options
Diffstat (limited to 'android/telephony')
-rw-r--r-- | android/telephony/CarrierConfigManager.java | 34 | ||||
-rw-r--r-- | android/telephony/MbmsDownloadSession.java | 41 | ||||
-rw-r--r-- | android/telephony/NetworkScanRequest.java | 105 | ||||
-rw-r--r-- | android/telephony/ServiceState.java | 9 | ||||
-rw-r--r-- | android/telephony/mbms/DownloadRequest.java | 30 | ||||
-rw-r--r-- | android/telephony/mbms/MbmsDownloadReceiver.java | 11 | ||||
-rw-r--r-- | android/telephony/mbms/vendor/MbmsDownloadServiceBase.java | 18 | ||||
-rw-r--r-- | android/telephony/mbms/vendor/MbmsStreamingServiceBase.java | 8 |
8 files changed, 223 insertions, 33 deletions
diff --git a/android/telephony/CarrierConfigManager.java b/android/telephony/CarrierConfigManager.java index 689ce954..de980b2f 100644 --- a/android/telephony/CarrierConfigManager.java +++ b/android/telephony/CarrierConfigManager.java @@ -763,6 +763,18 @@ public class CarrierConfigManager { public static final String KEY_CDMA_DTMF_TONE_DELAY_INT = "cdma_dtmf_tone_delay_int"; /** + * Some carriers will send call forwarding responses for voicemail in a format that is not 3gpp + * compliant, which causes issues during parsing. This causes the + * {@link com.android.internal.telephony.CallForwardInfo#number} to contain non-numerical + * characters instead of a number. + * + * If true, we will detect the non-numerical characters and replace them with "Voicemail". + * @hide + */ + public static final String KEY_CALL_FORWARDING_MAP_NON_NUMBER_TO_VOICEMAIL_BOOL = + "call_forwarding_map_non_number_to_voicemail_bool"; + + /** * Determines whether conference calls are supported by a carrier. When {@code true}, * conference calling is supported, {@code false otherwise}. */ @@ -1573,6 +1585,25 @@ public class CarrierConfigManager { public static final String KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL = "show_ims_registration_status_bool"; + /** + * The flag to disable the popup dialog which warns the user of data charges. + * @hide + */ + public static final String KEY_DISABLE_CHARGE_INDICATION_BOOL = + "disable_charge_indication_bool"; + + /** + * Boolean indicating whether to skip the call forwarding (CF) fail-to-disable dialog. + * The logic used to determine whether we succeeded in disabling is carrier specific, + * so the dialog may not always be accurate. + * {@code false} - show CF fail-to-disable dialog. + * {@code true} - skip showing CF fail-to-disable dialog. + * + * @hide + */ + public static final String KEY_SKIP_CF_FAIL_TO_DISABLE_DIALOG_BOOL = + "skip_cf_fail_to_disable_dialog_bool"; + /** The default value for every variable. */ private final static PersistableBundle sDefaults; @@ -1703,6 +1734,7 @@ public class CarrierConfigManager { sDefaults.putInt(KEY_GSM_DTMF_TONE_DELAY_INT, 0); sDefaults.putInt(KEY_IMS_DTMF_TONE_DELAY_INT, 0); sDefaults.putInt(KEY_CDMA_DTMF_TONE_DELAY_INT, 100); + sDefaults.putBoolean(KEY_CALL_FORWARDING_MAP_NON_NUMBER_TO_VOICEMAIL_BOOL, false); sDefaults.putInt(KEY_CDMA_3WAYCALL_FLASH_DELAY_INT , 0); sDefaults.putBoolean(KEY_SUPPORT_CONFERENCE_CALL_BOOL, true); sDefaults.putBoolean(KEY_SUPPORT_IMS_CONFERENCE_CALL_BOOL, true); @@ -1726,6 +1758,7 @@ public class CarrierConfigManager { sDefaults.putString(KEY_CARRIER_NAME_STRING, ""); sDefaults.putBoolean(KEY_SUPPORT_DIRECT_FDN_DIALING_BOOL, false); sDefaults.putBoolean(KEY_CARRIER_DEFAULT_DATA_ROAMING_ENABLED_BOOL, false); + sDefaults.putBoolean(KEY_SKIP_CF_FAIL_TO_DISABLE_DIALOG_BOOL, false); // MMS defaults sDefaults.putBoolean(KEY_MMS_ALIAS_ENABLED_BOOL, false); @@ -1840,6 +1873,7 @@ public class CarrierConfigManager { sDefaults.putStringArray(KEY_NON_ROAMING_OPERATOR_STRING_ARRAY, null); sDefaults.putStringArray(KEY_ROAMING_OPERATOR_STRING_ARRAY, null); sDefaults.putBoolean(KEY_SHOW_IMS_REGISTRATION_STATUS_BOOL, false); + sDefaults.putBoolean(KEY_DISABLE_CHARGE_INDICATION_BOOL, false); } /** diff --git a/android/telephony/MbmsDownloadSession.java b/android/telephony/MbmsDownloadSession.java index 764b7b22..9a9877a8 100644 --- a/android/telephony/MbmsDownloadSession.java +++ b/android/telephony/MbmsDownloadSession.java @@ -77,8 +77,9 @@ public class MbmsDownloadSession implements AutoCloseable { * Integer extra that Android will attach to the intent supplied via * {@link android.telephony.mbms.DownloadRequest.Builder#setAppIntent(Intent)} * Indicates the result code of the download. One of - * {@link #RESULT_SUCCESSFUL}, {@link #RESULT_EXPIRED}, {@link #RESULT_CANCELLED}, or - * {@link #RESULT_IO_ERROR}. + * {@link #RESULT_SUCCESSFUL}, {@link #RESULT_EXPIRED}, {@link #RESULT_CANCELLED}, + * {@link #RESULT_IO_ERROR}, {@link #RESULT_DOWNLOAD_FAILURE}, {@link #RESULT_OUT_OF_STORAGE}, + * {@link #RESULT_SERVICE_ID_NOT_DEFINED}, or {@link #RESULT_FILE_ROOT_UNREACHABLE}. * * This extra may also be used by the middleware when it is sending intents to the app. */ @@ -142,11 +143,41 @@ public class MbmsDownloadSession implements AutoCloseable { /** * Indicates that the download will not be completed due to an I/O error incurred while - * writing to temp files. This commonly indicates that the device is out of storage space, - * but may indicate other conditions as well (such as an SD card being removed). + * writing to temp files. + * + * This is likely a transient error and another {@link DownloadRequest} should be sent to try + * the download again. */ public static final int RESULT_IO_ERROR = 4; - // TODO - more results! + + /** + * Indicates that the Service ID specified in the {@link DownloadRequest} is incorrect due to + * the Id being incorrect, stale, expired, or similar. + */ + public static final int RESULT_SERVICE_ID_NOT_DEFINED = 5; + + /** + * Indicates that there was an error while processing downloaded files, such as a file repair or + * file decoding error and is not due to a file I/O error. + * + * This is likely a transient error and another {@link DownloadRequest} should be sent to try + * the download again. + */ + public static final int RESULT_DOWNLOAD_FAILURE = 6; + + /** + * Indicates that the file system is full and the {@link DownloadRequest} can not complete. + * Either space must be made on the current file system or the temp file root location must be + * changed to a location that is not full to download the temp files. + */ + public static final int RESULT_OUT_OF_STORAGE = 7; + + /** + * Indicates that the file root that was set is currently unreachable. This can happen if the + * temp files are set to be stored on external storage and the SD card was removed, for example. + * The temp file root should be changed before sending another DownloadRequest. + */ + public static final int RESULT_FILE_ROOT_UNREACHABLE = 8; /** @hide */ @Retention(RetentionPolicy.SOURCE) diff --git a/android/telephony/NetworkScanRequest.java b/android/telephony/NetworkScanRequest.java index d2aef200..9674c930 100644 --- a/android/telephony/NetworkScanRequest.java +++ b/android/telephony/NetworkScanRequest.java @@ -19,6 +19,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; +import java.util.ArrayList; import java.util.Arrays; /** @@ -38,6 +39,20 @@ public final class NetworkScanRequest implements Parcelable { public static final int MAX_BANDS = 8; /** @hide */ public static final int MAX_CHANNELS = 32; + /** @hide */ + public static final int MAX_MCC_MNC_LIST_SIZE = 20; + /** @hide */ + public static final int MIN_SEARCH_PERIODICITY_SEC = 5; + /** @hide */ + public static final int MAX_SEARCH_PERIODICITY_SEC = 300; + /** @hide */ + public static final int MIN_SEARCH_MAX_SEC = 60; + /** @hide */ + public static final int MAX_SEARCH_MAX_SEC = 3600; + /** @hide */ + public static final int MIN_INCREMENTAL_PERIODICITY_SEC = 1; + /** @hide */ + public static final int MAX_INCREMENTAL_PERIODICITY_SEC = 10; /** Performs the scan only once */ public static final int SCAN_TYPE_ONE_SHOT = 0; @@ -46,24 +61,84 @@ public final class NetworkScanRequest implements Parcelable { * * The modem will start new scans periodically, and the interval between two scans is usually * multiple minutes. - * */ + */ public static final int SCAN_TYPE_PERIODIC = 1; /** Defines the type of the scan. */ public int scanType; + /** + * Search periodicity (in seconds). + * Expected range for the input is [5s - 300s] + * This value must be less than or equal to maxSearchTime + */ + public int searchPeriodicity; + + /** + * Maximum duration of the periodic search (in seconds). + * Expected range for the input is [60s - 3600s] + * If the search lasts this long, it will be terminated. + */ + public int maxSearchTime; + + /** + * Indicates whether the modem should report incremental + * results of the network scan to the client. + * FALSE – Incremental results are not reported. + * TRUE (default) – Incremental results are reported + */ + public boolean incrementalResults; + + /** + * Indicates the periodicity with which the modem should + * report incremental results to the client (in seconds). + * Expected range for the input is [1s - 10s] + * This value must be less than or equal to maxSearchTime + */ + public int incrementalResultsPeriodicity; + /** Describes the radio access technologies with bands or channels that need to be scanned. */ public RadioAccessSpecifier[] specifiers; /** + * Describes the List of PLMN ids (MCC-MNC) + * If any PLMN of this list is found, search should end at that point and + * results with all PLMN found till that point should be sent as response. + * If list not sent, search to be completed till end and all PLMNs found to be reported. + * Max size of array is MAX_MCC_MNC_LIST_SIZE + */ + public ArrayList<String> mccMncs; + + /** * Creates a new NetworkScanRequest with scanType and network specifiers * * @param scanType The type of the scan * @param specifiers the radio network with bands / channels to be scanned + * @param searchPeriodicity Search periodicity (in seconds) + * @param maxSearchTime Maximum duration of the periodic search (in seconds) + * @param incrementalResults Indicates whether the modem should report incremental + * results of the network scan to the client + * @param incrementalResultsPeriodicity Indicates the periodicity with which the modem should + * report incremental results to the client (in seconds) + * @param mccMncs Describes the List of PLMN ids (MCC-MNC) */ - public NetworkScanRequest(int scanType, RadioAccessSpecifier[] specifiers) { + public NetworkScanRequest(int scanType, RadioAccessSpecifier[] specifiers, + int searchPeriodicity, + int maxSearchTime, + boolean incrementalResults, + int incrementalResultsPeriodicity, + ArrayList<String> mccMncs) { this.scanType = scanType; this.specifiers = specifiers; + this.searchPeriodicity = searchPeriodicity; + this.maxSearchTime = maxSearchTime; + this.incrementalResults = incrementalResults; + this.incrementalResultsPeriodicity = incrementalResultsPeriodicity; + if (mccMncs != null) { + this.mccMncs = mccMncs; + } else { + this.mccMncs = new ArrayList<>(); + } } @Override @@ -75,6 +150,11 @@ public final class NetworkScanRequest implements Parcelable { public void writeToParcel(Parcel dest, int flags) { dest.writeInt(scanType); dest.writeParcelableArray(specifiers, flags); + dest.writeInt(searchPeriodicity); + dest.writeInt(maxSearchTime); + dest.writeBoolean(incrementalResults); + dest.writeInt(incrementalResultsPeriodicity); + dest.writeStringList(mccMncs); } private NetworkScanRequest(Parcel in) { @@ -82,6 +162,12 @@ public final class NetworkScanRequest implements Parcelable { specifiers = (RadioAccessSpecifier[]) in.readParcelableArray( Object.class.getClassLoader(), RadioAccessSpecifier.class); + searchPeriodicity = in.readInt(); + maxSearchTime = in.readInt(); + incrementalResults = in.readBoolean(); + incrementalResultsPeriodicity = in.readInt(); + mccMncs = new ArrayList<>(); + in.readStringList(mccMncs); } @Override @@ -99,13 +185,24 @@ public final class NetworkScanRequest implements Parcelable { } return (scanType == nsr.scanType - && Arrays.equals(specifiers, nsr.specifiers)); + && Arrays.equals(specifiers, nsr.specifiers) + && searchPeriodicity == nsr.searchPeriodicity + && maxSearchTime == nsr.maxSearchTime + && incrementalResults == nsr.incrementalResults + && incrementalResultsPeriodicity == nsr.incrementalResultsPeriodicity + && (((mccMncs != null) + && mccMncs.equals(nsr.mccMncs)))); } @Override public int hashCode () { return ((scanType * 31) - + (Arrays.hashCode(specifiers)) * 37); + + (Arrays.hashCode(specifiers)) * 37 + + (searchPeriodicity * 41) + + (maxSearchTime * 43) + + ((incrementalResults == true? 1 : 0) * 47) + + (incrementalResultsPeriodicity * 53) + + (mccMncs.hashCode() * 59)); } public static final Creator<NetworkScanRequest> CREATOR = diff --git a/android/telephony/ServiceState.java b/android/telephony/ServiceState.java index e448fb2a..116e711e 100644 --- a/android/telephony/ServiceState.java +++ b/android/telephony/ServiceState.java @@ -1197,15 +1197,6 @@ public class ServiceState implements Parcelable { } } - /** - * @Deprecated to be removed Q3 2013 use {@link #getVoiceNetworkType} - * @hide - */ - public int getNetworkType() { - Rlog.e(LOG_TAG, "ServiceState.getNetworkType() DEPRECATED will be removed *******"); - return rilRadioTechnologyToNetworkType(mRilVoiceRadioTechnology); - } - /** @hide */ public int getDataNetworkType() { return rilRadioTechnologyToNetworkType(mRilDataRadioTechnology); diff --git a/android/telephony/mbms/DownloadRequest.java b/android/telephony/mbms/DownloadRequest.java index 5a57f322..f0d60b68 100644 --- a/android/telephony/mbms/DownloadRequest.java +++ b/android/telephony/mbms/DownloadRequest.java @@ -16,6 +16,7 @@ package android.telephony.mbms; +import android.annotation.NonNull; import android.annotation.SystemApi; import android.content.Intent; import android.net.Uri; @@ -26,7 +27,6 @@ import android.util.Log; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.File; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; @@ -71,6 +71,19 @@ public final class DownloadRequest implements Parcelable { private String appIntent; private int version = CURRENT_VERSION; + + /** + * Builds a new DownloadRequest. + * @param sourceUri the source URI for the DownloadRequest to be built. This URI should + * never be null. + */ + public Builder(@NonNull Uri sourceUri) { + if (sourceUri == null) { + throw new IllegalArgumentException("Source URI must be non-null."); + } + source = sourceUri; + } + /** * Sets the service from which the download request to be built will download from. * @param serviceInfo @@ -92,15 +105,6 @@ public final class DownloadRequest implements Parcelable { } /** - * Sets the source URI for the download request to be built. - * @param source - */ - public Builder setSource(Uri source) { - this.source = source; - return this; - } - - /** * Set the subscription ID on which the file(s) should be downloaded. * @param subscriptionId */ @@ -316,9 +320,11 @@ public final class DownloadRequest implements Parcelable { throw new RuntimeException("Could not get sha256 hash object"); } if (version >= 1) { - // Hash the source URI, destination URI, and the app intent + // Hash the source URI and the app intent digest.update(sourceUri.toString().getBytes(StandardCharsets.UTF_8)); - digest.update(serializedResultIntentForApp.getBytes(StandardCharsets.UTF_8)); + if (serializedResultIntentForApp != null) { + digest.update(serializedResultIntentForApp.getBytes(StandardCharsets.UTF_8)); + } } // Add updates for future versions here return Base64.encodeToString(digest.digest(), Base64.URL_SAFE | Base64.NO_WRAP); diff --git a/android/telephony/mbms/MbmsDownloadReceiver.java b/android/telephony/mbms/MbmsDownloadReceiver.java index fe275372..9af1eb9e 100644 --- a/android/telephony/mbms/MbmsDownloadReceiver.java +++ b/android/telephony/mbms/MbmsDownloadReceiver.java @@ -287,7 +287,7 @@ public class MbmsDownloadReceiver extends BroadcastReceiver { return; } - List<Uri> tempFiles = intent.getParcelableExtra(VendorUtils.EXTRA_TEMP_LIST); + List<Uri> tempFiles = intent.getParcelableArrayListExtra(VendorUtils.EXTRA_TEMP_LIST); if (tempFiles == null) { return; } @@ -309,7 +309,7 @@ public class MbmsDownloadReceiver extends BroadcastReceiver { return; } int fdCount = intent.getIntExtra(VendorUtils.EXTRA_FD_COUNT, 0); - List<Uri> pausedList = intent.getParcelableExtra(VendorUtils.EXTRA_PAUSED_LIST); + List<Uri> pausedList = intent.getParcelableArrayListExtra(VendorUtils.EXTRA_PAUSED_LIST); if (fdCount == 0 && (pausedList == null || pausedList.size() == 0)) { Log.i(LOG_TAG, "No temp files actually requested. Ending."); @@ -492,9 +492,14 @@ public class MbmsDownloadReceiver extends BroadcastReceiver { } catch (PackageManager.NameNotFoundException e) { throw new RuntimeException("Package manager couldn't find " + context.getPackageName()); } + if (appInfo.metaData == null) { + throw new RuntimeException("App must declare the file provider authority as metadata " + + "in the manifest."); + } String authority = appInfo.metaData.getString(MBMS_FILE_PROVIDER_META_DATA_KEY); if (authority == null) { - throw new RuntimeException("Must declare the file provider authority as meta data"); + throw new RuntimeException("App must declare the file provider authority as metadata " + + "in the manifest."); } return authority; } diff --git a/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java b/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java index 2f85a1df..c3b2c482 100644 --- a/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java +++ b/android/telephony/mbms/vendor/MbmsDownloadServiceBase.java @@ -113,6 +113,10 @@ public class MbmsDownloadServiceBase extends IMbmsDownloadService.Stub { @Override public final int initialize(final int subscriptionId, final IMbmsDownloadSessionCallback callback) throws RemoteException { + if (callback == null) { + throw new NullPointerException("Callback must not be null"); + } + final int uid = Binder.getCallingUid(); callback.asBinder().linkToDeath(new DeathRecipient() { @Override @@ -240,6 +244,13 @@ public class MbmsDownloadServiceBase extends IMbmsDownloadService.Stub { public final int registerStateCallback(final DownloadRequest downloadRequest, final IDownloadStateCallback callback, int flags) throws RemoteException { final int uid = Binder.getCallingUid(); + if (downloadRequest == null) { + throw new NullPointerException("Download request must not be null"); + } + if (callback == null) { + throw new NullPointerException("Callback must not be null"); + } + DeathRecipient deathRecipient = new DeathRecipient() { @Override public void binderDied() { @@ -292,6 +303,13 @@ public class MbmsDownloadServiceBase extends IMbmsDownloadService.Stub { public final int unregisterStateCallback( final DownloadRequest downloadRequest, final IDownloadStateCallback callback) throws RemoteException { + if (downloadRequest == null) { + throw new NullPointerException("Download request must not be null"); + } + if (callback == null) { + throw new NullPointerException("Callback must not be null"); + } + DeathRecipient deathRecipient = mDownloadCallbackDeathRecipients.remove(callback.asBinder()); if (deathRecipient == null) { diff --git a/android/telephony/mbms/vendor/MbmsStreamingServiceBase.java b/android/telephony/mbms/vendor/MbmsStreamingServiceBase.java index f8f370a5..65b726df 100644 --- a/android/telephony/mbms/vendor/MbmsStreamingServiceBase.java +++ b/android/telephony/mbms/vendor/MbmsStreamingServiceBase.java @@ -65,6 +65,10 @@ public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub { @Override public final int initialize(final IMbmsStreamingSessionCallback callback, final int subscriptionId) throws RemoteException { + if (callback == null) { + throw new NullPointerException("Callback must not be null"); + } + final int uid = Binder.getCallingUid(); callback.asBinder().linkToDeath(new DeathRecipient() { @Override @@ -152,6 +156,10 @@ public class MbmsStreamingServiceBase extends IMbmsStreamingService.Stub { @Override public int startStreaming(final int subscriptionId, String serviceId, final IStreamingServiceCallback callback) throws RemoteException { + if (callback == null) { + throw new NullPointerException("Callback must not be null"); + } + final int uid = Binder.getCallingUid(); callback.asBinder().linkToDeath(new DeathRecipient() { @Override |