AI 146848: am: CL 146847 am: CL 146845 Fix detecting "home" activities when parsing the Android Manifest
Original author: xav Merged from: //branches/cupcake/... Original author: android-build Automated import of CL 146848
This commit is contained in:
committed by
The Android Open Source Project
parent
03a7e70160
commit
8317a67c2e
@@ -414,7 +414,7 @@ public class MainLaunchConfigTab extends AbstractLaunchConfigurationTab {
|
||||
mActivityCombo.removeAll();
|
||||
|
||||
for (Activity activity : activities) {
|
||||
if (activity.getExported() && activity.hasAction()) {
|
||||
if (activity.isExported() && activity.hasAction()) {
|
||||
mActivities.add(activity);
|
||||
mActivityCombo.add(activity.getName());
|
||||
}
|
||||
|
||||
@@ -110,22 +110,22 @@ public class AndroidManifestParser {
|
||||
*/
|
||||
public static class Activity {
|
||||
private final String mName;
|
||||
private final boolean mExported;
|
||||
private final boolean mIsExported;
|
||||
private boolean mHasAction = false;
|
||||
private boolean mHasMainAction = false;
|
||||
private boolean mHasLauncherCategory = false;
|
||||
|
||||
public Activity(String name, boolean exported) {
|
||||
mName = name;
|
||||
mExported = exported;
|
||||
mIsExported = exported;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return mName;
|
||||
}
|
||||
|
||||
public boolean getExported() {
|
||||
return mExported;
|
||||
public boolean isExported() {
|
||||
return mIsExported;
|
||||
}
|
||||
|
||||
public boolean hasAction() {
|
||||
@@ -430,7 +430,10 @@ public class AndroidManifestParser {
|
||||
case LEVEL_INTENT_FILTER:
|
||||
// if we found both a main action and a launcher category, this is our
|
||||
// launcher activity!
|
||||
if (mCurrentActivity != null && mCurrentActivity.isHomeActivity()) {
|
||||
if (mLauncherActivity == null &&
|
||||
mCurrentActivity != null &&
|
||||
mCurrentActivity.isHomeActivity() &&
|
||||
mCurrentActivity.isExported()) {
|
||||
mLauncherActivity = mCurrentActivity;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user