summaryrefslogtreecommitdiff
path: root/src/plugins/preflighting.core/src/com/motorolamobility/preflighting/core/source/model/PermissionGroups.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/preflighting.core/src/com/motorolamobility/preflighting/core/source/model/PermissionGroups.java')
-rw-r--r--src/plugins/preflighting.core/src/com/motorolamobility/preflighting/core/source/model/PermissionGroups.java75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/plugins/preflighting.core/src/com/motorolamobility/preflighting/core/source/model/PermissionGroups.java b/src/plugins/preflighting.core/src/com/motorolamobility/preflighting/core/source/model/PermissionGroups.java
new file mode 100644
index 0000000..c05a594
--- /dev/null
+++ b/src/plugins/preflighting.core/src/com/motorolamobility/preflighting/core/source/model/PermissionGroups.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2012 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.motorolamobility.preflighting.core.source.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Class that contains a list of required and optional permissions that the application needs (or should declare)
+ * based on the methods invoked inside the application. These permissions are
+ * the ones declared in the AndroidManifest.xml in the tag <uses-permission>.
+ */
+public class PermissionGroups
+{
+ /**
+ * The permission must be declared
+ */
+ private final List<String> requiredPermissions = new ArrayList<String>();
+
+ /**
+ * At least one of this permissions must be declared
+ */
+ private final List<String> optionalPermissions = new ArrayList<String>();
+
+ /**
+ * Get the {@link List} of required permissions. These are the ones in the
+ * AndroidManifest.xml represented within the tag &lt;uses-permission>.
+ *
+ * @return Returns the list of required permissions.
+ */
+ public List<String> getRequiredPermissions()
+ {
+ return requiredPermissions;
+ }
+
+ /**
+ * Get the list of optional permissions. These are the ones in the
+ * AndroidManifest.xml represented within the tag &lt;uses-permission>.
+ *
+ * @return Returns the list of optional permissions.
+ */
+ public List<String> getOptionalPermissions()
+ {
+ return optionalPermissions;
+ }
+
+ /**
+ * This implementation provides a human-readable text of this
+ * {@link PermissionGroups}.
+ *
+ * @return Returns a human-readable text of this {@link PermissionGroups}.
+ *
+ * @see Object#toString()
+ */
+ @Override
+ public String toString()
+ {
+ return "PermissionGroups [requiredPermissions=" + requiredPermissions
+ + ", optionalPermissions=" + optionalPermissions + "]";
+ }
+}