Fix control flow bug in preference controller
BUG: 118908907 Test: manual Change-Id: I5300309a13833e278902c75090c9f7de43d6e2b7
This commit is contained in:
@@ -86,12 +86,10 @@ public class LocationFooterPreferenceController extends LocationBasePreferenceCo
|
|||||||
.getResourcesForApplication(data.applicationInfo)
|
.getResourcesForApplication(data.applicationInfo)
|
||||||
.getString(data.footerStringRes);
|
.getString(data.footerStringRes);
|
||||||
} catch (NameNotFoundException exception) {
|
} catch (NameNotFoundException exception) {
|
||||||
if (Log.isLoggable(TAG, Log.WARN)) {
|
Log.w(
|
||||||
Log.w(
|
TAG,
|
||||||
TAG,
|
"Resources not found for application "
|
||||||
"Resources not found for application "
|
+ data.applicationInfo.packageName);
|
||||||
+ data.applicationInfo.packageName);
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
footerPreference.setTitle(footerString);
|
footerPreference.setTitle(footerString);
|
||||||
@@ -152,11 +150,11 @@ public class LocationFooterPreferenceController extends LocationBasePreferenceCo
|
|||||||
mPackageManager.queryBroadcastReceivers(
|
mPackageManager.queryBroadcastReceivers(
|
||||||
INJECT_INTENT, PackageManager.GET_META_DATA);
|
INJECT_INTENT, PackageManager.GET_META_DATA);
|
||||||
if (resolveInfos == null) {
|
if (resolveInfos == null) {
|
||||||
if (Log.isLoggable(TAG, Log.ERROR)) {
|
Log.e(TAG, "Unable to resolve intent " + INJECT_INTENT);
|
||||||
Log.e(TAG, "Unable to resolve intent " + INJECT_INTENT);
|
return Collections.emptyList();
|
||||||
return Collections.emptyList();
|
}
|
||||||
}
|
|
||||||
} else if (Log.isLoggable(TAG, Log.DEBUG)) {
|
if (Log.isLoggable(TAG, Log.DEBUG)) {
|
||||||
Log.d(TAG, "Found broadcast receivers: " + resolveInfos);
|
Log.d(TAG, "Found broadcast receivers: " + resolveInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,30 +165,26 @@ public class LocationFooterPreferenceController extends LocationBasePreferenceCo
|
|||||||
|
|
||||||
// If a non-system app tries to inject footer, ignore it
|
// If a non-system app tries to inject footer, ignore it
|
||||||
if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
|
if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
|
||||||
if (Log.isLoggable(TAG, Log.WARN)) {
|
Log.w(TAG, "Ignoring attempt to inject footer from app not in system image: "
|
||||||
Log.w(TAG, "Ignoring attempt to inject footer from app not in system image: "
|
+ resolveInfo);
|
||||||
+ resolveInfo);
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the footer text resource id from broadcast receiver's metadata
|
// Get the footer text resource id from broadcast receiver's metadata
|
||||||
if (activityInfo.metaData == null) {
|
if (activityInfo.metaData == null) {
|
||||||
if (Log.isLoggable(TAG, Log.DEBUG)) {
|
if (Log.isLoggable(TAG, Log.DEBUG)) {
|
||||||
Log.d(TAG, "No METADATA in broadcast receiver " + activityInfo.name);
|
Log.d(TAG, "No METADATA in broadcast receiver " + activityInfo.name);
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int footerTextRes =
|
final int footerTextRes =
|
||||||
activityInfo.metaData.getInt(LocationManager.METADATA_SETTINGS_FOOTER_STRING);
|
activityInfo.metaData.getInt(LocationManager.METADATA_SETTINGS_FOOTER_STRING);
|
||||||
if (footerTextRes == 0) {
|
if (footerTextRes == 0) {
|
||||||
if (Log.isLoggable(TAG, Log.WARN)) {
|
Log.w(
|
||||||
Log.w(
|
TAG,
|
||||||
TAG,
|
"No mapping of integer exists for "
|
||||||
"No mapping of integer exists for "
|
+ LocationManager.METADATA_SETTINGS_FOOTER_STRING);
|
||||||
+ LocationManager.METADATA_SETTINGS_FOOTER_STRING);
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
footerDataList.add(
|
footerDataList.add(
|
||||||
|
Reference in New Issue
Block a user