Fix the names for network preference. (SL4A side)

1. change the string constants name to all capital cases.
2. remove unused Facade APIs (set network preference by integer)

BUG: 26354635
Change-Id: Ibdef87a95931d98dbf724c2ed8fdb38dbe895f0d
diff --git a/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyConstants.java b/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyConstants.java
index f962110..f8ec761 100644
--- a/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyConstants.java
+++ b/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyConstants.java
@@ -315,52 +315,52 @@
     /**
      * Constant for Packet Keep Alive Call Back
      * **/
-    public static final String  PacketKeepaliveCallBack = "PacketKeepliveCallBack";
-    public static final String  PacketKeepaliveCallBackStarted = "Started";
-    public static final String  PacketKeepaliveCallBackStopped = "Stopped";
-    public static final String  PacketKeepaliveCallBackError = "Error";
-    public static final String  PacketKeepaliveCallBackInvalid = "Invalid";
+    public static final String PacketKeepaliveCallBack = "PacketKeepliveCallBack";
+    public static final String PacketKeepaliveCallBackStarted = "Started";
+    public static final String PacketKeepaliveCallBackStopped = "Stopped";
+    public static final String PacketKeepaliveCallBackError = "Error";
+    public static final String PacketKeepaliveCallBackInvalid = "Invalid";
 
     /**
      * Constant for Network Call Back
      * **/
-    public static final String  NetworkCallBack = "NetworkCallBack";
-    public static final String  NetworkCallBackPreCheck = "PreCheck";
-    public static final String  NetworkCallBackAvailable = "Available";
-    public static final String  NetworkCallBackLosing = "Losing";
-    public static final String  NetworkCallBackLost = "Lost";
-    public static final String  NetworkCallBackUnavailable = "Unavailable";
-    public static final String  NetworkCallBackCapabilitiesChanged = "CapabilitiesChanged";
-    public static final String  NetworkCallBackSuspended = "Suspended";
-    public static final String  NetworkCallBackResumed = "Resumed";
-    public static final String  NetworkCallBackLinkPropertiesChanged = "LinkPropertiesChanged";
-    public static final String  NetworkCallBackInvalid = "Invalid";
+    public static final String NetworkCallBack = "NetworkCallBack";
+    public static final String NetworkCallBackPreCheck = "PreCheck";
+    public static final String NetworkCallBackAvailable = "Available";
+    public static final String NetworkCallBackLosing = "Losing";
+    public static final String NetworkCallBackLost = "Lost";
+    public static final String NetworkCallBackUnavailable = "Unavailable";
+    public static final String NetworkCallBackCapabilitiesChanged = "CapabilitiesChanged";
+    public static final String NetworkCallBackSuspended = "Suspended";
+    public static final String NetworkCallBackResumed = "Resumed";
+    public static final String NetworkCallBackLinkPropertiesChanged = "LinkPropertiesChanged";
+    public static final String NetworkCallBackInvalid = "Invalid";
 
     /**
      * Constant for Network Preference
      * **/
