1 /* 2 * Copyright (C) 2016 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 com.android.packageinstaller.wear; 18 19 /** 20 * Constants for Installation / Uninstallation requests. 21 * Using the same values as Finsky/Wearsky code for consistency in user analytics of failures 22 */ 23 public class InstallerConstants { 24 /** Request succeeded */ 25 public static final int STATUS_SUCCESS = 0; 26 27 /** 28 * The new PackageInstaller also returns a small set of less granular error codes, which 29 * we'll remap to the range -500 and below to keep away from existing installer codes 30 * (which run from -1 to -110). 31 */ 32 public final static int ERROR_PACKAGEINSTALLER_BASE = -500; 33 34 public static final int ERROR_COULD_NOT_GET_FD = -603; 35 /** This node is not targeted by this request. */ 36 37 /** The install did not complete because could not create PackageInstaller session */ 38 public final static int ERROR_INSTALL_CREATE_SESSION = -612; 39 /** The install did not complete because could not open PackageInstaller session */ 40 public final static int ERROR_INSTALL_OPEN_SESSION = -613; 41 /** The install did not complete because could not open PackageInstaller output stream */ 42 public final static int ERROR_INSTALL_OPEN_STREAM = -614; 43 /** The install did not complete because of an exception while streaming bytes */ 44 public final static int ERROR_INSTALL_COPY_STREAM_EXCEPTION = -615; 45 /** The install did not complete because of an unexpected exception from PackageInstaller */ 46 public final static int ERROR_INSTALL_SESSION_EXCEPTION = -616; 47 /** The install did not complete because of an unexpected userActionRequired callback */ 48 public final static int ERROR_INSTALL_USER_ACTION_REQUIRED = -617; 49 /** The install did not complete because of an unexpected broadcast (missing fields) */ 50 public final static int ERROR_INSTALL_MALFORMED_BROADCAST = -618; 51 /** The install did not complete because of an error while copying from downloaded file */ 52 public final static int ERROR_INSTALL_APK_COPY_FAILURE = -619; 53 /** The install did not complete because of an error while copying to the PackageInstaller 54 * output stream */ 55 public final static int ERROR_INSTALL_COPY_STREAM = -620; 56 /** The install did not complete because of an error while closing the PackageInstaller 57 * output stream */ 58 public final static int ERROR_INSTALL_CLOSE_STREAM = -621; 59 }