title: Having <activity-alias> breaks a contract of singleTop mode
body: <p>Here's the problem. I have an &lt;activity-alias> in my manifest defined as follows:</p>
  
  <pre><code>&lt;activity
      android:name=".HomeActivity"/&gt;
  
  &lt;activity-alias
      android:name=".MainActivity"
      android:targetActivity=".HomeActivity"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.MAIN" /&gt;
          &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
      &lt;/intent-filter&gt;
  &lt;/activity-alias&gt;
  </code></pre>
  
  <p>Now, user starts <code>MainActivity</code> using a launcher icon, it forwards to the <code>HomeActivity</code>.</p>
  
  <p>I also have an Intent to start <code>HomeActivity</code> from the navigation drawer. It is started with <code>Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP</code> flags - to reuse existing instance of activity.</p>
  
  <p>The problem is that this does not work as intended and it actually creates a new instance of <code>HomeActivity</code> (even though it is currently on top and visible!).
  This happens because an activity backstack contains an entry for <code>.MainActivity</code>, not the <code>HomeActivity</code> it forwarded to in the end.</p>
  
  <p><strong>Question:</strong> I suspect this might or might not be the bug in Android, but I have a difficult time of figuring out a decent workaround.  Asking for help here! :) </p>
  
  <p>I need only single activity started, and when user selects an item in navdrawer, that single activity should get onNewIntent(), not the new activity spawning!</p>
  
  <p>Getting rid of an activity-alias fixes things, but this is not an acceptable option for me...</p>
  
  <p>Here's the <code>adb dumpsys</code> result after the activity is started from launcher and then user selects 'Home' in navdrawer which starts activity directly, not through the alias (this dump confirms that there are two entries with different names):</p>
  
  <pre><code>  Main stack:
      TaskRecord{4181c408 #61 A ru.treto.tile U 0}
      Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=ru.treto.tile/.HomeActivity }
        Hist #2: ActivityRecord{412514b8 ru.treto.tile/.HomeActivity}
          Intent { flg=0x24000000 cmp=ru.treto.tile/.HomeActivity }
          ProcessRecord{412b06e0 10165:ru.treto.tile/u0a63}
        Hist #1: ActivityRecord{41723200 ru.treto.tile/.MainActivity}
          Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=ru.treto.tile/.MainActivity }
          ProcessRecord{412b06e0 10165:ru.treto.tile/u0a63}
  </code></pre>