OSDN Git Service

Add a method to check if the current console is privileged
authorjruesga <jorge@ruesga.com>
Thu, 18 Oct 2012 23:03:41 +0000 (01:03 +0200)
committerjruesga <jorge@ruesga.com>
Thu, 18 Oct 2012 23:03:41 +0000 (01:03 +0200)
src/com/cyanogenmod/explorer/console/ConsoleBuilder.java

index ac9c8f2..ec61df8 100644 (file)
@@ -395,4 +395,16 @@ public final class ConsoleBuilder {
         }
     }
 
+    /**
+     * Method that returns if the current console is a privileged console
+     *
+     * @return boolean If the current console is a privileged console
+     */
+    public static boolean isPrivileged() {
+        if (sHolder != null && sHolder.getConsole() instanceof PrivilegedConsole) {
+            return true;
+        }
+        return false;
+    }
+
 }