Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/jellybean' into ics
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike C committed Dec 17, 2012
2 parents d7460f8 + 995e39a commit e2c06b2
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,20 @@ public final void alloc() throws ConsoleAllocException {
getExecutableFactory().newCreator().createIdentityExecutable();
execute(identityCmd);
this.mIdentity = identityCmd.getResult();
if (this.mIdentity.getGroups().size() == 0) {
//Try with groups
GroupsExecutable groupsCmd =
getExecutableFactory().newCreator().createGroupsExecutable();
execute(groupsCmd);
this.mIdentity.setGroups(groupsCmd.getResult());
// Identity command is required for root console detection,
// but Groups command is not used for now. Also, this command is causing
// problems on some implementations (maybe toolbox?) which don't
// recognize the root AID and returns an error. Safely ignore on error.
try {
if (this.mIdentity.getGroups().size() == 0) {
//Try with groups
GroupsExecutable groupsCmd =
getExecutableFactory().newCreator().createGroupsExecutable();
execute(groupsCmd);
this.mIdentity.setGroups(groupsCmd.getResult());
}
} catch (Exception ex) {
Log.w(TAG, "Groups command failed. Ignored.", ex);
}

} catch (Exception ex) {
Expand Down

0 comments on commit e2c06b2

Please sign in to comment.