Loading packages/PackageInstaller/AndroidManifest.xml +8 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,14 @@ </intent-filter> </receiver> <receiver android:name=".PackageInstalledReceiver" android:exported="true"> <intent-filter android:priority="1"> <action android:name="android.intent.action.PACKAGE_ADDED" /> <data android:scheme="package" /> </intent-filter> </receiver> <activity android:name=".UninstallUninstalling" android:excludeFromRecents="true" android:exported="false" /> Loading packages/PackageInstaller/src/com/android/packageinstaller/PackageInstalledReceiver.java 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.packageinstaller; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; /** * Receive new app installed broadcast and notify user new app installed. */ public class PackageInstalledReceiver extends BroadcastReceiver { private static final String TAG = "PackageInstalledReceiver"; @Override public void onReceive(Context context, Intent intent) { // TODO: Add logic to handle new app installed. } } services/core/java/com/android/server/pm/PackageManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -1988,6 +1988,14 @@ public class PackageManagerService extends IPackageManager.Stub mRequiredVerifierPackage, null /*finishedReceiver*/, updateUserIds, instantUserIds); } // If package installer is defined, notify package installer about new // app installed if (mRequiredInstallerPackage != null) { sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED, packageName, extras, Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND /*flags*/, mRequiredInstallerPackage, null /*finishedReceiver*/, firstUserIds, instantUserIds); } // Send replaced for users that don't see the package for the first time if (update) { Loading
packages/PackageInstaller/AndroidManifest.xml +8 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,14 @@ </intent-filter> </receiver> <receiver android:name=".PackageInstalledReceiver" android:exported="true"> <intent-filter android:priority="1"> <action android:name="android.intent.action.PACKAGE_ADDED" /> <data android:scheme="package" /> </intent-filter> </receiver> <activity android:name=".UninstallUninstalling" android:excludeFromRecents="true" android:exported="false" /> Loading
packages/PackageInstaller/src/com/android/packageinstaller/PackageInstalledReceiver.java 0 → 100644 +34 −0 Original line number Diff line number Diff line /* * Copyright 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.packageinstaller; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; /** * Receive new app installed broadcast and notify user new app installed. */ public class PackageInstalledReceiver extends BroadcastReceiver { private static final String TAG = "PackageInstalledReceiver"; @Override public void onReceive(Context context, Intent intent) { // TODO: Add logic to handle new app installed. } }
services/core/java/com/android/server/pm/PackageManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -1988,6 +1988,14 @@ public class PackageManagerService extends IPackageManager.Stub mRequiredVerifierPackage, null /*finishedReceiver*/, updateUserIds, instantUserIds); } // If package installer is defined, notify package installer about new // app installed if (mRequiredInstallerPackage != null) { sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED, packageName, extras, Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND /*flags*/, mRequiredInstallerPackage, null /*finishedReceiver*/, firstUserIds, instantUserIds); } // Send replaced for users that don't see the package for the first time if (update) {