Add null check for package in setEnabledSetting

When calling setEnabledSetting, the target package might have been
uninstalled. This change checks whether the package is null or not.

Bug: 162753654
Test: compile & verify basic functions working
Change-Id: Ibc1816cd7b5b4577c0510a388880fbec964c200a
1 file changed