Commit 22f2fda8 authored by DidntRead's avatar DidntRead
Browse files

patches: add havoc specific patches

parent aaf4683e
Loading
Loading
Loading
Loading

.gitmodules

0 → 100644
+3 −0
Original line number Diff line number Diff line
[submodule "Lawnchair"]
	path = Lawnchair
	url = https://github.com/LawnchairLauncher/Lawnchair
Original line number Diff line number Diff line
Subproject commit 2f87116e6b9dc3ec5c505612cd740193eb3f1dd2
+76 −0
Original line number Diff line number Diff line
diff --git a/src/com/android/server/telecom/PhoneNumberUtilsAdapterImpl.java b/src/com/android/server/telecom/PhoneNumberUtilsAdapterImpl.java
index 6e0068a..c68f8bf 100644
--- a/src/com/android/server/telecom/PhoneNumberUtilsAdapterImpl.java
+++ b/src/com/android/server/telecom/PhoneNumberUtilsAdapterImpl.java
@@ -23,12 +23,12 @@ import android.telephony.PhoneNumberUtils;
 public class PhoneNumberUtilsAdapterImpl implements PhoneNumberUtilsAdapter {
     @Override
     public boolean isLocalEmergencyNumber(Context context, String number) {
-            return TelephonyUtil.isLocalEmergencyNumber(number);
+            return PhoneNumberUtils.isLocalEmergencyNumber(context, number);
     }
 
     @Override
     public boolean isPotentialLocalEmergencyNumber(Context context, String number) {
-        return TelephonyUtil.isPotentialLocalEmergencyNumber(number);
+        return PhoneNumberUtils.isPotentialLocalEmergencyNumber(context, number);
     }
 
     @Override
diff --git a/src/com/android/server/telecom/TelephonyUtil.java b/src/com/android/server/telecom/TelephonyUtil.java
index 82991b9..ce8f990 100644
--- a/src/com/android/server/telecom/TelephonyUtil.java
+++ b/src/com/android/server/telecom/TelephonyUtil.java
@@ -29,7 +29,6 @@ import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 
 import com.android.internal.annotations.VisibleForTesting;
-import org.codeaurora.internal.IExtTelephony;
 
 import java.util.Collections;
 import java.util.Comparator;
@@ -76,42 +75,8 @@ public final class TelephonyUtil {
     }
 
     public static boolean shouldProcessAsEmergency(Context context, Uri handle) {
-        return handle != null && isLocalEmergencyNumber(handle.getSchemeSpecificPart());
-    }
-
-    private static IExtTelephony getIExtTelephony() {
-        try {
-            IExtTelephony ex = IExtTelephony.Stub.asInterface(ServiceManager.getService("extphone"));
-            return ex;
-        } catch (NoClassDefFoundError ex) {
-            return null;
-        }
-    }
-
-    public static boolean isLocalEmergencyNumber(String address) {
-        IExtTelephony mIExtTelephony = getIExtTelephony();
-        boolean result = false;
-        try {
-            result = mIExtTelephony.isLocalEmergencyNumber(address);
-        } catch (RemoteException ex) {
-            Log.e(LOG_TAG, ex, "RemoteException");
-        } catch (NullPointerException ex) {
-            Log.e(LOG_TAG, ex, "NullPointerException");
-        }
-        return result;
-    }
-
-    public static boolean isPotentialLocalEmergencyNumber(String address) {
-        IExtTelephony mIExtTelephony = getIExtTelephony();
-        boolean result = false;
-        try {
-            result = mIExtTelephony.isPotentialLocalEmergencyNumber(address);
-        } catch (RemoteException ex) {
-            Log.e(LOG_TAG, ex, "RemoteException");
-        } catch (NullPointerException ex) {
-            Log.e(LOG_TAG, ex, "NullPointerException");
-        }
-        return result;
+        return handle != null && PhoneNumberUtils.isLocalEmergencyNumber(
+                context, handle.getSchemeSpecificPart());
     }
 
     public static void sortSimPhoneAccounts(Context context, List<PhoneAccount> accounts) {
+115 −0
Original line number Diff line number Diff line
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index eb819f5..99de011 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -2416,20 +2416,7 @@ public class PhoneUtils {
      * return false.
      */
     public static boolean isNetworkSettingsApkAvailable() {
-        // check whether the target handler exist in system
-        boolean isVendorNetworkSettingApkAvailable = false;
-        IExtTelephony extTelephony =
-                IExtTelephony.Stub.asInterface(ServiceManager.getService("extphone"));
-        try {
-            if (extTelephony != null &&
-                    extTelephony.isVendorApkAvailable("com.qualcomm.qti.networksetting")) {
-                isVendorNetworkSettingApkAvailable = true;
-            }
-        } catch (RemoteException ex) {
-            // could not connect to extphone service, launch the default activity
-            log("couldn't connect to extphone service, launch the default activity");
-        }
-        return isVendorNetworkSettingApkAvailable;
+	return false;
     }
 
     private static IExtTelephony getIExtTelephony() {
@@ -2442,69 +2429,23 @@ public class PhoneUtils {
     }
 
     public static boolean isLocalEmergencyNumber(String address) {
-        IExtTelephony mIExtTelephony = getIExtTelephony();
-        if (mIExtTelephony == null) {
-            return PhoneNumberUtils.isLocalEmergencyNumber(PhoneGlobals.getInstance(), address);
-        }
-        try {
-            return mIExtTelephony.isLocalEmergencyNumber(address);
-        }catch (RemoteException ex) {
-            return PhoneNumberUtils.isLocalEmergencyNumber(PhoneGlobals.getInstance(), address);
-        }
+        return PhoneNumberUtils.isLocalEmergencyNumber(PhoneGlobals.getInstance(), address);
     }
 
     public static boolean isPotentialLocalEmergencyNumber(String address) {
-        IExtTelephony mIExtTelephony = getIExtTelephony();
-        if (mIExtTelephony == null) {
-            return PhoneNumberUtils.isPotentialLocalEmergencyNumber(PhoneGlobals.getInstance(), address);
-        }
-        try {
-            return mIExtTelephony.isPotentialLocalEmergencyNumber(address);
-        }catch (RemoteException ex) {
-            return PhoneNumberUtils.isPotentialLocalEmergencyNumber(PhoneGlobals.getInstance(), address);
-        }
+        return PhoneNumberUtils.isPotentialLocalEmergencyNumber(PhoneGlobals.getInstance(), address);
     }
 
     public static boolean isEmergencyNumber(String address) {
-        IExtTelephony mIExtTelephony = getIExtTelephony();
-        if (mIExtTelephony == null) {
-            return PhoneNumberUtils.isEmergencyNumber(address);
-        }
-        try {
-            return mIExtTelephony.isEmergencyNumber(address);
-        }catch (RemoteException ex) {
-            return PhoneNumberUtils.isEmergencyNumber(address);
-        }
+        return PhoneNumberUtils.isEmergencyNumber(address);
     }
 
     public static boolean isDeviceInSingleStandBy() {
-        boolean result = false;
-        IExtTelephony mIExtTelephony = getIExtTelephony();
-        if (mIExtTelephony == null) {
-            return result;
-        }
-        try {
-            result = mIExtTelephony.isDeviceInSingleStandby();
-        } catch (RemoteException ex) {
-            Log.e("TelephonyConnectionService", "Exception : " + ex);
-        } catch (NullPointerException ex) {
-            Log.e("TelephonyConnectionService", "Exception : " + ex);
-        }
-        return result;
+	return false;
     }
 
     public static int getPhoneIdForECall() {
-        int phoneId = 0;
-        IExtTelephony mIExtTelephony = getIExtTelephony();
-        if (mIExtTelephony == null) {
-            return -1;
-        }
-        try {
-            phoneId = mIExtTelephony.getPhoneIdForECall();
-        } catch (RemoteException ex) {
-            Log.e("TelephonyConnectionService", "Exceptions : " + ex);
-        }
-        return phoneId;
+	return -1;
     }
 
     public static int getPrimaryStackPhoneId() {
diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java
index 8e1125a..55688b3 100644
--- a/src/com/android/services/telephony/TelecomAccountRegistry.java
+++ b/src/com/android/services/telephony/TelecomAccountRegistry.java
@@ -1033,8 +1033,7 @@ final class TelecomAccountRegistry {
             // slot which is bound to primary modem stack, for emergency numbers since
             // no actual SIM is needed for dialing emergency numbers but a phone account is.
             if (mAccounts.isEmpty()) {
-                mAccounts.add(new AccountEntry(PhoneFactory.getPhone(
-                        PhoneUtils.getPrimaryStackPhoneId()), true /* emergency */,
+                mAccounts.add(new AccountEntry(PhoneFactory.getDefaultPhone(), true /* emergency */,
                         false /* isDummy */));
             }