Browser: add to customize and show useragent

Add for carrier feature which requires to use useragent with
specified format. We try to load carrier useragent if needed
and show useragent in "about" menu item.

CRs-Fixed: 516733

Change-Id: Ifae25644d9ad5387684e3ff1e691e20db9a45e2a
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index 74eede7..c548322 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -17,6 +17,7 @@
 package com.android.browser;
 
 import android.app.Activity;
+import android.app.AlertDialog;
 import android.app.KeyguardManager;
 import android.content.Context;
 import android.content.Intent;
@@ -34,6 +35,8 @@
 import android.view.MotionEvent;
 import android.view.View;
 import android.view.Window;
+import android.webkit.WebSettings;
+import android.webkit.WebView;
 import android.webkit.JavascriptInterface;
 
 import com.android.browser.UI.ComboViews;
@@ -239,6 +242,22 @@
                     }
                 }, 300);
             }
+            if (item.getItemId() == R.id.about_menu_id) {
+                final AlertDialog.Builder builder = new AlertDialog.Builder(this);
+                builder.setTitle(R.string.about);
+                builder.setCancelable(true);
+                String ua = "";
+                final WebView current = getController().getCurrentWebView();
+                if (current != null) {
+                    final WebSettings s = current.getSettings();
+                    if (s != null) {
+                        ua = s.getUserAgentString();
+                    }
+                }
+                builder.setMessage("Agent:" + ua);
+                builder.setPositiveButton(android.R.string.ok, null);
+                builder.create().show();
+            }
             return super.onOptionsItemSelected(item);
         }
         return true;