Android Open Source - android-autostarts Package Info






From Project

Back to project page android-autostarts.

License

The source code is released under:

GNU General Public License

If you think the Android project android-autostarts 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 com.elsdoerfer.android.autostarts.db;
// w w w.j  av  a 2  s  .  c  o m
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;


/**
 * This can be compared to android.content.pm.PackageInfo (et al),
 * except that we are forced to parse the package manifest files
 * ourselves, so we don't use the classes in android.content.pm.
 */
public class PackageInfo implements Parcelable {
  public String packageName;
  public String packageLabel;
  public Drawable icon;
  public boolean isSystem;

  public PackageInfo(android.content.pm.PackageInfo packageInfo) {
    this.packageName = packageInfo.packageName;
  }

  @Override
    public int hashCode() {
    return this.packageName.hashCode();
  }

  /**
   * Return a label identifying the package.
   */
  public String getLabel() {
    if (packageLabel != null && !packageLabel.equals(""))
      return packageLabel;
    else
      return packageName;
  }

  @Override
  public int describeContents() {
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeString(packageName);
    dest.writeString(packageLabel);
    dest.writeInt(isSystem ? 1 : 0);
    // TODO: We don't currently parcel the icon. However,
    // due to how we use the ability to save to parcel at
    // this time (to remember the last selected receiver for an
    // in-progress toggle action), the icon isn't really needed.
    // Ultimately, we want a different fix for the whole
    // problem (see other TODOs).
  }

  public static final Parcelable.Creator<PackageInfo> CREATOR
  = new Parcelable.Creator<PackageInfo>()
  {
    public PackageInfo createFromParcel(Parcel in) {
      return new PackageInfo(in);
    }

    public PackageInfo[] newArray(int size) {
      return new PackageInfo[size];
    }
  };

  private PackageInfo(Parcel in) {
    packageName = in.readString();
    packageLabel = in.readString();
    isSystem = in.readInt() == 1;
  }
}




Java Source Code List

com.elsdoerfer.android.autostarts.Actions.java
com.elsdoerfer.android.autostarts.DatabaseHelper.java
com.elsdoerfer.android.autostarts.EventDetailsFragment.java
com.elsdoerfer.android.autostarts.HelpActivity.java
com.elsdoerfer.android.autostarts.ListActivity.java
com.elsdoerfer.android.autostarts.LoadTask.java
com.elsdoerfer.android.autostarts.MyExpandableListAdapter.java
com.elsdoerfer.android.autostarts.ReceiverReader.java
com.elsdoerfer.android.autostarts.ToggleService.java
com.elsdoerfer.android.autostarts.ToggleTool.java
com.elsdoerfer.android.autostarts.Utils.java
com.elsdoerfer.android.autostarts.compat.FixedExpandableListView.java
com.elsdoerfer.android.autostarts.db.ComponentInfo.java
com.elsdoerfer.android.autostarts.db.IntentFilterInfo.java
com.elsdoerfer.android.autostarts.db.PackageInfo.java
com.stericson.RootTools.Constants.java
com.stericson.RootTools.RootTools.java
com.stericson.RootTools.containers.Mount.java
com.stericson.RootTools.containers.Permissions.java
com.stericson.RootTools.containers.RootClass.java
com.stericson.RootTools.containers.Symlink.java
com.stericson.RootTools.exceptions.RootDeniedException.java
com.stericson.RootTools.execution.CommandCapture.java
com.stericson.RootTools.execution.Command.java
com.stericson.RootTools.execution.JavaCommandCapture.java
com.stericson.RootTools.execution.Shell.java
com.stericson.RootTools.internal.Installer.java
com.stericson.RootTools.internal.InternalVariables.java
com.stericson.RootTools.internal.Remounter.java
com.stericson.RootTools.internal.RootToolsInternalMethods.java
com.stericson.RootTools.internal.Runner.java
src.com.elsdoerfer.android.autostarts.opt.MarketUtils.java
src.com.elsdoerfer.android.autostarts.opt.MarketUtils.java
src.com.elsdoerfer.android.autostarts.opt.RootFeatures.java
src.com.elsdoerfer.android.autostarts.opt.RootFeatures.java