merge in oc-release history after reset to oc-dev
diff --git a/src/com/android/providers/telephony/ServiceStateProvider.java b/src/com/android/providers/telephony/ServiceStateProvider.java
index 32165a9..dcbcc6a 100644
--- a/src/com/android/providers/telephony/ServiceStateProvider.java
+++ b/src/com/android/providers/telephony/ServiceStateProvider.java
@@ -200,8 +200,8 @@
             try {
                 subId = Integer.parseInt(uri.getLastPathSegment());
             } catch (NumberFormatException e) {
-                Log.e(TAG, "query: no subId provided in uri");
-                throw e;
+                Log.d(TAG, "query: no subId provided in uri, using default.");
+                subId = getDefaultSubId();
             }
             Log.d(TAG, "subId=" + subId);
 
diff --git a/tests/src/com/android/providers/telephony/ServiceStateProviderTest.java b/tests/src/com/android/providers/telephony/ServiceStateProviderTest.java
index 0d99386..685d9be 100644
--- a/tests/src/com/android/providers/telephony/ServiceStateProviderTest.java
+++ b/tests/src/com/android/providers/telephony/ServiceStateProviderTest.java
@@ -149,12 +149,24 @@
 
     @Test
     @SmallTest
+    public void testQueryServiceStateWithNoSubId() {
+        // Verify that when calling query with no subId in the uri the default ServiceState is
+        // returned.
+        // In this case the subId is set to 0 and the expected service state is
+        // testServiceState.
+        verifyServiceStateForSubId(ServiceStateTable.CONTENT_URI, testServiceState);
+    }
+
+    @Test
+    @SmallTest
     public void testGetServiceStateWithDefaultSubId() {
         // Verify that when calling with the DEFAULT_SUBSCRIPTION_ID the correct ServiceState is
         // returned
         // In this case the subId is set to 0 and the expected service state is
-        // testServiceState
-        verifyServiceStateForSubId(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, testServiceState);
+        // testServiceState.
+        verifyServiceStateForSubId(
+                getUriForSubscriptionId(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID),
+                testServiceState);
     }
 
     /**
@@ -166,11 +178,11 @@
         // Verify that when calling with a specific subId the correct ServiceState is returned
         // In this case the subId is set to 1 and the expected service state is
         // testServiceStateForSubId1
-        verifyServiceStateForSubId(1, testServiceStateForSubId1);
+        verifyServiceStateForSubId(getUriForSubscriptionId(1), testServiceStateForSubId1);
     }
 
-    private void verifyServiceStateForSubId(int subId, ServiceState ss) {
-        Cursor cursor = mContentResolver.query(getUriForSubscriptionId(subId), testProjection, "",
+    private void verifyServiceStateForSubId(Uri uri, ServiceState ss) {
+        Cursor cursor = mContentResolver.query(uri, testProjection, "",
                 null, null);
         assertNotNull(cursor);
         cursor.moveToFirst();
diff --git a/tests/src/com/android/providers/telephony/TelephonyBackupAgentTest.java b/tests/src/com/android/providers/telephony/TelephonyBackupAgentTest.java
index 4866dbd..a5dcff7 100644
--- a/tests/src/com/android/providers/telephony/TelephonyBackupAgentTest.java
+++ b/tests/src/com/android/providers/telephony/TelephonyBackupAgentTest.java
@@ -545,18 +545,18 @@
         mSmsTable.addAll(Arrays.asList(mSmsRows));
         mMmsTable.addAll(Arrays.asList(mMmsRows));
 
-        FullBackupDataOutput fullBackupDataOutput = new FullBackupDataOutput();
+        FullBackupDataOutput fullBackupDataOutput = new FullBackupDataOutput(Long.MAX_VALUE);
         mTelephonyBackupAgent.onFullBackup(fullBackupDataOutput);
         assertEquals(backupSize, fullBackupDataOutput.getSize());
 
         mTelephonyBackupAgent.onQuotaExceeded(backupSize, backupSize - 100);
-        fullBackupDataOutput = new FullBackupDataOutput();
+        fullBackupDataOutput = new FullBackupDataOutput(Long.MAX_VALUE);
         mTelephonyBackupAgent.onFullBackup(fullBackupDataOutput);
         assertEquals(backupSizeAfterFirstQuotaHit, fullBackupDataOutput.getSize());
 
         mTelephonyBackupAgent.onQuotaExceeded(backupSizeAfterFirstQuotaHit,
                 backupSizeAfterFirstQuotaHit - 200);
-        fullBackupDataOutput = new FullBackupDataOutput();
+        fullBackupDataOutput = new FullBackupDataOutput(Long.MAX_VALUE);
         mTelephonyBackupAgent.onFullBackup(fullBackupDataOutput);
         assertEquals(backupSizeAfterSecondQuotaHit, fullBackupDataOutput.getSize());
     }