If there are ports allocated outside of the project, do not allow network setting to be changed from shared to not shared

Change-Id: I055a096a78d978b5b5adf3d188564c1b715adede
Closes-Bug: 1351223
(cherry picked from commit 253df73cbc5f7966693e96ad1cab406d6f386be3)
Merge "If there are ports allocated outside of the project, do not allow network setting to be changed from shared to not shared" into R1.10