Merge "Skip LayoutTransition animations on objects of size (0,0)" into jb-dev
diff --git a/api/16.txt b/api/16.txt
index b8aeb39..8a7ac00 100644
--- a/api/16.txt
+++ b/api/16.txt
@@ -754,7 +754,6 @@
field public static final int pathPrefix = 16842795; // 0x101002b
field public static final int permission = 16842758; // 0x1010006
field public static final int permissionGroup = 16842762; // 0x101000a
- field public static final int permissionGroupFlags = 16843688; // 0x10103a8
field public static final int persistent = 16842765; // 0x101000d
field public static final int persistentDrawingCache = 16842990; // 0x10100ee
field public static final deprecated int phoneNumber = 16843111; // 0x1010167
@@ -6596,11 +6595,8 @@
method public int describeContents();
method public java.lang.CharSequence loadDescription(android.content.pm.PackageManager);
field public static final android.os.Parcelable.Creator CREATOR;
- field public static final int FLAG_PERSONAL_INFO = 1; // 0x1
field public int descriptionRes;
- field public int flags;
field public java.lang.CharSequence nonLocalizedDescription;
- field public int priority;
}
public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
diff --git a/api/current.txt b/api/current.txt
index b8aeb39..8a7ac00 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -754,7 +754,6 @@
field public static final int pathPrefix = 16842795; // 0x101002b
field public static final int permission = 16842758; // 0x1010006
field public static final int permissionGroup = 16842762; // 0x101000a
- field public static final int permissionGroupFlags = 16843688; // 0x10103a8
field public static final int persistent = 16842765; // 0x101000d
field public static final int persistentDrawingCache = 16842990; // 0x10100ee
field public static final deprecated int phoneNumber = 16843111; // 0x1010167
@@ -6596,11 +6595,8 @@
method public int describeContents();
method public java.lang.CharSequence loadDescription(android.content.pm.PackageManager);
field public static final android.os.Parcelable.Creator CREATOR;
- field public static final int FLAG_PERSONAL_INFO = 1; // 0x1
field public int descriptionRes;
- field public int flags;
field public java.lang.CharSequence nonLocalizedDescription;
- field public int priority;
}
public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index e180df4..679a8ac 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -1464,8 +1464,7 @@
perm.info.descriptionRes = sa.getResourceId(
com.android.internal.R.styleable.AndroidManifestPermissionGroup_description,
0);
- perm.info.flags = sa.getInt(
- com.android.internal.R.styleable.AndroidManifestPermissionGroup_permissionGroupFlags, 0);
+ perm.info.flags = 0;
perm.info.priority = sa.getInt(
com.android.internal.R.styleable.AndroidManifestPermissionGroup_priority, 0);
if (perm.info.priority > 0 && (flags&PARSE_IS_SYSTEM) == 0) {
diff --git a/core/java/android/content/pm/PermissionGroupInfo.java b/core/java/android/content/pm/PermissionGroupInfo.java
index 452bf0d..96d30d4 100644
--- a/core/java/android/content/pm/PermissionGroupInfo.java
+++ b/core/java/android/content/pm/PermissionGroupInfo.java
@@ -44,17 +44,20 @@
/**
* Flag for {@link #flags}, corresponding to <code>personalInfo</code>
* value of {@link android.R.attr#permissionGroupFlags}.
+ * @hide
*/
public static final int FLAG_PERSONAL_INFO = 1<<0;
/**
* Additional flags about this group as given by
* {@link android.R.attr#permissionGroupFlags}.
+ * @hide
*/
public int flags;
/**
* Prioritization of this group, for visually sorting with other groups.
+ * @hide
*/
public int priority;
diff --git a/core/java/android/widget/AppSecurityPermissions.java b/core/java/android/widget/AppSecurityPermissions.java
index 64f6c07..988760d 100755
--- a/core/java/android/widget/AppSecurityPermissions.java
+++ b/core/java/android/widget/AppSecurityPermissions.java
@@ -18,9 +18,7 @@
import com.android.internal.R;
-import android.app.AlertDialog;
import android.content.Context;
-import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -28,14 +26,9 @@
import android.content.pm.PermissionGroupInfo;
import android.content.pm.PermissionInfo;
import android.graphics.drawable.Drawable;
-import android.os.Parcel;
-import android.text.SpannableStringBuilder;
-import android.text.TextUtils;
-import android.util.AttributeSet;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
-import android.view.ViewGroup;
import java.text.Collator;
import java.util.ArrayList;
@@ -43,6 +36,7 @@
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -58,200 +52,52 @@
*
* {@hide}
*/
-public class AppSecurityPermissions {
+public class AppSecurityPermissions implements View.OnClickListener {
- public static final int WHICH_PERSONAL = 1<<0;
- public static final int WHICH_DEVICE = 1<<1;
- public static final int WHICH_NEW = 1<<2;
- public static final int WHICH_ALL = 0xffff;
+ private enum State {
+ NO_PERMS,
+ DANGEROUS_ONLY,
+ NORMAL_ONLY,
+ BOTH
+ }
private final static String TAG = "AppSecurityPermissions";
private boolean localLOGV = false;
private Context mContext;
private LayoutInflater mInflater;
private PackageManager mPm;
- private PackageInfo mInstalledPackageInfo;
- private final Map<String, MyPermissionGroupInfo> mPermGroups
- = new HashMap<String, MyPermissionGroupInfo>();
- private final List<MyPermissionGroupInfo> mPermGroupsList
- = new ArrayList<MyPermissionGroupInfo>();
- private final PermissionGroupInfoComparator mPermGroupComparator;
- private final PermissionInfoComparator mPermComparator;
- private List<MyPermissionInfo> mPermsList;
- private CharSequence mNewPermPrefix;
+ private LinearLayout mPermsView;
+ private Map<String, String> mDangerousMap;
+ private Map<String, String> mNormalMap;
+ private List<PermissionInfo> mPermsList;
+ private String mDefaultGrpLabel;
+ private String mDefaultGrpName="DefaultGrp";
+ private String mPermFormat;
private Drawable mNormalIcon;
private Drawable mDangerousIcon;
-
- static class MyPermissionGroupInfo extends PermissionGroupInfo {
- CharSequence mLabel;
-
- final ArrayList<MyPermissionInfo> mNewPermissions = new ArrayList<MyPermissionInfo>();
- final ArrayList<MyPermissionInfo> mPersonalPermissions = new ArrayList<MyPermissionInfo>();
- final ArrayList<MyPermissionInfo> mDevicePermissions = new ArrayList<MyPermissionInfo>();
- final ArrayList<MyPermissionInfo> mAllPermissions = new ArrayList<MyPermissionInfo>();
-
- MyPermissionGroupInfo(PermissionInfo perm) {
- name = perm.packageName;
- packageName = perm.packageName;
- }
-
- MyPermissionGroupInfo(PermissionGroupInfo info) {
- super(info);
- }
-
- public Drawable loadGroupIcon(PackageManager pm) {
- if (icon != 0) {
- return loadIcon(pm);
- } else {
- ApplicationInfo appInfo;
- try {
- appInfo = pm.getApplicationInfo(packageName, 0);
- return appInfo.loadIcon(pm);
- } catch (NameNotFoundException e) {
- }
- }
- return null;
- }
- }
-
- static class MyPermissionInfo extends PermissionInfo {
- CharSequence mLabel;
-
- /**
- * PackageInfo.requestedPermissionsFlags for the new package being installed.
- */
- int mNewReqFlags;
-
- /**
- * PackageInfo.requestedPermissionsFlags for the currently installed
- * package, if it is installed.
- */
- int mExistingReqFlags;
-
- /**
- * True if this should be considered a new permission.
- */
- boolean mNew;
-
- MyPermissionInfo() {
- }
-
- MyPermissionInfo(PermissionInfo info) {
- super(info);
- }
-
- MyPermissionInfo(MyPermissionInfo info) {
- super(info);
- mNewReqFlags = info.mNewReqFlags;
- mExistingReqFlags = info.mExistingReqFlags;
- mNew = info.mNew;
- }
- }
-
- public static class PermissionItemView extends LinearLayout implements View.OnClickListener {
- MyPermissionGroupInfo mGroup;
- MyPermissionInfo mPerm;
- AlertDialog mDialog;
-
- public PermissionItemView(Context context, AttributeSet attrs) {
- super(context, attrs);
- setClickable(true);
- }
-
- public void setPermission(MyPermissionGroupInfo grp, MyPermissionInfo perm,
- boolean first, CharSequence newPermPrefix) {
- mGroup = grp;
- mPerm = perm;
-
- ImageView permGrpIcon = (ImageView) findViewById(R.id.perm_icon);
- TextView permNameView = (TextView) findViewById(R.id.perm_name);
-
- PackageManager pm = getContext().getPackageManager();
- Drawable icon = null;
- if (first) {
- icon = grp.loadGroupIcon(pm);
- }
- CharSequence label = perm.mLabel;
- if (perm.mNew && newPermPrefix != null) {
- // If this is a new permission, format it appropriately.
- SpannableStringBuilder builder = new SpannableStringBuilder();
- Parcel parcel = Parcel.obtain();
- TextUtils.writeToParcel(newPermPrefix, parcel, 0);
- parcel.setDataPosition(0);
- CharSequence newStr = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(parcel);
- parcel.recycle();
- builder.append(newStr);
- builder.append(label);
- label = builder;
- }
-
- permGrpIcon.setImageDrawable(icon);
- permNameView.setText(label);
- setOnClickListener(this);
- }
-
- @Override
- public void onClick(View v) {
- if (mGroup != null && mPerm != null) {
- if (mDialog != null) {
- mDialog.dismiss();
- }
- PackageManager pm = getContext().getPackageManager();
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
- builder.setTitle(mGroup.mLabel);
- if (mPerm.descriptionRes != 0) {
- builder.setMessage(mPerm.loadDescription(pm));
- } else {
- CharSequence appName;
- try {
- ApplicationInfo app = pm.getApplicationInfo(mPerm.packageName, 0);
- appName = app.loadLabel(pm);
- } catch (NameNotFoundException e) {
- appName = mPerm.packageName;
- }
- StringBuilder sbuilder = new StringBuilder(128);
- sbuilder.append(getContext().getString(
- R.string.perms_description_app, appName));
- sbuilder.append("\n\n");
- sbuilder.append(mPerm.name);
- builder.setMessage(sbuilder.toString());
- }
- builder.setCancelable(true);
- builder.setIcon(mGroup.loadGroupIcon(pm));
- mDialog = builder.show();
- mDialog.setCanceledOnTouchOutside(true);
- }
- }
-
- @Override
- protected void onDetachedFromWindow() {
- super.onDetachedFromWindow();
- if (mDialog != null) {
- mDialog.dismiss();
- }
- }
- }
-
+ private boolean mExpanded;
+ private Drawable mShowMaxIcon;
+ private Drawable mShowMinIcon;
+ private View mShowMore;
+ private TextView mShowMoreText;
+ private ImageView mShowMoreIcon;
+ private State mCurrentState;
+ private LinearLayout mNonDangerousList;
+ private LinearLayout mDangerousList;
+ private HashMap<String, CharSequence> mGroupLabelCache;
+ private View mNoPermsView;
+
public AppSecurityPermissions(Context context, List<PermissionInfo> permList) {
mContext = context;
mPm = mContext.getPackageManager();
- loadResources();
- mPermComparator = new PermissionInfoComparator();
- mPermGroupComparator = new PermissionGroupInfoComparator();
- for (PermissionInfo pi : permList) {
- mPermsList.add(new MyPermissionInfo(pi));
- }
- setPermissions(mPermsList);
+ mPermsList = permList;
}
public AppSecurityPermissions(Context context, String packageName) {
mContext = context;
mPm = mContext.getPackageManager();
- loadResources();
- mPermComparator = new PermissionInfoComparator();
- mPermGroupComparator = new PermissionGroupInfoComparator();
- mPermsList = new ArrayList<MyPermissionInfo>();
- Set<MyPermissionInfo> permSet = new HashSet<MyPermissionInfo>();
+ mPermsList = new ArrayList<PermissionInfo>();
+ Set<PermissionInfo> permSet = new HashSet<PermissionInfo>();
PackageInfo pkgInfo;
try {
pkgInfo = mPm.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS);
@@ -263,39 +109,29 @@
if((pkgInfo.applicationInfo != null) && (pkgInfo.applicationInfo.uid != -1)) {
getAllUsedPermissions(pkgInfo.applicationInfo.uid, permSet);
}
- for(MyPermissionInfo tmpInfo : permSet) {
+ for(PermissionInfo tmpInfo : permSet) {
mPermsList.add(tmpInfo);
}
- setPermissions(mPermsList);
}
-
+
public AppSecurityPermissions(Context context, PackageParser.Package pkg) {
mContext = context;
mPm = mContext.getPackageManager();
- loadResources();
- mPermComparator = new PermissionInfoComparator();
- mPermGroupComparator = new PermissionGroupInfoComparator();
- mPermsList = new ArrayList<MyPermissionInfo>();
- Set<MyPermissionInfo> permSet = new HashSet<MyPermissionInfo>();
+ mPermsList = new ArrayList<PermissionInfo>();
+ Set<PermissionInfo> permSet = new HashSet<PermissionInfo>();
if(pkg == null) {
return;
}
-
- // Convert to a PackageInfo
- PackageInfo info = PackageParser.generatePackageInfo(pkg, null,
- PackageManager.GET_PERMISSIONS, 0, 0, null);
- PackageInfo installedPkgInfo = null;
// Get requested permissions
- if (info.requestedPermissions != null) {
- try {
- installedPkgInfo = mPm.getPackageInfo(info.packageName,
- PackageManager.GET_PERMISSIONS);
- } catch (NameNotFoundException e) {
+ if (pkg.requestedPermissions != null) {
+ ArrayList<String> strList = pkg.requestedPermissions;
+ int size = strList.size();
+ if (size > 0) {
+ extractPerms(strList.toArray(new String[size]), permSet);
}
- extractPerms(info, permSet, installedPkgInfo);
}
// Get permissions related to shared user if any
- if (pkg.mSharedUserId != null) {
+ if(pkg.mSharedUserId != null) {
int sharedUid;
try {
sharedUid = mPm.getUidForSharedUser(pkg.mSharedUserId);
@@ -305,23 +141,13 @@
}
}
// Retrieve list of permissions
- for (MyPermissionInfo tmpInfo : permSet) {
+ for(PermissionInfo tmpInfo : permSet) {
mPermsList.add(tmpInfo);
}
- setPermissions(mPermsList);
}
-
- private void loadResources() {
- // Pick up from framework resources instead.
- mNewPermPrefix = mContext.getText(R.string.perms_new_perm_prefix);
- mNormalIcon = mContext.getResources().getDrawable(R.drawable.ic_text_dot);
- mDangerousIcon = mContext.getResources().getDrawable(R.drawable.ic_bullet_key_permission);
- }
-
+
/**
- * Utility to retrieve a view displaying a single permission. This provides
- * the old UI layout for permissions; it is only here for the device admin
- * settings to continue to use.
+ * Utility to retrieve a view displaying a single permission.
*/
public static View getPermissionItemView(Context context,
CharSequence grpName, CharSequence description, boolean dangerous) {
@@ -329,15 +155,11 @@
Context.LAYOUT_INFLATER_SERVICE);
Drawable icon = context.getResources().getDrawable(dangerous
? R.drawable.ic_bullet_key_permission : R.drawable.ic_text_dot);
- return getPermissionItemViewOld(context, inflater, grpName,
+ return getPermissionItemView(context, inflater, grpName,
description, dangerous, icon);
}
- public PackageInfo getInstalledPackageInfo() {
- return mInstalledPackageInfo;
- }
-
- private void getAllUsedPermissions(int sharedUid, Set<MyPermissionInfo> permSet) {
+ private void getAllUsedPermissions(int sharedUid, Set<PermissionInfo> permSet) {
String sharedPkgList[] = mPm.getPackagesForUid(sharedUid);
if(sharedPkgList == null || (sharedPkgList.length == 0)) {
return;
@@ -348,95 +170,29 @@
}
private void getPermissionsForPackage(String packageName,
- Set<MyPermissionInfo> permSet) {
+ Set<PermissionInfo> permSet) {
PackageInfo pkgInfo;
try {
pkgInfo = mPm.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS);
} catch (NameNotFoundException e) {
- Log.w(TAG, "Couldn't retrieve permissions for package:"+packageName);
+ Log.w(TAG, "Could'nt retrieve permissions for package:"+packageName);
return;
}
if ((pkgInfo != null) && (pkgInfo.requestedPermissions != null)) {
- extractPerms(pkgInfo, permSet, pkgInfo);
+ extractPerms(pkgInfo.requestedPermissions, permSet);
}
}
-
- private void extractPerms(PackageInfo info, Set<MyPermissionInfo> permSet,
- PackageInfo installedPkgInfo) {
- String[] strList = info.requestedPermissions;
- int[] flagsList = info.requestedPermissionsFlags;
- if ((strList == null) || (strList.length == 0)) {
+
+ private void extractPerms(String strList[], Set<PermissionInfo> permSet) {
+ if((strList == null) || (strList.length == 0)) {
return;
}
- mInstalledPackageInfo = installedPkgInfo;
- for (int i=0; i<strList.length; i++) {
- String permName = strList[i];
- // If we are only looking at an existing app, then we only
- // care about permissions that have actually been granted to it.
- if (installedPkgInfo != null && info == installedPkgInfo) {
- if ((flagsList[i]&PackageInfo.REQUESTED_PERMISSION_GRANTED) == 0) {
- continue;
- }
- }
+ for(String permName:strList) {
try {
PermissionInfo tmpPermInfo = mPm.getPermissionInfo(permName, 0);
- if (tmpPermInfo == null) {
- continue;
+ if(tmpPermInfo != null) {
+ permSet.add(tmpPermInfo);
}
- int existingIndex = -1;
- if (installedPkgInfo != null
- && installedPkgInfo.requestedPermissions != null) {
- for (int j=0; j<installedPkgInfo.requestedPermissions.length; j++) {
- if (permName.equals(installedPkgInfo.requestedPermissions[j])) {
- existingIndex = j;
- break;
- }
- }
- }
- final int existingFlags = existingIndex >= 0 ?
- installedPkgInfo.requestedPermissionsFlags[existingIndex] : 0;
- if (!isDisplayablePermission(tmpPermInfo, flagsList[i], existingFlags)) {
- // This is not a permission that is interesting for the user
- // to see, so skip it.
- continue;
- }
- final String origGroupName = tmpPermInfo.group;
- String groupName = origGroupName;
- if (groupName == null) {
- groupName = tmpPermInfo.packageName;
- tmpPermInfo.group = groupName;
- }
- MyPermissionGroupInfo group = mPermGroups.get(groupName);
- if (group == null) {
- PermissionGroupInfo grp = null;
- if (origGroupName != null) {
- grp = mPm.getPermissionGroupInfo(origGroupName, 0);
- }
- if (grp != null) {
- group = new MyPermissionGroupInfo(grp);
- } else {
- // We could be here either because the permission
- // didn't originally specify a group or the group it
- // gave couldn't be found. In either case, we consider
- // its group to be the permission's package name.
- tmpPermInfo.group = tmpPermInfo.packageName;
- group = mPermGroups.get(tmpPermInfo.group);
- if (group == null) {
- group = new MyPermissionGroupInfo(tmpPermInfo);
- }
- group = new MyPermissionGroupInfo(tmpPermInfo);
- }
- mPermGroups.put(tmpPermInfo.group, group);
- }
- final boolean newPerm = installedPkgInfo != null
- && (existingFlags&PackageInfo.REQUESTED_PERMISSION_GRANTED) == 0;
- MyPermissionInfo myPerm = new MyPermissionInfo(tmpPermInfo);
- myPerm.mNewReqFlags = flagsList[i];
- myPerm.mExistingReqFlags = existingFlags;
- // This is a new permission if the app is already installed and
- // doesn't currently hold this permission.
- myPerm.mNew = newPerm;
- permSet.add(myPerm);
} catch (NameNotFoundException e) {
Log.i(TAG, "Ignoring unknown permission:"+permName);
}
@@ -444,99 +200,131 @@
}
public int getPermissionCount() {
- return getPermissionCount(WHICH_ALL);
- }
-
- private List<MyPermissionInfo> getPermissionList(MyPermissionGroupInfo grp, int which) {
- if (which == WHICH_NEW) {
- return grp.mNewPermissions;
- } else if (which == WHICH_PERSONAL) {
- return grp.mPersonalPermissions;
- } else if (which == WHICH_DEVICE) {
- return grp.mDevicePermissions;
- } else {
- return grp.mAllPermissions;
- }
- }
-
- public int getPermissionCount(int which) {
- int N = 0;
- for (int i=0; i<mPermGroupsList.size(); i++) {
- N += getPermissionList(mPermGroupsList.get(i), which).size();
- }
- return N;
+ return mPermsList.size();
}
public View getPermissionsView() {
- return getPermissionsView(WHICH_ALL);
+
+ mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ mPermsView = (LinearLayout) mInflater.inflate(R.layout.app_perms_summary, null);
+ mShowMore = mPermsView.findViewById(R.id.show_more);
+ mShowMoreIcon = (ImageView) mShowMore.findViewById(R.id.show_more_icon);
+ mShowMoreText = (TextView) mShowMore.findViewById(R.id.show_more_text);
+ mDangerousList = (LinearLayout) mPermsView.findViewById(R.id.dangerous_perms_list);
+ mNonDangerousList = (LinearLayout) mPermsView.findViewById(R.id.non_dangerous_perms_list);
+ mNoPermsView = mPermsView.findViewById(R.id.no_permissions);
+
+ // Set up the LinearLayout that acts like a list item.
+ mShowMore.setClickable(true);
+ mShowMore.setOnClickListener(this);
+ mShowMore.setFocusable(true);
+
+ // Pick up from framework resources instead.
+ mDefaultGrpLabel = mContext.getString(R.string.default_permission_group);
+ mPermFormat = mContext.getString(R.string.permissions_format);
+ mNormalIcon = mContext.getResources().getDrawable(R.drawable.ic_text_dot);
+ mDangerousIcon = mContext.getResources().getDrawable(R.drawable.ic_bullet_key_permission);
+ mShowMaxIcon = mContext.getResources().getDrawable(R.drawable.expander_close_holo_dark);
+ mShowMinIcon = mContext.getResources().getDrawable(R.drawable.expander_open_holo_dark);
+
+ // Set permissions view
+ setPermissions(mPermsList);
+ return mPermsView;
}
- public View getPermissionsView(int which) {
- mInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-
- LinearLayout permsView = (LinearLayout) mInflater.inflate(R.layout.app_perms_summary, null);
- LinearLayout displayList = (LinearLayout) permsView.findViewById(R.id.perms_list);
- View noPermsView = permsView.findViewById(R.id.no_permissions);
-
- displayPermissions(mPermGroupsList, displayList, which);
- if (displayList.getChildCount() <= 0) {
- noPermsView.setVisibility(View.VISIBLE);
+ /**
+ * Canonicalizes the group description before it is displayed to the user.
+ *
+ * TODO check for internationalization issues remove trailing '.' in str1
+ */
+ private String canonicalizeGroupDesc(String groupDesc) {
+ if ((groupDesc == null) || (groupDesc.length() == 0)) {
+ return null;
}
+ // Both str1 and str2 are non-null and are non-zero in size.
+ int len = groupDesc.length();
+ if(groupDesc.charAt(len-1) == '.') {
+ groupDesc = groupDesc.substring(0, len-1);
+ }
+ return groupDesc;
+ }
- return permsView;
+ /**
+ * Utility method that concatenates two strings defined by mPermFormat.
+ * a null value is returned if both str1 and str2 are null, if one of the strings
+ * is null the other non null value is returned without formatting
+ * this is to placate initial error checks
+ */
+ private String formatPermissions(String groupDesc, CharSequence permDesc) {
+ if(groupDesc == null) {
+ if(permDesc == null) {
+ return null;
+ }
+ return permDesc.toString();
+ }
+ groupDesc = canonicalizeGroupDesc(groupDesc);
+ if(permDesc == null) {
+ return groupDesc;
+ }
+ // groupDesc and permDesc are non null
+ return String.format(mPermFormat, groupDesc, permDesc.toString());
+ }
+
+ private CharSequence getGroupLabel(String grpName) {
+ if (grpName == null) {
+ //return default label
+ return mDefaultGrpLabel;
+ }
+ CharSequence cachedLabel = mGroupLabelCache.get(grpName);
+ if (cachedLabel != null) {
+ return cachedLabel;
+ }
+ PermissionGroupInfo pgi;
+ try {
+ pgi = mPm.getPermissionGroupInfo(grpName, 0);
+ } catch (NameNotFoundException e) {
+ Log.i(TAG, "Invalid group name:" + grpName);
+ return null;
+ }
+ CharSequence label = pgi.loadLabel(mPm).toString();
+ mGroupLabelCache.put(grpName, label);
+ return label;
}
/**
* Utility method that displays permissions from a map containing group name and
* list of permission descriptions.
*/
- private void displayPermissions(List<MyPermissionGroupInfo> groups,
- LinearLayout permListView, int which) {
+ private void displayPermissions(boolean dangerous) {
+ Map<String, String> permInfoMap = dangerous ? mDangerousMap : mNormalMap;
+ LinearLayout permListView = dangerous ? mDangerousList : mNonDangerousList;
permListView.removeAllViews();
- int spacing = (int)(8*mContext.getResources().getDisplayMetrics().density);
-
- for (int i=0; i<groups.size(); i++) {
- MyPermissionGroupInfo grp = groups.get(i);
- final List<MyPermissionInfo> perms = getPermissionList(grp, which);
- for (int j=0; j<perms.size(); j++) {
- MyPermissionInfo perm = perms.get(j);
- View view = getPermissionItemView(grp, perm, j == 0,
- which != WHICH_NEW ? mNewPermPrefix : null);
- LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
- ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.WRAP_CONTENT);
- if (j == 0) {
- lp.topMargin = spacing;
- }
- if (j == grp.mAllPermissions.size()-1) {
- lp.bottomMargin = spacing;
- }
- if (permListView.getChildCount() == 0) {
- lp.topMargin *= 2;
- }
- permListView.addView(view, lp);
- }
+ Set<String> permInfoStrSet = permInfoMap.keySet();
+ for (String loopPermGrpInfoStr : permInfoStrSet) {
+ CharSequence grpLabel = getGroupLabel(loopPermGrpInfoStr);
+ //guaranteed that grpLabel wont be null since permissions without groups
+ //will belong to the default group
+ if(localLOGV) Log.i(TAG, "Adding view group:" + grpLabel + ", desc:"
+ + permInfoMap.get(loopPermGrpInfoStr));
+ permListView.addView(getPermissionItemView(grpLabel,
+ permInfoMap.get(loopPermGrpInfoStr), dangerous));
}
}
- private PermissionItemView getPermissionItemView(MyPermissionGroupInfo grp,
- MyPermissionInfo perm, boolean first, CharSequence newPermPrefix) {
- return getPermissionItemView(mContext, mInflater, grp, perm, first, newPermPrefix);
+ private void displayNoPermissions() {
+ mNoPermsView.setVisibility(View.VISIBLE);
}
- private static PermissionItemView getPermissionItemView(Context context, LayoutInflater inflater,
- MyPermissionGroupInfo grp, MyPermissionInfo perm, boolean first,
- CharSequence newPermPrefix) {
- PermissionItemView permView = (PermissionItemView)inflater.inflate(
- R.layout.app_permission_item, null);
- permView.setPermission(grp, perm, first, newPermPrefix);
- return permView;
+ private View getPermissionItemView(CharSequence grpName, CharSequence permList,
+ boolean dangerous) {
+ return getPermissionItemView(mContext, mInflater, grpName, permList,
+ dangerous, dangerous ? mDangerousIcon : mNormalIcon);
}
- private static View getPermissionItemViewOld(Context context, LayoutInflater inflater,
+ private static View getPermissionItemView(Context context, LayoutInflater inflater,
CharSequence grpName, CharSequence permList, boolean dangerous, Drawable icon) {
- View permView = inflater.inflate(R.layout.app_permission_item_old, null);
+ View permView = inflater.inflate(R.layout.app_permission_item, null);
TextView permGrpView = (TextView) permView.findViewById(R.id.permission_group);
TextView permDescView = (TextView) permView.findViewById(R.id.permission_list);
@@ -553,107 +341,159 @@
return permView;
}
- private boolean isDisplayablePermission(PermissionInfo pInfo, int newReqFlags,
- int existingReqFlags) {
- final int base = pInfo.protectionLevel & PermissionInfo.PROTECTION_MASK_BASE;
- // Dangerous and normal permissions are always shown to the user.
- if (base == PermissionInfo.PROTECTION_DANGEROUS ||
- base == PermissionInfo.PROTECTION_NORMAL) {
- return true;
+ private void showPermissions() {
+
+ switch(mCurrentState) {
+ case NO_PERMS:
+ displayNoPermissions();
+ break;
+
+ case DANGEROUS_ONLY:
+ displayPermissions(true);
+ break;
+
+ case NORMAL_ONLY:
+ displayPermissions(false);
+ break;
+
+ case BOTH:
+ displayPermissions(true);
+ if (mExpanded) {
+ displayPermissions(false);
+ mShowMoreIcon.setImageDrawable(mShowMaxIcon);
+ mShowMoreText.setText(R.string.perms_hide);
+ mNonDangerousList.setVisibility(View.VISIBLE);
+ } else {
+ mShowMoreIcon.setImageDrawable(mShowMinIcon);
+ mShowMoreText.setText(R.string.perms_show_all);
+ mNonDangerousList.setVisibility(View.GONE);
+ }
+ mShowMore.setVisibility(View.VISIBLE);
+ break;
}
- // Development permissions are only shown to the user if they are already
- // granted to the app -- if we are installing an app and they are not
- // already granted, they will not be granted as part of the install.
- if ((existingReqFlags&PackageInfo.REQUESTED_PERMISSION_GRANTED) != 0
- && (pInfo.protectionLevel & PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0) {
+ }
+
+ private boolean isDisplayablePermission(PermissionInfo pInfo) {
+ if(pInfo.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS ||
+ pInfo.protectionLevel == PermissionInfo.PROTECTION_NORMAL) {
return true;
}
return false;
}
- private static class PermissionGroupInfoComparator implements Comparator<MyPermissionGroupInfo> {
- private final Collator sCollator = Collator.getInstance();
- PermissionGroupInfoComparator() {
+ /*
+ * Utility method that aggregates all permission descriptions categorized by group
+ * Say group1 has perm11, perm12, perm13, the group description will be
+ * perm11_Desc, perm12_Desc, perm13_Desc
+ */
+ private void aggregateGroupDescs(
+ Map<String, List<PermissionInfo> > map, Map<String, String> retMap) {
+ if(map == null) {
+ return;
}
- public final int compare(MyPermissionGroupInfo a, MyPermissionGroupInfo b) {
- if (((a.flags^b.flags)&PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) {
- return ((a.flags&PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) ? -1 : 1;
+ if(retMap == null) {
+ return;
+ }
+ Set<String> grpNames = map.keySet();
+ Iterator<String> grpNamesIter = grpNames.iterator();
+ while(grpNamesIter.hasNext()) {
+ String grpDesc = null;
+ String grpNameKey = grpNamesIter.next();
+ List<PermissionInfo> grpPermsList = map.get(grpNameKey);
+ if(grpPermsList == null) {
+ continue;
}
- if (a.priority != b.priority) {
- return a.priority > b.priority ? -1 : 1;
+ for(PermissionInfo permInfo: grpPermsList) {
+ CharSequence permDesc = permInfo.loadLabel(mPm);
+ grpDesc = formatPermissions(grpDesc, permDesc);
}
- return sCollator.compare(a.mLabel, b.mLabel);
+ // Insert grpDesc into map
+ if(grpDesc != null) {
+ if(localLOGV) Log.i(TAG, "Group:"+grpNameKey+" description:"+grpDesc.toString());
+ retMap.put(grpNameKey, grpDesc.toString());
+ }
}
}
- private static class PermissionInfoComparator implements Comparator<MyPermissionInfo> {
+ private static class PermissionInfoComparator implements Comparator<PermissionInfo> {
+ private PackageManager mPm;
private final Collator sCollator = Collator.getInstance();
- PermissionInfoComparator() {
+ PermissionInfoComparator(PackageManager pm) {
+ mPm = pm;
}
- public final int compare(MyPermissionInfo a, MyPermissionInfo b) {
- return sCollator.compare(a.mLabel, b.mLabel);
+ public final int compare(PermissionInfo a, PermissionInfo b) {
+ CharSequence sa = a.loadLabel(mPm);
+ CharSequence sb = b.loadLabel(mPm);
+ return sCollator.compare(sa, sb);
}
}
-
- private void addPermToList(List<MyPermissionInfo> permList,
- MyPermissionInfo pInfo) {
- if (pInfo.mLabel == null) {
- pInfo.mLabel = pInfo.loadLabel(mPm);
- }
- int idx = Collections.binarySearch(permList, pInfo, mPermComparator);
- if(localLOGV) Log.i(TAG, "idx="+idx+", list.size="+permList.size());
- if (idx < 0) {
- idx = -idx-1;
- permList.add(idx, pInfo);
- }
- }
-
- private void setPermissions(List<MyPermissionInfo> permList) {
+
+ private void setPermissions(List<PermissionInfo> permList) {
+ mGroupLabelCache = new HashMap<String, CharSequence>();
+ //add the default label so that uncategorized permissions can go here
+ mGroupLabelCache.put(mDefaultGrpName, mDefaultGrpLabel);
+
+ // Map containing group names and a list of permissions under that group
+ // categorized as dangerous
+ mDangerousMap = new HashMap<String, String>();
+ // Map containing group names and a list of permissions under that group
+ // categorized as normal
+ mNormalMap = new HashMap<String, String>();
+
+ // Additional structures needed to ensure that permissions are unique under
+ // each group
+ Map<String, List<PermissionInfo>> dangerousMap =
+ new HashMap<String, List<PermissionInfo>>();
+ Map<String, List<PermissionInfo> > normalMap =
+ new HashMap<String, List<PermissionInfo>>();
+ PermissionInfoComparator permComparator = new PermissionInfoComparator(mPm);
+
if (permList != null) {
// First pass to group permissions
- for (MyPermissionInfo pInfo : permList) {
+ for (PermissionInfo pInfo : permList) {
if(localLOGV) Log.i(TAG, "Processing permission:"+pInfo.name);
- if(!isDisplayablePermission(pInfo, pInfo.mNewReqFlags, pInfo.mExistingReqFlags)) {
+ if(!isDisplayablePermission(pInfo)) {
if(localLOGV) Log.i(TAG, "Permission:"+pInfo.name+" is not displayable");
continue;
}
- MyPermissionGroupInfo group = mPermGroups.get(pInfo.group);
- if (group != null) {
- pInfo.mLabel = pInfo.loadLabel(mPm);
- addPermToList(group.mAllPermissions, pInfo);
- if (pInfo.mNew) {
- addPermToList(group.mNewPermissions, pInfo);
- }
- if ((group.flags&PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0) {
- addPermToList(group.mPersonalPermissions, pInfo);
- } else {
- addPermToList(group.mDevicePermissions, pInfo);
+ Map<String, List<PermissionInfo> > permInfoMap =
+ (pInfo.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS) ?
+ dangerousMap : normalMap;
+ String grpName = (pInfo.group == null) ? mDefaultGrpName : pInfo.group;
+ if(localLOGV) Log.i(TAG, "Permission:"+pInfo.name+" belongs to group:"+grpName);
+ List<PermissionInfo> grpPermsList = permInfoMap.get(grpName);
+ if(grpPermsList == null) {
+ grpPermsList = new ArrayList<PermissionInfo>();
+ permInfoMap.put(grpName, grpPermsList);
+ grpPermsList.add(pInfo);
+ } else {
+ int idx = Collections.binarySearch(grpPermsList, pInfo, permComparator);
+ if(localLOGV) Log.i(TAG, "idx="+idx+", list.size="+grpPermsList.size());
+ if (idx < 0) {
+ idx = -idx-1;
+ grpPermsList.add(idx, pInfo);
}
}
}
+ // Second pass to actually form the descriptions
+ // Look at dangerous permissions first
+ aggregateGroupDescs(dangerousMap, mDangerousMap);
+ aggregateGroupDescs(normalMap, mNormalMap);
}
- for (MyPermissionGroupInfo pgrp : mPermGroups.values()) {
- if (pgrp.labelRes != 0 || pgrp.nonLocalizedLabel != null) {
- pgrp.mLabel = pgrp.loadLabel(mPm);
- } else {
- ApplicationInfo app;
- try {
- app = mPm.getApplicationInfo(pgrp.packageName, 0);
- pgrp.mLabel = app.loadLabel(mPm);
- } catch (NameNotFoundException e) {
- pgrp.mLabel = pgrp.loadLabel(mPm);
- }
- }
- mPermGroupsList.add(pgrp);
+ mCurrentState = State.NO_PERMS;
+ if(mDangerousMap.size() > 0) {
+ mCurrentState = (mNormalMap.size() > 0) ? State.BOTH : State.DANGEROUS_ONLY;
+ } else if(mNormalMap.size() > 0) {
+ mCurrentState = State.NORMAL_ONLY;
}
- Collections.sort(mPermGroupsList, mPermGroupComparator);
- if (false) {
- for (MyPermissionGroupInfo grp : mPermGroupsList) {
- Log.i("foo", "Group " + grp.name + " personal="
- + ((grp.flags&PermissionGroupInfo.FLAG_PERSONAL_INFO) != 0)
- + " priority=" + grp.priority);
- }
- }
+ if(localLOGV) Log.i(TAG, "mCurrentState=" + mCurrentState);
+ showPermissions();
+ }
+
+ public void onClick(View v) {
+ if(localLOGV) Log.i(TAG, "mExpanded="+mExpanded);
+ mExpanded = !mExpanded;
+ showPermissions();
}
}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 155e59c..abd7e92 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -139,11 +139,39 @@
<eat-comment />
<!-- Used for permissions that can be used to make the user spend money
- without their direct involvement. -->
+ without their direct involvement. For example, this is the group
+ for permissions that allow you to directly place phone calls,
+ directly send SMS messages, etc. -->
<permission-group android:name="android.permission-group.COST_MONEY"
android:label="@string/permgrouplab_costMoney"
android:description="@string/permgroupdesc_costMoney" />
+
+ <!-- Allows an application to send SMS messages. -->
+ <permission android:name="android.permission.SEND_SMS"
+ android:permissionGroup="android.permission-group.COST_MONEY"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_sendSms"
+ android:description="@string/permdesc_sendSms" />
+
+ <!-- Allows an application to send SMS messages via the Messaging app with no user
+ input or confirmation.
+ @hide -->
+ <permission android:name="android.permission.SEND_SMS_NO_CONFIRMATION"
+ android:permissionGroup="android.permission-group.COST_MONEY"
+ android:protectionLevel="signature|system"
+ android:label="@string/permlab_sendSmsNoConfirmation"
+ android:description="@string/permdesc_sendSmsNoConfirmation" />
+
+ <!-- Allows an application to initiate a phone call without going through
+ the Dialer user interface for the user to confirm the call
+ being placed. -->
+ <permission android:name="android.permission.CALL_PHONE"
+ android:permissionGroup="android.permission-group.COST_MONEY"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_callPhone"
+ android:description="@string/permdesc_callPhone" />
+
<!-- ================================== -->
<!-- Permissions for accessing messages -->
<!-- ================================== -->
@@ -155,26 +183,7 @@
receiving or reading an MMS. -->
<permission-group android:name="android.permission-group.MESSAGES"
android:label="@string/permgrouplab_messages"
- android:icon="@drawable/perm_group_messages"
- android:description="@string/permgroupdesc_messages"
- android:permissionGroupFlags="personalInfo"
- android:priority="360"/>
-
- <!-- Allows an application to send SMS messages. -->
- <permission android:name="android.permission.SEND_SMS"
- android:permissionGroup="android.permission-group.MESSAGES"
- android:protectionLevel="dangerous"
- android:label="@string/permlab_sendSms"
- android:description="@string/permdesc_sendSms" />
-
- <!-- Allows an application to send SMS messages via the Messaging app with no user
- input or confirmation.
- @hide -->
- <permission android:name="android.permission.SEND_SMS_NO_CONFIRMATION"
- android:permissionGroup="android.permission-group.MESSAGES"
- android:protectionLevel="signature|system"
- android:label="@string/permlab_sendSmsNoConfirmation"
- android:description="@string/permdesc_sendSmsNoConfirmation" />
+ android:description="@string/permgroupdesc_messages" />
<!-- Allows an application to monitor incoming SMS messages, to record
or perform processing on them. -->
@@ -240,25 +249,22 @@
android:description="@string/permdesc_receiveWapPush" />
<!-- =============================================================== -->
- <!-- Permissions for accessing social info (contacts and social) -->
+ <!-- Permissions for accessing personal info (contacts and calendar) -->
<!-- =============================================================== -->
<eat-comment />
- <!-- Used for permissions that provide access to the user's social connections,
- such as contacts, call logs, social stream, etc. This includes
+ <!-- Used for permissions that provide access to the user's private data,
+ such as contacts, calendar events, e-mail messages, etc. This includes
both reading and writing of this data (which should generally be
expressed as two distinct permissions). -->
- <permission-group android:name="android.permission-group.SOCIAL_INFO"
- android:label="@string/permgrouplab_socialInfo"
- android:icon="@drawable/perm_group_social_info"
- android:description="@string/permgroupdesc_socialInfo"
- android:permissionGroupFlags="personalInfo"
- android:priority="320" />
+ <permission-group android:name="android.permission-group.PERSONAL_INFO"
+ android:label="@string/permgrouplab_personalInfo"
+ android:description="@string/permgroupdesc_personalInfo" />
<!-- Allows an application to read the user's contacts data. -->
<permission android:name="android.permission.READ_CONTACTS"
- android:permissionGroup="android.permission-group.SOCIAL_INFO"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:protectionLevel="dangerous"
android:label="@string/permlab_readContacts"
android:description="@string/permdesc_readContacts" />
@@ -266,14 +272,14 @@
<!-- Allows an application to write (but not read) the user's
contacts data. -->
<permission android:name="android.permission.WRITE_CONTACTS"
- android:permissionGroup="android.permission-group.SOCIAL_INFO"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:protectionLevel="dangerous"
android:label="@string/permlab_writeContacts"
android:description="@string/permdesc_writeContacts" />
<!-- Allows an application to read the user's call log. -->
<permission android:name="android.permission.READ_CALL_LOG"
- android:permissionGroup="android.permission-group.SOCIAL_INFO"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:protectionLevel="dangerous"
android:label="@string/permlab_readCallLog"
android:description="@string/permdesc_readCallLog" />
@@ -281,42 +287,11 @@
<!-- Allows an application to write (but not read) the user's
contacts data. -->
<permission android:name="android.permission.WRITE_CALL_LOG"
- android:permissionGroup="android.permission-group.SOCIAL_INFO"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:protectionLevel="dangerous"
android:label="@string/permlab_writeCallLog"
android:description="@string/permdesc_writeCallLog" />
- <!-- Allows an application to read from the user's social stream. -->
- <permission android:name="android.permission.READ_SOCIAL_STREAM"
- android:permissionGroup="android.permission-group.SOCIAL_INFO"
- android:protectionLevel="dangerous"
- android:label="@string/permlab_readSocialStream"
- android:description="@string/permdesc_readSocialStream" />
-
- <!-- Allows an application to write (but not read) the user's
- social stream data. -->
- <permission android:name="android.permission.WRITE_SOCIAL_STREAM"
- android:permissionGroup="android.permission-group.SOCIAL_INFO"
- android:protectionLevel="dangerous"
- android:label="@string/permlab_writeSocialStream"
- android:description="@string/permdesc_writeSocialStream" />
-
- <!-- =============================================================== -->
- <!-- Permissions for accessing information about the device owner -->
- <!-- =============================================================== -->
- <eat-comment />
-
- <!-- Used for permissions that provide access to information about the device
- user such as profile information. This includes both reading and
- writing of this data (which should generally be expressed as two
- distinct permissions). -->
- <permission-group android:name="android.permission-group.PERSONAL_INFO"
- android:label="@string/permgrouplab_personalInfo"
- android:icon="@drawable/perm_group_personal_info"
- android:description="@string/permgroupdesc_personalInfo"
- android:permissionGroupFlags="personalInfo"
- android:priority="310" />
-
<!-- Allows an application to read the user's personal profile data. -->
<permission android:name="android.permission.READ_PROFILE"
android:permissionGroup="android.permission-group.PERSONAL_INFO"
@@ -332,19 +307,20 @@
android:label="@string/permlab_writeProfile"
android:description="@string/permdesc_writeProfile" />
- <!-- =============================================================== -->
- <!-- Permissions for accessing the device calendar -->
- <!-- =============================================================== -->
- <eat-comment />
+ <!-- Allows an application to read from the user's social stream. -->
+ <permission android:name="android.permission.READ_SOCIAL_STREAM"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_readSocialStream"
+ android:description="@string/permdesc_readSocialStream" />
- <!-- Used for permissions that provide access to the device
- calendar to create / view events.-->
- <permission-group android:name="android.permission-group.CALENDAR"
- android:label="@string/permgrouplab_calendar"
- android:icon="@drawable/perm_group_calendar"
- android:description="@string/permgroupdesc_calendar"
- android:permissionGroupFlags="personalInfo"
- android:priority="290" />
+ <!-- Allows an application to write (but not read) the user's
+ social stream data. -->
+ <permission android:name="android.permission.WRITE_SOCIAL_STREAM"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_writeSocialStream"
+ android:description="@string/permdesc_writeSocialStream" />
<!-- Allows an application to read the user's calendar data. -->
<permission android:name="android.permission.READ_CALENDAR"
@@ -361,63 +337,26 @@
android:label="@string/permlab_writeCalendar"
android:description="@string/permdesc_writeCalendar" />
- <!-- =============================================================== -->
- <!-- Permissions for accessing the user dictionary-->
- <!-- =============================================================== -->
- <eat-comment />
-
- <!-- Used for permissions that provide access to the user
- calendar to create / view events.-->
- <permission-group android:name="android.permission-group.USER_DICTIONARY"
- android:label="@string/permgrouplab_dictionary"
- android:icon="@drawable/perm_group_user_dictionary"
- android:description="@string/permgroupdesc_dictionary"
- android:permissionGroupFlags="personalInfo"
- android:priority="170" />
-
<!-- Allows an application to read the user dictionary. This should
really only be required by an IME, or a dictionary editor like
the Settings app. -->
<permission android:name="android.permission.READ_USER_DICTIONARY"
- android:permissionGroup="android.permission-group.USER_DICTIONARY"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:protectionLevel="dangerous"
android:label="@string/permlab_readDictionary"
android:description="@string/permdesc_readDictionary" />
- <!-- Used for permissions that provide access to the user
- calendar to create / view events.-->
- <permission-group android:name="android.permission-group.WRITE_USER_DICTIONARY"
- android:label="@string/permgrouplab_writeDictionary"
- android:icon="@drawable/perm_group_user_dictionary_write"
- android:description="@string/permgroupdesc_writeDictionary"
- android:permissionGroupFlags="personalInfo"
- android:priority="160" />
-
<!-- Allows an application to write to the user dictionary. -->
<permission android:name="android.permission.WRITE_USER_DICTIONARY"
- android:permissionGroup="android.permission-group.WRITE_USER_DICTIONARY"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:protectionLevel="normal"
android:label="@string/permlab_writeDictionary"
android:description="@string/permdesc_writeDictionary" />
- <!-- =============================================================== -->
- <!-- Permissions for accessing the user bookmarks -->
- <!-- =============================================================== -->
- <eat-comment />
-
- <!-- Used for permissions that provide access to the user
- bookmarks and browser history.-->
- <permission-group android:name="android.permission-group.BOOKMARKS"
- android:label="@string/permgrouplab_bookmarks"
- android:icon="@drawable/perm_group_bookmarks"
- android:description="@string/permgroupdesc_bookmarks"
- android:permissionGroupFlags="personalInfo"
- android:priority="300" />
-
<!-- Allows an application to read (but not write) the user's
browsing history and bookmarks. -->
<permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"
- android:permissionGroup="android.permission-group.BOOKMARKS"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:label="@string/permlab_readHistoryBookmarks"
android:description="@string/permdesc_readHistoryBookmarks"
android:protectionLevel="dangerous" />
@@ -425,48 +364,23 @@
<!-- Allows an application to write (but not read) the user's
browsing history and bookmarks. -->
<permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"
- android:permissionGroup="android.permission-group.BOOKMARKS"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:label="@string/permlab_writeHistoryBookmarks"
android:description="@string/permdesc_writeHistoryBookmarks"
android:protectionLevel="dangerous" />
- <!-- =============================================================== -->
- <!-- Permissions for setting the device alarm -->
- <!-- =============================================================== -->
- <eat-comment />
-
- <!-- Used for permissions that provide access to the user voicemail box. -->
- <permission-group android:name="android.permission-group.DEVICE_ALARMS"
- android:label="@string/permgrouplab_deviceAlarms"
- android:icon="@drawable/perm_group_device_alarms"
- android:description="@string/permgroupdesc_deviceAlarms"
- android:permissionGroupFlags="personalInfo"
- android:priority="210" />
-
<!-- Allows an application to broadcast an Intent to set an alarm for the
user. -->
<permission android:name="com.android.alarm.permission.SET_ALARM"
- android:permissionGroup="android.permission-group.DEVICE_ALARMS"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:label="@string/permlab_setAlarm"
android:description="@string/permdesc_setAlarm"
android:protectionLevel="normal" />
- <!-- =============================================================== -->
- <!-- Permissions for accessing the user voicemail -->
- <!-- =============================================================== -->
- <eat-comment />
-
- <!-- Used for permissions that provide access to the user voicemail box. -->
- <permission-group android:name="android.permission-group.VOICEMAIL"
- android:label="@string/permgrouplab_voicemail"
- android:icon="@drawable/perm_group_voicemail"
- android:description="@string/permgroupdesc_voicemail"
- android:permissionGroupFlags="personalInfo"
- android:priority="280" />
<!-- Allows an application to add voicemails into the system. -->
<permission android:name="com.android.voicemail.permission.ADD_VOICEMAIL"
- android:permissionGroup="android.permission-group.VOICEMAIL"
+ android:permissionGroup="android.permission-group.PERSONAL_INFO"
android:protectionLevel="dangerous"
android:label="@string/permlab_addVoicemail"
android:description="@string/permdesc_addVoicemail" />
@@ -481,9 +395,7 @@
<permission-group android:name="android.permission-group.LOCATION"
android:label="@string/permgrouplab_location"
android:icon="@drawable/perm_group_location"
- android:description="@string/permgroupdesc_location"
- android:permissionGroupFlags="personalInfo"
- android:priority="330" />
+ android:description="@string/permgroupdesc_location" />
<!-- Allows an application to access fine (e.g., GPS) location -->
<permission android:name="android.permission.ACCESS_FINE_LOCATION"
@@ -530,9 +442,7 @@
or other related network operations. -->
<permission-group android:name="android.permission-group.NETWORK"
android:label="@string/permgrouplab_network"
- android:icon="@drawable/perm_group_network"
- android:description="@string/permgroupdesc_network"
- android:priority="270" />
+ android:description="@string/permgroupdesc_network" />
<!-- Allows applications to open network sockets. -->
<permission android:name="android.permission.INTERNET"
@@ -555,13 +465,6 @@
android:description="@string/permdesc_accessWifiState"
android:label="@string/permlab_accessWifiState" />
- <!-- Allows applications to change Wi-Fi connectivity state -->
- <permission android:name="android.permission.CHANGE_WIFI_STATE"
- android:permissionGroup="android.permission-group.NETWORK"
- android:protectionLevel="normal"
- android:description="@string/permdesc_changeWifiState"
- android:label="@string/permlab_changeWifiState" />
-
<!-- @hide -->
<permission android:name="android.permission.ACCESS_WIMAX_STATE"
android:permissionGroup="android.permission-group.NETWORK"
@@ -569,55 +472,35 @@
android:description="@string/permdesc_accessWimaxState"
android:label="@string/permlab_accessWimaxState" />
- <!-- @hide -->
- <permission android:name="android.permission.CHANGE_WIMAX_STATE"
+ <!-- Allows applications to connect to paired bluetooth devices -->
+ <permission android:name="android.permission.BLUETOOTH"
android:permissionGroup="android.permission-group.NETWORK"
android:protectionLevel="dangerous"
- android:description="@string/permdesc_changeWimaxState"
- android:label="@string/permlab_changeWimaxState" />
-
- <!-- ======================================= -->
- <!-- Permissions for short range, peripheral networks -->
- <!-- ======================================= -->
- <eat-comment />
-
- <!-- Used for permissions that provide access to other devices through Bluetooth.-->
- <permission-group android:name="android.permission-group.BLUETOOTH_NETWORK"
- android:label="@string/permgrouplab_bluetoothNetwork"
- android:icon="@drawable/perm_group_bluetooth"
- android:description="@string/permgroupdesc_bluetoothNetwork"
- android:priority="260" />
-
- <!-- Allows applications to connect to paired bluetooth devices -->
- <permission android:name="android.permission.BLUETOOTH"
- android:permissionGroup="android.permission-group.BLUETOOTH_NETWORK"
- android:protectionLevel="dangerous"
android:description="@string/permdesc_bluetooth"
- android:label="@string/permlab_bluetooth" />
-
- <!-- Allows applications to discover and pair bluetooth devices -->
- <permission android:name="android.permission.BLUETOOTH_ADMIN"
- android:permissionGroup="android.permission-group.BLUETOOTH_NETWORK"
- android:protectionLevel="dangerous"
- android:description="@string/permdesc_bluetoothAdmin"
- android:label="@string/permlab_bluetoothAdmin" />
+ android:label="@string/permlab_bluetooth" />
- <!-- Used for permissions that provide access to network services that
- are for peripherals and other nearby devices. These networks
- generally do not provide IP based networking or internet access.-->
- <permission-group android:name="android.permission-group.SHORTRANGE_NETWORK"
- android:label="@string/permgrouplab_shortrangeNetwork"
- android:icon="@drawable/perm_group_shortrange_network"
- android:description="@string/permgroupdesc_shortrangeNetwork"
- android:priority="250" />
-
<!-- Allows applications to perform I/O operations over NFC -->
<permission android:name="android.permission.NFC"
- android:permissionGroup="android.permission-group.SHORTRANGE_NETWORK"
+ android:permissionGroup="android.permission-group.NETWORK"
android:protectionLevel="dangerous"
android:description="@string/permdesc_nfc"
android:label="@string/permlab_nfc" />
+ <!-- Allows an application to use SIP service -->
+ <permission android:name="android.permission.USE_SIP"
+ android:permissionGroup="android.permission-group.NETWORK"
+ android:protectionLevel="dangerous"
+ android:description="@string/permdesc_use_sip"
+ android:label="@string/permlab_use_sip" />
+
+ <!-- Allows applications to call into AccountAuthenticators. Only
+ the system can get this permission. -->
+ <permission android:name="android.permission.ACCOUNT_MANAGER"
+ android:permissionGroup="android.permission-group.ACCOUNTS"
+ android:protectionLevel="signature"
+ android:description="@string/permdesc_accountManagerService"
+ android:label="@string/permlab_accountManagerService" />
+
<!-- Allows an internal user to use privileged ConnectivityManager
APIs.
@hide -->
@@ -634,10 +517,7 @@
by the Account Manager. -->
<permission-group android:name="android.permission-group.ACCOUNTS"
android:label="@string/permgrouplab_accounts"
- android:icon="@drawable/perm_group_accounts"
- android:description="@string/permgroupdesc_accounts"
- android:permissionGroupFlags="personalInfo"
- android:priority="200" />
+ android:description="@string/permgroupdesc_accounts" />
<!-- Allows access to the list of accounts in the Accounts Service -->
<permission android:name="android.permission.GET_ACCOUNTS"
@@ -668,77 +548,6 @@
android:label="@string/permlab_manageAccounts"
android:description="@string/permdesc_manageAccounts" />
- <!-- Allows applications to call into AccountAuthenticators. Only
- the system can get this permission. -->
- <permission android:name="android.permission.ACCOUNT_MANAGER"
- android:permissionGroup="android.permission-group.ACCOUNTS"
- android:protectionLevel="signature"
- android:description="@string/permdesc_accountManagerService"
- android:label="@string/permlab_accountManagerService" />
-
- <!-- ================================== -->
- <!-- Permissions for accessing hardware that may effect battery life-->
- <!-- ================================== -->
- <eat-comment />
-
- <!-- Used for permissions that provide direct access to the hardware on
- the device that has an effect on battery life. This includes vibrator,
- flashlight, etc. -->
-
- <permission-group android:name="android.permission-group.AFFECTS_BATTERY"
- android:label="@string/permgrouplab_affectsBattery"
- android:icon="@drawable/perm_group_affects_battery"
- android:description="@string/permgroupdesc_affectsBattery"
- android:priority="180" />
-
- <!-- Allows applications to enter Wi-Fi Multicast mode -->
- <permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"
- android:permissionGroup="android.permission-group.AFFECTS_BATTERY"
- android:protectionLevel="normal"
- android:description="@string/permdesc_changeWifiMulticastState"
- android:label="@string/permlab_changeWifiMulticastState" />
-
- <!-- Allows access to the vibrator -->
- <permission android:name="android.permission.VIBRATE"
- android:permissionGroup="android.permission-group.AFFECTS_BATTERY"
- android:protectionLevel="normal"
- android:label="@string/permlab_vibrate"
- android:description="@string/permdesc_vibrate" />
-
- <!-- Allows access to the flashlight -->
- <permission android:name="android.permission.FLASHLIGHT"
- android:permissionGroup="android.permission-group.AFFECTS_BATTERY"
- android:protectionLevel="normal"
- android:label="@string/permlab_flashlight"
- android:description="@string/permdesc_flashlight" />
-
- <!-- Allows using PowerManager WakeLocks to keep processor from sleeping or screen
- from dimming -->
- <permission android:name="android.permission.WAKE_LOCK"
- android:permissionGroup="android.permission-group.AFFECTS_BATTERY"
- android:protectionLevel="normal"
- android:label="@string/permlab_wakeLock"
- android:description="@string/permdesc_wakeLock" />
-
- <!-- ==================================================== -->
- <!-- Permissions related to changing audio settings -->
- <!-- ==================================================== -->
-
- <!-- Used for permissions that provide direct access to speaker settings
- the device. -->
- <permission-group android:name="android.permission-group.AUDIO_SETTINGS"
- android:label="@string/permgrouplab_audioSettings"
- android:icon="@drawable/perm_group_audio_settings"
- android:description="@string/permgroupdesc_audioSettings"
- android:priority="130" />
-
- <!-- Allows an application to modify global audio settings -->
- <permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"
- android:permissionGroup="android.permission-group.AUDIO_SETTINGS"
- android:protectionLevel="normal"
- android:label="@string/permlab_modifyAudioSettings"
- android:description="@string/permdesc_modifyAudioSettings" />
-
<!-- ================================== -->
<!-- Permissions for accessing hardware -->
<!-- ================================== -->
@@ -748,8 +557,49 @@
the device. This includes audio, the camera, vibrator, etc. -->
<permission-group android:name="android.permission-group.HARDWARE_CONTROLS"
android:label="@string/permgrouplab_hardwareControls"
- android:description="@string/permgroupdesc_hardwareControls"
- android:priority="260"/>
+ android:description="@string/permgroupdesc_hardwareControls" />
+
+
+ <!-- Allows an application to modify global audio settings -->
+ <permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"
+ android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_modifyAudioSettings"
+ android:description="@string/permdesc_modifyAudioSettings" />
+
+ <!-- Allows an application to record audio -->
+ <permission android:name="android.permission.RECORD_AUDIO"
+ android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_recordAudio"
+ android:description="@string/permdesc_recordAudio" />
+
+ <!-- Required to be able to access the camera device.
+ <p>This will automatically enforce the <a
+ href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
+ <uses-feature>}</a> manifest element for <em>all</em> camera features.
+ If you do not require all camera features or can properly operate if a camera
+ is not available, then you must modify your manifest as appropriate in order to
+ install on devices that don't support all camera features.</p> -->
+ <permission android:name="android.permission.CAMERA"
+ android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_camera"
+ android:description="@string/permdesc_camera" />
+
+ <!-- Allows access to the vibrator -->
+ <permission android:name="android.permission.VIBRATE"
+ android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
+ android:protectionLevel="normal"
+ android:label="@string/permlab_vibrate"
+ android:description="@string/permdesc_vibrate" />
+
+ <!-- Allows access to the flashlight -->
+ <permission android:name="android.permission.FLASHLIGHT"
+ android:permissionGroup="android.permission-group.HARDWARE_CONTROLS"
+ android:protectionLevel="normal"
+ android:label="@string/permlab_flashlight"
+ android:description="@string/permdesc_flashlight" />
<!-- Allows an application to manage preferences and permissions for USB devices
@hide -->
@@ -787,68 +637,18 @@
android:protectionLevel="signature" />
<!-- =========================================== -->
- <!-- Permissions associated with audio capture -->
- <!-- =========================================== -->
- <eat-comment />
-
- <!-- Used for permissions that are associated with accessing
- microphone audio from the device. Note that phone calls also capture audio
- but are in a separate (more visible) permission group. -->
- <permission-group android:name="android.permission-group.MICROPHONE"
- android:label="@string/permgrouplab_microphone"
- android:icon="@drawable/perm_group_microphone"
- android:description="@string/permgroupdesc_microphone"
- android:permissionGroupFlags="personalInfo"
- android:priority="340" />
-
- <!-- Allows an application to record audio -->
- <permission android:name="android.permission.RECORD_AUDIO"
- android:permissionGroup="android.permission-group.MICROPHONE"
- android:protectionLevel="dangerous"
- android:label="@string/permlab_recordAudio" />
-
-
- <!-- =========================================== -->
- <!-- Permissions associated with camera and image capture -->
- <!-- =========================================== -->
- <eat-comment />
-
- <!-- Used for permissions that are associated with accessing
- camera or capturing images/video from the device. -->
- <permission-group android:name="android.permission-group.CAMERA"
- android:label="@string/permgrouplab_camera"
- android:icon="@drawable/perm_group_camera"
- android:description="@string/permgroupdesc_camera"
- android:permissionGroupFlags="personalInfo"
- android:priority="350" />
-
- <!-- Required to be able to access the camera device.
- <p>This will automatically enforce the <a
- href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code
- <uses-feature>}</a> manifest element for <em>all</em> camera features.
- If you do not require all camera features or can properly operate if a camera
- is not available, then you must modify your manifest as appropriate in order to
- install on devices that don't support all camera features.</p> -->
- <permission android:name="android.permission.CAMERA"
- android:permissionGroup="android.permission-group.CAMERA"
- android:protectionLevel="dangerous"
- android:label="@string/permlab_camera"
- android:description="@string/permdesc_camera" />
-
- <!-- =========================================== -->
<!-- Permissions associated with telephony state -->
<!-- =========================================== -->
<eat-comment />
<!-- Used for permissions that are associated with accessing and modifyign
- telephony state: placing calls, intercepting outgoing calls, reading
- and modifying the phone state. -->
+ telephony state: intercepting outgoing calls, reading
+ and modifying the phone state. Note that
+ placing phone calls is not in this group, since that is in the
+ more important "takin' yer moneys" group. -->
<permission-group android:name="android.permission-group.PHONE_CALLS"
android:label="@string/permgrouplab_phoneCalls"
- android:icon="@drawable/perm_group_phone_calls"
- android:description="@string/permgroupdesc_phoneCalls"
- android:permissionGroupFlags="personalInfo"
- android:priority="370" />
+ android:description="@string/permgroupdesc_phoneCalls" />
<!-- Allows an application to monitor, modify, or abort outgoing
calls. -->
@@ -879,22 +679,6 @@
android:permissionGroup="android.permission-group.PHONE_CALLS"
android:protectionLevel="signature|system" />
- <!-- Allows an application to initiate a phone call without going through
- the Dialer user interface for the user to confirm the call
- being placed. -->
- <permission android:name="android.permission.CALL_PHONE"
- android:permissionGroup="android.permission-group.PHONE_CALLS"
- android:protectionLevel="dangerous"
- android:label="@string/permlab_callPhone"
- android:description="@string/permdesc_callPhone" />
-
- <!-- Allows an application to use SIP service -->
- <permission android:name="android.permission.USE_SIP"
- android:permissionGroup="android.permission-group.PHONE_CALLS"
- android:protectionLevel="dangerous"
- android:description="@string/permdesc_use_sip"
- android:label="@string/permlab_use_sip" />
-
<!-- ================================== -->
<!-- Permissions for sdcard interaction -->
<!-- ================================== -->
@@ -903,10 +687,7 @@
<!-- Group of permissions that are related to SD card access. -->
<permission-group android:name="android.permission-group.STORAGE"
android:label="@string/permgrouplab_storage"
- android:icon="@drawable/perm_group_storage"
- android:description="@string/permgroupdesc_storage"
- android:permissionGroupFlags="personalInfo"
- android:priority="240" />
+ android:description="@string/permgroupdesc_storage" />
<!-- Allows an application to read from external storage -->
<permission android:name="android.permission.READ_EXTERNAL_STORAGE"
@@ -930,44 +711,45 @@
android:description="@string/permdesc_mediaStorageWrite"
android:protectionLevel="signature|system" />
- <!-- ================================== -->
- <!-- Permissions for screenlock -->
- <!-- ================================== -->
+ <!-- ============================================ -->
+ <!-- Permissions for low-level system interaction -->
+ <!-- ============================================ -->
<eat-comment />
- <!-- Group of permissions that are related to the screenlock. -->
- <permission-group android:name="android.permission-group.SCREENLOCK"
- android:label="@string/permgrouplab_storage"
- android:icon="@drawable/perm_group_screenlock"
- android:permissionGroupFlags="personalInfo"
- android:description="@string/permgroupdesc_storage"
- android:priority="230" />
+ <!-- Group of permissions that are related to system APIs. Many
+ of these are not permissions the user will be expected to understand,
+ and such permissions should generally be marked as "normal" protection
+ level so they don't get displayed. This can also, however, be used
+ for miscellaneous features that provide access to the operating system,
+ such as writing the global system settings. -->
+ <permission-group android:name="android.permission-group.SYSTEM_TOOLS"
+ android:label="@string/permgrouplab_systemTools"
+ android:description="@string/permgroupdesc_systemTools" />
- <!-- Allows applications to disable the keyguard -->
- <permission android:name="android.permission.DISABLE_KEYGUARD"
- android:permissionGroup="android.permission-group.SCREENLOCK"
+ <!-- Allows an application to read or write the system settings. -->
+ <permission android:name="android.permission.WRITE_SETTINGS"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="dangerous"
- android:description="@string/permdesc_disableKeyguard"
- android:label="@string/permlab_disableKeyguard" />
+ android:label="@string/permlab_writeSettings"
+ android:description="@string/permdesc_writeSettings" />
- <!-- ================================== -->
- <!-- Permissions to access other installed applications -->
- <!-- ================================== -->
- <eat-comment />
+ <!-- Allows an application to modify the Google service map. -->
+ <permission android:name="android.permission.WRITE_GSERVICES"
+ android:protectionLevel="signature|system"
+ android:label="@string/permlab_writeGservices"
+ android:description="@string/permdesc_writeGservices" />
- <!-- Group of permissions that are related to the other applications
- installed on the system. Examples include such as listing
- running apps, or killing background processes. -->
- <permission-group android:name="android.permission-group.APP_INFO"
- android:label="@string/permgrouplab_appInfo"
- android:icon="@drawable/perm_group_app_info"
- android:description="@string/permgroupdesc_appInfo"
- android:priority="220" />
+ <!-- Allows an application to expand or collapse the status bar. -->
+ <permission android:name="android.permission.EXPAND_STATUS_BAR"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="normal"
+ android:label="@string/permlab_expandStatusBar"
+ android:description="@string/permdesc_expandStatusBar" />
<!-- Allows an application to get information about the currently
or recently running tasks. -->
<permission android:name="android.permission.GET_TASKS"
- android:permissionGroup="android.permission-group.APP_INFO"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="dangerous"
android:label="@string/permlab_getTasks"
android:description="@string/permdesc_getTasks" />
@@ -983,14 +765,14 @@
<!-- Allows an application to change the Z-order of tasks -->
<permission android:name="android.permission.REORDER_TASKS"
- android:permissionGroup="android.permission-group.APP_INFO"
- android:protectionLevel="normal"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
android:label="@string/permlab_reorderTasks"
android:description="@string/permdesc_reorderTasks" />
<!-- @hide Allows an application to change to remove/kill tasks -->
<permission android:name="android.permission.REMOVE_TASKS"
- android:permissionGroup="android.permission-group.APP_INFO"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="signature"
android:label="@string/permlab_removeTasks"
android:description="@string/permdesc_removeTasks" />
@@ -1003,10 +785,25 @@
android:label="@string/permlab_startAnyActivity"
android:description="@string/permdesc_startAnyActivity" />
+ <!-- @hide Change the screen compatibility mode of applications -->
+ <permission android:name="android.permission.SET_SCREEN_COMPATIBILITY"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="signature"
+ android:label="@string/permlab_setScreenCompatibility"
+ android:description="@string/permdesc_setScreenCompatibility" />
+
+ <!-- Allows an application to modify the current configuration, such
+ as locale. -->
+ <permission android:name="android.permission.CHANGE_CONFIGURATION"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_changeConfiguration"
+ android:description="@string/permdesc_changeConfiguration" />
+
<!-- @deprecated The {@link android.app.ActivityManager#restartPackage}
API is no longer supported. -->
<permission android:name="android.permission.RESTART_PACKAGES"
- android:permissionGroup="android.permission-group.APP_INFO"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_killBackgroundProcesses"
android:description="@string/permdesc_killBackgroundProcesses" />
@@ -1014,199 +811,11 @@
<!-- Allows an application to call
{@link android.app.ActivityManager#killBackgroundProcesses}. -->
<permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"
- android:permissionGroup="android.permission-group.APP_INFO"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
android:protectionLevel="normal"
android:label="@string/permlab_killBackgroundProcesses"
android:description="@string/permdesc_killBackgroundProcesses" />
- <!-- ================================== -->
- <!-- Permissions affecting the display of other applications -->
- <!-- ================================== -->
- <eat-comment />
-
- <!-- Group of permissions that allow manipulation of how
- another application displays UI to the user. -->
- <permission-group android:name="android.permission-group.DISPLAY"
- android:label="@string/permgrouplab_display"
- android:icon="@drawable/perm_group_display"
- android:description="@string/permgroupdesc_display"
- android:priority="190"/>
-
- <!-- Allows an application to open windows using the type
- {@link android.view.WindowManager.LayoutParams#TYPE_SYSTEM_ALERT},
- shown on top of all other applications. Very few applications
- should use this permission; these windows are intended for
- system-level interaction with the user. -->
- <permission android:name="android.permission.SYSTEM_ALERT_WINDOW"
- android:permissionGroup="android.permission-group.DISPLAY"
- android:protectionLevel="dangerous"
- android:label="@string/permlab_systemAlertWindow"
- android:description="@string/permdesc_systemAlertWindow" />
-
- <!-- ================================== -->
- <!-- Permissions affecting the system wallpaper -->
- <!-- ================================== -->
- <eat-comment />
-
- <!-- Group of permissions that allow manipulation of how
- another application displays UI to the user. -->
- <permission-group android:name="android.permission-group.WALLPAPER"
- android:label="@string/permgrouplab_wallpaper"
- android:icon="@drawable/perm_group_wallpaper"
- android:description="@string/permgroupdesc_wallpaper"
- android:priority="150" />
-
- <!-- Allows applications to set the wallpaper -->
- <permission android:name="android.permission.SET_WALLPAPER"
- android:permissionGroup="android.permission-group.WALLPAPER"
- android:protectionLevel="normal"
- android:label="@string/permlab_setWallpaper"
- android:description="@string/permdesc_setWallpaper" />
-
- <!-- Allows applications to set the wallpaper hints -->
- <permission android:name="android.permission.SET_WALLPAPER_HINTS"
- android:permissionGroup="android.permission-group.WALLPAPER"
- android:protectionLevel="normal"
- android:label="@string/permlab_setWallpaperHints"
- android:description="@string/permdesc_setWallpaperHints" />
-
- <!-- ============================================ -->
- <!-- Permissions for changing the system clock -->
- <!-- ============================================ -->
- <eat-comment />
-
- <!-- Group of permissions that are related to system clock. -->
- <permission-group android:name="android.permission-group.SYSTEM_CLOCK"
- android:label="@string/permgrouplab_systemClock"
- android:icon="@drawable/perm_group_system_clock"
- android:description="@string/permgroupdesc_systemClock"
- android:priority="140" />
-
- <!-- Allows applications to set the system time -->
- <permission android:name="android.permission.SET_TIME"
- android:protectionLevel="signature|system"
- android:label="@string/permlab_setTime"
- android:description="@string/permdesc_setTime" />
-
- <!-- Allows applications to set the system time zone -->
- <permission android:name="android.permission.SET_TIME_ZONE"
- android:permissionGroup="android.permission-group.SYSTEM_CLOCK"
- android:protectionLevel="normal"
- android:label="@string/permlab_setTimeZone"
- android:description="@string/permdesc_setTimeZone" />
-
- <!-- ==================================================== -->
- <!-- Permissions related to changing status bar -->
- <!-- ==================================================== -->
-
- <!-- Used for permissions that change the status bar -->
- <permission-group android:name="android.permission-group.STATUS_BAR"
- android:label="@string/permgrouplab_statusBar"
- android:icon="@drawable/perm_group_status_bar"
- android:description="@string/permgroupdesc_statusBar"
- android:priority="110" />
-
- <!-- Allows an application to expand or collapse the status bar. -->
- <permission android:name="android.permission.EXPAND_STATUS_BAR"
- android:permissionGroup="android.permission-group.STATUS_BAR"
- android:protectionLevel="normal"
- android:label="@string/permlab_expandStatusBar"
- android:description="@string/permdesc_expandStatusBar" />
-
- <!-- ==================================================== -->
- <!-- Permissions related to accessing sync settings -->
- <!-- ==================================================== -->
-
- <!-- Used for permissions that access the sync settings or sync
- related information. -->
- <permission-group android:name="android.permission-group.SYNC_SETTINGS"
- android:label="@string/permgrouplab_syncSettings"
- android:icon="@drawable/perm_group_sync_settings"
- android:description="@string/permgroupdesc_syncSettings"
- android:priority="120" />
-
- <!-- Allows applications to read the sync settings -->
- <permission android:name="android.permission.READ_SYNC_SETTINGS"
- android:permissionGroup="android.permission-group.SYNC_SETTINGS"
- android:protectionLevel="normal"
- android:description="@string/permdesc_readSyncSettings"
- android:label="@string/permlab_readSyncSettings" />
-
- <!-- Allows applications to write the sync settings -->
- <permission android:name="android.permission.WRITE_SYNC_SETTINGS"
- android:permissionGroup="android.permission-group.SYNC_SETTINGS"
- android:protectionLevel="normal"
- android:description="@string/permdesc_writeSyncSettings"
- android:label="@string/permlab_writeSyncSettings" />
-
- <!-- Allows applications to read the sync stats -->
- <permission android:name="android.permission.READ_SYNC_STATS"
- android:permissionGroup="android.permission-group.SYNC_SETTINGS"
- android:protectionLevel="normal"
- android:description="@string/permdesc_readSyncStats"
- android:label="@string/permlab_readSyncStats" />
-
-
- <!-- ============================================ -->
- <!-- Permissions for low-level system interaction -->
- <!-- ============================================ -->
- <eat-comment />
-
- <!-- Group of permissions that are related to system APIs. Many
- of these are not permissions the user will be expected to understand,
- and such permissions should generally be marked as "normal" protection
- level so they don't get displayed. This can also, however, be used
- for miscellaneous features that provide access to the operating system,
- such as writing the global system settings. -->
- <permission-group android:name="android.permission-group.SYSTEM_TOOLS"
- android:label="@string/permgrouplab_systemTools"
- android:icon="@drawable/perm_group_system_tools"
- android:description="@string/permgroupdesc_systemTools"
- android:priority="100" />
-
- <!-- @hide Change the screen compatibility mode of applications -->
- <permission android:name="android.permission.SET_SCREEN_COMPATIBILITY"
- android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="signature"
- android:label="@string/permlab_setScreenCompatibility"
- android:description="@string/permdesc_setScreenCompatibility" />
-
- <!-- Allows an application to modify the current configuration, such
- as locale. -->
- <permission android:name="android.permission.CHANGE_CONFIGURATION"
- android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="signature|system|development"
- android:label="@string/permlab_changeConfiguration"
- android:description="@string/permdesc_changeConfiguration" />
-
- <!-- Allows an application to read or write the system settings. -->
- <permission android:name="android.permission.WRITE_SETTINGS"
- android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="normal"
- android:label="@string/permlab_writeSettings"
- android:description="@string/permdesc_writeSettings" />
-
- <!-- Allows an application to modify the Google service map. -->
- <permission android:name="android.permission.WRITE_GSERVICES"
- android:protectionLevel="signature|system"
- android:label="@string/permlab_writeGservices"
- android:description="@string/permdesc_writeGservices" />
-
- <!-- @hide Change the screen compatibility mode of applications -->
- <permission android:name="android.permission.SET_SCREEN_COMPATIBILITY"
- android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="signature"
- android:label="@string/permlab_setScreenCompatibility"
- android:description="@string/permdesc_setScreenCompatibility" />
-
- <!-- Allows an application to modify the current configuration, such
- as locale. -->
- <permission android:name="android.permission.CHANGE_CONFIGURATION"
- android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="system|signature"
- android:label="@string/permlab_changeConfiguration"
- android:description="@string/permdesc_changeConfiguration" />
-
<!-- Allows an application to call
{@link android.app.ActivityManager#forceStopPackage}.
@hide -->
@@ -1224,6 +833,17 @@
android:label="@string/permlab_retrieve_window_content"
android:description="@string/permdesc_retrieve_window_content" />
+ <!-- Allows an application to open windows using the type
+ {@link android.view.WindowManager.LayoutParams#TYPE_SYSTEM_ALERT},
+ shown on top of all other applications. Very few applications
+ should use this permission; these windows are intended for
+ system-level interaction with the user. -->
+ <permission android:name="android.permission.SYSTEM_ALERT_WINDOW"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_systemAlertWindow"
+ android:description="@string/permdesc_systemAlertWindow" />
+
<!-- Modify the global animation scaling factor. -->
<permission android:name="android.permission.SET_ANIMATION_SCALE"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -1235,7 +855,7 @@
not use. Allow an application to make its activities persistent. -->
<permission android:name="android.permission.PERSISTENT_ACTIVITY"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="normal"
+ android:protectionLevel="dangerous"
android:label="@string/permlab_persistentActivity"
android:description="@string/permdesc_persistentActivity" />
@@ -1282,17 +902,52 @@
android:label="@string/permlab_broadcastSticky"
android:description="@string/permdesc_broadcastSticky" />
+ <!-- Allows using PowerManager WakeLocks to keep processor from sleeping or screen
+ from dimming -->
+ <permission android:name="android.permission.WAKE_LOCK"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_wakeLock"
+ android:description="@string/permdesc_wakeLock" />
+
+ <!-- Allows applications to set the wallpaper -->
+ <permission android:name="android.permission.SET_WALLPAPER"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="normal"
+ android:label="@string/permlab_setWallpaper"
+ android:description="@string/permdesc_setWallpaper" />
+
+ <!-- Allows applications to set the wallpaper hints -->
+ <permission android:name="android.permission.SET_WALLPAPER_HINTS"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="normal"
+ android:label="@string/permlab_setWallpaperHints"
+ android:description="@string/permdesc_setWallpaperHints" />
+
+ <!-- Allows applications to set the system time -->
+ <permission android:name="android.permission.SET_TIME"
+ android:protectionLevel="signature|system"
+ android:label="@string/permlab_setTime"
+ android:description="@string/permdesc_setTime" />
+
+ <!-- Allows applications to set the system time zone -->
+ <permission android:name="android.permission.SET_TIME_ZONE"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:label="@string/permlab_setTimeZone"
+ android:description="@string/permdesc_setTimeZone" />
+
<!-- Allows mounting and unmounting file systems for removable storage. -->
<permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="system|signature"
+ android:protectionLevel="dangerous"
android:label="@string/permlab_mount_unmount_filesystems"
android:description="@string/permdesc_mount_unmount_filesystems" />
<!-- Allows formatting file systems for removable storage. -->
<permission android:name="android.permission.MOUNT_FORMAT_FILESYSTEMS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="system|signature"
+ android:protectionLevel="dangerous"
android:label="@string/permlab_mount_format_filesystems"
android:description="@string/permdesc_mount_format_filesystems" />
@@ -1336,6 +991,34 @@
android:label="@string/permlab_asec_rename"
android:description="@string/permdesc_asec_rename" />
+ <!-- Allows applications to disable the keyguard -->
+ <permission android:name="android.permission.DISABLE_KEYGUARD"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:description="@string/permdesc_disableKeyguard"
+ android:label="@string/permlab_disableKeyguard" />
+
+ <!-- Allows applications to read the sync settings -->
+ <permission android:name="android.permission.READ_SYNC_SETTINGS"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="normal"
+ android:description="@string/permdesc_readSyncSettings"
+ android:label="@string/permlab_readSyncSettings" />
+
+ <!-- Allows applications to write the sync settings -->
+ <permission android:name="android.permission.WRITE_SYNC_SETTINGS"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:description="@string/permdesc_writeSyncSettings"
+ android:label="@string/permlab_writeSyncSettings" />
+
+ <!-- Allows applications to read the sync stats -->
+ <permission android:name="android.permission.READ_SYNC_STATS"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="normal"
+ android:description="@string/permdesc_readSyncStats"
+ android:label="@string/permlab_readSyncStats" />
+
<!-- Allows applications to write the apn settings -->
<permission android:name="android.permission.WRITE_APN_SETTINGS"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
@@ -1359,10 +1042,41 @@
<!-- Allows applications to change network connectivity state -->
<permission android:name="android.permission.CHANGE_NETWORK_STATE"
android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
- android:protectionLevel="normal"
+ android:protectionLevel="dangerous"
android:description="@string/permdesc_changeNetworkState"
android:label="@string/permlab_changeNetworkState" />
+ <!-- Allows applications to change Wi-Fi connectivity state -->
+ <permission android:name="android.permission.CHANGE_WIFI_STATE"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:description="@string/permdesc_changeWifiState"
+ android:label="@string/permlab_changeWifiState" />
+
+
+ <!-- @hide -->
+ <permission android:name="android.permission.CHANGE_WIMAX_STATE"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:description="@string/permdesc_changeWimaxState"
+ android:label="@string/permlab_changeWimaxState" />
+
+
+
+ <!-- Allows applications to enter Wi-Fi Multicast mode -->
+ <permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:description="@string/permdesc_changeWifiMulticastState"
+ android:label="@string/permlab_changeWifiMulticastState" />
+
+ <!-- Allows applications to discover and pair bluetooth devices -->
+ <permission android:name="android.permission.BLUETOOTH_ADMIN"
+ android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
+ android:protectionLevel="dangerous"
+ android:description="@string/permdesc_bluetoothAdmin"
+ android:label="@string/permlab_bluetoothAdmin" />
+
<!-- Allows an application to clear the caches of all installed
applications on the device. -->
<permission android:name="android.permission.CLEAR_APP_CACHE"
@@ -1389,8 +1103,7 @@
purposes. -->
<permission-group android:name="android.permission-group.DEVELOPMENT_TOOLS"
android:label="@string/permgrouplab_developmentTools"
- android:description="@string/permgroupdesc_developmentTools"
- android:priority="310" />
+ android:description="@string/permgroupdesc_developmentTools" />
<!-- Allows an application to read or write the secure system settings. -->
<permission android:name="android.permission.WRITE_SECURE_SETTINGS"
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png
index bf3cabb..7efb94f 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo1.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png
index c4f00be..00e6879 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo2.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png
index 935e44f..3ffcd68 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo3.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png
index 03ae28b..a5e94f7 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo4.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png
index b68981f..dfdeba3 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo5.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png
index 678b772..5b02b13 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo6.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png
index 0aeb0a6..815f31b 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo7.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png
index 1bd7312..936794c 100644
--- a/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png
+++ b/core/res/res/drawable-hdpi/progressbar_indeterminate_holo8.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png
index 1e5d956..5a9dec3 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo1.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png
index d0c0200..184b280 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo2.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png
index bfdc5ea..96f0644 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo3.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png
index 1440bc8..2393a2c 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo4.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png
index 4f645fa8..4c1d60d 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo5.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png
index 21966fd..cb89d16 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo6.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png
index 7ca15ed..a4f843a 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo7.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png
index 369d0ac..ea1ee05 100644
--- a/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png
+++ b/core/res/res/drawable-mdpi/progressbar_indeterminate_holo8.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo1.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo1.png
index ca24502..f541e32 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo1.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo1.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo2.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo2.png
index 5653118..4c3f686 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo2.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo2.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo3.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo3.png
index 438b1b5..42ccc49 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo3.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo3.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo4.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo4.png
index efe3fed..e5f0cd3 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo4.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo4.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo5.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo5.png
index cb7931c..415494b 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo5.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo5.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo6.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo6.png
index 8ff7ee9..297d7b7 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo6.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo6.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo7.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo7.png
index ce07298..ba152f2 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo7.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo7.png
Binary files differ
diff --git a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo8.png b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo8.png
index 87e9d8f..b996b94 100644
--- a/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo8.png
+++ b/core/res/res/drawable-xhdpi/progressbar_indeterminate_holo8.png
Binary files differ
diff --git a/core/res/res/layout/app_permission_item.xml b/core/res/res/layout/app_permission_item.xml
index c448bd1..1bd267f 100644
--- a/core/res/res/layout/app_permission_item.xml
+++ b/core/res/res/layout/app_permission_item.xml
@@ -19,33 +19,37 @@
Contains the group name and a list of permission labels under the group.
-->
-<view class="android.widget.AppSecurityPermissions$PermissionItemView"
+<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:background="?android:attr/selectableItemBackground">
+ android:layout_height="wrap_content">
<ImageView
android:id="@+id/perm_icon"
- android:layout_width="32dp"
- android:layout_height="32dp"
- android:layout_marginLeft="16dp"
- android:layout_marginRight="8dp"
+ android:layout_width="30dip"
+ android:layout_height="30dip"
+ android:layout_alignParentLeft="true"
android:scaleType="fitCenter" />
- <ImageView
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:background="?android:attr/dividerVertical" />
<TextView
- android:id="@+id/perm_name"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textSize="16sp"
- android:layout_marginLeft="8dp"
+ android:id="@+id/permission_group"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textStyle="bold"
+ android:paddingLeft="6dip"
+ android:layout_toRightOf="@id/perm_icon"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="top|left" />
+ android:layout_height="wrap_content" />
-</view>
+ <TextView
+ android:id="@+id/permission_list"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:layout_marginTop="-4dip"
+ android:paddingBottom="8dip"
+ android:paddingLeft="6dip"
+ android:layout_below="@id/permission_group"
+ android:layout_toRightOf="@id/perm_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+</RelativeLayout>
diff --git a/core/res/res/layout/app_perms_summary.xml b/core/res/res/layout/app_perms_summary.xml
index 509c502..3f99dde 100755
--- a/core/res/res/layout/app_perms_summary.xml
+++ b/core/res/res/layout/app_perms_summary.xml
@@ -26,17 +26,79 @@
android:id="@+id/no_permissions"
android:text="@string/no_permissions"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:paddingLeft="8dp"
- android:paddingRight="8dp"
+ android:paddingLeft="16dip"
+ android:paddingRight="12dip"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
- <!-- Populated with all permissions. -->
+ <!-- List view containing list of dangerous permissions categorized by groups. -->
<LinearLayout
- android:id="@+id/perms_list"
+ android:id="@+id/dangerous_perms_list"
android:orientation="vertical"
android:layout_width="match_parent"
+ android:paddingLeft="16dip"
+ android:paddingRight="12dip"
+ android:layout_height="wrap_content" />
+
+ <!-- Clickable area letting user display additional permissions. -->
+ <LinearLayout
+ android:id="@+id/show_more"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:layout_marginTop="12dip"
+ android:layout_marginBottom="16dip">
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:background="?android:attr/listDivider" />
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16dip"
+ android:paddingBottom="12dip"
+ android:paddingLeft="16dip"
+ android:duplicateParentState="true"
+ android:background="?android:attr/selectableItemBackground">
+
+ <TextView
+ android:id="@+id/show_more_text"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:duplicateParentState="true"
+ android:layout_alignTop="@+id/show_more_icon"
+ android:layout_gravity="center_vertical"
+ android:paddingLeft="36dip"
+ android:layout_weight="1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <ImageView
+ android:id="@id/show_more_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginRight="12dip" />
+
+ </LinearLayout>
+
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:background="?android:attr/listDivider" />
+
+ </LinearLayout>
+
+ <!-- List view containing list of permissions that aren't dangerous. -->
+ <LinearLayout
+ android:id="@+id/non_dangerous_perms_list"
+ android:orientation="vertical"
+ android:paddingLeft="16dip"
+ android:paddingRight="12dip"
+ android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index f24733c..f971d39 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -199,7 +199,7 @@
<flag name="development" value="0x20" />
</attr>
- <!-- Flags indicating more context for a permission group. -->
+ <!-- Flags indicating more context for a permission group. @hide -->
<attr name="permissionGroupFlags">
<!-- Set to indicate that this permission group contains permissions
protecting access to some information that is considered
@@ -903,7 +903,6 @@
<attr name="icon" />
<attr name="logo" />
<attr name="description" />
- <attr name="permissionGroupFlags" />
<attr name="priority" />
</declare-styleable>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index bf9fe42..51be22d 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -123,9 +123,12 @@
<java-symbol type="id" name="package_label" />
<java-symbol type="id" name="packages_list" />
<java-symbol type="id" name="pause" />
- <java-symbol type="id" name="perms_list" />
+ <java-symbol type="id" name="show_more" />
<java-symbol type="id" name="perm_icon" />
- <java-symbol type="id" name="perm_name" />
+ <java-symbol type="id" name="show_more_icon" />
+ <java-symbol type="id" name="show_more_text" />
+ <java-symbol type="id" name="dangerous_perms_list" />
+ <java-symbol type="id" name="non_dangerous_perms_list" />
<java-symbol type="id" name="permission_group" />
<java-symbol type="id" name="permission_list" />
<java-symbol type="id" name="pickers" />
@@ -660,6 +663,10 @@
<java-symbol type="string" name="passwordIncorrect" />
<java-symbol type="string" name="perms_description_app" />
<java-symbol type="string" name="perms_new_perm_prefix" />
+ <java-symbol type="string" name="perms_hide" />
+ <java-symbol type="string" name="perms_show_all" />
+ <java-symbol type="string" name="default_permission_group" />
+ <java-symbol type="string" name="permissions_format" />
<java-symbol type="string" name="petabyteShort" />
<java-symbol type="string" name="phoneTypeAssistant" />
<java-symbol type="string" name="phoneTypeCallback" />
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 2b966f6..21efe4e 100755
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -390,12 +390,11 @@
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permgrouplab_personalInfo">Your personal information</string>
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_personalInfo">Direct access to information about you, stored in on your contact card.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_socialInfo">Your social information</string>
+ <string name="permgroupdesc_personalInfo" product="tablet">Direct access to your contacts
+ and calendar stored on the tablet.</string>
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_socialInfo">Direct access to information about your contacts and social connections.</string>
+ <string name="permgroupdesc_personalInfo" product="default">Direct access to your contacts
+ and calendar stored on the phone.</string>
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permgrouplab_location">Your location</string>
@@ -408,91 +407,6 @@
<string name="permgroupdesc_network">Access various network features.</string>
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_bluetoothNetwork">Bluetooth</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_bluetoothNetwork">Access devices and networks through Bluetooth.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_shortrangeNetwork">Short-range Networks</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_shortrangeNetwork">Access devices through short-range networks such as NFC.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_audioSettings">Audio Settings</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_audioSettings">Change audio settings.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_affectsBattery">Affects Battery</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_affectsBattery">Use features that can quickly drain battery.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_calendar">Calendar</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_calendar">Direct access to calendar and events.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_dictionary">Read User Dictionary</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_dictionary">Read words in user dictionary.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_writeDictionary">Write User Dictionary</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_writeDictionary">Add words to the user dictionary.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_bookmarks">Bookmarks and History</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_bookmarks">Direct access to bookmarks and browser history.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_deviceAlarms">Alarm</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_deviceAlarms">Set the alarm clock.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_voicemail">Voicemail</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_voicemail">Direct access to voicemail.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_microphone">Microphone</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_microphone">Direct access to the microphone to record audio.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_camera">Camera</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_camera">Direct access to camera for image or video capture.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_appInfo">Your applications information</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_appInfo">Ability to affect behavior of other applications on your device.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_wallpaper">Wallpaper</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_wallpaper">Change the device wallpaper settings.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_systemClock">Clock</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_systemClock">Change the device time or timezone.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_statusBar">Status Bar</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_statusBar">Change the device status bar settings.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_syncSettings">Sync Settings</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_syncSettings">Access to the sync settings.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permgrouplab_accounts">Your accounts</string>
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permgroupdesc_accounts">Access the available accounts.</string>
@@ -518,11 +432,6 @@
<string name="permgroupdesc_developmentTools">Features only needed for app developers.</string>
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgrouplab_display">Other Application UI</string>
- <!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permgroupdesc_display">Effect the UI of other applications.</string>
-
- <!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permgrouplab_storage">Storage</string>
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=30] -->
<string name="permgroupdesc_storage" product="nosdcard">Access the USB storage.</string>
@@ -630,7 +539,7 @@
<string name="permlab_getTasks">retrieve running apps</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_getTasks">Allows the app to retrieve
- information about currently and recently running tasks. Malicious apps may
+ information about currently and recently running tasks. Malicious apps may
discover private information about other apps.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=50] -->
@@ -781,7 +690,7 @@
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_batteryStats">modify battery statistics</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
- <string name="permdesc_batteryStats">Allows the app to modify
+ <string name="permdesc_batteryStats">Allows the app to modify
collected battery statistics. Not for use by normal apps.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
@@ -1142,18 +1051,18 @@
<string name="permlab_readCalendar">read calendar events plus confidential information</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_readCalendar" product="tablet">Allows the app to read all calendar
- events stored on your tablet, including those of friends or coworkers. Malicious apps
+ events stored on your tablet, including those of friends or coworkers. Malicious apps
may extract personal information from these calendars without the owners\' knowledge.</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_readCalendar" product="default">Allows the app to read all calendar
- events stored on your phone, including those of friends or coworkers. Malicious apps
+ events stored on your phone, including those of friends or coworkers. Malicious apps
may extract personal information from these calendars without the owners\' knowledge.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_writeCalendar">add or modify calendar events and send email to guests without owners\' knowledge</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permdesc_writeCalendar">Allows the app to send event invitations as the calendar owner and add, remove,
- change events that you can modify on your device, including those of friends or co-workers. Malicious apps
+ change events that you can modify on your device, including those of friends or co-workers. Malicious apps
may send spam emails that appear to come from calendar owners, modify events without the owners\' knowledge, or add fake events.</string>
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
@@ -3010,13 +2919,23 @@
<!-- Name of the button in the date/time picker to accept the date/time change -->
<string name="date_time_done">Done</string>
- <!-- Security Permissions strings-->
+ <!-- Security Permissions strings (old)-->
+ <!-- The default permission group for any permissions that have not explicitly set a group. -->
+ <string name="default_permission_group">Default</string>
+ <!-- Do not translate. -->
+ <string name="permissions_format"><xliff:g id="perm_line1">%1$s</xliff:g>, <xliff:g id="perm_line2">%2$s</xliff:g></string>
+ <!-- Shown for an application when it doesn't require any permission grants. -->
+ <string name="no_permissions">No permissions required</string>
+ <!-- When installing an application, the less-dangerous permissions are hidden. If the user showed those, this is the text to hide them again. -->
+ <string name="perms_hide"><b>Hide</b></string>
+ <!-- When installing an application, the less-dangerous permissions are hidden. This is the text to show those. -->
+ <string name="perms_show_all"><b>Show all</b></string>
+
+ <!-- Security Permissions strings (new)-->
<!-- Text that is placed at the front of a permission name that is being added to an app [CHAR LIMIT=NONE] -->
<string name="perms_new_perm_prefix"><font size="12" fgcolor="#ff900000">NEW: </font></string>
<!-- Text that is placed at the front of a permission name that is being added to an app [CHAR LIMIT=NONE] -->
<string name="perms_description_app">Provided by <xliff:g id="app_name">%1$s</xliff:g>.</string>
- <!-- Shown for an application when it doesn't require any permission grants. -->
- <string name="no_permissions">No permissions required</string>
<!-- USB storage dialog strings -->
<!-- This is the title for the activity's window. -->
diff --git a/packages/FakeOemFeatures/Android.mk b/packages/FakeOemFeatures/Android.mk
index b0b0eeb..d96bb3d 100644
--- a/packages/FakeOemFeatures/Android.mk
+++ b/packages/FakeOemFeatures/Android.mk
@@ -1,7 +1,7 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := debug
+LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index 8795154..c09e4c4 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -188,10 +188,16 @@
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("image/png");
sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
- sharingIntent.setFlags(Intent.FLAG_ACTIVITY_CLOSE_SYSTEM_DIALOGS);
+
+ Intent chooserIntent = Intent.createChooser(sharingIntent, null);
+ chooserIntent.addFlags(Intent.FLAG_ACTIVITY_CLOSE_SYSTEM_DIALOGS
+ | Intent.FLAG_ACTIVITY_CLEAR_TASK
+ | Intent.FLAG_ACTIVITY_NEW_TASK);
+
mNotificationBuilder.addAction(R.drawable.ic_menu_share,
r.getString(com.android.internal.R.string.share),
- PendingIntent.getActivity(context, 0, sharingIntent, 0));
+ PendingIntent.getActivity(context, 0, chooserIntent,
+ PendingIntent.FLAG_CANCEL_CURRENT));
OutputStream out = resolver.openOutputStream(uri);
image.compress(Bitmap.CompressFormat.PNG, 100, out);
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index 52ba665..f6d3b608 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -494,10 +494,11 @@
String action = intent.getAction();
boolean queryRestart = false;
+ boolean packageChanged = false;
if (action.equals(Intent.ACTION_PACKAGE_REMOVED)
|| action.equals(Intent.ACTION_PACKAGE_RESTARTED)
- || action.equals(Intent.ACTION_PACKAGE_CHANGED)
+ || (packageChanged=action.equals(Intent.ACTION_PACKAGE_CHANGED))
|| (queryRestart=action.equals(Intent.ACTION_QUERY_PACKAGE_RESTART))
|| action.equals(Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE)) {
String pkgList[] = null;
@@ -514,6 +515,15 @@
if (pkgName == null) {
return;
}
+ if (packageChanged) {
+ // We cancel notifications for packages which have just been disabled
+ final int enabled = mContext.getPackageManager()
+ .getApplicationEnabledSetting(pkgName);
+ if (enabled == PackageManager.COMPONENT_ENABLED_STATE_ENABLED
+ || enabled == PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) {
+ return;
+ }
+ }
pkgList = new String[]{pkgName};
}
if (pkgList != null && (pkgList.length > 0)) {
diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java
index 4c38ab9..67bdabd 100644
--- a/services/java/com/android/server/accessibility/TouchExplorer.java
+++ b/services/java/com/android/server/accessibility/TouchExplorer.java
@@ -1247,25 +1247,45 @@
@Override
public void run() {
- final int pointerIndex = mEvent.getActionIndex();
+ // If the last touched explored location is not within the focused
+ // window we will long press at that exact spot, otherwise we find the
+ // accessibility focus and if the tap is within its bounds we long press
+ // there, otherwise we pick the middle of the focus rectangle.
+ MotionEvent lastEvent = mInjectedPointerTracker.getLastInjectedHoverEvent();
+ if (lastEvent == null) {
+ return;
+ }
+
+ final int exploreLocationX = (int) lastEvent.getX(lastEvent.getActionIndex());
+ final int exploreLocationY = (int) lastEvent.getY(lastEvent.getActionIndex());
+
+ Rect bounds = mTempRect;
+ boolean useFocusedBounds = false;
+
+ final int pointerId = mEvent.getPointerId(mEvent.getActionIndex());
+ final int pointerIndex = mEvent.findPointerIndex(pointerId);
+ if (mAms.getAccessibilityFocusBounds(exploreLocationX, exploreLocationY, bounds)) {
+ // If the user's last touch explored location is not
+ // within the accessibility focus bounds we use the center
+ // of the accessibility focused rectangle.
+ if (!bounds.contains((int) mEvent.getX(pointerIndex),
+ (int) mEvent.getY(pointerIndex))) {
+ useFocusedBounds = true;
+ }
+ }
+
+ mLongPressingPointerId = mEvent.getPointerId(pointerIndex);
+
final int eventX = (int) mEvent.getX(pointerIndex);
final int eventY = (int) mEvent.getY(pointerIndex);
- Rect bounds = mTempRect;
- if (mAms.getAccessibilityFocusBounds(eventX, eventY, bounds)
- && !bounds.contains(eventX, eventY)) {
- mLongPressingPointerId = mEvent.getPointerId(pointerIndex);
+ if (useFocusedBounds) {
mLongPressingPointerDeltaX = eventX - bounds.centerX();
mLongPressingPointerDeltaY = eventY - bounds.centerY();
} else {
- mLongPressingPointerId = -1;
- mLongPressingPointerDeltaX = 0;
- mLongPressingPointerDeltaY = 0;
+ mLongPressingPointerDeltaX = eventX - exploreLocationX;
+ mLongPressingPointerDeltaY = eventY - exploreLocationY;
}
- // We are sending events so send exit and gesture
- // end since we transition to another state.
- final int pointerId = mReceivedPointerTracker.getPrimaryActivePointerId();
- final int pointerIdBits = (1 << pointerId);
- mAms.touchExplorationGestureEnded();
+
sendExitEventsIfNeeded(mPolicyFlags);
mCurrentState = STATE_DELEGATING;
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
index c800182..806730c 100644
--- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java
+++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java
@@ -897,7 +897,11 @@
break;
case WifiMonitor.P2P_DEVICE_LOST_EVENT:
WifiP2pDevice device = (WifiP2pDevice) message.obj;
- if (!mSavedPeerConfig.deviceAddress.equals(device.deviceAddress)) {
+
+ // If we lose a device during an autonomous group creation,
+ // mSavedPeerConfig can be empty
+ if (mSavedPeerConfig != null &&
+ !mSavedPeerConfig.deviceAddress.equals(device.deviceAddress)) {
// Do the regular device lost handling
ret = NOT_HANDLED;
break;