Example usage for android.telecom PhoneAccount getHighlightColor

List of usage examples for android.telecom PhoneAccount getHighlightColor

Introduction

In this page you can find the example usage for android.telecom PhoneAccount getHighlightColor.

Prototype

public int getHighlightColor() 

Source Link

Document

A highlight color to use in displaying information about this PhoneAccount .

Usage

From source file:Main.java

/**
 * Extract account color from PhoneAccount object.
 *///  ww  w  . j a v a  2  s .c  om
public static int getAccountColor(Context context, PhoneAccountHandle accountHandle) {
    TelecomManager telecomManager = (TelecomManager) context.getSystemService(Context.TELECOM_SERVICE);
    final PhoneAccount account = telecomManager.getPhoneAccount(accountHandle);

    // For single-sim devices the PhoneAccount will be NO_HIGHLIGHT_COLOR by default, so it is
    // safe to always use the account highlight color.
    return account == null ? PhoneAccount.NO_HIGHLIGHT_COLOR : account.getHighlightColor();
}