[FEATURE] Automatically adjust package states

Change-Id: Iff2d3b753dd9c48c3b8db0fdc2a1872fa38c97c3