Android Open Source - rights-alert Application Entity






From Project

Back to project page rights-alert.

License

The source code is released under:

GNU General Public License

If you think the Android project rights-alert listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package fr.keuse.rightsalert.entity;
/*  www .ja  v  a2  s . co  m*/
import fr.keuse.rightsalert.helper.Score;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;

public class ApplicationEntity {
  private String name;
  private Drawable icon;
  private int score = -1;
  private String[] permissions;
  
  public ApplicationEntity(PackageInfo p, PackageManager pm) {
    name = (String) p.applicationInfo.loadLabel(pm);
    icon = pm.getApplicationIcon(p.applicationInfo);
    permissions = p.requestedPermissions;
    score = Score.calculate(permissions);
  }
  
  public String getName() {
    return name;
  }
  public void setName(String name) {
    this.name = name;
  }
  public Drawable getIcon() {
    return icon;
  }
  public void setIcon(Drawable icon) {
    this.icon = icon;
  }
  public int getScore() {
    return score;
  }
  public void setScore(int score) {
    this.score = score;
  }
  public String[] getPermissions() {
    return permissions;
  }
  public void setPermissions(String[] permissions) {
    this.permissions = permissions;
  }
  
  public boolean isDangerous() {
    return Score.isDangerous(score);
  }
}




Java Source Code List

fr.keuse.rightsalert.activity.ApplistActivity.java
fr.keuse.rightsalert.adapter.ApplistAdapter.java
fr.keuse.rightsalert.comparator.ApplicationEntityComparator.java
fr.keuse.rightsalert.entity.ApplicationEntity.java
fr.keuse.rightsalert.handler.LoadApplicationsHandler.java
fr.keuse.rightsalert.helper.Score.java
fr.keuse.rightsalert.preference.RightsalertPreference.java
fr.keuse.rightsalert.thread.LoadApplicationsThread.java