congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
PhoneAccount.builder
Code IndexAdd Tabnine to your IDE (free)

How to use
builder
method
in
android.telecom.PhoneAccount

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

origin: robolectric/robolectric

@Test
@Config(minSdk = LOLLIPOP_MR1)
public void getPhoneAccountsForPackage() {
 PhoneAccountHandle handleInThisApplicationsPackage = createHandle("id1");
 telecomService.registerPhoneAccount(PhoneAccount.builder(handleInThisApplicationsPackage, "this_package")
   .build());
 PhoneAccountHandle anotherPackageHandle = createHandle("some.other.package", "id2");
 telecomService.registerPhoneAccount(PhoneAccount.builder(anotherPackageHandle, "another_package")
   .build());
 List<PhoneAccountHandle> phoneAccountsForPackage = telecomService.getPhoneAccountsForPackage();
 assertThat(phoneAccountsForPackage).contains(handleInThisApplicationsPackage);
 assertThat(phoneAccountsForPackage).doesNotContain(anotherPackageHandle);
}
origin: robolectric/robolectric

@Test
public void clearAccounts() {
 PhoneAccountHandle anotherPackageHandle = createHandle("some.other.package", "id");
 telecomService.registerPhoneAccount(PhoneAccount.builder(anotherPackageHandle, "another_package")
   .build());
}
origin: robolectric/robolectric

@Test
@Config(minSdk = M)
public void getCallCapablePhoneAccounts() {
 PhoneAccountHandle callCapableHandle = createHandle("id1");
 telecomService.registerPhoneAccount(PhoneAccount.builder(callCapableHandle, "enabled")
   .setIsEnabled(true)
   .build());
 PhoneAccountHandle notCallCapableHandler = createHandle("id2");
 telecomService.registerPhoneAccount(PhoneAccount.builder(notCallCapableHandler, "disabled")
   .setIsEnabled(false)
   .build());
 List<PhoneAccountHandle> callCapablePhoneAccounts = telecomService.getCallCapablePhoneAccounts();
 assertThat(callCapablePhoneAccounts).contains(callCapableHandle);
 assertThat(callCapablePhoneAccounts).doesNotContain(notCallCapableHandler);
}
origin: robolectric/robolectric

@Test
@Config(minSdk = LOLLIPOP_MR1)
public void clearAccountsForPackage() {
 PhoneAccountHandle accountHandle1 = createHandle("a.package", "id1");
 telecomService.registerPhoneAccount(PhoneAccount.builder(accountHandle1, "another_package")
   .build());
 PhoneAccountHandle accountHandle2 = createHandle("some.other.package", "id2");
 telecomService.registerPhoneAccount(PhoneAccount.builder(accountHandle2, "another_package")
   .build());
 telecomService.clearAccountsForPackage(accountHandle1.getComponentName().getPackageName());
 assertThat(telecomService.getPhoneAccount(accountHandle1)).isNull();
 assertThat(telecomService.getPhoneAccount(accountHandle2)).isNotNull();
}
origin: robolectric/robolectric

@Test
public void getPhoneAccountsSupportingScheme() {
 PhoneAccountHandle handleMatchingScheme = createHandle("id1");
 telecomService.registerPhoneAccount(PhoneAccount.builder(handleMatchingScheme, "some_scheme")
   .addSupportedUriScheme("some_scheme")
   .build());
 PhoneAccountHandle handleNotMatchingScheme = createHandle("id2");
 telecomService.registerPhoneAccount(PhoneAccount.builder(handleNotMatchingScheme, "another_scheme")
   .addSupportedUriScheme("another_scheme")
   .build());
 List<PhoneAccountHandle> actual = telecomService.getPhoneAccountsSupportingScheme("some_scheme");
 assertThat(actual).contains(handleMatchingScheme);
 assertThat(actual).doesNotContain(handleNotMatchingScheme);
}
origin: robolectric/robolectric

@Test
public void registerAndUnRegister() {
 assertThat(shadowOf(telecomService).getAllPhoneAccountsCount()).isEqualTo(0);
 assertThat(shadowOf(telecomService).getAllPhoneAccounts()).hasSize(0);
 PhoneAccountHandle handler = createHandle("id");
 PhoneAccount phoneAccount = PhoneAccount.builder(handler, "main_account").build();
 telecomService.registerPhoneAccount(phoneAccount);
 assertThat(shadowOf(telecomService).getAllPhoneAccountsCount()).isEqualTo(1);
 assertThat(shadowOf(telecomService).getAllPhoneAccounts()).hasSize(1);
 assertThat(telecomService.getAllPhoneAccountHandles()).hasSize(1);
 assertThat(telecomService.getAllPhoneAccountHandles()).contains(handler);
 assertThat(telecomService.getPhoneAccount(handler).getLabel()).isEqualTo(phoneAccount.getLabel());
 telecomService.unregisterPhoneAccount(handler);
 assertThat(shadowOf(telecomService).getAllPhoneAccountsCount()).isEqualTo(0);
 assertThat(shadowOf(telecomService).getAllPhoneAccounts()).hasSize(0);
 assertThat(telecomService.getAllPhoneAccountHandles()).hasSize(0);
}
android.telecomPhoneAccountbuilder

Popular methods of PhoneAccount

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

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • getExternalFilesDir (Context)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • From CI to AI: The AI layer in your organization
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