Loading packages/CrashRecovery/services/module/java/com/android/server/PackageWatchdog.java +6 −6 Original line number Diff line number Diff line Loading @@ -456,7 +456,7 @@ public class PackageWatchdog { * * <p>This method could be called frequently if there is a severe problem on the device. */ public void onPackageFailure(@NonNull List<VersionedPackage> packages, public void notifyPackageFailure(@NonNull List<VersionedPackage> packages, @FailureReasons int failureReason) { if (packages == null) { Slog.w(TAG, "Could not resolve a list of failing packages"); Loading @@ -467,7 +467,7 @@ public class PackageWatchdog { if (Flags.recoverabilityDetection()) { if (now >= mLastMitigation && (now - mLastMitigation) < getMitigationWindowMs()) { Slog.i(TAG, "Skipping onPackageFailure mitigation"); Slog.i(TAG, "Skipping notifyPackageFailure mitigation"); return; } } Loading @@ -494,7 +494,7 @@ public class PackageWatchdog { ObserverInternal observer = mAllObservers.valueAt(oIndex); PackageHealthObserver registeredObserver = observer.registeredObserver; if (registeredObserver != null && observer.onPackageFailureLocked( && observer.notifyPackageFailureLocked( versionedPackage.getPackageName())) { MonitoredPackage p = observer.getMonitoredPackage( versionedPackage.getPackageName()); Loading Loading @@ -693,7 +693,7 @@ public class PackageWatchdog { // Check if native watchdog reported a crash if ("1".equals(SystemProperties.get("sys.init.updatable_crashing"))) { // We rollback all available low impact rollbacks when crash is unattributable onPackageFailure(Collections.EMPTY_LIST, FAILURE_REASON_NATIVE_CRASH); notifyPackageFailure(Collections.EMPTY_LIST, FAILURE_REASON_NATIVE_CRASH); // we stop polling after an attempt to execute rollback, regardless of whether the // attempt succeeds or not } else { Loading Loading @@ -916,7 +916,7 @@ public class PackageWatchdog { * effectively behave as if the explicit health check hasn't passed for {@code packageName}. * * <p> {@code packageName} can still be considered failed if reported by * {@link #onPackageFailureLocked} before the package expires. * {@link #notifyPackageFailureLocked} before the package expires. * * <p> Triggered by components outside the system server when they are fully functional after an * update. Loading Loading @@ -1460,7 +1460,7 @@ public class PackageWatchdog { * @hide */ @GuardedBy("sLock") public boolean onPackageFailureLocked(String packageName) { public boolean notifyPackageFailureLocked(String packageName) { if (getMonitoredPackage(packageName) == null && registeredObserver.isPersistent() && registeredObserver.mayObservePackage(packageName)) { putMonitoredPackage(sPackageWatchdog.newMonitoredPackage( Loading packages/CrashRecovery/services/platform/java/com/android/server/PackageWatchdog.java +7 −7 Original line number Diff line number Diff line Loading @@ -477,7 +477,7 @@ public class PackageWatchdog { * * <p>This method could be called frequently if there is a severe problem on the device. */ public void onPackageFailure(@NonNull List<VersionedPackage> packages, public void notifyPackageFailure(@NonNull List<VersionedPackage> packages, @FailureReasons int failureReason) { if (packages == null) { Slog.w(TAG, "Could not resolve a list of failing packages"); Loading @@ -488,7 +488,7 @@ public class PackageWatchdog { if (Flags.recoverabilityDetection()) { if (now >= mLastMitigation && (now - mLastMitigation) < getMitigationWindowMs()) { Slog.i(TAG, "Skipping onPackageFailure mitigation"); Slog.i(TAG, "Skipping notifyPackageFailure mitigation"); return; } } Loading @@ -515,7 +515,7 @@ public class PackageWatchdog { ObserverInternal observer = mAllObservers.valueAt(oIndex); PackageHealthObserver registeredObserver = observer.registeredObserver; if (registeredObserver != null && observer.onPackageFailureLocked( && observer.notifyPackageFailureLocked( versionedPackage.getPackageName())) { MonitoredPackage p = observer.getMonitoredPackage( versionedPackage.getPackageName()); Loading Loading @@ -714,7 +714,7 @@ public class PackageWatchdog { // Check if native watchdog reported a crash if ("1".equals(SystemProperties.get("sys.init.updatable_crashing"))) { // We rollback all available low impact rollbacks when crash is unattributable onPackageFailure(Collections.EMPTY_LIST, FAILURE_REASON_NATIVE_CRASH); notifyPackageFailure(Collections.EMPTY_LIST, FAILURE_REASON_NATIVE_CRASH); // we stop polling after an attempt to execute rollback, regardless of whether the // attempt succeeds or not } else { Loading Loading @@ -926,7 +926,7 @@ public class PackageWatchdog { * effectively behave as if the explicit health check hasn't passed for {@code packageName}. * * <p> {@code packageName} can still be considered failed if reported by * {@link #onPackageFailureLocked} before the package expires. * {@link #notifyPackageFailureLocked} before the package expires. * * <p> Triggered by components outside the system server when they are fully functional after an * update. Loading Loading @@ -1253,7 +1253,7 @@ public class PackageWatchdog { return; } final List<VersionedPackage> pkgList = Collections.singletonList(pkg); onPackageFailure(pkgList, FAILURE_REASON_EXPLICIT_HEALTH_CHECK); notifyPackageFailure(pkgList, FAILURE_REASON_EXPLICIT_HEALTH_CHECK); }); } Loading Loading @@ -1467,7 +1467,7 @@ public class PackageWatchdog { * @hide */ @GuardedBy("mLock") public boolean onPackageFailureLocked(String packageName) { public boolean notifyPackageFailureLocked(String packageName) { if (getMonitoredPackage(packageName) == null && registeredObserver.isPersistent() && registeredObserver.mayObservePackage(packageName)) { putMonitoredPackage(sPackageWatchdog.newMonitoredPackage( Loading services/core/java/com/android/server/am/AppErrors.java +2 −2 Original line number Diff line number Diff line Loading @@ -598,7 +598,7 @@ class AppErrors { } if (r != null) { mPackageWatchdog.onPackageFailure(r.getPackageListWithVersionCode(), mPackageWatchdog.notifyPackageFailure(r.getPackageListWithVersionCode(), PackageWatchdog.FAILURE_REASON_APP_CRASH); synchronized (mService) { Loading Loading @@ -1142,7 +1142,7 @@ class AppErrors { } // Notify PackageWatchdog without the lock held if (packageList != null) { mPackageWatchdog.onPackageFailure(packageList, mPackageWatchdog.notifyPackageFailure(packageList, PackageWatchdog.FAILURE_REASON_APP_NOT_RESPONDING); } } Loading services/core/java/com/android/server/crashrecovery/CrashRecoveryHelper.java +2 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,8 @@ public final class CrashRecoveryHelper { return; } final List<VersionedPackage> pkgList = Collections.singletonList(pkg); PackageWatchdog.getInstance(mContext).onPackageFailure(pkgList, PackageWatchdog.FAILURE_REASON_EXPLICIT_HEALTH_CHECK); PackageWatchdog.getInstance(mContext).notifyPackageFailure(pkgList, PackageWatchdog.FAILURE_REASON_EXPLICIT_HEALTH_CHECK); }); } Loading tests/PackageWatchdog/src/com/android/server/CrashRecoveryTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -1014,7 +1014,7 @@ public class CrashRecoveryTest { triggerFailureCount = 1; } for (int i = 0; i < triggerFailureCount; i++) { watchdog.onPackageFailure(packages, failureReason); watchdog.notifyPackageFailure(packages, failureReason); } mTestLooper.dispatchAll(); if (Flags.recoverabilityDetection()) { Loading Loading
packages/CrashRecovery/services/module/java/com/android/server/PackageWatchdog.java +6 −6 Original line number Diff line number Diff line Loading @@ -456,7 +456,7 @@ public class PackageWatchdog { * * <p>This method could be called frequently if there is a severe problem on the device. */ public void onPackageFailure(@NonNull List<VersionedPackage> packages, public void notifyPackageFailure(@NonNull List<VersionedPackage> packages, @FailureReasons int failureReason) { if (packages == null) { Slog.w(TAG, "Could not resolve a list of failing packages"); Loading @@ -467,7 +467,7 @@ public class PackageWatchdog { if (Flags.recoverabilityDetection()) { if (now >= mLastMitigation && (now - mLastMitigation) < getMitigationWindowMs()) { Slog.i(TAG, "Skipping onPackageFailure mitigation"); Slog.i(TAG, "Skipping notifyPackageFailure mitigation"); return; } } Loading @@ -494,7 +494,7 @@ public class PackageWatchdog { ObserverInternal observer = mAllObservers.valueAt(oIndex); PackageHealthObserver registeredObserver = observer.registeredObserver; if (registeredObserver != null && observer.onPackageFailureLocked( && observer.notifyPackageFailureLocked( versionedPackage.getPackageName())) { MonitoredPackage p = observer.getMonitoredPackage( versionedPackage.getPackageName()); Loading Loading @@ -693,7 +693,7 @@ public class PackageWatchdog { // Check if native watchdog reported a crash if ("1".equals(SystemProperties.get("sys.init.updatable_crashing"))) { // We rollback all available low impact rollbacks when crash is unattributable onPackageFailure(Collections.EMPTY_LIST, FAILURE_REASON_NATIVE_CRASH); notifyPackageFailure(Collections.EMPTY_LIST, FAILURE_REASON_NATIVE_CRASH); // we stop polling after an attempt to execute rollback, regardless of whether the // attempt succeeds or not } else { Loading Loading @@ -916,7 +916,7 @@ public class PackageWatchdog { * effectively behave as if the explicit health check hasn't passed for {@code packageName}. * * <p> {@code packageName} can still be considered failed if reported by * {@link #onPackageFailureLocked} before the package expires. * {@link #notifyPackageFailureLocked} before the package expires. * * <p> Triggered by components outside the system server when they are fully functional after an * update. Loading Loading @@ -1460,7 +1460,7 @@ public class PackageWatchdog { * @hide */ @GuardedBy("sLock") public boolean onPackageFailureLocked(String packageName) { public boolean notifyPackageFailureLocked(String packageName) { if (getMonitoredPackage(packageName) == null && registeredObserver.isPersistent() && registeredObserver.mayObservePackage(packageName)) { putMonitoredPackage(sPackageWatchdog.newMonitoredPackage( Loading
packages/CrashRecovery/services/platform/java/com/android/server/PackageWatchdog.java +7 −7 Original line number Diff line number Diff line Loading @@ -477,7 +477,7 @@ public class PackageWatchdog { * * <p>This method could be called frequently if there is a severe problem on the device. */ public void onPackageFailure(@NonNull List<VersionedPackage> packages, public void notifyPackageFailure(@NonNull List<VersionedPackage> packages, @FailureReasons int failureReason) { if (packages == null) { Slog.w(TAG, "Could not resolve a list of failing packages"); Loading @@ -488,7 +488,7 @@ public class PackageWatchdog { if (Flags.recoverabilityDetection()) { if (now >= mLastMitigation && (now - mLastMitigation) < getMitigationWindowMs()) { Slog.i(TAG, "Skipping onPackageFailure mitigation"); Slog.i(TAG, "Skipping notifyPackageFailure mitigation"); return; } } Loading @@ -515,7 +515,7 @@ public class PackageWatchdog { ObserverInternal observer = mAllObservers.valueAt(oIndex); PackageHealthObserver registeredObserver = observer.registeredObserver; if (registeredObserver != null && observer.onPackageFailureLocked( && observer.notifyPackageFailureLocked( versionedPackage.getPackageName())) { MonitoredPackage p = observer.getMonitoredPackage( versionedPackage.getPackageName()); Loading Loading @@ -714,7 +714,7 @@ public class PackageWatchdog { // Check if native watchdog reported a crash if ("1".equals(SystemProperties.get("sys.init.updatable_crashing"))) { // We rollback all available low impact rollbacks when crash is unattributable onPackageFailure(Collections.EMPTY_LIST, FAILURE_REASON_NATIVE_CRASH); notifyPackageFailure(Collections.EMPTY_LIST, FAILURE_REASON_NATIVE_CRASH); // we stop polling after an attempt to execute rollback, regardless of whether the // attempt succeeds or not } else { Loading Loading @@ -926,7 +926,7 @@ public class PackageWatchdog { * effectively behave as if the explicit health check hasn't passed for {@code packageName}. * * <p> {@code packageName} can still be considered failed if reported by * {@link #onPackageFailureLocked} before the package expires. * {@link #notifyPackageFailureLocked} before the package expires. * * <p> Triggered by components outside the system server when they are fully functional after an * update. Loading Loading @@ -1253,7 +1253,7 @@ public class PackageWatchdog { return; } final List<VersionedPackage> pkgList = Collections.singletonList(pkg); onPackageFailure(pkgList, FAILURE_REASON_EXPLICIT_HEALTH_CHECK); notifyPackageFailure(pkgList, FAILURE_REASON_EXPLICIT_HEALTH_CHECK); }); } Loading Loading @@ -1467,7 +1467,7 @@ public class PackageWatchdog { * @hide */ @GuardedBy("mLock") public boolean onPackageFailureLocked(String packageName) { public boolean notifyPackageFailureLocked(String packageName) { if (getMonitoredPackage(packageName) == null && registeredObserver.isPersistent() && registeredObserver.mayObservePackage(packageName)) { putMonitoredPackage(sPackageWatchdog.newMonitoredPackage( Loading
services/core/java/com/android/server/am/AppErrors.java +2 −2 Original line number Diff line number Diff line Loading @@ -598,7 +598,7 @@ class AppErrors { } if (r != null) { mPackageWatchdog.onPackageFailure(r.getPackageListWithVersionCode(), mPackageWatchdog.notifyPackageFailure(r.getPackageListWithVersionCode(), PackageWatchdog.FAILURE_REASON_APP_CRASH); synchronized (mService) { Loading Loading @@ -1142,7 +1142,7 @@ class AppErrors { } // Notify PackageWatchdog without the lock held if (packageList != null) { mPackageWatchdog.onPackageFailure(packageList, mPackageWatchdog.notifyPackageFailure(packageList, PackageWatchdog.FAILURE_REASON_APP_NOT_RESPONDING); } } Loading
services/core/java/com/android/server/crashrecovery/CrashRecoveryHelper.java +2 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,8 @@ public final class CrashRecoveryHelper { return; } final List<VersionedPackage> pkgList = Collections.singletonList(pkg); PackageWatchdog.getInstance(mContext).onPackageFailure(pkgList, PackageWatchdog.FAILURE_REASON_EXPLICIT_HEALTH_CHECK); PackageWatchdog.getInstance(mContext).notifyPackageFailure(pkgList, PackageWatchdog.FAILURE_REASON_EXPLICIT_HEALTH_CHECK); }); } Loading
tests/PackageWatchdog/src/com/android/server/CrashRecoveryTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -1014,7 +1014,7 @@ public class CrashRecoveryTest { triggerFailureCount = 1; } for (int i = 0; i < triggerFailureCount; i++) { watchdog.onPackageFailure(packages, failureReason); watchdog.notifyPackageFailure(packages, failureReason); } mTestLooper.dispatchAll(); if (Flags.recoverabilityDetection()) { Loading