* commit 'c9e94ea6451958fce107580b54c183181de6aa22': Fix issue #7213113: Remove old intent resolver
This commit is contained in:
@@ -257,7 +257,7 @@ public class AppSecurityPermissions {
|
|||||||
try {
|
try {
|
||||||
pkgInfo = mPm.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS);
|
pkgInfo = mPm.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS);
|
||||||
} catch (NameNotFoundException e) {
|
} catch (NameNotFoundException e) {
|
||||||
Log.w(TAG, "Could'nt retrieve permissions for package:"+packageName);
|
Log.w(TAG, "Couldn't retrieve permissions for package:"+packageName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Extract all user permissions
|
// Extract all user permissions
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
<protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_VERIFICATION" />
|
<protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_VERIFICATION" />
|
||||||
<protected-broadcast android:name="android.intent.action.PACKAGE_VERIFIED" />
|
<protected-broadcast android:name="android.intent.action.PACKAGE_VERIFIED" />
|
||||||
<protected-broadcast android:name="android.intent.action.UID_REMOVED" />
|
<protected-broadcast android:name="android.intent.action.UID_REMOVED" />
|
||||||
|
<protected-broadcast android:name="android.intent.action.QUERY_PACKAGE_RESTART" />
|
||||||
<protected-broadcast android:name="android.intent.action.CONFIGURATION_CHANGED" />
|
<protected-broadcast android:name="android.intent.action.CONFIGURATION_CHANGED" />
|
||||||
<protected-broadcast android:name="android.intent.action.LOCALE_CHANGED" />
|
<protected-broadcast android:name="android.intent.action.LOCALE_CHANGED" />
|
||||||
<protected-broadcast android:name="android.intent.action.BATTERY_CHANGED" />
|
<protected-broadcast android:name="android.intent.action.BATTERY_CHANGED" />
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
|
|||||||
final private static String TAG = "IntentResolver";
|
final private static String TAG = "IntentResolver";
|
||||||
final private static boolean DEBUG = false;
|
final private static boolean DEBUG = false;
|
||||||
final private static boolean localLOGV = DEBUG || false;
|
final private static boolean localLOGV = DEBUG || false;
|
||||||
|
final private static boolean VALIDATE = false;
|
||||||
|
|
||||||
public void addFilter(F f) {
|
public void addFilter(F f) {
|
||||||
if (localLOGV) {
|
if (localLOGV) {
|
||||||
@@ -67,16 +68,20 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
|
|||||||
mTypedActionToFilter, " TypedAction: ");
|
mTypedActionToFilter, " TypedAction: ");
|
||||||
}
|
}
|
||||||
|
|
||||||
mOldResolver.addFilter(f);
|
if (VALIDATE) {
|
||||||
verifyDataStructures(f);
|
mOldResolver.addFilter(f);
|
||||||
|
verifyDataStructures(f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeFilter(F f) {
|
public void removeFilter(F f) {
|
||||||
removeFilterInternal(f);
|
removeFilterInternal(f);
|
||||||
mFilters.remove(f);
|
mFilters.remove(f);
|
||||||
|
|
||||||
mOldResolver.removeFilter(f);
|
if (VALIDATE) {
|
||||||
verifyDataStructures(f);
|
mOldResolver.removeFilter(f);
|
||||||
|
verifyDataStructures(f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void removeFilterInternal(F f) {
|
void removeFilterInternal(F f) {
|
||||||
@@ -314,12 +319,14 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
|
|||||||
}
|
}
|
||||||
sortResults(finalList);
|
sortResults(finalList);
|
||||||
|
|
||||||
List<R> oldList = mOldResolver.queryIntent(intent, resolvedType, defaultOnly, userId);
|
if (VALIDATE) {
|
||||||
if (oldList.size() != finalList.size()) {
|
List<R> oldList = mOldResolver.queryIntent(intent, resolvedType, defaultOnly, userId);
|
||||||
ValidationFailure here = new ValidationFailure();
|
if (oldList.size() != finalList.size()) {
|
||||||
here.fillInStackTrace();
|
ValidationFailure here = new ValidationFailure();
|
||||||
Log.wtf(TAG, "Query result " + intent + " size is " + finalList.size()
|
here.fillInStackTrace();
|
||||||
+ "; old implementation is " + oldList.size(), here);
|
Log.wtf(TAG, "Query result " + intent + " size is " + finalList.size()
|
||||||
|
+ "; old implementation is " + oldList.size(), here);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
|
|||||||
Reference in New Issue
Block a user