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();
|
mActivityCombo.removeAll();
|
||||||
|
|
||||||
for (Activity activity : activities) {
|
for (Activity activity : activities) {
|
||||||
if (activity.getExported() && activity.hasAction()) {
|
if (activity.isExported() && activity.hasAction()) {
|
||||||
mActivities.add(activity);
|
mActivities.add(activity);
|
||||||
mActivityCombo.add(activity.getName());
|
mActivityCombo.add(activity.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,22 +110,22 @@ public class AndroidManifestParser {
|
|||||||
*/
|
*/
|
||||||
public static class Activity {
|
public static class Activity {
|
||||||
private final String mName;
|
private final String mName;
|
||||||
private final boolean mExported;
|
private final boolean mIsExported;
|
||||||
private boolean mHasAction = false;
|
private boolean mHasAction = false;
|
||||||
private boolean mHasMainAction = false;
|
private boolean mHasMainAction = false;
|
||||||
private boolean mHasLauncherCategory = false;
|
private boolean mHasLauncherCategory = false;
|
||||||
|
|
||||||
public Activity(String name, boolean exported) {
|
public Activity(String name, boolean exported) {
|
||||||
mName = name;
|
mName = name;
|
||||||
mExported = exported;
|
mIsExported = exported;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return mName;
|
return mName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getExported() {
|
public boolean isExported() {
|
||||||
return mExported;
|
return mIsExported;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAction() {
|
public boolean hasAction() {
|
||||||
@@ -430,7 +430,10 @@ public class AndroidManifestParser {
|
|||||||
case LEVEL_INTENT_FILTER:
|
case LEVEL_INTENT_FILTER:
|
||||||
// if we found both a main action and a launcher category, this is our
|
// if we found both a main action and a launcher category, this is our
|
||||||
// launcher activity!
|
// launcher activity!
|
||||||
if (mCurrentActivity != null && mCurrentActivity.isHomeActivity()) {
|
if (mLauncherActivity == null &&
|
||||||
|
mCurrentActivity != null &&
|
||||||
|
mCurrentActivity.isHomeActivity() &&
|
||||||
|
mCurrentActivity.isExported()) {
|
||||||
mLauncherActivity = mCurrentActivity;
|
mLauncherActivity = mCurrentActivity;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user