1 /* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.content.pm; 18 19 import android.content.pm.Checksum; 20 import android.content.pm.DataLoaderParamsParcel; 21 import android.content.pm.IOnChecksumsReadyListener; 22 import android.content.pm.IPackageInstallObserver2; 23 import android.content.pm.PackageInstaller; 24 import android.content.pm.verify.domain.DomainSet; 25 import android.content.IntentSender; 26 import android.os.ParcelFileDescriptor; 27 28 /** {@hide} */ 29 interface IPackageInstallerSession { setClientProgress(float progress)30 void setClientProgress(float progress); addClientProgress(float progress)31 void addClientProgress(float progress); 32 getNames()33 String[] getNames(); 34 openWrite(String name, long offsetBytes, long lengthBytes)35 ParcelFileDescriptor openWrite(String name, long offsetBytes, long lengthBytes); openRead(String name)36 ParcelFileDescriptor openRead(String name); 37 write(String name, long offsetBytes, long lengthBytes, in ParcelFileDescriptor fd)38 void write(String name, long offsetBytes, long lengthBytes, in ParcelFileDescriptor fd); stageViaHardLink(String target)39 void stageViaHardLink(String target); 40 setChecksums(String name, in Checksum[] checksums, in byte[] signature)41 void setChecksums(String name, in Checksum[] checksums, in byte[] signature); requestChecksums(in String name, int optional, int required, in List trustedInstallers, in IOnChecksumsReadyListener onChecksumsReadyListener)42 void requestChecksums(in String name, int optional, int required, in List trustedInstallers, in IOnChecksumsReadyListener onChecksumsReadyListener); 43 removeSplit(String splitName)44 void removeSplit(String splitName); 45 close()46 void close(); commit(in IntentSender statusReceiver, boolean forTransferred)47 void commit(in IntentSender statusReceiver, boolean forTransferred); transfer(in String packageName)48 void transfer(in String packageName); abandon()49 void abandon(); seal()50 void seal(); fetchPackageNames()51 List<String> fetchPackageNames(); 52 53 @EnforcePermission("USE_INSTALLER_V2") getDataLoaderParams()54 DataLoaderParamsParcel getDataLoaderParams(); 55 @EnforcePermission("USE_INSTALLER_V2") addFile(int location, String name, long lengthBytes, in byte[] metadata, in byte[] signature)56 void addFile(int location, String name, long lengthBytes, in byte[] metadata, in byte[] signature); 57 @EnforcePermission("USE_INSTALLER_V2") removeFile(int location, String name)58 void removeFile(int location, String name); 59 isMultiPackage()60 boolean isMultiPackage(); getChildSessionIds()61 int[] getChildSessionIds(); addChildSessionId(in int sessionId)62 void addChildSessionId(in int sessionId); removeChildSessionId(in int sessionId)63 void removeChildSessionId(in int sessionId); getParentSessionId()64 int getParentSessionId(); 65 isStaged()66 boolean isStaged(); getInstallFlags()67 int getInstallFlags(); 68 requestUserPreapproval(in PackageInstaller.PreapprovalDetails details, in IntentSender statusReceiver)69 void requestUserPreapproval(in PackageInstaller.PreapprovalDetails details, in IntentSender statusReceiver); 70 isApplicationEnabledSettingPersistent()71 boolean isApplicationEnabledSettingPersistent(); isRequestUpdateOwnership()72 boolean isRequestUpdateOwnership(); 73 getAppMetadataFd()74 ParcelFileDescriptor getAppMetadataFd(); openWriteAppMetadata()75 ParcelFileDescriptor openWriteAppMetadata(); removeAppMetadata()76 void removeAppMetadata(); 77 setPreVerifiedDomains(in DomainSet preVerifiedDomains)78 void setPreVerifiedDomains(in DomainSet preVerifiedDomains); getPreVerifiedDomains()79 DomainSet getPreVerifiedDomains(); 80 } 81