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

How to use
get
method
in
android.os.SystemProperties

Best Java code snippets using android.os.SystemProperties.get (Showing top 7 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: 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

@Test
public void getWithDefault() {
 assertThat(SystemProperties.get("foo", "bar")).isEqualTo("bar");
}
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: robolectric/robolectric

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

public static boolean isMIUI() {
  return !SystemProperties.get("ro.miui.ui.version.name", "").equals("");
}
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");
}
android.osSystemPropertiesget

Popular methods of SystemProperties

  • set
  • getInt

Popular in Java

  • Parsing JSON documents to java classes using gson
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
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