Skip to content

Commit

Permalink
WebSettings: Add ro.cm.version to default user agent.
Browse files Browse the repository at this point in the history
Change-Id: Ic14a1626ab7bec26297e2041bdcfb26ca7b3a440
  • Loading branch information
optedoblivion authored and rmcc committed Dec 10, 2012
1 parent 0561b72 commit 9266b8e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/java/android/webkit/WebSettingsClassic.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.os.SystemProperties;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.util.EventLog;
Expand Down Expand Up @@ -432,6 +433,9 @@ public static String getDefaultUserAgentForLocale(Context context, Locale locale
buffer.append(" Build/");
buffer.append(id);
}
final String cmversion = SystemProperties.get("ro.cm.version");
if (cmversion != null && cmversion.length() > 0)
buffer.append("; CyanogenMod-" + cmversion.replaceAll("([0-9\\.]+?)-.*","$1"));
String mobile = context.getResources().getText(
com.android.internal.R.string.web_user_agent_target_content).toString();
final String base = context.getResources().getText(
Expand Down

0 comments on commit 9266b8e

Please sign in to comment.