Launch apps on link press in HTMLViewer

When pressing link in HTMLViewer, loading new page in
HTMLViewer fails.

With this commit pressing link in HTMLViewer will launch
new apps to load in the same tab.

Code is from ChromeWebView at https://chromium.googlesource.com
(see android_webview/java/src/org/chromium/android_webview/AwContentsClient.java)
commit f08cb003ea22c8c126279a8de1ac604e4dd13b0f
by Hui Shu.

Bug: 70605061
Test: Manual. Open a page with e.g. a Youtube link, press it
      and observe that Youtube app is open.
Change-Id: Iac4e053c3e03d002a162c4c38f3c9812806bdc92
diff --git a/src/com/android/htmlviewer/HTMLViewerActivity.java b/src/com/android/htmlviewer/HTMLViewerActivity.java
index 20f2edc..38940c5 100644
--- a/src/com/android/htmlviewer/HTMLViewerActivity.java
+++ b/src/com/android/htmlviewer/HTMLViewerActivity.java
@@ -24,6 +24,7 @@
 import android.Manifest;
 import android.net.Uri;
 import android.os.Bundle;
+import android.provider.Browser;
 import android.util.Log;
 import android.view.View;
 import android.webkit.WebChromeClient;
@@ -161,6 +162,10 @@
                 selector.addCategory(Intent.CATEGORY_BROWSABLE);
                 selector.setComponent(null);
             }
+            // Pass the package name as application ID so that the intent from the
+            // same application can be opened in the same tab.
+            intent.putExtra(Browser.EXTRA_APPLICATION_ID,
+                            view.getContext().getPackageName());
 
             try {
                 view.getContext().startActivity(intent);