[pm] prevent non-debuggable app downgrades via shell

Downgrade can only be performed if the following conditions are met:

1. Downgrade is requested in the installFlags
2a. App is debuggable
Or 2b: If app is not debuggable, the build is debuggable or the calling
uid is system or root.

This means shell can't downgrade a non-debuggable app on a non-debuggable build.

BUG: 256202273
Test: manual
Change-Id: I841878502eaa9574e98a38a77e73352fd9735677
1 file changed