PackageInstallObserver.java revision f1977b4500e82b72ea6aa5c46d97406a20017caf
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 17package android.app; 18 19import android.content.pm.IPackageInstallObserver2; 20import android.os.Bundle; 21import android.os.RemoteException; 22 23/** 24 * @hide 25 * 26 * New-style observer for package installers to use. 27 */ 28public class PackageInstallObserver { 29 IPackageInstallObserver2.Stub mObserver = new IPackageInstallObserver2.Stub() { 30 @Override 31 public void packageInstalled(String pkgName, Bundle extras, int result) 32 throws RemoteException { 33 PackageInstallObserver.this.packageInstalled(pkgName, extras, result); 34 } 35 }; 36 37 /** 38 * This method will be called to report the result of the package installation attempt. 39 * 40 * @param pkgName Name of the package whose installation was attempted 41 * @param extras If non-null, this Bundle contains extras providing additional information 42 * about an install failure. See {@link android.content.pm.PackageManager} for 43 * documentation about which extras apply to various failures; in particular the 44 * strings named EXTRA_FAILURE_*. 45 * @param result The numeric success or failure code indicating the basic outcome 46 */ 47 public void packageInstalled(String pkgName, Bundle extras, int result) { 48 } 49} 50