Android Open Source - rights-alert Application Entity

From Project

Back to project page rights-alert.


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;

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) { = 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