Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e57607f4 authored by Victor Tan's avatar Victor Tan
Browse files

Adding aconfig and changeID for user-agent reduction

Early steps adding the changeID and Aconfig for user-agent
reduction to help us enable it for Android Baklava+.

Bug: 371034303
Test: not avaible for test right now
Flag: android.webkit.user_agent_reduction

Change-Id: I2f7ea8ba443b41ec88d41a6ffb734ffdcd886514
parent 75e7463f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -18559,6 +18559,7 @@ package android.webkit {
    method @Deprecated public abstract void setUserAgent(int);
    method public abstract void setVideoOverlayForEmbeddedEncryptedVideoEnabled(boolean);
    field public static final long ENABLE_SIMPLIFIED_DARK_MODE = 214741472L; // 0xcccb1e0L
    field @FlaggedApi("android.webkit.user_agent_reduction") public static final long ENABLE_USER_AGENT_REDUCTION = 371034303L; // 0x161d88bfL
  }
  public class WebStorage {
+20 −0
Original line number Diff line number Diff line
@@ -16,10 +16,12 @@

package android.webkit;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledAfter;
import android.compat.annotation.EnabledSince;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
@@ -150,6 +152,24 @@ public abstract class WebSettings {
    @SystemApi
    public static final long ENABLE_SIMPLIFIED_DARK_MODE = 214741472L;

    /**
     * Enable User-Agent Reduction for webview.
     * The OS, CPU, and Build information in the default User-Agent will be
     * reduced to the static "Linux; Android 10; K" string.
     * Minor/build/patch version information in the default User-Agent is
     * reduced to "0.0.0". The rest of the default User-Agent remains unchanged.
     *
     * See https://developers.google.com/privacy-sandbox/protections/user-agent
     * for details related to User-Agent Reduction.
     *
     * @hide
     */
    @ChangeId
    @EnabledAfter(targetSdkVersion = android.os.Build.VERSION_CODES.VANILLA_ICE_CREAM)
    @FlaggedApi(android.webkit.Flags.FLAG_USER_AGENT_REDUCTION)
    @SystemApi
    public static final long ENABLE_USER_AGENT_REDUCTION = 371034303L;

    /**
     * Default cache usage mode. If the navigation type doesn't impose any
     * specific behavior, use cached resources when they are available
+8 −0
Original line number Diff line number Diff line
@@ -18,3 +18,11 @@ flag {
    bug: "310653407"
    is_fixed_read_only: true
}

flag {
    name: "user_agent_reduction"
    is_exported: true
    namespace: "webview"
    description: "New feature reduce user-agent for webview"
    bug: "371034303"
}