Tabnine Logo
SystemProperties
Code IndexAdd Tabnine to your IDE (free)

How to use
SystemProperties
in
android.os

Best Java code snippets using android.os.SystemProperties (Showing top 20 results out of 315)

origin: robolectric/robolectric

@Test
public void set() {
 assertThat(SystemProperties.get("newkey")).isEqualTo("");
 SystemProperties.set("newkey", "val");
 assertThat(SystemProperties.get("newkey")).isEqualTo("val");
 SystemProperties.set("newkey", null);
 assertThat(SystemProperties.get("newkey")).isEqualTo("");
}
origin: robolectric/robolectric

@Test
@Config(sdk = 16)
public void readPropFromJarNotClassPath16() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(16);
}
origin: robolectric/robolectric

 @Test
 public void override() {
  assertThat(SystemProperties.get("newkey")).isEqualTo("");
  ShadowSystemProperties.override("newkey", "val");
  assertThat(SystemProperties.get("newkey")).isEqualTo("val");
  ShadowSystemProperties.override("newkey", null);
  assertThat(SystemProperties.get("newkey")).isEqualTo("");
 }
}
origin: wasdennnoch/AndroidN-ify

@SuppressLint("CommitPrefEdits")
private static void checkRom() {
  if (sPrefs.contains("rom")) return;
  String aicpVersion = SystemProperties.get("ro.aicp.version", "");
  if (!aicpVersion.equals("")) {
    sPrefs.edit().putString("rom", "aicp").commit();
    return;
  }
  int cmSdkVersion = SystemProperties.getInt("ro.cm.build.version.plat.sdk", 0);
  if (cmSdkVersion != 0) {
    sPrefs.edit().putString("rom", "cm").commit();
    return;
  }
  String xperiaVersion = SystemProperties.get("ro.semc.version.fs_revision", "");
  if (!xperiaVersion.equals("")) {
    sPrefs.edit().putString("rom", "xperia").commit();
    return;
  }
  sPrefs.edit().putString("rom", "aosp").commit();
}
origin: robolectric/robolectric

/**
 * Overrides the system property for testing. Similar to the Android implementation, the value
 * may be coerced to other types like boolean or long depending on the get method that is used.
 *
 * <p>Note: Use {@link org.robolectric.shadows.ShadowBuild} instead for changing fields in
 * {@link android.os.Build}.
 */
public static void override(String key, String val) {
 SystemProperties.set(key, val);
}
origin: robolectric/robolectric

@Test
public void getWithDefault() {
 assertThat(SystemProperties.get("foo", "bar")).isEqualTo("bar");
}
origin: org.robolectric/shadows-framework

/**
 * Overrides the system property for testing. Similar to the Android implementation, the value
 * may be coerced to other types like boolean or long depending on the get method that is used.
 *
 * <p>Note: Use {@link org.robolectric.shadows.ShadowBuild} instead for changing fields in
 * {@link android.os.Build}.
 */
public static void override(String key, String val) {
 SystemProperties.set(key, val);
}
origin: robolectric/robolectric

@Test
public void get() {
 assertThat(SystemProperties.get("ro.product.device")).isEqualTo("robolectric");
}
origin: robolectric/robolectric

@Test
@Config(sdk = 22)
public void readPropFromJarNotClassPath22() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(22);
}
origin: wasdennnoch/AndroidN-ify

public static boolean isOneplusStock() {
  return SystemProperties.get("ro.oxygen.version", "").contains("3.5") || SystemProperties.get("ro.rom.version", "").contains("H2OS V2.5") || SystemProperties.get("ro.oxygen.version", "").contains("O2_Open") || SystemProperties.get("ro.rom.version", "").contains("H2_Open");
}
origin: robolectric/robolectric

@Test
@Config(sdk = 24)
public void readPropFromJarNotClassPath24() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(24);
}
origin: AdBlocker-Reborn/AdBlocker_Reborn

public static boolean isMIUI() {
  return !SystemProperties.get("ro.miui.ui.version.name", "").equals("");
}
origin: robolectric/robolectric

@Test
@Config(sdk = 26)
public void readPropFromJarNotClassPath26() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(26);
}
origin: robolectric/robolectric

@Test
@Config(sdk = 18)
public void readPropFromJarNotClassPath18() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(18);
}
origin: robolectric/robolectric

@Test
@Config(sdk = 17)
public void readPropFromJarNotClassPath17() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(17);
}
origin: robolectric/robolectric

@Test
@Config(sdk = 19)
public void readPropFromJarNotClassPath19() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(19);
}
origin: robolectric/robolectric

@Test
@Config(sdk = 21)
public void readPropFromJarNotClassPath21() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(21);
}
origin: robolectric/robolectric

@Test
@Config(sdk = 23)
public void readPropFromJarNotClassPath23() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(23);
}
origin: robolectric/robolectric

@Test
@Config(sdk = 25)
public void readPropFromJarNotClassPath25() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(25);
}
origin: robolectric/robolectric

@Test
@Config(sdk = 27)
public void readPropFromJarNotClassPath27() {
 assertThat(SystemProperties.getInt("ro.build.version.sdk", 0)).isEqualTo(27);
}
android.osSystemProperties

Most used methods

  • get
  • set
  • getInt

Popular in Java

  • Reading from database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • BoxLayout (javax.swing)
  • JOptionPane (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • CodeWhisperer alternatives
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