diff options
Diffstat (limited to 'core/tests')
-rw-r--r-- | core/tests/coretests/src/android/content/pm/PackageManagerTests.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java index a4214cf..8b4030a 100644 --- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java +++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java @@ -27,6 +27,7 @@ import static android.system.OsConstants.S_IXOTH; import android.app.PackageInstallObserver; import android.content.BroadcastReceiver; +import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; @@ -3847,4 +3848,21 @@ public class PackageManagerTests extends AndroidTestCase { * how to do tests on updated system apps? * verify updates to system apps cannot be installed on the sdcard. */ + + //CM Tests + public void testIsComponentProtectedFromSamePackage() { + ComponentName testComponentName = new ComponentName("com.android.test", + "com.android.test.component.protected"); + getPm().setComponentProtectedSetting(testComponentName, true); + assertFalse(getPm().isComponentProtected(testComponentName.getPackageName(), + testComponentName)); + } + + public void testIsComponentProtectedFromManagers() { + ComponentName testComponentName = new ComponentName("com.android.test", + "com.android.test.component.protected"); + getPm().setComponentProtectedSetting(testComponentName, true); + assertFalse(getPm().isComponentProtected(testComponentName.getPackageName(), + testComponentName)); + } } |