Java Code Examples for android.content.pm.PathPermission#getReadPermission()

The following examples show how to use android.content.pm.PathPermission#getReadPermission() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PackageDetail.java    From Inspeckage with Apache License 2.0 5 votes vote down vote up
public String getExportedContentProvider() {
    StringBuilder sb = new StringBuilder();
    if (mPInfo.providers != null) {
        for (ProviderInfo pi : mPInfo.providers) {
            String piName = pi.name;
            if (pi.exported) {

                //Grant Uri Permissions
                piName = piName + " GRANT: " + String.valueOf(pi.grantUriPermissions) + "|";

                if (pi.authority != null) {
                    piName = piName + " AUTHORITY: " + pi.authority + "|";
                }

                if (pi.readPermission != null) {
                    piName = piName + " READ: " + pi.readPermission + "|";
                }
                if (pi.writePermission != null) {
                    piName = piName + " WRITE: " + pi.writePermission + "|";
                }
                PathPermission[] pp = pi.pathPermissions;
                if (pp != null) {
                    for (PathPermission pathPermission : pp) {
                        piName = piName + " PATH: " + pathPermission.getPath() + "|";
                        piName = piName + "  - READ: " + pathPermission.getReadPermission() + "|";
                        piName = piName + "  - WRITE: " + pathPermission.getWritePermission() + "|";
                    }
                }
                sb.append(piName + "\n");
            }
        }
    } else {
        sb.append(" -- null");
    }
    return sb.toString();
}
 
Example 2
Source File: PackageDetail.java    From Inspeckage with Apache License 2.0 5 votes vote down vote up
public String getNonExportedContentProvider() {
    StringBuilder sb = new StringBuilder();
    if (mPInfo.providers != null) {
        for (ProviderInfo pi : mPInfo.providers) {
            String piName = pi.name;
            if (!pi.exported) {

                //Grant Uri Permissions
                piName = piName + " GRANT: " + String.valueOf(pi.grantUriPermissions) + "|";

                if (pi.authority != null) {
                    piName = piName + " AUTHORITY: " + pi.authority + "|";
                }

                if (pi.readPermission != null) {
                    piName = piName + " READ: " + pi.readPermission + "|";
                }
                if (pi.writePermission != null) {
                    piName = piName + " WRITE: " + pi.writePermission + "|";
                }
                PathPermission[] pp = pi.pathPermissions;
                if (pp != null) {
                    for (PathPermission pathPermission : pp) {
                        piName = piName + " PATH: " + pathPermission.getPath() + "|";
                        piName = piName + "  - READ: " + pathPermission.getReadPermission() + "|";
                        piName = piName + "  - WRITE: " + pathPermission.getWritePermission() + "|";
                    }
                }
                sb.append(piName + "\n");
            }
        }
    } else {
        sb.append(" -- null");
    }
    return sb.toString();
}