OSDN Git Service

Do not throw RuntimeException from stopScan().
authoryinxu <yinxu@google.com>
Wed, 7 Mar 2018 21:49:51 +0000 (13:49 -0800)
committeryinxu <yinxu@google.com>
Thu, 8 Mar 2018 21:32:25 +0000 (13:32 -0800)
This is a clean cherry-pick from
https://android-review.googlesource.com/#/c/platform/frameworks/base/+/635589/

Bug:73750871
Test: Unit Test
Change-Id: I640093627c103fe1d2fe5707e6854ba748789919
Merged-in: I640093627c103fe1d2fe5707e6854ba748789919
(cherry picked from commit 5e366e31aecbecafd3dfb4bfc8f69ada34b1f550)

telephony/java/android/telephony/NetworkScan.java
telephony/java/android/telephony/TelephonyManager.java

index 71a177a..7f43ee5 100644 (file)
@@ -110,13 +110,11 @@ public class NetworkScan {
         ITelephony telephony = getITelephony();
         if (telephony == null) {
             Rlog.e(TAG, "Failed to get the ITelephony instance.");
-            throw new RuntimeException("Failed to get the ITelephony instance.");
         }
         try {
             telephony.stopNetworkScan(mSubId, mScanId);
         } catch (RemoteException ex) {
             Rlog.e(TAG, "stopNetworkScan  RemoteException", ex);
-            ex.rethrowAsRuntimeException();
         }
     }
 
index b04ed0e..5329613 100644 (file)
@@ -5396,7 +5396,8 @@ public class TelephonyManager {
      * <p>
      * Requires Permission:
      *   {@link android.Manifest.permission#MODIFY_PHONE_STATE MODIFY_PHONE_STATE}
-     * Or the calling app has carrier privileges. @see #hasCarrierPrivileges()
+     * Or the calling app has carrier privileges.
+     * @see #hasCarrierPrivileges()
      *
      * @param request Contains all the RAT with bands/channels that need to be scanned.
      * @param executor The executor through which the callback should be invoked.