Tabnine Logo
PhoneAccount.hasCapabilities
Code IndexAdd Tabnine to your IDE (free)

How to use
hasCapabilities
method
in
android.telecom.PhoneAccount

Best Java code snippets using android.telecom.PhoneAccount.hasCapabilities (Showing top 4 results out of 315)

origin: geniusgithub/AndroidDialer

/**
 * Determine whether a phone account supports call subjects.
 *
 * @return {@code true} if call subjects are supported, {@code false} otherwise.
 */
public static boolean getAccountSupportsCallSubject(Context context,
    @Nullable PhoneAccountHandle accountHandle) {
  final PhoneAccount account = TelecomUtil.getPhoneAccount(context, accountHandle);
  return account == null ? false :
      account.hasCapabilities(PhoneAccount.CAPABILITY_CALL_SUBJECT);
}
origin: geniusgithub/AndroidDialer

/**
 * Return a list of phone accounts that are subscription/SIM accounts.
 */
public static List<PhoneAccountHandle> getSubscriptionPhoneAccounts(Context context) {
  List<PhoneAccountHandle> subscriptionAccountHandles = new ArrayList<PhoneAccountHandle>();
  final List<PhoneAccountHandle> accountHandles =
      TelecomUtil.getCallCapablePhoneAccounts(context);
  for (PhoneAccountHandle accountHandle : accountHandles) {
    PhoneAccount account = TelecomUtil.getPhoneAccount(context, accountHandle);
    if (account.hasCapabilities(PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)) {
      subscriptionAccountHandles.add(accountHandle);
    }
  }
  return subscriptionAccountHandles;
}
origin: geniusgithub/AndroidDialer

PhoneAccount account = telecommMgr.getPhoneAccount(accountHandle);
if (account != null) {
  if (account.hasCapabilities(PhoneAccount.CAPABILITY_VIDEO_CALLING)) {
    if (account.hasCapabilities(
        PhoneAccountSdkCompat.CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE)) {
      videoCapabilities |= VIDEO_CALLING_PRESENCE;
origin: geniusgithub/AndroidDialer

  /**
   * Determines if one of the call capable phone accounts defined supports calling with a subject
   * specified.
   *
   * @param context The context.
   * @return {@code true} if one of the call capable phone accounts supports calling with a
   *      subject specified, {@code false} otherwise.
   */
  public static boolean isCallWithSubjectSupported(Context context) {
    if (!PermissionsUtil.hasPermission(context, android.Manifest.permission.READ_PHONE_STATE)
        || !CompatUtils.isCallSubjectCompatible()) {
      return false;
    }
    TelecomManager telecommMgr = (TelecomManager)
        context.getSystemService(Context.TELECOM_SERVICE);
    if (telecommMgr == null) {
      return false;
    }

    List<PhoneAccountHandle> accountHandles = telecommMgr.getCallCapablePhoneAccounts();
    for (PhoneAccountHandle accountHandle : accountHandles) {
      PhoneAccount account = telecommMgr.getPhoneAccount(accountHandle);
      if (account != null && account.hasCapabilities(PhoneAccount.CAPABILITY_CALL_SUBJECT)) {
        return true;
      }
    }
    return false;
  }
}
android.telecomPhoneAccounthasCapabilities

Popular methods of PhoneAccount

  • getAccountHandle
  • getSupportedUriSchemes
  • isEnabled
  • getLabel
  • builder
  • getAddress
  • getExtras
  • getHighlightColor
  • getIcon

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now