Home | History | Annotate | Download | only in res
      1 package org.robolectric.res;
      2 
      3 /**
      4  * Utility class to that checks if a resource ID is a framework resource or application resource.
      5  */
      6 public class ResourceIds {
      7   public static boolean isFrameworkResource(int resId) {
      8     return ((resId >>> 24) == 0x1);
      9   }
     10 
     11   public static int getPackageIdentifier(int resId) {
     12     return (resId >>> 24);
     13   }
     14 
     15   public static int getTypeIdentifier(int resId) {
     16     return (resId & 0x00FF0000) >>> 16;
     17   }
     18 
     19   public static int getEntryIdentifier(int resId) {
     20     return resId & 0x0000FFFF;
     21   }
     22 
     23   public static int makeIdentifer(int packageIdentifier, int typeIdentifier, int entryIdenifier) {
     24     return packageIdentifier << 24 | typeIdentifier << 16 | entryIdenifier;
     25   }
     26 }