-    public static final String  NetworkModeWcdmaPref = "NetworkModeWcdmaPref";
-    public static final String  NetworkModeGsmOnly = "NetworkModeGsmOnly";
-    public static final String  NetworkModeWcdmaOnly = "NetworkModeWcdmaOnly";
-    public static final String  NetworkModeGsmUmts = "NetworkModeGsmUmts";
-    public static final String  NetworkModeCdma = "NetworkModeCdma";
-    public static final String  NetworkModeCdmaNoEvdo = "NetworkModeCdmaNoEvdo";
-    public static final String  NetworkModeEvdoNoCdma = "NetworkModeEvdoNoCdma";
-    public static final String  NetworkModeGlobal = "NetworkModeGlobal";
-    public static final String  NetworkModeLteCdmaEvdo = "NetworkModeLteCdmaEvdo";
-    public static final String  NetworkModeLteGsmWcdma = "NetworkModeLteGsmWcdma";
-    public static final String  NetworkModeLteCdmaEvdoGsmWcdma = "NetworkModeLteCdmaEvdoGsmWcdma";
-    public static final String  NetworkModeLteOnly = "NetworkModeLteOnly";
-    public static final String  NetworkModeLteWcdma = "NetworkModeLteWcdma";
-    public static final String  NetworkModeTdscdmaOnly = "NetworkModeTdscdmaOnly";
-    public static final String  NetworkModeTdscdmaWcdma = "NetworkModeTdscdmaWcdma";
-    public static final String  NetworkModeLteTdscdma = "NetworkModeLteTdscdma";
-    public static final String  NetworkModeTdsdmaGsm = "NetworkModeTdsdmaGsm";
-    public static final String  NetworkModeLteTdscdmaGsm = "NetworkModeLteTdscdmaGsm";
-    public static final String  NetworkModeTdscdmaGsmWcdma = "NetworkModeTdscdmaGsmWcdma";
-    public static final String  NetworkModeLteTdscdmaWcdma = "NetworkModeLteTdscdmaWcdma";
-    public static final String  NetworkModeLteTdscdmaGsmWcdma = "NetworkModeLteTdscdmaGsmWcdma";
-    public static final String  NetworkModeTdscdmaCdmaEvdoGsmWcdma = "NetworkModeTdscdmaCdmaEvdoGsmWcdma";
-    public static final String  NetworkModeLteTdscdmaCdmaEvdoGsmWcdma = "NetworkModeLteTdscdmaCdmaEvdoGsmWcdma";
-    public static final String  NetworkModeInvalid = "Invalid";
-}
+    public static final String NETWORK_MODE_WCDMA_PREF = "NETWORK_MODE_WCDMA_PREF";
+    public static final String NETWORK_MODE_GSM_ONLY = "NETWORK_MODE_GSM_ONLY";
+    public static final String NETWORK_MODE_WCDMA_ONLY = "NETWORK_MODE_WCDMA_ONLY";
+    public static final String NETWORK_MODE_GSM_UMTS = "NETWORK_MODE_GSM_UMTS";
+    public static final String NETWORK_MODE_CDMA = "NETWORK_MODE_CDMA";
+    public static final String NETWORK_MODE_CDMA_NO_EVDO = "NETWORK_MODE_CDMA_NO_EVDO";
+    public static final String NETWORK_MODE_EVDO_NO_CDMA = "NETWORK_MODE_EVDO_NO_CDMA";
+    public static final String NETWORK_MODE_GLOBAL = "NETWORK_MODE_GLOBAL";
+    public static final String NETWORK_MODE_LTE_CDMA_EVDO = "NETWORK_MODE_LTE_CDMA_EVDO";
+    public static final String NETWORK_MODE_LTE_GSM_WCDMA = "NETWORK_MODE_LTE_GSM_WCDMA";
+    public static final String NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA = "NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA";
+    public static final String NETWORK_MODE_LTE_ONLY = "NETWORK_MODE_LTE_ONLY";
+    public static final String NETWORK_MODE_LTE_WCDMA = "NETWORK_MODE_LTE_WCDMA";
+    public static final String NETWORK_MODE_TDSCDMA_ONLY = "NETWORK_MODE_TDSCDMA_ONLY";
+    public static final String NETWORK_MODE_TDSCDMA_WCDMA = "NETWORK_MODE_TDSCDMA_WCDMA";
+    public static final String NETWORK_MODE_LTE_TDSCDMA = "NETWORK_MODE_LTE_TDSCDMA";
+    public static final String NETWORK_MODE_TDSCDMA_GSM = "NETWORK_MODE_TDSCDMA_GSM";
+    public static final String NETWORK_MODE_LTE_TDSCDMA_GSM = "NETWORK_MODE_LTE_TDSCDMA_GSM";
+    public static final String NETWORK_MODE_TDSCDMA_GSM_WCDMA = "NETWORK_MODE_TDSCDMA_GSM_WCDMA";
+    public static final String NETWORK_MODE_LTE_TDSCDMA_WCDMA = "NETWORK_MODE_LTE_TDSCDMA_WCDMA";
+    public static final String NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA = "NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA";
+    public static final String NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = "NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA";
+    public static final String NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA = "NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA";
+    public static final String NETWORK_MODE_INVALID = "INVALID";
+}
\ No newline at end of file
diff --git a/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java b/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java
index 52759c1..4c817bb 100644
--- a/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java
+++ b/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java
@@ -968,20 +968,6 @@
         return key;
     }
 
