示例#1
0
 /**
  * Returns the software configuration for the given API version.
  *
  * @param apiVersion The API version requested.
  * @return The Software instance for the requested API version or null if the API version is
  *     unsupported for this device.
  */
 public Software getSoftware(int apiVersion) {
   for (Software s : mSoftware) {
     if (apiVersion >= s.getMinSdkLevel() && apiVersion <= s.getMaxSdkLevel()) {
       return s;
     }
   }
   return null;
 }
示例#2
0
 public Builder(Device d) {
   mName = d.getName();
   mManufacturer = d.getManufacturer();
   for (Software s : d.getAllSoftware()) {
     mSoftware.add(s.deepCopy());
   }
   for (State s : d.getAllStates()) {
     mState.add(s.deepCopy());
   }
   mSoftware.addAll(d.getAllSoftware());
   mState.addAll(d.getAllStates());
   mMeta = d.getMeta();
   mDefaultState = d.getDefaultState();
 }
 public Software deepCopy() {
   Software s = new Software();
   s.setMinSdkLevel(getMinSdkLevel());
   s.setMaxSdkLevel(getMaxSdkLevel());
   s.setLiveWallpaperSupport(hasLiveWallpaperSupport());
   s.addAllBluetoothProfiles(getBluetoothProfiles());
   s.setGlVersion(getGlVersion());
   s.addAllGlExtensions(getGlExtensions());
   s.setStatusBar(hasStatusBar());
   return s;
 }
  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (!(o instanceof Software)) {
      return false;
    }

    Software sw = (Software) o;
    return mMinSdkLevel == sw.getMinSdkLevel()
        && mMaxSdkLevel == sw.getMaxSdkLevel()
        && mLiveWallpaperSupport == sw.hasLiveWallpaperSupport()
        && mBluetoothProfiles.equals(sw.getBluetoothProfiles())
        && mGlVersion.equals(sw.getGlVersion())
        && mGlExtensions.equals(sw.getGlExtensions())
        && mStatusBar == sw.hasStatusBar();
  }