Skip to content

Commit

Permalink
Changes related to revoking permissions.
Browse files Browse the repository at this point in the history
Change-Id: I8176920c7d33aa586e5fe4ecf9eee7a85a649237
  • Loading branch information
blackd authored and hyperb1iss committed May 20, 2011
1 parent c660f35 commit a400a9a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions AndroidManifest.xml
Expand Up @@ -45,6 +45,7 @@
<uses-permission android:name="android.permission.MOVE_PACKAGE" />
<uses-permission android:name="com.android.phone.CHANGE_NETWORK_MODE" />
<uses-permission android:name="android.permission.MANAGE_USB" />
<uses-permission android:name="android.permission.REVOKE_PERMISSIONS" />

<application android:label="@string/settings_label"
android:icon="@drawable/ic_launcher_settings"
Expand Down
16 changes: 15 additions & 1 deletion src/com/android/settings/applications/InstalledAppDetails.java
Expand Up @@ -46,6 +46,7 @@
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.provider.Settings;
import android.text.format.Formatter;
import android.util.Log;

Expand All @@ -54,7 +55,9 @@
import java.util.List;
import android.content.ComponentName;
import android.view.View;
import android.widget.AppSecurityEditablePermissions;
import android.widget.AppSecurityPermissions;
import android.widget.AppSecurityPermissionsBase;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
Expand Down Expand Up @@ -448,7 +451,12 @@ private boolean refreshUi() {

// Security permissions section
LinearLayout permsView = (LinearLayout) findViewById(R.id.permissions_section);
AppSecurityPermissions asp = new AppSecurityPermissions(this, packageName);
AppSecurityPermissionsBase asp = null;
if (isRevokeEnabled() && (mAppEntry.info.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
asp = new AppSecurityEditablePermissions(this, packageName);
} else {
asp = new AppSecurityPermissions(this, packageName);
}
if (asp.getPermissionCount() > 0) {
permsView.setVisibility(View.VISIBLE);
// Make the security sections header visible
Expand All @@ -466,6 +474,12 @@ private boolean refreshUi() {
refreshSizeInfo();
return true;
}

private boolean isRevokeEnabled() {
return Settings.Secure.getInt(getContentResolver(),
Settings.Secure.ENABLE_PERMISSIONS_MANAGMENT,
getResources().getBoolean(com.android.internal.R.bool.config_enablePermissionsManagment) ? 1 : 0) == 1;
}

private void setIntentAndFinish(boolean finish, boolean appChanged) {
if(localLOGV) Log.i(TAG, "appChanged="+appChanged);
Expand Down

0 comments on commit a400a9a

Please sign in to comment.