-    @Rpc(description = "Sets the preferred Network type")
-    public void telephonySetPreferredNetwork(Integer networktype) {
-        Integer subId = SubscriptionManager.getDefaultSubId();
-        telephonySetPreferredNetworkForSubscription(subId, networktype);
-    }
-
-    @Rpc(description = "Sets the preferred network type for the given subId")
-    public void telephonySetPreferredNetworkForSubscription(Integer subId, Integer networktype) {
-        android.provider.Settings.Global.putInt(mService.getContentResolver(),
-                android.provider.Settings.Global.PREFERRED_NETWORK_MODE + subId,
-                networktype );
-        mTelephonyManager.setPreferredNetworkType(subId, networktype);
-    }
-
     @Rpc(description = "Returns the current data connection state")
     public String telephonyGetDataConnectionState() {
         int state = mTelephonyManager.getDataState();
diff --git a/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyUtils.java b/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyUtils.java
index 878dd3e..2ac50d4 100644
--- a/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyUtils.java
+++ b/sl4a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyUtils.java
@@ -28,51 +28,51 @@
 
     public static int getNetworkModeIntfromString(String networkMode) {
         switch (networkMode) {
-            case TelephonyConstants.NetworkModeWcdmaPref:
+            case TelephonyConstants.NETWORK_MODE_WCDMA_PREF:
                 return RILConstants.NETWORK_MODE_WCDMA_PREF;
-            case TelephonyConstants.NetworkModeGsmOnly:
+            case TelephonyConstants.NETWORK_MODE_GSM_ONLY:
                 return RILConstants.NETWORK_MODE_GSM_ONLY;
-            case TelephonyConstants.NetworkModeWcdmaOnly:
+            case TelephonyConstants.NETWORK_MODE_WCDMA_ONLY:
                 return RILConstants.NETWORK_MODE_WCDMA_ONLY;
-            case TelephonyConstants.NetworkModeGsmUmts:
+            case TelephonyConstants.NETWORK_MODE_GSM_UMTS:
                 return RILConstants.NETWORK_MODE_GSM_UMTS;
-            case TelephonyConstants.NetworkModeCdma:
+            case TelephonyConstants.NETWORK_MODE_CDMA:
                 return RILConstants.NETWORK_MODE_CDMA;
-            case TelephonyConstants.NetworkModeCdmaNoEvdo:
+            case TelephonyConstants.NETWORK_MODE_CDMA_NO_EVDO:
                 return RILConstants.NETWORK_MODE_CDMA_NO_EVDO;
-            case TelephonyConstants.NetworkModeEvdoNoCdma:
+            case TelephonyConstants.NETWORK_MODE_EVDO_NO_CDMA:
                 return RILConstants.NETWORK_MODE_EVDO_NO_CDMA;
-            case TelephonyConstants.NetworkModeGlobal:
+            case TelephonyConstants.NETWORK_MODE_GLOBAL:
                 return RILConstants.NETWORK_MODE_GLOBAL;
-            case TelephonyConstants.NetworkModeLteCdmaEvdo:
+            case TelephonyConstants.NETWORK_MODE_LTE_CDMA_EVDO:
                 return RILConstants.NETWORK_MODE_LTE_CDMA_EVDO;
-            case TelephonyConstants.NetworkModeLteGsmWcdma:
+            case TelephonyConstants.NETWORK_MODE_LTE_GSM_WCDMA:
                 return RILConstants.NETWORK_MODE_LTE_GSM_WCDMA;
-            case TelephonyConstants.NetworkModeLteCdmaEvdoGsmWcdma:
+            case TelephonyConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
                 return RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA;
-            case TelephonyConstants.NetworkModeLteOnly:
+            case TelephonyConstants.NETWORK_MODE_LTE_ONLY:
                 return RILConstants.NETWORK_MODE_LTE_ONLY;
-            case TelephonyConstants.NetworkModeLteWcdma:
+            case TelephonyConstants.NETWORK_MODE_LTE_WCDMA:
                 return RILConstants.NETWORK_MODE_LTE_WCDMA;
-            case TelephonyConstants.NetworkModeTdscdmaOnly:
+            case TelephonyConstants.NETWORK_MODE_TDSCDMA_ONLY:
                 return RILConstants.NETWORK_MODE_TDSCDMA_ONLY;
-            case TelephonyConstants.NetworkModeTdscdmaWcdma:
+            case TelephonyConstants.NETWORK_MODE_TDSCDMA_WCDMA:
                 return RILConstants.NETWORK_MODE_TDSCDMA_WCDMA;
-            case TelephonyConstants.NetworkModeLteTdscdma:
+            case TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA:
                 return RILConstants.NETWORK_MODE_LTE_TDSCDMA;
-            case TelephonyConstants.NetworkModeTdsdmaGsm:
+            case TelephonyConstants.NETWORK_MODE_TDSCDMA_GSM:
                 return RILConstants.NETWORK_MODE_TDSCDMA_GSM;
-            case TelephonyConstants.NetworkModeLteTdscdmaGsm:
+            case TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA_GSM:
                 return RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM;
-            case TelephonyConstants.NetworkModeTdscdmaGsmWcdma:
+            case TelephonyConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA:
                 return RILConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA;
-            case TelephonyConstants.NetworkModeLteTdscdmaWcdma:
+            case TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA:
                 return RILConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA;
-            case TelephonyConstants.NetworkModeLteTdscdmaGsmWcdma:
+            case TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA:
                 return RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA;
-            case TelephonyConstants.NetworkModeTdscdmaCdmaEvdoGsmWcdma:
+            case TelephonyConstants.NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
                 return RILConstants.NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA;
-            case TelephonyConstants.NetworkModeLteTdscdmaCdmaEvdoGsmWcdma:
+            case TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
                 return RILConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA;
         }
         Log.d("getNetworkModeIntfromString error. String: " + networkMode);
@@ -82,54 +82,54 @@
     public static String getNetworkModeStringfromInt(int networkMode) {
         switch (networkMode) {
             case RILConstants.NETWORK_MODE_WCDMA_PREF:
-                return TelephonyConstants.NetworkModeWcdmaPref;
+                return TelephonyConstants.NETWORK_MODE_WCDMA_PREF;
             case RILConstants.NETWORK_MODE_GSM_ONLY:
-                return TelephonyConstants.NetworkModeGsmOnly;
+                return TelephonyConstants.NETWORK_MODE_GSM_ONLY;
             case RILConstants.NETWORK_MODE_WCDMA_ONLY:
-                return TelephonyConstants.NetworkModeWcdmaOnly;
+                return TelephonyConstants.NETWORK_MODE_WCDMA_ONLY;
             case RILConstants.NETWORK_MODE_GSM_UMTS:
-                return TelephonyConstants.NetworkModeGsmUmts;
+                return TelephonyConstants.NETWORK_MODE_GSM_UMTS;
             case RILConstants.NETWORK_MODE_CDMA:
-                return TelephonyConstants.NetworkModeCdma;
+                return TelephonyConstants.NETWORK_MODE_CDMA;
             case RILConstants.NETWORK_MODE_CDMA_NO_EVDO:
-                return TelephonyConstants.NetworkModeCdmaNoEvdo;
+                return TelephonyConstants.NETWORK_MODE_CDMA_NO_EVDO;
             case RILConstants.NETWORK_MODE_EVDO_NO_CDMA:
-                return TelephonyConstants.NetworkModeEvdoNoCdma;
+                return TelephonyConstants.NETWORK_MODE_EVDO_NO_CDMA;
             case RILConstants.NETWORK_MODE_GLOBAL:
-                return TelephonyConstants.NetworkModeGlobal;
+                return TelephonyConstants.NETWORK_MODE_GLOBAL;
             case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO:
-                return TelephonyConstants.NetworkModeLteCdmaEvdo;
+                return TelephonyConstants.NETWORK_MODE_LTE_CDMA_EVDO;
             case RILConstants.NETWORK_MODE_LTE_GSM_WCDMA:
-                return TelephonyConstants.NetworkModeLteGsmWcdma;
+                return TelephonyConstants.NETWORK_MODE_LTE_GSM_WCDMA;
             case RILConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
-                return TelephonyConstants.NetworkModeLteCdmaEvdoGsmWcdma;
+                return TelephonyConstants.NETWORK_MODE_LTE_CDMA_EVDO_GSM_WCDMA;
             case RILConstants.NETWORK_MODE_LTE_ONLY:
-                return TelephonyConstants.NetworkModeLteOnly;
+                return TelephonyConstants.NETWORK_MODE_LTE_ONLY;
             case RILConstants.NETWORK_MODE_LTE_WCDMA:
-                return TelephonyConstants.NetworkModeLteWcdma;
+                return TelephonyConstants.NETWORK_MODE_LTE_WCDMA;
             case RILConstants.NETWORK_MODE_TDSCDMA_ONLY:
-                return TelephonyConstants.NetworkModeTdscdmaOnly;
+                return TelephonyConstants.NETWORK_MODE_TDSCDMA_ONLY;
             case RILConstants.NETWORK_MODE_TDSCDMA_WCDMA:
-                return TelephonyConstants.NetworkModeTdscdmaWcdma;
+                return TelephonyConstants.NETWORK_MODE_TDSCDMA_WCDMA;
             case RILConstants.NETWORK_MODE_LTE_TDSCDMA:
-                return TelephonyConstants.NetworkModeLteTdscdma;
+                return TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA;
             case RILConstants.NETWORK_MODE_TDSCDMA_GSM:
-                return TelephonyConstants.NetworkModeTdsdmaGsm;
+                return TelephonyConstants.NETWORK_MODE_TDSCDMA_GSM;
             case RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM:
-                return TelephonyConstants.NetworkModeLteTdscdmaGsm;
+                return TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA_GSM;
             case RILConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA:
-                return TelephonyConstants.NetworkModeTdscdmaGsmWcdma;
+                return TelephonyConstants.NETWORK_MODE_TDSCDMA_GSM_WCDMA;
             case RILConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA:
-                return TelephonyConstants.NetworkModeLteTdscdmaWcdma;
+                return TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA_WCDMA;
             case RILConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA:
-                return TelephonyConstants.NetworkModeLteTdscdmaGsmWcdma;
+                return TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA_GSM_WCDMA;
             case RILConstants.NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
-                return TelephonyConstants.NetworkModeTdscdmaCdmaEvdoGsmWcdma;
+                return TelephonyConstants.NETWORK_MODE_TDSCDMA_CDMA_EVDO_GSM_WCDMA;
             case RILConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA:
-                return TelephonyConstants.NetworkModeLteTdscdmaCdmaEvdoGsmWcdma;
+                return TelephonyConstants.NETWORK_MODE_LTE_TDSCDMA_CDMA_EVDO_GSM_WCDMA;
         }
         Log.d("getNetworkModeIntfromString error. Int: " + networkMode);
-        return TelephonyConstants.NetworkModeInvalid;
+        return TelephonyConstants.NETWORK_MODE_INVALID;
     }
 
     public static String getNetworkTypeString(int type) {