Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bdb4bc4f authored by Todd Kennedy's avatar Todd Kennedy Committed by android-build-merger
Browse files

Merge "Add internal implementation for notifyPackageUse" into oc-mr1-dev am: 8bb58a14

am: ad64df2b

Change-Id: I7fab82efe230dea393fa4b12c9c7ea71c44243fe
parents 7c5df649 ad64df2b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -378,4 +378,9 @@ public abstract class PackageManagerInternal {
     * associated with an instant app. It may be kept after the instant app has been uninstalled.
     */
    public abstract boolean hasInstantApplicationMetadata(String packageName, int userId);

    /**
     * Updates a package last used time.
     */
    public abstract void notifyPackageUse(String packageName, int reason);
}
+2 −4
Original line number Diff line number Diff line
@@ -3597,10 +3597,8 @@ public class ActivityManagerService extends IActivityManager.Stub
    }
    void notifyPackageUse(String packageName, int reason) {
        IPackageManager pm = AppGlobals.getPackageManager();
        try {
            pm.notifyPackageUse(packageName, reason);
        } catch (RemoteException e) {
        synchronized(this) {
            getPackageManagerInternalLocked().notifyPackageUse(packageName, reason);
        }
    }
+16 −5
Original line number Diff line number Diff line
@@ -9844,13 +9844,17 @@ public class PackageManagerService extends IPackageManager.Stub
                    return;
                }
            }
            notifyPackageUseLocked(packageName, reason);
        }
    }
    private void notifyPackageUseLocked(String packageName, int reason) {
        final PackageParser.Package p = mPackages.get(packageName);
        if (p == null) {
            return;
        }
        p.mLastPackageUsageTimeInMills[reason] = System.currentTimeMillis();
    }
    }
    @Override
    public void notifyDexLoad(String loadingPackageName, List<String> classLoaderNames,
@@ -25516,6 +25520,13 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
                return mInstantAppRegistry.hasInstantApplicationMetadataLPr(packageName, userId);
            }
        }
        @Override
        public void notifyPackageUse(String packageName, int reason) {
            synchronized (mPackages) {
                PackageManagerService.this.notifyPackageUseLocked(packageName, reason);
            }
        }
    }
    @Override