Tabnine Logo
RestrictionEntry.getKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getKey
method
in
android.content.RestrictionEntry

Best Java code snippets using android.content.RestrictionEntry.getKey (Showing top 3 results out of 315)

origin: robolectric/robolectric

 @Test
 public void getManifestRestrictions() {
  RestrictionEntry restrictionEntry = Iterables.getOnlyElement(restrictionsManager
    .getManifestRestrictions(context.getPackageName()));

  assertThat(restrictionEntry.getKey()).isEqualTo("restrictionKey");
 }
}
origin: googlesamples/android-AppRestrictionEnforcer

SharedPreferences prefs = activity.getSharedPreferences(PREFS_KEY, Context.MODE_PRIVATE);
for (RestrictionEntry restriction : restrictions) {
  String key = restriction.getKey();
  if (RESTRICTION_KEY_SAY_HELLO.equals(key)) {
    updateCanSayHello(prefs.getBoolean(RESTRICTION_KEY_SAY_HELLO,
origin: googlesamples/android-AppRestrictionSchema

private void resolveRestrictions() {
  RestrictionsManager manager =
      (RestrictionsManager) getActivity().getSystemService(Context.RESTRICTIONS_SERVICE);
  Bundle restrictions = manager.getApplicationRestrictions();
  List<RestrictionEntry> entries = manager.getManifestRestrictions(
      getActivity().getApplicationContext().getPackageName());
  for (RestrictionEntry entry : entries) {
    String key = entry.getKey();
    Log.d(TAG, "key: " + key);
    if (key.equals(KEY_CAN_SAY_HELLO)) {
      updateCanSayHello(entry, restrictions);
    } else if (key.equals(KEY_MESSAGE)) {
      updateMessage(entry, restrictions);
    } else if (key.equals(KEY_NUMBER)) {
      updateNumber(entry, restrictions);
    } else if (key.equals(KEY_RANK)) {
      updateRank(entry, restrictions);
    } else if (key.equals(KEY_APPROVALS)) {
      updateApprovals(entry, restrictions);
    } else if (key.equals(KEY_ITEMS)) {
      updateItems(restrictions);
    }
  }
}
android.contentRestrictionEntrygetKey

Popular methods of RestrictionEntry

  • getAllSelectedStrings
  • getIntValue
  • getSelectedState
  • getSelectedString
  • setTitle
  • <init>
  • getChoiceValues
  • setChoiceEntries
  • setChoiceValues
  • setDescription
  • setType
  • setType

Popular in Java

  • Creating JSON documents from java classes using gson
  • getContentResolver (Context)
  • runOnUiThread (Activity)
  • setRequestProperty (URLConnection)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Collectors (java.util.stream)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JTextField (javax.swing)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • 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