Allow google dialer code to be compiled against M and N SDKs

+ Class DirectorySdkCompat and PhoneAccountSdkCompat for N/pre-N version
  pre-N is implemented with stubs

Bug:26330692
Change-Id: I53374f68ff3756ba0a502c15d07aa18a2d763e83
diff --git a/src/com/android/contacts/common/CallUtil.java b/src/com/android/contacts/common/CallUtil.java
index 7640246..88fca92 100644
--- a/src/com/android/contacts/common/CallUtil.java
+++ b/src/com/android/contacts/common/CallUtil.java
@@ -17,6 +17,7 @@
 package com.android.contacts.common;
 
 import com.android.contacts.common.compat.CompatUtils;
+import com.android.contacts.common.compat.PhoneAccountSdkCompat;
 import com.android.contacts.common.util.PermissionsUtil;
 import com.android.contacts.common.util.PhoneNumberHelper;
 import com.android.phone.common.PhoneConstants;
@@ -151,7 +152,7 @@
 
                     int videoCapabilities = VIDEO_CALLING_ENABLED;
                     if (account.hasCapabilities(
-                            PhoneAccount.CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE)) {
+                            PhoneAccountSdkCompat.CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE)) {
                         videoCapabilities |= VIDEO_CALLING_PRESENCE;
                     }
                     return videoCapabilities;
diff --git a/src/com/android/contacts/common/compat/DirectoryCompat.java b/src/com/android/contacts/common/compat/DirectoryCompat.java
index b032fe9..5f6d8bf 100644
--- a/src/com/android/contacts/common/compat/DirectoryCompat.java
+++ b/src/com/android/contacts/common/compat/DirectoryCompat.java
@@ -17,7 +17,6 @@
 package com.android.contacts.common.compat;
 
 import android.net.Uri;
-import android.os.Build;
 import android.provider.ContactsContract;
 import android.provider.ContactsContract.Directory;
 
@@ -47,7 +46,7 @@
     public static boolean isRemoteDirectory(long directoryId) {
         // TODO: Use N APIs
         if (ContactsUtils.FLAG_N_FEATURE && android.os.Build.VERSION.CODENAME.startsWith("N")) {
-            return Directory.isRemoteDirectory(directoryId);
+            return DirectorySdkCompat.isRemoteDirectory(directoryId);
         }
         return !(directoryId == Directory.DEFAULT || directoryId == Directory.LOCAL_INVISIBLE);
     }
diff --git a/src/com/android/contacts/common/dialog/CallSubjectDialog.java b/src/com/android/contacts/common/dialog/CallSubjectDialog.java
index 3c08b37..a17c4fc 100644
--- a/src/com/android/contacts/common/dialog/CallSubjectDialog.java
+++ b/src/com/android/contacts/common/dialog/CallSubjectDialog.java
@@ -48,6 +48,7 @@
 import com.android.contacts.common.ContactPhotoManager;
 import com.android.contacts.common.R;
 import com.android.contacts.common.compat.CompatUtils;
+import com.android.contacts.common.compat.PhoneAccountSdkCompat;
 import com.android.contacts.common.compat.telecom.TelecomManagerCompat;
 import com.android.contacts.common.util.UriUtils;
 import com.android.phone.common.animation.AnimUtils;
@@ -593,17 +594,18 @@
                 (TelecomManager) getSystemService(Context.TELECOM_SERVICE);
         final PhoneAccount account = telecomManager.getPhoneAccount(mPhoneAccountHandle);
 
-        Bundle phoneAccountExtras = account.getExtras();
+        Bundle phoneAccountExtras = PhoneAccountSdkCompat.getExtras(account);
         if (phoneAccountExtras == null) {
             return;
         }
 
         // Get limit, if provided; otherwise default to existing value.
-        mLimit = phoneAccountExtras.getInt(PhoneAccount.EXTRA_CALL_SUBJECT_MAX_LENGTH, mLimit);
+        mLimit = phoneAccountExtras
+                .getInt(PhoneAccountSdkCompat.EXTRA_CALL_SUBJECT_MAX_LENGTH, mLimit);
 
         // Get charset; default to none (e.g. count characters 1:1).
         String charsetName = phoneAccountExtras.getString(
-                PhoneAccount.EXTRA_CALL_SUBJECT_CHARACTER_ENCODING);
+                PhoneAccountSdkCompat.EXTRA_CALL_SUBJECT_CHARACTER_ENCODING);
 
         if (!TextUtils.isEmpty(charsetName)) {
             try {