blob: ff2867945f06eb7c28e87e07f0a38a5c4e27cfdb [file] [log] [blame]
Christopher Tatef1977b42014-03-24 16:25:51 -07001/*
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
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -070019import android.content.Intent;
Christopher Tatef1977b42014-03-24 16:25:51 -070020import android.content.pm.IPackageInstallObserver2;
21import android.os.Bundle;
Christopher Tatef1977b42014-03-24 16:25:51 -070022
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -070023/** {@hide} */
Christopher Tatef1977b42014-03-24 16:25:51 -070024public class PackageInstallObserver {
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -070025 private final IPackageInstallObserver2.Stub mBinder = new IPackageInstallObserver2.Stub() {
Christopher Tatef1977b42014-03-24 16:25:51 -070026 @Override
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -070027 public void onUserActionRequired(Intent intent) {
28 PackageInstallObserver.this.onUserActionRequired(intent);
29 }
30
31 @Override
32 public void onPackageInstalled(String basePackageName, int returnCode,
33 String msg, Bundle extras) {
34 PackageInstallObserver.this.onPackageInstalled(basePackageName, returnCode, msg,
35 extras);
Christopher Tatef1977b42014-03-24 16:25:51 -070036 }
37 };
38
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -070039 /** {@hide} */
Jeff Sharkeybb580672014-07-10 12:10:25 -070040 public IPackageInstallObserver2 getBinder() {
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -070041 return mBinder;
42 }
43
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -070044 public void onUserActionRequired(Intent intent) {
45 }
46
Christopher Tatef1977b42014-03-24 16:25:51 -070047 /**
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -070048 * This method will be called to report the result of the package
49 * installation attempt.
Christopher Tatef1977b42014-03-24 16:25:51 -070050 *
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -070051 * @param basePackageName Name of the package whose installation was
52 * attempted
53 * @param extras If non-null, this Bundle contains extras providing
54 * additional information about an install failure. See
55 * {@link android.content.pm.PackageManager} for documentation
56 * about which extras apply to various failures; in particular
57 * the strings named EXTRA_FAILURE_*.
58 * @param returnCode The numeric success or failure code indicating the
59 * basic outcome
60 * @hide
Christopher Tatef1977b42014-03-24 16:25:51 -070061 */
Jeff Sharkeyfbd0e9f2014-08-06 16:34:34 -070062 public void onPackageInstalled(String basePackageName, int returnCode, String msg,
63 Bundle extras) {
Jeff Sharkeybb580672014-07-10 12:10:25 -070064 }
Christopher Tatef1977b42014-03-24 16:25:51 -070065}