| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.content.pm; |
| 18 |
|
| 19 |
import android.os.Parcel; |
| 20 |
import android.os.Parcelable; |
| 21 |
import android.os.PatternMatcher; |
| 22 |
import android.util.Printer; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
public final class ProviderInfo extends ComponentInfo |
| 31 |
implements Parcelable { |
| 32 |
|
| 33 |
|
| 34 |
public String authority = null; |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
public String readPermission = null; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
public String writePermission = null; |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
public boolean grantUriPermissions = false; |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
public boolean forceUriPermissions = false; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
public PatternMatcher[] uriPermissionPatterns = null; |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
public PathPermission[] pathPermissions = null; |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
public boolean multiprocess = false; |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
public int initOrder = 0; |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
public static final int FLAG_VISIBLE_TO_INSTANT_APP = 0x100000; |
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
public static final int FLAG_SINGLE_USER = 0x40000000; |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
public int flags = 0; |
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
@Deprecated |
| 110 |
public boolean isSyncable = false; |
| 111 |
|
| 112 |
public ProviderInfo() { |
| 113 |
} |
| 114 |
|
| 115 |
public ProviderInfo(ProviderInfo orig) { |
| 116 |
super(orig); |
| 117 |
authority = orig.authority; |
| 118 |
readPermission = orig.readPermission; |
| 119 |
writePermission = orig.writePermission; |
| 120 |
grantUriPermissions = orig.grantUriPermissions; |
| 121 |
forceUriPermissions = orig.forceUriPermissions; |
| 122 |
uriPermissionPatterns = orig.uriPermissionPatterns; |
| 123 |
pathPermissions = orig.pathPermissions; |
| 124 |
multiprocess = orig.multiprocess; |
| 125 |
initOrder = orig.initOrder; |
| 126 |
flags = orig.flags; |
| 127 |
isSyncable = orig.isSyncable; |
| 128 |
} |
| 129 |
|
| 130 |
public void dump(Printer pw, String prefix) { |
| 131 |
dump(pw, prefix, DUMP_FLAG_ALL); |
| 132 |
} |
| 133 |
|
| 134 |
|
| 135 |
public void dump(Printer pw, String prefix, int dumpFlags) { |
| 136 |
super.dumpFront(pw, prefix); |
| 137 |
pw.println(prefix + "authority=" + authority); |
| 138 |
pw.println(prefix + "flags=0x" + Integer.toHexString(flags)); |
| 139 |
super.dumpBack(pw, prefix, dumpFlags); |
| 140 |
} |
| 141 |
|
| 142 |
public int describeContents() { |
| 143 |
return 0; |
| 144 |
} |
| 145 |
|
| 146 |
@Override public void writeToParcel(Parcel out, int parcelableFlags) { |
| 147 |
super.writeToParcel(out, parcelableFlags); |
| 148 |
out.writeString8(authority); |
| 149 |
out.writeString8(readPermission); |
| 150 |
out.writeString8(writePermission); |
| 151 |
out.writeInt(grantUriPermissions ? 1 : 0); |
| 152 |
out.writeInt(forceUriPermissions ? 1 : 0); |
| 153 |
out.writeTypedArray(uriPermissionPatterns, parcelableFlags); |
| 154 |
out.writeTypedArray(pathPermissions, parcelableFlags); |
| 155 |
out.writeInt(multiprocess ? 1 : 0); |
| 156 |
out.writeInt(initOrder); |
| 157 |
out.writeInt(flags); |
| 158 |
out.writeInt(isSyncable ? 1 : 0); |
| 159 |
} |
| 160 |
|
| 161 |
public static final @android.annotation.NonNull Parcelable.Creator<ProviderInfo> CREATOR |
| 162 |
= new Parcelable.Creator<ProviderInfo>() { |
| 163 |
public ProviderInfo createFromParcel(Parcel in) { |
| 164 |
return new ProviderInfo(in); |
| 165 |
} |
| 166 |
|
| 167 |
public ProviderInfo[] newArray(int size) { |
| 168 |
return new ProviderInfo[size]; |
| 169 |
} |
| 170 |
}; |
| 171 |
|
| 172 |
public String toString() { |
| 173 |
return "ContentProviderInfo{name=" + authority + " className=" + name + "}"; |
| 174 |
} |
| 175 |
|
| 176 |
private ProviderInfo(Parcel in) { |
| 177 |
super(in); |
| 178 |
authority = in.readString8(); |
| 179 |
readPermission = in.readString8(); |
| 180 |
writePermission = in.readString8(); |
| 181 |
grantUriPermissions = in.readInt() != 0; |
| 182 |
forceUriPermissions = in.readInt() != 0; |
| 183 |
uriPermissionPatterns = in.createTypedArray(PatternMatcher.CREATOR); |
| 184 |
pathPermissions = in.createTypedArray(PathPermission.CREATOR); |
| 185 |
multiprocess = in.readInt() != 0; |
| 186 |
initOrder = in.readInt(); |
| 187 |
flags = in.readInt(); |
| 188 |
isSyncable = in.readInt() != 0; |
| 189 |
} |
| 190 |
} |