Merge "Add nullability annotations for some apis and update java doc"
diff --git a/Android.bp b/Android.bp
index 286be82..e63463c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -191,6 +191,10 @@
"core/java/android/hardware/input/IInputDevicesChangedListener.aidl",
"core/java/android/hardware/input/ITabletModeChangedListener.aidl",
"core/java/android/hardware/iris/IIrisService.aidl",
+ "core/java/android/hardware/location/IActivityRecognitionHardware.aidl",
+ "core/java/android/hardware/location/IActivityRecognitionHardwareClient.aidl",
+ "core/java/android/hardware/location/IActivityRecognitionHardwareSink.aidl",
+ "core/java/android/hardware/location/IActivityRecognitionHardwareWatcher.aidl",
"core/java/android/hardware/location/IGeofenceHardware.aidl",
"core/java/android/hardware/location/IGeofenceHardwareCallback.aidl",
"core/java/android/hardware/location/IGeofenceHardwareMonitorCallback.aidl",
@@ -207,7 +211,6 @@
"core/java/android/hardware/soundtrigger/IRecognitionStatusCallback.aidl",
"core/java/android/hardware/usb/IUsbManager.aidl",
"core/java/android/hardware/usb/IUsbSerialReader.aidl",
- "core/java/android/net/ICaptivePortal.aidl",
"core/java/android/net/IConnectivityManager.aidl",
"core/java/android/hardware/ISensorPrivacyListener.aidl",
"core/java/android/hardware/ISensorPrivacyManager.aidl",
@@ -762,8 +765,6 @@
required: [
// TODO: remove gps_debug when the build system propagates "required" properly.
"gps_debug.conf",
- // Loaded with System.loadLibrary by android.view.textclassifier
- "libmedia2_jni",
],
dxflags: [
@@ -884,6 +885,7 @@
srcs: [
"core/java/android/net/ApfCapabilitiesParcelable.aidl",
"core/java/android/net/DhcpResultsParcelable.aidl",
+ "core/java/android/net/ICaptivePortal.aidl",
"core/java/android/net/INetworkMonitor.aidl",
"core/java/android/net/INetworkMonitorCallbacks.aidl",
"core/java/android/net/IIpMemoryStore.aidl",
diff --git a/api/current.txt b/api/current.txt
index 4efdc23..3bb6957 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -9625,7 +9625,7 @@
public abstract class Context {
ctor public Context();
- method public abstract boolean bindIsolatedService(@RequiresPermission android.content.Intent, @NonNull android.content.ServiceConnection, int, @NonNull String);
+ method public boolean bindIsolatedService(@RequiresPermission android.content.Intent, @NonNull android.content.ServiceConnection, int, @NonNull String);
method public abstract boolean bindService(@RequiresPermission android.content.Intent, @NonNull android.content.ServiceConnection, int);
method @CheckResult(suggest="#enforceCallingOrSelfPermission(String,String)") public abstract int checkCallingOrSelfPermission(@NonNull String);
method @CheckResult(suggest="#enforceCallingOrSelfUriPermission(Uri,int,String)") public abstract int checkCallingOrSelfUriPermission(android.net.Uri, int);
@@ -9678,7 +9678,7 @@
method public abstract java.io.File getNoBackupFilesDir();
method public abstract java.io.File getObbDir();
method public abstract java.io.File[] getObbDirs();
- method public abstract String getOpPackageName();
+ method public String getOpPackageName();
method public abstract String getPackageCodePath();
method public abstract android.content.pm.PackageManager getPackageManager();
method public abstract String getPackageName();
@@ -9745,7 +9745,7 @@
method public abstract void unbindService(@NonNull android.content.ServiceConnection);
method public void unregisterComponentCallbacks(android.content.ComponentCallbacks);
method public abstract void unregisterReceiver(android.content.BroadcastReceiver);
- method public abstract void updateServiceGroup(@NonNull android.content.ServiceConnection, int, int);
+ method public void updateServiceGroup(@NonNull android.content.ServiceConnection, int, int);
field public static final String ACCESSIBILITY_SERVICE = "accessibility";
field public static final String ACCOUNT_SERVICE = "account";
field public static final String ACTIVITY_SERVICE = "activity";
@@ -9839,7 +9839,6 @@
public class ContextWrapper extends android.content.Context {
ctor public ContextWrapper(android.content.Context);
method protected void attachBaseContext(android.content.Context);
- method public boolean bindIsolatedService(android.content.Intent, android.content.ServiceConnection, int, String);
method public boolean bindService(android.content.Intent, android.content.ServiceConnection, int);
method public int checkCallingOrSelfPermission(String);
method public int checkCallingOrSelfUriPermission(android.net.Uri, int);
@@ -9889,7 +9888,6 @@
method public java.io.File getNoBackupFilesDir();
method public java.io.File getObbDir();
method public java.io.File[] getObbDirs();
- method public String getOpPackageName();
method public String getPackageCodePath();
method public android.content.pm.PackageManager getPackageManager();
method public String getPackageName();
@@ -9945,7 +9943,6 @@
method public boolean stopService(android.content.Intent);
method public void unbindService(android.content.ServiceConnection);
method public void unregisterReceiver(android.content.BroadcastReceiver);
- method public void updateServiceGroup(android.content.ServiceConnection, int, int);
}
@Deprecated public class CursorLoader extends android.content.AsyncTaskLoader<android.database.Cursor> {
@@ -10221,7 +10218,7 @@
field public static final String ACTION_MY_PACKAGE_REPLACED = "android.intent.action.MY_PACKAGE_REPLACED";
field public static final String ACTION_MY_PACKAGE_SUSPENDED = "android.intent.action.MY_PACKAGE_SUSPENDED";
field public static final String ACTION_MY_PACKAGE_UNSUSPENDED = "android.intent.action.MY_PACKAGE_UNSUSPENDED";
- field public static final String ACTION_NEW_OUTGOING_CALL = "android.intent.action.NEW_OUTGOING_CALL";
+ field @Deprecated public static final String ACTION_NEW_OUTGOING_CALL = "android.intent.action.NEW_OUTGOING_CALL";
field public static final String ACTION_OPEN_DOCUMENT = "android.intent.action.OPEN_DOCUMENT";
field public static final String ACTION_OPEN_DOCUMENT_TREE = "android.intent.action.OPEN_DOCUMENT_TREE";
field public static final String ACTION_PACKAGES_SUSPENDED = "android.intent.action.PACKAGES_SUSPENDED";
@@ -21650,7 +21647,7 @@
ctor public JapaneseCalendar(int, int, int, int);
ctor public JapaneseCalendar(int, int, int);
ctor public JapaneseCalendar(int, int, int, int, int, int);
- field public static final int CURRENT_ERA;
+ field @Deprecated public static final int CURRENT_ERA;
field public static final int HEISEI;
field public static final int MEIJI;
field public static final int SHOWA;
@@ -27426,15 +27423,24 @@
public final class MediaSessionManager {
method public void addOnActiveSessionsChangedListener(@NonNull android.media.session.MediaSessionManager.OnActiveSessionsChangedListener, @Nullable android.content.ComponentName);
method public void addOnActiveSessionsChangedListener(@NonNull android.media.session.MediaSessionManager.OnActiveSessionsChangedListener, @Nullable android.content.ComponentName, @Nullable android.os.Handler);
+ method public void addOnSession2TokensChangedListener(@NonNull android.media.session.MediaSessionManager.OnSession2TokensChangedListener);
+ method public void addOnSession2TokensChangedListener(@NonNull android.media.session.MediaSessionManager.OnSession2TokensChangedListener, @NonNull android.os.Handler);
method @NonNull public java.util.List<android.media.session.MediaController> getActiveSessions(@Nullable android.content.ComponentName);
+ method @NonNull public java.util.List<android.media.Session2Token> getSession2Tokens();
method public boolean isTrustedForMediaControl(@NonNull android.media.session.MediaSessionManager.RemoteUserInfo);
+ method public void notifySession2Created(@NonNull android.media.Session2Token);
method public void removeOnActiveSessionsChangedListener(@NonNull android.media.session.MediaSessionManager.OnActiveSessionsChangedListener);
+ method public void removeOnSession2TokensChangedListener(@NonNull android.media.session.MediaSessionManager.OnSession2TokensChangedListener);
}
public static interface MediaSessionManager.OnActiveSessionsChangedListener {
method public void onActiveSessionsChanged(@Nullable java.util.List<android.media.session.MediaController>);
}
+ public static interface MediaSessionManager.OnSession2TokensChangedListener {
+ method public void onSession2TokensChanged(@NonNull java.util.List<android.media.Session2Token>);
+ }
+
public static final class MediaSessionManager.RemoteUserInfo {
ctor public MediaSessionManager.RemoteUserInfo(@NonNull String, int, int);
ctor public MediaSessionManager.RemoteUserInfo(String, int, int, android.os.IBinder);
@@ -28903,24 +28909,24 @@
field public static final android.os.Parcelable.Creator<android.net.RouteInfo> CREATOR;
}
- public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
+ @Deprecated public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
ctor @Deprecated public SSLCertificateSocketFactory(int);
- method public java.net.Socket createSocket(java.net.Socket, String, int, boolean) throws java.io.IOException;
- method public java.net.Socket createSocket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
- method public java.net.Socket createSocket(java.net.InetAddress, int) throws java.io.IOException;
- method public java.net.Socket createSocket(String, int, java.net.InetAddress, int) throws java.io.IOException;
- method public java.net.Socket createSocket(String, int) throws java.io.IOException;
- method public static javax.net.SocketFactory getDefault(int);
- method public static javax.net.ssl.SSLSocketFactory getDefault(int, android.net.SSLSessionCache);
- method public String[] getDefaultCipherSuites();
- method public static javax.net.ssl.SSLSocketFactory getInsecure(int, android.net.SSLSessionCache);
- method public byte[] getNpnSelectedProtocol(java.net.Socket);
- method public String[] getSupportedCipherSuites();
- method public void setHostname(java.net.Socket, String);
- method public void setKeyManagers(javax.net.ssl.KeyManager[]);
- method public void setNpnProtocols(byte[][]);
- method public void setTrustManagers(javax.net.ssl.TrustManager[]);
- method public void setUseSessionTickets(java.net.Socket, boolean);
+ method @Deprecated public java.net.Socket createSocket(java.net.Socket, String, int, boolean) throws java.io.IOException;
+ method @Deprecated public java.net.Socket createSocket(java.net.InetAddress, int, java.net.InetAddress, int) throws java.io.IOException;
+ method @Deprecated public java.net.Socket createSocket(java.net.InetAddress, int) throws java.io.IOException;
+ method @Deprecated public java.net.Socket createSocket(String, int, java.net.InetAddress, int) throws java.io.IOException;
+ method @Deprecated public java.net.Socket createSocket(String, int) throws java.io.IOException;
+ method @Deprecated public static javax.net.SocketFactory getDefault(int);
+ method @Deprecated public static javax.net.ssl.SSLSocketFactory getDefault(int, android.net.SSLSessionCache);
+ method @Deprecated public String[] getDefaultCipherSuites();
+ method @Deprecated public static javax.net.ssl.SSLSocketFactory getInsecure(int, android.net.SSLSessionCache);
+ method @Deprecated public byte[] getNpnSelectedProtocol(java.net.Socket);
+ method @Deprecated public String[] getSupportedCipherSuites();
+ method @Deprecated public void setHostname(java.net.Socket, String);
+ method @Deprecated public void setKeyManagers(javax.net.ssl.KeyManager[]);
+ method @Deprecated public void setNpnProtocols(byte[][]);
+ method @Deprecated public void setTrustManagers(javax.net.ssl.TrustManager[]);
+ method @Deprecated public void setUseSessionTickets(java.net.Socket, boolean);
}
public final class SSLSessionCache {
@@ -29109,6 +29115,8 @@
public class VpnService extends android.app.Service {
ctor public VpnService();
+ method public final boolean isAlwaysOn();
+ method public final boolean isLockdownEnabled();
method public android.os.IBinder onBind(android.content.Intent);
method public void onRevoke();
method public static android.content.Intent prepare(android.content.Context);
@@ -34864,10 +34872,13 @@
method public static final void setThreadPriority(int, int) throws java.lang.IllegalArgumentException, java.lang.SecurityException;
method public static final void setThreadPriority(int) throws java.lang.IllegalArgumentException, java.lang.SecurityException;
method @Deprecated public static final boolean supportsProcesses();
+ field public static final int BLUETOOTH_UID = 1002; // 0x3ea
field public static final int FIRST_APPLICATION_UID = 10000; // 0x2710
field public static final int INVALID_UID = -1; // 0xffffffff
field public static final int LAST_APPLICATION_UID = 19999; // 0x4e1f
field public static final int PHONE_UID = 1001; // 0x3e9
+ field public static final int ROOT_UID = 0; // 0x0
+ field public static final int SHELL_UID = 2000; // 0x7d0
field public static final int SIGNAL_KILL = 9; // 0x9
field public static final int SIGNAL_QUIT = 3; // 0x3
field public static final int SIGNAL_USR1 = 10; // 0xa
@@ -45011,7 +45022,9 @@
field public static final int PROTOCOL_IP = 0; // 0x0
field public static final int PROTOCOL_IPV4V6 = 2; // 0x2
field public static final int PROTOCOL_IPV6 = 1; // 0x1
+ field public static final int PROTOCOL_NON_IP = 4; // 0x4
field public static final int PROTOCOL_PPP = 3; // 0x3
+ field public static final int PROTOCOL_UNSTRUCTURED = 5; // 0x5
field public static final int TYPE_CBS = 128; // 0x80
field public static final int TYPE_DEFAULT = 17; // 0x11
field public static final int TYPE_DUN = 8; // 0x8
diff --git a/api/removed.txt b/api/removed.txt
index 2c567e0..e232227 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -325,7 +325,7 @@
@IntDef({0x0, 0xa, 0x14, 0x1e}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface NetworkBadging.Badging {
}
- public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
+ @Deprecated public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
method @Deprecated public static org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache);
}
diff --git a/api/system-current.txt b/api/system-current.txt
index 8e6d4b0..d3d0b57 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -1776,8 +1776,13 @@
}
public final class ColorDisplayManager {
+ method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public int getTransformCapabilities();
method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setAppSaturationLevel(@NonNull String, @IntRange(from=0, to=100) int);
method @RequiresPermission(android.Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS) public boolean setSaturationLevel(@IntRange(from=0, to=100) int);
+ field public static final int CAPABILITY_HARDWARE_ACCELERATION_GLOBAL = 2; // 0x2
+ field public static final int CAPABILITY_HARDWARE_ACCELERATION_PER_APP = 4; // 0x4
+ field public static final int CAPABILITY_NONE = 0; // 0x0
+ field public static final int CAPABILITY_PROTECTED_CONTENT = 1; // 0x1
}
public final class DisplayManager {
@@ -3895,6 +3900,8 @@
package android.net {
public class CaptivePortal implements android.os.Parcelable {
+ ctor public CaptivePortal(android.os.IBinder);
+ method public void useNetwork();
field public static final int APP_RETURN_DISMISSED = 0; // 0x0
field public static final int APP_RETURN_UNWANTED = 1; // 0x1
field public static final int APP_RETURN_WANTED_AS_IS = 2; // 0x2
@@ -3962,14 +3969,30 @@
public final class LinkProperties implements android.os.Parcelable {
ctor public LinkProperties();
+ method public boolean addDnsServer(java.net.InetAddress);
method public boolean addRoute(android.net.RouteInfo);
method public void clear();
+ method public String getTcpBufferSizes();
+ method public java.util.List<java.net.InetAddress> getValidatedPrivateDnsServers();
+ method public boolean hasGlobalIPv6Address();
+ method public boolean hasIPv4Address();
+ method public boolean hasIPv6DefaultRoute();
+ method public boolean isIPv4Provisioned();
+ method public boolean isIPv6Provisioned();
+ method public boolean isProvisioned();
+ method public boolean isReachable(java.net.InetAddress);
+ method public boolean removeDnsServer(java.net.InetAddress);
+ method public boolean removeRoute(android.net.RouteInfo);
method public void setDnsServers(java.util.Collection<java.net.InetAddress>);
method public void setDomains(String);
method public void setHttpProxy(android.net.ProxyInfo);
method public void setInterfaceName(String);
method public void setLinkAddresses(java.util.Collection<android.net.LinkAddress>);
method public void setMtu(int);
+ method public void setPrivateDnsServerName(@Nullable String);
+ method public void setTcpBufferSizes(String);
+ method public void setUsePrivateDns(boolean);
+ method public void setValidatedPrivateDnsServers(java.util.Collection<java.net.InetAddress>);
}
public class Network implements android.os.Parcelable {
@@ -3978,6 +4001,8 @@
public final class NetworkCapabilities implements android.os.Parcelable {
method public int getSignalStrength();
+ method public int[] getTransportTypes();
+ method public boolean satisfiedByNetworkCapabilities(android.net.NetworkCapabilities);
field public static final int NET_CAPABILITY_OEM_PAID = 22; // 0x16
}
@@ -4080,6 +4105,158 @@
}
+package android.net.metrics {
+
+ public final class ApfProgramEvent implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static class ApfProgramEvent.Builder {
+ ctor public ApfProgramEvent.Builder();
+ method public android.net.metrics.ApfProgramEvent build();
+ method public android.net.metrics.ApfProgramEvent.Builder setActualLifetime(long);
+ method public android.net.metrics.ApfProgramEvent.Builder setCurrentRas(int);
+ method public android.net.metrics.ApfProgramEvent.Builder setFilteredRas(int);
+ method public android.net.metrics.ApfProgramEvent.Builder setFlags(boolean, boolean);
+ method public android.net.metrics.ApfProgramEvent.Builder setLifetime(long);
+ method public android.net.metrics.ApfProgramEvent.Builder setProgramLength(int);
+ }
+
+ public final class ApfStats implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static class ApfStats.Builder {
+ ctor public ApfStats.Builder();
+ method public android.net.metrics.ApfStats build();
+ method public android.net.metrics.ApfStats.Builder setDroppedRas(int);
+ method public android.net.metrics.ApfStats.Builder setDurationMs(long);
+ method public android.net.metrics.ApfStats.Builder setMatchingRas(int);
+ method public android.net.metrics.ApfStats.Builder setMaxProgramSize(int);
+ method public android.net.metrics.ApfStats.Builder setParseErrors(int);
+ method public android.net.metrics.ApfStats.Builder setProgramUpdates(int);
+ method public android.net.metrics.ApfStats.Builder setProgramUpdatesAll(int);
+ method public android.net.metrics.ApfStats.Builder setProgramUpdatesAllowingMulticast(int);
+ method public android.net.metrics.ApfStats.Builder setReceivedRas(int);
+ method public android.net.metrics.ApfStats.Builder setZeroLifetimeRas(int);
+ }
+
+ public final class DhcpClientEvent implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static class DhcpClientEvent.Builder {
+ ctor public DhcpClientEvent.Builder();
+ method public android.net.metrics.DhcpClientEvent build();
+ method public android.net.metrics.DhcpClientEvent.Builder setDurationMs(int);
+ method public android.net.metrics.DhcpClientEvent.Builder setMsg(String);
+ }
+
+ public final class DhcpErrorEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public DhcpErrorEvent(int);
+ method public static int errorCodeWithOption(int, int);
+ field public static final int BOOTP_TOO_SHORT;
+ field public static final int BUFFER_UNDERFLOW;
+ field public static final int DHCP_BAD_MAGIC_COOKIE;
+ field public static final int DHCP_ERROR = 4; // 0x4
+ field public static final int DHCP_INVALID_OPTION_LENGTH;
+ field public static final int DHCP_NO_COOKIE;
+ field public static final int DHCP_NO_MSG_TYPE;
+ field public static final int DHCP_UNKNOWN_MSG_TYPE;
+ field public static final int L2_ERROR = 1; // 0x1
+ field public static final int L2_TOO_SHORT;
+ field public static final int L2_WRONG_ETH_TYPE;
+ field public static final int L3_ERROR = 2; // 0x2
+ field public static final int L3_INVALID_IP;
+ field public static final int L3_NOT_IPV4;
+ field public static final int L3_TOO_SHORT;
+ field public static final int L4_ERROR = 3; // 0x3
+ field public static final int L4_NOT_UDP;
+ field public static final int L4_WRONG_PORT;
+ field public static final int MISC_ERROR = 5; // 0x5
+ field public static final int PARSING_ERROR;
+ field public static final int RECEIVE_ERROR;
+ }
+
+ public class IpConnectivityLog {
+ method public boolean log(long, android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(String, android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(android.net.Network, int[], android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(int, int[], android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(android.net.metrics.IpConnectivityLog.Event);
+ }
+
+ public static interface IpConnectivityLog.Event extends android.os.Parcelable {
+ }
+
+ public final class IpManagerEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public IpManagerEvent(int, long);
+ field public static final int COMPLETE_LIFECYCLE = 3; // 0x3
+ field public static final int ERROR_INTERFACE_NOT_FOUND = 8; // 0x8
+ field public static final int ERROR_INVALID_PROVISIONING = 7; // 0x7
+ field public static final int ERROR_STARTING_IPREACHABILITYMONITOR = 6; // 0x6
+ field public static final int ERROR_STARTING_IPV4 = 4; // 0x4
+ field public static final int ERROR_STARTING_IPV6 = 5; // 0x5
+ field public static final int PROVISIONING_FAIL = 2; // 0x2
+ field public static final int PROVISIONING_OK = 1; // 0x1
+ }
+
+ public final class IpReachabilityEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public IpReachabilityEvent(int);
+ field public static final int NUD_FAILED = 512; // 0x200
+ field public static final int NUD_FAILED_ORGANIC = 1024; // 0x400
+ field public static final int PROBE = 256; // 0x100
+ field public static final int PROVISIONING_LOST = 768; // 0x300
+ field public static final int PROVISIONING_LOST_ORGANIC = 1280; // 0x500
+ }
+
+ public final class NetworkEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public NetworkEvent(int, long);
+ ctor public NetworkEvent(int);
+ field public static final int NETWORK_CAPTIVE_PORTAL_FOUND = 4; // 0x4
+ field public static final int NETWORK_CONNECTED = 1; // 0x1
+ field public static final int NETWORK_CONSECUTIVE_DNS_TIMEOUT_FOUND = 12; // 0xc
+ field public static final int NETWORK_DISCONNECTED = 7; // 0x7
+ field public static final int NETWORK_FIRST_VALIDATION_PORTAL_FOUND = 10; // 0xa
+ field public static final int NETWORK_FIRST_VALIDATION_SUCCESS = 8; // 0x8
+ field public static final int NETWORK_LINGER = 5; // 0x5
+ field public static final int NETWORK_REVALIDATION_PORTAL_FOUND = 11; // 0xb
+ field public static final int NETWORK_REVALIDATION_SUCCESS = 9; // 0x9
+ field public static final int NETWORK_UNLINGER = 6; // 0x6
+ field public static final int NETWORK_VALIDATED = 2; // 0x2
+ field public static final int NETWORK_VALIDATION_FAILED = 3; // 0x3
+ }
+
+ public final class ValidationProbeEvent implements android.net.metrics.IpConnectivityLog.Event {
+ method public static String getProbeName(int);
+ field public static final int DNS_FAILURE = 0; // 0x0
+ field public static final int DNS_SUCCESS = 1; // 0x1
+ field public static final int PROBE_DNS = 0; // 0x0
+ field public static final int PROBE_FALLBACK = 4; // 0x4
+ field public static final int PROBE_HTTP = 1; // 0x1
+ field public static final int PROBE_HTTPS = 2; // 0x2
+ field public static final int PROBE_PAC = 3; // 0x3
+ field public static final int PROBE_PRIVDNS = 5; // 0x5
+ }
+
+ public static class ValidationProbeEvent.Builder {
+ ctor public ValidationProbeEvent.Builder();
+ method public android.net.metrics.ValidationProbeEvent build();
+ method public android.net.metrics.ValidationProbeEvent.Builder setDurationMs(long);
+ method public android.net.metrics.ValidationProbeEvent.Builder setProbeType(int, boolean);
+ method public android.net.metrics.ValidationProbeEvent.Builder setReturnCode(int);
+ }
+
+}
+
+package android.net.util {
+
+ public class SocketUtils {
+ method public static void bindSocketToInterface(java.io.FileDescriptor, String) throws android.system.ErrnoException;
+ method public static java.net.SocketAddress makeNetlinkSocketAddress(int, int);
+ method public static java.net.SocketAddress makePacketSocketAddress(short, int);
+ method public static java.net.SocketAddress makePacketSocketAddress(int, byte[]);
+ }
+
+}
+
package android.net.wifi {
public abstract class EasyConnectStatusCallback {
@@ -4555,7 +4732,7 @@
method public abstract void onProvisioningStatus(int);
field public static final int OSU_FAILURE_ADD_PASSPOINT_CONFIGURATION = 22; // 0x16
field public static final int OSU_FAILURE_AP_CONNECTION = 1; // 0x1
- field public static final int OSU_FAILURE_INVALID_SERVER_URL = 8; // 0x8
+ field public static final int OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU = 8; // 0x8
field public static final int OSU_FAILURE_NO_AAA_SERVER_TRUST_ROOT_NODE = 17; // 0x11
field public static final int OSU_FAILURE_NO_AAA_TRUST_ROOT_CERTIFICATE = 21; // 0x15
field public static final int OSU_FAILURE_NO_OSU_ACTIVITY_FOUND = 14; // 0xe
@@ -4913,6 +5090,12 @@
method public void onResult(android.os.Bundle);
}
+ public class ServiceSpecificException extends java.lang.RuntimeException {
+ ctor public ServiceSpecificException(int, String);
+ ctor public ServiceSpecificException(int);
+ field public final int errorCode;
+ }
+
public final class StatsDimensionsValue implements android.os.Parcelable {
method public int describeContents();
method public boolean getBooleanValue();
@@ -6574,42 +6757,211 @@
}
public final class DataFailCause {
+ field public static final int ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 2219; // 0x8ab
+ field public static final int ACCESS_BLOCK = 2087; // 0x827
+ field public static final int ACCESS_BLOCK_ALL = 2088; // 0x828
+ field public static final int ACCESS_CLASS_DSAC_REJECTION = 2108; // 0x83c
+ field public static final int ACCESS_CONTROL_LIST_CHECK_FAILURE = 2128; // 0x850
+ field public static final int ACTIVATION_REJECTED_BCM_VIOLATION = 48; // 0x30
field public static final int ACTIVATION_REJECT_GGSN = 30; // 0x1e
field public static final int ACTIVATION_REJECT_UNSPECIFIED = 31; // 0x1f
field public static final int ACTIVE_PDP_CONTEXT_MAX_NUMBER_REACHED = 65; // 0x41
+ field public static final int APN_DISABLED = 2045; // 0x7fd
+ field public static final int APN_DISALLOWED_ON_ROAMING = 2059; // 0x80b
+ field public static final int APN_MISMATCH = 2054; // 0x806
+ field public static final int APN_PARAMETERS_CHANGED = 2060; // 0x80c
+ field public static final int APN_PENDING_HANDOVER = 2041; // 0x7f9
field public static final int APN_TYPE_CONFLICT = 112; // 0x70
field public static final int AUTH_FAILURE_ON_EMERGENCY_CALL = 122; // 0x7a
+ field public static final int BEARER_HANDLING_NOT_SUPPORTED = 60; // 0x3c
+ field public static final int CALL_DISALLOWED_IN_ROAMING = 2068; // 0x814
+ field public static final int CALL_PREEMPT_BY_EMERGENCY_APN = 127; // 0x7f
+ field public static final int CANNOT_ENCODE_OTA_MESSAGE = 2159; // 0x86f
+ field public static final int CDMA_ALERT_STOP = 2077; // 0x81d
+ field public static final int CDMA_INCOMING_CALL = 2076; // 0x81c
+ field public static final int CDMA_INTERCEPT = 2073; // 0x819
+ field public static final int CDMA_LOCK = 2072; // 0x818
+ field public static final int CDMA_RELEASE_DUE_TO_SO_REJECTION = 2075; // 0x81b
+ field public static final int CDMA_REORDER = 2074; // 0x81a
+ field public static final int CDMA_RETRY_ORDER = 2086; // 0x826
+ field public static final int CHANNEL_ACQUISITION_FAILURE = 2078; // 0x81e
+ field public static final int CLOSE_IN_PROGRESS = 2030; // 0x7ee
+ field public static final int COLLISION_WITH_NETWORK_INITIATED_REQUEST = 56; // 0x38
field public static final int COMPANION_IFACE_IN_USE = 118; // 0x76
+ field public static final int CONCURRENT_SERVICES_INCOMPATIBLE = 2083; // 0x823
+ field public static final int CONCURRENT_SERVICES_NOT_ALLOWED = 2091; // 0x82b
+ field public static final int CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 2080; // 0x820
field public static final int CONDITIONAL_IE_ERROR = 100; // 0x64
+ field public static final int CONGESTION = 2106; // 0x83a
+ field public static final int CONNECTION_RELEASED = 2113; // 0x841
+ field public static final int CS_DOMAIN_NOT_AVAILABLE = 2181; // 0x885
+ field public static final int CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 2188; // 0x88c
+ field public static final int DATA_PLAN_EXPIRED = 2198; // 0x896
+ field public static final int DATA_ROAMING_SETTINGS_DISABLED = 2064; // 0x810
+ field public static final int DATA_SETTINGS_DISABLED = 2063; // 0x80f
+ field public static final int DBM_OR_SMS_IN_PROGRESS = 2211; // 0x8a3
+ field public static final int DDS_SWITCHED = 2065; // 0x811
+ field public static final int DDS_SWITCH_IN_PROGRESS = 2067; // 0x813
+ field public static final int DRB_RELEASED_BY_RRC = 2112; // 0x840
+ field public static final int DS_EXPLICIT_DEACTIVATION = 2125; // 0x84d
+ field public static final int DUAL_SWITCH = 2227; // 0x8b3
+ field public static final int DUN_CALL_DISALLOWED = 2056; // 0x808
+ field public static final int DUPLICATE_BEARER_ID = 2118; // 0x846
+ field public static final int EHRPD_TO_HRPD_FALLBACK = 2049; // 0x801
+ field public static final int EMBMS_NOT_ENABLED = 2193; // 0x891
+ field public static final int EMBMS_REGULAR_DEACTIVATION = 2195; // 0x893
field public static final int EMERGENCY_IFACE_ONLY = 116; // 0x74
+ field public static final int EMERGENCY_MODE = 2221; // 0x8ad
field public static final int EMM_ACCESS_BARRED = 115; // 0x73
field public static final int EMM_ACCESS_BARRED_INFINITE_RETRY = 121; // 0x79
+ field public static final int EMM_ATTACH_FAILED = 2115; // 0x843
+ field public static final int EMM_ATTACH_STARTED = 2116; // 0x844
+ field public static final int EMM_DETACHED = 2114; // 0x842
+ field public static final int EMM_T3417_EXPIRED = 2130; // 0x852
+ field public static final int EMM_T3417_EXT_EXPIRED = 2131; // 0x853
+ field public static final int EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 2178; // 0x882
+ field public static final int EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 2179; // 0x883
field public static final int ERROR_UNSPECIFIED = 65535; // 0xffff
+ field public static final int ESM_BAD_OTA_MESSAGE = 2122; // 0x84a
+ field public static final int ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 2120; // 0x848
+ field public static final int ESM_COLLISION_SCENARIOS = 2119; // 0x847
+ field public static final int ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 2124; // 0x84c
+ field public static final int ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 2123; // 0x84b
+ field public static final int ESM_FAILURE = 2182; // 0x886
field public static final int ESM_INFO_NOT_RECEIVED = 53; // 0x35
+ field public static final int ESM_LOCAL_CAUSE_NONE = 2126; // 0x84e
+ field public static final int ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 2121; // 0x849
+ field public static final int ESM_PROCEDURE_TIME_OUT = 2155; // 0x86b
+ field public static final int ESM_UNKNOWN_EPS_BEARER_CONTEXT = 2111; // 0x83f
+ field public static final int EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 2201; // 0x899
+ field public static final int EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 2200; // 0x898
+ field public static final int EVDO_HDR_CHANGED = 2202; // 0x89a
+ field public static final int EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 2206; // 0x89e
+ field public static final int EVDO_HDR_EXITED = 2203; // 0x89b
+ field public static final int EVDO_HDR_NO_SESSION = 2204; // 0x89c
+ field public static final int EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 2205; // 0x89d
+ field public static final int FADE = 2217; // 0x8a9
+ field public static final int FAILED_TO_ACQUIRE_COLOCATED_HDR = 2207; // 0x89f
field public static final int FEATURE_NOT_SUPP = 40; // 0x28
field public static final int FILTER_SEMANTIC_ERROR = 44; // 0x2c
field public static final int FILTER_SYTAX_ERROR = 45; // 0x2d
+ field public static final int FORBIDDEN_APN_NAME = 2066; // 0x812
field public static final int GPRS_REGISTRATION_FAIL = -2; // 0xfffffffe
+ field public static final int GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 2097; // 0x831
+ field public static final int GPRS_SERVICES_NOT_ALLOWED = 2098; // 0x832
+ field public static final int GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 2103; // 0x837
+ field public static final int HANDOFF_PREFERENCE_CHANGED = 2251; // 0x8cb
+ field public static final int HDR_ACCESS_FAILURE = 2213; // 0x8a5
+ field public static final int HDR_FADE = 2212; // 0x8a4
+ field public static final int HDR_NO_LOCK_GRANTED = 2210; // 0x8a2
field public static final int IFACE_AND_POL_FAMILY_MISMATCH = 120; // 0x78
field public static final int IFACE_MISMATCH = 117; // 0x75
+ field public static final int ILLEGAL_ME = 2096; // 0x830
+ field public static final int ILLEGAL_MS = 2095; // 0x82f
+ field public static final int IMEI_NOT_ACCEPTED = 2177; // 0x881
+ field public static final int IMPLICITLY_DETACHED = 2100; // 0x834
+ field public static final int IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 2176; // 0x880
+ field public static final int INCOMING_CALL_REJECTED = 2092; // 0x82c
field public static final int INSUFFICIENT_RESOURCES = 26; // 0x1a
+ field public static final int INTERFACE_IN_USE = 2058; // 0x80a
field public static final int INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN = 114; // 0x72
+ field public static final int INTERNAL_EPC_NONEPC_TRANSITION = 2057; // 0x809
+ field public static final int INVALID_CONNECTION_ID = 2156; // 0x86c
+ field public static final int INVALID_DNS_ADDR = 123; // 0x7b
+ field public static final int INVALID_EMM_STATE = 2190; // 0x88e
field public static final int INVALID_MANDATORY_INFO = 96; // 0x60
+ field public static final int INVALID_MODE = 2223; // 0x8af
field public static final int INVALID_PCSCF_ADDR = 113; // 0x71
+ field public static final int INVALID_PCSCF_OR_DNS_ADDRESS = 124; // 0x7c
+ field public static final int INVALID_PRIMARY_NSAPI = 2158; // 0x86e
+ field public static final int INVALID_SIM_STATE = 2224; // 0x8b0
field public static final int INVALID_TRANSACTION_ID = 81; // 0x51
+ field public static final int IPV6_ADDRESS_TRANSFER_FAILED = 2047; // 0x7ff
+ field public static final int IPV6_PREFIX_UNAVAILABLE = 2250; // 0x8ca
field public static final int IP_ADDRESS_MISMATCH = 119; // 0x77
+ field public static final int IP_VERSION_MISMATCH = 2055; // 0x807
+ field public static final int IRAT_HANDOVER_FAILED = 2194; // 0x892
+ field public static final int IS707B_MAX_ACCESS_PROBES = 2089; // 0x829
+ field public static final int LIMITED_TO_IPV4 = 2234; // 0x8ba
+ field public static final int LIMITED_TO_IPV6 = 2235; // 0x8bb
field public static final int LLC_SNDCP = 25; // 0x19
+ field public static final int LOCAL_END = 2215; // 0x8a7
+ field public static final int LOCATION_AREA_NOT_ALLOWED = 2102; // 0x836
field public static final int LOST_CONNECTION = 65540; // 0x10004
+ field public static final int LOWER_LAYER_REGISTRATION_FAILURE = 2197; // 0x895
+ field public static final int LOW_POWER_MODE_OR_POWERING_DOWN = 2044; // 0x7fc
+ field public static final int LTE_NAS_SERVICE_REQUEST_FAILED = 2117; // 0x845
+ field public static final int LTE_THROTTLING_NOT_REQUIRED = 2127; // 0x84f
+ field public static final int MAC_FAILURE = 2183; // 0x887
+ field public static final int MAXIMIUM_NSAPIS_EXCEEDED = 2157; // 0x86d
+ field public static final int MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 2166; // 0x876
+ field public static final int MAX_ACCESS_PROBE = 2079; // 0x81f
+ field public static final int MAX_IPV4_CONNECTIONS = 2052; // 0x804
+ field public static final int MAX_IPV6_CONNECTIONS = 2053; // 0x805
+ field public static final int MAX_PPP_INACTIVITY_TIMER_EXPIRED = 2046; // 0x7fe
field public static final int MESSAGE_INCORRECT_SEMANTIC = 95; // 0x5f
field public static final int MESSAGE_TYPE_UNSUPPORTED = 97; // 0x61
+ field public static final int MIP_CONFIG_FAILURE = 2050; // 0x802
+ field public static final int MIP_FA_ADMIN_PROHIBITED = 2001; // 0x7d1
+ field public static final int MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 2012; // 0x7dc
+ field public static final int MIP_FA_ENCAPSULATION_UNAVAILABLE = 2008; // 0x7d8
+ field public static final int MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 2004; // 0x7d4
+ field public static final int MIP_FA_INSUFFICIENT_RESOURCES = 2002; // 0x7d2
+ field public static final int MIP_FA_MALFORMED_REPLY = 2007; // 0x7d7
+ field public static final int MIP_FA_MALFORMED_REQUEST = 2006; // 0x7d6
+ field public static final int MIP_FA_MISSING_CHALLENGE = 2017; // 0x7e1
+ field public static final int MIP_FA_MISSING_HOME_ADDRESS = 2015; // 0x7df
+ field public static final int MIP_FA_MISSING_HOME_AGENT = 2014; // 0x7de
+ field public static final int MIP_FA_MISSING_NAI = 2013; // 0x7dd
+ field public static final int MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2003; // 0x7d3
+ field public static final int MIP_FA_REASON_UNSPECIFIED = 2000; // 0x7d0
+ field public static final int MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 2005; // 0x7d5
+ field public static final int MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 2011; // 0x7db
+ field public static final int MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 2010; // 0x7da
+ field public static final int MIP_FA_STALE_CHALLENGE = 2018; // 0x7e2
+ field public static final int MIP_FA_UNKNOWN_CHALLENGE = 2016; // 0x7e0
+ field public static final int MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 2009; // 0x7d9
+ field public static final int MIP_HA_ADMIN_PROHIBITED = 2020; // 0x7e4
+ field public static final int MIP_HA_ENCAPSULATION_UNAVAILABLE = 2029; // 0x7ed
+ field public static final int MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 2023; // 0x7e7
+ field public static final int MIP_HA_INSUFFICIENT_RESOURCES = 2021; // 0x7e5
+ field public static final int MIP_HA_MALFORMED_REQUEST = 2025; // 0x7e9
+ field public static final int MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 2022; // 0x7e6
+ field public static final int MIP_HA_REASON_UNSPECIFIED = 2019; // 0x7e3
+ field public static final int MIP_HA_REGISTRATION_ID_MISMATCH = 2024; // 0x7e8
+ field public static final int MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 2028; // 0x7ec
+ field public static final int MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 2027; // 0x7eb
+ field public static final int MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 2026; // 0x7ea
field public static final int MISSING_UNKNOWN_APN = 27; // 0x1b
+ field public static final int MODEM_APP_PREEMPTED = 2032; // 0x7f0
+ field public static final int MODEM_RESTART = 2037; // 0x7f5
+ field public static final int MSC_TEMPORARILY_NOT_REACHABLE = 2180; // 0x884
field public static final int MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE = 101; // 0x65
field public static final int MSG_TYPE_NONCOMPATIBLE_STATE = 98; // 0x62
+ field public static final int MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 2099; // 0x833
+ field public static final int MULTIPLE_PDP_CALL_NOT_ALLOWED = 2192; // 0x890
field public static final int MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 55; // 0x37
+ field public static final int NAS_LAYER_FAILURE = 2191; // 0x88f
+ field public static final int NAS_REQUEST_REJECTED_BY_NETWORK = 2167; // 0x877
field public static final int NAS_SIGNALLING = 14; // 0xe
field public static final int NETWORK_FAILURE = 38; // 0x26
+ field public static final int NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 2154; // 0x86a
+ field public static final int NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 2153; // 0x869
+ field public static final int NETWORK_INITIATED_TERMINATION = 2031; // 0x7ef
field public static final int NONE = 0; // 0x0
+ field public static final int NON_IP_NOT_SUPPORTED = 2069; // 0x815
+ field public static final int NORMAL_RELEASE = 2218; // 0x8aa
+ field public static final int NO_CDMA_SERVICE = 2084; // 0x824
+ field public static final int NO_COLLOCATED_HDR = 2225; // 0x8b1
+ field public static final int NO_EPS_BEARER_CONTEXT_ACTIVATED = 2189; // 0x88d
+ field public static final int NO_GPRS_CONTEXT = 2094; // 0x82e
+ field public static final int NO_HYBRID_HDR_SERVICE = 2209; // 0x8a1
+ field public static final int NO_PDP_CONTEXT_ACTIVATED = 2107; // 0x83b
+ field public static final int NO_RESPONSE_FROM_BASE_STATION = 2081; // 0x821
+ field public static final int NO_SERVICE = 2216; // 0x8a8
+ field public static final int NO_SERVICE_ON_GATEWAY = 2093; // 0x82d
field public static final int NSAPI_IN_USE = 35; // 0x23
+ field public static final int NULL_APN_DISALLOWED = 2061; // 0x80d
field public static final int OEM_DCFAILCAUSE_1 = 4097; // 0x1001
field public static final int OEM_DCFAILCAUSE_10 = 4106; // 0x100a
field public static final int OEM_DCFAILCAUSE_11 = 4107; // 0x100b
@@ -6625,33 +6977,126 @@
field public static final int OEM_DCFAILCAUSE_7 = 4103; // 0x1007
field public static final int OEM_DCFAILCAUSE_8 = 4104; // 0x1008
field public static final int OEM_DCFAILCAUSE_9 = 4105; // 0x1009
+ field public static final int ONLY_IPV4V6_ALLOWED = 57; // 0x39
field public static final int ONLY_IPV4_ALLOWED = 50; // 0x32
field public static final int ONLY_IPV6_ALLOWED = 51; // 0x33
+ field public static final int ONLY_NON_IP_ALLOWED = 58; // 0x3a
field public static final int ONLY_SINGLE_BEARER_ALLOWED = 52; // 0x34
field public static final int OPERATOR_BARRED = 8; // 0x8
+ field public static final int OTASP_COMMIT_IN_PROGRESS = 2208; // 0x8a0
field public static final int PDN_CONN_DOES_NOT_EXIST = 54; // 0x36
+ field public static final int PDN_INACTIVITY_TIMER_EXPIRED = 2051; // 0x803
+ field public static final int PDN_IPV4_CALL_DISALLOWED = 2033; // 0x7f1
+ field public static final int PDN_IPV4_CALL_THROTTLED = 2034; // 0x7f2
+ field public static final int PDN_IPV6_CALL_DISALLOWED = 2035; // 0x7f3
+ field public static final int PDN_IPV6_CALL_THROTTLED = 2036; // 0x7f4
+ field public static final int PDN_NON_IP_CALL_DISALLOWED = 2071; // 0x817
+ field public static final int PDN_NON_IP_CALL_THROTTLED = 2070; // 0x816
+ field public static final int PDP_ACTIVATE_MAX_RETRY_FAILED = 2109; // 0x83d
+ field public static final int PDP_DUPLICATE = 2104; // 0x838
+ field public static final int PDP_ESTABLISH_TIMEOUT_EXPIRED = 2161; // 0x871
+ field public static final int PDP_INACTIVE_TIMEOUT_EXPIRED = 2163; // 0x873
+ field public static final int PDP_LOWERLAYER_ERROR = 2164; // 0x874
+ field public static final int PDP_MODIFY_COLLISION = 2165; // 0x875
+ field public static final int PDP_MODIFY_TIMEOUT_EXPIRED = 2162; // 0x872
+ field public static final int PDP_PPP_NOT_SUPPORTED = 2038; // 0x7f6
field public static final int PDP_WITHOUT_ACTIVE_TFT = 46; // 0x2e
+ field public static final int PHONE_IN_USE = 2222; // 0x8ae
+ field public static final int PHYSICAL_LINK_CLOSE_IN_PROGRESS = 2040; // 0x7f8
+ field public static final int PLMN_NOT_ALLOWED = 2101; // 0x835
+ field public static final int PPP_AUTH_FAILURE = 2229; // 0x8b5
+ field public static final int PPP_CHAP_FAILURE = 2232; // 0x8b8
+ field public static final int PPP_CLOSE_IN_PROGRESS = 2233; // 0x8b9
+ field public static final int PPP_OPTION_MISMATCH = 2230; // 0x8b6
+ field public static final int PPP_PAP_FAILURE = 2231; // 0x8b7
+ field public static final int PPP_TIMEOUT = 2228; // 0x8b4
field public static final int PREF_RADIO_TECH_CHANGED = -4; // 0xfffffffc
+ field public static final int PROFILE_BEARER_INCOMPATIBLE = 2042; // 0x7fa
field public static final int PROTOCOL_ERRORS = 111; // 0x6f
field public static final int QOS_NOT_ACCEPTED = 37; // 0x25
+ field public static final int RADIO_ACCESS_BEARER_FAILURE = 2110; // 0x83e
+ field public static final int RADIO_ACCESS_BEARER_SETUP_FAILURE = 2160; // 0x870
field public static final int RADIO_NOT_AVAILABLE = 65537; // 0x10001
field public static final int RADIO_POWER_OFF = -5; // 0xfffffffb
+ field public static final int REDIRECTION_OR_HANDOFF_IN_PROGRESS = 2220; // 0x8ac
field public static final int REGISTRATION_FAIL = -1; // 0xffffffff
field public static final int REGULAR_DEACTIVATION = 36; // 0x24
+ field public static final int REJECTED_BY_BASE_STATION = 2082; // 0x822
+ field public static final int RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 2173; // 0x87d
+ field public static final int RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 2174; // 0x87e
+ field public static final int RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 2171; // 0x87b
+ field public static final int RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 2175; // 0x87f
+ field public static final int RRC_CONNECTION_ABORT_REQUEST = 2151; // 0x867
+ field public static final int RRC_CONNECTION_ACCESS_BARRED = 2139; // 0x85b
+ field public static final int RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 2137; // 0x859
+ field public static final int RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 2138; // 0x85a
+ field public static final int RRC_CONNECTION_CELL_NOT_CAMPED = 2144; // 0x860
+ field public static final int RRC_CONNECTION_CELL_RESELECTION = 2140; // 0x85c
+ field public static final int RRC_CONNECTION_CONFIG_FAILURE = 2141; // 0x85d
+ field public static final int RRC_CONNECTION_INVALID_REQUEST = 2168; // 0x878
+ field public static final int RRC_CONNECTION_LINK_FAILURE = 2143; // 0x85f
+ field public static final int RRC_CONNECTION_NORMAL_RELEASE = 2147; // 0x863
+ field public static final int RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 2150; // 0x866
+ field public static final int RRC_CONNECTION_RADIO_LINK_FAILURE = 2148; // 0x864
+ field public static final int RRC_CONNECTION_REESTABLISHMENT_FAILURE = 2149; // 0x865
+ field public static final int RRC_CONNECTION_REJECT_BY_NETWORK = 2146; // 0x862
+ field public static final int RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 2172; // 0x87c
+ field public static final int RRC_CONNECTION_RF_UNAVAILABLE = 2170; // 0x87a
+ field public static final int RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 2152; // 0x868
+ field public static final int RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 2145; // 0x861
+ field public static final int RRC_CONNECTION_TIMER_EXPIRED = 2142; // 0x85e
+ field public static final int RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 2169; // 0x879
+ field public static final int RRC_UPLINK_CONNECTION_RELEASE = 2134; // 0x856
+ field public static final int RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 2132; // 0x854
+ field public static final int RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 2133; // 0x855
+ field public static final int RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 2136; // 0x858
+ field public static final int RRC_UPLINK_RADIO_LINK_FAILURE = 2135; // 0x857
+ field public static final int RUIM_NOT_PRESENT = 2085; // 0x825
+ field public static final int SECURITY_MODE_REJECTED = 2186; // 0x88a
+ field public static final int SERVICE_NOT_ALLOWED_ON_PLMN = 2129; // 0x851
field public static final int SERVICE_OPTION_NOT_SUBSCRIBED = 33; // 0x21
field public static final int SERVICE_OPTION_NOT_SUPPORTED = 32; // 0x20
field public static final int SERVICE_OPTION_OUT_OF_ORDER = 34; // 0x22
field public static final int SIGNAL_LOST = -3; // 0xfffffffd
+ field public static final int SIM_CARD_CHANGED = 2043; // 0x7fb
+ field public static final int SYNCHRONIZATION_FAILURE = 2184; // 0x888
+ field public static final int TEST_LOOPBACK_REGULAR_DEACTIVATION = 2196; // 0x894
field public static final int TETHERED_CALL_ACTIVE = -6; // 0xfffffffa
field public static final int TFT_SEMANTIC_ERROR = 41; // 0x29
field public static final int TFT_SYTAX_ERROR = 42; // 0x2a
+ field public static final int THERMAL_EMERGENCY = 2090; // 0x82a
+ field public static final int THERMAL_MITIGATION = 2062; // 0x80e
+ field public static final int TRAT_SWAP_FAILED = 2048; // 0x800
+ field public static final int UE_INITIATED_DETACH_OR_DISCONNECT = 128; // 0x80
+ field public static final int UE_IS_ENTERING_POWERSAVE_MODE = 2226; // 0x8b2
+ field public static final int UE_RAT_CHANGE = 2105; // 0x839
+ field public static final int UE_SECURITY_CAPABILITIES_MISMATCH = 2185; // 0x889
+ field public static final int UMTS_HANDOVER_TO_IWLAN = 2199; // 0x897
field public static final int UMTS_REACTIVATION_REQ = 39; // 0x27
+ field public static final int UNACCEPTABLE_NON_EPS_AUTHENTICATION = 2187; // 0x88b
field public static final int UNKNOWN = 65536; // 0x10000
field public static final int UNKNOWN_INFO_ELEMENT = 99; // 0x63
field public static final int UNKNOWN_PDP_ADDRESS_TYPE = 28; // 0x1c
field public static final int UNKNOWN_PDP_CONTEXT = 43; // 0x2b
+ field public static final int UNPREFERRED_RAT = 2039; // 0x7f7
+ field public static final int UNSUPPORTED_1X_PREV = 2214; // 0x8a6
field public static final int UNSUPPORTED_APN_IN_CURRENT_PLMN = 66; // 0x42
+ field public static final int UNSUPPORTED_QCI_VALUE = 59; // 0x3b
field public static final int USER_AUTHENTICATION = 29; // 0x1d
+ field public static final int VSNCP_ADMINISTRATIVELY_PROHIBITED = 2245; // 0x8c5
+ field public static final int VSNCP_APN_UNATHORIZED = 2238; // 0x8be
+ field public static final int VSNCP_GEN_ERROR = 2237; // 0x8bd
+ field public static final int VSNCP_INSUFFICIENT_PARAMETERS = 2243; // 0x8c3
+ field public static final int VSNCP_NO_PDN_GATEWAY_ADDRESS = 2240; // 0x8c0
+ field public static final int VSNCP_PDN_EXISTS_FOR_THIS_APN = 2248; // 0x8c8
+ field public static final int VSNCP_PDN_GATEWAY_REJECT = 2242; // 0x8c2
+ field public static final int VSNCP_PDN_GATEWAY_UNREACHABLE = 2241; // 0x8c1
+ field public static final int VSNCP_PDN_ID_IN_USE = 2246; // 0x8c6
+ field public static final int VSNCP_PDN_LIMIT_EXCEEDED = 2239; // 0x8bf
+ field public static final int VSNCP_RECONNECT_NOT_ALLOWED = 2249; // 0x8c9
+ field public static final int VSNCP_RESOURCE_UNAVAILABLE = 2244; // 0x8c4
+ field public static final int VSNCP_SUBSCRIBER_LIMITATION = 2247; // 0x8c7
+ field public static final int VSNCP_TIMEOUT = 2236; // 0x8bc
}
public class DisconnectCause {
@@ -8461,6 +8906,22 @@
package android.util {
+ public class DocumentsStatsLog {
+ method public static void logActivityLaunch(int, boolean, int, int);
+ method public static void logFileOperation(int, int);
+ method public static void logFileOperationCanceled(int);
+ method public static void logFileOperationCopyMoveMode(int, int);
+ method public static void logFileOperationFailure(int, int);
+ method public static void logFilePick(int, long, int, boolean, int, int, int);
+ method public static void logInvalidScopedAccessRequest(int);
+ method public static void logPickerLaunchedFrom(String);
+ method public static void logRootVisited(int, int);
+ method public static void logSearchMode(int);
+ method public static void logSearchType(int);
+ method public static void logStartupMs(int);
+ method public static void logUserAction(int);
+ }
+
public class EventLog {
method public static void readEventsOnWrapping(int[], long, java.util.Collection<android.util.EventLog.Event>) throws java.io.IOException;
}
@@ -8956,6 +9417,10 @@
field public final android.content.pm.Signature[] signatures;
}
+ public abstract class WebViewRenderer {
+ ctor public WebViewRenderer();
+ }
+
public final class WebViewUpdateService {
method public static android.webkit.WebViewProviderInfo[] getAllWebViewPackages();
method public static String getCurrentWebViewPackageName();
diff --git a/api/test-current.txt b/api/test-current.txt
index b829758..d089831 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -781,6 +781,8 @@
package android.net {
public class CaptivePortal implements android.os.Parcelable {
+ ctor public CaptivePortal(android.os.IBinder);
+ method public void useNetwork();
field public static final int APP_RETURN_DISMISSED = 0; // 0x0
field public static final int APP_RETURN_UNWANTED = 1; // 0x1
field public static final int APP_RETURN_WANTED_AS_IS = 2; // 0x2
@@ -802,6 +804,25 @@
method public boolean isSameAddressAs(android.net.LinkAddress);
}
+ public final class LinkProperties implements android.os.Parcelable {
+ method public boolean addDnsServer(java.net.InetAddress);
+ method public String getTcpBufferSizes();
+ method public java.util.List<java.net.InetAddress> getValidatedPrivateDnsServers();
+ method public boolean hasGlobalIPv6Address();
+ method public boolean hasIPv4Address();
+ method public boolean hasIPv6DefaultRoute();
+ method public boolean isIPv4Provisioned();
+ method public boolean isIPv6Provisioned();
+ method public boolean isProvisioned();
+ method public boolean isReachable(java.net.InetAddress);
+ method public boolean removeDnsServer(java.net.InetAddress);
+ method public boolean removeRoute(android.net.RouteInfo);
+ method public void setPrivateDnsServerName(@Nullable String);
+ method public void setTcpBufferSizes(String);
+ method public void setUsePrivateDns(boolean);
+ method public void setValidatedPrivateDnsServers(java.util.Collection<java.net.InetAddress>);
+ }
+
public class Network implements android.os.Parcelable {
method public android.net.Network getPrivateDnsBypassingCopy();
}
@@ -809,6 +830,7 @@
public final class NetworkCapabilities implements android.os.Parcelable {
method public int[] getCapabilities();
method public int[] getTransportTypes();
+ method public boolean satisfiedByNetworkCapabilities(android.net.NetworkCapabilities);
}
public final class RouteInfo implements android.os.Parcelable {
@@ -827,6 +849,147 @@
}
+package android.net.metrics {
+
+ public final class ApfProgramEvent implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static class ApfProgramEvent.Builder {
+ ctor public ApfProgramEvent.Builder();
+ method public android.net.metrics.ApfProgramEvent build();
+ method public android.net.metrics.ApfProgramEvent.Builder setActualLifetime(long);
+ method public android.net.metrics.ApfProgramEvent.Builder setCurrentRas(int);
+ method public android.net.metrics.ApfProgramEvent.Builder setFilteredRas(int);
+ method public android.net.metrics.ApfProgramEvent.Builder setFlags(boolean, boolean);
+ method public android.net.metrics.ApfProgramEvent.Builder setLifetime(long);
+ method public android.net.metrics.ApfProgramEvent.Builder setProgramLength(int);
+ }
+
+ public final class ApfStats implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static class ApfStats.Builder {
+ ctor public ApfStats.Builder();
+ method public android.net.metrics.ApfStats build();
+ method public android.net.metrics.ApfStats.Builder setDroppedRas(int);
+ method public android.net.metrics.ApfStats.Builder setDurationMs(long);
+ method public android.net.metrics.ApfStats.Builder setMatchingRas(int);
+ method public android.net.metrics.ApfStats.Builder setMaxProgramSize(int);
+ method public android.net.metrics.ApfStats.Builder setParseErrors(int);
+ method public android.net.metrics.ApfStats.Builder setProgramUpdates(int);
+ method public android.net.metrics.ApfStats.Builder setProgramUpdatesAll(int);
+ method public android.net.metrics.ApfStats.Builder setProgramUpdatesAllowingMulticast(int);
+ method public android.net.metrics.ApfStats.Builder setReceivedRas(int);
+ method public android.net.metrics.ApfStats.Builder setZeroLifetimeRas(int);
+ }
+
+ public final class DhcpClientEvent implements android.net.metrics.IpConnectivityLog.Event {
+ }
+
+ public static class DhcpClientEvent.Builder {
+ ctor public DhcpClientEvent.Builder();
+ method public android.net.metrics.DhcpClientEvent build();
+ method public android.net.metrics.DhcpClientEvent.Builder setDurationMs(int);
+ method public android.net.metrics.DhcpClientEvent.Builder setMsg(String);
+ }
+
+ public final class DhcpErrorEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public DhcpErrorEvent(int);
+ method public static int errorCodeWithOption(int, int);
+ field public static final int BOOTP_TOO_SHORT;
+ field public static final int BUFFER_UNDERFLOW;
+ field public static final int DHCP_BAD_MAGIC_COOKIE;
+ field public static final int DHCP_ERROR = 4; // 0x4
+ field public static final int DHCP_INVALID_OPTION_LENGTH;
+ field public static final int DHCP_NO_COOKIE;
+ field public static final int DHCP_NO_MSG_TYPE;
+ field public static final int DHCP_UNKNOWN_MSG_TYPE;
+ field public static final int L2_ERROR = 1; // 0x1
+ field public static final int L2_TOO_SHORT;
+ field public static final int L2_WRONG_ETH_TYPE;
+ field public static final int L3_ERROR = 2; // 0x2
+ field public static final int L3_INVALID_IP;
+ field public static final int L3_NOT_IPV4;
+ field public static final int L3_TOO_SHORT;
+ field public static final int L4_ERROR = 3; // 0x3
+ field public static final int L4_NOT_UDP;
+ field public static final int L4_WRONG_PORT;
+ field public static final int MISC_ERROR = 5; // 0x5
+ field public static final int PARSING_ERROR;
+ field public static final int RECEIVE_ERROR;
+ }
+
+ public class IpConnectivityLog {
+ method public boolean log(long, android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(String, android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(android.net.Network, int[], android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(int, int[], android.net.metrics.IpConnectivityLog.Event);
+ method public boolean log(android.net.metrics.IpConnectivityLog.Event);
+ }
+
+ public static interface IpConnectivityLog.Event extends android.os.Parcelable {
+ }
+
+ public final class IpManagerEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public IpManagerEvent(int, long);
+ field public static final int COMPLETE_LIFECYCLE = 3; // 0x3
+ field public static final int ERROR_INTERFACE_NOT_FOUND = 8; // 0x8
+ field public static final int ERROR_INVALID_PROVISIONING = 7; // 0x7
+ field public static final int ERROR_STARTING_IPREACHABILITYMONITOR = 6; // 0x6
+ field public static final int ERROR_STARTING_IPV4 = 4; // 0x4
+ field public static final int ERROR_STARTING_IPV6 = 5; // 0x5
+ field public static final int PROVISIONING_FAIL = 2; // 0x2
+ field public static final int PROVISIONING_OK = 1; // 0x1
+ }
+
+ public final class IpReachabilityEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public IpReachabilityEvent(int);
+ field public static final int NUD_FAILED = 512; // 0x200
+ field public static final int NUD_FAILED_ORGANIC = 1024; // 0x400
+ field public static final int PROBE = 256; // 0x100
+ field public static final int PROVISIONING_LOST = 768; // 0x300
+ field public static final int PROVISIONING_LOST_ORGANIC = 1280; // 0x500
+ }
+
+ public final class NetworkEvent implements android.net.metrics.IpConnectivityLog.Event {
+ ctor public NetworkEvent(int, long);
+ ctor public NetworkEvent(int);
+ field public static final int NETWORK_CAPTIVE_PORTAL_FOUND = 4; // 0x4
+ field public static final int NETWORK_CONNECTED = 1; // 0x1
+ field public static final int NETWORK_CONSECUTIVE_DNS_TIMEOUT_FOUND = 12; // 0xc
+ field public static final int NETWORK_DISCONNECTED = 7; // 0x7
+ field public static final int NETWORK_FIRST_VALIDATION_PORTAL_FOUND = 10; // 0xa
+ field public static final int NETWORK_FIRST_VALIDATION_SUCCESS = 8; // 0x8
+ field public static final int NETWORK_LINGER = 5; // 0x5
+ field public static final int NETWORK_REVALIDATION_PORTAL_FOUND = 11; // 0xb
+ field public static final int NETWORK_REVALIDATION_SUCCESS = 9; // 0x9
+ field public static final int NETWORK_UNLINGER = 6; // 0x6
+ field public static final int NETWORK_VALIDATED = 2; // 0x2
+ field public static final int NETWORK_VALIDATION_FAILED = 3; // 0x3
+ }
+
+ public final class ValidationProbeEvent implements android.net.metrics.IpConnectivityLog.Event {
+ method public static String getProbeName(int);
+ field public static final int DNS_FAILURE = 0; // 0x0
+ field public static final int DNS_SUCCESS = 1; // 0x1
+ field public static final int PROBE_DNS = 0; // 0x0
+ field public static final int PROBE_FALLBACK = 4; // 0x4
+ field public static final int PROBE_HTTP = 1; // 0x1
+ field public static final int PROBE_HTTPS = 2; // 0x2
+ field public static final int PROBE_PAC = 3; // 0x3
+ field public static final int PROBE_PRIVDNS = 5; // 0x5
+ }
+
+ public static class ValidationProbeEvent.Builder {
+ ctor public ValidationProbeEvent.Builder();
+ method public android.net.metrics.ValidationProbeEvent build();
+ method public android.net.metrics.ValidationProbeEvent.Builder setDurationMs(long);
+ method public android.net.metrics.ValidationProbeEvent.Builder setProbeType(int, boolean);
+ method public android.net.metrics.ValidationProbeEvent.Builder setReturnCode(int);
+ }
+
+}
+
package android.os {
public class Build {
diff --git a/cmds/bootanimation/bootanim.rc b/cmds/bootanimation/bootanim.rc
index 469c964..1b3c32b 100644
--- a/cmds/bootanimation/bootanim.rc
+++ b/cmds/bootanimation/bootanim.rc
@@ -2,6 +2,7 @@
class core animation
user graphics
group graphics audio
+ updatable
disabled
oneshot
writepid /dev/stune/top-app/tasks
diff --git a/cmds/statsd/src/StatsService.cpp b/cmds/statsd/src/StatsService.cpp
index 3107b4d..820da55 100644
--- a/cmds/statsd/src/StatsService.cpp
+++ b/cmds/statsd/src/StatsService.cpp
@@ -1089,6 +1089,14 @@
return hardware::Void();
}
+hardware::Return<void> StatsService::reportUsbPortOverheatEvent(
+ const UsbPortOverheatEvent& usbPortOverheatEvent) {
+ LogEvent event(getWallClockSec() * NS_PER_SEC, getElapsedRealtimeNs(), usbPortOverheatEvent);
+ mProcessor->OnLogEvent(&event);
+
+ return hardware::Void();
+}
+
void StatsService::binderDied(const wp <IBinder>& who) {
ALOGW("statscompanion service died");
StatsdStats::getInstance().noteSystemServerRestart(getWallClockSec());
diff --git a/cmds/statsd/src/StatsService.h b/cmds/statsd/src/StatsService.h
index 135a3c9..e9b3d4f 100644
--- a/cmds/statsd/src/StatsService.h
+++ b/cmds/statsd/src/StatsService.h
@@ -199,6 +199,12 @@
virtual Return<void> reportBatteryCausedShutdown(
const BatteryCausedShutdown& batteryCausedShutdown) override;
+ /**
+ * Binder call to get UsbPortOverheatEvent atom.
+ */
+ virtual Return<void> reportUsbPortOverheatEvent(
+ const UsbPortOverheatEvent& usbPortOverheatEvent) override;
+
/** IBinder::DeathRecipient */
virtual void binderDied(const wp<IBinder>& who) override;
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index ef3eac0..961a2c9 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -91,7 +91,7 @@
ChargingStateChanged charging_state_changed = 31;
PluggedStateChanged plugged_state_changed = 32;
InteractiveStateChanged interactive_state_changed = 33;
- // 34 is available
+ TouchEventReported touch_event_reported = 34;
WakeupAlarmOccurred wakeup_alarm_occurred = 35;
KernelWakeupReported kernel_wakeup_reported = 36;
WifiLockStateChanged wifi_lock_state_changed = 37;
@@ -193,6 +193,16 @@
LowStorageStateChanged low_storage_state_changed = 130;
GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
GnssConfigurationReported gnss_configuration_reported = 132;
+ UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
+ NfcErrorOccurred nfc_error_occurred = 134;
+ NfcStateChanged nfc_state_changed = 135;
+ NfcBeamOccurred nfc_beam_occurred = 136;
+ NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
+ NfcTagOccurred nfc_tag_occurred = 138;
+ NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
+ SeStateChanged se_state_changed = 140;
+ SeOmapiReported se_omapi_reported = 141;
+ BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
}
// Pulled events will start at field 10000.
@@ -243,6 +253,7 @@
ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
BatteryLevel battery_level = 10043;
BuildInformation build_information = 10044;
+ BatteryCycleCount battery_cycle_count = 10045;
}
// DO NOT USE field numbers above 100,000 in AOSP.
@@ -1735,6 +1746,33 @@
}
/**
+ * Logs basic timing information about touch events.
+ * Reported at most every 5 minutes while device is being interacted with.
+ *
+ * Logged from:
+ * frameworks/native/services/inputflinger
+ */
+message TouchEventReported {
+ /**
+ * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
+ * and the standard deviation of latency between the kernel and framework
+ * for touchscreen events. The units are microseconds.
+ *
+ * The number is measured as the difference between the time at which
+ * the input event was received in the evdev driver,
+ * and the time at which the input event was received in EventHub.
+ */
+ // Minimum value
+ optional float latency_min_micros = 1;
+ // Maximum value
+ optional float latency_max_micros = 2;
+ // Average value
+ optional float latency_mean_micros = 3;
+ // Standard deviation
+ optional float latency_stdev_micros = 4;
+}
+
+/**
* Logs that a setting was updated.
* Logged from:
* frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
@@ -2468,6 +2506,37 @@
optional State state = 3;
}
+/** Represents USB port overheat event. */
+message UsbPortOverheatEvent {
+ /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
+ optional int32 plug_temperature_deci_c = 1;
+
+ /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
+ optional int32 max_temperature_deci_c = 2;
+
+ /* Time between USB plug event and overheat threshold trip, in seconds. */
+ optional int32 time_to_overheat_secs = 3;
+
+ /* Time between overheat threshold trip and hysteresis, in seconds. */
+ optional int32 time_to_hysteresis_secs = 4;
+
+ /* Time between hysteresis and active mitigation ending, in seconds. */
+ optional int32 time_to_inactive_secs = 5;
+};
+
+/**
+ * Logs total effective full charge and discharge cycles on a battery.
+ * Here are some examples of one effective cycle:
+ * 1) the battery charges from 0% to 100% and drains back to 0%,
+ * 2) charging from 50% to 100% and draining back to 50% twice.
+ * Pulled from:
+ * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
+ */
+message BatteryCycleCount {
+ /* Number of total charge and discharge cycles on the system battery. */
+ optional int32 cycle_count = 1;
+}
+
/*
* Logs when a connection becomes available and lost.
* Logged in StatsCompanionService.java
@@ -4263,3 +4332,148 @@
// with spaces as separators.
optional string enabled_proxy_app_package_name_list = 13;
}
+
+/**
+ * Logs when a NFC device's error occurred.
+ * Logged from:
+ * system/nfc/src/nfc/nfc/nfc_ncif.cc
+ * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
+ */
+message NfcErrorOccurred {
+ enum Type {
+ UNKNOWN = 0;
+ CMD_TIMEOUT = 1;
+ ERROR_NOTIFICATION = 2;
+ AID_OVERFLOW = 3;
+ }
+ optional Type type = 1;
+ // If it's nci cmd timeout, log the timeout command.
+ optional uint32 nci_cmd = 2;
+
+ optional uint32 error_ntf_status_code = 3;
+}
+
+/**
+ * Logs when a NFC device's state changed event
+ * Logged from:
+ * packages/apps/Nfc/src/com/android/nfc/NfcService.java
+ */
+message NfcStateChanged {
+ enum State {
+ UNKNOWN = 0;
+ OFF = 1;
+ ON = 2;
+ ON_LOCKED = 3; // Secure Nfc enabled.
+ CRASH_RESTART = 4; // NfcService watchdog timeout restart.
+ }
+ optional State state = 1;
+}
+
+/**
+ * Logs when a NFC Beam Transaction occurred.
+ * Logged from:
+ * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
+ */
+message NfcBeamOccurred {
+ enum Operation {
+ UNKNOWN = 0;
+ SEND = 1;
+ RECEIVE = 2;
+ }
+ optional Operation operation = 1;
+}
+
+/**
+ * Logs when a NFC Card Emulation Transaction occurred.
+ * Logged from:
+ * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
+ * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
+ */
+message NfcCardemulationOccurred {
+ enum Category {
+ UNKNOWN = 0;
+ HCE_PAYMENT = 1;
+ HCE_OTHER = 2;
+ OFFHOST = 3;
+ }
+ // Transaction belongs to HCE payment or HCE other category, or offhost.
+ optional Category category = 1;
+ // SeName from transaction: SIMx, eSEx, HCE, HCEF.
+ optional string se_name = 2;
+}
+
+/**
+ * Logs when a NFC Tag event occurred.
+ * Logged from:
+ * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
+ */
+message NfcTagOccurred {
+ enum Type {
+ UNKNOWN = 0;
+ URL = 1;
+ BT_PAIRING = 2;
+ PROVISION = 3;
+ WIFI_CONNECT = 4;
+ APP_LAUNCH = 5;
+ OTHERS = 6;
+ }
+ optional Type type = 1;
+}
+
+/**
+ * Logs when Hce transaction triggered
+ * Logged from:
+ * system/nfc/src/nfc/nfc/nfc_ncif.cc
+ */
+message NfcHceTransactionOccurred {
+ // The latency period(in microseconds) it took for the first HCE data
+ // exchange.
+ optional uint32 latency_micros = 1;
+}
+
+/**
+ * Logs when SecureElement state event changed
+ * Logged from:
+ * packages/apps/SecureElement/src/com/android/se/Terminal.java
+ */
+message SeStateChanged {
+ enum State {
+ UNKNOWN = 0;
+ INITIALIZED = 1;
+ DISCONNECTED = 2;
+ CONNECTED = 3;
+ HALCRASH = 4;
+ }
+ optional State state = 1;
+
+ optional string state_change_reason = 2;
+ // SIMx or eSEx.
+ optional string terminal = 3;
+}
+
+/**
+ * Logs when Omapi API used
+ * Logged from:
+ * packages/apps/SecureElement/src/com/android/se/Terminal.java
+ */
+message SeOmapiReported {
+ enum Operation {
+ UNKNOWN = 0;
+ OPEN_CHANNEL = 1;
+ }
+ optional Operation operation = 1;
+ // SIMx or eSEx.
+ optional string terminal = 2;
+
+ optional string packageName = 3;
+}
+
+/**
+ * Logs the dispatch latencey of a broadcast during processing of BOOT_COMPLETED.
+ * The dispatch latencey is the dispatchClockTime - enqueueClockTime.
+ * Logged from:
+ * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
+ */
+message BroadcastDispatchLatencyReported {
+ optional int64 dispatch_latency_millis = 1;
+}
diff --git a/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp b/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
index b878652..75b63f4 100644
--- a/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
+++ b/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
@@ -24,16 +24,16 @@
#include "ResourceHealthManagerPuller.h"
#include "logd/LogEvent.h"
-#include "statslog.h"
#include "stats_log_util.h"
+#include "statslog.h"
using android::hardware::hidl_vec;
+using android::hardware::Return;
+using android::hardware::Void;
using android::hardware::health::V2_0::get_health_service;
using android::hardware::health::V2_0::HealthInfo;
using android::hardware::health::V2_0::IHealth;
using android::hardware::health::V2_0::Result;
-using android::hardware::Return;
-using android::hardware::Void;
using std::make_shared;
using std::shared_ptr;
@@ -75,35 +75,41 @@
}
if (mTagId == android::util::REMAINING_BATTERY_CAPACITY) {
auto ptr = make_shared<LogEvent>(android::util::REMAINING_BATTERY_CAPACITY,
- wallClockTimestampNs, elapsedTimestampNs);
+ wallClockTimestampNs, elapsedTimestampNs);
ptr->write(v.legacy.batteryChargeCounter);
ptr->init();
data->push_back(ptr);
} else if (mTagId == android::util::FULL_BATTERY_CAPACITY) {
auto ptr = make_shared<LogEvent>(android::util::FULL_BATTERY_CAPACITY,
- wallClockTimestampNs, elapsedTimestampNs);
+ wallClockTimestampNs, elapsedTimestampNs);
ptr->write(v.legacy.batteryFullCharge);
ptr->init();
data->push_back(ptr);
} else if (mTagId == android::util::BATTERY_VOLTAGE) {
- auto ptr = make_shared<LogEvent>(android::util::BATTERY_VOLTAGE,
- wallClockTimestampNs, elapsedTimestampNs);
+ auto ptr = make_shared<LogEvent>(android::util::BATTERY_VOLTAGE, wallClockTimestampNs,
+ elapsedTimestampNs);
ptr->write(v.legacy.batteryVoltage);
ptr->init();
data->push_back(ptr);
} else if (mTagId == android::util::BATTERY_LEVEL) {
- auto ptr = make_shared<LogEvent>(android::util::BATTERY_LEVEL,
- wallClockTimestampNs, elapsedTimestampNs);
- ptr->write(v.legacy.batteryLevel);
- ptr->init();
- data->push_back(ptr);
+ auto ptr = make_shared<LogEvent>(android::util::BATTERY_LEVEL, wallClockTimestampNs,
+ elapsedTimestampNs);
+ ptr->write(v.legacy.batteryLevel);
+ ptr->init();
+ data->push_back(ptr);
+ } else if (mTagId == android::util::BATTERY_CYCLE_COUNT) {
+ auto ptr = make_shared<LogEvent>(android::util::BATTERY_CYCLE_COUNT,
+ wallClockTimestampNs, elapsedTimestampNs);
+ ptr->write(v.legacy.batteryCycleCount);
+ ptr->init();
+ data->push_back(ptr);
} else {
ALOGE("Unsupported tag in ResourceHealthManagerPuller: %d", mTagId);
}
});
if (!result_success || !ret.isOk()) {
ALOGE("getHealthHal() failed: health HAL service not available. Description: %s",
- ret.description().c_str());
+ ret.description().c_str());
if (!ret.isOk() && ret.isDeadObject()) {
gHealthHal = nullptr;
}
diff --git a/cmds/statsd/src/external/StatsPullerManager.cpp b/cmds/statsd/src/external/StatsPullerManager.cpp
index 4a716cf..19a7389 100644
--- a/cmds/statsd/src/external/StatsPullerManager.cpp
+++ b/cmds/statsd/src/external/StatsPullerManager.cpp
@@ -131,9 +131,12 @@
// battery_voltage
{android::util::BATTERY_VOLTAGE,
{.puller = new ResourceHealthManagerPuller(android::util::BATTERY_VOLTAGE)}},
- // battery_voltage
+ // battery_level
{android::util::BATTERY_LEVEL,
{.puller = new ResourceHealthManagerPuller(android::util::BATTERY_LEVEL)}},
+ // battery_cycle_count
+ {android::util::BATTERY_CYCLE_COUNT,
+ {.puller = new ResourceHealthManagerPuller(android::util::BATTERY_CYCLE_COUNT)}},
// process_memory_state
{android::util::PROCESS_MEMORY_STATE,
{.additiveFields = {4, 5, 6, 7, 8, 9},
diff --git a/cmds/statsd/src/logd/LogEvent.cpp b/cmds/statsd/src/logd/LogEvent.cpp
index 2ff8aa1..78a75c5 100644
--- a/cmds/statsd/src/logd/LogEvent.cpp
+++ b/cmds/statsd/src/logd/LogEvent.cpp
@@ -276,6 +276,24 @@
Value(batteryCausedShutdown.voltageMicroV)));
}
+LogEvent::LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
+ const UsbPortOverheatEvent& usbPortOverheatEvent) {
+ mLogdTimestampNs = wallClockTimestampNs;
+ mElapsedTimestampNs = elapsedTimestampNs;
+ mTagId = android::util::USB_PORT_OVERHEAT_EVENT_REPORTED;
+
+ mValues.push_back(FieldValue(Field(mTagId, getSimpleField(1)),
+ Value(usbPortOverheatEvent.plugTemperatureDeciC)));
+ mValues.push_back(FieldValue(Field(mTagId, getSimpleField(2)),
+ Value(usbPortOverheatEvent.maxTemperatureDeciC)));
+ mValues.push_back(FieldValue(Field(mTagId, getSimpleField(3)),
+ Value(usbPortOverheatEvent.timeToOverheat)));
+ mValues.push_back(FieldValue(Field(mTagId, getSimpleField(4)),
+ Value(usbPortOverheatEvent.timeToHysteresis)));
+ mValues.push_back(FieldValue(Field(mTagId, getSimpleField(5)),
+ Value(usbPortOverheatEvent.timeToInactive)));
+}
+
LogEvent::LogEvent(int32_t tagId, int64_t timestampNs) : LogEvent(tagId, timestampNs, 0) {}
LogEvent::LogEvent(int32_t tagId, int64_t timestampNs, int32_t uid) {
diff --git a/cmds/statsd/src/logd/LogEvent.h b/cmds/statsd/src/logd/LogEvent.h
index 43e6e4f..3f47b7e 100644
--- a/cmds/statsd/src/logd/LogEvent.h
+++ b/cmds/statsd/src/logd/LogEvent.h
@@ -118,6 +118,9 @@
explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
const BatteryCausedShutdown& batteryCausedShutdown);
+ explicit LogEvent(int64_t wallClockTimestampNs, int64_t elapsedTimestampNs,
+ const UsbPortOverheatEvent& usbPortOverheatEvent);
+
~LogEvent();
/**
diff --git a/config/boot-image-profile.txt b/config/boot-image-profile.txt
index 3ec0db4..c2e441b 100644
--- a/config/boot-image-profile.txt
+++ b/config/boot-image-profile.txt
@@ -2768,6 +2768,11 @@
HPLandroid/hardware/location/GeofenceHardwareService$1;->registerForMonitorStateChangeCallback(ILandroid/hardware/location/IGeofenceHardwareMonitorCallback;)Z
HPLandroid/hardware/location/GeofenceHardwareService$1;->removeGeofence(II)Z
HPLandroid/hardware/location/GeofenceHardwareService;->checkPermission(III)V
+HPLandroid/hardware/location/IActivityRecognitionHardwareClient$Stub$Proxy;->onAvailabilityChanged(ZLandroid/hardware/location/IActivityRecognitionHardware;)V
+HPLandroid/hardware/location/IActivityRecognitionHardwareClient$Stub;-><init>()V
+HPLandroid/hardware/location/IActivityRecognitionHardwareClient$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/location/IActivityRecognitionHardwareClient;
+HPLandroid/hardware/location/IActivityRecognitionHardwareClient$Stub;->onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
+HPLandroid/hardware/location/IActivityRecognitionHardwareClient;->onAvailabilityChanged(ZLandroid/hardware/location/IActivityRecognitionHardware;)V
HPLandroid/hardware/location/IContextHubCallback$Stub;->asBinder()Landroid/os/IBinder;
HPLandroid/hardware/location/IContextHubCallback$Stub;->onTransact(ILandroid/os/Parcel;Landroid/os/Parcel;I)Z
HPLandroid/hardware/location/IContextHubService$Stub$Proxy;->findNanoAppOnHub(ILandroid/hardware/location/NanoAppFilter;)[I
@@ -21777,6 +21782,7 @@
HSPLandroid/hardware/input/TouchCalibration$1;-><init>()V
HSPLandroid/hardware/input/TouchCalibration;-><init>()V
HSPLandroid/hardware/input/TouchCalibration;->getAffineTransform()[F
+HSPLandroid/hardware/location/ActivityRecognitionHardware;->isSupported()Z
HSPLandroid/hardware/location/ContextHubInfo$1;-><init>()V
HSPLandroid/hardware/location/ContextHubInfo;-><init>(Landroid/hardware/contexthub/V1_0/ContextHub;)V
HSPLandroid/hardware/location/ContextHubMessage$1;-><init>()V
@@ -21796,6 +21802,13 @@
HSPLandroid/hardware/location/GeofenceHardwareService;-><init>()V
HSPLandroid/hardware/location/GeofenceHardwareService;->onBind(Landroid/content/Intent;)Landroid/os/IBinder;
HSPLandroid/hardware/location/GeofenceHardwareService;->onCreate()V
+HSPLandroid/hardware/location/IActivityRecognitionHardware;->disableActivityEvent(Ljava/lang/String;I)Z
+HSPLandroid/hardware/location/IActivityRecognitionHardware;->enableActivityEvent(Ljava/lang/String;IJ)Z
+HSPLandroid/hardware/location/IActivityRecognitionHardware;->flush()Z
+HSPLandroid/hardware/location/IActivityRecognitionHardware;->getSupportedActivities()[Ljava/lang/String;
+HSPLandroid/hardware/location/IActivityRecognitionHardware;->isActivitySupported(Ljava/lang/String;)Z
+HSPLandroid/hardware/location/IActivityRecognitionHardware;->registerSink(Landroid/hardware/location/IActivityRecognitionHardwareSink;)Z
+HSPLandroid/hardware/location/IActivityRecognitionHardware;->unregisterSink(Landroid/hardware/location/IActivityRecognitionHardwareSink;)Z
HSPLandroid/hardware/location/IContextHubCallback$Stub$Proxy;->asBinder()Landroid/os/IBinder;
HSPLandroid/hardware/location/IContextHubCallback$Stub$Proxy;->onMessageReceipt(IILandroid/hardware/location/ContextHubMessage;)V
HSPLandroid/hardware/location/IContextHubCallback;->onMessageReceipt(IILandroid/hardware/location/ContextHubMessage;)V
@@ -55637,6 +55650,7 @@
Landroid/hardware/input/KeyboardLayout$1;
Landroid/hardware/input/TouchCalibration$1;
Landroid/hardware/input/TouchCalibration;
+Landroid/hardware/location/ActivityRecognitionHardware;
Landroid/hardware/location/ContextHubInfo$1;
Landroid/hardware/location/ContextHubInfo;
Landroid/hardware/location/ContextHubManager;
@@ -55652,6 +55666,11 @@
Landroid/hardware/location/GeofenceHardwareRequestParcelable$1;
Landroid/hardware/location/GeofenceHardwareService$1;
Landroid/hardware/location/GeofenceHardwareService;
+Landroid/hardware/location/IActivityRecognitionHardware$Stub;
+Landroid/hardware/location/IActivityRecognitionHardware;
+Landroid/hardware/location/IActivityRecognitionHardwareClient$Stub$Proxy;
+Landroid/hardware/location/IActivityRecognitionHardwareClient$Stub;
+Landroid/hardware/location/IActivityRecognitionHardwareClient;
Landroid/hardware/location/IContextHubCallback$Stub$Proxy;
Landroid/hardware/location/IContextHubCallback;
Landroid/hardware/location/IContextHubClient$Stub;
diff --git a/config/hiddenapi-greylist.txt b/config/hiddenapi-greylist.txt
index 13f8dd9..fc47f67 100644
--- a/config/hiddenapi-greylist.txt
+++ b/config/hiddenapi-greylist.txt
@@ -462,6 +462,8 @@
Landroid/hardware/input/IInputManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/input/IInputManager;
Landroid/hardware/input/IInputManager$Stub;->TRANSACTION_injectInputEvent:I
Landroid/hardware/input/IInputManager;->injectInputEvent(Landroid/view/InputEvent;I)Z
+Landroid/hardware/location/IActivityRecognitionHardwareClient$Stub;-><init>()V
+Landroid/hardware/location/IActivityRecognitionHardwareClient;->onAvailabilityChanged(ZLandroid/hardware/location/IActivityRecognitionHardware;)V
Landroid/hardware/location/IContextHubService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/location/IContextHubService;
Landroid/hardware/usb/IUsbManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/hardware/usb/IUsbManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/usb/IUsbManager;
@@ -921,7 +923,6 @@
Landroid/os/PowerManager;->mService:Landroid/os/IPowerManager;
Landroid/os/PowerManager;->validateWakeLockParameters(ILjava/lang/String;)V
Landroid/os/PowerManager;->wakeUp(JLjava/lang/String;)V
-Landroid/os/Process;->BLUETOOTH_UID:I
Landroid/os/Process;->DRM_UID:I
Landroid/os/Process;->getFreeMemory()J
Landroid/os/Process;->getParentPid(I)I
@@ -948,10 +949,8 @@
Landroid/os/Process;->PROC_ZERO_TERM:I
Landroid/os/Process;->readProcFile(Ljava/lang/String;[I[Ljava/lang/String;[J[F)Z
Landroid/os/Process;->readProcLines(Ljava/lang/String;[Ljava/lang/String;[J)V
-Landroid/os/Process;->ROOT_UID:I
Landroid/os/Process;->setArgV0(Ljava/lang/String;)V
Landroid/os/Process;->setProcessGroup(II)V
-Landroid/os/Process;->SHELL_UID:I
Landroid/os/Process;->VPN_UID:I
Landroid/os/Process;->WIFI_UID:I
Landroid/os/RecoverySystem;->verifyPackageCompatibility(Ljava/io/InputStream;)Z
@@ -993,8 +992,6 @@
Landroid/os/ServiceManagerNative;->asInterface(Landroid/os/IBinder;)Landroid/os/IServiceManager;
Landroid/os/ServiceManagerProxy;->getService(Ljava/lang/String;)Landroid/os/IBinder;
Landroid/os/ServiceManagerProxy;->mRemote:Landroid/os/IBinder;
-Landroid/os/ServiceSpecificException;-><init>(ILjava/lang/String;)V
-Landroid/os/ServiceSpecificException;->errorCode:I
Landroid/os/SharedMemory;->getFd()I
Landroid/os/ShellCommand;->peekNextArg()Ljava/lang/String;
Landroid/os/StatFs;->mStat:Landroid/system/StructStatVfs;
@@ -1419,11 +1416,6 @@
Landroid/service/euicc/IRetainSubscriptionsForFactoryResetCallback;->onComplete(I)V
Landroid/service/euicc/ISwitchToSubscriptionCallback;->onComplete(I)V
Landroid/service/euicc/IUpdateSubscriptionNicknameCallback;->onComplete(I)V
-Landroid/service/media/IMediaBrowserServiceCallbacks$Stub;->asInterface(Landroid/os/IBinder;)Landroid/service/media/IMediaBrowserServiceCallbacks;
-Landroid/service/media/IMediaBrowserServiceCallbacks;->onConnect(Ljava/lang/String;Landroid/media/session/MediaSession$Token;Landroid/os/Bundle;)V
-Landroid/service/media/IMediaBrowserServiceCallbacks;->onConnectFailed()V
-Landroid/service/media/IMediaBrowserServiceCallbacks;->onLoadChildren(Ljava/lang/String;Landroid/content/pm/ParceledListSlice;)V
-Landroid/service/media/IMediaBrowserServiceCallbacks;->onLoadChildrenWithOptions(Ljava/lang/String;Landroid/content/pm/ParceledListSlice;Landroid/os/Bundle;)V
Landroid/service/notification/INotificationListener$Stub;-><init>()V
Landroid/service/persistentdata/IPersistentDataBlockService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/service/persistentdata/IPersistentDataBlockService;
Landroid/service/vr/IVrManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/service/vr/IVrManager;
diff --git a/config/preloaded-classes b/config/preloaded-classes
index cd798ad..c8a2a9c 100644
--- a/config/preloaded-classes
+++ b/config/preloaded-classes
@@ -1405,7 +1405,10 @@
android.hardware.input.InputManager$InputDeviceListener
android.hardware.input.InputManager$InputDeviceListenerDelegate
android.hardware.input.InputManager$InputDevicesChangedListener
+android.hardware.location.ActivityRecognitionHardware
android.hardware.location.ContextHubManager
+android.hardware.location.IActivityRecognitionHardware
+android.hardware.location.IActivityRecognitionHardware$Stub
android.hardware.radio.RadioManager
android.hardware.soundtrigger.SoundTrigger
android.hardware.soundtrigger.SoundTrigger$ConfidenceLevel
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 6d7c547..86db99bf 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -9403,12 +9403,18 @@
}
/**
- * Allows the device owner to enable or disable the backup service.
+ * Allows the device owner or profile owner to enable or disable the backup service.
*
- * <p> Backup service manages all backup and restore mechanisms on the device. Setting this to
- * false will prevent data from being backed up or restored.
+ * <p> Each user has its own backup service which manages the backup and restore mechanisms in
+ * that user. Disabling the backup service will prevent data from being backed up or restored.
*
- * <p> Backup service is off by default when device owner is present.
+ * <p> Device owner calls this API to control backup services across all users on the device.
+ * Profile owner can use this API to enable or disable the profile's backup service. However,
+ * for a managed profile its backup functionality is only enabled if both the device owner
+ * and the profile owner have enabled the backup service.
+ *
+ * <p> By default, backup service is disabled on a device with device owner, and within a
+ * managed profile.
*
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param enabled {@code true} to enable the backup service, {@code false} to disable it.
@@ -9424,7 +9430,12 @@
}
/**
- * Return whether the backup service is enabled by the device owner.
+ * Return whether the backup service is enabled by the device owner or profile owner for the
+ * current user, as previously set by {@link #setBackupServiceEnabled(ComponentName, boolean)}.
+ *
+ * <p> Whether the backup functionality is actually enabled or not depends on settings from both
+ * the current user and the device owner, please see
+ * {@link #setBackupServiceEnabled(ComponentName, boolean)} for details.
*
* <p> Backup service manages all backup and restore mechanisms on the device.
*
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index cefc700..280f1ac 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -771,7 +771,9 @@
* <p>
* This is not generally intended for third party application developers.
*/
- public abstract String getOpPackageName();
+ public String getOpPackageName() {
+ throw new RuntimeException("Not implemented. Must override in a subclass.");
+ }
/** Return the full application info for this context's package. */
public abstract ApplicationInfo getApplicationInfo();
@@ -2980,9 +2982,11 @@
*
* @see #bindService
*/
- public abstract boolean bindIsolatedService(@RequiresPermission Intent service,
+ public boolean bindIsolatedService(@RequiresPermission Intent service,
@NonNull ServiceConnection conn, @BindServiceFlags int flags,
- @NonNull String instanceName);
+ @NonNull String instanceName) {
+ throw new RuntimeException("Not implemented. Must override in a subclass.");
+ }
/**
* Same as {@link #bindService(Intent, ServiceConnection, int)}, but with an explicit userHandle
@@ -3037,8 +3041,10 @@
* a related groups -- higher importance values will be killed before
* lower ones.
*/
- public abstract void updateServiceGroup(@NonNull ServiceConnection conn, int group,
- int importance);
+ public void updateServiceGroup(@NonNull ServiceConnection conn, int group,
+ int importance) {
+ throw new RuntimeException("Not implemented. Must override in a subclass.");
+ }
/**
* Disconnect from an application service. You will no longer receive
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 8497656..3c487a1 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -3192,7 +3192,18 @@
*
* <p class="note">This is a protected intent that can only be sent
* by the system.
+ *
+ * <p class="note">If the user has chosen a {@link android.telecom.CallRedirectionService} to
+ * handle redirection of outgoing calls, this intent will NOT be sent as an ordered broadcast.
+ * This means that attempts to re-write the outgoing call by other apps using this intent will
+ * be ignored.
+ * </p>
+ *
+ * @deprecated Apps that redirect outgoing calls should use the
+ * {@link android.telecom.CallRedirectionService} API. Apps that perform call screening
+ * should use the {@link android.telecom.CallScreeningService} API.
*/
+ @Deprecated
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_NEW_OUTGOING_CALL =
"android.intent.action.NEW_OUTGOING_CALL";
diff --git a/core/java/android/content/pm/LauncherApps.java b/core/java/android/content/pm/LauncherApps.java
index 983ea9f..766c566 100644
--- a/core/java/android/content/pm/LauncherApps.java
+++ b/core/java/android/content/pm/LauncherApps.java
@@ -136,6 +136,17 @@
public static final String EXTRA_PIN_ITEM_REQUEST =
"android.content.pm.extra.PIN_ITEM_REQUEST";
+ /**
+ * Metadata key that specifies vouched certs, so any apps signed by a cert in vouched certs
+ * will not show hidden icon in launcher even it does not have a launcher visible activity.
+ *
+ * If an app has this metadata in manifest, it won't be eligible to hide its icon even if its
+ * cert is in vouched certs list.
+ *
+ * @hide
+ */
+ public static final String VOUCHED_CERTS_KEY = "vouched_certs";
+
private final Context mContext;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
private final ILauncherApps mService;
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index a185c8a..88a240f 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -8494,6 +8494,18 @@
public static PackageInfo generatePackageInfoFromApex(File apexFile, boolean collectCerts)
throws PackageParserException {
PackageInfo pi = new PackageInfo();
+
+ // TODO(b/123086053) properly fill in the ApplicationInfo with data from AndroidManifest
+ // Add ApplicationInfo to the PackageInfo.
+ ApplicationInfo ai = new ApplicationInfo();
+ ai.sourceDir = apexFile.getPath();
+ ai.flags = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_INSTALLED;
+ ai.enabled = true;
+ ai.targetSdkVersion = 28;
+ ai.targetSandboxVersion = 0;
+ pi.applicationInfo = ai;
+
+
// TODO(b/123052859): We should avoid these repeated calls to parseApkLite each time
// we want to generate information for APEX modules.
PackageParser.ApkLite apk = PackageParser.parseApkLite(apexFile,
diff --git a/core/java/android/database/TranslatingCursor.java b/core/java/android/database/TranslatingCursor.java
index 58e65b2..d9165b4 100644
--- a/core/java/android/database/TranslatingCursor.java
+++ b/core/java/android/database/TranslatingCursor.java
@@ -39,28 +39,29 @@
public class TranslatingCursor extends CrossProcessCursorWrapper {
public static class Config {
public final Uri baseUri;
- public final String idColumn;
- public final String[] filePathColumns;
+ public final String auxiliaryColumn;
+ public final String[] translateColumns;
- public Config(Uri baseUri, String idColumn, String... filePathColumns) {
+ public Config(Uri baseUri, String auxiliaryColumn, String... translateColumns) {
this.baseUri = baseUri;
- this.idColumn = idColumn;
- this.filePathColumns = filePathColumns;
+ this.auxiliaryColumn = auxiliaryColumn;
+ this.translateColumns = translateColumns;
}
}
public interface Translator {
- String translate(String data, long id);
+ String translate(String data, int auxiliaryColumnIndex,
+ String matchingColumn, Cursor cursor);
}
private final @NonNull Config mConfig;
private final @NonNull Translator mTranslator;
private final boolean mDropLast;
- private final int mIdIndex;
- private final int[] mFilePathColIndices;
+ private final int mAuxiliaryColumnIndex;
+ private final int[] mTranslateColumnIndices;
- private TranslatingCursor(@NonNull Cursor cursor, @NonNull Config config,
+ public TranslatingCursor(@NonNull Cursor cursor, @NonNull Config config,
@NonNull Translator translator, boolean dropLast) {
super(cursor);
@@ -68,10 +69,10 @@
mTranslator = Objects.requireNonNull(translator);
mDropLast = dropLast;
- mIdIndex = cursor.getColumnIndexOrThrow(config.idColumn);
- mFilePathColIndices = new int[config.filePathColumns.length];
- for (int i = mFilePathColIndices.length - 1; i >= 0; --i) {
- mFilePathColIndices[i] = cursor.getColumnIndex(config.filePathColumns[i]);
+ mAuxiliaryColumnIndex = cursor.getColumnIndexOrThrow(config.auxiliaryColumn);
+ mTranslateColumnIndices = new int[config.translateColumns.length];
+ for (int i = 0; i < mTranslateColumnIndices.length; ++i) {
+ mTranslateColumnIndices[i] = cursor.getColumnIndex(config.translateColumns[i]);
}
}
@@ -97,26 +98,27 @@
SQLiteQueryBuilder qb, SQLiteDatabase db, String[] projectionIn, String selection,
String[] selectionArgs, String groupBy, String having, String sortOrder, String limit,
CancellationSignal signal) {
- final boolean requestedId = ArrayUtils.isEmpty(projectionIn)
- || ArrayUtils.contains(projectionIn, config.idColumn);
- final boolean requestedData = ArrayUtils.isEmpty(projectionIn)
- || ArrayUtils.containsAny(projectionIn, config.filePathColumns);
+ final boolean requestedAuxiliaryColumn = ArrayUtils.isEmpty(projectionIn)
+ || ArrayUtils.contains(projectionIn, config.auxiliaryColumn);
+ final boolean requestedTranslateColumns = ArrayUtils.isEmpty(projectionIn)
+ || ArrayUtils.containsAny(projectionIn, config.translateColumns);
- // If caller didn't request data, we have nothing to redirect
- if (!requestedData || !ContentResolver.DEPRECATE_DATA_COLUMNS) {
+ // If caller didn't request any columns that need to be translated,
+ // we have nothing to redirect
+ if (!requestedTranslateColumns) {
return qb.query(db, projectionIn, selection, selectionArgs,
groupBy, having, sortOrder, limit, signal);
}
- // If caller didn't request id, we need to splice it in
- if (!requestedId) {
+ // If caller didn't request auxiliary column, we need to splice it in
+ if (!requestedAuxiliaryColumn) {
projectionIn = ArrayUtils.appendElement(String.class, projectionIn,
- config.idColumn);
+ config.auxiliaryColumn);
}
final Cursor c = qb.query(db, projectionIn, selection, selectionArgs,
groupBy, having, sortOrder);
- return new TranslatingCursor(c, config, translator, !requestedId);
+ return new TranslatingCursor(c, config, translator, !requestedAuxiliaryColumn);
}
@Override
@@ -139,7 +141,7 @@
@Override
public double getDouble(int columnIndex) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
throw new IllegalArgumentException();
} else {
return super.getDouble(columnIndex);
@@ -148,7 +150,7 @@
@Override
public float getFloat(int columnIndex) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
throw new IllegalArgumentException();
} else {
return super.getFloat(columnIndex);
@@ -157,7 +159,7 @@
@Override
public int getInt(int columnIndex) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
throw new IllegalArgumentException();
} else {
return super.getInt(columnIndex);
@@ -166,7 +168,7 @@
@Override
public long getLong(int columnIndex) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
throw new IllegalArgumentException();
} else {
return super.getLong(columnIndex);
@@ -175,7 +177,7 @@
@Override
public short getShort(int columnIndex) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
throw new IllegalArgumentException();
} else {
return super.getShort(columnIndex);
@@ -184,8 +186,9 @@
@Override
public String getString(int columnIndex) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
- return mTranslator.translate(super.getString(columnIndex), super.getLong(mIdIndex));
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
+ return mTranslator.translate(super.getString(columnIndex),
+ mAuxiliaryColumnIndex, getColumnName(columnIndex), this);
} else {
return super.getString(columnIndex);
}
@@ -193,7 +196,7 @@
@Override
public void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
throw new IllegalArgumentException();
} else {
super.copyStringToBuffer(columnIndex, buffer);
@@ -202,7 +205,7 @@
@Override
public byte[] getBlob(int columnIndex) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
throw new IllegalArgumentException();
} else {
return super.getBlob(columnIndex);
@@ -211,7 +214,7 @@
@Override
public int getType(int columnIndex) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
return Cursor.FIELD_TYPE_STRING;
} else {
return super.getType(columnIndex);
@@ -220,7 +223,7 @@
@Override
public boolean isNull(int columnIndex) {
- if (ArrayUtils.contains(mFilePathColIndices, columnIndex)) {
+ if (ArrayUtils.contains(mTranslateColumnIndices, columnIndex)) {
return getString(columnIndex) == null;
} else {
return super.isNull(columnIndex);
diff --git a/core/java/android/hardware/display/ColorDisplayManager.java b/core/java/android/hardware/display/ColorDisplayManager.java
index 70a9f08..fa335c8b 100644
--- a/core/java/android/hardware/display/ColorDisplayManager.java
+++ b/core/java/android/hardware/display/ColorDisplayManager.java
@@ -17,6 +17,7 @@
package android.hardware.display;
import android.Manifest;
+import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
@@ -30,6 +31,9 @@
import com.android.internal.R;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
* Manages the display's color transforms and modes.
*
@@ -39,6 +43,44 @@
@SystemService(Context.COLOR_DISPLAY_SERVICE)
public final class ColorDisplayManager {
+ /**
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({CAPABILITY_NONE, CAPABILITY_PROTECTED_CONTENT, CAPABILITY_HARDWARE_ACCELERATION_GLOBAL,
+ CAPABILITY_HARDWARE_ACCELERATION_PER_APP})
+ public @interface CapabilityType {}
+
+ /**
+ * The device does not support color transforms.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final int CAPABILITY_NONE = 0x0;
+ /**
+ * The device can properly apply transforms over protected content.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final int CAPABILITY_PROTECTED_CONTENT = 0x1;
+ /**
+ * The device's hardware can efficiently apply transforms to the entire display.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final int CAPABILITY_HARDWARE_ACCELERATION_GLOBAL = 0x2;
+ /**
+ * The device's hardware can efficiently apply transforms to a specific Surface (window) so
+ * that apps can be transformed independently of one another.
+ *
+ * @hide
+ */
+ @SystemApi
+ public static final int CAPABILITY_HARDWARE_ACCELERATION_PER_APP = 0x4;
+
private final ColorDisplayManagerInternal mManager;
/**
@@ -114,6 +156,17 @@
return context.getResources().getBoolean(R.bool.config_setColorTransformAccelerated);
}
+ /**
+ * Returns the available software and hardware color transform capabilities of this device.
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS)
+ public @CapabilityType int getTransformCapabilities() {
+ return mManager.getTransformCapabilities();
+ }
+
private static class ColorDisplayManagerInternal {
private static ColorDisplayManagerInternal sInstance;
@@ -162,5 +215,13 @@
throw e.rethrowFromSystemServer();
}
}
+
+ int getTransformCapabilities() {
+ try {
+ return mCdm.getTransformCapabilities();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
}
}
diff --git a/core/java/android/hardware/display/IColorDisplayManager.aidl b/core/java/android/hardware/display/IColorDisplayManager.aidl
index 644f510..53cb8db 100644
--- a/core/java/android/hardware/display/IColorDisplayManager.aidl
+++ b/core/java/android/hardware/display/IColorDisplayManager.aidl
@@ -22,4 +22,6 @@
boolean setSaturationLevel(int saturationLevel);
boolean setAppSaturationLevel(String packageName, int saturationLevel);
+
+ int getTransformCapabilities();
}
\ No newline at end of file
diff --git a/core/java/android/hardware/hdmi/HdmiUtils.java b/core/java/android/hardware/hdmi/HdmiUtils.java
index 3081738..8c94b78 100644
--- a/core/java/android/hardware/hdmi/HdmiUtils.java
+++ b/core/java/android/hardware/hdmi/HdmiUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014 The Android Open Source Project
+ * Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,14 +16,18 @@
package android.hardware.hdmi;
+import android.annotation.IntDef;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
- * Various utilities to handle HDMI CEC messages.
+ * Various utilities related to HDMI CEC.
*
* TODO(b/110094868): unhide for Q
* @hide
*/
-public class HdmiUtils {
-
+public final class HdmiUtils {
/**
* Return value of {@link #getLocalPortFromPhysicalAddress(int, int)}
*/
@@ -78,4 +82,164 @@
}
return port;
}
+
+ /**
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef({HDMI_RELATIVE_POSITION_UNKNOWN, HDMI_RELATIVE_POSITION_DIRECTLY_BELOW,
+ HDMI_RELATIVE_POSITION_BELOW, HDMI_RELATIVE_POSITION_SAME,
+ HDMI_RELATIVE_POSITION_DIRECTLY_ABOVE, HDMI_RELATIVE_POSITION_ABOVE,
+ HDMI_RELATIVE_POSITION_SIBLING, HDMI_RELATIVE_POSITION_DIFFERENT_BRANCH})
+ public @interface HdmiAddressRelativePosition {}
+ /**
+ * HDMI relative position is not determined.
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ public static final int HDMI_RELATIVE_POSITION_UNKNOWN = 0;
+ /**
+ * HDMI relative position: directly blow the device.
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ public static final int HDMI_RELATIVE_POSITION_DIRECTLY_BELOW = 1;
+ /**
+ * HDMI relative position: indirectly below the device.
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ public static final int HDMI_RELATIVE_POSITION_BELOW = 2;
+ /**
+ * HDMI relative position: the same device.
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ public static final int HDMI_RELATIVE_POSITION_SAME = 3;
+ /**
+ * HDMI relative position: directly above the device.
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ public static final int HDMI_RELATIVE_POSITION_DIRECTLY_ABOVE = 4;
+ /**
+ * HDMI relative position: indirectly above the device.
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ public static final int HDMI_RELATIVE_POSITION_ABOVE = 5;
+ /**
+ * HDMI relative position: directly below a same device.
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ public static final int HDMI_RELATIVE_POSITION_SIBLING = 6;
+ /**
+ * HDMI relative position: different branch.
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ public static final int HDMI_RELATIVE_POSITION_DIFFERENT_BRANCH = 7;
+
+ private static final int NPOS = -1;
+
+ /**
+ * Check if the given physical address is valid.
+ *
+ * @param address physical address
+ * @return {@code true} if the given address is valid
+ */
+ public static boolean isValidPhysicalAddress(int address) {
+ if (address < 0 || address >= 0xFFFF) {
+ return false;
+ }
+ int mask = 0xF000;
+ boolean hasZero = false;
+ for (int i = 0; i < 4; i++) {
+ if ((address & mask) == 0) {
+ hasZero = true;
+ } else if (hasZero) {
+ // only 0s are valid after a 0.
+ // e.g. 0x1012 is not valid.
+ return false;
+ }
+ mask >>= 4;
+ }
+ return true;
+ }
+
+
+ /**
+ * Returns the relative position of two physical addresses.
+ */
+ @HdmiAddressRelativePosition
+ public static int getHdmiAddressRelativePosition(int src, int dest) {
+ if (src == 0xFFFF || dest == 0xFFFF) {
+ // address not assigned
+ return HDMI_RELATIVE_POSITION_UNKNOWN;
+ }
+ try {
+ int firstDiffPos = physicalAddressFirstDifferentDigitPos(src, dest);
+ if (firstDiffPos == NPOS) {
+ return HDMI_RELATIVE_POSITION_SAME;
+ }
+ int mask = (0xF000 >> (firstDiffPos * 4));
+ int nextPos = firstDiffPos + 1;
+ if ((src & mask) == 0) {
+ // src is above dest
+ if (nextPos == 4) {
+ // last digits are different
+ return HDMI_RELATIVE_POSITION_DIRECTLY_ABOVE;
+ }
+ if (((0xF000 >> (nextPos * 4)) & dest) == 0) {
+ // next digit is 0
+ return HDMI_RELATIVE_POSITION_DIRECTLY_ABOVE;
+ }
+ return HDMI_RELATIVE_POSITION_ABOVE;
+ }
+
+ if ((dest & mask) == 0) {
+ // src is below dest
+ if (nextPos == 4) {
+ // last digits are different
+ return HDMI_RELATIVE_POSITION_DIRECTLY_BELOW;
+ }
+ if (((0xF000 >> (nextPos * 4)) & src) == 0) {
+ // next digit is 0
+ return HDMI_RELATIVE_POSITION_DIRECTLY_BELOW;
+ }
+ return HDMI_RELATIVE_POSITION_BELOW;
+ }
+ if (nextPos == 4) {
+ // last digits are different
+ return HDMI_RELATIVE_POSITION_SIBLING;
+ }
+ if (((0xF000 >> (nextPos * 4)) & src) == 0 && ((0xF000 >> (nextPos * 4)) & dest) == 0) {
+ return HDMI_RELATIVE_POSITION_SIBLING;
+ }
+ return HDMI_RELATIVE_POSITION_DIFFERENT_BRANCH;
+ } catch (IllegalArgumentException e) {
+ // invalid address
+ return HDMI_RELATIVE_POSITION_UNKNOWN;
+ }
+ }
+
+ private static int physicalAddressFirstDifferentDigitPos(int address1, int address2)
+ throws IllegalArgumentException {
+ if (!isValidPhysicalAddress(address1)) {
+ throw new IllegalArgumentException(address1 + " is not a valid address.");
+ }
+ if (!isValidPhysicalAddress(address2)) {
+ throw new IllegalArgumentException(address2 + " is not a valid address.");
+ }
+ int mask = 0xF000;
+ for (int i = 0; i < 4; i++) {
+ if ((address1 & mask) != (address2 & mask)) {
+ return i;
+ }
+ mask = mask >> 4;
+ }
+ return NPOS;
+ }
}
diff --git a/core/java/android/hardware/location/ActivityChangedEvent.aidl b/core/java/android/hardware/location/ActivityChangedEvent.aidl
new file mode 100644
index 0000000..21f2445
--- /dev/null
+++ b/core/java/android/hardware/location/ActivityChangedEvent.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.hardware.location;
+
+parcelable ActivityChangedEvent;
\ No newline at end of file
diff --git a/core/java/android/hardware/location/ActivityChangedEvent.java b/core/java/android/hardware/location/ActivityChangedEvent.java
new file mode 100644
index 0000000..16cfe6e
--- /dev/null
+++ b/core/java/android/hardware/location/ActivityChangedEvent.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.hardware.location;
+
+import android.annotation.NonNull;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.security.InvalidParameterException;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * A class representing an event for Activity changes.
+ *
+ * @hide
+ */
+public class ActivityChangedEvent implements Parcelable {
+ private final List<ActivityRecognitionEvent> mActivityRecognitionEvents;
+
+ public ActivityChangedEvent(ActivityRecognitionEvent[] activityRecognitionEvents) {
+ if (activityRecognitionEvents == null) {
+ throw new InvalidParameterException(
+ "Parameter 'activityRecognitionEvents' must not be null.");
+ }
+
+ mActivityRecognitionEvents = Arrays.asList(activityRecognitionEvents);
+ }
+
+ @NonNull
+ public Iterable<ActivityRecognitionEvent> getActivityRecognitionEvents() {
+ return mActivityRecognitionEvents;
+ }
+
+ public static final Creator<ActivityChangedEvent> CREATOR =
+ new Creator<ActivityChangedEvent>() {
+ @Override
+ public ActivityChangedEvent createFromParcel(Parcel source) {
+ int activityRecognitionEventsLength = source.readInt();
+ ActivityRecognitionEvent[] activityRecognitionEvents =
+ new ActivityRecognitionEvent[activityRecognitionEventsLength];
+ source.readTypedArray(activityRecognitionEvents, ActivityRecognitionEvent.CREATOR);
+
+ return new ActivityChangedEvent(activityRecognitionEvents);
+ }
+
+ @Override
+ public ActivityChangedEvent[] newArray(int size) {
+ return new ActivityChangedEvent[size];
+ }
+ };
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel parcel, int flags) {
+ ActivityRecognitionEvent[] activityRecognitionEventArray =
+ mActivityRecognitionEvents.toArray(new ActivityRecognitionEvent[0]);
+ parcel.writeInt(activityRecognitionEventArray.length);
+ parcel.writeTypedArray(activityRecognitionEventArray, flags);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder("[ ActivityChangedEvent:");
+
+ for (ActivityRecognitionEvent event : mActivityRecognitionEvents) {
+ builder.append("\n ");
+ builder.append(event.toString());
+ }
+ builder.append("\n]");
+
+ return builder.toString();
+ }
+}
diff --git a/core/java/android/hardware/location/ActivityRecognitionEvent.java b/core/java/android/hardware/location/ActivityRecognitionEvent.java
new file mode 100644
index 0000000..190030a
--- /dev/null
+++ b/core/java/android/hardware/location/ActivityRecognitionEvent.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.location;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * A class that represents an Activity Recognition Event.
+ *
+ * @hide
+ */
+public class ActivityRecognitionEvent implements Parcelable {
+ private final String mActivity;
+ private final int mEventType;
+ private final long mTimestampNs;
+
+ public ActivityRecognitionEvent(String activity, int eventType, long timestampNs) {
+ mActivity = activity;
+ mEventType = eventType;
+ mTimestampNs = timestampNs;
+ }
+
+ public String getActivity() {
+ return mActivity;
+ }
+
+ public int getEventType() {
+ return mEventType;
+ }
+
+ public long getTimestampNs() {
+ return mTimestampNs;
+ }
+
+ public static final Creator<ActivityRecognitionEvent> CREATOR =
+ new Creator<ActivityRecognitionEvent>() {
+ @Override
+ public ActivityRecognitionEvent createFromParcel(Parcel source) {
+ String activity = source.readString();
+ int eventType = source.readInt();
+ long timestampNs = source.readLong();
+
+ return new ActivityRecognitionEvent(activity, eventType, timestampNs);
+ }
+
+ @Override
+ public ActivityRecognitionEvent[] newArray(int size) {
+ return new ActivityRecognitionEvent[size];
+ }
+ };
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel parcel, int flags) {
+ parcel.writeString(mActivity);
+ parcel.writeInt(mEventType);
+ parcel.writeLong(mTimestampNs);
+ }
+
+ @Override
+ public String toString() {
+ return String.format(
+ "Activity='%s', EventType=%s, TimestampNs=%s",
+ mActivity,
+ mEventType,
+ mTimestampNs);
+ }
+}
diff --git a/core/java/android/hardware/location/ActivityRecognitionHardware.java b/core/java/android/hardware/location/ActivityRecognitionHardware.java
new file mode 100644
index 0000000..8acd1ff
--- /dev/null
+++ b/core/java/android/hardware/location/ActivityRecognitionHardware.java
@@ -0,0 +1,279 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package android.hardware.location;
+
+import android.Manifest;
+import android.content.Context;
+import android.os.RemoteCallbackList;
+import android.os.RemoteException;
+import android.text.TextUtils;
+import android.util.Log;
+
+/**
+ * A class that implements an {@link IActivityRecognitionHardware} backed up by the Activity
+ * Recognition HAL.
+ *
+ * @hide
+ */
+public class ActivityRecognitionHardware extends IActivityRecognitionHardware.Stub {
+ private static final String TAG = "ActivityRecognitionHW";
+ private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+
+ private static final String HARDWARE_PERMISSION = Manifest.permission.LOCATION_HARDWARE;
+ private static final String ENFORCE_HW_PERMISSION_MESSAGE = "Permission '"
+ + HARDWARE_PERMISSION + "' not granted to access ActivityRecognitionHardware";
+
+ private static final int INVALID_ACTIVITY_TYPE = -1;
+ private static final int NATIVE_SUCCESS_RESULT = 0;
+ private static final int EVENT_TYPE_DISABLED = 0;
+ private static final int EVENT_TYPE_ENABLED = 1;
+
+ /**
+ * Contains the number of supported Event Types.
+ *
+ * NOTE: increment this counter every time a new EVENT_TYPE_ is added to
+ * com.android.location.provider.ActivityRecognitionProvider
+ */
+ private static final int EVENT_TYPE_COUNT = 3;
+
+ private static ActivityRecognitionHardware sSingletonInstance;
+ private static final Object sSingletonInstanceLock = new Object();
+
+ private final Context mContext;
+ private final int mSupportedActivitiesCount;
+ private final String[] mSupportedActivities;
+ private final int[][] mSupportedActivitiesEnabledEvents;
+ private final SinkList mSinks = new SinkList();
+
+ private static class Event {
+ public int activity;
+ public int type;
+ public long timestamp;
+ }
+
+ private ActivityRecognitionHardware(Context context) {
+ nativeInitialize();
+
+ mContext = context;
+ mSupportedActivities = fetchSupportedActivities();
+ mSupportedActivitiesCount = mSupportedActivities.length;
+ mSupportedActivitiesEnabledEvents = new int[mSupportedActivitiesCount][EVENT_TYPE_COUNT];
+ }
+
+ public static ActivityRecognitionHardware getInstance(Context context) {
+ synchronized (sSingletonInstanceLock) {
+ if (sSingletonInstance == null) {
+ sSingletonInstance = new ActivityRecognitionHardware(context);
+ }
+
+ return sSingletonInstance;
+ }
+ }
+
+ public static boolean isSupported() {
+ return nativeIsSupported();
+ }
+
+ @Override
+ public String[] getSupportedActivities() {
+ checkPermissions();
+ return mSupportedActivities;
+ }
+
+ @Override
+ public boolean isActivitySupported(String activity) {
+ checkPermissions();
+ int activityType = getActivityType(activity);
+ return activityType != INVALID_ACTIVITY_TYPE;
+ }
+
+ @Override
+ public boolean registerSink(IActivityRecognitionHardwareSink sink) {
+ checkPermissions();
+ return mSinks.register(sink);
+ }
+
+ @Override
+ public boolean unregisterSink(IActivityRecognitionHardwareSink sink) {
+ checkPermissions();
+ return mSinks.unregister(sink);
+ }
+
+ @Override
+ public boolean enableActivityEvent(String activity, int eventType, long reportLatencyNs) {
+ checkPermissions();
+
+ int activityType = getActivityType(activity);
+ if (activityType == INVALID_ACTIVITY_TYPE) {
+ return false;
+ }
+
+ int result = nativeEnableActivityEvent(activityType, eventType, reportLatencyNs);
+ if (result == NATIVE_SUCCESS_RESULT) {
+ mSupportedActivitiesEnabledEvents[activityType][eventType] = EVENT_TYPE_ENABLED;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean disableActivityEvent(String activity, int eventType) {
+ checkPermissions();
+
+ int activityType = getActivityType(activity);
+ if (activityType == INVALID_ACTIVITY_TYPE) {
+ return false;
+ }
+
+ int result = nativeDisableActivityEvent(activityType, eventType);
+ if (result == NATIVE_SUCCESS_RESULT) {
+ mSupportedActivitiesEnabledEvents[activityType][eventType] = EVENT_TYPE_DISABLED;
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean flush() {
+ checkPermissions();
+ int result = nativeFlush();
+ return result == NATIVE_SUCCESS_RESULT;
+ }
+
+ /**
+ * Called by the Activity-Recognition HAL.
+ */
+ private void onActivityChanged(Event[] events) {
+ if (events == null || events.length == 0) {
+ if (DEBUG) Log.d(TAG, "No events to broadcast for onActivityChanged.");
+ return;
+ }
+
+ int eventsLength = events.length;
+ ActivityRecognitionEvent activityRecognitionEventArray[] =
+ new ActivityRecognitionEvent[eventsLength];
+ for (int i = 0; i < eventsLength; ++i) {
+ Event event = events[i];
+ String activityName = getActivityName(event.activity);
+ activityRecognitionEventArray[i] =
+ new ActivityRecognitionEvent(activityName, event.type, event.timestamp);
+ }
+ ActivityChangedEvent activityChangedEvent =
+ new ActivityChangedEvent(activityRecognitionEventArray);
+
+ int size = mSinks.beginBroadcast();
+ for (int i = 0; i < size; ++i) {
+ IActivityRecognitionHardwareSink sink = mSinks.getBroadcastItem(i);
+ try {
+ sink.onActivityChanged(activityChangedEvent);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error delivering activity changed event.", e);
+ }
+ }
+ mSinks.finishBroadcast();
+ }
+
+ private String getActivityName(int activityType) {
+ if (activityType < 0 || activityType >= mSupportedActivities.length) {
+ String message = String.format(
+ "Invalid ActivityType: %d, SupportedActivities: %d",
+ activityType,
+ mSupportedActivities.length);
+ Log.e(TAG, message);
+ return null;
+ }
+
+ return mSupportedActivities[activityType];
+ }
+
+ private int getActivityType(String activity) {
+ if (TextUtils.isEmpty(activity)) {
+ return INVALID_ACTIVITY_TYPE;
+ }
+
+ int supportedActivitiesLength = mSupportedActivities.length;
+ for (int i = 0; i < supportedActivitiesLength; ++i) {
+ if (activity.equals(mSupportedActivities[i])) {
+ return i;
+ }
+ }
+
+ return INVALID_ACTIVITY_TYPE;
+ }
+
+ private void checkPermissions() {
+ mContext.enforceCallingPermission(HARDWARE_PERMISSION, ENFORCE_HW_PERMISSION_MESSAGE);
+ }
+
+ private String[] fetchSupportedActivities() {
+ String[] supportedActivities = nativeGetSupportedActivities();
+ if (supportedActivities != null) {
+ return supportedActivities;
+ }
+
+ return new String[0];
+ }
+
+ private class SinkList extends RemoteCallbackList<IActivityRecognitionHardwareSink> {
+ @Override
+ public void onCallbackDied(IActivityRecognitionHardwareSink callback) {
+ int callbackCount = mSinks.getRegisteredCallbackCount();
+ if (DEBUG) Log.d(TAG, "RegisteredCallbackCount: " + callbackCount);
+ if (callbackCount != 0) {
+ return;
+ }
+ // currently there is only one client for this, so if all its sinks have died, we clean
+ // up after them, this ensures that the AR HAL is not out of sink
+ for (int activity = 0; activity < mSupportedActivitiesCount; ++activity) {
+ for (int event = 0; event < EVENT_TYPE_COUNT; ++event) {
+ disableActivityEventIfEnabled(activity, event);
+ }
+ }
+ }
+
+ private void disableActivityEventIfEnabled(int activityType, int eventType) {
+ if (mSupportedActivitiesEnabledEvents[activityType][eventType] != EVENT_TYPE_ENABLED) {
+ return;
+ }
+
+ int result = nativeDisableActivityEvent(activityType, eventType);
+ mSupportedActivitiesEnabledEvents[activityType][eventType] = EVENT_TYPE_DISABLED;
+ String message = String.format(
+ "DisableActivityEvent: activityType=%d, eventType=%d, result=%d",
+ activityType,
+ eventType,
+ result);
+ Log.e(TAG, message);
+ }
+ }
+
+ // native bindings
+ static { nativeClassInit(); }
+
+ private static native void nativeClassInit();
+ private static native boolean nativeIsSupported();
+
+ private native void nativeInitialize();
+ private native void nativeRelease();
+ private native String[] nativeGetSupportedActivities();
+ private native int nativeEnableActivityEvent(
+ int activityType,
+ int eventType,
+ long reportLatenceNs);
+ private native int nativeDisableActivityEvent(int activityType, int eventType);
+ private native int nativeFlush();
+}
diff --git a/core/java/android/hardware/location/IActivityRecognitionHardware.aidl b/core/java/android/hardware/location/IActivityRecognitionHardware.aidl
new file mode 100644
index 0000000..bc6b183
--- /dev/null
+++ b/core/java/android/hardware/location/IActivityRecognitionHardware.aidl
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2014, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/license/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.location;
+
+import android.hardware.location.IActivityRecognitionHardwareSink;
+
+/**
+ * Activity Recognition Hardware provider interface.
+ * This interface can be used to implement hardware based activity recognition.
+ *
+ * @hide
+ */
+interface IActivityRecognitionHardware {
+ /**
+ * Gets an array of supported activities by hardware.
+ */
+ String[] getSupportedActivities();
+
+ /**
+ * Returns true if the given activity is supported, false otherwise.
+ */
+ boolean isActivitySupported(in String activityType);
+
+ /**
+ * Registers a sink with Hardware Activity-Recognition.
+ */
+ boolean registerSink(in IActivityRecognitionHardwareSink sink);
+
+ /**
+ * Unregisters a sink with Hardware Activity-Recognition.
+ */
+ boolean unregisterSink(in IActivityRecognitionHardwareSink sink);
+
+ /**
+ * Enables tracking of a given activity/event type, if the activity is supported.
+ */
+ boolean enableActivityEvent(in String activityType, int eventType, long reportLatencyNs);
+
+ /**
+ * Disables tracking of a given activity/eventy type.
+ */
+ boolean disableActivityEvent(in String activityType, int eventType);
+
+ /**
+ * Requests hardware for all the activity events detected up to the given point in time.
+ */
+ boolean flush();
+}
\ No newline at end of file
diff --git a/core/java/android/hardware/location/IActivityRecognitionHardwareClient.aidl b/core/java/android/hardware/location/IActivityRecognitionHardwareClient.aidl
new file mode 100644
index 0000000..3fe645c
--- /dev/null
+++ b/core/java/android/hardware/location/IActivityRecognitionHardwareClient.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2015, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/license/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.location;
+
+import android.hardware.location.IActivityRecognitionHardware;
+
+/**
+ * Activity Recognition Hardware client interface.
+ * This interface can be used to receive interfaces to implementations of
+ * {@link IActivityRecognitionHardware}.
+ *
+ * @hide
+ */
+oneway interface IActivityRecognitionHardwareClient {
+ /**
+ * Hardware Activity-Recognition availability event.
+ *
+ * @param isSupported whether the platform has hardware support for the feature
+ * @param instance the available instance to provide access to the feature
+ */
+ void onAvailabilityChanged(in boolean isSupported, in IActivityRecognitionHardware instance);
+}
diff --git a/core/java/android/hardware/location/IActivityRecognitionHardwareSink.aidl b/core/java/android/hardware/location/IActivityRecognitionHardwareSink.aidl
new file mode 100644
index 0000000..21c8e87
--- /dev/null
+++ b/core/java/android/hardware/location/IActivityRecognitionHardwareSink.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2014, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/license/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.location;
+
+import android.hardware.location.ActivityChangedEvent;
+
+/**
+ * Activity Recognition Hardware provider Sink interface.
+ * This interface can be used to implement sinks to receive activity notifications.
+ *
+ * @hide
+ */
+interface IActivityRecognitionHardwareSink {
+ /**
+ * Activity changed event.
+ */
+ void onActivityChanged(in ActivityChangedEvent event);
+}
\ No newline at end of file
diff --git a/core/java/android/hardware/location/IActivityRecognitionHardwareWatcher.aidl b/core/java/android/hardware/location/IActivityRecognitionHardwareWatcher.aidl
new file mode 100644
index 0000000..12e3117
--- /dev/null
+++ b/core/java/android/hardware/location/IActivityRecognitionHardwareWatcher.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2014, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/license/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.location;
+
+import android.hardware.location.IActivityRecognitionHardware;
+
+/**
+ * Activity Recognition Hardware watcher. This interface can be used to receive interfaces to
+ * implementations of {@link IActivityRecognitionHardware}.
+ *
+ * @deprecated use {@link IActivityRecognitionHardwareClient} instead.
+
+ * @hide
+ */
+interface IActivityRecognitionHardwareWatcher {
+ /**
+ * Hardware Activity-Recognition availability event.
+ */
+ void onInstanceChanged(in IActivityRecognitionHardware instance);
+}
diff --git a/core/java/android/net/CaptivePortal.java b/core/java/android/net/CaptivePortal.java
index 4047068..3b01266 100644
--- a/core/java/android/net/CaptivePortal.java
+++ b/core/java/android/net/CaptivePortal.java
@@ -45,6 +45,8 @@
private final IBinder mBinder;
/** @hide */
+ @SystemApi
+ @TestApi
public CaptivePortal(IBinder binder) {
mBinder = binder;
}
@@ -107,6 +109,8 @@
* connectivity for apps because the captive portal is still in place.
* @hide
*/
+ @SystemApi
+ @TestApi
public void useNetwork() {
try {
ICaptivePortal.Stub.asInterface(mBinder).appResponse(APP_RETURN_WANTED_AS_IS);
diff --git a/core/java/android/net/ICaptivePortal.aidl b/core/java/android/net/ICaptivePortal.aidl
index a013e79..56ae57d 100644
--- a/core/java/android/net/ICaptivePortal.aidl
+++ b/core/java/android/net/ICaptivePortal.aidl
@@ -20,7 +20,6 @@
* Interface to inform NetworkMonitor of decisions of app handling captive portal.
* @hide
*/
-interface ICaptivePortal
-{
- oneway void appResponse(int response);
+oneway interface ICaptivePortal {
+ void appResponse(int response);
}
diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl
index da5d96e..3d34574 100644
--- a/core/java/android/net/IConnectivityManager.aidl
+++ b/core/java/android/net/IConnectivityManager.aidl
@@ -187,4 +187,6 @@
byte[] getNetworkWatchlistConfigHash();
int getConnectionOwnerUid(in ConnectionInfo connectionInfo);
+ boolean isCallerCurrentAlwaysOnVpnApp();
+ boolean isCallerCurrentAlwaysOnVpnLockdownApp();
}
diff --git a/core/java/android/net/LinkProperties.java b/core/java/android/net/LinkProperties.java
index c2963fd..21b6a8e 100644
--- a/core/java/android/net/LinkProperties.java
+++ b/core/java/android/net/LinkProperties.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.Parcel;
@@ -368,7 +369,8 @@
* @return true if the DNS server was added, false if it was already present.
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public boolean addDnsServer(InetAddress dnsServer) {
if (dnsServer != null && !mDnses.contains(dnsServer)) {
mDnses.add(dnsServer);
@@ -384,7 +386,8 @@
* @return true if the DNS server was removed, false if it did not exist.
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public boolean removeDnsServer(InetAddress dnsServer) {
if (dnsServer != null) {
return mDnses.remove(dnsServer);
@@ -423,6 +426,8 @@
* @param usePrivateDns The private DNS state.
* @hide
*/
+ @TestApi
+ @SystemApi
public void setUsePrivateDns(boolean usePrivateDns) {
mUsePrivateDns = usePrivateDns;
}
@@ -448,6 +453,8 @@
* @param privateDnsServerName The private DNS server name.
* @hide
*/
+ @TestApi
+ @SystemApi
public void setPrivateDnsServerName(@Nullable String privateDnsServerName) {
mPrivateDnsServerName = privateDnsServerName;
}
@@ -510,6 +517,8 @@
* object.
* @hide
*/
+ @TestApi
+ @SystemApi
public void setValidatedPrivateDnsServers(Collection<InetAddress> dnsServers) {
mValidatedPrivateDnses.clear();
for (InetAddress dnsServer: dnsServers) {
@@ -525,6 +534,8 @@
* DNS servers on this link.
* @hide
*/
+ @TestApi
+ @SystemApi
public List<InetAddress> getValidatedPrivateDnsServers() {
return Collections.unmodifiableList(mValidatedPrivateDnses);
}
@@ -636,7 +647,8 @@
*
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public void setTcpBufferSizes(String tcpBufferSizes) {
mTcpBufferSizes = tcpBufferSizes;
}
@@ -648,7 +660,8 @@
*
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public String getTcpBufferSizes() {
return mTcpBufferSizes;
}
@@ -699,7 +712,8 @@
*
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public boolean removeRoute(RouteInfo route) {
return route != null &&
Objects.equals(mIfaceName, route.getInterface()) &&
@@ -960,7 +974,8 @@
* @return {@code true} if there is an IPv4 address, {@code false} otherwise.
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public boolean hasIPv4Address() {
for (LinkAddress address : mLinkAddresses) {
if (address.getAddress() instanceof Inet4Address) {
@@ -988,7 +1003,8 @@
* @return {@code true} if there is a global preferred IPv6 address, {@code false} otherwise.
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public boolean hasGlobalIPv6Address() {
for (LinkAddress address : mLinkAddresses) {
if (address.getAddress() instanceof Inet6Address && address.isGlobalPreferred()) {
@@ -1020,7 +1036,8 @@
* @return {@code true} if there is an IPv6 default route, {@code false} otherwise.
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public boolean hasIPv6DefaultRoute() {
for (RouteInfo r : mRoutes) {
if (r.isIPv6Default()) {
@@ -1099,6 +1116,8 @@
* @return {@code true} if the link is provisioned, {@code false} otherwise.
* @hide
*/
+ @TestApi
+ @SystemApi
public boolean isIPv4Provisioned() {
return (hasIPv4Address() &&
hasIPv4DefaultRoute() &&
@@ -1112,7 +1131,8 @@
* @return {@code true} if the link is provisioned, {@code false} otherwise.
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public boolean isIPv6Provisioned() {
return (hasGlobalIPv6Address() &&
hasIPv6DefaultRoute() &&
@@ -1126,7 +1146,8 @@
* @return {@code true} if the link is provisioned, {@code false} otherwise.
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public boolean isProvisioned() {
return (isIPv4Provisioned() || isIPv6Provisioned());
}
@@ -1138,7 +1159,8 @@
* {@code false} otherwise.
* @hide
*/
- @UnsupportedAppUsage
+ @TestApi
+ @SystemApi
public boolean isReachable(InetAddress ip) {
final List<RouteInfo> allRoutes = getAllRoutes();
// If we don't have a route to this IP address, it's not reachable.
diff --git a/core/java/android/net/LinkPropertiesParcelable.aidl b/core/java/android/net/LinkPropertiesParcelable.aidl
index b153dc7..6b52239 100644
--- a/core/java/android/net/LinkPropertiesParcelable.aidl
+++ b/core/java/android/net/LinkPropertiesParcelable.aidl
@@ -35,5 +35,4 @@
int mtu;
String tcpBufferSizes;
IpPrefixParcelable nat64Prefix;
- LinkPropertiesParcelable[] stackedLinks;
}
\ No newline at end of file
diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java
index 1b44c92..7e9bda1 100644
--- a/core/java/android/net/NetworkCapabilities.java
+++ b/core/java/android/net/NetworkCapabilities.java
@@ -712,6 +712,7 @@
* @hide
*/
@TestApi
+ @SystemApi
public @Transport int[] getTransportTypes() {
return BitUtils.unpackBits(mTransportTypes);
}
@@ -1312,6 +1313,8 @@
*
* @hide
*/
+ @TestApi
+ @SystemApi
public boolean satisfiedByNetworkCapabilities(NetworkCapabilities nc) {
return satisfiedByNetworkCapabilities(nc, false);
}
diff --git a/core/java/android/net/SSLCertificateSocketFactory.java b/core/java/android/net/SSLCertificateSocketFactory.java
index abc1cac..90dccb5 100644
--- a/core/java/android/net/SSLCertificateSocketFactory.java
+++ b/core/java/android/net/SSLCertificateSocketFactory.java
@@ -86,7 +86,16 @@
* <p>On development devices, "setprop socket.relaxsslcheck yes" bypasses all
* SSL certificate and hostname checks for testing purposes. This setting
* requires root access.
+ *
+ * @deprecated This class has less error-prone replacements using standard APIs. To create an
+ * {@code SSLSocket}, obtain an {@link SSLSocketFactory} from {@link SSLSocketFactory#getDefault()}
+ * or {@link javax.net.ssl.SSLContext#getSocketFactory()}. To verify hostnames, pass
+ * {@code "HTTPS"} to
+ * {@link javax.net.ssl.SSLParameters#setEndpointIdentificationAlgorithm(String)}. To enable ALPN,
+ * use {@link javax.net.ssl.SSLParameters#setApplicationProtocols(String[])}. To enable SNI,
+ * use {@link javax.net.ssl.SSLParameters#setServerNames(java.util.List)}.
*/
+@Deprecated
public class SSLCertificateSocketFactory extends SSLSocketFactory {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
private static final String TAG = "SSLCertificateSocketFactory";
diff --git a/core/java/android/net/VpnService.java b/core/java/android/net/VpnService.java
index f0c0462..37bf3a7 100644
--- a/core/java/android/net/VpnService.java
+++ b/core/java/android/net/VpnService.java
@@ -368,6 +368,29 @@
}
/**
+ * Returns whether the service is running in always-on VPN mode.
+ */
+ public final boolean isAlwaysOn() {
+ try {
+ return getService().isCallerCurrentAlwaysOnVpnApp();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Returns whether the service is running in always-on VPN mode blocking connections without
+ * VPN.
+ */
+ public final boolean isLockdownEnabled() {
+ try {
+ return getService().isCallerCurrentAlwaysOnVpnLockdownApp();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Return the communication interface to the service. This method returns
* {@code null} on {@link Intent}s other than {@link #SERVICE_INTERFACE}
* action. Applications overriding this method must identify the intent
diff --git a/core/java/android/net/metrics/ApfProgramEvent.java b/core/java/android/net/metrics/ApfProgramEvent.java
index 5dabf35..8601005 100644
--- a/core/java/android/net/metrics/ApfProgramEvent.java
+++ b/core/java/android/net/metrics/ApfProgramEvent.java
@@ -17,6 +17,8 @@
package android.net.metrics;
import android.annotation.IntDef;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;
@@ -36,11 +38,15 @@
* the APF program in place with a new APF program.
* {@hide}
*/
-public final class ApfProgramEvent implements Parcelable {
+@TestApi
+@SystemApi
+public final class ApfProgramEvent implements IpConnectivityLog.Event {
// Bitflag constants describing what an Apf program filters.
// Bits are indexeds from LSB to MSB, starting at index 0.
+ /** @hide */
public static final int FLAG_MULTICAST_FILTER_ON = 0;
+ /** @hide */
public static final int FLAG_HAS_IPV4_ADDRESS = 1;
/** {@hide} */
@@ -48,21 +54,33 @@
@Retention(RetentionPolicy.SOURCE)
public @interface Flags {}
+ /** @hide */
@UnsupportedAppUsage
- public long lifetime; // Maximum computed lifetime of the program in seconds
+ public final long lifetime; // Maximum computed lifetime of the program in seconds
+ /** @hide */
@UnsupportedAppUsage
- public long actualLifetime; // Effective program lifetime in seconds
+ public final long actualLifetime; // Effective program lifetime in seconds
+ /** @hide */
@UnsupportedAppUsage
- public int filteredRas; // Number of RAs filtered by the APF program
+ public final int filteredRas; // Number of RAs filtered by the APF program
+ /** @hide */
@UnsupportedAppUsage
- public int currentRas; // Total number of current RAs at generation time
+ public final int currentRas; // Total number of current RAs at generation time
+ /** @hide */
@UnsupportedAppUsage
- public int programLength; // Length of the APF program in bytes
+ public final int programLength; // Length of the APF program in bytes
+ /** @hide */
@UnsupportedAppUsage
- public int flags; // Bitfield compound of FLAG_* constants
+ public final int flags; // Bitfield compound of FLAG_* constants
- @UnsupportedAppUsage
- public ApfProgramEvent() {
+ private ApfProgramEvent(long lifetime, long actualLifetime, int filteredRas, int currentRas,
+ int programLength, int flags) {
+ this.lifetime = lifetime;
+ this.actualLifetime = actualLifetime;
+ this.filteredRas = filteredRas;
+ this.currentRas = currentRas;
+ this.programLength = programLength;
+ this.flags = flags;
}
private ApfProgramEvent(Parcel in) {
@@ -74,6 +92,75 @@
this.flags = in.readInt();
}
+ /**
+ * Utility to create an instance of {@link ApfProgramEvent}.
+ */
+ public static class Builder {
+ private long mLifetime;
+ private long mActualLifetime;
+ private int mFilteredRas;
+ private int mCurrentRas;
+ private int mProgramLength;
+ private int mFlags;
+
+ /**
+ * Set the maximum computed lifetime of the program in seconds.
+ */
+ public Builder setLifetime(long lifetime) {
+ mLifetime = lifetime;
+ return this;
+ }
+
+ /**
+ * Set the effective program lifetime in seconds.
+ */
+ public Builder setActualLifetime(long lifetime) {
+ mActualLifetime = lifetime;
+ return this;
+ }
+
+ /**
+ * Set the number of RAs filtered by the APF program.
+ */
+ public Builder setFilteredRas(int filteredRas) {
+ mFilteredRas = filteredRas;
+ return this;
+ }
+
+ /**
+ * Set the total number of current RAs at generation time.
+ */
+ public Builder setCurrentRas(int currentRas) {
+ mCurrentRas = currentRas;
+ return this;
+ }
+
+ /**
+ * Set the length of the APF program in bytes.
+ */
+ public Builder setProgramLength(int programLength) {
+ mProgramLength = programLength;
+ return this;
+ }
+
+ /**
+ * Set the flags describing what an Apf program filters.
+ */
+ public Builder setFlags(boolean hasIPv4, boolean multicastFilterOn) {
+ mFlags = flagsFor(hasIPv4, multicastFilterOn);
+ return this;
+ }
+
+ /**
+ * Build a new {@link ApfProgramEvent}.
+ */
+ public ApfProgramEvent build() {
+ return new ApfProgramEvent(mLifetime, mActualLifetime, mFilteredRas, mCurrentRas,
+ mProgramLength, mFlags);
+ }
+ }
+
+ /** @hide */
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeLong(lifetime);
@@ -84,6 +171,7 @@
out.writeInt(flags);
}
+ /** @hide */
@Override
public int describeContents() {
return 0;
@@ -96,6 +184,7 @@
programLength, actualLifetime, lifetimeString, namesOf(flags));
}
+ /** @hide */
public static final Parcelable.Creator<ApfProgramEvent> CREATOR
= new Parcelable.Creator<ApfProgramEvent>() {
public ApfProgramEvent createFromParcel(Parcel in) {
@@ -107,6 +196,7 @@
}
};
+ /** @hide */
@UnsupportedAppUsage
public static @Flags int flagsFor(boolean hasIPv4, boolean multicastFilterOn) {
int bitfield = 0;
diff --git a/core/java/android/net/metrics/ApfStats.java b/core/java/android/net/metrics/ApfStats.java
index bb2a35c..844a134 100644
--- a/core/java/android/net/metrics/ApfStats.java
+++ b/core/java/android/net/metrics/ApfStats.java
@@ -16,6 +16,8 @@
package android.net.metrics;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;
@@ -24,42 +26,70 @@
* An event logged for an interface with APF capabilities when its IpClient state machine exits.
* {@hide}
*/
-public final class ApfStats implements Parcelable {
+@SystemApi
+@TestApi
+public final class ApfStats implements IpConnectivityLog.Event {
- /** time interval in milliseconds these stastistics covers. */
+ /**
+ * time interval in milliseconds these stastistics covers.
+ * @hide
+ */
@UnsupportedAppUsage
- public long durationMs;
- /** number of received RAs. */
+ public final long durationMs;
+ /**
+ * number of received RAs.
+ * @hide
+ */
@UnsupportedAppUsage
- public int receivedRas;
- /** number of received RAs matching a known RA. */
+ public final int receivedRas;
+ /**
+ * number of received RAs matching a known RA.
+ * @hide
+ */
@UnsupportedAppUsage
- public int matchingRas;
- /** number of received RAs ignored due to the MAX_RAS limit. */
+ public final int matchingRas;
+ /**
+ * number of received RAs ignored due to the MAX_RAS limit.
+ * @hide
+ */
@UnsupportedAppUsage
- public int droppedRas;
- /** number of received RAs with a minimum lifetime of 0. */
+ public final int droppedRas;
+ /**
+ * number of received RAs with a minimum lifetime of 0.
+ * @hide
+ */
@UnsupportedAppUsage
- public int zeroLifetimeRas;
- /** number of received RAs that could not be parsed. */
+ public final int zeroLifetimeRas;
+ /**
+ * number of received RAs that could not be parsed.
+ * @hide
+ */
@UnsupportedAppUsage
- public int parseErrors;
- /** number of APF program updates from receiving RAs.. */
+ public final int parseErrors;
+ /**
+ * number of APF program updates from receiving RAs.
+ * @hide
+ */
@UnsupportedAppUsage
- public int programUpdates;
- /** total number of APF program updates. */
+ public final int programUpdates;
+ /**
+ * total number of APF program updates.
+ * @hide
+ */
@UnsupportedAppUsage
- public int programUpdatesAll;
- /** number of APF program updates from allowing multicast traffic. */
+ public final int programUpdatesAll;
+ /**
+ * number of APF program updates from allowing multicast traffic.
+ * @hide
+ */
@UnsupportedAppUsage
- public int programUpdatesAllowingMulticast;
- /** maximum APF program size advertised by hardware. */
+ public final int programUpdatesAllowingMulticast;
+ /**
+ * maximum APF program size advertised by hardware.
+ * @hide
+ */
@UnsupportedAppUsage
- public int maxProgramSize;
-
- @UnsupportedAppUsage
- public ApfStats() {
- }
+ public final int maxProgramSize;
private ApfStats(Parcel in) {
this.durationMs = in.readLong();
@@ -74,6 +104,130 @@
this.maxProgramSize = in.readInt();
}
+ private ApfStats(long durationMs, int receivedRas, int matchingRas, int droppedRas,
+ int zeroLifetimeRas, int parseErrors, int programUpdates, int programUpdatesAll,
+ int programUpdatesAllowingMulticast, int maxProgramSize) {
+ this.durationMs = durationMs;
+ this.receivedRas = receivedRas;
+ this.matchingRas = matchingRas;
+ this.droppedRas = droppedRas;
+ this.zeroLifetimeRas = zeroLifetimeRas;
+ this.parseErrors = parseErrors;
+ this.programUpdates = programUpdates;
+ this.programUpdatesAll = programUpdatesAll;
+ this.programUpdatesAllowingMulticast = programUpdatesAllowingMulticast;
+ this.maxProgramSize = maxProgramSize;
+ }
+
+ /**
+ * Utility to create an instance of {@link ApfStats}.
+ * @hide
+ */
+ @SystemApi
+ @TestApi
+ public static class Builder {
+ private long mDurationMs;
+ private int mReceivedRas;
+ private int mMatchingRas;
+ private int mDroppedRas;
+ private int mZeroLifetimeRas;
+ private int mParseErrors;
+ private int mProgramUpdates;
+ private int mProgramUpdatesAll;
+ private int mProgramUpdatesAllowingMulticast;
+ private int mMaxProgramSize;
+
+ /**
+ * Set the time interval in milliseconds these statistics covers.
+ */
+ public Builder setDurationMs(long durationMs) {
+ mDurationMs = durationMs;
+ return this;
+ }
+
+ /**
+ * Set the number of received RAs.
+ */
+ public Builder setReceivedRas(int receivedRas) {
+ mReceivedRas = receivedRas;
+ return this;
+ }
+
+ /**
+ * Set the number of received RAs matching a known RA.
+ */
+ public Builder setMatchingRas(int matchingRas) {
+ mMatchingRas = matchingRas;
+ return this;
+ }
+
+ /**
+ * Set the number of received RAs ignored due to the MAX_RAS limit.
+ */
+ public Builder setDroppedRas(int droppedRas) {
+ mDroppedRas = droppedRas;
+ return this;
+ }
+
+ /**
+ * Set the number of received RAs with a minimum lifetime of 0.
+ */
+ public Builder setZeroLifetimeRas(int zeroLifetimeRas) {
+ mZeroLifetimeRas = zeroLifetimeRas;
+ return this;
+ }
+
+ /**
+ * Set the number of received RAs that could not be parsed.
+ */
+ public Builder setParseErrors(int parseErrors) {
+ mParseErrors = parseErrors;
+ return this;
+ }
+
+ /**
+ * Set the number of APF program updates from receiving RAs.
+ */
+ public Builder setProgramUpdates(int programUpdates) {
+ mProgramUpdates = programUpdates;
+ return this;
+ }
+
+ /**
+ * Set the total number of APF program updates.
+ */
+ public Builder setProgramUpdatesAll(int programUpdatesAll) {
+ mProgramUpdatesAll = programUpdatesAll;
+ return this;
+ }
+
+ /**
+ * Set the number of APF program updates from allowing multicast traffic.
+ */
+ public Builder setProgramUpdatesAllowingMulticast(int programUpdatesAllowingMulticast) {
+ mProgramUpdatesAllowingMulticast = programUpdatesAllowingMulticast;
+ return this;
+ }
+
+ /**
+ * Set the maximum APF program size advertised by hardware.
+ */
+ public Builder setMaxProgramSize(int maxProgramSize) {
+ mMaxProgramSize = maxProgramSize;
+ return this;
+ }
+
+ /**
+ * Create a new {@link ApfStats}.
+ */
+ public ApfStats build() {
+ return new ApfStats(mDurationMs, mReceivedRas, mMatchingRas, mDroppedRas,
+ mZeroLifetimeRas, mParseErrors, mProgramUpdates, mProgramUpdatesAll,
+ mProgramUpdatesAllowingMulticast, mMaxProgramSize);
+ }
+ }
+
+ /** @hide */
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeLong(durationMs);
@@ -88,6 +242,7 @@
out.writeInt(maxProgramSize);
}
+ /** @hide */
@Override
public int describeContents() {
return 0;
@@ -108,6 +263,7 @@
.toString();
}
+ /** @hide */
public static final Parcelable.Creator<ApfStats> CREATOR = new Parcelable.Creator<ApfStats>() {
public ApfStats createFromParcel(Parcel in) {
return new ApfStats(in);
diff --git a/core/java/android/net/metrics/DhcpClientEvent.java b/core/java/android/net/metrics/DhcpClientEvent.java
index 98a7d7e..2a942ee 100644
--- a/core/java/android/net/metrics/DhcpClientEvent.java
+++ b/core/java/android/net/metrics/DhcpClientEvent.java
@@ -16,6 +16,8 @@
package android.net.metrics;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;
@@ -24,7 +26,9 @@
* An event recorded when a DhcpClient state machine transitions to a new state.
* {@hide}
*/
-public final class DhcpClientEvent implements Parcelable {
+@SystemApi
+@TestApi
+public final class DhcpClientEvent implements IpConnectivityLog.Event {
// Names for recording DhcpClient pseudo-state transitions.
/** {@hide} Represents transitions from DhcpInitState to DhcpBoundState */
@@ -32,11 +36,13 @@
/** {@hide} Represents transitions from and to DhcpBoundState via DhcpRenewingState */
public static final String RENEWING_BOUND = "RenewingBoundState";
+ /** @hide */
public final String msg;
+ /** @hide */
public final int durationMs;
@UnsupportedAppUsage
- public DhcpClientEvent(String msg, int durationMs) {
+ private DhcpClientEvent(String msg, int durationMs) {
this.msg = msg;
this.durationMs = durationMs;
}
@@ -46,12 +52,45 @@
this.durationMs = in.readInt();
}
+ /**
+ * Utility to create an instance of {@link ApfProgramEvent}.
+ */
+ public static class Builder {
+ private String mMsg;
+ private int mDurationMs;
+
+ /**
+ * Set the message of the event.
+ */
+ public Builder setMsg(String msg) {
+ mMsg = msg;
+ return this;
+ }
+
+ /**
+ * Set the duration of the event in milliseconds.
+ */
+ public Builder setDurationMs(int durationMs) {
+ mDurationMs = durationMs;
+ return this;
+ }
+
+ /**
+ * Create a new {@link DhcpClientEvent}.
+ */
+ public DhcpClientEvent build() {
+ return new DhcpClientEvent(mMsg, mDurationMs);
+ }
+ }
+
+ /** @hide */
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeString(msg);
out.writeInt(durationMs);
}
+ /** @hide */
@Override
public int describeContents() {
return 0;
@@ -62,6 +101,7 @@
return String.format("DhcpClientEvent(%s, %dms)", msg, durationMs);
}
+ /** @hide */
public static final Parcelable.Creator<DhcpClientEvent> CREATOR
= new Parcelable.Creator<DhcpClientEvent>() {
public DhcpClientEvent createFromParcel(Parcel in) {
diff --git a/core/java/android/net/metrics/DhcpErrorEvent.java b/core/java/android/net/metrics/DhcpErrorEvent.java
index c6c06f0..18fde80 100644
--- a/core/java/android/net/metrics/DhcpErrorEvent.java
+++ b/core/java/android/net/metrics/DhcpErrorEvent.java
@@ -16,7 +16,8 @@
package android.net.metrics;
-import android.annotation.UnsupportedAppUsage;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.SparseArray;
@@ -27,48 +28,34 @@
* Event class used to record error events when parsing DHCP response packets.
* {@hide}
*/
-public final class DhcpErrorEvent implements Parcelable {
+@SystemApi
+@TestApi
+public final class DhcpErrorEvent implements IpConnectivityLog.Event {
public static final int L2_ERROR = 1;
public static final int L3_ERROR = 2;
public static final int L4_ERROR = 3;
public static final int DHCP_ERROR = 4;
public static final int MISC_ERROR = 5;
- @UnsupportedAppUsage
public static final int L2_TOO_SHORT = makeErrorCode(L2_ERROR, 1);
- @UnsupportedAppUsage
public static final int L2_WRONG_ETH_TYPE = makeErrorCode(L2_ERROR, 2);
- @UnsupportedAppUsage
public static final int L3_TOO_SHORT = makeErrorCode(L3_ERROR, 1);
- @UnsupportedAppUsage
public static final int L3_NOT_IPV4 = makeErrorCode(L3_ERROR, 2);
- @UnsupportedAppUsage
public static final int L3_INVALID_IP = makeErrorCode(L3_ERROR, 3);
- @UnsupportedAppUsage
public static final int L4_NOT_UDP = makeErrorCode(L4_ERROR, 1);
- @UnsupportedAppUsage
public static final int L4_WRONG_PORT = makeErrorCode(L4_ERROR, 2);
- @UnsupportedAppUsage
public static final int BOOTP_TOO_SHORT = makeErrorCode(DHCP_ERROR, 1);
- @UnsupportedAppUsage
public static final int DHCP_BAD_MAGIC_COOKIE = makeErrorCode(DHCP_ERROR, 2);
- @UnsupportedAppUsage
public static final int DHCP_INVALID_OPTION_LENGTH = makeErrorCode(DHCP_ERROR, 3);
- @UnsupportedAppUsage
public static final int DHCP_NO_MSG_TYPE = makeErrorCode(DHCP_ERROR, 4);
- @UnsupportedAppUsage
public static final int DHCP_UNKNOWN_MSG_TYPE = makeErrorCode(DHCP_ERROR, 5);
- @UnsupportedAppUsage
public static final int DHCP_NO_COOKIE = makeErrorCode(DHCP_ERROR, 6);
- @UnsupportedAppUsage
public static final int BUFFER_UNDERFLOW = makeErrorCode(MISC_ERROR, 1);
- @UnsupportedAppUsage
public static final int RECEIVE_ERROR = makeErrorCode(MISC_ERROR, 2);
- @UnsupportedAppUsage
public static final int PARSING_ERROR = makeErrorCode(MISC_ERROR, 3);
// error code byte format (MSB to LSB):
@@ -76,9 +63,9 @@
// byte 1: error subtype
// byte 2: unused
// byte 3: optional code
+ /** @hide */
public final int errorCode;
- @UnsupportedAppUsage
public DhcpErrorEvent(int errorCode) {
this.errorCode = errorCode;
}
@@ -87,16 +74,19 @@
this.errorCode = in.readInt();
}
+ /** @hide */
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeInt(errorCode);
}
+ /** @hide */
@Override
public int describeContents() {
return 0;
}
+ /** @hide */
public static final Parcelable.Creator<DhcpErrorEvent> CREATOR
= new Parcelable.Creator<DhcpErrorEvent>() {
public DhcpErrorEvent createFromParcel(Parcel in) {
@@ -108,7 +98,6 @@
}
};
- @UnsupportedAppUsage
public static int errorCodeWithOption(int errorCode, int option) {
return (0xFFFF0000 & errorCode) | (0xFF & option);
}
diff --git a/core/java/android/net/metrics/IpConnectivityLog.java b/core/java/android/net/metrics/IpConnectivityLog.java
index 998f4ba..16aea31b 100644
--- a/core/java/android/net/metrics/IpConnectivityLog.java
+++ b/core/java/android/net/metrics/IpConnectivityLog.java
@@ -16,13 +16,17 @@
package android.net.metrics;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.net.ConnectivityMetricsEvent;
import android.net.IIpConnectivityMetrics;
+import android.net.Network;
import android.os.Parcelable;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Log;
+
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.BitUtils;
@@ -30,18 +34,28 @@
* Class for logging IpConnectvity events with IpConnectivityMetrics
* {@hide}
*/
+@SystemApi
+@TestApi
public class IpConnectivityLog {
private static final String TAG = IpConnectivityLog.class.getSimpleName();
private static final boolean DBG = false;
+ /** @hide */
public static final String SERVICE_NAME = "connmetrics";
private IIpConnectivityMetrics mService;
+ /**
+ * An event to be logged.
+ */
+ public interface Event extends Parcelable {}
+
+ /** @hide */
@UnsupportedAppUsage
public IpConnectivityLog() {
}
+ /** @hide */
@VisibleForTesting
public IpConnectivityLog(IIpConnectivityMetrics service) {
mService = service;
@@ -67,6 +81,7 @@
* @param ev the event to log. If the event timestamp is 0,
* the timestamp is set to the current time in milliseconds.
* @return true if the event was successfully logged.
+ * @hide
*/
public boolean log(ConnectivityMetricsEvent ev) {
if (!checkLoggerService()) {
@@ -94,7 +109,7 @@
* @param data is a Parcelable instance representing the event.
* @return true if the event was successfully logged.
*/
- public boolean log(long timestamp, Parcelable data) {
+ public boolean log(long timestamp, Event data) {
ConnectivityMetricsEvent ev = makeEv(data);
ev.timestamp = timestamp;
return log(ev);
@@ -106,8 +121,7 @@
* @param data is a Parcelable instance representing the event.
* @return true if the event was successfully logged.
*/
- @UnsupportedAppUsage
- public boolean log(String ifname, Parcelable data) {
+ public boolean log(String ifname, Event data) {
ConnectivityMetricsEvent ev = makeEv(data);
ev.ifname = ifname;
return log(ev);
@@ -115,13 +129,25 @@
/**
* Log an IpConnectivity event.
+ * @param network the network associated with the event.
+ * @param transports the current transports of the network associated with the event, as defined
+ * in NetworkCapabilities.
+ * @param data is a Parcelable instance representing the event.
+ * @return true if the event was successfully logged.
+ */
+ public boolean log(Network network, int[] transports, Event data) {
+ return log(network.netId, transports, data);
+ }
+
+ /**
+ * Log an IpConnectivity event.
* @param netid the id of the network associated with the event.
* @param transports the current transports of the network associated with the event, as defined
* in NetworkCapabilities.
* @param data is a Parcelable instance representing the event.
* @return true if the event was successfully logged.
*/
- public boolean log(int netid, int[] transports, Parcelable data) {
+ public boolean log(int netid, int[] transports, Event data) {
ConnectivityMetricsEvent ev = makeEv(data);
ev.netId = netid;
ev.transports = BitUtils.packBits(transports);
@@ -133,12 +159,11 @@
* @param data is a Parcelable instance representing the event.
* @return true if the event was successfully logged.
*/
- @UnsupportedAppUsage
- public boolean log(Parcelable data) {
+ public boolean log(Event data) {
return log(makeEv(data));
}
- private static ConnectivityMetricsEvent makeEv(Parcelable data) {
+ private static ConnectivityMetricsEvent makeEv(Event data) {
ConnectivityMetricsEvent ev = new ConnectivityMetricsEvent();
ev.data = data;
return ev;
diff --git a/core/java/android/net/metrics/IpManagerEvent.java b/core/java/android/net/metrics/IpManagerEvent.java
index c47650f..013e353 100644
--- a/core/java/android/net/metrics/IpManagerEvent.java
+++ b/core/java/android/net/metrics/IpManagerEvent.java
@@ -17,7 +17,8 @@
package android.net.metrics;
import android.annotation.IntDef;
-import android.annotation.UnsupportedAppUsage;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.SparseArray;
@@ -28,11 +29,13 @@
import java.lang.annotation.RetentionPolicy;
/**
- * An event recorded by IpManager when IP provisioning completes for a network or
+ * An event recorded by IpClient when IP provisioning completes for a network or
* when a network disconnects.
* {@hide}
*/
-public final class IpManagerEvent implements Parcelable {
+@SystemApi
+@TestApi
+public final class IpManagerEvent implements IpConnectivityLog.Event {
public static final int PROVISIONING_OK = 1;
public static final int PROVISIONING_FAIL = 2;
@@ -43,6 +46,7 @@
public static final int ERROR_INVALID_PROVISIONING = 7;
public static final int ERROR_INTERFACE_NOT_FOUND = 8;
+ /** @hide */
@IntDef(value = {
PROVISIONING_OK, PROVISIONING_FAIL, COMPLETE_LIFECYCLE,
ERROR_STARTING_IPV4, ERROR_STARTING_IPV6, ERROR_STARTING_IPREACHABILITYMONITOR,
@@ -51,10 +55,11 @@
@Retention(RetentionPolicy.SOURCE)
public @interface EventType {}
+ /** @hide */
public final @EventType int eventType;
+ /** @hide */
public final long durationMs;
- @UnsupportedAppUsage
public IpManagerEvent(@EventType int eventType, long duration) {
this.eventType = eventType;
this.durationMs = duration;
@@ -65,17 +70,20 @@
this.durationMs = in.readLong();
}
+ /** @hide */
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeInt(eventType);
out.writeLong(durationMs);
}
+ /** @hide */
@Override
public int describeContents() {
return 0;
}
+ /** @hide */
public static final Parcelable.Creator<IpManagerEvent> CREATOR
= new Parcelable.Creator<IpManagerEvent>() {
public IpManagerEvent createFromParcel(Parcel in) {
diff --git a/core/java/android/net/metrics/IpReachabilityEvent.java b/core/java/android/net/metrics/IpReachabilityEvent.java
index 715c95e..c736297 100644
--- a/core/java/android/net/metrics/IpReachabilityEvent.java
+++ b/core/java/android/net/metrics/IpReachabilityEvent.java
@@ -16,7 +16,8 @@
package android.net.metrics;
-import android.annotation.UnsupportedAppUsage;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.SparseArray;
@@ -28,7 +29,9 @@
* a neighbor probe result.
* {@hide}
*/
-public final class IpReachabilityEvent implements Parcelable {
+@SystemApi
+@TestApi
+public final class IpReachabilityEvent implements IpConnectivityLog.Event {
// Event types.
/** A probe forced by IpReachabilityMonitor. */
@@ -47,9 +50,9 @@
// byte 1: unused
// byte 2: type of event: PROBE, NUD_FAILED, PROVISIONING_LOST
// byte 3: when byte 2 == PROBE, errno code from RTNetlink or IpReachabilityMonitor.
+ /** @hide */
public final int eventType;
- @UnsupportedAppUsage
public IpReachabilityEvent(int eventType) {
this.eventType = eventType;
}
@@ -58,16 +61,19 @@
this.eventType = in.readInt();
}
+ /** @hide */
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeInt(eventType);
}
+ /** @hide */
@Override
public int describeContents() {
return 0;
}
+ /** @hide */
public static final Parcelable.Creator<IpReachabilityEvent> CREATOR
= new Parcelable.Creator<IpReachabilityEvent>() {
public IpReachabilityEvent createFromParcel(Parcel in) {
@@ -79,18 +85,6 @@
}
};
- /**
- * Returns the NUD failure event type code corresponding to the given conditions.
- */
- @UnsupportedAppUsage
- public static int nudFailureEventType(boolean isFromProbe, boolean isProvisioningLost) {
- if (isFromProbe) {
- return isProvisioningLost ? PROVISIONING_LOST : NUD_FAILED;
- } else {
- return isProvisioningLost ? PROVISIONING_LOST_ORGANIC : NUD_FAILED_ORGANIC;
- }
- }
-
@Override
public String toString() {
int hi = eventType & 0xff00;
diff --git a/core/java/android/net/metrics/NetworkEvent.java b/core/java/android/net/metrics/NetworkEvent.java
index cb82fbe..f5b2ff1 100644
--- a/core/java/android/net/metrics/NetworkEvent.java
+++ b/core/java/android/net/metrics/NetworkEvent.java
@@ -17,6 +17,8 @@
package android.net.metrics;
import android.annotation.IntDef;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.SparseArray;
@@ -29,7 +31,9 @@
/**
* {@hide}
*/
-public final class NetworkEvent implements Parcelable {
+@SystemApi
+@TestApi
+public final class NetworkEvent implements IpConnectivityLog.Event {
public static final int NETWORK_CONNECTED = 1;
public static final int NETWORK_VALIDATED = 2;
@@ -46,6 +50,7 @@
public static final int NETWORK_CONSECUTIVE_DNS_TIMEOUT_FOUND = 12;
+ /** @hide */
@IntDef(value = {
NETWORK_CONNECTED,
NETWORK_VALIDATED,
@@ -63,7 +68,9 @@
@Retention(RetentionPolicy.SOURCE)
public @interface EventType {}
+ /** @hide */
public final @EventType int eventType;
+ /** @hide */
public final long durationMs;
public NetworkEvent(@EventType int eventType, long durationMs) {
@@ -80,17 +87,20 @@
durationMs = in.readLong();
}
+ /** @hide */
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeInt(eventType);
out.writeLong(durationMs);
}
+ /** @hide */
@Override
public int describeContents() {
return 0;
}
+ /** @hide */
public static final Parcelable.Creator<NetworkEvent> CREATOR
= new Parcelable.Creator<NetworkEvent>() {
public NetworkEvent createFromParcel(Parcel in) {
diff --git a/core/java/android/net/metrics/RaEvent.java b/core/java/android/net/metrics/RaEvent.java
index c41881c..d308246 100644
--- a/core/java/android/net/metrics/RaEvent.java
+++ b/core/java/android/net/metrics/RaEvent.java
@@ -24,7 +24,7 @@
* An event logged when the APF packet socket receives an RA packet.
* {@hide}
*/
-public final class RaEvent implements Parcelable {
+public final class RaEvent implements IpConnectivityLog.Event {
public static final long NO_LIFETIME = -1L;
diff --git a/core/java/android/net/metrics/ValidationProbeEvent.java b/core/java/android/net/metrics/ValidationProbeEvent.java
index 12c2305..42e8aa6 100644
--- a/core/java/android/net/metrics/ValidationProbeEvent.java
+++ b/core/java/android/net/metrics/ValidationProbeEvent.java
@@ -17,6 +17,8 @@
package android.net.metrics;
import android.annotation.IntDef;
+import android.annotation.SystemApi;
+import android.annotation.TestApi;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.SparseArray;
@@ -30,7 +32,9 @@
* An event recorded by NetworkMonitor when sending a probe for finding captive portals.
* {@hide}
*/
-public final class ValidationProbeEvent implements Parcelable {
+@SystemApi
+@TestApi
+public final class ValidationProbeEvent implements IpConnectivityLog.Event {
public static final int PROBE_DNS = 0;
public static final int PROBE_HTTP = 1;
@@ -45,20 +49,27 @@
private static final int FIRST_VALIDATION = 1 << 8;
private static final int REVALIDATION = 2 << 8;
+ /** @hide */
@IntDef(value = {DNS_FAILURE, DNS_SUCCESS})
@Retention(RetentionPolicy.SOURCE)
public @interface ReturnCode {}
- public long durationMs;
+ /** @hide */
+ public final long durationMs;
// probeType byte format (MSB to LSB):
// byte 0: unused
// byte 1: unused
// byte 2: 0 = UNKNOWN, 1 = FIRST_VALIDATION, 2 = REVALIDATION
// byte 3: PROBE_* constant
- public int probeType;
- public @ReturnCode int returnCode;
+ /** @hide */
+ public final int probeType;
+ /** @hide */
+ public final @ReturnCode int returnCode;
- public ValidationProbeEvent() {
+ private ValidationProbeEvent(long durationMs, int probeType, int returnCode) {
+ this.durationMs = durationMs;
+ this.probeType = probeType;
+ this.returnCode = returnCode;
}
private ValidationProbeEvent(Parcel in) {
@@ -67,6 +78,47 @@
returnCode = in.readInt();
}
+ /**
+ * Utility to create an instance of {@link ApfProgramEvent}.
+ */
+ public static class Builder {
+ private long mDurationMs;
+ private int mProbeType;
+ private int mReturnCode;
+
+ /**
+ * Set the duration of the probe in milliseconds.
+ */
+ public Builder setDurationMs(long durationMs) {
+ mDurationMs = durationMs;
+ return this;
+ }
+
+ /**
+ * Set the probe type based on whether it was the first validation.
+ */
+ public Builder setProbeType(int probeType, boolean firstValidation) {
+ mProbeType = makeProbeType(probeType, firstValidation);
+ return this;
+ }
+
+ /**
+ * Set the return code of the probe.
+ */
+ public Builder setReturnCode(int returnCode) {
+ mReturnCode = returnCode;
+ return this;
+ }
+
+ /**
+ * Create a new {@link ValidationProbeEvent}.
+ */
+ public ValidationProbeEvent build() {
+ return new ValidationProbeEvent(mDurationMs, mProbeType, mReturnCode);
+ }
+ }
+
+ /** @hide */
@Override
public void writeToParcel(Parcel out, int flags) {
out.writeLong(durationMs);
@@ -74,11 +126,13 @@
out.writeInt(returnCode);
}
+ /** @hide */
@Override
public int describeContents() {
return 0;
}
+ /** @hide */
public static final Parcelable.Creator<ValidationProbeEvent> CREATOR
= new Parcelable.Creator<ValidationProbeEvent>() {
public ValidationProbeEvent createFromParcel(Parcel in) {
@@ -90,7 +144,7 @@
}
};
- public static int makeProbeType(int probeType, boolean firstValidation) {
+ private static int makeProbeType(int probeType, boolean firstValidation) {
return (probeType & 0xff) | (firstValidation ? FIRST_VALIDATION : REVALIDATION);
}
@@ -98,7 +152,7 @@
return Decoder.constants.get(probeType & 0xff, "PROBE_???");
}
- public static String getValidationStage(int probeType) {
+ private static String getValidationStage(int probeType) {
return Decoder.constants.get(probeType & 0xff00, "UNKNOWN");
}
diff --git a/core/java/android/net/util/SocketUtils.java b/core/java/android/net/util/SocketUtils.java
new file mode 100644
index 0000000..de67cf5
--- /dev/null
+++ b/core/java/android/net/util/SocketUtils.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.util;
+
+import static android.system.OsConstants.SOL_SOCKET;
+import static android.system.OsConstants.SO_BINDTODEVICE;
+
+import android.annotation.SystemApi;
+import android.net.NetworkUtils;
+import android.system.ErrnoException;
+import android.system.NetlinkSocketAddress;
+import android.system.Os;
+import android.system.PacketSocketAddress;
+
+import java.io.FileDescriptor;
+import java.net.SocketAddress;
+
+/**
+ * Collection of utilities to interact with raw sockets.
+ * @hide
+ */
+@SystemApi
+public class SocketUtils {
+ /**
+ * Create a raw datagram socket that is bound to an interface.
+ *
+ * <p>Data sent through the socket will go directly to the underlying network, ignoring VPNs.
+ */
+ public static void bindSocketToInterface(FileDescriptor socket, String iface)
+ throws ErrnoException {
+ // SO_BINDTODEVICE actually takes a string. This works because the first member
+ // of struct ifreq is a NULL-terminated interface name.
+ // TODO: add a setsockoptString()
+ Os.setsockoptIfreq(socket, SOL_SOCKET, SO_BINDTODEVICE, iface);
+ NetworkUtils.protectFromVpn(socket);
+ }
+
+ /**
+ * Make a socket address to communicate with netlink.
+ */
+ public static SocketAddress makeNetlinkSocketAddress(int portId, int groupsMask) {
+ return new NetlinkSocketAddress(portId, groupsMask);
+ }
+
+ /**
+ * Make a socket address to bind to packet sockets.
+ */
+ public static SocketAddress makePacketSocketAddress(short protocol, int ifIndex) {
+ return new PacketSocketAddress(protocol, ifIndex);
+ }
+
+ /**
+ * Make a socket address to send raw packets.
+ */
+ public static SocketAddress makePacketSocketAddress(int ifIndex, byte[] hwAddr) {
+ return new PacketSocketAddress(ifIndex, hwAddr);
+ }
+
+ private SocketUtils() {}
+}
diff --git a/core/java/android/os/HandlerThread.java b/core/java/android/os/HandlerThread.java
index a4d5c6f..92fcbb6 100644
--- a/core/java/android/os/HandlerThread.java
+++ b/core/java/android/os/HandlerThread.java
@@ -20,8 +20,10 @@
import android.annotation.Nullable;
/**
- * Handy class for starting a new thread that has a looper. The looper can then be
- * used to create handler classes. Note that start() must still be called.
+ * A {@link Thread} that has a {@link Looper}.
+ * The {@link Looper} can then be used to create {@link Handler}s.
+ * <p>
+ * Note that just like with a regular {@link Thread}, {@link #start()} must still be called.
*/
public class HandlerThread extends Thread {
int mPriority;
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java
index 760fef7..f2a9adb 100644
--- a/core/java/android/os/Process.java
+++ b/core/java/android/os/Process.java
@@ -48,7 +48,6 @@
/**
* Defines the root UID.
- * @hide
*/
public static final int ROOT_UID = 0;
@@ -64,7 +63,6 @@
/**
* Defines the UID/GID for the user shell.
- * @hide
*/
public static final int SHELL_UID = 2000;
@@ -118,7 +116,6 @@
/**
* Defines the UID/GID for the Bluetooth service process.
- * @hide
*/
public static final int BLUETOOTH_UID = 1002;
diff --git a/core/java/android/os/ServiceSpecificException.java b/core/java/android/os/ServiceSpecificException.java
index 3e0f6da..3b0f26ae 100644
--- a/core/java/android/os/ServiceSpecificException.java
+++ b/core/java/android/os/ServiceSpecificException.java
@@ -15,6 +15,8 @@
*/
package android.os;
+import android.annotation.SystemApi;
+
/**
* An exception specific to a service.
*
@@ -28,6 +30,7 @@
*
* @hide
*/
+@SystemApi
public class ServiceSpecificException extends RuntimeException {
public final int errorCode;
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 516f49c..b2c2d0e 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3300,6 +3300,14 @@
public static final int SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1;
/**
+ * Control whether to enable adaptive sleep mode.
+ * @hide
+ */
+ public static final String ADAPTIVE_SLEEP = "adaptive_sleep";
+
+ private static final Validator ADAPTIVE_SLEEP_VALIDATOR = BOOLEAN_VALIDATOR;
+
+ /**
* Control whether the process CPU usage meter should be shown.
*
* @deprecated This functionality is no longer available as of
@@ -4232,6 +4240,7 @@
SCREEN_BRIGHTNESS_MODE,
SCREEN_AUTO_BRIGHTNESS_ADJ,
SCREEN_BRIGHTNESS_FOR_VR,
+ ADAPTIVE_SLEEP,
VIBRATE_INPUT_DEVICES,
MODE_RINGER_STREAMS_AFFECTED,
TEXT_AUTO_REPLACE,
@@ -4307,6 +4316,7 @@
PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS);
PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_FOR_VR);
PUBLIC_SETTINGS.add(SCREEN_BRIGHTNESS_MODE);
+ PUBLIC_SETTINGS.add(ADAPTIVE_SLEEP);
PUBLIC_SETTINGS.add(MODE_RINGER_STREAMS_AFFECTED);
PUBLIC_SETTINGS.add(MUTE_STREAMS_AFFECTED);
PUBLIC_SETTINGS.add(VIBRATE_ON);
@@ -4411,6 +4421,7 @@
VALIDATORS.put(SCREEN_OFF_TIMEOUT, SCREEN_OFF_TIMEOUT_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_FOR_VR, SCREEN_BRIGHTNESS_FOR_VR_VALIDATOR);
VALIDATORS.put(SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_VALIDATOR);
+ VALIDATORS.put(ADAPTIVE_SLEEP, ADAPTIVE_SLEEP_VALIDATOR);
VALIDATORS.put(MODE_RINGER_STREAMS_AFFECTED, MODE_RINGER_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(MUTE_STREAMS_AFFECTED, MUTE_STREAMS_AFFECTED_VALIDATOR);
VALIDATORS.put(VIBRATE_ON, VIBRATE_ON_VALIDATOR);
diff --git a/core/java/android/util/DocumentsStatsLog.java b/core/java/android/util/DocumentsStatsLog.java
new file mode 100644
index 0000000..f483944
--- /dev/null
+++ b/core/java/android/util/DocumentsStatsLog.java
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.util;
+
+import android.annotation.SystemApi;
+import android.provider.DocumentsContract;
+import android.provider.DocumentsProvider;
+
+/**
+ * DocumentsStatsLog provides APIs to send DocumentsUI related events to statsd.
+ * @hide
+ */
+@SystemApi
+public class DocumentsStatsLog {
+
+ private DocumentsStatsLog() {}
+
+ /**
+ * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
+ *
+ * @param action action that launches DocumentsUI.
+ * @param hasInitialUri is DocumentsUI launched with
+ * {@link DocumentsContract#EXTRA_INITIAL_URI}.
+ * @param mimeType the requested mime type.
+ * @param rootUri the resolved rootUri, or {@code null} if the provider doesn't
+ * support {@link DocumentsProvider#findDocumentPath(String, String)}
+ */
+ public static void logActivityLaunch(
+ int action, boolean hasInitialUri, int mimeType, int rootUri) {
+ StatsLog.write(StatsLog.DOCS_UI_LAUNCH_REPORTED, action, hasInitialUri, mimeType, rootUri);
+ }
+
+ /**
+ * Logs root visited event.
+ *
+ * @param scope whether it's in FILES or PICKER mode.
+ * @param root the root that user visited
+ */
+ public static void logRootVisited(int scope, int root) {
+ StatsLog.write(StatsLog.DOCS_UI_ROOT_VISITED, scope, root);
+ }
+
+ /**
+ * Logs file operation stats. Call this when a file operation has completed.
+ *
+ * @param provider whether it's system or external provider
+ * @param fileOp the file operation
+ */
+ public static void logFileOperation(int provider, int fileOp) {
+ StatsLog.write(StatsLog.DOCS_UI_PROVIDER_FILE_OP, provider, fileOp);
+ }
+
+ /**
+ * Logs file operation stats. Call this when a copy/move operation has completed with a specific
+ * mode.
+ *
+ * @param fileOp copy or move file operation
+ * @param mode the mode for copy and move operation
+ */
+ public static void logFileOperationCopyMoveMode(int fileOp, int mode) {
+ StatsLog.write(StatsLog.DOCS_UI_FILE_OP_COPY_MOVE_MODE_REPORTED, fileOp, mode);
+ }
+
+ /**
+ * Logs file sub operation stats. Call this when a file operation has failed.
+ *
+ * @param authority the authority of the source document
+ * @param subOp the sub-file operation
+ */
+ public static void logFileOperationFailure(int authority, int subOp) {
+ StatsLog.write(StatsLog.DOCS_UI_FILE_OP_FAILURE, authority, subOp);
+ }
+
+ /**
+ * Logs the cancellation of a file operation. Call this when a job is canceled
+ *
+ * @param fileOp the file operation.
+ */
+ public static void logFileOperationCanceled(int fileOp) {
+ StatsLog.write(StatsLog.DOCS_UI_FILE_OP_CANCELED, fileOp);
+ }
+
+ /**
+ * Logs startup time in milliseconds.
+ *
+ * @param startupMs
+ */
+ public static void logStartupMs(int startupMs) {
+ StatsLog.write(StatsLog.DOCS_UI_STARTUP_MS, startupMs);
+ }
+
+ /**
+ * Logs the action that was started by user.
+ *
+ * @param userAction
+ */
+ public static void logUserAction(int userAction) {
+ StatsLog.write(StatsLog.DOCS_UI_USER_ACTION_REPORTED, userAction);
+ }
+
+ /**
+ * Logs the invalid type when invalid scoped access is requested.
+ *
+ * @param type the type of invalid scoped access request.
+ */
+ public static void logInvalidScopedAccessRequest(int type) {
+ StatsLog.write(StatsLog.DOCS_UI_INVALID_SCOPED_ACCESS_REQUEST, type);
+ }
+
+ /**
+ * Logs the package name that launches docsui picker mode.
+ *
+ * @param packageName
+ */
+ public static void logPickerLaunchedFrom(String packageName) {
+ StatsLog.write(StatsLog.DOCS_UI_PICKER_LAUNCHED_FROM_REPORTED, packageName);
+ }
+
+ /**
+ * Logs the search type.
+ *
+ * @param searchType
+ */
+ public static void logSearchType(int searchType) {
+ StatsLog.write(StatsLog.DOCS_UI_SEARCH_TYPE_REPORTED, searchType);
+ }
+
+ /**
+ * Logs the search mode.
+ *
+ * @param searchMode
+ */
+ public static void logSearchMode(int searchMode) {
+ StatsLog.write(StatsLog.DOCS_UI_SEARCH_MODE_REPORTED, searchMode);
+ }
+
+ /**
+ * Logs the pick result information.
+ *
+ * @param actionCount total user action count during pick process.
+ * @param duration total time spent on pick process.
+ * @param fileCount number of picked files.
+ * @param isSearching are the picked files found by search.
+ * @param root the root where the picked files located.
+ * @param mimeType the mime type of the picked file. Only for single-select case.
+ * @param repeatedlyPickTimes number of times that the file has been picked before. Only for
+ * single-select case.
+ */
+ public static void logFilePick(int actionCount, long duration, int fileCount,
+ boolean isSearching, int root, int mimeType, int repeatedlyPickTimes) {
+ StatsLog.write(StatsLog.DOCS_UI_PICK_RESULT_REPORTED, actionCount, duration, fileCount,
+ isSearching, root, mimeType, repeatedlyPickTimes);
+ }
+}
diff --git a/core/java/android/view/InsetsAnimationControlImpl.java b/core/java/android/view/InsetsAnimationControlImpl.java
index ce71b07..7c1465b 100644
--- a/core/java/android/view/InsetsAnimationControlImpl.java
+++ b/core/java/android/view/InsetsAnimationControlImpl.java
@@ -161,8 +161,9 @@
private Insets getInsetsFromState(InsetsState state, Rect frame,
@Nullable @InsetSide SparseIntArray typeSideMap) {
return state.calculateInsets(frame, false /* isScreenRound */,
- false /* alwaysConsumerNavBar */, null /* displayCutout */, typeSideMap)
- .getInsets(mTypes);
+ false /* alwaysConsumerNavBar */, null /* displayCutout */,
+ null /* legacyContentInsets */, null /* legacyStableInsets */, typeSideMap)
+ .getInsets(mTypes);
}
private Insets sanitize(Insets insets) {
diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java
index c2ade76..4b1d1ec 100644
--- a/core/java/android/view/InsetsController.java
+++ b/core/java/android/view/InsetsController.java
@@ -56,6 +56,9 @@
private final Runnable mAnimCallback;
+ private final Rect mLastLegacyContentInsets = new Rect();
+ private final Rect mLastLegacyStableInsets = new Rect();
+
public InsetsController(ViewRootImpl viewRoot) {
mViewRoot = viewRoot;
mAnimCallback = () -> {
@@ -70,6 +73,7 @@
}
WindowInsets insets = state.calculateInsets(mFrame, mLastInsets.isRound(),
mLastInsets.shouldAlwaysConsumeNavBar(), mLastInsets.getDisplayCutout(),
+ mLastLegacyContentInsets, mLastLegacyStableInsets,
null /* typeSideMap */);
mViewRoot.mView.dispatchWindowInsetsAnimationProgress(insets);
};
@@ -102,8 +106,12 @@
*/
@VisibleForTesting
public WindowInsets calculateInsets(boolean isScreenRound,
- boolean alwaysConsumeNavBar, DisplayCutout cutout) {
+ boolean alwaysConsumeNavBar, DisplayCutout cutout, Rect legacyContentInsets,
+ Rect legacyStableInsets) {
+ mLastLegacyContentInsets.set(legacyContentInsets);
+ mLastLegacyStableInsets.set(legacyStableInsets);
mLastInsets = mState.calculateInsets(mFrame, isScreenRound, alwaysConsumeNavBar, cutout,
+ legacyContentInsets, legacyStableInsets,
null /* typeSideMap */);
return mLastInsets;
}
diff --git a/core/java/android/view/InsetsState.java b/core/java/android/view/InsetsState.java
index cf8c0707..529776e 100644
--- a/core/java/android/view/InsetsState.java
+++ b/core/java/android/view/InsetsState.java
@@ -16,6 +16,7 @@
package android.view;
+import static android.view.ViewRootImpl.NEW_INSETS_MODE_IME;
import static android.view.WindowInsets.Type.indexOf;
import android.annotation.IntDef;
@@ -119,11 +120,17 @@
*/
public WindowInsets calculateInsets(Rect frame, boolean isScreenRound,
boolean alwaysConsumeNavBar, DisplayCutout cutout,
+ @Nullable Rect legacyContentInsets, @Nullable Rect legacyStableInsets,
@Nullable @InsetSide SparseIntArray typeSideMap) {
Insets[] typeInsetsMap = new Insets[Type.SIZE];
Insets[] typeMaxInsetsMap = new Insets[Type.SIZE];
final Rect relativeFrame = new Rect(frame);
final Rect relativeFrameMax = new Rect(frame);
+ if (ViewRootImpl.sNewInsetsMode == NEW_INSETS_MODE_IME
+ && legacyContentInsets != null && legacyStableInsets != null) {
+ WindowInsets.assignCompatInsets(typeInsetsMap, legacyContentInsets);
+ WindowInsets.assignCompatInsets(typeMaxInsetsMap, legacyStableInsets);
+ }
for (int type = FIRST_TYPE; type <= LAST_TYPE; type++) {
InsetsSource source = mSources.get(type);
if (source == null) {
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index a1aa06e..2131e6d 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -16,6 +16,7 @@
package android.view;
+import static android.view.ViewRootImpl.NEW_INSETS_MODE_FULL;
import static android.view.accessibility.AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED;
import static java.lang.Math.max;
@@ -5123,7 +5124,7 @@
sAcceptZeroSizeDragShadow = targetSdkVersion < Build.VERSION_CODES.P;
- sBrokenInsetsDispatch = !ViewRootImpl.USE_NEW_INSETS
+ sBrokenInsetsDispatch = ViewRootImpl.sNewInsetsMode != NEW_INSETS_MODE_FULL
|| targetSdkVersion < Build.VERSION_CODES.Q;
sCompatibilityDone = true;
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 27d4ea4..a031b70 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -163,13 +163,16 @@
private static final boolean MT_RENDERER_AVAILABLE = true;
/**
- * If set to true, the view system will switch from using rectangles retrieved from window to
+ * If set to 2, the view system will switch from using rectangles retrieved from window to
* dispatch to the view hierarchy to using {@link InsetsController}, that derives the insets
* directly from the full configuration, enabling richer information about the insets state, as
* well as new APIs to control it frame-by-frame, and synchronize animations with it.
* <p>
- * Only switch this to true once the new insets system is productionized and the old APIs are
+ * Only set this to 2 once the new insets system is productionized and the old APIs are
* fully migrated over.
+ * <p>
+ * If set to 1, this will switch to a mode where we only use the new approach for IME, but not
+ * for the status/navigation bar.
*/
private static final String USE_NEW_INSETS_PROPERTY = "persist.wm.new_insets";
@@ -177,8 +180,26 @@
* @see #USE_NEW_INSETS_PROPERTY
* @hide
*/
- public static final boolean USE_NEW_INSETS =
- SystemProperties.getBoolean(USE_NEW_INSETS_PROPERTY, false);
+ public static final int sNewInsetsMode =
+ SystemProperties.getInt(USE_NEW_INSETS_PROPERTY, 0);
+
+ /**
+ * @see #USE_NEW_INSETS_PROPERTY
+ * @hide
+ */
+ public static final int NEW_INSETS_MODE_NONE = 0;
+
+ /**
+ * @see #USE_NEW_INSETS_PROPERTY
+ * @hide
+ */
+ public static final int NEW_INSETS_MODE_IME = 1;
+
+ /**
+ * @see #USE_NEW_INSETS_PROPERTY
+ * @hide
+ */
+ public static final int NEW_INSETS_MODE_FULL = 2;
/**
* Set this system property to true to force the view hierarchy to render
@@ -1367,7 +1388,7 @@
}
void notifyInsetsChanged() {
- if (!USE_NEW_INSETS) {
+ if (sNewInsetsMode == NEW_INSETS_MODE_NONE) {
return;
}
mApplyInsetsRequested = true;
@@ -1855,10 +1876,11 @@
}
contentInsets = ensureInsetsNonNegative(contentInsets, "content");
stableInsets = ensureInsetsNonNegative(stableInsets, "stable");
- if (USE_NEW_INSETS) {
+ if (sNewInsetsMode != NEW_INSETS_MODE_NONE) {
mLastWindowInsets = mInsetsController.calculateInsets(
mContext.getResources().getConfiguration().isScreenRound(),
- mAttachInfo.mAlwaysConsumeNavBar, displayCutout);
+ mAttachInfo.mAlwaysConsumeNavBar, displayCutout,
+ contentInsets, stableInsets);
} else {
mLastWindowInsets = new WindowInsets(contentInsets, stableInsets,
mContext.getResources().getConfiguration().isScreenRound(),
diff --git a/core/java/android/view/WindowInsets.java b/core/java/android/view/WindowInsets.java
index 9ac0ca9..e808830 100644
--- a/core/java/android/view/WindowInsets.java
+++ b/core/java/android/view/WindowInsets.java
@@ -217,7 +217,10 @@
return typeInsetMap;
}
- private static void assignCompatInsets(Insets[] typeInsetMap, Rect insets) {
+ /**
+ * @hide
+ */
+ static void assignCompatInsets(Insets[] typeInsetMap, Rect insets) {
typeInsetMap[indexOf(TOP_BAR)] = Insets.of(0, insets.top, 0, 0);
typeInsetMap[indexOf(SIDE_BARS)] = Insets.of(insets.left, 0, insets.right, insets.bottom);
}
diff --git a/core/java/android/view/inputmethod/EditorInfo.java b/core/java/android/view/inputmethod/EditorInfo.java
index f99afe6..8e7b0db 100644
--- a/core/java/android/view/inputmethod/EditorInfo.java
+++ b/core/java/android/view/inputmethod/EditorInfo.java
@@ -479,13 +479,9 @@
* If not {@code null}, this editor needs to talk to IMEs that run for the specified user, no
* matter what user ID the calling process has.
*
- * <p>Note: This field is silently ignored when:</p>
- * <ul>
- * <li>{@link android.view.inputmethod.InputMethodSystemProperty#PER_PROFILE_IME_ENABLED} is
- * {@code false}.</li>
- * <li>{@link android.view.inputmethod.InputMethodSystemProperty#MULTI_CLIENT_IME_ENABLED}
- * is {@code true}.</li>
- * </ul>
+ * <p>Note: This field will be silently ignored when
+ * {@link android.view.inputmethod.InputMethodSystemProperty#MULTI_CLIENT_IME_ENABLED} is
+ * {@code true}.</p>
*
* <p>Note also that pseudo handles such as {@link UserHandle#ALL} are not supported.</p>
*
diff --git a/core/java/android/webkit/WebViewRenderer.java b/core/java/android/webkit/WebViewRenderer.java
index 5328254..fc38cd9 100644
--- a/core/java/android/webkit/WebViewRenderer.java
+++ b/core/java/android/webkit/WebViewRenderer.java
@@ -16,6 +16,8 @@
package android.webkit;
+import android.annotation.SystemApi;
+
/**
* WebViewRenderer provides an opaque handle to a {@link WebView} renderer.
*/
@@ -40,6 +42,7 @@
* This class cannot be created by applications.
* @hide
*/
+ @SystemApi
public WebViewRenderer() {
}
}
diff --git a/core/java/com/android/internal/logging/MetricsLogger.java b/core/java/com/android/internal/logging/MetricsLogger.java
index c4aa1d7..a691a24 100644
--- a/core/java/com/android/internal/logging/MetricsLogger.java
+++ b/core/java/com/android/internal/logging/MetricsLogger.java
@@ -25,7 +25,13 @@
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
/**
- * Log all the things.
+ * Writes sysui_multi_event records to the system event log.
+ *
+ * Prefer the methods write(LogMaker), or count() or histogram(). Replace legacy methods with
+ * their current equivalents when the opportunity arises.
+ *
+ * This class is a lightweight dependency barrier - it is cheap and easy to construct.
+ * Logging is also cheap, so it is not normally necessary to move logging off of the UI thread.
*
* @hide
*/
@@ -52,6 +58,7 @@
public static final int VIEW_UNKNOWN = MetricsEvent.VIEW_UNKNOWN;
public static final int LOGTAG = EventLogTags.SYSUI_MULTI_ACTION;
+ /** Write an event log record, consisting of content.serialize(). */
@UnsupportedAppUsage
public void write(LogMaker content) {
if (content.getType() == MetricsEvent.TYPE_UNKNOWN) {
@@ -60,128 +67,145 @@
saveLog(content);
}
+ /** Add an integer value to the monotonically increasing counter with the given name. */
+ public void count(String name, int value) {
+ saveLog(new LogMaker(MetricsEvent.RESERVED_FOR_LOGBUILDER_COUNTER)
+ .setCounterName(name)
+ .setCounterValue(value));
+ }
+
+ /** Increment the bucket with the integer label on the histogram with the given name. */
+ public void histogram(String name, int bucket) {
+ // see LogHistogram in system/core/libmetricslogger/metrics_logger.cpp
+ saveLog(new LogMaker(MetricsEvent.RESERVED_FOR_LOGBUILDER_HISTOGRAM)
+ .setCounterName(name)
+ .setCounterBucket(bucket)
+ .setCounterValue(1));
+ }
+
+ /* Legacy logging methods follow. These are all simple shorthands and can be replaced
+ * with an equivalent write(). */
+
+ /** Logs an OPEN event on the category.
+ * Equivalent to write(new LogMaker(category).setType(MetricsEvent.TYPE_OPEN)) */
public void visible(int category) throws IllegalArgumentException {
if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {
throw new IllegalArgumentException("Must define metric category");
}
- EventLogTags.writeSysuiViewVisibility(category, 100);
saveLog(new LogMaker(category).setType(MetricsEvent.TYPE_OPEN));
}
+ /** Logs a CLOSE event on the category.
+ * Equivalent to write(new LogMaker(category).setType(MetricsEvent.TYPE_CLOSE)) */
public void hidden(int category) throws IllegalArgumentException {
if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {
throw new IllegalArgumentException("Must define metric category");
}
- EventLogTags.writeSysuiViewVisibility(category, 0);
saveLog(new LogMaker(category).setType(MetricsEvent.TYPE_CLOSE));
}
- public void visibility(int category, boolean visibile)
+ /** Logs an OPEN or CLOSE event on the category, depending on visible.
+ * Equivalent to write(new LogMaker(category)
+ * .setType(visible ? MetricsEvent.TYPE_OPEN : MetricsEvent.TYPE_CLOSE)) */
+ public void visibility(int category, boolean visible)
throws IllegalArgumentException {
- if (visibile) {
+ if (visible) {
visible(category);
} else {
hidden(category);
}
}
+ /** Logs an OPEN or CLOSE event on the category, depending on vis.
+ * Equivalent to write(new LogMaker(category)
+ .setType(vis == View.VISIBLE ?
+ MetricsEvent.TYPE_OPEN : MetricsEvent.TYPE_CLOSE)) */
public void visibility(int category, int vis)
throws IllegalArgumentException {
visibility(category, vis == View.VISIBLE);
}
+ /** Logs an ACTION event on the category.
+ * Equivalent to write(new LogMaker(category).setType(MetricsEvent.TYPE_ACTION)) */
public void action(int category) {
- EventLogTags.writeSysuiAction(category, "");
saveLog(new LogMaker(category).setType(MetricsEvent.TYPE_ACTION));
}
+ /** Logs an ACTION event on the category.
+ * Equivalent to write(new LogMaker(category).setType(MetricsEvent.TYPE_ACTION)
+ .setSubtype(value) */
public void action(int category, int value) {
- EventLogTags.writeSysuiAction(category, Integer.toString(value));
saveLog(new LogMaker(category).setType(MetricsEvent.TYPE_ACTION).setSubtype(value));
}
+ /** Logs an ACTION event on the category.
+ * Equivalent to write(new LogMaker(category).setType(MetricsEvent.TYPE_ACTION)
+ .setSubtype(value ? 1 : 0) */
public void action(int category, boolean value) {
- EventLogTags.writeSysuiAction(category, Boolean.toString(value));
saveLog(new LogMaker(category).setType(MetricsEvent.TYPE_ACTION).setSubtype(value ? 1 : 0));
}
+ /** Logs an ACTION event on the category.
+ * Equivalent to write(new LogMaker(category).setType(MetricsEvent.TYPE_ACTION)
+ .setPackageName(value ? 1 : 0) */
public void action(int category, String pkg) {
if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) {
throw new IllegalArgumentException("Must define metric category");
}
- EventLogTags.writeSysuiAction(category, pkg);
saveLog(new LogMaker(category).setType(MetricsEvent.TYPE_ACTION).setPackageName(pkg));
}
- /** Add an integer value to the monotonically increasing counter with the given name. */
- public void count(String name, int value) {
- EventLogTags.writeSysuiCount(name, value);
- saveLog(new LogMaker(MetricsEvent.RESERVED_FOR_LOGBUILDER_COUNTER)
- .setCounterName(name)
- .setCounterValue(value));
- }
-
- /** Increment the bucket with the integer label on the histogram with the given name. */
- public void histogram(String name, int bucket) {
- // see LogHistogram in system/core/libmetricslogger/metrics_logger.cpp
- EventLogTags.writeSysuiHistogram(name, bucket);
- saveLog(new LogMaker(MetricsEvent.RESERVED_FOR_LOGBUILDER_HISTOGRAM)
- .setCounterName(name)
- .setCounterBucket(bucket)
- .setCounterValue(1));
- }
-
- /** @deprecated use {@link #visible(int)} */
+ /** @deprecated because untestable; use {@link #visible(int)} */
@Deprecated
public static void visible(Context context, int category) throws IllegalArgumentException {
getLogger().visible(category);
}
- /** @deprecated use {@link #hidden(int)} */
+ /** @deprecated because untestable; use {@link #hidden(int)} */
@Deprecated
public static void hidden(Context context, int category) throws IllegalArgumentException {
getLogger().hidden(category);
}
- /** @deprecated use {@link #visibility(int, boolean)} */
+ /** @deprecated because untestable; use {@link #visibility(int, boolean)} */
@Deprecated
public static void visibility(Context context, int category, boolean visibile)
throws IllegalArgumentException {
getLogger().visibility(category, visibile);
}
- /** @deprecated use {@link #visibility(int, int)} */
+ /** @deprecated because untestable; use {@link #visibility(int, int)} */
@Deprecated
public static void visibility(Context context, int category, int vis)
throws IllegalArgumentException {
visibility(context, category, vis == View.VISIBLE);
}
- /** @deprecated use {@link #action(int)} */
+ /** @deprecated because untestable; use {@link #action(int)} */
@Deprecated
public static void action(Context context, int category) {
getLogger().action(category);
}
- /** @deprecated use {@link #action(int, int)} */
+ /** @deprecated because untestable; use {@link #action(int, int)} */
@Deprecated
public static void action(Context context, int category, int value) {
getLogger().action(category, value);
}
- /** @deprecated use {@link #action(int, boolean)} */
+ /** @deprecated because untestable; use {@link #action(int, boolean)} */
@Deprecated
public static void action(Context context, int category, boolean value) {
getLogger().action(category, value);
}
- /** @deprecated use {@link #write(LogMaker)} */
+ /** @deprecated because untestable; use {@link #write(LogMaker)} */
@Deprecated
public static void action(LogMaker content) {
getLogger().write(content);
}
- /** @deprecated use {@link #action(int, String)} */
+ /** @deprecated because untestable; use {@link #action(int, String)} */
@Deprecated
public static void action(Context context, int category, String pkg) {
getLogger().action(category, pkg);
@@ -189,7 +213,7 @@
/**
* Add an integer value to the monotonically increasing counter with the given name.
- * @deprecated use {@link #count(String, int)}
+ * @deprecated because untestable; use {@link #count(String, int)}
*/
@Deprecated
public static void count(Context context, String name, int value) {
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 17cc6af..534361e 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -87,6 +87,10 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.location.gnssmetrics.GnssMetrics;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidActiveTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidClusterTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidFreqTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidUserSysTimeReader;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.FastXmlSerializer;
@@ -187,18 +191,19 @@
private final KernelWakelockStats mTmpWakelockStats = new KernelWakelockStats();
@VisibleForTesting
- protected KernelUidCpuTimeReader mKernelUidCpuTimeReader = new KernelUidCpuTimeReader();
+ protected KernelCpuUidUserSysTimeReader mCpuUidUserSysTimeReader =
+ new KernelCpuUidUserSysTimeReader(true);
@VisibleForTesting
protected KernelCpuSpeedReader[] mKernelCpuSpeedReaders;
@VisibleForTesting
- protected KernelUidCpuFreqTimeReader mKernelUidCpuFreqTimeReader =
- new KernelUidCpuFreqTimeReader();
+ protected KernelCpuUidFreqTimeReader mCpuUidFreqTimeReader =
+ new KernelCpuUidFreqTimeReader(true);
@VisibleForTesting
- protected KernelUidCpuActiveTimeReader mKernelUidCpuActiveTimeReader =
- new KernelUidCpuActiveTimeReader();
+ protected KernelCpuUidActiveTimeReader mCpuUidActiveTimeReader =
+ new KernelCpuUidActiveTimeReader(true);
@VisibleForTesting
- protected KernelUidCpuClusterTimeReader mKernelUidCpuClusterTimeReader =
- new KernelUidCpuClusterTimeReader();
+ protected KernelCpuUidClusterTimeReader mCpuUidClusterTimeReader =
+ new KernelCpuUidClusterTimeReader(true);
@VisibleForTesting
protected KernelSingleUidTimeReader mKernelSingleUidTimeReader;
@@ -248,9 +253,9 @@
/** Last time that RPM stats were updated by updateRpmStatsLocked. */
private long mLastRpmStatsUpdateTimeMs = -RPM_STATS_UPDATE_FREQ_MS;
/**
- * Use a queue to delay removing UIDs from {@link KernelUidCpuTimeReader},
- * {@link KernelUidCpuActiveTimeReader}, {@link KernelUidCpuClusterTimeReader},
- * {@link KernelUidCpuFreqTimeReader} and from the Kernel.
+ * Use a queue to delay removing UIDs from {@link KernelCpuUidUserSysTimeReader},
+ * {@link KernelCpuUidActiveTimeReader}, {@link KernelCpuUidClusterTimeReader},
+ * {@link KernelCpuUidFreqTimeReader} and from the Kernel.
*
* Isolated and invalid UID info must be removed to conserve memory. However, STATSD and
* Batterystats both need to access UID cpu time. To resolve this race condition, only
@@ -281,22 +286,22 @@
void remove() {
if (startUid == endUid) {
- mKernelUidCpuTimeReader.removeUid(startUid);
- mKernelUidCpuFreqTimeReader.removeUid(startUid);
+ mCpuUidUserSysTimeReader.removeUid(startUid);
+ mCpuUidFreqTimeReader.removeUid(startUid);
if (mConstants.TRACK_CPU_ACTIVE_CLUSTER_TIME) {
- mKernelUidCpuActiveTimeReader.removeUid(startUid);
- mKernelUidCpuClusterTimeReader.removeUid(startUid);
+ mCpuUidActiveTimeReader.removeUid(startUid);
+ mCpuUidClusterTimeReader.removeUid(startUid);
}
if (mKernelSingleUidTimeReader != null) {
mKernelSingleUidTimeReader.removeUid(startUid);
}
mNumUidsRemoved++;
} else if (startUid < endUid) {
- mKernelUidCpuFreqTimeReader.removeUidsInRange(startUid, endUid);
- mKernelUidCpuTimeReader.removeUidsInRange(startUid, endUid);
+ mCpuUidFreqTimeReader.removeUidsInRange(startUid, endUid);
+ mCpuUidUserSysTimeReader.removeUidsInRange(startUid, endUid);
if (mConstants.TRACK_CPU_ACTIVE_CLUSTER_TIME) {
- mKernelUidCpuActiveTimeReader.removeUidsInRange(startUid, endUid);
- mKernelUidCpuClusterTimeReader.removeUidsInRange(startUid, endUid);
+ mCpuUidActiveTimeReader.removeUidsInRange(startUid, endUid);
+ mCpuUidClusterTimeReader.removeUidsInRange(startUid, endUid);
}
if (mKernelSingleUidTimeReader != null) {
mKernelSingleUidTimeReader.removeUidsInRange(startUid, endUid);
@@ -496,7 +501,7 @@
}
final SparseArray<long[]> allUidCpuFreqTimesMs =
- mKernelUidCpuFreqTimeReader.getAllUidCpuFreqTimeMs();
+ mCpuUidFreqTimeReader.getAllUidCpuFreqTimeMs();
// If the KernelSingleUidTimeReader has stale cpu times, then we shouldn't try to
// compute deltas since it might result in mis-attributing cpu times to wrong states.
if (mIsPerProcessStateCpuDataStale) {
@@ -553,16 +558,16 @@
return false;
}
if (mCpuFreqs == null) {
- mCpuFreqs = mKernelUidCpuFreqTimeReader.readFreqs(mPowerProfile);
+ mCpuFreqs = mCpuUidFreqTimeReader.readFreqs(mPowerProfile);
}
if (mCpuFreqs != null) {
mKernelSingleUidTimeReader = new KernelSingleUidTimeReader(mCpuFreqs.length);
} else {
- mPerProcStateCpuTimesAvailable = mKernelUidCpuFreqTimeReader.allUidTimesAvailable();
+ mPerProcStateCpuTimesAvailable = mCpuUidFreqTimeReader.allUidTimesAvailable();
return false;
}
}
- mPerProcStateCpuTimesAvailable = mKernelUidCpuFreqTimeReader.allUidTimesAvailable()
+ mPerProcStateCpuTimesAvailable = mCpuUidFreqTimeReader.allUidTimesAvailable()
&& mKernelSingleUidTimeReader.singleUidCpuTimesAvailable();
return true;
}
@@ -11926,7 +11931,7 @@
}
if (mCpuFreqs == null) {
- mCpuFreqs = mKernelUidCpuFreqTimeReader.readFreqs(mPowerProfile);
+ mCpuFreqs = mCpuUidFreqTimeReader.readFreqs(mPowerProfile);
}
// Calculate the wakelocks we have to distribute amongst. The system is excluded as it is
@@ -11952,12 +11957,12 @@
// When the battery is not on, we don't attribute the cpu times to any timers but we still
// need to take the snapshots.
if (!onBattery) {
- mKernelUidCpuTimeReader.readDelta(null);
- mKernelUidCpuFreqTimeReader.readDelta(null);
+ mCpuUidUserSysTimeReader.readDelta(null);
+ mCpuUidFreqTimeReader.readDelta(null);
mNumAllUidCpuTimeReads += 2;
if (mConstants.TRACK_CPU_ACTIVE_CLUSTER_TIME) {
- mKernelUidCpuActiveTimeReader.readDelta(null);
- mKernelUidCpuClusterTimeReader.readDelta(null);
+ mCpuUidActiveTimeReader.readDelta(null);
+ mCpuUidClusterTimeReader.readDelta(null);
mNumAllUidCpuTimeReads += 2;
}
for (int cluster = mKernelCpuSpeedReaders.length - 1; cluster >= 0; --cluster) {
@@ -11967,7 +11972,7 @@
}
mUserInfoProvider.refreshUserIds();
- final SparseLongArray updatedUids = mKernelUidCpuFreqTimeReader.perClusterTimesAvailable()
+ final SparseLongArray updatedUids = mCpuUidFreqTimeReader.perClusterTimesAvailable()
? null : new SparseLongArray();
readKernelUidCpuTimesLocked(partialTimersToConsider, updatedUids, onBattery);
// updatedUids=null means /proc/uid_time_in_state provides snapshots of per-cluster cpu
@@ -12084,18 +12089,20 @@
final int numWakelocks = partialTimers == null ? 0 : partialTimers.size();
final long startTimeMs = mClocks.uptimeMillis();
- mKernelUidCpuTimeReader.readDelta((uid, userTimeUs, systemTimeUs) -> {
+ mCpuUidUserSysTimeReader.readDelta((uid, timesUs) -> {
+ long userTimeUs = timesUs[0], systemTimeUs = timesUs[1];
+
uid = mapUid(uid);
if (Process.isIsolated(uid)) {
// This could happen if the isolated uid mapping was removed before that process
// was actually killed.
- mKernelUidCpuTimeReader.removeUid(uid);
+ mCpuUidUserSysTimeReader.removeUid(uid);
Slog.d(TAG, "Got readings for an isolated uid with no mapping: " + uid);
return;
}
if (!mUserInfoProvider.exists(UserHandle.getUserId(uid))) {
Slog.d(TAG, "Got readings for an invalid user's uid " + uid);
- mKernelUidCpuTimeReader.removeUid(uid);
+ mCpuUidUserSysTimeReader.removeUid(uid);
return;
}
final Uid u = getUidStatsLocked(uid);
@@ -12189,21 +12196,21 @@
public void readKernelUidCpuFreqTimesLocked(@Nullable ArrayList<StopwatchTimer> partialTimers,
boolean onBattery, boolean onBatteryScreenOff) {
final boolean perClusterTimesAvailable =
- mKernelUidCpuFreqTimeReader.perClusterTimesAvailable();
+ mCpuUidFreqTimeReader.perClusterTimesAvailable();
final int numWakelocks = partialTimers == null ? 0 : partialTimers.size();
final int numClusters = mPowerProfile.getNumCpuClusters();
mWakeLockAllocationsUs = null;
final long startTimeMs = mClocks.uptimeMillis();
- mKernelUidCpuFreqTimeReader.readDelta((uid, cpuFreqTimeMs) -> {
+ mCpuUidFreqTimeReader.readDelta((uid, cpuFreqTimeMs) -> {
uid = mapUid(uid);
if (Process.isIsolated(uid)) {
- mKernelUidCpuFreqTimeReader.removeUid(uid);
+ mCpuUidFreqTimeReader.removeUid(uid);
Slog.d(TAG, "Got freq readings for an isolated uid with no mapping: " + uid);
return;
}
if (!mUserInfoProvider.exists(UserHandle.getUserId(uid))) {
Slog.d(TAG, "Got freq readings for an invalid user's uid " + uid);
- mKernelUidCpuFreqTimeReader.removeUid(uid);
+ mCpuUidFreqTimeReader.removeUid(uid);
return;
}
final Uid u = getUidStatsLocked(uid);
@@ -12307,16 +12314,16 @@
@VisibleForTesting
public void readKernelUidCpuActiveTimesLocked(boolean onBattery) {
final long startTimeMs = mClocks.uptimeMillis();
- mKernelUidCpuActiveTimeReader.readDelta((uid, cpuActiveTimesMs) -> {
+ mCpuUidActiveTimeReader.readDelta((uid, cpuActiveTimesMs) -> {
uid = mapUid(uid);
if (Process.isIsolated(uid)) {
- mKernelUidCpuActiveTimeReader.removeUid(uid);
+ mCpuUidActiveTimeReader.removeUid(uid);
Slog.w(TAG, "Got active times for an isolated uid with no mapping: " + uid);
return;
}
if (!mUserInfoProvider.exists(UserHandle.getUserId(uid))) {
Slog.w(TAG, "Got active times for an invalid user's uid " + uid);
- mKernelUidCpuActiveTimeReader.removeUid(uid);
+ mCpuUidActiveTimeReader.removeUid(uid);
return;
}
final Uid u = getUidStatsLocked(uid);
@@ -12336,16 +12343,16 @@
@VisibleForTesting
public void readKernelUidCpuClusterTimesLocked(boolean onBattery) {
final long startTimeMs = mClocks.uptimeMillis();
- mKernelUidCpuClusterTimeReader.readDelta((uid, cpuClusterTimesMs) -> {
+ mCpuUidClusterTimeReader.readDelta((uid, cpuClusterTimesMs) -> {
uid = mapUid(uid);
if (Process.isIsolated(uid)) {
- mKernelUidCpuClusterTimeReader.removeUid(uid);
+ mCpuUidClusterTimeReader.removeUid(uid);
Slog.w(TAG, "Got cluster times for an isolated uid with no mapping: " + uid);
return;
}
if (!mUserInfoProvider.exists(UserHandle.getUserId(uid))) {
Slog.w(TAG, "Got cluster times for an invalid user's uid " + uid);
- mKernelUidCpuClusterTimeReader.removeUid(uid);
+ mCpuUidClusterTimeReader.removeUid(uid);
return;
}
final Uid u = getUidStatsLocked(uid);
@@ -13344,7 +13351,7 @@
private static final boolean DEFAULT_TRACK_CPU_TIMES_BY_PROC_STATE = false;
private static final boolean DEFAULT_TRACK_CPU_ACTIVE_CLUSTER_TIME = true;
private static final long DEFAULT_PROC_STATE_CPU_TIMES_READ_DELAY_MS = 5_000;
- private static final long DEFAULT_KERNEL_UID_READERS_THROTTLE_TIME = 10_000;
+ private static final long DEFAULT_KERNEL_UID_READERS_THROTTLE_TIME = 1_000;
private static final long DEFAULT_UID_REMOVE_DELAY_MS = 5L * 60L * 1000L;
private static final long DEFAULT_EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS = 600_000;
private static final long DEFAULT_BATTERY_LEVEL_COLLECTION_DELAY_MS = 300_000;
@@ -13357,7 +13364,9 @@
public boolean TRACK_CPU_TIMES_BY_PROC_STATE = DEFAULT_TRACK_CPU_TIMES_BY_PROC_STATE;
public boolean TRACK_CPU_ACTIVE_CLUSTER_TIME = DEFAULT_TRACK_CPU_ACTIVE_CLUSTER_TIME;
public long PROC_STATE_CPU_TIMES_READ_DELAY_MS = DEFAULT_PROC_STATE_CPU_TIMES_READ_DELAY_MS;
- public long KERNEL_UID_READERS_THROTTLE_TIME = DEFAULT_KERNEL_UID_READERS_THROTTLE_TIME;
+ /* Do not set default value for KERNEL_UID_READERS_THROTTLE_TIME. Need to trigger an
+ * update when startObserving. */
+ public long KERNEL_UID_READERS_THROTTLE_TIME;
public long UID_REMOVE_DELAY_MS = DEFAULT_UID_REMOVE_DELAY_MS;
public long EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS
= DEFAULT_EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS;
@@ -13464,11 +13473,11 @@
private void updateKernelUidReadersThrottleTime(long oldTimeMs, long newTimeMs) {
KERNEL_UID_READERS_THROTTLE_TIME = newTimeMs;
if (oldTimeMs != newTimeMs) {
- mKernelUidCpuTimeReader.setThrottleInterval(KERNEL_UID_READERS_THROTTLE_TIME);
- mKernelUidCpuFreqTimeReader.setThrottleInterval(KERNEL_UID_READERS_THROTTLE_TIME);
- mKernelUidCpuActiveTimeReader.setThrottleInterval(KERNEL_UID_READERS_THROTTLE_TIME);
- mKernelUidCpuClusterTimeReader
- .setThrottleInterval(KERNEL_UID_READERS_THROTTLE_TIME);
+ mCpuUidUserSysTimeReader.setThrottle(KERNEL_UID_READERS_THROTTLE_TIME);
+ mCpuUidFreqTimeReader.setThrottle(KERNEL_UID_READERS_THROTTLE_TIME);
+ mCpuUidActiveTimeReader.setThrottle(KERNEL_UID_READERS_THROTTLE_TIME);
+ mCpuUidClusterTimeReader
+ .setThrottle(KERNEL_UID_READERS_THROTTLE_TIME);
}
}
diff --git a/core/java/com/android/internal/os/KernelCpuProcReader.java b/core/java/com/android/internal/os/KernelCpuProcReader.java
deleted file mode 100644
index c233ea8..0000000
--- a/core/java/com/android/internal/os/KernelCpuProcReader.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.os;
-
-import android.os.StrictMode;
-import android.os.SystemClock;
-import android.util.Slog;
-
-import com.android.internal.annotations.VisibleForTesting;
-
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.file.Files;
-import java.nio.file.NoSuchFileException;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Arrays;
-
-/**
- * Reads cpu time proc files with throttling (adjustable interval).
- *
- * KernelCpuProcReader is implemented as singletons for built-in kernel proc files. Get___Instance()
- * method will return corresponding reader instance. In order to prevent frequent GC,
- * KernelCpuProcReader reuses a {@link ByteBuffer} to store data read from proc files.
- *
- * A KernelCpuProcReader instance keeps an error counter. When the number of read errors within that
- * instance accumulates to 5, this instance will reject all further read requests.
- *
- * Each KernelCpuProcReader instance also has a throttler. Throttle interval can be adjusted via
- * {@link #setThrottleInterval(long)} method. Default throttle interval is 3000ms. If current
- * timestamp based on {@link SystemClock#elapsedRealtime()} is less than throttle interval from
- * the last read timestamp, {@link #readBytes()} will return previous result.
- *
- * A KernelCpuProcReader instance is thread-unsafe. Caller needs to hold a lock on this object while
- * accessing its instance methods or digesting the return values.
- */
-public class KernelCpuProcReader {
- private static final String TAG = "KernelCpuProcReader";
- private static final int ERROR_THRESHOLD = 5;
- // Throttle interval in milliseconds
- private static final long DEFAULT_THROTTLE_INTERVAL = 3000L;
- private static final int MAX_BUFFER_SIZE = 1024 * 1024;
- private static final String PROC_UID_FREQ_TIME = "/proc/uid_cpupower/time_in_state";
- private static final String PROC_UID_ACTIVE_TIME = "/proc/uid_cpupower/concurrent_active_time";
- private static final String PROC_UID_CLUSTER_TIME = "/proc/uid_cpupower/concurrent_policy_time";
-
- private static final KernelCpuProcReader mFreqTimeReader = new KernelCpuProcReader(
- PROC_UID_FREQ_TIME);
- private static final KernelCpuProcReader mActiveTimeReader = new KernelCpuProcReader(
- PROC_UID_ACTIVE_TIME);
- private static final KernelCpuProcReader mClusterTimeReader = new KernelCpuProcReader(
- PROC_UID_CLUSTER_TIME);
-
- public static KernelCpuProcReader getFreqTimeReaderInstance() {
- return mFreqTimeReader;
- }
-
- public static KernelCpuProcReader getActiveTimeReaderInstance() {
- return mActiveTimeReader;
- }
-
- public static KernelCpuProcReader getClusterTimeReaderInstance() {
- return mClusterTimeReader;
- }
-
- private int mErrors;
- private long mThrottleInterval = DEFAULT_THROTTLE_INTERVAL;
- private long mLastReadTime = Long.MIN_VALUE;
- private final Path mProc;
- private byte[] mBuffer = new byte[8 * 1024];
- private int mContentSize;
-
- @VisibleForTesting
- public KernelCpuProcReader(String procFile) {
- mProc = Paths.get(procFile);
- }
-
- /**
- * Reads all bytes from the corresponding proc file.
- *
- * If elapsed time since last call to this method is less than the throttle interval, it will
- * return previous result. When IOException accumulates to 5, it will always return null. This
- * method is thread-unsafe, so is the return value. Caller needs to hold a lock on this
- * object while calling this method and digesting its return value.
- *
- * @return a {@link ByteBuffer} containing all bytes from the proc file.
- */
- public ByteBuffer readBytes() {
- if (mErrors >= ERROR_THRESHOLD) {
- return null;
- }
- if (SystemClock.elapsedRealtime() < mLastReadTime + mThrottleInterval) {
- if (mContentSize > 0) {
- return ByteBuffer.wrap(mBuffer, 0, mContentSize).asReadOnlyBuffer()
- .order(ByteOrder.nativeOrder());
- }
- return null;
- }
- mLastReadTime = SystemClock.elapsedRealtime();
- mContentSize = 0;
- final int oldMask = StrictMode.allowThreadDiskReadsMask();
- try (InputStream in = Files.newInputStream(mProc)) {
- int numBytes = 0;
- int curr;
- while ((curr = in.read(mBuffer, numBytes, mBuffer.length - numBytes)) >= 0) {
- numBytes += curr;
- if (numBytes == mBuffer.length) {
- // Hit the limit. Resize mBuffer.
- if (mBuffer.length == MAX_BUFFER_SIZE) {
- mErrors++;
- Slog.e(TAG, "Proc file is too large: " + mProc);
- return null;
- }
- mBuffer = Arrays.copyOf(mBuffer,
- Math.min(mBuffer.length << 1, MAX_BUFFER_SIZE));
- }
- }
- mContentSize = numBytes;
- return ByteBuffer.wrap(mBuffer, 0, mContentSize).asReadOnlyBuffer()
- .order(ByteOrder.nativeOrder());
- } catch (NoSuchFileException | FileNotFoundException e) {
- // Happens when the kernel does not provide this file. Not a big issue. Just log it.
- mErrors++;
- Slog.w(TAG, "File not exist: " + mProc);
- } catch (IOException e) {
- mErrors++;
- Slog.e(TAG, "Error reading: " + mProc, e);
- } finally {
- StrictMode.setThreadPolicyMask(oldMask);
- }
- return null;
- }
-
- /**
- * Sets the throttle interval. Set to 0 will disable throttling. Thread-unsafe, holding a lock
- * on this object is recommended.
- *
- * @param throttleInterval throttle interval in milliseconds
- */
- public void setThrottleInterval(long throttleInterval) {
- if (throttleInterval >= 0) {
- mThrottleInterval = throttleInterval;
- }
- }
-}
diff --git a/core/java/com/android/internal/os/KernelCpuUidTimeReader.java b/core/java/com/android/internal/os/KernelCpuUidTimeReader.java
index 7021b57..e6d044f 100644
--- a/core/java/com/android/internal/os/KernelCpuUidTimeReader.java
+++ b/core/java/com/android/internal/os/KernelCpuUidTimeReader.java
@@ -177,6 +177,9 @@
* The file contains a monotonically increasing count of time for a single boot. This class
* maintains the previous results of a call to {@link #readDelta} in order to provide a proper
* delta.
+ *
+ * The second parameter of the callback is a long[] with 2 elements, [user time in us, system
+ * time in us].
*/
public static class KernelCpuUidUserSysTimeReader extends KernelCpuUidTimeReader<long[]> {
private static final String REMOVE_UID_PROC_FILE = "/proc/uid_cputime/remove_uid_range";
diff --git a/core/java/com/android/internal/os/KernelSingleUidTimeReader.java b/core/java/com/android/internal/os/KernelSingleUidTimeReader.java
index ad62852..3c43a11 100644
--- a/core/java/com/android/internal/os/KernelSingleUidTimeReader.java
+++ b/core/java/com/android/internal/os/KernelSingleUidTimeReader.java
@@ -16,7 +16,6 @@
package com.android.internal.os;
import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
-import static com.android.internal.os.KernelUidCpuFreqTimeReader.UID_TIMES_PROC_FILE;
import android.annotation.NonNull;
import android.util.Slog;
@@ -34,11 +33,12 @@
@VisibleForTesting(visibility = PACKAGE)
public class KernelSingleUidTimeReader {
- private final String TAG = KernelUidCpuFreqTimeReader.class.getName();
- private final boolean DBG = false;
+ private static final String TAG = KernelSingleUidTimeReader.class.getName();
+ private static final boolean DBG = false;
- private final String PROC_FILE_DIR = "/proc/uid/";
- private final String PROC_FILE_NAME = "/time_in_state";
+ private static final String PROC_FILE_DIR = "/proc/uid/";
+ private static final String PROC_FILE_NAME = "/time_in_state";
+ private static final String UID_TIMES_PROC_FILE = "/proc/uid_time_in_state";
@VisibleForTesting
public static final int TOTAL_READ_ERROR_COUNT = 5;
diff --git a/core/java/com/android/internal/os/KernelUidCpuActiveTimeReader.java b/core/java/com/android/internal/os/KernelUidCpuActiveTimeReader.java
deleted file mode 100644
index bd8a67a..0000000
--- a/core/java/com/android/internal/os/KernelUidCpuActiveTimeReader.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.os;
-
-import android.annotation.Nullable;
-import android.util.Slog;
-import android.util.SparseArray;
-
-import com.android.internal.annotations.VisibleForTesting;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-import java.util.function.Consumer;
-
-/**
- * Reads binary proc file /proc/uid_cpupower/concurrent_active_time and reports CPU active time to
- * BatteryStats to compute {@link PowerProfile#POWER_CPU_ACTIVE}.
- *
- * concurrent_active_time is an array of u32's in the following format:
- * [n, uid0, time0a, time0b, ..., time0n,
- * uid1, time1a, time1b, ..., time1n,
- * uid2, time2a, time2b, ..., time2n, etc.]
- * where n is the total number of cpus (num_possible_cpus)
- * ...
- * timeXn means the CPU time that a UID X spent running concurrently with n other processes.
- * The file contains a monotonically increasing count of time for a single boot. This class
- * maintains the previous results of a call to {@link #readDelta} in order to provide a
- * proper delta.
- *
- * This class uses a throttler to reject any {@link #readDelta} call within
- * {@link #mThrottleInterval}. This is different from the throttler in {@link KernelCpuProcReader},
- * which has a shorter throttle interval and returns cached result from last read when the request
- * is throttled.
- *
- * This class is NOT thread-safe and NOT designed to be accessed by more than one caller since each
- * caller has its own view of delta.
- */
-public class KernelUidCpuActiveTimeReader extends
- KernelUidCpuTimeReaderBase<KernelUidCpuActiveTimeReader.Callback> {
- private static final String TAG = KernelUidCpuActiveTimeReader.class.getSimpleName();
-
- private final KernelCpuProcReader mProcReader;
- private SparseArray<Double> mLastUidCpuActiveTimeMs = new SparseArray<>();
- private int mCores;
-
- public interface Callback extends KernelUidCpuTimeReaderBase.Callback {
- /**
- * Notifies when new data is available.
- *
- * @param uid uid int
- * @param cpuActiveTimeMs cpu active time spent by this uid in milliseconds
- */
- void onUidCpuActiveTime(int uid, long cpuActiveTimeMs);
- }
-
- public KernelUidCpuActiveTimeReader() {
- mProcReader = KernelCpuProcReader.getActiveTimeReaderInstance();
- }
-
- @VisibleForTesting
- public KernelUidCpuActiveTimeReader(KernelCpuProcReader procReader) {
- mProcReader = procReader;
- }
-
- @Override
- protected void readDeltaImpl(@Nullable Callback callback) {
- readImpl((buf) -> {
- int uid = buf.get();
- double activeTime = sumActiveTime(buf);
- if (activeTime > 0) {
- double delta = activeTime - mLastUidCpuActiveTimeMs.get(uid, 0.0);
- if (delta > 0) {
- mLastUidCpuActiveTimeMs.put(uid, activeTime);
- if (callback != null) {
- callback.onUidCpuActiveTime(uid, (long) delta);
- }
- } else if (delta < 0) {
- Slog.e(TAG, "Negative delta from active time proc: " + delta);
- }
- }
- });
- }
-
- public void readAbsolute(Callback callback) {
- readImpl((buf) -> {
- int uid = buf.get();
- double activeTime = sumActiveTime(buf);
- if (activeTime > 0) {
- callback.onUidCpuActiveTime(uid, (long) activeTime);
- }
- });
- }
-
- private double sumActiveTime(IntBuffer buffer) {
- double sum = 0;
- boolean corrupted = false;
- for (int j = 1; j <= mCores; j++) {
- int time = buffer.get();
- if (time < 0) {
- // Even if error happens, we still need to continue reading.
- // Buffer cannot be skipped.
- Slog.e(TAG, "Negative time from active time proc: " + time);
- corrupted = true;
- } else {
- sum += (double) time * 10 / j; // Unit is 10ms.
- }
- }
- return corrupted ? -1 : sum;
- }
-
- /**
- * readImpl accepts a callback to process the uid entry. readDeltaImpl needs to store the last
- * seen results while processing the buffer, while readAbsolute returns the absolute value read
- * from the buffer without storing. So readImpl contains the common logic of the two, leaving
- * the difference to a processUid function.
- *
- * @param processUid the callback function to process the uid entry in the buffer.
- */
- private void readImpl(Consumer<IntBuffer> processUid) {
- synchronized (mProcReader) {
- final ByteBuffer bytes = mProcReader.readBytes();
- if (bytes == null || bytes.remaining() <= 4) {
- // Error already logged in mProcReader.
- return;
- }
- if ((bytes.remaining() & 3) != 0) {
- Slog.wtf(TAG,
- "Cannot parse active time proc bytes to int: " + bytes.remaining());
- return;
- }
- final IntBuffer buf = bytes.asIntBuffer();
- final int cores = buf.get();
- if (mCores != 0 && cores != mCores) {
- Slog.wtf(TAG, "Cpu active time wrong # cores: " + cores);
- return;
- }
- mCores = cores;
- if (cores <= 0 || buf.remaining() % (cores + 1) != 0) {
- Slog.wtf(TAG,
- "Cpu active time format error: " + buf.remaining() + " / " + (cores
- + 1));
- return;
- }
- int numUids = buf.remaining() / (cores + 1);
- for (int i = 0; i < numUids; i++) {
- processUid.accept(buf);
- }
- if (DEBUG) {
- Slog.d(TAG, "Read uids: " + numUids);
- }
- }
- }
-
- public void removeUid(int uid) {
- mLastUidCpuActiveTimeMs.delete(uid);
- }
-
- public void removeUidsInRange(int startUid, int endUid) {
- mLastUidCpuActiveTimeMs.put(startUid, null);
- mLastUidCpuActiveTimeMs.put(endUid, null);
- final int firstIndex = mLastUidCpuActiveTimeMs.indexOfKey(startUid);
- final int lastIndex = mLastUidCpuActiveTimeMs.indexOfKey(endUid);
- mLastUidCpuActiveTimeMs.removeAtRange(firstIndex, lastIndex - firstIndex + 1);
- }
-}
diff --git a/core/java/com/android/internal/os/KernelUidCpuClusterTimeReader.java b/core/java/com/android/internal/os/KernelUidCpuClusterTimeReader.java
deleted file mode 100644
index 3cbfaea..0000000
--- a/core/java/com/android/internal/os/KernelUidCpuClusterTimeReader.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.os;
-
-import android.annotation.Nullable;
-import android.util.Slog;
-import android.util.SparseArray;
-
-import com.android.internal.annotations.VisibleForTesting;
-
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-import java.util.function.Consumer;
-
-/**
- * Reads binary proc file /proc/uid_cpupower/concurrent_policy_time and reports CPU cluster times
- * to BatteryStats to compute cluster power. See
- * {@link PowerProfile#getAveragePowerForCpuCluster(int)}.
- *
- * concurrent_policy_time is an array of u32's in the following format:
- * [n, x0, ..., xn, uid0, time0a, time0b, ..., time0n,
- * uid1, time1a, time1b, ..., time1n,
- * uid2, time2a, time2b, ..., time2n, etc.]
- * where n is the number of policies
- * xi is the number cpus on a particular policy
- * Each uidX is followed by x0 time entries corresponding to the time UID X spent on cluster0
- * running concurrently with 0, 1, 2, ..., x0 - 1 other processes, then followed by x1, ..., xn
- * time entries.
- *
- * The file contains a monotonically increasing count of time for a single boot. This class
- * maintains the previous results of a call to {@link #readDelta} in order to provide a
- * proper delta.
- *
- * This class uses a throttler to reject any {@link #readDelta} call within
- * {@link #mThrottleInterval}. This is different from the throttler in {@link KernelCpuProcReader},
- * which has a shorter throttle interval and returns cached result from last read when the request
- * is throttled.
- *
- * This class is NOT thread-safe and NOT designed to be accessed by more than one caller since each
- * caller has its own view of delta.
- */
-public class KernelUidCpuClusterTimeReader extends
- KernelUidCpuTimeReaderBase<KernelUidCpuClusterTimeReader.Callback> {
- private static final String TAG = KernelUidCpuClusterTimeReader.class.getSimpleName();
-
- private final KernelCpuProcReader mProcReader;
- private SparseArray<double[]> mLastUidPolicyTimeMs = new SparseArray<>();
-
- private int mNumClusters = -1;
- private int mNumCores;
- private int[] mNumCoresOnCluster;
-
- private double[] mCurTime; // Reuse to avoid GC.
- private long[] mDeltaTime; // Reuse to avoid GC.
- private long[] mCurTimeRounded; // Reuse to avoid GC.
-
- public interface Callback extends KernelUidCpuTimeReaderBase.Callback {
- /**
- * Notifies when new data is available.
- *
- * @param uid uid int
- * @param cpuClusterTimeMs an array of times spent by this uid on corresponding clusters.
- * The array index is the cluster index.
- */
- void onUidCpuPolicyTime(int uid, long[] cpuClusterTimeMs);
- }
-
- public KernelUidCpuClusterTimeReader() {
- mProcReader = KernelCpuProcReader.getClusterTimeReaderInstance();
- }
-
- @VisibleForTesting
- public KernelUidCpuClusterTimeReader(KernelCpuProcReader procReader) {
- mProcReader = procReader;
- }
-
- @Override
- protected void readDeltaImpl(@Nullable Callback cb) {
- readImpl((buf) -> {
- int uid = buf.get();
- double[] lastTimes = mLastUidPolicyTimeMs.get(uid);
- if (lastTimes == null) {
- lastTimes = new double[mNumClusters];
- mLastUidPolicyTimeMs.put(uid, lastTimes);
- }
- if (!sumClusterTime(buf, mCurTime)) {
- return;
- }
- boolean valid = true;
- boolean notify = false;
- for (int i = 0; i < mNumClusters; i++) {
- mDeltaTime[i] = (long) (mCurTime[i] - lastTimes[i]);
- if (mDeltaTime[i] < 0) {
- Slog.e(TAG, "Negative delta from cluster time proc: " + mDeltaTime[i]);
- valid = false;
- }
- notify |= mDeltaTime[i] > 0;
- }
- if (notify && valid) {
- System.arraycopy(mCurTime, 0, lastTimes, 0, mNumClusters);
- if (cb != null) {
- cb.onUidCpuPolicyTime(uid, mDeltaTime);
- }
- }
- });
- }
-
- public void readAbsolute(Callback callback) {
- readImpl((buf) -> {
- int uid = buf.get();
- if (sumClusterTime(buf, mCurTime)) {
- for (int i = 0; i < mNumClusters; i++) {
- mCurTimeRounded[i] = (long) mCurTime[i];
- }
- callback.onUidCpuPolicyTime(uid, mCurTimeRounded);
- }
- });
- }
-
- private boolean sumClusterTime(IntBuffer buffer, double[] clusterTime) {
- boolean valid = true;
- for (int i = 0; i < mNumClusters; i++) {
- clusterTime[i] = 0;
- for (int j = 1; j <= mNumCoresOnCluster[i]; j++) {
- int time = buffer.get();
- if (time < 0) {
- Slog.e(TAG, "Negative time from cluster time proc: " + time);
- valid = false;
- }
- clusterTime[i] += (double) time * 10 / j; // Unit is 10ms.
- }
- }
- return valid;
- }
-
- /**
- * readImpl accepts a callback to process the uid entry. readDeltaImpl needs to store the last
- * seen results while processing the buffer, while readAbsolute returns the absolute value read
- * from the buffer without storing. So readImpl contains the common logic of the two, leaving
- * the difference to a processUid function.
- *
- * @param processUid the callback function to process the uid entry in the buffer.
- */
- private void readImpl(Consumer<IntBuffer> processUid) {
- synchronized (mProcReader) {
- ByteBuffer bytes = mProcReader.readBytes();
- if (bytes == null || bytes.remaining() <= 4) {
- // Error already logged in mProcReader.
- return;
- }
- if ((bytes.remaining() & 3) != 0) {
- Slog.wtf(TAG,
- "Cannot parse cluster time proc bytes to int: " + bytes.remaining());
- return;
- }
- IntBuffer buf = bytes.asIntBuffer();
- final int numClusters = buf.get();
- if (numClusters <= 0) {
- Slog.wtf(TAG, "Cluster time format error: " + numClusters);
- return;
- }
- if (mNumClusters == -1) {
- mNumClusters = numClusters;
- }
- if (buf.remaining() < numClusters) {
- Slog.wtf(TAG, "Too few data left in the buffer: " + buf.remaining());
- return;
- }
- if (mNumCores <= 0) {
- if (!readCoreInfo(buf, numClusters)) {
- return;
- }
- } else {
- buf.position(buf.position() + numClusters);
- }
-
- if (buf.remaining() % (mNumCores + 1) != 0) {
- Slog.wtf(TAG,
- "Cluster time format error: " + buf.remaining() + " / " + (mNumCores
- + 1));
- return;
- }
- int numUids = buf.remaining() / (mNumCores + 1);
-
- for (int i = 0; i < numUids; i++) {
- processUid.accept(buf);
- }
- if (DEBUG) {
- Slog.d(TAG, "Read uids: " + numUids);
- }
- }
- }
-
- // Returns if it has read valid info.
- private boolean readCoreInfo(IntBuffer buf, int numClusters) {
- int numCores = 0;
- int[] numCoresOnCluster = new int[numClusters];
- for (int i = 0; i < numClusters; i++) {
- numCoresOnCluster[i] = buf.get();
- numCores += numCoresOnCluster[i];
- }
- if (numCores <= 0) {
- Slog.e(TAG, "Invalid # cores from cluster time proc file: " + numCores);
- return false;
- }
- mNumCores = numCores;
- mNumCoresOnCluster = numCoresOnCluster;
- mCurTime = new double[numClusters];
- mDeltaTime = new long[numClusters];
- mCurTimeRounded = new long[numClusters];
- return true;
- }
-
- public void removeUid(int uid) {
- mLastUidPolicyTimeMs.delete(uid);
- }
-
- public void removeUidsInRange(int startUid, int endUid) {
- mLastUidPolicyTimeMs.put(startUid, null);
- mLastUidPolicyTimeMs.put(endUid, null);
- final int firstIndex = mLastUidPolicyTimeMs.indexOfKey(startUid);
- final int lastIndex = mLastUidPolicyTimeMs.indexOfKey(endUid);
- mLastUidPolicyTimeMs.removeAtRange(firstIndex, lastIndex - firstIndex + 1);
- }
-}
diff --git a/core/java/com/android/internal/os/KernelUidCpuFreqTimeReader.java b/core/java/com/android/internal/os/KernelUidCpuFreqTimeReader.java
deleted file mode 100644
index 5b46d0f..0000000
--- a/core/java/com/android/internal/os/KernelUidCpuFreqTimeReader.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.os;
-
-import static com.android.internal.util.Preconditions.checkNotNull;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.os.StrictMode;
-import android.util.IntArray;
-import android.util.Slog;
-import android.util.SparseArray;
-
-import com.android.internal.annotations.VisibleForTesting;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.nio.IntBuffer;
-import java.util.function.Consumer;
-
-/**
- * Reads /proc/uid_time_in_state which has the format:
- *
- * uid: [freq1] [freq2] [freq3] ...
- * [uid1]: [time in freq1] [time in freq2] [time in freq3] ...
- * [uid2]: [time in freq1] [time in freq2] [time in freq3] ...
- * ...
- *
- * Binary variation reads /proc/uid_cpupower/time_in_state in the following format:
- * [n, uid0, time0a, time0b, ..., time0n,
- * uid1, time1a, time1b, ..., time1n,
- * uid2, time2a, time2b, ..., time2n, etc.]
- * where n is the total number of frequencies.
- *
- * This provides the times a UID's processes spent executing at each different cpu frequency.
- * The file contains a monotonically increasing count of time for a single boot. This class
- * maintains the previous results of a call to {@link #readDelta} in order to provide a proper
- * delta.
- *
- * This class uses a throttler to reject any {@link #readDelta} call within
- * {@link #mThrottleInterval}. This is different from the throttler in {@link KernelCpuProcReader},
- * which has a shorter throttle interval and returns cached result from last read when the request
- * is throttled.
- *
- * This class is NOT thread-safe and NOT designed to be accessed by more than one caller since each
- * caller has its own view of delta.
- */
-public class KernelUidCpuFreqTimeReader extends
- KernelUidCpuTimeReaderBase<KernelUidCpuFreqTimeReader.Callback> {
- private static final String TAG = KernelUidCpuFreqTimeReader.class.getSimpleName();
- static final String UID_TIMES_PROC_FILE = "/proc/uid_time_in_state";
-
- public interface Callback extends KernelUidCpuTimeReaderBase.Callback {
- void onUidCpuFreqTime(int uid, long[] cpuFreqTimeMs);
- }
-
- private long[] mCpuFreqs;
- private long[] mCurTimes; // Reuse to prevent GC.
- private long[] mDeltaTimes; // Reuse to prevent GC.
- private int mCpuFreqsCount;
- private final KernelCpuProcReader mProcReader;
-
- private SparseArray<long[]> mLastUidCpuFreqTimeMs = new SparseArray<>();
-
- // We check the existence of proc file a few times (just in case it is not ready yet when we
- // start reading) and if it is not available, we simply ignore further read requests.
- private static final int TOTAL_READ_ERROR_COUNT = 5;
- private int mReadErrorCounter;
- private boolean mPerClusterTimesAvailable;
- private boolean mAllUidTimesAvailable = true;
-
- public KernelUidCpuFreqTimeReader() {
- mProcReader = KernelCpuProcReader.getFreqTimeReaderInstance();
- }
-
- @VisibleForTesting
- public KernelUidCpuFreqTimeReader(KernelCpuProcReader procReader) {
- mProcReader = procReader;
- }
-
- public boolean perClusterTimesAvailable() {
- return mPerClusterTimesAvailable;
- }
-
- public boolean allUidTimesAvailable() {
- return mAllUidTimesAvailable;
- }
-
- public SparseArray<long[]> getAllUidCpuFreqTimeMs() {
- return mLastUidCpuFreqTimeMs;
- }
-
- public long[] readFreqs(@NonNull PowerProfile powerProfile) {
- checkNotNull(powerProfile);
- if (mCpuFreqs != null) {
- // No need to read cpu freqs more than once.
- return mCpuFreqs;
- }
- if (!mAllUidTimesAvailable) {
- return null;
- }
- final int oldMask = StrictMode.allowThreadDiskReadsMask();
- try (BufferedReader reader = new BufferedReader(new FileReader(UID_TIMES_PROC_FILE))) {
- return readFreqs(reader, powerProfile);
- } catch (IOException e) {
- if (++mReadErrorCounter >= TOTAL_READ_ERROR_COUNT) {
- mAllUidTimesAvailable = false;
- }
- Slog.e(TAG, "Failed to read " + UID_TIMES_PROC_FILE + ": " + e);
- return null;
- } finally {
- StrictMode.setThreadPolicyMask(oldMask);
- }
- }
-
- @VisibleForTesting
- public long[] readFreqs(BufferedReader reader, PowerProfile powerProfile)
- throws IOException {
- final String line = reader.readLine();
- if (line == null) {
- return null;
- }
- final String[] freqStr = line.split(" ");
- // First item would be "uid: " which needs to be ignored.
- mCpuFreqsCount = freqStr.length - 1;
- mCpuFreqs = new long[mCpuFreqsCount];
- mCurTimes = new long[mCpuFreqsCount];
- mDeltaTimes = new long[mCpuFreqsCount];
- for (int i = 0; i < mCpuFreqsCount; ++i) {
- mCpuFreqs[i] = Long.parseLong(freqStr[i + 1], 10);
- }
-
- // Check if the freqs in the proc file correspond to per-cluster freqs.
- final IntArray numClusterFreqs = extractClusterInfoFromProcFileFreqs();
- final int numClusters = powerProfile.getNumCpuClusters();
- if (numClusterFreqs.size() == numClusters) {
- mPerClusterTimesAvailable = true;
- for (int i = 0; i < numClusters; ++i) {
- if (numClusterFreqs.get(i) != powerProfile.getNumSpeedStepsInCpuCluster(i)) {
- mPerClusterTimesAvailable = false;
- break;
- }
- }
- } else {
- mPerClusterTimesAvailable = false;
- }
- Slog.i(TAG, "mPerClusterTimesAvailable=" + mPerClusterTimesAvailable);
- return mCpuFreqs;
- }
-
- @Override
- @VisibleForTesting
- public void readDeltaImpl(@Nullable Callback callback) {
- if (mCpuFreqs == null) {
- return;
- }
- readImpl((buf) -> {
- int uid = buf.get();
- long[] lastTimes = mLastUidCpuFreqTimeMs.get(uid);
- if (lastTimes == null) {
- lastTimes = new long[mCpuFreqsCount];
- mLastUidCpuFreqTimeMs.put(uid, lastTimes);
- }
- if (!getFreqTimeForUid(buf, mCurTimes)) {
- return;
- }
- boolean notify = false;
- boolean valid = true;
- for (int i = 0; i < mCpuFreqsCount; i++) {
- mDeltaTimes[i] = mCurTimes[i] - lastTimes[i];
- if (mDeltaTimes[i] < 0) {
- Slog.e(TAG, "Negative delta from freq time proc: " + mDeltaTimes[i]);
- valid = false;
- }
- notify |= mDeltaTimes[i] > 0;
- }
- if (notify && valid) {
- System.arraycopy(mCurTimes, 0, lastTimes, 0, mCpuFreqsCount);
- if (callback != null) {
- callback.onUidCpuFreqTime(uid, mDeltaTimes);
- }
- }
- });
- }
-
- public void readAbsolute(Callback callback) {
- readImpl((buf) -> {
- int uid = buf.get();
- if (getFreqTimeForUid(buf, mCurTimes)) {
- callback.onUidCpuFreqTime(uid, mCurTimes);
- }
- });
- }
-
- private boolean getFreqTimeForUid(IntBuffer buffer, long[] freqTime) {
- boolean valid = true;
- for (int i = 0; i < mCpuFreqsCount; i++) {
- freqTime[i] = (long) buffer.get() * 10; // Unit is 10ms.
- if (freqTime[i] < 0) {
- Slog.e(TAG, "Negative time from freq time proc: " + freqTime[i]);
- valid = false;
- }
- }
- return valid;
- }
-
- /**
- * readImpl accepts a callback to process the uid entry. readDeltaImpl needs to store the last
- * seen results while processing the buffer, while readAbsolute returns the absolute value read
- * from the buffer without storing. So readImpl contains the common logic of the two, leaving
- * the difference to a processUid function.
- *
- * @param processUid the callback function to process the uid entry in the buffer.
- */
- private void readImpl(Consumer<IntBuffer> processUid) {
- synchronized (mProcReader) {
- ByteBuffer bytes = mProcReader.readBytes();
- if (bytes == null || bytes.remaining() <= 4) {
- // Error already logged in mProcReader.
- return;
- }
- if ((bytes.remaining() & 3) != 0) {
- Slog.wtf(TAG, "Cannot parse freq time proc bytes to int: " + bytes.remaining());
- return;
- }
- IntBuffer buf = bytes.asIntBuffer();
- final int freqs = buf.get();
- if (freqs != mCpuFreqsCount) {
- Slog.wtf(TAG, "Cpu freqs expect " + mCpuFreqsCount + " , got " + freqs);
- return;
- }
- if (buf.remaining() % (freqs + 1) != 0) {
- Slog.wtf(TAG, "Freq time format error: " + buf.remaining() + " / " + (freqs + 1));
- return;
- }
- int numUids = buf.remaining() / (freqs + 1);
- for (int i = 0; i < numUids; i++) {
- processUid.accept(buf);
- }
- if (DEBUG) {
- Slog.d(TAG, "Read uids: #" + numUids);
- }
- }
- }
-
- public void removeUid(int uid) {
- mLastUidCpuFreqTimeMs.delete(uid);
- }
-
- public void removeUidsInRange(int startUid, int endUid) {
- mLastUidCpuFreqTimeMs.put(startUid, null);
- mLastUidCpuFreqTimeMs.put(endUid, null);
- final int firstIndex = mLastUidCpuFreqTimeMs.indexOfKey(startUid);
- final int lastIndex = mLastUidCpuFreqTimeMs.indexOfKey(endUid);
- mLastUidCpuFreqTimeMs.removeAtRange(firstIndex, lastIndex - firstIndex + 1);
- }
-
- /**
- * Extracts no. of cpu clusters and no. of freqs in each of these clusters from the freqs
- * read from the proc file.
- *
- * We need to assume that freqs in each cluster are strictly increasing.
- * For e.g. if the freqs read from proc file are: 12, 34, 15, 45, 12, 15, 52. Then it means
- * there are 3 clusters: (12, 34), (15, 45), (12, 15, 52)
- *
- * @return an IntArray filled with no. of freqs in each cluster.
- */
- private IntArray extractClusterInfoFromProcFileFreqs() {
- final IntArray numClusterFreqs = new IntArray();
- int freqsFound = 0;
- for (int i = 0; i < mCpuFreqsCount; ++i) {
- freqsFound++;
- if (i + 1 == mCpuFreqsCount || mCpuFreqs[i + 1] <= mCpuFreqs[i]) {
- numClusterFreqs.add(freqsFound);
- freqsFound = 0;
- }
- }
- return numClusterFreqs;
- }
-}
diff --git a/core/java/com/android/internal/os/KernelUidCpuTimeReader.java b/core/java/com/android/internal/os/KernelUidCpuTimeReader.java
deleted file mode 100644
index 97b7211..0000000
--- a/core/java/com/android/internal/os/KernelUidCpuTimeReader.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.internal.os;
-
-import android.annotation.Nullable;
-import android.os.StrictMode;
-import android.os.SystemClock;
-import android.text.TextUtils;
-import android.util.Slog;
-import android.util.SparseLongArray;
-import android.util.TimeUtils;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-
-/**
- * Reads /proc/uid_cputime/show_uid_stat which has the line format:
- *
- * uid: user_time_micro_seconds system_time_micro_seconds power_in_milli-amp-micro_seconds
- *
- * This provides the time a UID's processes spent executing in user-space and kernel-space.
- * The file contains a monotonically increasing count of time for a single boot. This class
- * maintains the previous results of a call to {@link #readDelta} in order to provide a proper
- * delta.
- */
-public class KernelUidCpuTimeReader extends
- KernelUidCpuTimeReaderBase<KernelUidCpuTimeReader.Callback> {
- private static final String TAG = KernelUidCpuTimeReader.class.getSimpleName();
- private static final String sProcFile = "/proc/uid_cputime/show_uid_stat";
- private static final String sRemoveUidProcFile = "/proc/uid_cputime/remove_uid_range";
-
- /**
- * Callback interface for processing each line of the proc file.
- */
- public interface Callback extends KernelUidCpuTimeReaderBase.Callback {
- /**
- * @param uid UID of the app
- * @param userTimeUs time spent executing in user space in microseconds
- * @param systemTimeUs time spent executing in kernel space in microseconds
- */
- void onUidCpuTime(int uid, long userTimeUs, long systemTimeUs);
- }
-
- private SparseLongArray mLastUserTimeUs = new SparseLongArray();
- private SparseLongArray mLastSystemTimeUs = new SparseLongArray();
- private long mLastTimeReadUs = 0;
-
- /**
- * Reads the proc file, calling into the callback with a delta of time for each UID.
- *
- * @param callback The callback to invoke for each line of the proc file. If null,
- * the data is consumed and subsequent calls to readDelta will provide
- * a fresh delta.
- */
- @Override
- protected void readDeltaImpl(@Nullable Callback callback) {
- final int oldMask = StrictMode.allowThreadDiskReadsMask();
- long nowUs = SystemClock.elapsedRealtime() * 1000;
- try (BufferedReader reader = new BufferedReader(new FileReader(sProcFile))) {
- TextUtils.SimpleStringSplitter splitter = new TextUtils.SimpleStringSplitter(' ');
- String line;
- while ((line = reader.readLine()) != null) {
- splitter.setString(line);
- final String uidStr = splitter.next();
- final int uid = Integer.parseInt(uidStr.substring(0, uidStr.length() - 1), 10);
- final long userTimeUs = Long.parseLong(splitter.next(), 10);
- final long systemTimeUs = Long.parseLong(splitter.next(), 10);
-
- boolean notifyCallback = false;
- long userTimeDeltaUs = userTimeUs;
- long systemTimeDeltaUs = systemTimeUs;
- // Only report if there is a callback and if this is not the first read.
- if (callback != null && mLastTimeReadUs != 0) {
- int index = mLastUserTimeUs.indexOfKey(uid);
- if (index >= 0) {
- userTimeDeltaUs -= mLastUserTimeUs.valueAt(index);
- systemTimeDeltaUs -= mLastSystemTimeUs.valueAt(index);
-
- final long timeDiffUs = nowUs - mLastTimeReadUs;
- if (userTimeDeltaUs < 0 || systemTimeDeltaUs < 0) {
- StringBuilder sb = new StringBuilder("Malformed cpu data for UID=");
- sb.append(uid).append("!\n");
- sb.append("Time between reads: ");
- TimeUtils.formatDuration(timeDiffUs / 1000, sb);
- sb.append("\n");
- sb.append("Previous times: u=");
- TimeUtils.formatDuration(mLastUserTimeUs.valueAt(index) / 1000, sb);
- sb.append(" s=");
- TimeUtils.formatDuration(mLastSystemTimeUs.valueAt(index) / 1000, sb);
-
- sb.append("\nCurrent times: u=");
- TimeUtils.formatDuration(userTimeUs / 1000, sb);
- sb.append(" s=");
- TimeUtils.formatDuration(systemTimeUs / 1000, sb);
- sb.append("\nDelta: u=");
- TimeUtils.formatDuration(userTimeDeltaUs / 1000, sb);
- sb.append(" s=");
- TimeUtils.formatDuration(systemTimeDeltaUs / 1000, sb);
- Slog.e(TAG, sb.toString());
-
- userTimeDeltaUs = 0;
- systemTimeDeltaUs = 0;
- }
- }
-
- notifyCallback = (userTimeDeltaUs != 0 || systemTimeDeltaUs != 0);
- }
- mLastUserTimeUs.put(uid, userTimeUs);
- mLastSystemTimeUs.put(uid, systemTimeUs);
- if (notifyCallback) {
- callback.onUidCpuTime(uid, userTimeDeltaUs, systemTimeDeltaUs);
- }
- }
- } catch (IOException e) {
- Slog.e(TAG, "Failed to read uid_cputime: " + e.getMessage());
- } finally {
- StrictMode.setThreadPolicyMask(oldMask);
- }
- mLastTimeReadUs = nowUs;
- }
-
- /**
- * Reads the proc file, calling into the callback with raw absolute value of time for each UID.
- * @param callback The callback to invoke for each line of the proc file.
- */
- public void readAbsolute(Callback callback) {
- final int oldMask = StrictMode.allowThreadDiskReadsMask();
- try (BufferedReader reader = new BufferedReader(new FileReader(sProcFile))) {
- TextUtils.SimpleStringSplitter splitter = new TextUtils.SimpleStringSplitter(' ');
- String line;
- while ((line = reader.readLine()) != null) {
- splitter.setString(line);
- final String uidStr = splitter.next();
- final int uid = Integer.parseInt(uidStr.substring(0, uidStr.length() - 1), 10);
- final long userTimeUs = Long.parseLong(splitter.next(), 10);
- final long systemTimeUs = Long.parseLong(splitter.next(), 10);
- callback.onUidCpuTime(uid, userTimeUs, systemTimeUs);
- }
- } catch (IOException e) {
- Slog.e(TAG, "Failed to read uid_cputime: " + e.getMessage());
- } finally {
- StrictMode.setThreadPolicyMask(oldMask);
- }
- }
-
- /**
- * Removes the UID from the kernel module and from internal accounting data. Only
- * {@link BatteryStatsImpl} and its child processes should call this, as the change on Kernel is
- * visible system wide.
- *
- * @param uid The UID to remove.
- */
- public void removeUid(int uid) {
- final int index = mLastSystemTimeUs.indexOfKey(uid);
- if (index >= 0) {
- mLastSystemTimeUs.removeAt(index);
- mLastUserTimeUs.removeAt(index);
- }
- removeUidsFromKernelModule(uid, uid);
- }
-
- /**
- * Removes UIDs in a given range from the kernel module and internal accounting data. Only
- * {@link BatteryStatsImpl} and its child processes should call this, as the change on Kernel is
- * visible system wide.
- *
- * @param startUid the first uid to remove
- * @param endUid the last uid to remove
- */
- public void removeUidsInRange(int startUid, int endUid) {
- if (endUid < startUid) {
- return;
- }
- mLastSystemTimeUs.put(startUid, 0);
- mLastUserTimeUs.put(startUid, 0);
- mLastSystemTimeUs.put(endUid, 0);
- mLastUserTimeUs.put(endUid, 0);
- final int startIndex = mLastSystemTimeUs.indexOfKey(startUid);
- final int endIndex = mLastSystemTimeUs.indexOfKey(endUid);
- mLastSystemTimeUs.removeAtRange(startIndex, endIndex - startIndex + 1);
- mLastUserTimeUs.removeAtRange(startIndex, endIndex - startIndex + 1);
- removeUidsFromKernelModule(startUid, endUid);
- }
-
- private void removeUidsFromKernelModule(int startUid, int endUid) {
- Slog.d(TAG, "Removing uids " + startUid + "-" + endUid);
- final int oldMask = StrictMode.allowThreadDiskWritesMask();
- try (FileWriter writer = new FileWriter(sRemoveUidProcFile)) {
- writer.write(startUid + "-" + endUid);
- writer.flush();
- } catch (IOException e) {
- Slog.e(TAG, "failed to remove uids " + startUid + " - " + endUid
- + " from uid_cputime module", e);
- } finally {
- StrictMode.setThreadPolicyMask(oldMask);
- }
- }
-}
diff --git a/core/java/com/android/internal/os/KernelUidCpuTimeReaderBase.java b/core/java/com/android/internal/os/KernelUidCpuTimeReaderBase.java
deleted file mode 100644
index 11e50e1..0000000
--- a/core/java/com/android/internal/os/KernelUidCpuTimeReaderBase.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.os;
-
-import android.annotation.Nullable;
-import android.os.SystemClock;
-import android.util.Slog;
-
-/**
- * The base class of all KernelUidCpuTimeReaders.
- *
- * This class is NOT designed to be thread-safe or accessed by more than one caller (due to
- * the nature of {@link #readDelta(Callback)}).
- */
-public abstract class KernelUidCpuTimeReaderBase<T extends KernelUidCpuTimeReaderBase.Callback> {
- protected static final boolean DEBUG = false;
- // Throttle interval in milliseconds
- private static final long DEFAULT_THROTTLE_INTERVAL = 10_000L;
-
- private final String TAG = this.getClass().getSimpleName();
- private long mLastTimeReadMs = Long.MIN_VALUE;
- private long mThrottleInterval = DEFAULT_THROTTLE_INTERVAL;
-
- // A generic Callback interface (used by readDelta) to be extended by subclasses.
- public interface Callback {
- }
-
- public void readDelta(@Nullable T cb) {
- if (SystemClock.elapsedRealtime() < mLastTimeReadMs + mThrottleInterval) {
- if (DEBUG) {
- Slog.d(TAG, "Throttle");
- }
- return;
- }
- readDeltaImpl(cb);
- mLastTimeReadMs = SystemClock.elapsedRealtime();
- }
-
- protected abstract void readDeltaImpl(@Nullable T cb);
-
- public void setThrottleInterval(long throttleInterval) {
- if (throttleInterval >= 0) {
- mThrottleInterval = throttleInterval;
- }
- }
-}
diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
index 197e873..d61f10e 100644
--- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl
+++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl
@@ -65,7 +65,7 @@
int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv);
void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys,
in NotificationVisibility[] noLongerVisibleKeys);
- void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded);
+ void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation);
void onNotificationDirectReplied(String key);
void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount,
boolean generatedByAsssistant);
diff --git a/core/java/com/android/internal/util/Protocol.java b/core/java/com/android/internal/util/Protocol.java
index 1aa32cc..276cad9 100644
--- a/core/java/com/android/internal/util/Protocol.java
+++ b/core/java/com/android/internal/util/Protocol.java
@@ -53,7 +53,6 @@
public static final int BASE_WIFI_PASSPOINT_MANAGER = 0x00028000;
public static final int BASE_WIFI_PASSPOINT_SERVICE = 0x00028100;
public static final int BASE_WIFI_LOGGER = 0x00028300;
- public static final int BASE_DHCP = 0x00030000;
public static final int BASE_DATA_CONNECTION = 0x00040000;
public static final int BASE_DATA_CONNECTION_AC = 0x00041000;
public static final int BASE_DATA_CONNECTION_TRACKER = 0x00042000;
@@ -62,7 +61,6 @@
public static final int BASE_NETWORK_STATE_TRACKER = 0x00070000;
public static final int BASE_CONNECTIVITY_MANAGER = 0x00080000;
public static final int BASE_NETWORK_AGENT = 0x00081000;
- public static final int BASE_NETWORK_MONITOR = 0x00082000;
public static final int BASE_NETWORK_FACTORY = 0x00083000;
public static final int BASE_ETHERNET = 0x00084000;
public static final int BASE_LOWPAN = 0x00085000;
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index 5be70ef..be12700 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -61,8 +61,11 @@
"android_database_SQLiteConnection.cpp",
"android_database_SQLiteGlobal.cpp",
"android_database_SQLiteDebug.cpp",
+ "android_graphics_Canvas.cpp",
+ "android_graphics_ColorSpace.cpp",
"android_graphics_drawable_AnimatedVectorDrawable.cpp",
"android_graphics_drawable_VectorDrawable.cpp",
+ "android_graphics_Picture.cpp",
"android_view_DisplayEventReceiver.cpp",
"android_view_DisplayListCanvas.cpp",
"android_view_TextureLayer.cpp",
@@ -117,8 +120,6 @@
"android_util_StringBlock.cpp",
"android_util_XmlBlock.cpp",
"android_util_jar_StrictJarFile.cpp",
- "android_graphics_Canvas.cpp",
- "android_graphics_Picture.cpp",
"android/graphics/AnimatedImageDrawable.cpp",
"android/graphics/Bitmap.cpp",
"android/graphics/BitmapFactory.cpp",
@@ -185,6 +186,7 @@
"android_hardware_UsbDevice.cpp",
"android_hardware_UsbDeviceConnection.cpp",
"android_hardware_UsbRequest.cpp",
+ "android_hardware_location_ActivityRecognitionHardware.cpp",
"android_util_FileObserver.cpp",
"android/opengl/poly_clip.cpp", // TODO: .arm
"android/opengl/util.cpp",
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index a586dc1..18d9b5a 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -101,6 +101,7 @@
extern int register_android_hardware_UsbDevice(JNIEnv *env);
extern int register_android_hardware_UsbDeviceConnection(JNIEnv *env);
extern int register_android_hardware_UsbRequest(JNIEnv *env);
+extern int register_android_hardware_location_ActivityRecognitionHardware(JNIEnv* env);
extern int register_android_media_AudioEffectDescriptor(JNIEnv *env);
extern int register_android_media_AudioRecord(JNIEnv *env);
@@ -130,6 +131,7 @@
extern int register_android_graphics_Canvas(JNIEnv* env);
extern int register_android_graphics_CanvasProperty(JNIEnv* env);
extern int register_android_graphics_ColorFilter(JNIEnv* env);
+extern int register_android_graphics_ColorSpace(JNIEnv* env);
extern int register_android_graphics_DrawFilter(JNIEnv* env);
extern int register_android_graphics_FontFamily(JNIEnv* env);
extern int register_android_graphics_Matrix(JNIEnv* env);
@@ -1360,6 +1362,9 @@
REG_JNI(register_android_os_VintfRuntimeInfo),
REG_JNI(register_android_nio_utils),
REG_JNI(register_android_graphics_Canvas),
+ // This needs to be before register_android_graphics_Graphics, or the latter
+ // will not be able to find the jmethodID for ColorSpace.get().
+ REG_JNI(register_android_graphics_ColorSpace),
REG_JNI(register_android_graphics_Graphics),
REG_JNI(register_android_view_DisplayEventReceiver),
REG_JNI(register_android_view_RenderNode),
@@ -1456,6 +1461,7 @@
REG_JNI(register_android_hardware_UsbDevice),
REG_JNI(register_android_hardware_UsbDeviceConnection),
REG_JNI(register_android_hardware_UsbRequest),
+ REG_JNI(register_android_hardware_location_ActivityRecognitionHardware),
REG_JNI(register_android_media_AudioEffectDescriptor),
REG_JNI(register_android_media_AudioSystem),
REG_JNI(register_android_media_AudioRecord),
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp
index 876bd4f..ad51c47 100755
--- a/core/jni/android/graphics/Bitmap.cpp
+++ b/core/jni/android/graphics/Bitmap.cpp
@@ -334,7 +334,7 @@
static jobject Bitmap_creator(JNIEnv* env, jobject, jintArray jColors,
jint offset, jint stride, jint width, jint height,
jint configHandle, jboolean isMutable,
- jfloatArray xyzD50, jobject transferParameters) {
+ jlong colorSpacePtr) {
SkColorType colorType = GraphicsJNI::legacyBitmapConfigToColorType(configHandle);
if (NULL != jColors) {
size_t n = env->GetArrayLength(jColors);
@@ -350,17 +350,8 @@
}
SkBitmap bitmap;
- sk_sp<SkColorSpace> colorSpace;
-
- if (xyzD50 == nullptr || transferParameters == nullptr) {
- colorSpace = SkColorSpace::MakeSRGB();
- } else {
- skcms_TransferFunction p = GraphicsJNI::getNativeTransferParameters(env, transferParameters);
- skcms_Matrix3x3 xyzMatrix = GraphicsJNI::getNativeXYZMatrix(env, xyzD50);
- colorSpace = SkColorSpace::MakeRGB(p, xyzMatrix);
- }
-
- bitmap.setInfo(SkImageInfo::Make(width, height, colorType, kPremul_SkAlphaType, colorSpace));
+ bitmap.setInfo(SkImageInfo::Make(width, height, colorType, kPremul_SkAlphaType,
+ GraphicsJNI::getNativeColorSpace(colorSpacePtr)));
sk_sp<Bitmap> nativeBitmap = Bitmap::allocateHeapBitmap(&bitmap);
if (!nativeBitmap) {
@@ -582,17 +573,14 @@
bitmapErase(skBitmap, SkColor4f::FromColor(color), SkColorSpace::MakeSRGB());
}
-static void Bitmap_eraseLong(JNIEnv* env, jobject, jlong bitmapHandle, jobject jColorSpace,
- jfloat r, jfloat g, jfloat b, jfloat a) {
- sk_sp<SkColorSpace> cs = GraphicsJNI::getNativeColorSpace(env, jColorSpace);
- if (GraphicsJNI::hasException(env)) {
- return;
- }
-
+static void Bitmap_eraseLong(JNIEnv* env, jobject, jlong bitmapHandle,
+ jlong colorSpaceHandle, jlong colorLong) {
LocalScopedBitmap bitmap(bitmapHandle);
SkBitmap skBitmap;
bitmap->getSkBitmap(&skBitmap);
- SkColor4f color = SkColor4f{r, g, b, a};
+
+ SkColor4f color = GraphicsJNI::convertColorLong(colorLong);
+ sk_sp<SkColorSpace> cs = GraphicsJNI::getNativeColorSpace(colorSpaceHandle);
bitmapErase(skBitmap, color, cs);
}
@@ -1141,14 +1129,12 @@
}
static jobject Bitmap_wrapHardwareBufferBitmap(JNIEnv* env, jobject, jobject hardwareBuffer,
- jfloatArray xyzD50, jobject transferParameters) {
- skcms_TransferFunction p = GraphicsJNI::getNativeTransferParameters(env, transferParameters);
- skcms_Matrix3x3 xyzMatrix = GraphicsJNI::getNativeXYZMatrix(env, xyzD50);
- sk_sp<SkColorSpace> colorSpace = SkColorSpace::MakeRGB(p, xyzMatrix);
+ jlong colorSpacePtr) {
AHardwareBuffer* hwBuf = android_hardware_HardwareBuffer_getNativeHardwareBuffer(env,
hardwareBuffer);
sp<GraphicBuffer> buffer(AHardwareBuffer_to_GraphicBuffer(hwBuf));
- sk_sp<Bitmap> bitmap = Bitmap::createFrom(buffer, colorSpace);
+ sk_sp<Bitmap> bitmap = Bitmap::createFrom(buffer,
+ GraphicsJNI::getNativeColorSpace(colorSpacePtr));
if (!bitmap.get()) {
ALOGW("failed to create hardware bitmap from hardware buffer");
return NULL;
@@ -1190,7 +1176,7 @@
///////////////////////////////////////////////////////////////////////////////
static const JNINativeMethod gBitmapMethods[] = {
- { "nativeCreate", "([IIIIIIZ[FLandroid/graphics/ColorSpace$Rgb$TransferParameters;)Landroid/graphics/Bitmap;",
+ { "nativeCreate", "([IIIIIIZJ)Landroid/graphics/Bitmap;",
(void*)Bitmap_creator },
{ "nativeCopy", "(JIZ)Landroid/graphics/Bitmap;",
(void*)Bitmap_copy },
@@ -1204,7 +1190,7 @@
{ "nativeCompress", "(JIILjava/io/OutputStream;[B)Z",
(void*)Bitmap_compress },
{ "nativeErase", "(JI)V", (void*)Bitmap_erase },
- { "nativeErase", "(JLandroid/graphics/ColorSpace;FFFF)V", (void*)Bitmap_eraseLong },
+ { "nativeErase", "(JJJ)V", (void*)Bitmap_eraseLong },
{ "nativeRowBytes", "(J)I", (void*)Bitmap_rowBytes },
{ "nativeConfig", "(J)I", (void*)Bitmap_config },
{ "nativeHasAlpha", "(J)Z", (void*)Bitmap_hasAlpha },
@@ -1236,7 +1222,7 @@
(void*)Bitmap_copyPreserveInternalConfig },
{ "nativeCreateHardwareBitmap", "(Landroid/graphics/GraphicBuffer;)Landroid/graphics/Bitmap;",
(void*) Bitmap_createHardwareBitmap },
- { "nativeWrapHardwareBufferBitmap", "(Landroid/hardware/HardwareBuffer;[FLandroid/graphics/ColorSpace$Rgb$TransferParameters;)Landroid/graphics/Bitmap;",
+ { "nativeWrapHardwareBufferBitmap", "(Landroid/hardware/HardwareBuffer;J)Landroid/graphics/Bitmap;",
(void*) Bitmap_wrapHardwareBufferBitmap },
{ "nativeCreateGraphicBufferHandle", "(J)Landroid/graphics/GraphicBuffer;",
(void*) Bitmap_createGraphicBufferHandle },
diff --git a/core/jni/android/graphics/BitmapFactory.cpp b/core/jni/android/graphics/BitmapFactory.cpp
index 4b0ab5b..7d0d3d8 100644
--- a/core/jni/android/graphics/BitmapFactory.cpp
+++ b/core/jni/android/graphics/BitmapFactory.cpp
@@ -179,7 +179,7 @@
}
static jobject doDecode(JNIEnv* env, std::unique_ptr<SkStreamRewindable> stream,
- jobject padding, jobject options) {
+ jobject padding, jobject options, jlong colorSpaceHandle) {
// Set default values for the options parameters.
int sampleSize = 1;
bool onlyDecodeSize = false;
@@ -189,7 +189,7 @@
float scale = 1.0f;
bool requireUnpremultiplied = false;
jobject javaBitmap = NULL;
- sk_sp<SkColorSpace> prefColorSpace = nullptr;
+ sk_sp<SkColorSpace> prefColorSpace = GraphicsJNI::getNativeColorSpace(colorSpaceHandle);
// Update with options supplied by the client.
if (options != NULL) {
@@ -213,8 +213,6 @@
jobject jconfig = env->GetObjectField(options, gOptions_configFieldID);
prefColorType = GraphicsJNI::getNativeBitmapColorType(env, jconfig);
- jobject jcolorSpace = env->GetObjectField(options, gOptions_colorSpaceFieldID);
- prefColorSpace = GraphicsJNI::getNativeColorSpace(env, jcolorSpace);
isHardware = GraphicsJNI::isHardwareConfig(env, jconfig);
isMutable = env->GetBooleanField(options, gOptions_mutableFieldID);
requireUnpremultiplied = !env->GetBooleanField(options, gOptions_premultipliedFieldID);
@@ -515,7 +513,7 @@
}
static jobject nativeDecodeStream(JNIEnv* env, jobject clazz, jobject is, jbyteArray storage,
- jobject padding, jobject options) {
+ jobject padding, jobject options, jlong colorSpaceHandle) {
jobject bitmap = NULL;
std::unique_ptr<SkStream> stream(CreateJavaInputStreamAdaptor(env, is, storage));
@@ -524,13 +522,13 @@
std::unique_ptr<SkStreamRewindable> bufferedStream(
SkFrontBufferedStream::Make(std::move(stream), SkCodec::MinBufferedBytesNeeded()));
SkASSERT(bufferedStream.get() != NULL);
- bitmap = doDecode(env, std::move(bufferedStream), padding, options);
+ bitmap = doDecode(env, std::move(bufferedStream), padding, options, colorSpaceHandle);
}
return bitmap;
}
static jobject nativeDecodeFileDescriptor(JNIEnv* env, jobject clazz, jobject fileDescriptor,
- jobject padding, jobject bitmapFactoryOptions) {
+ jobject padding, jobject bitmapFactoryOptions, jlong colorSpaceHandle) {
NPE_CHECK_RETURN_ZERO(env, fileDescriptor);
@@ -566,7 +564,8 @@
// If there is no offset for the file descriptor, we use SkFILEStream directly.
if (::lseek(descriptor, 0, SEEK_CUR) == 0) {
assert(isSeekable(dupDescriptor));
- return doDecode(env, std::move(fileStream), padding, bitmapFactoryOptions);
+ return doDecode(env, std::move(fileStream), padding, bitmapFactoryOptions,
+ colorSpaceHandle);
}
// Use a buffered stream. Although an SkFILEStream can be rewound, this
@@ -575,24 +574,25 @@
std::unique_ptr<SkStreamRewindable> stream(SkFrontBufferedStream::Make(std::move(fileStream),
SkCodec::MinBufferedBytesNeeded()));
- return doDecode(env, std::move(stream), padding, bitmapFactoryOptions);
+ return doDecode(env, std::move(stream), padding, bitmapFactoryOptions, colorSpaceHandle);
}
static jobject nativeDecodeAsset(JNIEnv* env, jobject clazz, jlong native_asset,
- jobject padding, jobject options) {
+ jobject padding, jobject options, jlong colorSpaceHandle) {
Asset* asset = reinterpret_cast<Asset*>(native_asset);
// since we know we'll be done with the asset when we return, we can
// just use a simple wrapper
- return doDecode(env, skstd::make_unique<AssetStreamAdaptor>(asset), padding, options);
+ return doDecode(env, skstd::make_unique<AssetStreamAdaptor>(asset), padding, options,
+ colorSpaceHandle);
}
static jobject nativeDecodeByteArray(JNIEnv* env, jobject, jbyteArray byteArray,
- jint offset, jint length, jobject options) {
+ jint offset, jint length, jobject options, jlong colorSpaceHandle) {
AutoJavaByteArray ar(env, byteArray);
return doDecode(env, skstd::make_unique<SkMemoryStream>(ar.ptr() + offset, length, false),
- nullptr, options);
+ nullptr, options, colorSpaceHandle);
}
static jboolean nativeIsSeekable(JNIEnv* env, jobject, jobject fileDescriptor) {
@@ -600,31 +600,26 @@
return isSeekable(descriptor) ? JNI_TRUE : JNI_FALSE;
}
-jobject decodeBitmap(JNIEnv* env, void* data, size_t size) {
- return doDecode(env, skstd::make_unique<SkMemoryStream>(data, size),
- nullptr, nullptr);
-}
-
///////////////////////////////////////////////////////////////////////////////
static const JNINativeMethod gMethods[] = {
{ "nativeDecodeStream",
- "(Ljava/io/InputStream;[BLandroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
+ "(Ljava/io/InputStream;[BLandroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;J)Landroid/graphics/Bitmap;",
(void*)nativeDecodeStream
},
{ "nativeDecodeFileDescriptor",
- "(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
+ "(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;J)Landroid/graphics/Bitmap;",
(void*)nativeDecodeFileDescriptor
},
{ "nativeDecodeAsset",
- "(JLandroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
+ "(JLandroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;J)Landroid/graphics/Bitmap;",
(void*)nativeDecodeAsset
},
{ "nativeDecodeByteArray",
- "([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
+ "([BIILandroid/graphics/BitmapFactory$Options;J)Landroid/graphics/Bitmap;",
(void*)nativeDecodeByteArray
},
diff --git a/core/jni/android/graphics/BitmapFactory.h b/core/jni/android/graphics/BitmapFactory.h
index 1ee49fa..e37c98d 100644
--- a/core/jni/android/graphics/BitmapFactory.h
+++ b/core/jni/android/graphics/BitmapFactory.h
@@ -28,6 +28,4 @@
jstring encodedFormatToString(JNIEnv* env, SkEncodedImageFormat format);
-jobject decodeBitmap(JNIEnv* env, void* data, size_t size);
-
#endif // _ANDROID_GRAPHICS_BITMAP_FACTORY_H_
diff --git a/core/jni/android/graphics/BitmapRegionDecoder.cpp b/core/jni/android/graphics/BitmapRegionDecoder.cpp
index f831c05..b4ba749 100644
--- a/core/jni/android/graphics/BitmapRegionDecoder.cpp
+++ b/core/jni/android/graphics/BitmapRegionDecoder.cpp
@@ -124,7 +124,7 @@
* reportSizeToVM not supported
*/
static jobject nativeDecodeRegion(JNIEnv* env, jobject, jlong brdHandle, jint inputX,
- jint inputY, jint inputWidth, jint inputHeight, jobject options) {
+ jint inputY, jint inputWidth, jint inputHeight, jobject options, jlong colorSpaceHandle) {
// Set default options.
int sampleSize = 1;
@@ -132,14 +132,12 @@
bool requireUnpremul = false;
jobject javaBitmap = NULL;
bool isHardware = false;
- sk_sp<SkColorSpace> colorSpace = nullptr;
+ sk_sp<SkColorSpace> colorSpace = GraphicsJNI::getNativeColorSpace(colorSpaceHandle);
// Update the default options with any options supplied by the client.
if (NULL != options) {
sampleSize = env->GetIntField(options, gOptions_sampleSizeFieldID);
jobject jconfig = env->GetObjectField(options, gOptions_configFieldID);
colorType = GraphicsJNI::getNativeBitmapColorType(env, jconfig);
- jobject jcolorSpace = env->GetObjectField(options, gOptions_colorSpaceFieldID);
- colorSpace = GraphicsJNI::getNativeColorSpace(env, jcolorSpace);
isHardware = GraphicsJNI::isHardwareConfig(env, jconfig);
requireUnpremul = !env->GetBooleanField(options, gOptions_premultipliedFieldID);
javaBitmap = env->GetObjectField(options, gOptions_bitmapFieldID);
@@ -255,7 +253,7 @@
static const JNINativeMethod gBitmapRegionDecoderMethods[] = {
{ "nativeDecodeRegion",
- "(JIIIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;",
+ "(JIIIILandroid/graphics/BitmapFactory$Options;J)Landroid/graphics/Bitmap;",
(void*)nativeDecodeRegion},
{ "nativeGetHeight", "(J)I", (void*)nativeGetHeight},
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp
index 9e74b88..6570992 100644
--- a/core/jni/android/graphics/Graphics.cpp
+++ b/core/jni/android/graphics/Graphics.cpp
@@ -178,23 +178,11 @@
static jmethodID gVMRuntime_newNonMovableArray;
static jmethodID gVMRuntime_addressOf;
-static jfieldID gTransferParams_aFieldID;
-static jfieldID gTransferParams_bFieldID;
-static jfieldID gTransferParams_cFieldID;
-static jfieldID gTransferParams_dFieldID;
-static jfieldID gTransferParams_eFieldID;
-static jfieldID gTransferParams_fFieldID;
-static jfieldID gTransferParams_gFieldID;
-
static jclass gColorSpace_class;
-static jfieldID gColorSpace_IlluminantD50FieldID;
-static jmethodID gColorSpace_adaptMethodID;
static jmethodID gColorSpace_getMethodID;
static jmethodID gColorSpace_matchMethodID;
static jclass gColorSpaceRGB_class;
-static jmethodID gColorSpaceRGB_getTransferParametersMethodID;
-static jmethodID gColorSpaceRGB_getTransformMethodID;
static jmethodID gColorSpaceRGB_constructorMethodID;
static jclass gColorSpace_Named_class;
@@ -424,63 +412,6 @@
///////////////////////////////////////////////////////////////////////////////
-skcms_TransferFunction GraphicsJNI::getNativeTransferParameters(JNIEnv* env, jobject transferParams) {
- skcms_TransferFunction p;
- p.a = (float) env->GetDoubleField(transferParams, gTransferParams_aFieldID);
- p.b = (float) env->GetDoubleField(transferParams, gTransferParams_bFieldID);
- p.c = (float) env->GetDoubleField(transferParams, gTransferParams_cFieldID);
- p.d = (float) env->GetDoubleField(transferParams, gTransferParams_dFieldID);
- p.e = (float) env->GetDoubleField(transferParams, gTransferParams_eFieldID);
- p.f = (float) env->GetDoubleField(transferParams, gTransferParams_fFieldID);
- p.g = (float) env->GetDoubleField(transferParams, gTransferParams_gFieldID);
- return p;
-}
-
-skcms_Matrix3x3 GraphicsJNI::getNativeXYZMatrix(JNIEnv* env, jfloatArray xyzD50) {
- skcms_Matrix3x3 xyzMatrix;
- jfloat* array = env->GetFloatArrayElements(xyzD50, NULL);
- xyzMatrix.vals[0][0] = array[0];
- xyzMatrix.vals[1][0] = array[1];
- xyzMatrix.vals[2][0] = array[2];
- xyzMatrix.vals[0][1] = array[3];
- xyzMatrix.vals[1][1] = array[4];
- xyzMatrix.vals[2][1] = array[5];
- xyzMatrix.vals[0][2] = array[6];
- xyzMatrix.vals[1][2] = array[7];
- xyzMatrix.vals[2][2] = array[8];
- env->ReleaseFloatArrayElements(xyzD50, array, 0);
- return xyzMatrix;
-}
-
-sk_sp<SkColorSpace> GraphicsJNI::getNativeColorSpace(JNIEnv* env, jobject colorSpace) {
- if (colorSpace == nullptr) return nullptr;
- if (!env->IsInstanceOf(colorSpace, gColorSpaceRGB_class)) {
- doThrowIAE(env, "The color space must be an RGB color space");
- return nullptr;
- }
-
- jobject transferParams = env->CallObjectMethod(colorSpace,
- gColorSpaceRGB_getTransferParametersMethodID);
- if (transferParams == nullptr) {
- doThrowIAE(env, "The color space must use an ICC parametric transfer function");
- return nullptr;
- }
-
- jfloatArray illuminantD50 = (jfloatArray) env->GetStaticObjectField(gColorSpace_class,
- gColorSpace_IlluminantD50FieldID);
- jobject colorSpaceD50 = env->CallStaticObjectMethod(gColorSpace_class,
- gColorSpace_adaptMethodID, colorSpace, illuminantD50);
-
- jfloatArray xyzD50 = (jfloatArray) env->CallObjectMethod(colorSpaceD50,
- gColorSpaceRGB_getTransformMethodID);
-
- skcms_Matrix3x3 xyzMatrix = getNativeXYZMatrix(env, xyzD50);
- skcms_TransferFunction transferFunction = getNativeTransferParameters(env, transferParams);
-
- return SkColorSpace::MakeRGB(transferFunction, xyzMatrix);
-}
-
-
jobject GraphicsJNI::getColorSpace(JNIEnv* env, sk_sp<SkColorSpace>& decodeColorSpace,
SkColorType decodeColorType) {
jobject colorSpace = nullptr;
@@ -712,20 +643,7 @@
"(Ljava/lang/Class;I)Ljava/lang/Object;");
gVMRuntime_addressOf = GetMethodIDOrDie(env, gVMRuntime_class, "addressOf", "(Ljava/lang/Object;)J");
- jclass transfer_params_class = FindClassOrDie(env, "android/graphics/ColorSpace$Rgb$TransferParameters");
- gTransferParams_aFieldID = GetFieldIDOrDie(env, transfer_params_class, "a", "D");
- gTransferParams_bFieldID = GetFieldIDOrDie(env, transfer_params_class, "b", "D");
- gTransferParams_cFieldID = GetFieldIDOrDie(env, transfer_params_class, "c", "D");
- gTransferParams_dFieldID = GetFieldIDOrDie(env, transfer_params_class, "d", "D");
- gTransferParams_eFieldID = GetFieldIDOrDie(env, transfer_params_class, "e", "D");
- gTransferParams_fFieldID = GetFieldIDOrDie(env, transfer_params_class, "f", "D");
- gTransferParams_gFieldID = GetFieldIDOrDie(env, transfer_params_class, "g", "D");
-
gColorSpace_class = MakeGlobalRefOrDie(env, FindClassOrDie(env, "android/graphics/ColorSpace"));
- gColorSpace_IlluminantD50FieldID = GetStaticFieldIDOrDie(env,
- gColorSpace_class, "ILLUMINANT_D50", "[F");
- gColorSpace_adaptMethodID = GetStaticMethodIDOrDie(env, gColorSpace_class, "adapt",
- "(Landroid/graphics/ColorSpace;[F)Landroid/graphics/ColorSpace;");
gColorSpace_getMethodID = GetStaticMethodIDOrDie(env, gColorSpace_class,
"get", "(Landroid/graphics/ColorSpace$Named;)Landroid/graphics/ColorSpace;");
gColorSpace_matchMethodID = GetStaticMethodIDOrDie(env, gColorSpace_class, "match",
@@ -735,10 +653,6 @@
FindClassOrDie(env, "android/graphics/ColorSpace$Rgb"));
gColorSpaceRGB_constructorMethodID = GetMethodIDOrDie(env, gColorSpaceRGB_class,
"<init>", "(Ljava/lang/String;[FLandroid/graphics/ColorSpace$Rgb$TransferParameters;)V");
- gColorSpaceRGB_getTransferParametersMethodID = GetMethodIDOrDie(env, gColorSpaceRGB_class,
- "getTransferParameters", "()Landroid/graphics/ColorSpace$Rgb$TransferParameters;");
- gColorSpaceRGB_getTransformMethodID = GetMethodIDOrDie(env, gColorSpaceRGB_class,
- "getTransform", "()[F");
gColorSpace_Named_class = MakeGlobalRefOrDie(env,
FindClassOrDie(env, "android/graphics/ColorSpace$Named"));
diff --git a/core/jni/android/graphics/GraphicsJNI.h b/core/jni/android/graphics/GraphicsJNI.h
index 699d153..dc0d022 100644
--- a/core/jni/android/graphics/GraphicsJNI.h
+++ b/core/jni/android/graphics/GraphicsJNI.h
@@ -100,12 +100,27 @@
int srcStride, int x, int y, int width, int height,
SkBitmap* dstBitmap);
- static skcms_TransferFunction getNativeTransferParameters(JNIEnv* env, jobject transferParams);
- static skcms_Matrix3x3 getNativeXYZMatrix(JNIEnv* env, jfloatArray xyzD50);
- static sk_sp<SkColorSpace> getNativeColorSpace(JNIEnv* env, jobject colorSpace);
+ /**
+ * Convert the native SkColorSpace retrieved from ColorSpace.Rgb.getNativeInstance().
+ *
+ * This will never throw an Exception. If the ColorSpace is one that Skia cannot
+ * use, ColorSpace.Rgb.getNativeInstance() would have thrown an Exception. It may,
+ * however, be nullptr, which may be acceptable.
+ */
+ static sk_sp<SkColorSpace> getNativeColorSpace(jlong colorSpaceHandle);
static jobject getColorSpace(JNIEnv* env, sk_sp<SkColorSpace>& decodeColorSpace,
SkColorType decodeColorType);
+
+ /**
+ * Convert from a Java @ColorLong to an SkColor4f that Skia can use directly.
+ *
+ * This ignores the encoded ColorSpace, besides checking to see if it is sRGB,
+ * which is encoded differently. The color space should be passed down separately
+ * via ColorSpace#getNativeInstance(), and converted with getNativeColorSpace(),
+ * above.
+ */
+ static SkColor4f convertColorLong(jlong color);
};
class HeapAllocator : public SkBRDAllocator {
diff --git a/core/jni/android/graphics/ImageDecoder.cpp b/core/jni/android/graphics/ImageDecoder.cpp
index df735ae..5f12665 100644
--- a/core/jni/android/graphics/ImageDecoder.cpp
+++ b/core/jni/android/graphics/ImageDecoder.cpp
@@ -202,7 +202,7 @@
jint desiredWidth, jint desiredHeight, jobject jsubset,
jboolean requireMutable, jint allocator,
jboolean requireUnpremul, jboolean preferRamOverQuality,
- jboolean asAlphaMask, jobject jcolorSpace) {
+ jboolean asAlphaMask, jlong colorSpaceHandle) {
auto* decoder = reinterpret_cast<ImageDecoder*>(nativePtr);
SkAndroidCodec* codec = decoder->mCodec.get();
const SkISize desiredSize = SkISize::Make(desiredWidth, desiredHeight);
@@ -256,7 +256,7 @@
// This is currently the only way to know that we should decode to F16.
colorType = codec->computeOutputColorType(colorType);
}
- sk_sp<SkColorSpace> colorSpace = GraphicsJNI::getNativeColorSpace(env, jcolorSpace);
+ sk_sp<SkColorSpace> colorSpace = GraphicsJNI::getNativeColorSpace(colorSpaceHandle);
colorSpace = codec->computeOutputColorSpace(colorType, colorSpace);
decodeInfo = decodeInfo.makeColorType(colorType).makeColorSpace(colorSpace);
@@ -508,7 +508,7 @@
{ "nCreate", "([BIILandroid/graphics/ImageDecoder$Source;)Landroid/graphics/ImageDecoder;", (void*) ImageDecoder_nCreateByteArray },
{ "nCreate", "(Ljava/io/InputStream;[BLandroid/graphics/ImageDecoder$Source;)Landroid/graphics/ImageDecoder;", (void*) ImageDecoder_nCreateInputStream },
{ "nCreate", "(Ljava/io/FileDescriptor;Landroid/graphics/ImageDecoder$Source;)Landroid/graphics/ImageDecoder;", (void*) ImageDecoder_nCreateFd },
- { "nDecodeBitmap", "(JLandroid/graphics/ImageDecoder;ZIILandroid/graphics/Rect;ZIZZZLandroid/graphics/ColorSpace;)Landroid/graphics/Bitmap;",
+ { "nDecodeBitmap", "(JLandroid/graphics/ImageDecoder;ZIILandroid/graphics/Rect;ZIZZZJ)Landroid/graphics/Bitmap;",
(void*) ImageDecoder_nDecodeBitmap },
{ "nGetSampledSize","(JI)Landroid/util/Size;", (void*) ImageDecoder_nGetSampledSize },
{ "nGetPadding", "(JLandroid/graphics/Rect;)V", (void*) ImageDecoder_nGetPadding },
diff --git a/core/jni/android/graphics/Paint.cpp b/core/jni/android/graphics/Paint.cpp
index e2e3042..7679c5b 100644
--- a/core/jni/android/graphics/Paint.cpp
+++ b/core/jni/android/graphics/Paint.cpp
@@ -557,41 +557,6 @@
return result;
}
- // FIXME: Make this CriticalNative when we no longer need to use JNIEnv. b/122514935 will allow
- // passing the SkColorSpace directly from JNI.
- static void setColor(JNIEnv* env, jobject clazz, jlong paintHandle, jobject jColorSpace,
- jfloat r, jfloat g, jfloat b, jfloat a) {
- sk_sp<SkColorSpace> cs = GraphicsJNI::getNativeColorSpace(env, jColorSpace);
- if (GraphicsJNI::hasException(env)) {
- return;
- }
-
- SkColor4f color = SkColor4f{r, g, b, a};
- reinterpret_cast<Paint*>(paintHandle)->setColor4f(color, cs.get());
- }
-
- // FIXME: Make this CriticalNative when we no longer need to use JNIEnv. b/122514935 will allow
- // passing the SkColorSpace directly from JNI.
- static void setShadowLayer(JNIEnv* env, jobject clazz, jlong paintHandle, jfloat radius,
- jfloat dx, jfloat dy, jobject jColorSpace,
- jfloat r, jfloat g, jfloat b, jfloat a) {
- sk_sp<SkColorSpace> cs = GraphicsJNI::getNativeColorSpace(env, jColorSpace);
- if (GraphicsJNI::hasException(env)) {
- return;
- }
-
- SkColor4f color = SkColor4f{r, g, b, a};
-
- Paint* paint = reinterpret_cast<Paint*>(paintHandle);
- if (radius <= 0) {
- paint->setLooper(nullptr);
- }
- else {
- SkScalar sigma = android::uirenderer::Blur::convertRadiusToSigma(radius);
- paint->setLooper(SkBlurDrawLooper::Make(color, cs.get(), sigma, dx, dy));
- }
- }
-
// ------------------ @FastNative ---------------------------
static jint setTextLocales(JNIEnv* env, jobject clazz, jlong objHandle, jstring locales) {
@@ -787,6 +752,13 @@
obj->setStyle(style);
}
+ static void setColor(jlong paintHandle, jlong colorSpaceHandle,
+ jfloat r, jfloat g, jfloat b, jfloat a) {
+ sk_sp<SkColorSpace> cs = GraphicsJNI::getNativeColorSpace(colorSpaceHandle);
+ SkColor4f color = SkColor4f{r, g, b, a};
+ reinterpret_cast<Paint*>(paintHandle)->setColor4f(color, cs.get());
+ }
+
static void setAlpha(jlong paintHandle, jint a) {
reinterpret_cast<Paint*>(paintHandle)->setAlpha(a);
}
@@ -1034,6 +1006,22 @@
return SkScalarToFloat(Paint::kStdStrikeThru_Thickness * textSize);
}
+ static void setShadowLayer(jlong paintHandle, jfloat radius,
+ jfloat dx, jfloat dy, jlong colorSpaceHandle,
+ jfloat r, jfloat g, jfloat b, jfloat a) {
+ sk_sp<SkColorSpace> cs = GraphicsJNI::getNativeColorSpace(colorSpaceHandle);
+ SkColor4f color = SkColor4f{r, g, b, a};
+
+ Paint* paint = reinterpret_cast<Paint*>(paintHandle);
+ if (radius <= 0) {
+ paint->setLooper(nullptr);
+ }
+ else {
+ SkScalar sigma = android::uirenderer::Blur::convertRadiusToSigma(radius);
+ paint->setLooper(SkBlurDrawLooper::Make(color, cs.get(), sigma, dx, dy));
+ }
+ }
+
static jboolean hasShadowLayer(jlong paintHandle) {
Paint* paint = reinterpret_cast<Paint*>(paintHandle);
return paint->getLooper() && paint->getLooper()->asABlurShadow(nullptr);
@@ -1082,9 +1070,6 @@
{"nGetRunAdvance", "(J[CIIIIZI)F", (void*) PaintGlue::getRunAdvance___CIIIIZI_F},
{"nGetOffsetForAdvance", "(J[CIIIIZF)I",
(void*) PaintGlue::getOffsetForAdvance___CIIIIZF_I},
- {"nSetColor","(JLandroid/graphics/ColorSpace;FFFF)V", (void*) PaintGlue::setColor},
- {"nSetShadowLayer", "(JFFFLandroid/graphics/ColorSpace;FFFF)V",
- (void*)PaintGlue::setShadowLayer},
// --------------- @FastNative ----------------------
@@ -1114,6 +1099,7 @@
{"nSetDither","(JZ)V", (void*) PaintGlue::setDither},
{"nGetStyle","(J)I", (void*) PaintGlue::getStyle},
{"nSetStyle","(JI)V", (void*) PaintGlue::setStyle},
+ {"nSetColor","(JJFFFF)V", (void*) PaintGlue::setColor},
{"nSetAlpha","(JI)V", (void*) PaintGlue::setAlpha},
{"nGetStrokeWidth","(J)F", (void*) PaintGlue::getStrokeWidth},
{"nSetStrokeWidth","(JF)V", (void*) PaintGlue::setStrokeWidth},
@@ -1154,6 +1140,7 @@
{"nGetUnderlineThickness","(J)F", (void*) PaintGlue::getUnderlineThickness},
{"nGetStrikeThruPosition","(J)F", (void*) PaintGlue::getStrikeThruPosition},
{"nGetStrikeThruThickness","(J)F", (void*) PaintGlue::getStrikeThruThickness},
+ {"nSetShadowLayer", "(JFFFJFFFF)V", (void*)PaintGlue::setShadowLayer},
{"nHasShadowLayer", "(J)Z", (void*)PaintGlue::hasShadowLayer},
{"nEqualsForTextMeasurement", "(JJ)Z", (void*)PaintGlue::equalsForTextMeasurement},
};
diff --git a/core/jni/android_graphics_ColorSpace.cpp b/core/jni/android_graphics_ColorSpace.cpp
new file mode 100644
index 0000000..7a9963e
--- /dev/null
+++ b/core/jni/android_graphics_ColorSpace.cpp
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "jni.h"
+#include "GraphicsJNI.h"
+#include "core_jni_helpers.h"
+
+#include "SkColor.h"
+#include "SkColorSpace.h"
+#include "SkHalf.h"
+
+using namespace android;
+
+static skcms_Matrix3x3 getNativeXYZMatrix(JNIEnv* env, jfloatArray xyzD50) {
+ skcms_Matrix3x3 xyzMatrix;
+ jfloat* array = env->GetFloatArrayElements(xyzD50, NULL);
+ xyzMatrix.vals[0][0] = array[0];
+ xyzMatrix.vals[1][0] = array[1];
+ xyzMatrix.vals[2][0] = array[2];
+ xyzMatrix.vals[0][1] = array[3];
+ xyzMatrix.vals[1][1] = array[4];
+ xyzMatrix.vals[2][1] = array[5];
+ xyzMatrix.vals[0][2] = array[6];
+ xyzMatrix.vals[1][2] = array[7];
+ xyzMatrix.vals[2][2] = array[8];
+ env->ReleaseFloatArrayElements(xyzD50, array, 0);
+ return xyzMatrix;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
+SkColor4f GraphicsJNI::convertColorLong(jlong color) {
+ if ((color & 0x3f) == 0) {
+ // This corresponds to sRGB, which is treated differently than the rest.
+ uint8_t a = color >> 56 & 0xff;
+ uint8_t r = color >> 48 & 0xff;
+ uint8_t g = color >> 40 & 0xff;
+ uint8_t b = color >> 32 & 0xff;
+ SkColor c = SkColorSetARGB(a, r, g, b);
+ return SkColor4f::FromColor(c);
+ }
+
+ // These match the implementation of android.graphics.Color#red(long) etc.
+ float r = SkHalfToFloat((SkHalf)(color >> 48 & 0xffff));
+ float g = SkHalfToFloat((SkHalf)(color >> 32 & 0xffff));
+ float b = SkHalfToFloat((SkHalf)(color >> 16 & 0xffff));
+ float a = (color >> 6 & 0x3ff) / 1023.0f;
+
+ return SkColor4f{r, g, b, a};
+}
+
+sk_sp<SkColorSpace> GraphicsJNI::getNativeColorSpace(jlong colorSpaceHandle) {
+ if (colorSpaceHandle == 0) return nullptr;
+ return sk_ref_sp(reinterpret_cast<SkColorSpace*>(colorSpaceHandle));
+}
+
+static void unref_colorSpace(SkColorSpace* cs) {
+ SkSafeUnref(cs);
+}
+
+static jlong ColorSpace_getNativeFinalizer(JNIEnv*, jobject) {
+ return static_cast<jlong>(reinterpret_cast<uintptr_t>(&unref_colorSpace));
+}
+
+static jlong ColorSpace_creator(JNIEnv* env, jobject, jfloat a, jfloat b, jfloat c,
+ jfloat d, jfloat e, jfloat f, jfloat g, jfloatArray xyzD50) {
+ skcms_TransferFunction p;
+ p.a = a;
+ p.b = b;
+ p.c = c;
+ p.d = d;
+ p.e = e;
+ p.f = f;
+ p.g = g;
+ skcms_Matrix3x3 xyzMatrix = getNativeXYZMatrix(env, xyzD50);
+
+ return reinterpret_cast<jlong>(SkColorSpace::MakeRGB(p, xyzMatrix).release());
+}
+
+static const JNINativeMethod gColorSpaceRgbMethods[] = {
+ { "nativeGetNativeFinalizer", "()J", (void*)ColorSpace_getNativeFinalizer },
+ { "nativeCreate", "(FFFFFFF[F)J", (void*)ColorSpace_creator }
+};
+
+namespace android {
+
+int register_android_graphics_ColorSpace(JNIEnv* env) {
+ return android::RegisterMethodsOrDie(env, "android/graphics/ColorSpace$Rgb",
+ gColorSpaceRgbMethods, NELEM(gColorSpaceRgbMethods));
+}
+
+}; // namespace android
diff --git a/core/jni/android_hardware_location_ActivityRecognitionHardware.cpp b/core/jni/android_hardware_location_ActivityRecognitionHardware.cpp
new file mode 100644
index 0000000..1c9ab94
--- /dev/null
+++ b/core/jni/android_hardware_location_ActivityRecognitionHardware.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright 2014, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "ActivityRecognitionHardware"
+
+#include <jni.h>
+#include <nativehelper/JNIHelp.h>
+
+#include <android_runtime/AndroidRuntime.h>
+#include <android_runtime/Log.h>
+
+// #include <hardware/activity_recognition.h>
+// The activity recognition HAL is being deprecated. This means -
+// i) Android framework code shall not depend on activity recognition
+// being provided through the activity_recognition.h interface.
+// ii) activity recognition HAL will not be binderized as the other HALs.
+//
+
+/**
+ * Initializes the ActivityRecognitionHardware class from the native side.
+ */
+static void class_init(JNIEnv* /*env*/, jclass /*clazz*/) {
+ ALOGE("activity_recognition HAL is deprecated. %s is effectively a no-op",
+ __FUNCTION__);
+}
+
+/**
+ * Initializes and connect the callbacks handlers in the HAL.
+ */
+static void initialize(JNIEnv* /*env*/, jobject /*obj*/) {
+ ALOGE("activity_recognition HAL is deprecated. %s is effectively a no-op",
+ __FUNCTION__);
+}
+
+/**
+ * De-initializes the ActivityRecognitionHardware from the native side.
+ */
+static void release(JNIEnv* /*env*/, jobject /*obj*/) {
+ ALOGE("activity_recognition HAL is deprecated. %s is effectively a no-op",
+ __FUNCTION__);
+}
+
+/**
+ * Returns true if ActivityRecognition HAL is supported, false otherwise.
+ */
+static jboolean is_supported(JNIEnv* /*env*/, jclass /*clazz*/) {
+ ALOGE("activity_recognition HAL is deprecated. %s is effectively a no-op",
+ __FUNCTION__);
+ return JNI_FALSE;
+}
+
+/**
+ * Gets an array representing the supported activities.
+ */
+static jobjectArray get_supported_activities(JNIEnv* /*env*/, jobject /*obj*/) {
+ ALOGE("activity_recognition HAL is deprecated. %s is effectively a no-op",
+ __FUNCTION__);
+ return NULL;
+}
+
+/**
+ * Enables a given activity event to be actively monitored.
+ */
+static int enable_activity_event(
+ JNIEnv* /*env*/,
+ jobject /*obj*/,
+ jint /*activity_handle*/,
+ jint /*event_type*/,
+ jlong /*report_latency_ns*/) {
+ ALOGE("activity_recognition HAL is deprecated. %s is effectively a no-op",
+ __FUNCTION__);
+ return android::NO_INIT;
+}
+
+/**
+ * Disables a given activity event from being actively monitored.
+ */
+static int disable_activity_event(
+ JNIEnv* /*env*/,
+ jobject /*obj*/,
+ jint /*activity_handle*/,
+ jint /*event_type*/) {
+ ALOGE("activity_recognition HAL is deprecated. %s is effectively a no-op",
+ __FUNCTION__);
+ return android::NO_INIT;
+}
+
+/**
+ * Request flush for al batch buffers.
+ */
+static int flush(JNIEnv* /*env*/, jobject /*obj*/) {
+ ALOGE("activity_recognition HAL is deprecated. %s is effectively a no-op",
+ __FUNCTION__);
+ return android::NO_INIT;
+}
+
+
+static const JNINativeMethod sMethods[] = {
+ // {"name", "signature", (void*) functionPointer },
+ { "nativeClassInit", "()V", (void*) class_init },
+ { "nativeInitialize", "()V", (void*) initialize },
+ { "nativeRelease", "()V", (void*) release },
+ { "nativeIsSupported", "()Z", (void*) is_supported },
+ { "nativeGetSupportedActivities", "()[Ljava/lang/String;", (void*) get_supported_activities },
+ { "nativeEnableActivityEvent", "(IIJ)I", (void*) enable_activity_event },
+ { "nativeDisableActivityEvent", "(II)I", (void*) disable_activity_event },
+ { "nativeFlush", "()I", (void*) flush },
+};
+
+/**
+ * Registration method invoked in JNI load.
+ */
+int register_android_hardware_location_ActivityRecognitionHardware(JNIEnv* env) {
+ return jniRegisterNativeMethods(
+ env,
+ "android/hardware/location/ActivityRecognitionHardware",
+ sMethods,
+ NELEM(sMethods));
+}
diff --git a/core/jni/android_os_Debug.cpp b/core/jni/android_os_Debug.cpp
index 7d63ec9..7837248 100644
--- a/core/jni/android_os_Debug.cpp
+++ b/core/jni/android_os_Debug.cpp
@@ -45,6 +45,7 @@
#include <meminfo/sysmeminfo.h>
#include <memtrack/memtrack.h>
#include <memunreachable/memunreachable.h>
+#include <android-base/strings.h>
#include "android_os_Debug.h"
namespace android
@@ -231,244 +232,162 @@
return err;
}
-static void read_mapinfo(FILE *fp, stats_t* stats, bool* foundSwapPss)
-{
- char line[1024];
- int len, nameLen;
- bool skip, done = false;
-
- unsigned pss = 0, swappable_pss = 0, rss = 0;
- float sharing_proportion = 0.0;
- unsigned shared_clean = 0, shared_dirty = 0;
- unsigned private_clean = 0, private_dirty = 0;
- unsigned swapped_out = 0, swapped_out_pss = 0;
- bool is_swappable = false;
- unsigned temp;
-
- uint64_t start;
- uint64_t end = 0;
- uint64_t prevEnd = 0;
- char* name;
- int name_pos;
-
- int whichHeap = HEAP_UNKNOWN;
- int subHeap = HEAP_UNKNOWN;
- int prevHeap = HEAP_UNKNOWN;
-
- *foundSwapPss = false;
-
- if(fgets(line, sizeof(line), fp) == 0) return;
-
- while (!done) {
- prevHeap = whichHeap;
- prevEnd = end;
- whichHeap = HEAP_UNKNOWN;
- subHeap = HEAP_UNKNOWN;
- skip = false;
- is_swappable = false;
-
- len = strlen(line);
- if (len < 1) return;
- line[--len] = 0;
-
- if (sscanf(line, "%" SCNx64 "-%" SCNx64 " %*s %*x %*x:%*x %*d%n", &start, &end, &name_pos) != 2) {
- skip = true;
- } else {
- while (isspace(line[name_pos])) {
- name_pos += 1;
- }
- name = line + name_pos;
- nameLen = strlen(name);
- // Trim the end of the line if it is " (deleted)".
- const char* deleted_str = " (deleted)";
- if (nameLen > (int)strlen(deleted_str) &&
- strcmp(name+nameLen-strlen(deleted_str), deleted_str) == 0) {
- nameLen -= strlen(deleted_str);
- name[nameLen] = '\0';
- }
- if ((strstr(name, "[heap]") == name)) {
- whichHeap = HEAP_NATIVE;
- } else if (strncmp(name, "[anon:libc_malloc]", 18) == 0) {
- whichHeap = HEAP_NATIVE;
- } else if (strncmp(name, "[stack", 6) == 0) {
- whichHeap = HEAP_STACK;
- } else if (nameLen > 3 && strcmp(name+nameLen-3, ".so") == 0) {
- whichHeap = HEAP_SO;
- is_swappable = true;
- } else if (nameLen > 4 && strcmp(name+nameLen-4, ".jar") == 0) {
- whichHeap = HEAP_JAR;
- is_swappable = true;
- } else if (nameLen > 4 && strcmp(name+nameLen-4, ".apk") == 0) {
- whichHeap = HEAP_APK;
- is_swappable = true;
- } else if (nameLen > 4 && strcmp(name+nameLen-4, ".ttf") == 0) {
- whichHeap = HEAP_TTF;
- is_swappable = true;
- } else if ((nameLen > 4 && strstr(name, ".dex") != NULL) ||
- (nameLen > 5 && strcmp(name+nameLen-5, ".odex") == 0)) {
- whichHeap = HEAP_DEX;
- subHeap = HEAP_DEX_APP_DEX;
- is_swappable = true;
- } else if (nameLen > 5 && strcmp(name+nameLen-5, ".vdex") == 0) {
- whichHeap = HEAP_DEX;
- // Handle system@framework@boot* and system/framework/boot*
- if (strstr(name, "@boot") != NULL || strstr(name, "/boot") != NULL) {
- subHeap = HEAP_DEX_BOOT_VDEX;
- } else {
- subHeap = HEAP_DEX_APP_VDEX;
- }
- is_swappable = true;
- } else if (nameLen > 4 && strcmp(name+nameLen-4, ".oat") == 0) {
- whichHeap = HEAP_OAT;
- is_swappable = true;
- } else if (nameLen > 4 && strcmp(name+nameLen-4, ".art") == 0) {
- whichHeap = HEAP_ART;
- // Handle system@framework@boot* and system/framework/boot*
- if (strstr(name, "@boot") != NULL || strstr(name, "/boot") != NULL) {
- subHeap = HEAP_ART_BOOT;
- } else {
- subHeap = HEAP_ART_APP;
- }
- is_swappable = true;
- } else if (strncmp(name, "/dev/", 5) == 0) {
- whichHeap = HEAP_UNKNOWN_DEV;
- if (strncmp(name, "/dev/kgsl-3d0", 13) == 0) {
- whichHeap = HEAP_GL_DEV;
- } else if (strncmp(name, "/dev/ashmem/CursorWindow", 24) == 0) {
- whichHeap = HEAP_CURSOR;
- } else if (strncmp(name, "/dev/ashmem", 11)) {
- whichHeap = HEAP_ASHMEM;
- }
- } else if (strncmp(name, "[anon:", 6) == 0) {
- whichHeap = HEAP_UNKNOWN;
- if (strncmp(name, "[anon:dalvik-", 13) == 0) {
- whichHeap = HEAP_DALVIK_OTHER;
- if (strstr(name, "[anon:dalvik-LinearAlloc") == name) {
- subHeap = HEAP_DALVIK_OTHER_LINEARALLOC;
- } else if ((strstr(name, "[anon:dalvik-alloc space") == name) ||
- (strstr(name, "[anon:dalvik-main space") == name)) {
- // This is the regular Dalvik heap.
- whichHeap = HEAP_DALVIK;
- subHeap = HEAP_DALVIK_NORMAL;
- } else if (strstr(name, "[anon:dalvik-large object space") == name ||
- strstr(name, "[anon:dalvik-free list large object space")
- == name) {
- whichHeap = HEAP_DALVIK;
- subHeap = HEAP_DALVIK_LARGE;
- } else if (strstr(name, "[anon:dalvik-non moving space") == name) {
- whichHeap = HEAP_DALVIK;
- subHeap = HEAP_DALVIK_NON_MOVING;
- } else if (strstr(name, "[anon:dalvik-zygote space") == name) {
- whichHeap = HEAP_DALVIK;
- subHeap = HEAP_DALVIK_ZYGOTE;
- } else if (strstr(name, "[anon:dalvik-indirect ref") == name) {
- subHeap = HEAP_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE;
- } else if (strstr(name, "[anon:dalvik-jit-code-cache") == name ||
- strstr(name, "[anon:dalvik-data-code-cache") == name) {
- subHeap = HEAP_DALVIK_OTHER_CODE_CACHE;
- } else if (strstr(name, "[anon:dalvik-CompilerMetadata") == name) {
- subHeap = HEAP_DALVIK_OTHER_COMPILER_METADATA;
- } else {
- subHeap = HEAP_DALVIK_OTHER_ACCOUNTING; // Default to accounting.
- }
- }
- } else if (nameLen > 0) {
- whichHeap = HEAP_UNKNOWN_MAP;
- } else if (start == prevEnd && prevHeap == HEAP_SO) {
- // bss section of a shared library.
- whichHeap = HEAP_SO;
- }
- }
-
- //ALOGI("native=%d dalvik=%d sqlite=%d: %s\n", isNativeHeap, isDalvikHeap,
- // isSqliteHeap, line);
-
- shared_clean = 0;
- shared_dirty = 0;
- private_clean = 0;
- private_dirty = 0;
- swapped_out = 0;
- swapped_out_pss = 0;
-
- while (true) {
- if (fgets(line, 1024, fp) == 0) {
- done = true;
- break;
- }
-
- if (line[0] == 'S' && sscanf(line, "Size: %d kB", &temp) == 1) {
- /* size = temp; */
- } else if (line[0] == 'R' && sscanf(line, "Rss: %d kB", &temp) == 1) {
- rss = temp;
- } else if (line[0] == 'P' && sscanf(line, "Pss: %d kB", &temp) == 1) {
- pss = temp;
- } else if (line[0] == 'S' && sscanf(line, "Shared_Clean: %d kB", &temp) == 1) {
- shared_clean = temp;
- } else if (line[0] == 'S' && sscanf(line, "Shared_Dirty: %d kB", &temp) == 1) {
- shared_dirty = temp;
- } else if (line[0] == 'P' && sscanf(line, "Private_Clean: %d kB", &temp) == 1) {
- private_clean = temp;
- } else if (line[0] == 'P' && sscanf(line, "Private_Dirty: %d kB", &temp) == 1) {
- private_dirty = temp;
- } else if (line[0] == 'R' && sscanf(line, "Referenced: %d kB", &temp) == 1) {
- /* referenced = temp; */
- } else if (line[0] == 'S' && sscanf(line, "Swap: %d kB", &temp) == 1) {
- swapped_out = temp;
- } else if (line[0] == 'S' && sscanf(line, "SwapPss: %d kB", &temp) == 1) {
- *foundSwapPss = true;
- swapped_out_pss = temp;
- } else if (sscanf(line, "%" SCNx64 "-%" SCNx64 " %*s %*x %*x:%*x %*d", &start, &end) == 2) {
- // looks like a new mapping
- // example: "10000000-10001000 ---p 10000000 00:00 0"
- break;
- }
- }
-
- if (!skip) {
- if (is_swappable && (pss > 0)) {
- sharing_proportion = 0.0;
- if ((shared_clean > 0) || (shared_dirty > 0)) {
- sharing_proportion = (pss - private_clean
- - private_dirty)/(shared_clean+shared_dirty);
- }
- swappable_pss = (sharing_proportion*shared_clean) + private_clean;
- } else
- swappable_pss = 0;
-
- stats[whichHeap].pss += pss;
- stats[whichHeap].swappablePss += swappable_pss;
- stats[whichHeap].rss += rss;
- stats[whichHeap].privateDirty += private_dirty;
- stats[whichHeap].sharedDirty += shared_dirty;
- stats[whichHeap].privateClean += private_clean;
- stats[whichHeap].sharedClean += shared_clean;
- stats[whichHeap].swappedOut += swapped_out;
- stats[whichHeap].swappedOutPss += swapped_out_pss;
- if (whichHeap == HEAP_DALVIK || whichHeap == HEAP_DALVIK_OTHER ||
- whichHeap == HEAP_DEX || whichHeap == HEAP_ART) {
- stats[subHeap].pss += pss;
- stats[subHeap].swappablePss += swappable_pss;
- stats[subHeap].rss += rss;
- stats[subHeap].privateDirty += private_dirty;
- stats[subHeap].sharedDirty += shared_dirty;
- stats[subHeap].privateClean += private_clean;
- stats[subHeap].sharedClean += shared_clean;
- stats[subHeap].swappedOut += swapped_out;
- stats[subHeap].swappedOutPss += swapped_out_pss;
- }
- }
- }
-}
-
static void load_maps(int pid, stats_t* stats, bool* foundSwapPss)
{
*foundSwapPss = false;
+ uint64_t prev_end = 0;
+ int prev_heap = HEAP_UNKNOWN;
std::string smaps_path = base::StringPrintf("/proc/%d/smaps", pid);
- UniqueFile fp = MakeUniqueFile(smaps_path.c_str(), "re");
- if (fp == nullptr) return;
+ auto vma_scan = [&](const meminfo::Vma& vma) {
+ int which_heap = HEAP_UNKNOWN;
+ int sub_heap = HEAP_UNKNOWN;
+ bool is_swappable = false;
+ std::string name;
+ if (base::EndsWith(vma.name, " (deleted)")) {
+ name = vma.name.substr(0, vma.name.size() - strlen(" (deleted)"));
+ } else {
+ name = vma.name;
+ }
- read_mapinfo(fp.get(), stats, foundSwapPss);
+ uint32_t namesz = name.size();
+ if (base::StartsWith(name, "[heap]")) {
+ which_heap = HEAP_NATIVE;
+ } else if (base::StartsWith(name, "[anon:libc_malloc]")) {
+ which_heap = HEAP_NATIVE;
+ } else if (base::StartsWith(name, "[stack")) {
+ which_heap = HEAP_NATIVE;
+ } else if (base::EndsWith(name, ".so")) {
+ which_heap = HEAP_SO;
+ is_swappable = true;
+ } else if (base::EndsWith(name, ".jar")) {
+ which_heap = HEAP_JAR;
+ is_swappable = true;
+ } else if (base::EndsWith(name, ".apk")) {
+ which_heap = HEAP_APK;
+ is_swappable = true;
+ } else if (base::EndsWith(name, ".ttf")) {
+ which_heap = HEAP_TTF;
+ is_swappable = true;
+ } else if ((base::EndsWith(name, ".odex")) ||
+ (namesz > 4 && strstr(name.c_str(), ".dex") != nullptr)) {
+ which_heap = HEAP_DEX;
+ sub_heap = HEAP_DEX_APP_DEX;
+ is_swappable = true;
+ } else if (base::EndsWith(name, ".vdex")) {
+ which_heap = HEAP_DEX;
+ // Handle system@framework@boot and system/framework/boot
+ if ((strstr(name.c_str(), "@boot") != nullptr) ||
+ (strstr(name.c_str(), "/boot"))) {
+ sub_heap = HEAP_DEX_BOOT_VDEX;
+ } else {
+ sub_heap = HEAP_DEX_APP_VDEX;
+ }
+ is_swappable = true;
+ } else if (base::EndsWith(name, ".oat")) {
+ which_heap = HEAP_OAT;
+ is_swappable = true;
+ } else if (base::EndsWith(name, ".art")) {
+ which_heap = HEAP_ART;
+ // Handle system@framework@boot* and system/framework/boot*
+ if ((strstr(name.c_str(), "@boot") != nullptr) ||
+ (strstr(name.c_str(), "/boot"))) {
+ sub_heap = HEAP_DEX_BOOT_VDEX;
+ } else {
+ sub_heap = HEAP_DEX_APP_VDEX;
+ }
+ is_swappable = true;
+ } else if (base::StartsWith(name, "/dev/")) {
+ which_heap = HEAP_UNKNOWN_DEV;
+ if (base::StartsWith(name, "/dev/kgsl-3d0")) {
+ which_heap = HEAP_GL_DEV;
+ } else if (base::StartsWith(name, "/dev/ashmem/CursorWindow")) {
+ which_heap = HEAP_CURSOR;
+ } else if (base::StartsWith(name, "/dev/ashmem")) {
+ which_heap = HEAP_ASHMEM;
+ }
+ } else if (base::StartsWith(name, "[anon:")) {
+ which_heap = HEAP_UNKNOWN;
+ if (base::StartsWith(name, "[anon:dalvik-")) {
+ which_heap = HEAP_DALVIK_OTHER;
+ if (base::StartsWith(name, "[anon:dalvik-LinearAlloc")) {
+ sub_heap = HEAP_DALVIK_OTHER_LINEARALLOC;
+ } else if (base::StartsWith(name, "[anon:dalvik-alloc space") ||
+ base::StartsWith(name, "[anon:dalvik-main space")) {
+ // This is the regular Dalvik heap.
+ which_heap = HEAP_DALVIK;
+ sub_heap = HEAP_DALVIK_NORMAL;
+ } else if (base::StartsWith(name,
+ "[anon:dalvik-large object space") ||
+ base::StartsWith(
+ name, "[anon:dalvik-free list large object space")) {
+ which_heap = HEAP_DALVIK;
+ sub_heap = HEAP_DALVIK_LARGE;
+ } else if (base::StartsWith(name, "[anon:dalvik-non moving space")) {
+ which_heap = HEAP_DALVIK;
+ sub_heap = HEAP_DALVIK_NON_MOVING;
+ } else if (base::StartsWith(name, "[anon:dalvik-zygote space")) {
+ which_heap = HEAP_DALVIK;
+ sub_heap = HEAP_DALVIK_ZYGOTE;
+ } else if (base::StartsWith(name, "[anon:dalvik-indirect ref")) {
+ sub_heap = HEAP_DALVIK_OTHER_INDIRECT_REFERENCE_TABLE;
+ } else if (base::StartsWith(name, "[anon:dalvik-jit-code-cache") ||
+ base::StartsWith(name, "[anon:dalvik-data-code-cache")) {
+ sub_heap = HEAP_DALVIK_OTHER_CODE_CACHE;
+ } else if (base::StartsWith(name, "[anon:dalvik-CompilerMetadata")) {
+ sub_heap = HEAP_DALVIK_OTHER_COMPILER_METADATA;
+ } else {
+ sub_heap = HEAP_DALVIK_OTHER_ACCOUNTING; // Default to accounting.
+ }
+ }
+ } else if (namesz > 0) {
+ which_heap = HEAP_UNKNOWN_MAP;
+ } else if (vma.start == prev_end && prev_heap == HEAP_SO) {
+ // bss section of a shared library
+ which_heap = HEAP_SO;
+ }
+
+ prev_end = vma.end;
+ prev_heap = which_heap;
+
+ const meminfo::MemUsage& usage = vma.usage;
+ if (usage.swap_pss > 0 && *foundSwapPss != true) {
+ *foundSwapPss = true;
+ }
+
+ uint64_t swapable_pss = 0;
+ if (is_swappable && (usage.pss > 0)) {
+ float sharing_proportion = 0.0;
+ if ((usage.shared_clean > 0) || (usage.shared_dirty > 0)) {
+ sharing_proportion = (usage.pss - usage.uss) / (usage.shared_clean + usage.shared_dirty);
+ }
+ swapable_pss = (sharing_proportion * usage.shared_clean) + usage.private_clean;
+ }
+
+ stats[which_heap].pss += usage.pss;
+ stats[which_heap].swappablePss += swapable_pss;
+ stats[which_heap].rss += usage.rss;
+ stats[which_heap].privateDirty += usage.private_dirty;
+ stats[which_heap].sharedDirty += usage.shared_dirty;
+ stats[which_heap].privateClean += usage.private_clean;
+ stats[which_heap].sharedClean += usage.shared_clean;
+ stats[which_heap].swappedOut += usage.swap;
+ stats[which_heap].swappedOutPss += usage.swap_pss;
+ if (which_heap == HEAP_DALVIK || which_heap == HEAP_DALVIK_OTHER ||
+ which_heap == HEAP_DEX || which_heap == HEAP_ART) {
+ stats[sub_heap].pss += usage.pss;
+ stats[sub_heap].swappablePss += swapable_pss;
+ stats[sub_heap].rss += usage.rss;
+ stats[sub_heap].privateDirty += usage.private_dirty;
+ stats[sub_heap].sharedDirty += usage.shared_dirty;
+ stats[sub_heap].privateClean += usage.private_clean;
+ stats[sub_heap].sharedClean += usage.shared_clean;
+ stats[sub_heap].swappedOut += usage.swap;
+ stats[sub_heap].swappedOutPss += usage.swap_pss;
+ }
+ };
+
+ meminfo::ForEachVmaFromFile(smaps_path, vma_scan);
}
static void android_os_Debug_getDirtyPagesPid(JNIEnv *env, jobject clazz,
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 5995640..44b2c31 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -705,6 +705,9 @@
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
<bool name="config_automatic_brightness_available">false</bool>
+ <!-- Flag indicating whether we should enable the adaptive sleep.-->
+ <bool name="config_adaptive_sleep_available">false</bool>
+
<!-- Flag indicating whether we should enable smart battery. -->
<bool name="config_smart_battery_available">false</bool>
@@ -931,6 +934,10 @@
in hardware. -->
<bool name="config_setColorTransformAccelerated">false</bool>
+ <!-- Boolean indicating whether the HWC setColorTransform function can be performed efficiently
+ in hardware for individual layers. -->
+ <bool name="config_setColorTransformAcceleratedPerLayer">false</bool>
+
<!-- Control whether Night display is available. This should only be enabled on devices
that have a HWC implementation that can apply the matrix passed to setColorTransform
without impacting power, performance, and app compatibility (e.g. protected content). -->
@@ -1743,6 +1750,19 @@
config_enableGeofenceOverlay is false. -->
<string name="config_geofenceProviderPackageName" translatable="false">@null</string>
+ <!-- Whether to enable Hardware Activity-Recognition overlay which allows Hardware
+ Activity-Recognition to be replaced by an app at run-time. When disabled, only the
+ config_activityRecognitionHardwarePackageName package will be searched for
+ its implementation, otherwise packages whose signature matches the
+ signatures of config_locationProviderPackageNames will be searched, and
+ the service with the highest version number will be picked. Anyone who
+ wants to disable the overlay mechanism can set it to false.
+ -->
+ <bool name="config_enableActivityRecognitionHardwareOverlay" translatable="false">true</bool>
+ <!-- Package name providing Hardware Activity-Recognition API support. Used only when
+ config_enableActivityRecognitionHardwareOverlay is false. -->
+ <string name="config_activityRecognitionHardwarePackageName" translatable="false">@null</string>
+
<!-- Package name(s) containing location provider support.
These packages can contain services implementing location providers,
such as the Geocode Provider, Network Location Provider, and
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 53c33a3..11fc66a 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1845,6 +1845,7 @@
<java-symbol type="array" name="config_defaultNotificationVibePattern" />
<java-symbol type="array" name="config_notificationFallbackVibePattern" />
<java-symbol type="bool" name="config_useAttentionLight" />
+ <java-symbol type="bool" name="config_adaptive_sleep_available" />
<java-symbol type="bool" name="config_animateScreenLights" />
<java-symbol type="bool" name="config_automatic_brightness_available" />
<java-symbol type="bool" name="config_smart_battery_available" />
@@ -1853,6 +1854,7 @@
<java-symbol type="bool" name="config_enableNightMode" />
<java-symbol type="bool" name="config_tintNotificationActionButtons" />
<java-symbol type="bool" name="config_dozeAfterScreenOffByDefault" />
+ <java-symbol type="bool" name="config_enableActivityRecognitionHardwareOverlay" />
<java-symbol type="bool" name="config_enableFusedLocationOverlay" />
<java-symbol type="bool" name="config_enableHardwareFlpOverlay" />
<java-symbol type="bool" name="config_enableGeocoderOverlay" />
@@ -2021,6 +2023,7 @@
<java-symbol type="string" name="car_mode_disable_notification_title" />
<java-symbol type="string" name="chooser_wallpaper" />
<java-symbol type="string" name="config_datause_iface" />
+ <java-symbol type="string" name="config_activityRecognitionHardwarePackageName" />
<java-symbol type="string" name="config_fusedLocationProviderPackageName" />
<java-symbol type="string" name="config_hardwareFlpPackageName" />
<java-symbol type="string" name="config_geocoderProviderPackageName" />
@@ -3031,6 +3034,7 @@
<java-symbol type="drawable" name="ic_doc_generic" />
<java-symbol type="bool" name="config_setColorTransformAccelerated" />
+ <java-symbol type="bool" name="config_setColorTransformAcceleratedPerLayer" />
<java-symbol type="bool" name="config_displayWhiteBalanceAvailable" />
<java-symbol type="bool" name="config_nightDisplayAvailable" />
<java-symbol type="bool" name="config_allowDisablingAssistDisclosure" />
diff --git a/core/tests/coretests/src/android/view/InsetsStateTest.java b/core/tests/coretests/src/android/view/InsetsStateTest.java
index 9857b7a..2db2f5f 100644
--- a/core/tests/coretests/src/android/view/InsetsStateTest.java
+++ b/core/tests/coretests/src/android/view/InsetsStateTest.java
@@ -60,7 +60,7 @@
mState.getSource(TYPE_IME).setVisible(true);
SparseIntArray typeSideMap = new SparseIntArray();
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), false, false,
- DisplayCutout.NO_CUTOUT, typeSideMap);
+ DisplayCutout.NO_CUTOUT, null, null, typeSideMap);
assertEquals(Insets.of(0, 100, 0, 100), insets.getSystemWindowInsets());
assertEquals(Insets.of(0, 100, 0, 100), insets.getInsets(Type.all()));
assertEquals(INSET_SIDE_TOP, typeSideMap.get(TYPE_TOP_BAR));
@@ -76,7 +76,7 @@
mState.getSource(TYPE_IME).setFrame(new Rect(0, 100, 100, 300));
mState.getSource(TYPE_IME).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), false, false,
- DisplayCutout.NO_CUTOUT, null);
+ DisplayCutout.NO_CUTOUT, null, null, null);
assertEquals(100, insets.getStableInsetBottom());
assertEquals(Insets.of(0, 0, 0, 100), insets.getMaxInsets(Type.all()));
assertEquals(Insets.of(0, 0, 0, 200), insets.getSystemWindowInsets());
@@ -92,7 +92,7 @@
mState.getSource(TYPE_NAVIGATION_BAR).setFrame(new Rect(80, 0, 100, 300));
mState.getSource(TYPE_NAVIGATION_BAR).setVisible(true);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), false, false,
- DisplayCutout.NO_CUTOUT, null);
+ DisplayCutout.NO_CUTOUT, null, null, null);
assertEquals(Insets.of(0, 100, 20, 0), insets.getSystemWindowInsets());
assertEquals(Insets.of(0, 100, 0, 0), insets.getInsets(Type.topBar()));
assertEquals(Insets.of(0, 0, 20, 0), insets.getInsets(Type.sideBars()));
@@ -106,7 +106,7 @@
mState.getSource(TYPE_IME).setVisible(true);
mState.removeSource(TYPE_IME);
WindowInsets insets = mState.calculateInsets(new Rect(0, 0, 100, 300), false, false,
- DisplayCutout.NO_CUTOUT, null);
+ DisplayCutout.NO_CUTOUT, null, null, null);
assertEquals(0, insets.getSystemWindowInsetBottom());
}
diff --git a/core/tests/coretests/src/android/view/WindowInsetsTest.java b/core/tests/coretests/src/android/view/WindowInsetsTest.java
index 15a96a1..d57fa8f 100644
--- a/core/tests/coretests/src/android/view/WindowInsetsTest.java
+++ b/core/tests/coretests/src/android/view/WindowInsetsTest.java
@@ -18,7 +18,7 @@
import static android.view.WindowInsets.Type.ime;
import static android.view.WindowInsets.Type.sideBars;
-
+import static android.view.WindowInsets.Type.topBar;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -54,6 +54,7 @@
assertTrue(new WindowInsets((Rect) null).isConsumed());
}
+ // TODO: Move this to CTS once API made public
@Test
public void typeMap() {
Builder b = new WindowInsets.Builder();
@@ -62,4 +63,14 @@
WindowInsets insets = b.build();
assertEquals(300, insets.getSystemWindowInsets().bottom);
}
+
+ // TODO: Move this to CTS once API made public
+ @Test
+ public void compatInsets() {
+ Builder b = new WindowInsets.Builder();
+ b.setSystemWindowInsets(Insets.of(0, 50, 30, 10));
+ WindowInsets insets = b.build();
+ assertEquals(Insets.of(0, 50, 0, 0), insets.getInsets(topBar()));
+ assertEquals(Insets.of(0, 0, 30, 10), insets.getInsets(sideBars()));
+ }
}
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsCpuTimesTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsCpuTimesTest.java
index 0179ead..9cac7e7 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsCpuTimesTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsCpuTimesTest.java
@@ -43,6 +43,10 @@
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidActiveTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidClusterTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidFreqTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidUserSysTimeReader;
import com.android.internal.util.ArrayUtils;
import org.junit.Before;
@@ -76,13 +80,13 @@
@RunWith(AndroidJUnit4.class)
public class BatteryStatsCpuTimesTest {
@Mock
- KernelUidCpuTimeReader mKernelUidCpuTimeReader;
+ KernelCpuUidUserSysTimeReader mCpuUidUserSysTimeReader;
@Mock
- KernelUidCpuFreqTimeReader mKernelUidCpuFreqTimeReader;
+ KernelCpuUidFreqTimeReader mCpuUidFreqTimeReader;
@Mock
- KernelUidCpuActiveTimeReader mKernelUidCpuActiveTimeReader;
+ KernelCpuUidActiveTimeReader mCpuUidActiveTimeReader;
@Mock
- KernelUidCpuClusterTimeReader mKernelUidCpuClusterTimeReader;
+ KernelCpuUidClusterTimeReader mCpuUidClusterTimeReader;
@Mock
BatteryStatsImpl.UserInfoProvider mUserInfoProvider;
@Mock
@@ -98,10 +102,10 @@
mClocks = new MockClocks();
mBatteryStatsImpl = new MockBatteryStatsImpl(mClocks)
- .setKernelUidCpuTimeReader(mKernelUidCpuTimeReader)
- .setKernelUidCpuFreqTimeReader(mKernelUidCpuFreqTimeReader)
- .setKernelUidCpuActiveTimeReader(mKernelUidCpuActiveTimeReader)
- .setKernelUidCpuClusterTimeReader(mKernelUidCpuClusterTimeReader)
+ .setKernelCpuUidUserSysTimeReader(mCpuUidUserSysTimeReader)
+ .setKernelCpuUidFreqTimeReader(mCpuUidFreqTimeReader)
+ .setKernelCpuUidActiveTimeReader(mCpuUidActiveTimeReader)
+ .setKernelCpuUidClusterTimeReader(mCpuUidClusterTimeReader)
.setUserInfoProvider(mUserInfoProvider);
}
@@ -113,21 +117,21 @@
final int numClusters = 3;
initKernelCpuSpeedReaders(numClusters);
final long[] freqs = {1, 12, 123, 12, 1234};
- when(mKernelUidCpuFreqTimeReader.readFreqs(mPowerProfile)).thenReturn(freqs);
+ when(mCpuUidFreqTimeReader.readFreqs(mPowerProfile)).thenReturn(freqs);
// RUN
mBatteryStatsImpl.updateCpuTimeLocked(false, false);
// VERIFY
assertArrayEquals("Unexpected cpu freqs", freqs, mBatteryStatsImpl.getCpuFreqs());
- verify(mKernelUidCpuTimeReader).readDelta(null);
- verify(mKernelUidCpuFreqTimeReader).readDelta(null);
+ verify(mCpuUidUserSysTimeReader).readDelta(null);
+ verify(mCpuUidFreqTimeReader).readDelta(null);
for (int i = 0; i < numClusters; ++i) {
verify(mKernelCpuSpeedReaders[i]).readDelta();
}
// Prepare for next test
- Mockito.reset(mUserInfoProvider, mKernelUidCpuFreqTimeReader, mKernelUidCpuTimeReader);
+ Mockito.reset(mUserInfoProvider, mCpuUidFreqTimeReader, mCpuUidUserSysTimeReader);
for (int i = 0; i < numClusters; ++i) {
Mockito.reset(mKernelCpuSpeedReaders[i]);
}
@@ -140,17 +144,18 @@
// VERIFY
verify(mUserInfoProvider).refreshUserIds();
- verify(mKernelUidCpuTimeReader).readDelta(any(KernelUidCpuTimeReader.Callback.class));
+ verify(mCpuUidUserSysTimeReader).readDelta(
+ any(KernelCpuUidUserSysTimeReader.Callback.class));
// perClusterTimesAvailable is called twice, once in updateCpuTimeLocked() and the other
// in readKernelUidCpuFreqTimesLocked.
- verify(mKernelUidCpuFreqTimeReader, times(2)).perClusterTimesAvailable();
- verify(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
- verify(mKernelUidCpuActiveTimeReader).readDelta(
- any(KernelUidCpuActiveTimeReader.Callback.class));
- verify(mKernelUidCpuClusterTimeReader).readDelta(
- any(KernelUidCpuClusterTimeReader.Callback.class));
- verifyNoMoreInteractions(mKernelUidCpuFreqTimeReader);
+ verify(mCpuUidFreqTimeReader, times(2)).perClusterTimesAvailable();
+ verify(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
+ verify(mCpuUidActiveTimeReader).readDelta(
+ any(KernelCpuUidActiveTimeReader.Callback.class));
+ verify(mCpuUidClusterTimeReader).readDelta(
+ any(KernelCpuUidClusterTimeReader.Callback.class));
+ verifyNoMoreInteractions(mCpuUidFreqTimeReader);
for (int i = 0; i < numClusters; ++i) {
verify(mKernelCpuSpeedReaders[i]).readDelta();
}
@@ -253,13 +258,14 @@
{12, 34}, {34897394, 3123983}, {79775429834l, 8430434903489l}
};
doAnswer(invocation -> {
- final KernelUidCpuTimeReader.Callback callback =
- (KernelUidCpuTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidUserSysTimeReader.Callback<long[]> callback =
+ (KernelCpuUidUserSysTimeReader.Callback<long[]>) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuTime(testUids[i], uidTimesUs[i][0], uidTimesUs[i][1]);
+ callback.onUidCpuTime(testUids[i], uidTimesUs[i]);
}
return null;
- }).when(mKernelUidCpuTimeReader).readDelta(any(KernelUidCpuTimeReader.Callback.class));
+ }).when(mCpuUidUserSysTimeReader).readDelta(
+ any(KernelCpuUidUserSysTimeReader.Callback.class));
// RUN
final SparseLongArray updatedUids = new SparseLongArray();
@@ -287,13 +293,14 @@
{9379, 3332409833484l}, {493247, 723234}, {3247819, 123348}
};
doAnswer(invocation -> {
- final KernelUidCpuTimeReader.Callback callback =
- (KernelUidCpuTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidUserSysTimeReader.Callback<long[]> callback =
+ (KernelCpuUidUserSysTimeReader.Callback<long[]>) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuTime(testUids[i], deltasUs[i][0], deltasUs[i][1]);
+ callback.onUidCpuTime(testUids[i], deltasUs[i]);
}
return null;
- }).when(mKernelUidCpuTimeReader).readDelta(any(KernelUidCpuTimeReader.Callback.class));
+ }).when(mCpuUidUserSysTimeReader).readDelta(
+ any(KernelCpuUidUserSysTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuTimesLocked(null, null, true);
@@ -326,13 +333,14 @@
{12, 34}, {34897394, 3123983}, {79775429834l, 8430434903489l}
};
doAnswer(invocation -> {
- final KernelUidCpuTimeReader.Callback callback =
- (KernelUidCpuTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidUserSysTimeReader.Callback<long[]> callback =
+ (KernelCpuUidUserSysTimeReader.Callback<long[]>) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuTime(testUids[i], uidTimesUs[i][0], uidTimesUs[i][1]);
+ callback.onUidCpuTime(testUids[i], uidTimesUs[i]);
}
return null;
- }).when(mKernelUidCpuTimeReader).readDelta(any(KernelUidCpuTimeReader.Callback.class));
+ }).when(mCpuUidUserSysTimeReader).readDelta(
+ any(KernelCpuUidUserSysTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuTimesLocked(null, null, true);
@@ -350,7 +358,7 @@
assertEquals("Unexpected system cpu time for uid=" + testUids[i],
uidTimesUs[i][1], u.getSystemCpuTimeUs(STATS_SINCE_CHARGED));
}
- verify(mKernelUidCpuTimeReader).removeUid(isolatedUid);
+ verify(mCpuUidUserSysTimeReader).removeUid(isolatedUid);
// Add an isolated uid mapping and repeat the test.
@@ -361,13 +369,14 @@
{9379, 3332409833484l}, {493247, 723234}, {3247819, 123348}
};
doAnswer(invocation -> {
- final KernelUidCpuTimeReader.Callback callback =
- (KernelUidCpuTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidUserSysTimeReader.Callback<long[]> callback =
+ (KernelCpuUidUserSysTimeReader.Callback<long[]>) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuTime(testUids[i], deltasUs[i][0], deltasUs[i][1]);
+ callback.onUidCpuTime(testUids[i], deltasUs[i]);
}
return null;
- }).when(mKernelUidCpuTimeReader).readDelta(any(KernelUidCpuTimeReader.Callback.class));
+ }).when(mCpuUidUserSysTimeReader).readDelta(
+ any(KernelCpuUidUserSysTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuTimesLocked(null, null, true);
@@ -414,15 +423,16 @@
{12, 34}, {34897394, 3123983}, {79775429834l, 8430434903489l}
};
doAnswer(invocation -> {
- final KernelUidCpuTimeReader.Callback callback =
- (KernelUidCpuTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidUserSysTimeReader.Callback<long[]> callback =
+ (KernelCpuUidUserSysTimeReader.Callback<long[]>) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuTime(testUids[i], uidTimesUs[i][0], uidTimesUs[i][1]);
+ callback.onUidCpuTime(testUids[i], uidTimesUs[i]);
}
// And one for the invalid uid
- callback.onUidCpuTime(invalidUid, 3879, 239);
+ callback.onUidCpuTime(invalidUid, new long[]{3879, 239});
return null;
- }).when(mKernelUidCpuTimeReader).readDelta(any(KernelUidCpuTimeReader.Callback.class));
+ }).when(mCpuUidUserSysTimeReader).readDelta(
+ any(KernelCpuUidUserSysTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuTimesLocked(null, null, true);
@@ -438,7 +448,7 @@
}
assertNull("There shouldn't be an entry for invalid uid=" + invalidUid,
mBatteryStatsImpl.getUidStats().get(invalidUid));
- verify(mKernelUidCpuTimeReader).removeUid(invalidUid);
+ verify(mCpuUidUserSysTimeReader).removeUid(invalidUid);
}
@Test
@@ -462,13 +472,14 @@
{12, 34}, {3394, 3123}, {7977, 80434}
};
doAnswer(invocation -> {
- final KernelUidCpuTimeReader.Callback callback =
- (KernelUidCpuTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidUserSysTimeReader.Callback<long[]> callback =
+ (KernelCpuUidUserSysTimeReader.Callback<long[]>) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuTime(testUids[i], uidTimesUs[i][0], uidTimesUs[i][1]);
+ callback.onUidCpuTime(testUids[i], uidTimesUs[i]);
}
return null;
- }).when(mKernelUidCpuTimeReader).readDelta(any(KernelUidCpuTimeReader.Callback.class));
+ }).when(mCpuUidUserSysTimeReader).readDelta(
+ any(KernelCpuUidUserSysTimeReader.Callback.class));
// RUN
final SparseLongArray updatedUids = new SparseLongArray();
@@ -541,14 +552,14 @@
{8, 25, 3, 0, 42}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(null, true, false);
@@ -574,14 +585,14 @@
{43, 3345, 2143, 123, 4554}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], deltasMs[i]);
+ callback.onUidCpuTime(testUids[i], deltasMs[i]);
}
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(null, true, true);
@@ -624,15 +635,15 @@
{8, 25, 3, 0, 42}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
- when(mKernelUidCpuFreqTimeReader.perClusterTimesAvailable()).thenReturn(true);
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
+ when(mCpuUidFreqTimeReader.perClusterTimesAvailable()).thenReturn(true);
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(null, true, false);
@@ -668,14 +679,14 @@
{43, 3345, 2143, 123, 4554}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], deltasMs[i]);
+ callback.onUidCpuTime(testUids[i], deltasMs[i]);
}
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(null, true, true);
@@ -734,15 +745,15 @@
{8, 25, 3, 0, 42}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
- when(mKernelUidCpuFreqTimeReader.perClusterTimesAvailable()).thenReturn(true);
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
+ when(mCpuUidFreqTimeReader.perClusterTimesAvailable()).thenReturn(true);
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(partialTimers, true, false);
@@ -824,14 +835,14 @@
{8, 25, 3, 0, 42}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(null, true, false);
@@ -857,14 +868,14 @@
{43, 3345, 2143, 123, 4554, 9374983794839l, 979875}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], deltasMs[i]);
+ callback.onUidCpuTime(testUids[i], deltasMs[i]);
}
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(null, true, true);
@@ -901,14 +912,14 @@
{8, 25, 3, 0, 42}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(null, true, false);
@@ -927,7 +938,7 @@
assertNull("Unexpected screen-off cpu times for uid=" + testUids[i],
u.getScreenOffCpuFreqTimes(STATS_SINCE_CHARGED));
}
- verify(mKernelUidCpuFreqTimeReader).removeUid(isolatedUid);
+ verify(mCpuUidFreqTimeReader).removeUid(isolatedUid);
// Add an isolated uid mapping and repeat the test.
@@ -941,14 +952,14 @@
{43, 3345, 2143, 123, 4554}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], deltasMs[i]);
+ callback.onUidCpuTime(testUids[i], deltasMs[i]);
}
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(null, true, false);
@@ -996,16 +1007,16 @@
{8, 25, 3, 0, 42}
};
doAnswer(invocation -> {
- final KernelUidCpuFreqTimeReader.Callback callback =
- (KernelUidCpuFreqTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidFreqTimeReader.Callback callback =
+ (KernelCpuUidFreqTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuFreqTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
// And one for the invalid uid
- callback.onUidCpuFreqTime(invalidUid, new long[]{12, 839, 32, 34, 21});
+ callback.onUidCpuTime(invalidUid, new long[]{12, 839, 32, 34, 21});
return null;
- }).when(mKernelUidCpuFreqTimeReader).readDelta(
- any(KernelUidCpuFreqTimeReader.Callback.class));
+ }).when(mCpuUidFreqTimeReader).readDelta(
+ any(KernelCpuUidFreqTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuFreqTimesLocked(null, true, false);
@@ -1022,7 +1033,7 @@
}
assertNull("There shouldn't be an entry for invalid uid=" + invalidUid,
mBatteryStatsImpl.getUidStats().get(invalidUid));
- verify(mKernelUidCpuFreqTimeReader).removeUid(invalidUid);
+ verify(mCpuUidFreqTimeReader).removeUid(invalidUid);
}
@Test
@@ -1039,14 +1050,14 @@
});
final long[] uidTimesMs = {8000, 25000, 3000, 0, 42000};
doAnswer(invocation -> {
- final KernelUidCpuActiveTimeReader.Callback callback =
- (KernelUidCpuActiveTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidActiveTimeReader.Callback callback =
+ (KernelCpuUidActiveTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuActiveTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
return null;
- }).when(mKernelUidCpuActiveTimeReader).readDelta(
- any(KernelUidCpuActiveTimeReader.Callback.class));
+ }).when(mCpuUidActiveTimeReader).readDelta(
+ any(KernelCpuUidActiveTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuActiveTimesLocked(true);
@@ -1065,14 +1076,14 @@
updateTimeBasesLocked(true, Display.STATE_OFF, 0, 0);
final long[] deltasMs = {43000, 3345000, 2143000, 123000, 4554000};
doAnswer(invocation -> {
- final KernelUidCpuActiveTimeReader.Callback callback =
- (KernelUidCpuActiveTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidActiveTimeReader.Callback callback =
+ (KernelCpuUidActiveTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuActiveTime(testUids[i], deltasMs[i]);
+ callback.onUidCpuTime(testUids[i], deltasMs[i]);
}
return null;
- }).when(mKernelUidCpuActiveTimeReader).readDelta(
- any(KernelUidCpuActiveTimeReader.Callback.class));
+ }).when(mCpuUidActiveTimeReader).readDelta(
+ any(KernelCpuUidActiveTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuActiveTimesLocked(true);
@@ -1103,16 +1114,16 @@
});
final long[] uidTimesMs = {8000, 25000, 3000, 0, 42000};
doAnswer(invocation -> {
- final KernelUidCpuActiveTimeReader.Callback callback =
- (KernelUidCpuActiveTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidActiveTimeReader.Callback callback =
+ (KernelCpuUidActiveTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuActiveTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
// And one for the invalid uid
- callback.onUidCpuActiveTime(invalidUid, 1200L);
+ callback.onUidCpuTime(invalidUid, 1200L);
return null;
- }).when(mKernelUidCpuActiveTimeReader).readDelta(
- any(KernelUidCpuActiveTimeReader.Callback.class));
+ }).when(mCpuUidActiveTimeReader).readDelta(
+ any(KernelCpuUidActiveTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuActiveTimesLocked(true);
@@ -1126,7 +1137,7 @@
}
assertNull("There shouldn't be an entry for invalid uid=" + invalidUid,
mBatteryStatsImpl.getUidStats().get(invalidUid));
- verify(mKernelUidCpuActiveTimeReader).removeUid(invalidUid);
+ verify(mCpuUidActiveTimeReader).removeUid(invalidUid);
}
@Test
@@ -1147,14 +1158,14 @@
{8000, 0}
};
doAnswer(invocation -> {
- final KernelUidCpuClusterTimeReader.Callback callback =
- (KernelUidCpuClusterTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidClusterTimeReader.Callback callback =
+ (KernelCpuUidClusterTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuPolicyTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
return null;
- }).when(mKernelUidCpuClusterTimeReader).readDelta(
- any(KernelUidCpuClusterTimeReader.Callback.class));
+ }).when(mCpuUidClusterTimeReader).readDelta(
+ any(KernelCpuUidClusterTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuClusterTimesLocked(true);
@@ -1177,14 +1188,14 @@
{43000, 3345000}
};
doAnswer(invocation -> {
- final KernelUidCpuClusterTimeReader.Callback callback =
- (KernelUidCpuClusterTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidClusterTimeReader.Callback callback =
+ (KernelCpuUidClusterTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuPolicyTime(testUids[i], deltasMs[i]);
+ callback.onUidCpuTime(testUids[i], deltasMs[i]);
}
return null;
- }).when(mKernelUidCpuClusterTimeReader).readDelta(
- any(KernelUidCpuClusterTimeReader.Callback.class));
+ }).when(mCpuUidClusterTimeReader).readDelta(
+ any(KernelCpuUidClusterTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuClusterTimesLocked(true);
@@ -1193,7 +1204,8 @@
for (int i = 0; i < testUids.length; ++i) {
final BatteryStats.Uid u = mBatteryStatsImpl.getUidStats().get(testUids[i]);
assertNotNull("No entry for uid=" + testUids[i], u);
- assertArrayEquals("Unexpected cpu cluster time for uid=" + testUids[i], sum(uidTimesMs[i], deltasMs[i]),
+ assertArrayEquals("Unexpected cpu cluster time for uid=" + testUids[i],
+ sum(uidTimesMs[i], deltasMs[i]),
u.getCpuClusterTimes());
}
}
@@ -1219,16 +1231,16 @@
{8000, 0}
};
doAnswer(invocation -> {
- final KernelUidCpuClusterTimeReader.Callback callback =
- (KernelUidCpuClusterTimeReader.Callback) invocation.getArguments()[0];
+ final KernelCpuUidClusterTimeReader.Callback callback =
+ (KernelCpuUidClusterTimeReader.Callback) invocation.getArguments()[0];
for (int i = 0; i < testUids.length; ++i) {
- callback.onUidCpuPolicyTime(testUids[i], uidTimesMs[i]);
+ callback.onUidCpuTime(testUids[i], uidTimesMs[i]);
}
// And one for the invalid uid
- callback.onUidCpuPolicyTime(invalidUid, new long[] {400, 1000});
+ callback.onUidCpuTime(invalidUid, new long[]{400, 1000});
return null;
- }).when(mKernelUidCpuClusterTimeReader).readDelta(
- any(KernelUidCpuClusterTimeReader.Callback.class));
+ }).when(mCpuUidClusterTimeReader).readDelta(
+ any(KernelCpuUidClusterTimeReader.Callback.class));
// RUN
mBatteryStatsImpl.readKernelUidCpuClusterTimesLocked(true);
@@ -1242,7 +1254,7 @@
}
assertNull("There shouldn't be an entry for invalid uid=" + invalidUid,
mBatteryStatsImpl.getUidStats().get(invalidUid));
- verify(mKernelUidCpuClusterTimeReader).removeUid(invalidUid);
+ verify(mCpuUidClusterTimeReader).removeUid(invalidUid);
}
@Test
@@ -1268,25 +1280,25 @@
mClocks.realtime = mClocks.uptime = 400_000;
mBatteryStatsImpl.clearPendingRemovedUids();
assertEquals(1, mBatteryStatsImpl.getPendingRemovedUids().size());
- verify(mKernelUidCpuActiveTimeReader).removeUid(1);
- verify(mKernelUidCpuActiveTimeReader).removeUidsInRange(5, 10);
- verify(mKernelUidCpuClusterTimeReader).removeUid(1);
- verify(mKernelUidCpuClusterTimeReader).removeUidsInRange(5, 10);
- verify(mKernelUidCpuFreqTimeReader).removeUid(1);
- verify(mKernelUidCpuFreqTimeReader).removeUidsInRange(5, 10);
- verify(mKernelUidCpuTimeReader).removeUid(1);
- verify(mKernelUidCpuTimeReader).removeUidsInRange(5, 10);
+ verify(mCpuUidActiveTimeReader).removeUid(1);
+ verify(mCpuUidActiveTimeReader).removeUidsInRange(5, 10);
+ verify(mCpuUidClusterTimeReader).removeUid(1);
+ verify(mCpuUidClusterTimeReader).removeUidsInRange(5, 10);
+ verify(mCpuUidFreqTimeReader).removeUid(1);
+ verify(mCpuUidFreqTimeReader).removeUidsInRange(5, 10);
+ verify(mCpuUidUserSysTimeReader).removeUid(1);
+ verify(mCpuUidUserSysTimeReader).removeUidsInRange(5, 10);
mClocks.realtime = mClocks.uptime = 800_000;
mBatteryStatsImpl.clearPendingRemovedUids();
assertEquals(0, mBatteryStatsImpl.getPendingRemovedUids().size());
- verify(mKernelUidCpuActiveTimeReader).removeUid(100);
- verify(mKernelUidCpuClusterTimeReader).removeUid(100);
- verify(mKernelUidCpuFreqTimeReader).removeUid(100);
- verify(mKernelUidCpuTimeReader).removeUid(100);
+ verify(mCpuUidActiveTimeReader).removeUid(100);
+ verify(mCpuUidClusterTimeReader).removeUid(100);
+ verify(mCpuUidFreqTimeReader).removeUid(100);
+ verify(mCpuUidUserSysTimeReader).removeUid(100);
- verifyNoMoreInteractions(mKernelUidCpuActiveTimeReader, mKernelUidCpuClusterTimeReader,
- mKernelUidCpuFreqTimeReader, mKernelUidCpuTimeReader);
+ verifyNoMoreInteractions(mCpuUidActiveTimeReader, mCpuUidClusterTimeReader,
+ mCpuUidFreqTimeReader, mCpuUidUserSysTimeReader);
}
private void updateTimeBasesLocked(boolean unplugged, int screenState,
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsImplTest.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsImplTest.java
index dc93675..0771829 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsImplTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsImplTest.java
@@ -39,6 +39,7 @@
import androidx.test.filters.LargeTest;
import androidx.test.runner.AndroidJUnit4;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidFreqTimeReader;
import com.android.internal.util.ArrayUtils;
import org.junit.Before;
@@ -54,7 +55,7 @@
@RunWith(AndroidJUnit4.class)
public class BatteryStatsImplTest {
@Mock
- private KernelUidCpuFreqTimeReader mKernelUidCpuFreqTimeReader;
+ private KernelCpuUidFreqTimeReader mKernelUidCpuFreqTimeReader;
@Mock
private KernelSingleUidTimeReader mKernelSingleUidTimeReader;
@@ -67,7 +68,7 @@
when(mKernelUidCpuFreqTimeReader.allUidTimesAvailable()).thenReturn(true);
when(mKernelSingleUidTimeReader.singleUidCpuTimesAvailable()).thenReturn(true);
mBatteryStatsImpl = new MockBatteryStatsImpl()
- .setKernelUidCpuFreqTimeReader(mKernelUidCpuFreqTimeReader)
+ .setKernelCpuUidFreqTimeReader(mKernelUidCpuFreqTimeReader)
.setKernelSingleUidTimeReader(mKernelSingleUidTimeReader);
}
diff --git a/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java b/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
index d69e1d1..a6329298 100644
--- a/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
+++ b/core/tests/coretests/src/com/android/internal/os/BatteryStatsTests.java
@@ -38,7 +38,6 @@
BatteryStatsTimerTest.class,
BatteryStatsUidTest.class,
BatteryStatsUserLifecycleTests.class,
- KernelCpuProcReaderTest.class,
KernelCpuProcStringReaderTest.class,
KernelCpuUidActiveTimeReaderTest.class,
KernelCpuUidClusterTimeReaderTest.class,
@@ -46,9 +45,6 @@
KernelCpuUidUserSysTimeReaderTest.class,
KernelMemoryBandwidthStatsTest.class,
KernelSingleUidTimeReaderTest.class,
- KernelUidCpuFreqTimeReaderTest.class,
- KernelUidCpuActiveTimeReaderTest.class,
- KernelUidCpuClusterTimeReaderTest.class,
KernelWakelockReaderTest.class,
LongSamplingCounterTest.class,
LongSamplingCounterArrayTest.class,
diff --git a/core/tests/coretests/src/com/android/internal/os/KernelCpuProcReaderTest.java b/core/tests/coretests/src/com/android/internal/os/KernelCpuProcReaderTest.java
deleted file mode 100644
index a25a7489..0000000
--- a/core/tests/coretests/src/com/android/internal/os/KernelCpuProcReaderTest.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2018 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.os;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
-import android.content.Context;
-import android.os.FileUtils;
-import android.os.SystemClock;
-
-import androidx.test.InstrumentationRegistry;
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import java.io.File;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.file.Files;
-import java.util.Arrays;
-import java.util.Random;
-
-/**
- * Test class for {@link KernelCpuProcReader}.
- *
- * $ atest FrameworksCoreTests:com.android.internal.os.KernelCpuProcReaderTest
- */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class KernelCpuProcReaderTest {
-
- private File mRoot;
- private File mTestDir;
- private File mTestFile;
- private Random mRand = new Random();
-
- private KernelCpuProcReader mKernelCpuProcReader;
-
- private Context getContext() {
- return InstrumentationRegistry.getContext();
- }
-
- @Before
- public void setUp() {
- mTestDir = getContext().getDir("test", Context.MODE_PRIVATE);
- mRoot = getContext().getFilesDir();
- mTestFile = new File(mTestDir, "test.file");
- mKernelCpuProcReader = new KernelCpuProcReader(mTestFile.getAbsolutePath());
- }
-
- @After
- public void tearDown() throws Exception {
- FileUtils.deleteContents(mTestDir);
- FileUtils.deleteContents(mRoot);
- }
-
-
- /**
- * Tests that reading will return null if the file does not exist.
- */
- @Test
- public void testReadInvalidFile() throws Exception {
- assertEquals(null, mKernelCpuProcReader.readBytes());
- }
-
- /**
- * Tests that reading will always return null after 5 failures.
- */
- @Test
- public void testReadErrorsLimit() throws Exception {
- mKernelCpuProcReader.setThrottleInterval(0);
- for (int i = 0; i < 3; i++) {
- assertNull(mKernelCpuProcReader.readBytes());
- SystemClock.sleep(50);
- }
-
- final byte[] data = new byte[1024];
- mRand.nextBytes(data);
- try (OutputStream os = Files.newOutputStream(mTestFile.toPath())) {
- os.write(data);
- }
- assertTrue(Arrays.equals(data, toArray(mKernelCpuProcReader.readBytes())));
-
- assertTrue(mTestFile.delete());
- for (int i = 0; i < 3; i++) {
- assertNull(mKernelCpuProcReader.readBytes());
- SystemClock.sleep(50);
- }
- try (OutputStream os = Files.newOutputStream(mTestFile.toPath())) {
- os.write(data);
- }
- assertNull(mKernelCpuProcReader.readBytes());
- }
-
- /**
- * Tests reading functionality.
- */
- @Test
- public void testSimpleRead() throws Exception {
- final byte[] data = new byte[1024];
- mRand.nextBytes(data);
- try (OutputStream os = Files.newOutputStream(mTestFile.toPath())) {
- os.write(data);
- }
- assertTrue(Arrays.equals(data, toArray(mKernelCpuProcReader.readBytes())));
- }
-
- /**
- * Tests multiple reading functionality.
- */
- @Test
- public void testMultipleRead() throws Exception {
- mKernelCpuProcReader.setThrottleInterval(0);
- for (int i = 0; i < 100; i++) {
- final byte[] data = new byte[mRand.nextInt(102400) + 4];
- mRand.nextBytes(data);
- try (OutputStream os = Files.newOutputStream(mTestFile.toPath())) {
- os.write(data);
- }
- assertTrue(Arrays.equals(data, toArray(mKernelCpuProcReader.readBytes())));
- assertTrue(mTestFile.delete());
- }
- }
-
- /**
- * Tests reading with resizing.
- */
- @Test
- public void testReadWithResize() throws Exception {
- final byte[] data = new byte[128001];
- mRand.nextBytes(data);
- try (OutputStream os = Files.newOutputStream(mTestFile.toPath())) {
- os.write(data);
- }
- assertTrue(Arrays.equals(data, toArray(mKernelCpuProcReader.readBytes())));
- }
-
- /**
- * Tests that reading a file over the limit (1MB) will return null.
- */
- @Test
- public void testReadOverLimit() throws Exception {
- final byte[] data = new byte[1228800];
- mRand.nextBytes(data);
- try (OutputStream os = Files.newOutputStream(mTestFile.toPath())) {
- os.write(data);
- }
- assertNull(mKernelCpuProcReader.readBytes());
- }
-
- /**
- * Tests throttling. Deleting underlying file should not affect cache.
- */
- @Test
- public void testThrottle() throws Exception {
- mKernelCpuProcReader.setThrottleInterval(3000);
- final byte[] data = new byte[20001];
- mRand.nextBytes(data);
- try (OutputStream os = Files.newOutputStream(mTestFile.toPath())) {
- os.write(data);
- }
- assertTrue(Arrays.equals(data, toArray(mKernelCpuProcReader.readBytes())));
- assertTrue(mTestFile.delete());
- for (int i = 0; i < 5; i++) {
- assertTrue(Arrays.equals(data, toArray(mKernelCpuProcReader.readBytes())));
- SystemClock.sleep(10);
- }
- SystemClock.sleep(5000);
- assertNull(mKernelCpuProcReader.readBytes());
- }
-
- private byte[] toArray(ByteBuffer buffer) {
- assertNotNull(buffer);
- byte[] arr = new byte[buffer.remaining()];
- buffer.get(arr);
- return arr;
- }
-}
diff --git a/core/tests/coretests/src/com/android/internal/os/KernelCpuProcStringReaderTest.java b/core/tests/coretests/src/com/android/internal/os/KernelCpuProcStringReaderTest.java
index 7a31605..cbd2ba4 100644
--- a/core/tests/coretests/src/com/android/internal/os/KernelCpuProcStringReaderTest.java
+++ b/core/tests/coretests/src/com/android/internal/os/KernelCpuProcStringReaderTest.java
@@ -299,9 +299,10 @@
assertTrue(mTestFile.delete());
try (BufferedWriter w = Files.newBufferedWriter(mTestFile.toPath())) {
w.write(data1);
- modify.countDown();
} catch (Throwable e) {
errs.add(e);
+ } finally {
+ modify.countDown();
}
}, 600, TimeUnit.MILLISECONDS);
diff --git a/core/tests/coretests/src/com/android/internal/os/KernelUidCpuActiveTimeReaderTest.java b/core/tests/coretests/src/com/android/internal/os/KernelUidCpuActiveTimeReaderTest.java
deleted file mode 100644
index 12f6c18..0000000
--- a/core/tests/coretests/src/com/android/internal/os/KernelUidCpuActiveTimeReaderTest.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.os;
-
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.when;
-
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.Random;
-
-/**
- * Test class for {@link KernelUidCpuActiveTimeReader}.
- *
- * To run it:
- * bit FrameworksCoreTests:com.android.internal.os.KernelUidCpuActiveTimeReaderTest
- */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class KernelUidCpuActiveTimeReaderTest {
- @Mock
- private KernelCpuProcReader mProcReader;
- @Mock
- private KernelUidCpuActiveTimeReader.Callback mCallback;
- private KernelUidCpuActiveTimeReader mReader;
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
- mReader = new KernelUidCpuActiveTimeReader(mProcReader);
- mReader.setThrottleInterval(0);
- }
-
- @Test
- public void testReadDelta() {
- final int cores = 8;
- final int[] uids = {1, 22, 333, 4444, 5555};
-
- final long[][] times = increaseTime(new long[uids.length][cores]);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length; i++) {
- verify(mCallback).onUidCpuActiveTime(uids[i], getTotal(times[i]));
- }
- verifyNoMoreInteractions(mCallback);
-
- // Verify that a second call will only return deltas.
- Mockito.reset(mCallback);
- final long[][] times1 = increaseTime(times);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times1));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length; i++) {
- verify(mCallback).onUidCpuActiveTime(uids[i], getTotal(subtract(times1[i], times[i])));
- }
- verifyNoMoreInteractions(mCallback);
-
- // Verify that there won't be a callback if the proc file values didn't change.
- Mockito.reset(mCallback);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times1));
- mReader.readDelta(mCallback);
- verifyNoMoreInteractions(mCallback);
-
- // Verify that calling with a null callback doesn't result in any crashes
- Mockito.reset(mCallback);
- final long[][] times2 = increaseTime(times1);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times2));
- mReader.readDelta(null);
-
- // Verify that the readDelta call will only return deltas when
- // the previous call had null callback.
- Mockito.reset(mCallback);
- final long[][] times3 = increaseTime(times2);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times3));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length; ++i) {
- verify(mCallback).onUidCpuActiveTime(uids[i], getTotal(subtract(times3[i], times2[i])));
- }
- verifyNoMoreInteractions(mCallback);
- }
-
- @Test
- public void testReadAbsolute() {
- final int cores = 8;
- final int[] uids = {1, 22, 333, 4444, 5555};
-
- final long[][] times = increaseTime(new long[uids.length][cores]);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times));
- mReader.readAbsolute(mCallback);
- for (int i = 0; i < uids.length; i++) {
- verify(mCallback).onUidCpuActiveTime(uids[i], getTotal(times[i]));
- }
- verifyNoMoreInteractions(mCallback);
-
- // Verify that a second call still returns absolute values
- Mockito.reset(mCallback);
- final long[][] times1 = increaseTime(times);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times1));
- mReader.readAbsolute(mCallback);
- for (int i = 0; i < uids.length; i++) {
- verify(mCallback).onUidCpuActiveTime(uids[i], getTotal(times1[i]));
- }
- verifyNoMoreInteractions(mCallback);
- }
-
- @Test
- public void testReadDelta_malformedData() {
- final int cores = 8;
- final int[] uids = {1, 22, 333, 4444, 5555};
- final long[][] times = increaseTime(new long[uids.length][cores]);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length; i++) {
- verify(mCallback).onUidCpuActiveTime(uids[i], getTotal(times[i]));
- }
- verifyNoMoreInteractions(mCallback);
-
- // Verify that there is no callback if subsequent call is in wrong format.
- Mockito.reset(mCallback);
- final long[][] times1 = increaseTime(times);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times1).putInt(0, 5));
- mReader.readDelta(mCallback);
- verifyNoMoreInteractions(mCallback);
-
- // Verify that the internal state was not modified if the given core count does not match
- // the following # of entries.
- Mockito.reset(mCallback);
- final long[][] times2 = increaseTime(times);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times2));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length; i++) {
- verify(mCallback).onUidCpuActiveTime(uids[i], getTotal(subtract(times2[i], times[i])));
- }
- verifyNoMoreInteractions(mCallback);
-
- // Verify that there is no callback if any value in the proc file is -ve.
- Mockito.reset(mCallback);
- final long[][] times3 = increaseTime(times2);
- times3[uids.length - 1][cores - 1] *= -1;
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times3));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length - 1; ++i) {
- verify(mCallback).onUidCpuActiveTime(uids[i], getTotal(subtract(times3[i], times2[i])));
- }
- verifyNoMoreInteractions(mCallback);
-
- // Verify that the internal state was not modified when the proc file had -ve value.
- Mockito.reset(mCallback);
- for (int i = 0; i < cores; i++) {
- times3[uids.length - 1][i] = times2[uids.length - 1][i] + uids[uids.length - 1] * 2520;
- }
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times3));
- mReader.readDelta(mCallback);
- verify(mCallback).onUidCpuActiveTime(uids[uids.length - 1],
- getTotal(subtract(times3[uids.length - 1], times2[uids.length - 1])));
- verifyNoMoreInteractions(mCallback);
-
- // Verify that there is no callback if the values in the proc file are decreased.
- Mockito.reset(mCallback);
- final long[][] times4 = increaseTime(times3);
- System.arraycopy(times3[uids.length - 1], 0, times4[uids.length - 1], 0, cores);
- times4[uids.length - 1][cores - 1] -= 100;
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times4));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length - 1; ++i) {
- verify(mCallback).onUidCpuActiveTime(uids[i], getTotal(subtract(times4[i], times3[i])));
- }
- verifyNoMoreInteractions(mCallback);
-
- // Verify that the internal state was not modified when the proc file had decreased values.
- Mockito.reset(mCallback);
- for (int i = 0; i < cores; i++) {
- times4[uids.length - 1][i] = times3[uids.length - 1][i] + uids[uids.length - 1] * 2520;
- }
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times4));
- mReader.readDelta(mCallback);
- verify(mCallback).onUidCpuActiveTime(uids[uids.length - 1],
- getTotal(subtract(times4[uids.length - 1], times3[uids.length - 1])));
- verifyNoMoreInteractions(mCallback);
- }
-
- private long[] subtract(long[] a1, long[] a2) {
- long[] val = new long[a1.length];
- for (int i = 0; i < val.length; ++i) {
- val[i] = a1[i] - a2[i];
- }
- return val;
- }
-
- /**
- * Unit of original and return value is 10ms. What's special about 2520? 2520 is LCM of 1, 2, 3,
- * ..., 10. So that when wedivide shared cpu time by concurrent thread count, we always get a
- * nice integer, avoiding rounding errors.
- */
- private long[][] increaseTime(long[][] original) {
- long[][] newTime = new long[original.length][original[0].length];
- Random rand = new Random();
- for (int i = 0; i < original.length; i++) {
- for (int j = 0; j < original[0].length; j++) {
- newTime[i][j] = original[i][j] + rand.nextInt(1000) * 2520 + 2520;
- }
- }
- return newTime;
- }
-
- // Unit of times is 10ms
- private long getTotal(long[] times) {
- long sum = 0;
- for (int i = 0; i < times.length; i++) {
- sum += times[i] * 10 / (i + 1);
- }
- return sum;
- }
-
- /**
- * Format uids and times (in 10ms) into the following format:
- * [n, uid0, time0a, time0b, ..., time0n,
- * uid1, time1a, time1b, ..., time1n,
- * uid2, time2a, time2b, ..., time2n, etc.]
- * where n is the total number of cpus (num_possible_cpus)
- */
- private ByteBuffer getUidTimesBytes(int[] uids, long[][] times) {
- int size = (1 + uids.length * (times[0].length + 1)) * 4;
- ByteBuffer buf = ByteBuffer.allocate(size);
- buf.order(ByteOrder.nativeOrder());
- buf.putInt(times[0].length);
- for (int i = 0; i < uids.length; i++) {
- buf.putInt(uids[i]);
- for (int j = 0; j < times[i].length; j++) {
- buf.putInt((int) times[i][j]);
- }
- }
- buf.flip();
- return buf.order(ByteOrder.nativeOrder());
- }
-}
diff --git a/core/tests/coretests/src/com/android/internal/os/KernelUidCpuClusterTimeReaderTest.java b/core/tests/coretests/src/com/android/internal/os/KernelUidCpuClusterTimeReaderTest.java
deleted file mode 100644
index 532f337..0000000
--- a/core/tests/coretests/src/com/android/internal/os/KernelUidCpuClusterTimeReaderTest.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.os;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.Mockito.when;
-
-import android.util.SparseArray;
-
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.Arrays;
-import java.util.Random;
-
-/**
- * Test class for {@link KernelUidCpuClusterTimeReader}.
- *
- * To run it:
- * bit FrameworksCoreTests:com.android.internal.os.KernelUidCpuClusterTimeReaderTest
- */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class KernelUidCpuClusterTimeReaderTest {
- @Mock
- private KernelCpuProcReader mProcReader;
- private KernelUidCpuClusterTimeReader mReader;
- private VerifiableCallback mCallback;
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
- mReader = new KernelUidCpuClusterTimeReader(mProcReader);
- mCallback = new VerifiableCallback();
- mReader.setThrottleInterval(0);
- }
-
- @Test
- public void testReadDelta() throws Exception {
- VerifiableCallback cb = new VerifiableCallback();
- final int cores = 6;
- final int[] clusters = {2, 4};
- final int[] uids = {1, 22, 333, 4444, 5555};
-
- // Verify initial call
- final long[][] times = increaseTime(new long[uids.length][cores]);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times));
- mReader.readDelta(cb);
- for (int i = 0; i < uids.length; i++) {
- cb.verify(uids[i], getTotal(clusters, times[i]));
- }
- cb.verifyNoMoreInteractions();
-
- // Verify that a second call will only return deltas.
- cb.clear();
- Mockito.reset(mProcReader);
- final long[][] times1 = increaseTime(times);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times1));
- mReader.readDelta(cb);
- for (int i = 0; i < uids.length; i++) {
- cb.verify(uids[i], getTotal(clusters, subtract(times1[i], times[i])));
- }
- cb.verifyNoMoreInteractions();
-
- // Verify that there won't be a callback if the proc file values didn't change.
- cb.clear();
- Mockito.reset(mProcReader);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times1));
- mReader.readDelta(cb);
- cb.verifyNoMoreInteractions();
-
- // Verify that calling with a null callback doesn't result in any crashes
- Mockito.reset(mProcReader);
- final long[][] times2 = increaseTime(times1);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times2));
- mReader.readDelta(null);
-
- // Verify that the readDelta call will only return deltas when
- // the previous call had null callback.
- cb.clear();
- Mockito.reset(mProcReader);
- final long[][] times3 = increaseTime(times2);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times3));
- mReader.readDelta(cb);
- for (int i = 0; i < uids.length; i++) {
- cb.verify(uids[i], getTotal(clusters, subtract(times3[i], times2[i])));
- }
- cb.verifyNoMoreInteractions();
-
- }
-
- @Test
- public void testReadAbsolute() throws Exception {
- VerifiableCallback cb = new VerifiableCallback();
- final int cores = 6;
- final int[] clusters = {2, 4};
- final int[] uids = {1, 22, 333, 4444, 5555};
-
- // Verify return absolute value
- final long[][] times = increaseTime(new long[uids.length][cores]);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times));
- mReader.readAbsolute(cb);
- for (int i = 0; i < uids.length; i++) {
- cb.verify(uids[i], getTotal(clusters, times[i]));
- }
- cb.verifyNoMoreInteractions();
-
- // Verify that a second call should return the same absolute value
- cb.clear();
- Mockito.reset(mProcReader);
- final long[][] times1 = increaseTime(times);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times1));
- mReader.readAbsolute(cb);
- for (int i = 0; i < uids.length; i++) {
- cb.verify(uids[i], getTotal(clusters, times1[i]));
- }
- cb.verifyNoMoreInteractions();
- }
-
- @Test
- public void testReadDelta_malformedData() throws Exception {
- final int cores = 6;
- final int[] clusters = {2, 4};
- final int[] uids = {1, 22, 333, 4444, 5555};
-
- // Verify initial call
- final long[][] times = increaseTime(new long[uids.length][cores]);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length; i++) {
- mCallback.verify(uids[i], getTotal(clusters, times[i]));
- }
- mCallback.verifyNoMoreInteractions();
-
- // Verify that there is no callback if a call has wrong format
- mCallback.clear();
- Mockito.reset(mProcReader);
- final long[][] temp = increaseTime(times);
- final long[][] times1 = new long[uids.length][];
- for (int i = 0; i < temp.length; i++) {
- times1[i] = Arrays.copyOfRange(temp[i], 0, 4);
- }
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times1));
- mReader.readDelta(mCallback);
- mCallback.verifyNoMoreInteractions();
-
- // Verify that the internal state was not modified if the given core count does not match
- // the following # of entries.
- mCallback.clear();
- Mockito.reset(mProcReader);
- final long[][] times2 = increaseTime(times);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times2));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length; i++) {
- mCallback.verify(uids[i], getTotal(clusters, subtract(times2[i], times[i])));
- }
- mCallback.verifyNoMoreInteractions();
-
- // Verify that there is no callback if any value in the proc file is -ve.
- mCallback.clear();
- Mockito.reset(mProcReader);
- final long[][] times3 = increaseTime(times2);
- times3[uids.length - 1][cores - 1] *= -1;
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times3));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length - 1; i++) {
- mCallback.verify(uids[i], getTotal(clusters, subtract(times3[i], times2[i])));
- }
- mCallback.verifyNoMoreInteractions();
-
- // Verify that the internal state was not modified when the proc file had -ve value.
- mCallback.clear();
- Mockito.reset(mProcReader);
- for (int i = 0; i < cores; i++) {
- times3[uids.length - 1][i] = times2[uids.length - 1][i] + uids[uids.length - 1] * 2520;
- }
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times3));
- mReader.readDelta(mCallback);
- mCallback.verify(uids[uids.length - 1],
- getTotal(clusters, subtract(times3[uids.length - 1], times2[uids.length - 1])));
-
- // Verify that there is no callback if the values in the proc file are decreased.
- mCallback.clear();
- Mockito.reset(mProcReader);
- final long[][] times4 = increaseTime(times3);
- System.arraycopy(times3[uids.length - 1], 0, times4[uids.length - 1], 0, cores);
- times4[uids.length - 1][cores - 1] -= 100;
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times4));
- mReader.readDelta(mCallback);
- for (int i = 0; i < uids.length - 1; i++) {
- mCallback.verify(uids[i], getTotal(clusters, subtract(times4[i], times3[i])));
- }
- mCallback.verifyNoMoreInteractions();
-
- // Verify that the internal state was not modified when the proc file had decreased values.
- mCallback.clear();
- Mockito.reset(mProcReader);
- for (int i = 0; i < cores; i++) {
- times4[uids.length - 1][i] = times3[uids.length - 1][i] + uids[uids.length - 1] * 2520;
- }
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, clusters, times4));
- mReader.readDelta(mCallback);
- mCallback.verify(uids[uids.length - 1],
- getTotal(clusters, subtract(times3[uids.length - 1], times2[uids.length - 1])));
- mCallback.verifyNoMoreInteractions();
- }
-
-
- private long[] subtract(long[] a1, long[] a2) {
- long[] val = new long[a1.length];
- for (int i = 0; i < val.length; ++i) {
- val[i] = a1[i] - a2[i];
- }
- return val;
- }
-
- /**
- * Unit is 10ms. What's special about 2520? 2520 is LCM of 1, 2, 3, ..., 10. So that when we
- * divide shared cpu time by concurrent thread count, we always get a nice integer, avoiding
- * rounding errors.
- */
- private long[][] increaseTime(long[][] original) {
- long[][] newTime = new long[original.length][original[0].length];
- Random rand = new Random();
- for (int i = 0; i < original.length; i++) {
- for (int j = 0; j < original[0].length; j++) {
- newTime[i][j] = original[i][j] + rand.nextInt(1000) * 2520 + 2520;
- }
- }
- return newTime;
- }
-
- // Format an array of cluster times according to the algorithm in KernelUidCpuClusterTimeReader
- private long[] getTotal(int[] cluster, long[] times) {
- int core = 0;
- long[] sumTimes = new long[cluster.length];
- for (int i = 0; i < cluster.length; i++) {
- double sum = 0;
- for (int j = 0; j < cluster[i]; j++) {
- sum += (double) times[core++] * 10 / (j + 1);
- }
- sumTimes[i] = (long) sum;
- }
- return sumTimes;
- }
-
- private class VerifiableCallback implements KernelUidCpuClusterTimeReader.Callback {
-
- SparseArray<long[]> mData = new SparseArray<>();
- int count = 0;
-
- public void verify(int uid, long[] cpuClusterTimeMs) {
- long[] array = mData.get(uid);
- assertNotNull(array);
- assertArrayEquals(cpuClusterTimeMs, array);
- count++;
- }
-
- public void clear() {
- mData.clear();
- count = 0;
- }
-
- @Override
- public void onUidCpuPolicyTime(int uid, long[] cpuClusterTimeMs) {
- long[] array = new long[cpuClusterTimeMs.length];
- System.arraycopy(cpuClusterTimeMs, 0, array, 0, array.length);
- mData.put(uid, array);
- }
-
- public void verifyNoMoreInteractions() {
- assertEquals(mData.size(), count);
- }
- }
-
- /**
- * Format uids and times (in 10ms) into the following format:
- * [n, x0, ..., xn, uid0, time0a, time0b, ..., time0n,
- * uid1, time1a, time1b, ..., time1n,
- * uid2, time2a, time2b, ..., time2n, etc.]
- * where n is the number of policies
- * xi is the number cpus on a particular policy
- */
- private ByteBuffer getUidTimesBytes(int[] uids, int[] clusters, long[][] times) {
- int size = (1 + clusters.length + uids.length * (times[0].length + 1)) * 4;
- ByteBuffer buf = ByteBuffer.allocate(size);
- buf.order(ByteOrder.nativeOrder());
- buf.putInt(clusters.length);
- for (int i = 0; i < clusters.length; i++) {
- buf.putInt(clusters[i]);
- }
- for (int i = 0; i < uids.length; i++) {
- buf.putInt(uids[i]);
- for (int j = 0; j < times[i].length; j++) {
- buf.putInt((int) (times[i][j]));
- }
- }
- buf.flip();
- return buf.order(ByteOrder.nativeOrder());
- }
-}
diff --git a/core/tests/coretests/src/com/android/internal/os/KernelUidCpuFreqTimeReaderTest.java b/core/tests/coretests/src/com/android/internal/os/KernelUidCpuFreqTimeReaderTest.java
deleted file mode 100644
index 6d2980b..0000000
--- a/core/tests/coretests/src/com/android/internal/os/KernelUidCpuFreqTimeReaderTest.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.os;
-
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.verifyZeroInteractions;
-import static org.mockito.Mockito.when;
-
-import android.util.SparseArray;
-
-import androidx.test.filters.SmallTest;
-import androidx.test.runner.AndroidJUnit4;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.Mockito;
-import org.mockito.MockitoAnnotations;
-
-import java.io.BufferedReader;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.util.Arrays;
-
-/**
- * Test class for {@link KernelUidCpuFreqTimeReader}.
- *
- * To run the tests, use
- *
- * runtest -c com.android.internal.os.KernelUidCpuFreqTimeReaderTest frameworks-core
- *
- * or the following steps:
- *
- * Build: m FrameworksCoreTests
- * Install: adb install -r \
- * ${ANDROID_PRODUCT_OUT}/data/app/FrameworksCoreTests/FrameworksCoreTests.apk
- * Run: adb shell am instrument -e class com.android.internal.os.KernelUidCpuFreqTimeReaderTest -w \
- * com.android.frameworks.coretests/androidx.test.runner.AndroidJUnitRunner
- *
- * or
- *
- * bit FrameworksCoreTests:com.android.internal.os.KernelUidCpuFreqTimeReaderTest
- */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public class KernelUidCpuFreqTimeReaderTest {
- @Mock
- private BufferedReader mBufferedReader;
- @Mock
- private KernelUidCpuFreqTimeReader.Callback mCallback;
- @Mock
- private PowerProfile mPowerProfile;
- @Mock
- private KernelCpuProcReader mProcReader;
-
- private KernelUidCpuFreqTimeReader mKernelUidCpuFreqTimeReader;
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
- mKernelUidCpuFreqTimeReader = new KernelUidCpuFreqTimeReader(mProcReader);
- mKernelUidCpuFreqTimeReader.setThrottleInterval(0);
- }
-
- @Test
- public void testReadFreqs_perClusterTimesNotAvailable() throws Exception {
- final long[][] freqs = {
- {1, 12, 123, 1234},
- {1, 12, 123, 23, 123, 1234, 12345, 123456},
- {1, 12, 123, 23, 123, 1234, 12345, 123456, 12, 123, 12345},
- {1, 12, 123, 23, 2345, 234567}
- };
- final int[] numClusters = {2, 2, 3, 1};
- final int[][] numFreqs = {{3, 6}, {4, 5}, {3, 5, 4}, {3}};
- for (int i = 0; i < freqs.length; ++i) {
- setCpuClusterFreqs(numClusters[i], numFreqs[i]);
- when(mBufferedReader.readLine()).thenReturn(getFreqsLine(freqs[i]));
- long[] actualFreqs = mKernelUidCpuFreqTimeReader.readFreqs(
- mBufferedReader, mPowerProfile);
- assertArrayEquals(freqs[i], actualFreqs);
- verifyZeroInteractions(mCallback);
- final String errMsg = String.format("Freqs=%s, nClusters=%d, nFreqs=%s",
- Arrays.toString(freqs[i]), numClusters[i], Arrays.toString(numFreqs[i]));
- assertFalse(errMsg, mKernelUidCpuFreqTimeReader.perClusterTimesAvailable());
-
- // Verify that a second call won't read the proc file again
- Mockito.reset(mBufferedReader);
- actualFreqs = mKernelUidCpuFreqTimeReader.readFreqs(mPowerProfile);
- assertArrayEquals(freqs[i], actualFreqs);
- assertFalse(errMsg, mKernelUidCpuFreqTimeReader.perClusterTimesAvailable());
-
- // Prepare for next iteration
- Mockito.reset(mBufferedReader, mPowerProfile);
- }
- }
-
- @Test
- public void testReadFreqs_perClusterTimesAvailable() throws Exception {
- final long[][] freqs = {
- {1, 12, 123, 1234},
- {1, 12, 123, 23, 123, 1234, 12345, 123456},
- {1, 12, 123, 23, 123, 1234, 12345, 123456, 12, 123, 12345, 1234567}
- };
- final int[] numClusters = {1, 2, 3};
- final int[][] numFreqs = {{4}, {3, 5}, {3, 5, 4}};
- for (int i = 0; i < freqs.length; ++i) {
- setCpuClusterFreqs(numClusters[i], numFreqs[i]);
- when(mBufferedReader.readLine()).thenReturn(getFreqsLine(freqs[i]));
- long[] actualFreqs = mKernelUidCpuFreqTimeReader.readFreqs(
- mBufferedReader, mPowerProfile);
- assertArrayEquals(freqs[i], actualFreqs);
- verifyZeroInteractions(mCallback);
- final String errMsg = String.format("Freqs=%s, nClusters=%d, nFreqs=%s",
- Arrays.toString(freqs[i]), numClusters[i], Arrays.toString(numFreqs[i]));
- assertTrue(errMsg, mKernelUidCpuFreqTimeReader.perClusterTimesAvailable());
-
- // Verify that a second call won't read the proc file again
- Mockito.reset(mBufferedReader);
- actualFreqs = mKernelUidCpuFreqTimeReader.readFreqs(mPowerProfile);
- assertArrayEquals(freqs[i], actualFreqs);
- assertTrue(errMsg, mKernelUidCpuFreqTimeReader.perClusterTimesAvailable());
-
- // Prepare for next iteration
- Mockito.reset(mBufferedReader, mPowerProfile);
- }
- }
-
- @Test
- public void testReadDelta_Binary() throws Exception {
- VerifiableCallback cb = new VerifiableCallback();
- final long[] freqs = {110, 123, 145, 167, 289, 997};
- final int[] uids = {1, 22, 333, 444, 555};
- final long[][] times = new long[uids.length][freqs.length];
- for (int i = 0; i < uids.length; ++i) {
- for (int j = 0; j < freqs.length; ++j) {
- times[i][j] = uids[i] * freqs[j] * 10;
- }
- }
- when(mBufferedReader.readLine()).thenReturn(getFreqsLine(freqs));
- long[] actualFreqs = mKernelUidCpuFreqTimeReader.readFreqs(mBufferedReader, mPowerProfile);
-
- assertArrayEquals(freqs, actualFreqs);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times));
- mKernelUidCpuFreqTimeReader.readDeltaImpl(cb);
- for (int i = 0; i < uids.length; ++i) {
- cb.verify(uids[i], times[i]);
- }
- cb.verifyNoMoreInteractions();
-
- // Verify that a second call will only return deltas.
- cb.clear();
- Mockito.reset(mProcReader);
- final long[][] newTimes1 = new long[uids.length][freqs.length];
- for (int i = 0; i < uids.length; ++i) {
- for (int j = 0; j < freqs.length; ++j) {
- newTimes1[i][j] = times[i][j] + (uids[i] + freqs[j]) * 50;
- }
- }
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, newTimes1));
- mKernelUidCpuFreqTimeReader.readDeltaImpl(cb);
- for (int i = 0; i < uids.length; ++i) {
- cb.verify(uids[i], subtract(newTimes1[i], times[i]));
- }
- cb.verifyNoMoreInteractions();
-
- // Verify that there won't be a callback if the proc file values didn't change.
- cb.clear();
- Mockito.reset(mProcReader);
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, newTimes1));
- mKernelUidCpuFreqTimeReader.readDeltaImpl(cb);
- cb.verifyNoMoreInteractions();
-
- // Verify that calling with a null callback doesn't result in any crashes
- cb.clear();
- Mockito.reset(mProcReader);
- final long[][] newTimes2 = new long[uids.length][freqs.length];
- for (int i = 0; i < uids.length; ++i) {
- for (int j = 0; j < freqs.length; ++j) {
- newTimes2[i][j] = newTimes1[i][j] + (uids[i] * freqs[j]) * 30;
- }
- }
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, newTimes2));
- mKernelUidCpuFreqTimeReader.readDeltaImpl(null);
- cb.verifyNoMoreInteractions();
-
- // Verify that the readDelta call will only return deltas when
- // the previous call had null callback.
- cb.clear();
- Mockito.reset(mProcReader);
- final long[][] newTimes3 = new long[uids.length][freqs.length];
- for (int i = 0; i < uids.length; ++i) {
- for (int j = 0; j < freqs.length; ++j) {
- newTimes3[i][j] = newTimes2[i][j] + (uids[i] + freqs[j]) * 40;
- }
- }
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, newTimes3));
- mKernelUidCpuFreqTimeReader.readDeltaImpl(cb);
- for (int i = 0; i < uids.length; ++i) {
- cb.verify(uids[i], subtract(newTimes3[i], newTimes2[i]));
- }
- cb.verifyNoMoreInteractions();
- }
-
- @Test
- public void testReadAbsolute() throws Exception {
- VerifiableCallback cb = new VerifiableCallback();
- final long[] freqs = {110, 123, 145, 167, 289, 997};
- final int[] uids = {1, 22, 333, 444, 555};
- final long[][] times = new long[uids.length][freqs.length];
- for (int i = 0; i < uids.length; ++i) {
- for (int j = 0; j < freqs.length; ++j) {
- times[i][j] = uids[i] * freqs[j] * 10;
- }
- }
- when(mBufferedReader.readLine()).thenReturn(getFreqsLine(freqs));
- long[] actualFreqs = mKernelUidCpuFreqTimeReader.readFreqs(mBufferedReader, mPowerProfile);
-
- assertArrayEquals(freqs, actualFreqs);
- // Verify that the absolute values are returned
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, times));
- mKernelUidCpuFreqTimeReader.readAbsolute(cb);
- for (int i = 0; i < uids.length; ++i) {
- cb.verify(uids[i], times[i]);
- }
- cb.verifyNoMoreInteractions();
-
- // Verify that a second call should still return absolute values
- cb.clear();
- Mockito.reset(mProcReader);
- final long[][] newTimes1 = new long[uids.length][freqs.length];
- for (int i = 0; i < uids.length; ++i) {
- for (int j = 0; j < freqs.length; ++j) {
- newTimes1[i][j] = times[i][j] + (uids[i] + freqs[j]) * 50;
- }
- }
- when(mProcReader.readBytes()).thenReturn(getUidTimesBytes(uids, newTimes1));
- mKernelUidCpuFreqTimeReader.readAbsolute(cb);
- for (int i = 0; i < uids.length; ++i) {
- cb.verify(uids[i], newTimes1[i]);
- }
- cb.verifyNoMoreInteractions();
- }
-
- private long[] subtract(long[] a1, long[] a2) {
- long[] val = new long[a1.length];
- for (int i = 0; i < val.length; ++i) {
- val[i] = a1[i] - a2[i];
- }
- return val;
- }
-
- private String getFreqsLine(long[] freqs) {
- final StringBuilder sb = new StringBuilder();
- sb.append("uid:");
- for (int i = 0; i < freqs.length; ++i) {
- sb.append(" " + freqs[i]);
- }
- return sb.toString();
- }
-
- private ByteBuffer getUidTimesBytes(int[] uids, long[][] times) {
- int size = (1 + uids.length + uids.length * times[0].length) * 4;
- ByteBuffer buf = ByteBuffer.allocate(size);
- buf.order(ByteOrder.nativeOrder());
- buf.putInt(times[0].length);
- for (int i = 0; i < uids.length; i++) {
- buf.putInt(uids[i]);
- for (int j = 0; j < times[i].length; j++) {
- buf.putInt((int) (times[i][j] / 10));
- }
- }
- buf.flip();
- return buf.asReadOnlyBuffer().order(ByteOrder.nativeOrder());
- }
-
- private void setCpuClusterFreqs(int numClusters, int... clusterFreqs) {
- assertEquals(numClusters, clusterFreqs.length);
- when(mPowerProfile.getNumCpuClusters()).thenReturn(numClusters);
- for (int i = 0; i < numClusters; ++i) {
- when(mPowerProfile.getNumSpeedStepsInCpuCluster(i)).thenReturn(clusterFreqs[i]);
- }
- }
-
- private class VerifiableCallback implements KernelUidCpuFreqTimeReader.Callback {
-
- SparseArray<long[]> mData = new SparseArray<>();
- int count = 0;
-
- public void verify(int uid, long[] cpuFreqTimeMs) {
- long[] array = mData.get(uid);
- assertNotNull(array);
- assertArrayEquals(cpuFreqTimeMs, array);
- count++;
- }
-
- public void clear() {
- mData.clear();
- count = 0;
- }
-
- @Override
- public void onUidCpuFreqTime(int uid, long[] cpuFreqTimeMs) {
- long[] array = new long[cpuFreqTimeMs.length];
- System.arraycopy(cpuFreqTimeMs, 0, array, 0, array.length);
- mData.put(uid, array);
- }
-
- public void verifyNoMoreInteractions() {
- assertEquals(mData.size(), count);
- }
- }
-}
diff --git a/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java b/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
index c18445e..bc0e0a4 100644
--- a/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
+++ b/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
@@ -21,6 +21,10 @@
import android.util.SparseIntArray;
import com.android.internal.location.gnssmetrics.GnssMetrics;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidActiveTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidClusterTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidFreqTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidUserSysTimeReader;
import java.util.ArrayList;
import java.util.Queue;
@@ -43,13 +47,14 @@
mBluetoothScanTimer = new StopwatchTimer(mClocks, null, -14, null, mOnBatteryTimeBase);
setExternalStatsSyncLocked(new DummyExternalStatsSync());
- for (int i=0; i< GnssMetrics.NUM_GPS_SIGNAL_QUALITY_LEVELS; i++) {
- mGpsSignalQualityTimer[i] = new StopwatchTimer(clocks, null, -1000-i, null,
- mOnBatteryTimeBase);
+ for (int i = 0; i < GnssMetrics.NUM_GPS_SIGNAL_QUALITY_LEVELS; i++) {
+ mGpsSignalQualityTimer[i] = new StopwatchTimer(clocks, null, -1000 - i, null,
+ mOnBatteryTimeBase);
}
// A no-op handler.
- mHandler = new Handler(Looper.getMainLooper()) {};
+ mHandler = new Handler(Looper.getMainLooper()) {
+ };
}
MockBatteryStatsImpl() {
@@ -95,23 +100,26 @@
return this;
}
- public MockBatteryStatsImpl setKernelUidCpuFreqTimeReader(KernelUidCpuFreqTimeReader reader) {
- mKernelUidCpuFreqTimeReader = reader;
+ public MockBatteryStatsImpl setKernelCpuUidFreqTimeReader(KernelCpuUidFreqTimeReader reader) {
+ mCpuUidFreqTimeReader = reader;
return this;
}
- public MockBatteryStatsImpl setKernelUidCpuActiveTimeReader(KernelUidCpuActiveTimeReader reader) {
- mKernelUidCpuActiveTimeReader = reader;
+ public MockBatteryStatsImpl setKernelCpuUidActiveTimeReader(
+ KernelCpuUidActiveTimeReader reader) {
+ mCpuUidActiveTimeReader = reader;
return this;
}
- public MockBatteryStatsImpl setKernelUidCpuClusterTimeReader(KernelUidCpuClusterTimeReader reader) {
- mKernelUidCpuClusterTimeReader = reader;
+ public MockBatteryStatsImpl setKernelCpuUidClusterTimeReader(
+ KernelCpuUidClusterTimeReader reader) {
+ mCpuUidClusterTimeReader = reader;
return this;
}
- public MockBatteryStatsImpl setKernelUidCpuTimeReader(KernelUidCpuTimeReader reader) {
- mKernelUidCpuTimeReader = reader;
+ public MockBatteryStatsImpl setKernelCpuUidUserSysTimeReader(
+ KernelCpuUidUserSysTimeReader reader) {
+ mCpuUidUserSysTimeReader = reader;
return this;
}
diff --git a/core/tests/hdmitests/Android.mk b/core/tests/hdmitests/Android.mk
index 2ca31a6..f155feb 100644
--- a/core/tests/hdmitests/Android.mk
+++ b/core/tests/hdmitests/Android.mk
@@ -20,7 +20,7 @@
# Include all test java files
LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules frameworks-base-testutils
+LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules frameworks-base-testutils truth-prebuilt
LOCAL_JAVA_LIBRARIES := android.test.runner
LOCAL_PACKAGE_NAME := HdmiCecTests
diff --git a/core/tests/hdmitests/src/android/hardware/hdmi/HdmiUtilsTest.java b/core/tests/hdmitests/src/android/hardware/hdmi/HdmiUtilsTest.java
new file mode 100644
index 0000000..fdc6b84
--- /dev/null
+++ b/core/tests/hdmitests/src/android/hardware/hdmi/HdmiUtilsTest.java
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.hdmi;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+/**
+ * Tests for {@link HdmiUtils}.
+ */
+@RunWith(JUnit4.class)
+@SmallTest
+public class HdmiUtilsTest {
+ @Test
+ public void testInvalidAddress() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0, -1))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_UNKNOWN);
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0xFFFF, 0xFFFF))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_UNKNOWN);
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0xFFFFF, 0))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_UNKNOWN);
+ }
+
+ @Test
+ public void testSameAddress() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x1000, 0x1000))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_SAME);
+ }
+
+ @Test
+ public void testDirectlyAbove() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x1000, 0x1200))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_DIRECTLY_ABOVE);
+ }
+
+ @Test
+ public void testDirectlyAbove_rootDevice() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x0000, 0x2000))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_DIRECTLY_ABOVE);
+ }
+
+ @Test
+ public void testDirectlyAbove_leafDevice() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x1240, 0x1245))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_DIRECTLY_ABOVE);
+ }
+
+ @Test
+ public void testAbove() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x1000, 0x1210))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_ABOVE);
+ }
+
+ @Test
+ public void testAbove_rootDevice() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x0000, 0x1200))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_ABOVE);
+ }
+
+ @Test
+ public void testDirectlyBelow() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x2250, 0x2200))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_DIRECTLY_BELOW);
+ }
+
+ @Test
+ public void testDirectlyBelow_rootDevice() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x5000, 0x0000))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_DIRECTLY_BELOW);
+ }
+
+ @Test
+ public void testDirectlyBelow_leafDevice() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x3249, 0x3240))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_DIRECTLY_BELOW);
+ }
+
+ @Test
+ public void testBelow() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x5143, 0x5100))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_BELOW);
+ }
+
+ @Test
+ public void testBelow_rootDevice() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x3420, 0x0000))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_BELOW);
+ }
+
+ @Test
+ public void testSibling() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x4000, 0x5000))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_SIBLING);
+ }
+
+ @Test
+ public void testSibling_leafDevice() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x798A, 0x798F))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_SIBLING);
+ }
+
+ @Test
+ public void testDifferentBranch() {
+ assertThat(HdmiUtils.getHdmiAddressRelativePosition(0x798A, 0x7970))
+ .isEqualTo(HdmiUtils.HDMI_RELATIVE_POSITION_DIFFERENT_BRANCH);
+ }
+
+ @Test
+ public void isValidPysicalAddress_true() {
+ assertThat(HdmiUtils.isValidPhysicalAddress(0)).isTrue();
+ assertThat(HdmiUtils.isValidPhysicalAddress(0xFFFE)).isTrue();
+ assertThat(HdmiUtils.isValidPhysicalAddress(0x1200)).isTrue();
+ }
+
+ @Test
+ public void isValidPysicalAddress_outOfRange() {
+ assertThat(HdmiUtils.isValidPhysicalAddress(-1)).isFalse();
+ assertThat(HdmiUtils.isValidPhysicalAddress(0xFFFF)).isFalse();
+ assertThat(HdmiUtils.isValidPhysicalAddress(0x10000)).isFalse();
+ }
+
+ @Test
+ public void isValidPysicalAddress_nonTrailingZeros() {
+ assertThat(HdmiUtils.isValidPhysicalAddress(0x0001)).isFalse();
+ assertThat(HdmiUtils.isValidPhysicalAddress(0x0213)).isFalse();
+ }
+}
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 30f0bfa..bfbdbc5 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -21,7 +21,6 @@
import android.annotation.ColorLong;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.annotation.Size;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.annotation.WorkerThread;
@@ -748,22 +747,10 @@
throw new IllegalArgumentException("usage flags must contain USAGE_GPU_SAMPLED_IMAGE.");
}
int format = hardwareBuffer.getFormat();
- ColorSpace.Rgb rgb = null;
- if (colorSpace != null) {
- if (!(colorSpace instanceof ColorSpace.Rgb)) {
- throw new IllegalArgumentException("colorSpace must be an RGB color space");
- }
- rgb = (ColorSpace.Rgb) colorSpace;
- } else {
- rgb = (ColorSpace.Rgb) ColorSpace.get(ColorSpace.Named.SRGB);
+ if (colorSpace == null) {
+ colorSpace = ColorSpace.get(ColorSpace.Named.SRGB);
}
- ColorSpace.Rgb.TransferParameters parameters = rgb.getTransferParameters();
- if (parameters == null) {
- throw new IllegalArgumentException("colorSpace must use an ICC "
- + "parametric transfer function");
- }
- ColorSpace.Rgb d50 = (ColorSpace.Rgb) ColorSpace.adapt(rgb, ColorSpace.ILLUMINANT_D50);
- return nativeWrapHardwareBufferBitmap(hardwareBuffer, d50.getTransform(), parameters);
+ return nativeWrapHardwareBufferBitmap(hardwareBuffer, colorSpace.getNativeInstance());
}
/**
@@ -1103,26 +1090,18 @@
throw new IllegalArgumentException("can't create bitmap without a color space");
}
- Bitmap bm;
- // nullptr color spaces have a particular meaning in native and are interpreted as sRGB
- // (we also avoid the unnecessary extra work of the else branch)
- if (config != Config.ARGB_8888 || colorSpace == ColorSpace.get(ColorSpace.Named.SRGB)) {
- bm = nativeCreate(null, 0, width, width, height, config.nativeInt, true, null, null);
- } else {
- if (!(colorSpace instanceof ColorSpace.Rgb)) {
- throw new IllegalArgumentException("colorSpace must be an RGB color space");
+ if (config != Config.ARGB_8888) {
+ if (config == Config.RGBA_F16) {
+ // FIXME: This should be LINEAR_EXTENDED_SRGB, but that would fail a CTS test. See
+ // b/120960866. SRGB matches the old (incorrect) behavior.
+ //colorSpace = ColorSpace.get(ColorSpace.Named.LINEAR_EXTENDED_SRGB);
+ colorSpace = ColorSpace.get(ColorSpace.Named.SRGB);
+ } else {
+ colorSpace = ColorSpace.get(ColorSpace.Named.SRGB);
}
- ColorSpace.Rgb rgb = (ColorSpace.Rgb) colorSpace;
- ColorSpace.Rgb.TransferParameters parameters = rgb.getTransferParameters();
- if (parameters == null) {
- throw new IllegalArgumentException("colorSpace must use an ICC "
- + "parametric transfer function");
- }
-
- ColorSpace.Rgb d50 = (ColorSpace.Rgb) ColorSpace.adapt(rgb, ColorSpace.ILLUMINANT_D50);
- bm = nativeCreate(null, 0, width, width, height, config.nativeInt, true,
- d50.getTransform(), parameters);
}
+ Bitmap bm = nativeCreate(null, 0, width, width, height, config.nativeInt, true,
+ colorSpace.getNativeInstance());
if (display != null) {
bm.mDensity = display.densityDpi;
@@ -1200,8 +1179,9 @@
if (width <= 0 || height <= 0) {
throw new IllegalArgumentException("width and height must be > 0");
}
+ ColorSpace sRGB = ColorSpace.get(ColorSpace.Named.SRGB);
Bitmap bm = nativeCreate(colors, offset, stride, width, height,
- config.nativeInt, false, null, null);
+ config.nativeInt, false, sRGB.getNativeInstance());
if (display != null) {
bm.mDensity = display.densityDpi;
}
@@ -1798,11 +1778,7 @@
}
ColorSpace cs = Color.colorSpace(c);
- float r = Color.red(c);
- float g = Color.green(c);
- float b = Color.blue(c);
- float a = Color.alpha(c);
- nativeErase(mNativePtr, cs, r, g, b, a);
+ nativeErase(mNativePtr, cs.getNativeInstance(), c);
}
/**
@@ -2133,8 +2109,7 @@
private static native Bitmap nativeCreate(int[] colors, int offset,
int stride, int width, int height,
int nativeConfig, boolean mutable,
- @Nullable @Size(9) float[] xyzD50,
- @Nullable ColorSpace.Rgb.TransferParameters p);
+ long nativeColorSpace);
private static native Bitmap nativeCopy(long nativeSrcBitmap, int nativeConfig,
boolean isMutable);
private static native Bitmap nativeCopyAshmem(long nativeSrcBitmap);
@@ -2149,8 +2124,7 @@
int quality, OutputStream stream,
byte[] tempStorage);
private static native void nativeErase(long nativeBitmap, int color);
- private static native void nativeErase(long nativeBitmap, ColorSpace cs,
- float r, float g, float b, float a);
+ private static native void nativeErase(long nativeBitmap, long colorSpacePtr, long color);
private static native int nativeRowBytes(long nativeBitmap);
private static native int nativeConfig(long nativeBitmap);
@@ -2194,8 +2168,7 @@
private static native Bitmap nativeCopyPreserveInternalConfig(long nativeBitmap);
private static native Bitmap nativeCreateHardwareBitmap(GraphicBuffer buffer);
private static native Bitmap nativeWrapHardwareBufferBitmap(HardwareBuffer buffer,
- @Size(9) float[] xyzD50,
- ColorSpace.Rgb.TransferParameters p);
+ long nativeColorSpace);
private static native GraphicBuffer nativeCreateGraphicBufferHandle(long nativeBitmap);
private static native boolean nativeGetColorSpace(long nativePtr, float[] xyz, float[] params);
private static native boolean nativeIsSRGB(long nativePtr);
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java
index 022fbdc..7aff041 100644
--- a/graphics/java/android/graphics/BitmapFactory.java
+++ b/graphics/java/android/graphics/BitmapFactory.java
@@ -460,6 +460,21 @@
}
}
}
+
+ /**
+ * Helper for passing SkColorSpace pointer to native.
+ *
+ * @throws IllegalArgumentException if the ColorSpace is not Rgb or does
+ * not have TransferParameters.
+ */
+ static long nativeColorSpace(Options opts) {
+ if (opts == null || opts.inPreferredColorSpace == null) {
+ return 0;
+ }
+
+ return opts.inPreferredColorSpace.getNativeInstance();
+ }
+
}
/**
@@ -633,7 +648,8 @@
Trace.traceBegin(Trace.TRACE_TAG_GRAPHICS, "decodeBitmap");
try {
- bm = nativeDecodeByteArray(data, offset, length, opts);
+ bm = nativeDecodeByteArray(data, offset, length, opts,
+ Options.nativeColorSpace(opts));
if (bm == null && opts != null && opts.inBitmap != null) {
throw new IllegalArgumentException("Problem decoding into existing bitmap");
@@ -728,7 +744,7 @@
try {
if (is instanceof AssetManager.AssetInputStream) {
final long asset = ((AssetManager.AssetInputStream) is).getNativeAsset();
- bm = nativeDecodeAsset(asset, outPadding, opts);
+ bm = nativeDecodeAsset(asset, outPadding, opts, Options.nativeColorSpace(opts));
} else {
bm = decodeStreamInternal(is, outPadding, opts);
}
@@ -755,7 +771,8 @@
byte [] tempStorage = null;
if (opts != null) tempStorage = opts.inTempStorage;
if (tempStorage == null) tempStorage = new byte[DECODE_BUFFER_SIZE];
- return nativeDecodeStream(is, tempStorage, outPadding, opts);
+ return nativeDecodeStream(is, tempStorage, outPadding, opts,
+ Options.nativeColorSpace(opts));
}
/**
@@ -798,7 +815,8 @@
Trace.traceBegin(Trace.TRACE_TAG_GRAPHICS, "decodeFileDescriptor");
try {
if (nativeIsSeekable(fd)) {
- bm = nativeDecodeFileDescriptor(fd, outPadding, opts);
+ bm = nativeDecodeFileDescriptor(fd, outPadding, opts,
+ Options.nativeColorSpace(opts));
} else {
FileInputStream fis = new FileInputStream(fd);
try {
@@ -835,14 +853,15 @@
@UnsupportedAppUsage
private static native Bitmap nativeDecodeStream(InputStream is, byte[] storage,
- Rect padding, Options opts);
+ Rect padding, Options opts, long colorSpaceHandle);
@UnsupportedAppUsage
private static native Bitmap nativeDecodeFileDescriptor(FileDescriptor fd,
- Rect padding, Options opts);
+ Rect padding, Options opts, long colorSpaceHandle);
@UnsupportedAppUsage
- private static native Bitmap nativeDecodeAsset(long nativeAsset, Rect padding, Options opts);
+ private static native Bitmap nativeDecodeAsset(long nativeAsset, Rect padding, Options opts,
+ long colorSpaceHandle);
@UnsupportedAppUsage
private static native Bitmap nativeDecodeByteArray(byte[] data, int offset,
- int length, Options opts);
+ int length, Options opts, long colorSpaceHandle);
private static native boolean nativeIsSeekable(FileDescriptor fd);
}
diff --git a/graphics/java/android/graphics/BitmapRegionDecoder.java b/graphics/java/android/graphics/BitmapRegionDecoder.java
index 43282d3..1410423 100644
--- a/graphics/java/android/graphics/BitmapRegionDecoder.java
+++ b/graphics/java/android/graphics/BitmapRegionDecoder.java
@@ -195,7 +195,8 @@
|| rect.top >= getHeight())
throw new IllegalArgumentException("rectangle is outside the image");
return nativeDecodeRegion(mNativeBitmapRegionDecoder, rect.left, rect.top,
- rect.right - rect.left, rect.bottom - rect.top, options);
+ rect.right - rect.left, rect.bottom - rect.top, options,
+ BitmapFactory.Options.nativeColorSpace(options));
}
}
@@ -265,7 +266,7 @@
private static native Bitmap nativeDecodeRegion(long lbm,
int start_x, int start_y, int width, int height,
- BitmapFactory.Options options);
+ BitmapFactory.Options options, long colorSpaceHandle);
private static native int nativeGetWidth(long lbm);
private static native int nativeGetHeight(long lbm);
private static native void nativeClean(long lbm);
diff --git a/graphics/java/android/graphics/ColorSpace.java b/graphics/java/android/graphics/ColorSpace.java
index 9fa70a5..4755d45 100644
--- a/graphics/java/android/graphics/ColorSpace.java
+++ b/graphics/java/android/graphics/ColorSpace.java
@@ -25,6 +25,8 @@
import android.annotation.SuppressAutoDoc;
import android.util.Pair;
+import libcore.util.NativeAllocationRegistry;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -199,6 +201,9 @@
private static final float[] NTSC_1953_PRIMARIES = { 0.67f, 0.33f, 0.21f, 0.71f, 0.14f, 0.08f };
private static final float[] ILLUMINANT_D50_XYZ = { 0.964212f, 1.0f, 0.825188f };
+ private static final Rgb.TransferParameters SRGB_TRANSFER_PARAMETERS =
+ new Rgb.TransferParameters(1 / 1.055, 0.055 / 1.055, 1 / 12.92, 0.04045, 2.4);
+
// See static initialization block next to #get(Named)
private static final ColorSpace[] sNamedColorSpaces = new ColorSpace[Named.values().length];
@@ -1341,6 +1346,26 @@
}
/**
+ * Helper method for creating native SkColorSpace.
+ *
+ * This essentially calls adapt on a ColorSpace that has not been fully
+ * created. It also does not fully create the adapted ColorSpace, but
+ * just returns the transform.
+ */
+ @NonNull @Size(9)
+ private static float[] adaptToIlluminantD50(
+ @NonNull @Size(2) float[] origWhitePoint,
+ @NonNull @Size(9) float[] origTransform) {
+ float[] desired = ILLUMINANT_D50;
+ if (compare(origWhitePoint, desired)) return origTransform;
+
+ float[] xyz = xyYToXyz(desired);
+ float[] adaptationTransform = chromaticAdaptation(Adaptation.BRADFORD.mTransform,
+ xyYToXyz(origWhitePoint), xyz);
+ return mul3x3(adaptationTransform, origTransform);
+ }
+
+ /**
* <p>Returns an instance of {@link ColorSpace} whose ID matches the
* specified ID.</p>
*
@@ -1431,7 +1456,7 @@
"sRGB IEC61966-2.1",
SRGB_PRIMARIES,
ILLUMINANT_D65,
- new Rgb.TransferParameters(1 / 1.055, 0.055 / 1.055, 1 / 12.92, 0.04045, 2.4),
+ SRGB_TRANSFER_PARAMETERS,
Named.SRGB.ordinal()
);
sNamedColorSpaces[Named.LINEAR_SRGB.ordinal()] = new ColorSpace.Rgb(
@@ -1446,9 +1471,11 @@
"scRGB-nl IEC 61966-2-2:2003",
SRGB_PRIMARIES,
ILLUMINANT_D65,
+ null,
x -> absRcpResponse(x, 1 / 1.055, 0.055 / 1.055, 1 / 12.92, 0.04045, 2.4),
x -> absResponse(x, 1 / 1.055, 0.055 / 1.055, 1 / 12.92, 0.04045, 2.4),
-0.799f, 2.399f,
+ null, // FIXME: Use SRGB_TRANSFER_PARAMETERS
Named.EXTENDED_SRGB.ordinal()
);
sNamedColorSpaces[Named.LINEAR_EXTENDED_SRGB.ordinal()] = new ColorSpace.Rgb(
@@ -1485,7 +1512,7 @@
"Display P3",
new float[] { 0.680f, 0.320f, 0.265f, 0.690f, 0.150f, 0.060f },
ILLUMINANT_D65,
- new Rgb.TransferParameters(1 / 1.055, 0.055 / 1.055, 1 / 12.92, 0.04045, 2.4),
+ SRGB_TRANSFER_PARAMETERS,
Named.DISPLAY_P3.ordinal()
);
sNamedColorSpaces[Named.NTSC_1953.ordinal()] = new ColorSpace.Rgb(
@@ -1967,6 +1994,15 @@
}
/**
+ * Retrieve the native SkColorSpace object for passing to native.
+ *
+ * Only valid on ColorSpace.Rgb.
+ */
+ long getNativeInstance() {
+ throw new IllegalArgumentException("colorSpace must be an RGB color space");
+ }
+
+ /**
* {@usesMathJax}
*
* <p>An RGB color space is an additive color space using the
@@ -2269,7 +2305,22 @@
private final boolean mIsWideGamut;
private final boolean mIsSrgb;
- @Nullable private TransferParameters mTransferParameters;
+ @Nullable private final TransferParameters mTransferParameters;
+ private final long mNativePtr;
+
+ @Override
+ long getNativeInstance() {
+ if (mNativePtr == 0) {
+ // If this object has TransferParameters, it must have a native object.
+ throw new IllegalArgumentException("ColorSpace must use an ICC "
+ + "parametric transfer function! used " + this);
+ }
+ return mNativePtr;
+ }
+
+ private static native long nativeGetNativeFinalizer();
+ private static native long nativeCreate(float a, float b, float c, float d,
+ float e, float f, float g, float[] xyz);
/**
* <p>Creates a new RGB color space using a 3x3 column-major transform matrix.
@@ -2298,8 +2349,8 @@
@NonNull @Size(9) float[] toXYZ,
@NonNull DoubleUnaryOperator oetf,
@NonNull DoubleUnaryOperator eotf) {
- this(name, computePrimaries(toXYZ), computeWhitePoint(toXYZ),
- oetf, eotf, 0.0f, 1.0f, MIN_ID);
+ this(name, computePrimaries(toXYZ), computeWhitePoint(toXYZ), null,
+ oetf, eotf, 0.0f, 1.0f, null, MIN_ID);
}
/**
@@ -2349,7 +2400,7 @@
@NonNull DoubleUnaryOperator eotf,
float min,
float max) {
- this(name, primaries, whitePoint, oetf, eotf, min, max, MIN_ID);
+ this(name, primaries, whitePoint, null, oetf, eotf, min, max, null, MIN_ID);
}
/**
@@ -2459,7 +2510,7 @@
@NonNull @Size(min = 2, max = 3) float[] whitePoint,
@NonNull TransferParameters function,
@IntRange(from = MIN_ID, to = MAX_ID) int id) {
- this(name, primaries, whitePoint,
+ this(name, primaries, whitePoint, null,
function.e == 0.0 && function.f == 0.0 ?
x -> rcpResponse(x, function.a, function.b,
function.c, function.d, function.g) :
@@ -2470,8 +2521,7 @@
function.c, function.d, function.g) :
x -> response(x, function.a, function.b, function.c,
function.d, function.e, function.f, function.g),
- 0.0f, 1.0f, id);
- mTransferParameters = function;
+ 0.0f, 1.0f, function, id);
}
/**
@@ -2586,13 +2636,12 @@
float min,
float max,
@IntRange(from = MIN_ID, to = MAX_ID) int id) {
- this(name, primaries, whitePoint,
+ this(name, primaries, whitePoint, null,
gamma == 1.0 ? DoubleUnaryOperator.identity() :
x -> Math.pow(x < 0.0 ? 0.0 : x, 1 / gamma),
gamma == 1.0 ? DoubleUnaryOperator.identity() :
x -> Math.pow(x < 0.0 ? 0.0 : x, gamma),
- min, max, id);
- mTransferParameters = new TransferParameters(1.0, 0.0, 0.0, 0.0, gamma);
+ min, max, new TransferParameters(1.0, 0.0, 0.0, 0.0, gamma), id);
}
/**
@@ -2615,10 +2664,13 @@
* @param name Name of the color space, cannot be null, its length must be >= 1
* @param primaries RGB primaries as an array of 6 (xy) or 9 (XYZ) floats
* @param whitePoint Reference white as an array of 2 (xy) or 3 (XYZ) floats
+ * @param transform Computed transform matrix that converts from RGB to XYZ, or
+ * {@code null} to compute it from {@code primaries} and {@code whitePoint}.
* @param oetf Opto-electronic transfer function, cannot be null
* @param eotf Electro-optical transfer function, cannot be null
* @param min The minimum valid value in this color space's RGB range
* @param max The maximum valid value in this color space's RGB range
+ * @param transferParameters Parameters for the transfer functions
* @param id ID of this color space as an integer between {@link #MIN_ID} and {@link #MAX_ID}
*
* @throws IllegalArgumentException If any of the following conditions is met:
@@ -2637,10 +2689,12 @@
@NonNull @Size(min = 1) String name,
@NonNull @Size(min = 6, max = 9) float[] primaries,
@NonNull @Size(min = 2, max = 3) float[] whitePoint,
+ @Nullable @Size(9) float[] transform,
@NonNull DoubleUnaryOperator oetf,
@NonNull DoubleUnaryOperator eotf,
float min,
float max,
+ @Nullable TransferParameters transferParameters,
@IntRange(from = MIN_ID, to = MAX_ID) int id) {
super(name, Model.RGB, id);
@@ -2668,7 +2722,15 @@
mWhitePoint = xyWhitePoint(whitePoint);
mPrimaries = xyPrimaries(primaries);
- mTransform = computeXYZMatrix(mPrimaries, mWhitePoint);
+ if (transform == null) {
+ mTransform = computeXYZMatrix(mPrimaries, mWhitePoint);
+ } else {
+ if (transform.length != 9) {
+ throw new IllegalArgumentException("Transform must have 9 entries! Has "
+ + transform.length);
+ }
+ mTransform = transform;
+ }
mInverseTransform = inverse3x3(mTransform);
mOetf = oetf;
@@ -2681,10 +2743,39 @@
mClampedOetf = oetf.andThen(clamp);
mClampedEotf = clamp.andThen(eotf);
+ mTransferParameters = transferParameters;
+
// A color space is wide-gamut if its area is >90% of NTSC 1953 and
// if it entirely contains the Color space definition in xyY
mIsWideGamut = isWideGamut(mPrimaries, min, max);
mIsSrgb = isSrgb(mPrimaries, mWhitePoint, oetf, eotf, min, max, id);
+
+ if (mTransferParameters != null) {
+ if (mWhitePoint == null || mTransform == null) {
+ throw new IllegalStateException(
+ "ColorSpace (" + this + ") cannot create native object! mWhitePoint: "
+ + mWhitePoint + " mTransform: " + mTransform);
+ }
+
+ // This mimics the old code that was in native.
+ float[] nativeTransform = adaptToIlluminantD50(mWhitePoint, mTransform);
+ mNativePtr = nativeCreate((float) mTransferParameters.a,
+ (float) mTransferParameters.b,
+ (float) mTransferParameters.c,
+ (float) mTransferParameters.d,
+ (float) mTransferParameters.e,
+ (float) mTransferParameters.f,
+ (float) mTransferParameters.g,
+ nativeTransform);
+ NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mNativePtr);
+ } else {
+ mNativePtr = 0;
+ }
+ }
+
+ private static class NoImagePreloadHolder {
+ public static final NativeAllocationRegistry sRegistry = new NativeAllocationRegistry(
+ ColorSpace.Rgb.class.getClassLoader(), nativeGetNativeFinalizer(), 0);
}
/**
@@ -2695,27 +2786,9 @@
private Rgb(Rgb colorSpace,
@NonNull @Size(9) float[] transform,
@NonNull @Size(min = 2, max = 3) float[] whitePoint) {
- super(colorSpace.getName(), Model.RGB, -1);
-
- mWhitePoint = xyWhitePoint(whitePoint);
- mPrimaries = colorSpace.mPrimaries;
-
- mTransform = transform;
- mInverseTransform = inverse3x3(transform);
-
- mMin = colorSpace.mMin;
- mMax = colorSpace.mMax;
-
- mOetf = colorSpace.mOetf;
- mEotf = colorSpace.mEotf;
-
- mClampedOetf = colorSpace.mClampedOetf;
- mClampedEotf = colorSpace.mClampedEotf;
-
- mIsWideGamut = colorSpace.mIsWideGamut;
- mIsSrgb = colorSpace.mIsSrgb;
-
- mTransferParameters = colorSpace.mTransferParameters;
+ this(colorSpace.getName(), colorSpace.mPrimaries, whitePoint, transform,
+ colorSpace.mOetf, colorSpace.mEotf, colorSpace.mMin, colorSpace.mMax,
+ colorSpace.mTransferParameters, MIN_ID);
}
/**
diff --git a/graphics/java/android/graphics/ImageDecoder.java b/graphics/java/android/graphics/ImageDecoder.java
index e3b165c..466a5fc 100644
--- a/graphics/java/android/graphics/ImageDecoder.java
+++ b/graphics/java/android/graphics/ImageDecoder.java
@@ -1628,17 +1628,6 @@
if (mPostProcessor != null && mUnpremultipliedRequired) {
throw new IllegalStateException("Cannot draw to unpremultiplied pixels!");
}
-
- if (mDesiredColorSpace != null) {
- if (!(mDesiredColorSpace instanceof ColorSpace.Rgb)) {
- throw new IllegalArgumentException("The target color space must use the "
- + "RGB color model - provided: " + mDesiredColorSpace);
- }
- if (((ColorSpace.Rgb) mDesiredColorSpace).getTransferParameters() == null) {
- throw new IllegalArgumentException("The target color space must use an "
- + "ICC parametric transfer function - provided: " + mDesiredColorSpace);
- }
- }
}
private static void checkSubset(int width, int height, Rect r) {
@@ -1655,10 +1644,12 @@
@NonNull
private Bitmap decodeBitmapInternal() throws IOException {
checkState();
+ long colorSpacePtr = mDesiredColorSpace == null ? 0 :
+ mDesiredColorSpace.getNativeInstance();
return nDecodeBitmap(mNativePtr, this, mPostProcessor != null,
mDesiredWidth, mDesiredHeight, mCropRect,
mMutable, mAllocator, mUnpremultipliedRequired,
- mConserveMemory, mDecodeAsAlphaMask, mDesiredColorSpace);
+ mConserveMemory, mDecodeAsAlphaMask, colorSpacePtr);
}
private void callHeaderDecoded(@Nullable OnHeaderDecodedListener listener,
@@ -1946,7 +1937,7 @@
@Nullable Rect cropRect, boolean mutable,
int allocator, boolean unpremulRequired,
boolean conserveMemory, boolean decodeAsAlphaMask,
- @Nullable ColorSpace desiredColorSpace)
+ long desiredColorSpace)
throws IOException;
private static native Size nGetSampledSize(long nativePtr,
int sampleSize);
diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java
index 54e1abc..7eee6f4 100644
--- a/graphics/java/android/graphics/Paint.java
+++ b/graphics/java/android/graphics/Paint.java
@@ -1017,7 +1017,7 @@
float b = Color.blue(color);
float a = Color.alpha(color);
- nSetColor(mNativePaint, cs, r, g, b, a);
+ nSetColor(mNativePaint, cs.getNativeInstance(), r, g, b, a);
mColor = color;
}
@@ -1455,7 +1455,7 @@
float g = Color.green(shadowColor);
float b = Color.blue(shadowColor);
float a = Color.alpha(shadowColor);
- nSetShadowLayer(mNativePaint, radius, dx, dy, cs, r, g, b, a);
+ nSetShadowLayer(mNativePaint, radius, dx, dy, cs.getNativeInstance(), r, g, b, a);
mShadowLayerRadius = radius;
mShadowLayerDx = dx;
@@ -3003,11 +3003,6 @@
int contextStart, int contextEnd, boolean isRtl, int offset);
private static native int nGetOffsetForAdvance(long paintPtr, char[] text, int start, int end,
int contextStart, int contextEnd, boolean isRtl, float advance);
- private static native void nSetColor(long paintPtr, ColorSpace cs,
- float r, float g, float b, float a);
- private static native void nSetShadowLayer(long paintPtr,
- float radius, float dx, float dy, ColorSpace cs,
- float r, float g, float b, float a);
// ---------------- @FastNative ------------------------
@@ -3063,7 +3058,8 @@
int mMinikinLocaleListId);
@CriticalNative
private static native void nSetShadowLayer(long paintPtr,
- float radius, float dx, float dy, @ColorInt int color);
+ float radius, float dx, float dy, long colorSpaceHandle,
+ float r, float g, float b, float a);
@CriticalNative
private static native boolean nHasShadowLayer(long paintPtr);
@CriticalNative
@@ -3111,6 +3107,9 @@
@CriticalNative
private static native void nSetFilterBitmap(long paintPtr, boolean filter);
@CriticalNative
+ private static native void nSetColor(long paintPtr, long colorSpaceHandle,
+ float r, float g, float b, float a);
+ @CriticalNative
private static native void nSetStrikeThruText(long paintPtr, boolean strikeThruText);
@CriticalNative
private static native boolean nIsElegantTextHeight(long paintPtr);
diff --git a/location/lib/java/com/android/location/provider/ActivityChangedEvent.java b/location/lib/java/com/android/location/provider/ActivityChangedEvent.java
new file mode 100644
index 0000000..843dd67
--- /dev/null
+++ b/location/lib/java/com/android/location/provider/ActivityChangedEvent.java
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.location.provider;
+
+import android.annotation.NonNull;
+
+import java.security.InvalidParameterException;
+import java.util.List;
+
+/**
+ * A class representing an event for Activity changes.
+ * @hide
+ */
+public class ActivityChangedEvent {
+ private final List<ActivityRecognitionEvent> mActivityRecognitionEvents;
+
+ public ActivityChangedEvent(List<ActivityRecognitionEvent> activityRecognitionEvents) {
+ if (activityRecognitionEvents == null) {
+ throw new InvalidParameterException(
+ "Parameter 'activityRecognitionEvents' must not be null.");
+ }
+
+ mActivityRecognitionEvents = activityRecognitionEvents;
+ }
+
+ @NonNull
+ public Iterable<ActivityRecognitionEvent> getActivityRecognitionEvents() {
+ return mActivityRecognitionEvents;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder("[ ActivityChangedEvent:");
+
+ for (ActivityRecognitionEvent event : mActivityRecognitionEvents) {
+ builder.append("\n ");
+ builder.append(event.toString());
+ }
+ builder.append("\n]");
+
+ return builder.toString();
+ }
+}
diff --git a/location/lib/java/com/android/location/provider/ActivityRecognitionEvent.java b/location/lib/java/com/android/location/provider/ActivityRecognitionEvent.java
new file mode 100644
index 0000000..e54dea4
--- /dev/null
+++ b/location/lib/java/com/android/location/provider/ActivityRecognitionEvent.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.location.provider;
+
+/**
+ * A class that represents an Activity Recognition Event.
+ * @hide
+ */
+public class ActivityRecognitionEvent {
+ private final String mActivity;
+ private final int mEventType;
+ private final long mTimestampNs;
+
+ public ActivityRecognitionEvent(String activity, int eventType, long timestampNs) {
+ mActivity = activity;
+ mEventType = eventType;
+ mTimestampNs = timestampNs;
+ }
+
+ public String getActivity() {
+ return mActivity;
+ }
+
+ public int getEventType() {
+ return mEventType;
+ }
+
+ public long getTimestampNs() {
+ return mTimestampNs;
+ }
+
+ @Override
+ public String toString() {
+ String eventString;
+ switch (mEventType) {
+ case ActivityRecognitionProvider.EVENT_TYPE_ENTER:
+ eventString = "Enter";
+ break;
+ case ActivityRecognitionProvider.EVENT_TYPE_EXIT:
+ eventString = "Exit";
+ break;
+ case ActivityRecognitionProvider.EVENT_TYPE_FLUSH_COMPLETE:
+ eventString = "FlushComplete";
+ break;
+ default:
+ eventString = "<Invalid>";
+ break;
+ }
+
+ return String.format(
+ "Activity='%s', EventType=%s(%s), TimestampNs=%s",
+ mActivity,
+ eventString,
+ mEventType,
+ mTimestampNs);
+ }
+}
diff --git a/location/lib/java/com/android/location/provider/ActivityRecognitionProvider.java b/location/lib/java/com/android/location/provider/ActivityRecognitionProvider.java
new file mode 100644
index 0000000..0eff7d3
--- /dev/null
+++ b/location/lib/java/com/android/location/provider/ActivityRecognitionProvider.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.location.provider;
+
+import com.android.internal.util.Preconditions;
+
+import android.hardware.location.IActivityRecognitionHardware;
+import android.hardware.location.IActivityRecognitionHardwareSink;
+import android.os.RemoteException;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+
+/**
+ * A class that exposes {@link IActivityRecognitionHardware} functionality to unbundled services.
+ * @hide
+ */
+public final class ActivityRecognitionProvider {
+ private final IActivityRecognitionHardware mService;
+ private final HashSet<Sink> mSinkSet = new HashSet<>();
+
+ // the following constants must remain in sync with activity_recognition.h
+
+ public static final String ACTIVITY_IN_VEHICLE = "android.activity_recognition.in_vehicle";
+ public static final String ACTIVITY_ON_BICYCLE = "android.activity_recognition.on_bicycle";
+ public static final String ACTIVITY_WALKING = "android.activity_recognition.walking";
+ public static final String ACTIVITY_RUNNING = "android.activity_recognition.running";
+ public static final String ACTIVITY_STILL = "android.activity_recognition.still";
+ public static final String ACTIVITY_TILTING = "android.activity_recognition.tilting";
+
+ // NOTE: when adding an additional EVENT_TYPE_, EVENT_TYPE_COUNT needs to be updated in
+ // android.hardware.location.ActivityRecognitionHardware
+ public static final int EVENT_TYPE_FLUSH_COMPLETE = 0;
+ public static final int EVENT_TYPE_ENTER = 1;
+ public static final int EVENT_TYPE_EXIT = 2;
+
+ // end constants activity_recognition.h
+
+ /**
+ * Used to receive Activity-Recognition events.
+ */
+ public interface Sink {
+ void onActivityChanged(ActivityChangedEvent event);
+ }
+
+ public ActivityRecognitionProvider(IActivityRecognitionHardware service)
+ throws RemoteException {
+ Preconditions.checkNotNull(service);
+ mService = service;
+ mService.registerSink(new SinkTransport());
+ }
+
+ public String[] getSupportedActivities() throws RemoteException {
+ return mService.getSupportedActivities();
+ }
+
+ public boolean isActivitySupported(String activity) throws RemoteException {
+ return mService.isActivitySupported(activity);
+ }
+
+ public void registerSink(Sink sink) {
+ Preconditions.checkNotNull(sink);
+ synchronized (mSinkSet) {
+ mSinkSet.add(sink);
+ }
+ }
+
+ // TODO: if this functionality is exposed to 3rd party developers, handle unregistration (here
+ // and in the service) of all sinks while failing to disable all events
+ public void unregisterSink(Sink sink) {
+ Preconditions.checkNotNull(sink);
+ synchronized (mSinkSet) {
+ mSinkSet.remove(sink);
+ }
+ }
+
+ public boolean enableActivityEvent(String activity, int eventType, long reportLatencyNs)
+ throws RemoteException {
+ return mService.enableActivityEvent(activity, eventType, reportLatencyNs);
+ }
+
+ public boolean disableActivityEvent(String activity, int eventType) throws RemoteException {
+ return mService.disableActivityEvent(activity, eventType);
+ }
+
+ public boolean flush() throws RemoteException {
+ return mService.flush();
+ }
+
+ private final class SinkTransport extends IActivityRecognitionHardwareSink.Stub {
+ @Override
+ public void onActivityChanged(android.hardware.location.ActivityChangedEvent event) {
+ Collection<Sink> sinks;
+ synchronized (mSinkSet) {
+ if (mSinkSet.isEmpty()) {
+ return;
+ }
+ sinks = new ArrayList<>(mSinkSet);
+ }
+
+ // translate the event from platform internal and GmsCore types
+ ArrayList<ActivityRecognitionEvent> gmsEvents = new ArrayList<>();
+ for (android.hardware.location.ActivityRecognitionEvent reportingEvent
+ : event.getActivityRecognitionEvents()) {
+ ActivityRecognitionEvent gmsEvent = new ActivityRecognitionEvent(
+ reportingEvent.getActivity(),
+ reportingEvent.getEventType(),
+ reportingEvent.getTimestampNs());
+ gmsEvents.add(gmsEvent);
+ }
+ ActivityChangedEvent gmsEvent = new ActivityChangedEvent(gmsEvents);
+
+ for (Sink sink : sinks) {
+ sink.onActivityChanged(gmsEvent);
+ }
+ }
+ }
+}
diff --git a/location/lib/java/com/android/location/provider/ActivityRecognitionProviderClient.java b/location/lib/java/com/android/location/provider/ActivityRecognitionProviderClient.java
new file mode 100644
index 0000000..326d901
--- /dev/null
+++ b/location/lib/java/com/android/location/provider/ActivityRecognitionProviderClient.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.location.provider;
+
+import android.annotation.NonNull;
+import android.hardware.location.IActivityRecognitionHardware;
+import android.hardware.location.IActivityRecognitionHardwareClient;
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.Process;
+import android.os.RemoteException;
+import android.util.Log;
+
+/**
+ * A client class for interaction with an Activity-Recognition provider.
+ * @hide
+ */
+public abstract class ActivityRecognitionProviderClient {
+ private static final String TAG = "ArProviderClient";
+
+ protected ActivityRecognitionProviderClient() {}
+
+ private IActivityRecognitionHardwareClient.Stub mClient =
+ new IActivityRecognitionHardwareClient.Stub() {
+ @Override
+ public void onAvailabilityChanged(
+ boolean isSupported,
+ IActivityRecognitionHardware instance) {
+ int callingUid = Binder.getCallingUid();
+ if (callingUid != Process.SYSTEM_UID) {
+ Log.d(TAG, "Ignoring calls from non-system server. Uid: " + callingUid);
+ return;
+ }
+ ActivityRecognitionProvider provider;
+ try {
+ provider = isSupported ? new ActivityRecognitionProvider(instance) : null;
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error creating Hardware Activity-Recognition Provider.", e);
+ return;
+ }
+ onProviderChanged(isSupported, provider);
+ }
+ };
+
+ /**
+ * Gets the binder needed to interact with proxy provider in the platform.
+ */
+ @NonNull
+ public IBinder getBinder() {
+ return mClient;
+ }
+
+ /**
+ * Called when a change in the availability of {@link ActivityRecognitionProvider} is detected.
+ *
+ * @param isSupported whether the platform supports the provider natively
+ * @param instance the available provider's instance
+ */
+ public abstract void onProviderChanged(
+ boolean isSupported,
+ ActivityRecognitionProvider instance);
+}
diff --git a/location/lib/java/com/android/location/provider/ActivityRecognitionProviderWatcher.java b/location/lib/java/com/android/location/provider/ActivityRecognitionProviderWatcher.java
new file mode 100644
index 0000000..42f77b4
--- /dev/null
+++ b/location/lib/java/com/android/location/provider/ActivityRecognitionProviderWatcher.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.location.provider;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.hardware.location.IActivityRecognitionHardware;
+import android.hardware.location.IActivityRecognitionHardwareWatcher;
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.Process;
+import android.os.RemoteException;
+import android.util.Log;
+
+/**
+ * A watcher class for Activity-Recognition instances.
+ *
+ * @deprecated use {@link ActivityRecognitionProviderClient} instead.
+ * @hide
+ */
+@Deprecated
+public class ActivityRecognitionProviderWatcher {
+ private static final String TAG = "ActivityRecognitionProviderWatcher";
+
+ private static ActivityRecognitionProviderWatcher sWatcher;
+ private static final Object sWatcherLock = new Object();
+
+ private ActivityRecognitionProvider mActivityRecognitionProvider;
+
+ private ActivityRecognitionProviderWatcher() {}
+
+ public static ActivityRecognitionProviderWatcher getInstance() {
+ synchronized (sWatcherLock) {
+ if (sWatcher == null) {
+ sWatcher = new ActivityRecognitionProviderWatcher();
+ }
+ return sWatcher;
+ }
+ }
+
+ private IActivityRecognitionHardwareWatcher.Stub mWatcherStub =
+ new IActivityRecognitionHardwareWatcher.Stub() {
+ @Override
+ public void onInstanceChanged(IActivityRecognitionHardware instance) {
+ int callingUid = Binder.getCallingUid();
+ if (callingUid != Process.SYSTEM_UID) {
+ Log.d(TAG, "Ignoring calls from non-system server. Uid: " + callingUid);
+ return;
+ }
+
+ try {
+ mActivityRecognitionProvider = new ActivityRecognitionProvider(instance);
+ } catch (RemoteException e) {
+ Log.e(TAG, "Error creating Hardware Activity-Recognition", e);
+ }
+ }
+ };
+
+ /**
+ * Gets the binder needed to interact with proxy provider in the platform.
+ */
+ @NonNull
+ public IBinder getBinder() {
+ return mWatcherStub;
+ }
+
+ /**
+ * Gets an object that supports the functionality of {@link ActivityRecognitionProvider}.
+ *
+ * @return Non-null value if the functionality is supported by the platform, false otherwise.
+ */
+ @Nullable
+ public ActivityRecognitionProvider getActivityRecognitionProvider() {
+ return mActivityRecognitionProvider;
+ }
+}
diff --git a/lowpan/tests/Android.mk b/lowpan/tests/Android.mk
index 67727a7..832ed2f 100644
--- a/lowpan/tests/Android.mk
+++ b/lowpan/tests/Android.mk
@@ -45,7 +45,7 @@
LOCAL_JACK_COVERAGE_EXCLUDE_FILTER := $(jacoco_exclude)
LOCAL_STATIC_JAVA_LIBRARIES := \
- android-support-test \
+ androidx.test.rules \
guava \
mockito-target-minus-junit4 \
frameworks-base-testutils \
diff --git a/lowpan/tests/AndroidManifest.xml b/lowpan/tests/AndroidManifest.xml
index a216214..4225613 100644
--- a/lowpan/tests/AndroidManifest.xml
+++ b/lowpan/tests/AndroidManifest.xml
@@ -30,7 +30,7 @@
</activity>
</application>
- <instrumentation android:name="android.support.test.runner.AndroidJUnitRunner"
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="android.net.lowpan.test"
android:label="Frameworks LoWPAN API Tests">
</instrumentation>
diff --git a/lowpan/tests/AndroidTest.xml b/lowpan/tests/AndroidTest.xml
index 72ad050..978cc02 100644
--- a/lowpan/tests/AndroidTest.xml
+++ b/lowpan/tests/AndroidTest.xml
@@ -22,6 +22,6 @@
<option name="test-tag" value="FrameworksLowpanApiTests" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="android.net.lowpan.test" />
- <option name="runner" value="android.support.test.runner.AndroidJUnitRunner" />
+ <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
</test>
</configuration>
diff --git a/lowpan/tests/README.md b/lowpan/tests/README.md
index d0eed95..cb5772e 100644
--- a/lowpan/tests/README.md
+++ b/lowpan/tests/README.md
@@ -37,7 +37,7 @@
If you manually build and push the test APK to the device you can run tests using
```
-adb shell am instrument -w 'android.net.wifi.test/android.support.test.runner.AndroidJUnitRunner'
+adb shell am instrument -w 'android.net.wifi.test/androidx.test.runner.AndroidJUnitRunner'
```
## Adding Tests
diff --git a/lowpan/tests/runtests.sh b/lowpan/tests/runtests.sh
index 040f4f0..8267a79 100755
--- a/lowpan/tests/runtests.sh
+++ b/lowpan/tests/runtests.sh
@@ -21,4 +21,4 @@
adb install -r -g "$OUT/data/app/FrameworksLowpanApiTests/FrameworksLowpanApiTests.apk"
-adb shell am instrument -w "$@" 'android.net.lowpan.test/android.support.test.runner.AndroidJUnitRunner'
+adb shell am instrument -w "$@" 'android.net.lowpan.test/androidx.test.runner.AndroidJUnitRunner'
diff --git a/lowpan/tests/src/android/net/lowpan/LowpanInterfaceTest.java b/lowpan/tests/src/android/net/lowpan/LowpanInterfaceTest.java
index a495d3d..86f9d0e 100644
--- a/lowpan/tests/src/android/net/lowpan/LowpanInterfaceTest.java
+++ b/lowpan/tests/src/android/net/lowpan/LowpanInterfaceTest.java
@@ -23,15 +23,18 @@
import android.os.Handler;
import android.os.IBinder;
import android.os.test.TestLooper;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
-import java.util.Map;
+
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.Map;
+
/** Unit tests for android.net.lowpan.LowpanInterface. */
@RunWith(AndroidJUnit4.class)
@SmallTest
diff --git a/lowpan/tests/src/android/net/lowpan/LowpanManagerTest.java b/lowpan/tests/src/android/net/lowpan/LowpanManagerTest.java
index 3dd7504..998e8a5 100644
--- a/lowpan/tests/src/android/net/lowpan/LowpanManagerTest.java
+++ b/lowpan/tests/src/android/net/lowpan/LowpanManagerTest.java
@@ -26,8 +26,10 @@
import android.os.Handler;
import android.os.IBinder;
import android.os.test.TestLooper;
-import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
+
+import androidx.test.runner.AndroidJUnit4;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
diff --git a/media/java/android/media/MediaDescription.java b/media/java/android/media/MediaDescription.java
index e6aea99..31079e5 100644
--- a/media/java/android/media/MediaDescription.java
+++ b/media/java/android/media/MediaDescription.java
@@ -7,6 +7,7 @@
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
+import android.text.TextUtils;
/**
* A simple set of metadata for a media item suitable for display. This can be
@@ -122,9 +123,9 @@
private MediaDescription(Parcel in) {
mMediaId = in.readString();
- mTitle = in.readCharSequence();
- mSubtitle = in.readCharSequence();
- mDescription = in.readCharSequence();
+ mTitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
+ mSubtitle = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
+ mDescription = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
mIcon = in.readParcelable(null);
mIconUri = in.readParcelable(null);
mExtras = in.readBundle();
@@ -210,9 +211,9 @@
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mMediaId);
- dest.writeCharSequence(mTitle);
- dest.writeCharSequence(mSubtitle);
- dest.writeCharSequence(mDescription);
+ TextUtils.writeToParcel(mTitle, dest, 0);
+ TextUtils.writeToParcel(mSubtitle, dest, 0);
+ TextUtils.writeToParcel(mDescription, dest, 0);
dest.writeParcelable(mIcon, flags);
dest.writeParcelable(mIconUri, flags);
dest.writeBundle(mExtras);
diff --git a/media/java/android/media/MediaMetadata.java b/media/java/android/media/MediaMetadata.java
index 2721ad1..a3d75a3 100644
--- a/media/java/android/media/MediaMetadata.java
+++ b/media/java/android/media/MediaMetadata.java
@@ -34,8 +34,8 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
-import java.util.Set;
import java.util.Objects;
+import java.util.Set;
/**
* Contains metadata about an item, such as the title, artist, etc.
@@ -422,7 +422,7 @@
}
private MediaMetadata(Parcel in) {
- mBundle = Bundle.setDefusable(in.readBundle(), true);
+ mBundle = in.readBundle();
}
/**
diff --git a/media/java/android/media/MediaParceledListSlice.aidl b/media/java/android/media/MediaParceledListSlice.aidl
new file mode 100644
index 0000000..5c0e5bc
--- /dev/null
+++ b/media/java/android/media/MediaParceledListSlice.aidl
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.media;
+
+/** @hide */
+parcelable MediaParceledListSlice;
diff --git a/media/java/android/media/MediaParceledListSlice.java b/media/java/android/media/MediaParceledListSlice.java
new file mode 100644
index 0000000..16a37d9
--- /dev/null
+++ b/media/java/android/media/MediaParceledListSlice.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.media;
+
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.os.RemoteException;
+import android.util.Log;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Transfer a large list of objects across an IPC. Splits into multiple transactions if needed.
+ * Note: Only use classes declared final in order to avoid subclasses overriding reading/writing
+ * parcel logic.
+ *
+ * TODO: Add test for sending large data
+ * @param <T> A Parcelable class which will be sent over the binder calls.
+ * @hide
+ */
+public class MediaParceledListSlice<T extends Parcelable> implements Parcelable {
+ private static final String TAG = "MediaParceledListSlice";
+ private static final boolean DEBUG = false;
+
+ private static final int MAX_IPC_SIZE = 64 * 1024; // IBinder.MAX_IPC_SIZE
+
+ final List<T> mList;
+
+ public MediaParceledListSlice(List<T> list) {
+ if (list == null) {
+ throw new IllegalArgumentException("list shouldn't be null");
+ }
+ mList = list;
+ }
+
+ MediaParceledListSlice(Parcel p) {
+ final int itemCount = p.readInt();
+ mList = new ArrayList<>(itemCount);
+ if (DEBUG) {
+ Log.d(TAG, "Retrieving " + itemCount + " items");
+ }
+ if (itemCount <= 0) {
+ return;
+ }
+
+ int i = 0;
+ while (i < itemCount) {
+ if (p.readInt() == 0) {
+ break;
+ }
+
+ final T parcelable = p.readParcelable(null);
+ mList.add(parcelable);
+
+ if (DEBUG) {
+ Log.d(TAG, "Read inline #" + i + ": " + mList.get(mList.size() - 1));
+ }
+ i++;
+ }
+ if (i >= itemCount) {
+ return;
+ }
+ final IBinder retriever = p.readStrongBinder();
+ while (i < itemCount) {
+ if (DEBUG) {
+ Log.d(TAG, "Reading more @" + i + " of " + itemCount + ": retriever=" + retriever);
+ }
+ Parcel data = Parcel.obtain();
+ Parcel reply = Parcel.obtain();
+ data.writeInt(i);
+ try {
+ retriever.transact(IBinder.FIRST_CALL_TRANSACTION, data, reply, 0);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failure retrieving array; only received " + i + " of " + itemCount, e);
+ return;
+ }
+ while (i < itemCount && reply.readInt() != 0) {
+ final T parcelable = reply.readParcelable(null);
+ mList.add(parcelable);
+
+ if (DEBUG) {
+ Log.d(TAG, "Read extra #" + i + ": " + mList.get(mList.size() - 1));
+ }
+ i++;
+ }
+ reply.recycle();
+ data.recycle();
+ }
+ }
+
+ public List<T> getList() {
+ return mList;
+ }
+
+ /**
+ * Write this to another Parcel. Note that this discards the internal Parcel
+ * and should not be used anymore. This is so we can pass this to a Binder
+ * where we won't have a chance to call recycle on this.
+ */
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ final int itemCount = mList.size();
+ dest.writeInt(itemCount);
+ if (DEBUG) {
+ Log.d(TAG, "Writing " + itemCount + " items");
+ }
+ if (itemCount > 0) {
+ int i = 0;
+ while (i < itemCount && dest.dataSize() < MAX_IPC_SIZE) {
+ dest.writeInt(1);
+
+ final T parcelable = mList.get(i);
+ dest.writeParcelable(parcelable, flags);
+
+ if (DEBUG) {
+ Log.d(TAG, "Wrote inline #" + i + ": " + mList.get(i));
+ }
+ i++;
+ }
+ if (i < itemCount) {
+ dest.writeInt(0);
+ Binder retriever = new Binder() {
+ @Override
+ protected boolean onTransact(int code, Parcel data, Parcel reply, int flags)
+ throws RemoteException {
+ if (code != FIRST_CALL_TRANSACTION) {
+ return super.onTransact(code, data, reply, flags);
+ }
+ int i = data.readInt();
+ if (DEBUG) {
+ Log.d(TAG, "Writing more @" + i + " of " + itemCount);
+ }
+ while (i < itemCount && reply.dataSize() < MAX_IPC_SIZE) {
+ reply.writeInt(1);
+
+ final T parcelable = mList.get(i);
+ reply.writeParcelable(parcelable, flags);
+
+ if (DEBUG) {
+ Log.d(TAG, "Wrote extra #" + i + ": " + mList.get(i));
+ }
+ i++;
+ }
+ if (i < itemCount) {
+ if (DEBUG) {
+ Log.d(TAG, "Breaking @" + i + " of " + itemCount);
+ }
+ reply.writeInt(0);
+ }
+ return true;
+ }
+ };
+ if (DEBUG) {
+ Log.d(TAG, "Breaking @" + i + " of " + itemCount + ": retriever=" + retriever);
+ }
+ dest.writeStrongBinder(retriever);
+ }
+ }
+ }
+
+ @Override
+ public int describeContents() {
+ int contents = 0;
+ final List<T> list = getList();
+ for (int i = 0; i < list.size(); i++) {
+ contents |= list.get(i).describeContents();
+ }
+ return contents;
+ }
+
+ public static final Parcelable.Creator<MediaParceledListSlice> CREATOR =
+ new Parcelable.Creator<MediaParceledListSlice>() {
+ @Override
+ public MediaParceledListSlice createFromParcel(Parcel in) {
+ return new MediaParceledListSlice(in);
+ }
+
+ @Override
+ public MediaParceledListSlice[] newArray(int size) {
+ return new MediaParceledListSlice[size];
+ }
+ };
+}
diff --git a/media/java/android/media/browse/MediaBrowser.java b/media/java/android/media/browse/MediaBrowser.java
index 2bccd88..b1b14c6 100644
--- a/media/java/android/media/browse/MediaBrowser.java
+++ b/media/java/android/media/browse/MediaBrowser.java
@@ -23,8 +23,8 @@
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
-import android.content.pm.ParceledListSlice;
import android.media.MediaDescription;
+import android.media.MediaParceledListSlice;
import android.media.session.MediaController;
import android.media.session.MediaSession;
import android.os.Binder;
@@ -653,7 +653,7 @@
}
private final void onLoadChildren(final IMediaBrowserServiceCallbacks callback,
- final String parentId, final ParceledListSlice list, final Bundle options) {
+ final String parentId, final MediaParceledListSlice list, final Bundle options) {
mHandler.post(new Runnable() {
@Override
public void run() {
@@ -1107,12 +1107,12 @@
}
@Override
- public void onLoadChildren(String parentId, ParceledListSlice list) {
+ public void onLoadChildren(String parentId, MediaParceledListSlice list) {
onLoadChildrenWithOptions(parentId, list, null);
}
@Override
- public void onLoadChildrenWithOptions(String parentId, ParceledListSlice list,
+ public void onLoadChildrenWithOptions(String parentId, MediaParceledListSlice list,
final Bundle options) {
MediaBrowser mediaBrowser = mMediaBrowser.get();
if (mediaBrowser != null) {
diff --git a/media/java/android/media/session/ControllerLink.java b/media/java/android/media/session/ControllerLink.java
index df1d649..937df20 100644
--- a/media/java/android/media/session/ControllerLink.java
+++ b/media/java/android/media/session/ControllerLink.java
@@ -21,6 +21,7 @@
import android.annotation.SystemApi;
import android.app.PendingIntent;
import android.media.MediaMetadata;
+import android.media.MediaParceledListSlice;
import android.media.Rating;
import android.media.session.MediaController.PlaybackInfo;
import android.net.Uri;
@@ -544,7 +545,8 @@
@Nullable
public List<MediaSession.QueueItem> getQueue() {
try {
- return mISessionController.getQueue();
+ MediaParceledListSlice queue = mISessionController.getQueue();
+ return queue == null ? null : queue.getList();
} catch (RemoteException e) {
throw new RuntimeException(e);
}
@@ -961,8 +963,9 @@
}
@Override
- public List<MediaSession.QueueItem> getQueue() {
- return mControllerStub.getQueue();
+ public MediaParceledListSlice getQueue() {
+ List<MediaSession.QueueItem> queue = mControllerStub.getQueue();
+ return queue == null ? null : new MediaParceledListSlice(queue);
}
@Override
diff --git a/media/java/android/media/session/ISession.aidl b/media/java/android/media/session/ISession.aidl
index 9b4e2bc..9b1ad7b 100644
--- a/media/java/android/media/session/ISession.aidl
+++ b/media/java/android/media/session/ISession.aidl
@@ -18,6 +18,7 @@
import android.app.PendingIntent;
import android.media.AudioAttributes;
import android.media.MediaMetadata;
+import android.media.MediaParceledListSlice;
import android.media.session.ControllerLink;
import android.media.session.PlaybackState;
import android.media.session.MediaSession;
@@ -40,8 +41,7 @@
// These commands are for the TransportPerformer
void setMetadata(in MediaMetadata metadata, long duration, String metadataDescription);
void setPlaybackState(in PlaybackState state);
- // TODO(b/122432476): Replace List with MediaParceledListSlice
- void setQueue(in List<MediaSession.QueueItem> queue);
+ void setQueue(in MediaParceledListSlice queue);
void setQueueTitle(CharSequence title);
void setExtras(in Bundle extras);
void setRatingType(int type);
diff --git a/media/java/android/media/session/ISessionController.aidl b/media/java/android/media/session/ISessionController.aidl
index 787cb77..a3439a1a 100644
--- a/media/java/android/media/session/ISessionController.aidl
+++ b/media/java/android/media/session/ISessionController.aidl
@@ -18,6 +18,7 @@
import android.app.PendingIntent;
import android.content.Intent;
import android.media.MediaMetadata;
+import android.media.MediaParceledListSlice;
import android.media.Rating;
import android.media.session.ControllerCallbackLink;
import android.media.session.MediaController;
@@ -80,7 +81,7 @@
String action, in Bundle args);
MediaMetadata getMetadata();
PlaybackState getPlaybackState();
- List<MediaSession.QueueItem> getQueue();
+ MediaParceledListSlice getQueue();
CharSequence getQueueTitle();
Bundle getExtras();
int getRatingType();
diff --git a/media/java/android/media/session/MediaSession.java b/media/java/android/media/session/MediaSession.java
index 881e6ee..f02d9ba 100644
--- a/media/java/android/media/session/MediaSession.java
+++ b/media/java/android/media/session/MediaSession.java
@@ -154,7 +154,7 @@
throw new IllegalArgumentException("tag cannot be null or empty");
}
mMaxBitmapSize = context.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.config_mediaMetadataBitmapMaxSize);
+ android.R.dimen.config_mediaMetadataBitmapMaxSize);
mCbStub = new SessionCallbackLink(context, new CallbackStub(this));
MediaSessionManager manager = (MediaSessionManager) context
.getSystemService(Context.MEDIA_SESSION_SERVICE);
diff --git a/media/java/android/media/session/MediaSessionManager.java b/media/java/android/media/session/MediaSessionManager.java
index 77e758fc..3f4fbb9 100644
--- a/media/java/android/media/session/MediaSessionManager.java
+++ b/media/java/android/media/session/MediaSessionManager.java
@@ -122,7 +122,6 @@
* {@link MediaSession2.Builder} instead.
*
* @param token newly created session2 token
- * @hide
*/
public void notifySession2Created(@NonNull Session2Token token) {
if (token == null) {
@@ -196,9 +195,7 @@
* reject your uses of {@link MediaSession2}.
*
* @return A list of {@link Session2Token}.
- * @hide
*/
- // TODO: unhide
@NonNull
public List<Session2Token> getSession2Tokens() {
return getSession2Tokens(UserHandle.myUserId());
@@ -209,13 +206,12 @@
* given user.
* <p>
* If you want to get tokens for another user, you must hold the
- * {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} permission.
+ * android.Manifest.permission#INTERACT_ACROSS_USERS_FULL permission.
*
* @param userId The user id to fetch sessions for.
* @return A list of {@link Session2Token}
* @hide
*/
- // TODO: unhide
@NonNull
public List<Session2Token> getSession2Tokens(int userId) {
try {
@@ -342,13 +338,25 @@
* for consistent behavior across all devices.
*
* @param listener The listener to add
- * @param handler The handler to call listener on. If {@code null}, calling thread's looper will
- * be used.
- * @hide
*/
- // TODO(jaewan): Unhide
public void addOnSession2TokensChangedListener(
- @NonNull OnSession2TokensChangedListener listener, @Nullable Handler handler) {
+ @NonNull OnSession2TokensChangedListener listener) {
+ addOnSession2TokensChangedListener(UserHandle.myUserId(), listener, new Handler());
+ }
+
+ /**
+ * Adds a listener to be notified when the {@link #getSession2Tokens()} changes.
+ * <p>
+ * This API is not generally intended for third party application developers.
+ * Use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
+ * <a href="{@docRoot}reference/androidx/media2/package-summary.html">Media2 Library</a>
+ * for consistent behavior across all devices.
+ *
+ * @param listener The listener to add
+ * @param handler The handler to call listener on.
+ */
+ public void addOnSession2TokensChangedListener(
+ @NonNull OnSession2TokensChangedListener listener, @NonNull Handler handler) {
addOnSession2TokensChangedListener(UserHandle.myUserId(), listener, handler);
}
@@ -392,9 +400,7 @@
* Removes the {@link OnSession2TokensChangedListener} to stop receiving session token updates.
*
* @param listener The listener to remove.
- * @hide
*/
- // TODO(jaewan): Unhide
public void removeOnSession2TokensChangedListener(
@NonNull OnSession2TokensChangedListener listener) {
if (listener == null) {
@@ -688,8 +694,6 @@
* Use the <a href="{@docRoot}jetpack/androidx.html">AndroidX</a>
* <a href="{@docRoot}reference/androidx/media2/package-summary.html">Media2 Library</a>
* for consistent behavior across all devices.
- *
- * @hide
*/
public interface OnSession2TokensChangedListener {
/**
diff --git a/media/java/android/media/session/PlaybackState.java b/media/java/android/media/session/PlaybackState.java
index 17d16b8..2c57d1f 100644
--- a/media/java/android/media/session/PlaybackState.java
+++ b/media/java/android/media/session/PlaybackState.java
@@ -25,11 +25,11 @@
import android.os.Parcelable;
import android.os.SystemClock;
import android.text.TextUtils;
-import java.util.ArrayList;
-import java.util.List;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.util.ArrayList;
+import java.util.List;
/**
* Playback state for a {@link MediaSession}. This includes a state like
@@ -318,7 +318,7 @@
mActions = in.readLong();
mCustomActions = in.createTypedArrayList(CustomAction.CREATOR);
mActiveItemId = in.readLong();
- mErrorMessage = in.readCharSequence();
+ mErrorMessage = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(in);
mExtras = in.readBundle();
}
@@ -353,7 +353,7 @@
dest.writeLong(mActions);
dest.writeTypedList(mCustomActions);
dest.writeLong(mActiveItemId);
- dest.writeCharSequence(mErrorMessage);
+ TextUtils.writeToParcel(mErrorMessage, dest, 0);
dest.writeBundle(mExtras);
}
diff --git a/media/java/android/media/session/SessionLink.java b/media/java/android/media/session/SessionLink.java
index 466077e..0da0a5a 100644
--- a/media/java/android/media/session/SessionLink.java
+++ b/media/java/android/media/session/SessionLink.java
@@ -22,6 +22,7 @@
import android.app.PendingIntent;
import android.media.AudioAttributes;
import android.media.MediaMetadata;
+import android.media.MediaParceledListSlice;
import android.media.Rating;
import android.media.VolumeProvider;
import android.media.session.MediaSession.QueueItem;
@@ -196,7 +197,7 @@
*/
void setQueue(@Nullable List<QueueItem> queue) {
try {
- mISession.setQueue(queue);
+ mISession.setQueue(queue == null ? null : new MediaParceledListSlice(queue));
} catch (RemoteException e) {
throw new RuntimeException(e);
}
@@ -416,8 +417,8 @@
}
@Override
- public void setQueue(List<QueueItem> queue) {
- mSessionStub.setQueue(queue);
+ public void setQueue(MediaParceledListSlice queue) {
+ mSessionStub.setQueue(queue == null ? null : queue.getList());
}
@Override
diff --git a/media/java/android/media/tv/TvInputInfo.java b/media/java/android/media/tv/TvInputInfo.java
index 5cb8fb8..30907a5 100644
--- a/media/java/android/media/tv/TvInputInfo.java
+++ b/media/java/android/media/tv/TvInputInfo.java
@@ -33,7 +33,10 @@
import android.content.res.XmlResourceParser;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
+import android.hardware.hdmi.HdmiControlManager;
import android.hardware.hdmi.HdmiDeviceInfo;
+import android.hardware.hdmi.HdmiUtils;
+import android.hardware.hdmi.HdmiUtils.HdmiAddressRelativePosition;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcel;
@@ -49,7 +52,6 @@
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Retention;
@@ -145,6 +147,8 @@
// Attributes specific to HDMI
private final HdmiDeviceInfo mHdmiDeviceInfo;
private final boolean mIsConnectedToHdmiSwitch;
+ @HdmiAddressRelativePosition
+ private final int mHdmiConnectionRelativePosition;
private final String mParentId;
private final Bundle mExtras;
@@ -260,7 +264,9 @@
private TvInputInfo(ResolveInfo service, String id, int type, boolean isHardwareInput,
CharSequence label, int labelResId, Icon icon, Icon iconStandby, Icon iconDisconnected,
String setupActivity, boolean canRecord, int tunerCount, HdmiDeviceInfo hdmiDeviceInfo,
- boolean isConnectedToHdmiSwitch, String parentId, Bundle extras) {
+ boolean isConnectedToHdmiSwitch,
+ @HdmiAddressRelativePosition int hdmiConnectionRelativePosition, String parentId,
+ Bundle extras) {
mService = service;
mId = id;
mType = type;
@@ -275,6 +281,7 @@
mTunerCount = tunerCount;
mHdmiDeviceInfo = hdmiDeviceInfo;
mIsConnectedToHdmiSwitch = isConnectedToHdmiSwitch;
+ mHdmiConnectionRelativePosition = hdmiConnectionRelativePosition;
mParentId = parentId;
mExtras = extras;
}
@@ -419,6 +426,7 @@
/**
* Returns {@code true}, if a CEC device for this TV input is connected to an HDMI switch, i.e.,
* the device isn't directly connected to a HDMI port.
+ * TODO(b/110094868): add @Deprecated for Q
* @hide
*/
@SystemApi
@@ -427,6 +435,16 @@
}
/**
+ * Returns the relative position of this HDMI input.
+ * TODO(b/110094868): unhide for Q
+ * @hide
+ */
+ @HdmiAddressRelativePosition
+ public int getHdmiConnectionRelativePosition() {
+ return mHdmiConnectionRelativePosition;
+ }
+
+ /**
* Checks if this TV input is marked hidden by the user in the settings.
*
* @param context Supplies a {@link Context} used to check if this TV input is hidden.
@@ -555,6 +573,7 @@
&& mTunerCount == obj.mTunerCount
&& Objects.equals(mHdmiDeviceInfo, obj.mHdmiDeviceInfo)
&& mIsConnectedToHdmiSwitch == obj.mIsConnectedToHdmiSwitch
+ && mHdmiConnectionRelativePosition == obj.mHdmiConnectionRelativePosition
&& TextUtils.equals(mParentId, obj.mParentId)
&& Objects.equals(mExtras, obj.mExtras);
}
@@ -589,6 +608,7 @@
dest.writeInt(mTunerCount);
dest.writeParcelable(mHdmiDeviceInfo, flags);
dest.writeByte(mIsConnectedToHdmiSwitch ? (byte) 1 : 0);
+ dest.writeInt(mHdmiConnectionRelativePosition);
dest.writeString(mParentId);
dest.writeBundle(mExtras);
}
@@ -630,6 +650,7 @@
mTunerCount = in.readInt();
mHdmiDeviceInfo = in.readParcelable(null);
mIsConnectedToHdmiSwitch = in.readByte() == 1;
+ mHdmiConnectionRelativePosition = in.readInt();
mParentId = in.readString();
mExtras = in.readBundle();
}
@@ -883,12 +904,17 @@
int type;
boolean isHardwareInput = false;
boolean isConnectedToHdmiSwitch = false;
+ @HdmiAddressRelativePosition
+ int hdmiConnectionRelativePosition = HdmiUtils.HDMI_RELATIVE_POSITION_UNKNOWN;
if (mHdmiDeviceInfo != null) {
id = generateInputId(componentName, mHdmiDeviceInfo);
type = TYPE_HDMI;
isHardwareInput = true;
- isConnectedToHdmiSwitch = (mHdmiDeviceInfo.getPhysicalAddress() & 0x0FFF) != 0;
+ hdmiConnectionRelativePosition = getRelativePosition(mContext, mHdmiDeviceInfo);
+ isConnectedToHdmiSwitch =
+ hdmiConnectionRelativePosition
+ != HdmiUtils.HDMI_RELATIVE_POSITION_DIRECTLY_BELOW;
} else if (mTvInputHardwareInfo != null) {
id = generateInputId(componentName, mTvInputHardwareInfo);
type = sHardwareTypeToTvInputType.get(mTvInputHardwareInfo.getType(), TYPE_TUNER);
@@ -901,7 +927,8 @@
return new TvInputInfo(mResolveInfo, id, type, isHardwareInput, mLabel, mLabelResId,
mIcon, mIconStandby, mIconDisconnected, mSetupActivity,
mCanRecord == null ? false : mCanRecord, mTunerCount == null ? 0 : mTunerCount,
- mHdmiDeviceInfo, isConnectedToHdmiSwitch, mParentId, mExtras);
+ mHdmiDeviceInfo, isConnectedToHdmiSwitch, hdmiConnectionRelativePosition,
+ mParentId, mExtras);
}
private static String generateInputId(ComponentName name) {
@@ -923,6 +950,16 @@
+ tvInputHardwareInfo.getDeviceId();
}
+ private static int getRelativePosition(Context context, HdmiDeviceInfo info) {
+ HdmiControlManager hcm =
+ (HdmiControlManager) context.getSystemService(Context.HDMI_CONTROL_SERVICE);
+ if (hcm == null) {
+ return HdmiUtils.HDMI_RELATIVE_POSITION_UNKNOWN;
+ }
+ return HdmiUtils.getHdmiAddressRelativePosition(
+ info.getPhysicalAddress(), hcm.getPhysicalAddress());
+ }
+
private void parseServiceMetadata(int inputType) {
ServiceInfo si = mResolveInfo.serviceInfo;
PackageManager pm = mContext.getPackageManager();
diff --git a/media/java/android/service/media/IMediaBrowserServiceCallbacks.aidl b/media/java/android/service/media/IMediaBrowserServiceCallbacks.aidl
index deeab1a..8dc480d 100644
--- a/media/java/android/service/media/IMediaBrowserServiceCallbacks.aidl
+++ b/media/java/android/service/media/IMediaBrowserServiceCallbacks.aidl
@@ -2,8 +2,8 @@
package android.service.media;
-import android.content.pm.ParceledListSlice;
import android.graphics.Bitmap;
+import android.media.MediaParceledListSlice;
import android.media.session.MediaSession;
import android.os.Bundle;
@@ -22,6 +22,7 @@
*/
void onConnect(String root, in MediaSession.Token session, in Bundle extras);
void onConnectFailed();
- void onLoadChildren(String mediaId, in ParceledListSlice list);
- void onLoadChildrenWithOptions(String mediaId, in ParceledListSlice list, in Bundle options);
+ void onLoadChildren(String mediaId, in MediaParceledListSlice list);
+ void onLoadChildrenWithOptions(String mediaId, in MediaParceledListSlice list,
+ in Bundle options);
}
diff --git a/media/java/android/service/media/MediaBrowserService.java b/media/java/android/service/media/MediaBrowserService.java
index 5a60ac1..d19d117 100644
--- a/media/java/android/service/media/MediaBrowserService.java
+++ b/media/java/android/service/media/MediaBrowserService.java
@@ -25,21 +25,18 @@
import android.app.Service;
import android.content.Intent;
import android.content.pm.PackageManager;
-import android.content.pm.ParceledListSlice;
+import android.media.MediaParceledListSlice;
import android.media.browse.MediaBrowser;
import android.media.browse.MediaBrowserUtils;
import android.media.session.MediaSession;
+import android.media.session.MediaSessionManager;
+import android.media.session.MediaSessionManager.RemoteUserInfo;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
-import android.media.session.MediaSessionManager;
-import android.media.session.MediaSessionManager.RemoteUserInfo;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ResultReceiver;
-import android.service.media.IMediaBrowserService;
-import android.service.media.IMediaBrowserServiceCallbacks;
-import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.Log;
import android.util.Pair;
@@ -672,8 +669,8 @@
*/
private void performLoadChildren(final String parentId, final ConnectionRecord connection,
final Bundle options) {
- final Result<List<MediaBrowser.MediaItem>> result
- = new Result<List<MediaBrowser.MediaItem>>(parentId) {
+ final Result<List<MediaBrowser.MediaItem>> result =
+ new Result<List<MediaBrowser.MediaItem>>(parentId) {
@Override
void onResultSent(List<MediaBrowser.MediaItem> list, @ResultFlags int flag) {
if (mConnections.get(connection.callbacks.asBinder()) != connection) {
@@ -686,9 +683,9 @@
List<MediaBrowser.MediaItem> filteredList =
(flag & RESULT_FLAG_OPTION_NOT_HANDLED) != 0
- ? applyOptions(list, options) : list;
- final ParceledListSlice<MediaBrowser.MediaItem> pls =
- filteredList == null ? null : new ParceledListSlice<>(filteredList);
+ ? applyOptions(list, options) : list;
+ final MediaParceledListSlice<MediaBrowser.MediaItem> pls =
+ filteredList == null ? null : new MediaParceledListSlice<>(filteredList);
try {
connection.callbacks.onLoadChildrenWithOptions(parentId, pls, options);
} catch (RemoteException ex) {
diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt
index 8be8eda..97ebe38 100644
--- a/native/android/libandroid.map.txt
+++ b/native/android/libandroid.map.txt
@@ -172,6 +172,7 @@
ASensorEventQueue_hasEvents;
ASensorEventQueue_registerSensor; # introduced=26
ASensorEventQueue_setEventRate;
+ ASensorEventQueue_requestAdditionalInfoEvents; # introduced=29
ASensorManager_configureDirectReport; # introduced=26
ASensorManager_createEventQueue;
ASensorManager_createHardwareBufferDirectChannel; # introduced=26
@@ -185,6 +186,7 @@
ASensorManager_getSensorList;
ASensor_getFifoMaxEventCount; # introduced=21
ASensor_getFifoReservedEventCount; # introduced=21
+ ASensor_getHandle; # introduced=29
ASensor_getHighestDirectReportRateLevel; # introduced=26
ASensor_getMinDelay;
ASensor_getName;
diff --git a/native/android/sensor.cpp b/native/android/sensor.cpp
index c3b2e25..63082fd 100644
--- a/native/android/sensor.cpp
+++ b/native/android/sensor.cpp
@@ -115,6 +115,7 @@
if (queue != 0) {
ALooper_addFd(looper, queue->getFd(), ident, ALOOPER_EVENT_INPUT, callback, data);
queue->looper = looper;
+ queue->requestAdditionalInfo = false;
queue->incStrong(manager);
}
return static_cast<ASensorEventQueue*>(queue.get());
@@ -274,11 +275,19 @@
return android::BAD_VALUE;
}
- ssize_t actual = static_cast<SensorEventQueue*>(queue)->read(events, count);
+ SensorEventQueue* sensorQueue = static_cast<SensorEventQueue*>(queue);
+ ssize_t actual = sensorQueue->read(events, count);
if (actual > 0) {
- static_cast<SensorEventQueue*>(queue)->sendAck(events, actual);
+ sensorQueue->sendAck(events, actual);
}
- return actual;
+
+ return sensorQueue->filterEvents(events, actual);
+}
+
+int ASensorEventQueue_requestAdditionalInfoEvents(ASensorEventQueue* queue, bool enable) {
+ RETURN_IF_QUEUE_IS_NULL(android::BAD_VALUE);
+ queue->requestAdditionalInfo = enable;
+ return android::OK;
}
/*****************************************************************************/
diff --git a/packages/NetworkStack/src/android/net/dhcp/DhcpServer.java b/packages/NetworkStack/src/android/net/dhcp/DhcpServer.java
index 14e2936..7b112df 100644
--- a/packages/NetworkStack/src/android/net/dhcp/DhcpServer.java
+++ b/packages/NetworkStack/src/android/net/dhcp/DhcpServer.java
@@ -29,7 +29,6 @@
import static android.system.OsConstants.IPPROTO_UDP;
import static android.system.OsConstants.SOCK_DGRAM;
import static android.system.OsConstants.SOL_SOCKET;
-import static android.system.OsConstants.SO_BINDTODEVICE;
import static android.system.OsConstants.SO_BROADCAST;
import static android.system.OsConstants.SO_REUSEADDR;
@@ -45,6 +44,7 @@
import android.net.NetworkUtils;
import android.net.TrafficStats;
import android.net.util.SharedLog;
+import android.net.util.SocketUtils;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
@@ -629,14 +629,10 @@
final int oldTag = TrafficStats.getAndSetThreadStatsTag(TAG_SYSTEM_DHCP_SERVER);
try {
mSocket = Os.socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ SocketUtils.bindSocketToInterface(mSocket, mIfName);
Os.setsockoptInt(mSocket, SOL_SOCKET, SO_REUSEADDR, 1);
- // SO_BINDTODEVICE actually takes a string. This works because the first member
- // of struct ifreq is a NULL-terminated interface name.
- // TODO: add a setsockoptString()
- Os.setsockoptIfreq(mSocket, SOL_SOCKET, SO_BINDTODEVICE, mIfName);
Os.setsockoptInt(mSocket, SOL_SOCKET, SO_BROADCAST, 1);
Os.bind(mSocket, Inet4Address.ANY, DHCP_SERVER);
- NetworkUtils.protectFromVpn(mSocket);
return mSocket;
} catch (IOException | ErrnoException e) {
diff --git a/packages/NetworkStack/src/android/net/dhcp/DhcpServingParams.java b/packages/NetworkStack/src/android/net/dhcp/DhcpServingParams.java
index f38888a..868f3be 100644
--- a/packages/NetworkStack/src/android/net/dhcp/DhcpServingParams.java
+++ b/packages/NetworkStack/src/android/net/dhcp/DhcpServingParams.java
@@ -30,10 +30,10 @@
import android.net.IpPrefix;
import android.net.LinkAddress;
import android.net.NetworkUtils;
-
-import com.google.android.collect.Sets;
+import android.util.ArraySet;
import java.net.Inet4Address;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -208,7 +208,7 @@
* but it must always be set explicitly before building the {@link DhcpServingParams}.
*/
public Builder setDefaultRouters(@NonNull Inet4Address... defaultRouters) {
- return setDefaultRouters(Sets.newArraySet(defaultRouters));
+ return setDefaultRouters(new ArraySet<>(Arrays.asList(defaultRouters)));
}
/**
@@ -238,7 +238,7 @@
* building the {@link DhcpServingParams}.
*/
public Builder setDnsServers(@NonNull Inet4Address... dnsServers) {
- return setDnsServers(Sets.newArraySet(dnsServers));
+ return setDnsServers(new ArraySet<>(Arrays.asList(dnsServers)));
}
/**
@@ -268,7 +268,7 @@
* and do not need to be set here.
*/
public Builder setExcludedAddrs(@NonNull Inet4Address... excludedAddrs) {
- return setExcludedAddrs(Sets.newArraySet(excludedAddrs));
+ return setExcludedAddrs(new ArraySet<>(Arrays.asList(excludedAddrs)));
}
/**
diff --git a/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java b/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
index 4077d93..a3d7852 100644
--- a/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
+++ b/packages/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java
@@ -24,6 +24,7 @@
import static android.net.ConnectivityManager.TYPE_MOBILE;
import static android.net.ConnectivityManager.TYPE_WIFI;
import static android.net.INetworkMonitor.NETWORK_TEST_RESULT_INVALID;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_METERED;
import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
import static android.net.metrics.ValidationProbeEvent.DNS_FAILURE;
@@ -80,7 +81,6 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
-import com.android.internal.util.Protocol;
import com.android.internal.util.RingBufferIndices;
import com.android.internal.util.State;
import com.android.internal.util.StateMachine;
@@ -150,29 +150,28 @@
}
}
- private static final int BASE = Protocol.BASE_NETWORK_MONITOR;
/**
* ConnectivityService has sent a notification to indicate that network has connected.
* Initiates Network Validation.
*/
- private static final int CMD_NETWORK_CONNECTED = BASE + 1;
+ private static final int CMD_NETWORK_CONNECTED = 1;
/**
* Message to self indicating it's time to evaluate a network's connectivity.
* arg1 = Token to ignore old messages.
*/
- private static final int CMD_REEVALUATE = BASE + 6;
+ private static final int CMD_REEVALUATE = 6;
/**
* ConnectivityService has sent a notification to indicate that network has disconnected.
*/
- private static final int CMD_NETWORK_DISCONNECTED = BASE + 7;
+ private static final int CMD_NETWORK_DISCONNECTED = 7;
/**
* Force evaluation even if it has succeeded in the past.
* arg1 = UID responsible for requesting this reeval. Will be billed for data.
*/
- private static final int CMD_FORCE_REEVALUATION = BASE + 8;
+ private static final int CMD_FORCE_REEVALUATION = 8;
/**
* Message to self indicating captive portal app finished.
@@ -181,7 +180,7 @@
* APP_RETURN_WANTED_AS_IS
* obj = mCaptivePortalLoggedInResponseToken as String
*/
- private static final int CMD_CAPTIVE_PORTAL_APP_FINISHED = BASE + 9;
+ private static final int CMD_CAPTIVE_PORTAL_APP_FINISHED = 9;
/**
* Message indicating sign-in app should be launched.
@@ -190,14 +189,14 @@
* ConnectivityService when the user touches the "sign into
* network" button in the wifi access point detail page.
*/
- private static final int CMD_LAUNCH_CAPTIVE_PORTAL_APP = BASE + 11;
+ private static final int CMD_LAUNCH_CAPTIVE_PORTAL_APP = 11;
/**
* Retest network to see if captive portal is still in place.
* arg1 = UID responsible for requesting this reeval. Will be billed for data.
* 0 indicates self-initiated, so nobody to blame.
*/
- private static final int CMD_CAPTIVE_PORTAL_RECHECK = BASE + 12;
+ private static final int CMD_CAPTIVE_PORTAL_RECHECK = 12;
/**
* ConnectivityService notifies NetworkMonitor of settings changes to
@@ -210,20 +209,20 @@
* states, including being ignored until after an ongoing captive portal
* validation phase is completed.
*/
- private static final int CMD_PRIVATE_DNS_SETTINGS_CHANGED = BASE + 13;
- private static final int CMD_EVALUATE_PRIVATE_DNS = BASE + 15;
+ private static final int CMD_PRIVATE_DNS_SETTINGS_CHANGED = 13;
+ private static final int CMD_EVALUATE_PRIVATE_DNS = 15;
/**
* Message to self indicating captive portal detection is completed.
* obj = CaptivePortalProbeResult for detection result;
*/
- public static final int CMD_PROBE_COMPLETE = BASE + 16;
+ public static final int CMD_PROBE_COMPLETE = 16;
/**
* ConnectivityService notifies NetworkMonitor of DNS query responses event.
* arg1 = returncode in OnDnsEvent which indicates the response code for the DNS query.
*/
- public static final int EVENT_DNS_NOTIFICATION = BASE + 17;
+ public static final int EVENT_DNS_NOTIFICATION = 17;
// Start mReevaluateDelayMs at this value and double.
private static final int INITIAL_REEVALUATE_DELAY_MS = 1000;
@@ -245,7 +244,6 @@
private final INetworkMonitorCallbacks mCallback;
private final Network mNetwork;
private final Network mNonPrivateDnsBypassNetwork;
- private final int mNetId;
private final TelephonyManager mTelephonyManager;
private final WifiManager mWifiManager;
private final ConnectivityManager mCm;
@@ -322,7 +320,7 @@
NetworkRequest defaultRequest, IpConnectivityLog logger, SharedLog validationLogs,
Dependencies deps) {
// Add suffix indicating which NetworkMonitor we're talking about.
- super(TAG + "/" + network.netId);
+ super(TAG + "/" + network.toString());
// Logs with a tag of the form given just above, e.g.
// <timestamp> 862 2402 D NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: ...
@@ -335,7 +333,6 @@
mDependencies = deps;
mNonPrivateDnsBypassNetwork = network;
mNetwork = deps.getPrivateDnsBypassNetwork(network);
- mNetId = mNetwork.netId;
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
mCm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
@@ -471,7 +468,7 @@
@Override
protected void log(String s) {
- if (DBG) Log.d(TAG + "/" + mNetwork.netId, s);
+ if (DBG) Log.d(TAG + "/" + mNetwork.toString(), s);
}
private void validationLog(int probeType, Object url, String msg) {
@@ -795,7 +792,7 @@
CustomIntentReceiver(String action, int token, int what) {
mToken = token;
mWhat = what;
- mAction = action + "_" + mNetId + "_" + token;
+ mAction = action + "_" + mNetwork.getNetworkHandle() + "_" + token;
mContext.registerReceiver(this, new IntentFilter(mAction));
}
public PendingIntent getPendingIntent() {
@@ -1088,11 +1085,6 @@
return mDependencies.getSetting(mContext, Settings.Global.CAPTIVE_PORTAL_USE_HTTPS, 1) == 1;
}
- private boolean getWifiScansAlwaysAvailableDisabled() {
- return mDependencies.getSetting(
- mContext, Settings.Global.WIFI_SCAN_ALWAYS_AVAILABLE, 0) == 0;
- }
-
private String getCaptivePortalServerHttpsUrl() {
return mDependencies.getSetting(mContext,
Settings.Global.CAPTIVE_PORTAL_HTTPS_URL, DEFAULT_HTTPS_URL);
@@ -1484,7 +1476,7 @@
*/
private void sendNetworkConditionsBroadcast(boolean responseReceived, boolean isCaptivePortal,
long requestTimestampMs, long responseTimestampMs) {
- if (getWifiScansAlwaysAvailableDisabled()) {
+ if (!mWifiManager.isScanAlwaysAvailable()) {
return;
}
@@ -1568,7 +1560,7 @@
private void logNetworkEvent(int evtype) {
int[] transports = mNetworkCapabilities.getTransportTypes();
- mMetricsLog.log(mNetId, transports, new NetworkEvent(evtype));
+ mMetricsLog.log(mNetwork, transports, new NetworkEvent(evtype));
}
private int networkEventType(ValidationStage s, EvaluationResult r) {
@@ -1590,7 +1582,8 @@
private void maybeLogEvaluationResult(int evtype) {
if (mEvaluationTimer.isRunning()) {
int[] transports = mNetworkCapabilities.getTransportTypes();
- mMetricsLog.log(mNetId, transports, new NetworkEvent(evtype, mEvaluationTimer.stop()));
+ mMetricsLog.log(mNetwork, transports,
+ new NetworkEvent(evtype, mEvaluationTimer.stop()));
mEvaluationTimer.reset();
}
}
@@ -1598,11 +1591,12 @@
private void logValidationProbe(long durationMs, int probeType, int probeResult) {
int[] transports = mNetworkCapabilities.getTransportTypes();
boolean isFirstValidation = validationStage().mIsFirstValidation;
- ValidationProbeEvent ev = new ValidationProbeEvent();
- ev.probeType = ValidationProbeEvent.makeProbeType(probeType, isFirstValidation);
- ev.returnCode = probeResult;
- ev.durationMs = durationMs;
- mMetricsLog.log(mNetId, transports, ev);
+ ValidationProbeEvent ev = new ValidationProbeEvent.Builder()
+ .setProbeType(probeType, isFirstValidation)
+ .setReturnCode(probeResult)
+ .setDurationMs(durationMs)
+ .build();
+ mMetricsLog.log(mNetwork, transports, ev);
}
@VisibleForTesting
@@ -1742,7 +1736,7 @@
boolean result = false;
// Reevaluation will generate traffic. Thus, set a minimal reevaluation timer to limit the
// possible traffic cost in metered network.
- if (mNetworkCapabilities.isMetered()
+ if (!mNetworkCapabilities.hasCapability(NET_CAPABILITY_NOT_METERED)
&& (SystemClock.elapsedRealtime() - getLastProbeTime()
< mDataStallMinEvaluateTime)) {
return false;
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
index 24d7011..c059156 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/A2dpProfile.java
@@ -74,6 +74,7 @@
device.refresh();
}
mIsProfileReady=true;
+ mProfileManager.callServiceConnectedListeners();
}
public void onServiceDisconnected(int profile) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java
index 577d98d..77dfbe9 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/HearingAidProfile.java
@@ -71,8 +71,8 @@
// Check current list of CachedDevices to see if any are Hearing Aid devices.
mDeviceManager.updateHearingAidsDevices();
-
mIsProfileReady=true;
+ mProfileManager.callServiceConnectedListeners();
}
public void onServiceDisconnected(int profile) {
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaDevice.java b/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaDevice.java
index 959f9b2..a5c6f0c 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaDevice.java
@@ -54,17 +54,17 @@
}
@Override
- public void connect() {
+ public boolean connect() {
//TODO(b/117129183): add callback to notify LocalMediaManager connection state.
- mIsConnected = mCachedDevice.setActive();
- super.connect();
- Log.d(TAG, "connect() device : " + getName() + ", is selected : " + mIsConnected);
+ final boolean isConnected = mCachedDevice.setActive();
+ setConnectedRecord();
+ Log.d(TAG, "connect() device : " + getName() + ", is selected : " + isConnected);
+ return isConnected;
}
@Override
public void disconnect() {
//TODO(b/117129183): disconnected last select device
- mIsConnected = false;
}
/**
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java
index ab1cca0..fa2dd88 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/BluetoothMediaManager.java
@@ -18,6 +18,7 @@
import android.app.Notification;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.util.Log;
@@ -35,36 +36,48 @@
/**
* BluetoothMediaManager provide interface to get Bluetooth device list.
*/
-public class BluetoothMediaManager extends MediaManager implements BluetoothCallback {
+public class BluetoothMediaManager extends MediaManager implements BluetoothCallback,
+ LocalBluetoothProfileManager.ServiceListener {
private static final String TAG = "BluetoothMediaManager";
- private final DeviceAttributeChangeCallback mCachedDeviceCallback =
- new DeviceAttributeChangeCallback();
-
private LocalBluetoothManager mLocalBluetoothManager;
private LocalBluetoothProfileManager mProfileManager;
+ private CachedBluetoothDeviceManager mCachedBluetoothDeviceManager;
private MediaDevice mLastAddedDevice;
private MediaDevice mLastRemovedDevice;
+ private boolean mIsA2dpProfileReady = false;
+ private boolean mIsHearingAidProfileReady = false;
+
BluetoothMediaManager(Context context, LocalBluetoothManager localBluetoothManager,
Notification notification) {
super(context, notification);
mLocalBluetoothManager = localBluetoothManager;
mProfileManager = mLocalBluetoothManager.getProfileManager();
+ mCachedBluetoothDeviceManager = mLocalBluetoothManager.getCachedDeviceManager();
}
@Override
public void startScan() {
- mMediaDevices.clear();
mLocalBluetoothManager.getEventManager().registerCallback(this);
buildBluetoothDeviceList();
dispatchDeviceListAdded();
+
+ // The profile may not ready when calling startScan().
+ // Device status are all disconnected since profiles are not ready to connected.
+ // In this case, we observe onServiceConnected() in LocalBluetoothProfileManager.
+ // When A2dpProfile or HearingAidProfile is connected will call buildBluetoothDeviceList()
+ // again to find the connected devices.
+ if (!mIsA2dpProfileReady || !mIsHearingAidProfileReady) {
+ mProfileManager.addServiceListener(this);
+ }
}
private void buildBluetoothDeviceList() {
+ mMediaDevices.clear();
addConnectedA2dpDevices();
addConnectedHearingAidDevices();
}
@@ -77,12 +90,10 @@
}
final List<BluetoothDevice> devices = a2dpProfile.getConnectedDevices();
- final CachedBluetoothDeviceManager cachedBluetoothDeviceManager =
- mLocalBluetoothManager.getCachedDeviceManager();
for (BluetoothDevice device : devices) {
final CachedBluetoothDevice cachedDevice =
- cachedBluetoothDeviceManager.findDevice(device);
+ mCachedBluetoothDeviceManager.findDevice(device);
if (cachedDevice == null) {
Log.w(TAG, "Can't found CachedBluetoothDevice : " + device.getName());
@@ -96,6 +107,8 @@
addMediaDevice(cachedDevice);
}
}
+
+ mIsA2dpProfileReady = a2dpProfile.isProfileReady();
}
private void addConnectedHearingAidDevices() {
@@ -107,12 +120,10 @@
final List<Long> devicesHiSyncIds = new ArrayList<>();
final List<BluetoothDevice> devices = hapProfile.getConnectedDevices();
- final CachedBluetoothDeviceManager cachedBluetoothDeviceManager =
- mLocalBluetoothManager.getCachedDeviceManager();
for (BluetoothDevice device : devices) {
final CachedBluetoothDevice cachedDevice =
- cachedBluetoothDeviceManager.findDevice(device);
+ mCachedBluetoothDeviceManager.findDevice(device);
if (cachedDevice == null) {
Log.w(TAG, "Can't found CachedBluetoothDevice : " + device.getName());
@@ -130,13 +141,14 @@
addMediaDevice(cachedDevice);
}
}
+
+ mIsHearingAidProfileReady = hapProfile.isProfileReady();
}
private void addMediaDevice(CachedBluetoothDevice cachedDevice) {
MediaDevice mediaDevice = findMediaDevice(MediaDeviceUtils.getId(cachedDevice));
if (mediaDevice == null) {
mediaDevice = new BluetoothMediaDevice(mContext, cachedDevice);
- cachedDevice.registerCallback(mCachedDeviceCallback);
mLastAddedDevice = mediaDevice;
mMediaDevices.add(mediaDevice);
}
@@ -145,16 +157,6 @@
@Override
public void stopScan() {
mLocalBluetoothManager.getEventManager().unregisterCallback(this);
- unregisterCachedDeviceCallback();
- }
-
- private void unregisterCachedDeviceCallback() {
- for (MediaDevice device : mMediaDevices) {
- if (device instanceof BluetoothMediaDevice) {
- ((BluetoothMediaDevice) device).getCachedDevice()
- .unregisterCallback(mCachedDeviceCallback);
- }
- }
}
@Override
@@ -166,8 +168,6 @@
final List<MediaDevice> removeDevicesList = new ArrayList<>();
for (MediaDevice device : mMediaDevices) {
if (device instanceof BluetoothMediaDevice) {
- ((BluetoothMediaDevice) device).getCachedDevice()
- .unregisterCallback(mCachedDeviceCallback);
removeDevicesList.add(device);
}
}
@@ -212,7 +212,6 @@
private void removeMediaDevice(CachedBluetoothDevice cachedDevice) {
final MediaDevice mediaDevice = findMediaDevice(MediaDeviceUtils.getId(cachedDevice));
if (mediaDevice != null) {
- cachedDevice.unregisterCallback(mCachedDeviceCallback);
mLastRemovedDevice = mediaDevice;
mMediaDevices.remove(mediaDevice);
}
@@ -252,10 +251,34 @@
dispatchDeviceRemoved(cachedDevice);
}
}
- class DeviceAttributeChangeCallback implements CachedBluetoothDevice.Callback {
- @Override
- public void onDeviceAttributesChanged() {
- dispatchDeviceAttributesChanged();
+
+ @Override
+ public void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile) {
+ Log.d(TAG, "onActiveDeviceChanged : device : "
+ + activeDevice + ", profile : " + bluetoothProfile);
+ if (BluetoothProfile.HEARING_AID == bluetoothProfile
+ || BluetoothProfile.A2DP == bluetoothProfile) {
+ final String id = activeDevice == null
+ ? PhoneMediaDevice.ID : MediaDeviceUtils.getId(activeDevice);
+ dispatchConnectedDeviceChanged(id);
}
}
+
+ @Override
+ public void onServiceConnected() {
+ if (!mIsA2dpProfileReady || !mIsHearingAidProfileReady) {
+ buildBluetoothDeviceList();
+ dispatchDeviceListAdded();
+ }
+
+ //Remove the listener once a2dpProfile and hearingAidProfile are ready.
+ if (mIsA2dpProfileReady && mIsHearingAidProfileReady) {
+ mProfileManager.removeServiceListener(this);
+ }
+ }
+
+ @Override
+ public void onServiceDisconnected() {
+
+ }
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaDevice.java b/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaDevice.java
index 21a81e0..04f70cc 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaDevice.java
@@ -16,6 +16,7 @@
package com.android.settingslib.media;
import android.content.Context;
+import android.widget.Toast;
import androidx.mediarouter.media.MediaRouter;
@@ -43,7 +44,7 @@
@Override
public int getIcon() {
- //TODO(b/117129183): This is not final icon for cast device, just for demo.
+ //TODO(b/121083246): This is not final icon for cast device, just for demo.
return R.drawable.ic_settings_print;
}
@@ -53,15 +54,15 @@
}
@Override
- public void connect() {
- //TODO(b/117129183): use MediaController2 to transfer media
- mIsConnected = true;
- super.connect();
+ public boolean connect() {
+ //TODO(b/121083246): use SystemApi to transfer media
+ setConnectedRecord();
+ Toast.makeText(mContext, "This is cast device !", Toast.LENGTH_SHORT).show();
+ return false;
}
@Override
public void disconnect() {
- //TODO(b/117129183): disconnected last select device
- mIsConnected = false;
+ //TODO(b/121083246): disconnected last select device
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java
index 6907238..bc8e2c3 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java
@@ -22,6 +22,8 @@
import androidx.mediarouter.media.MediaRouteSelector;
import androidx.mediarouter.media.MediaRouter;
+import com.android.internal.annotations.VisibleForTesting;
+
/**
* InfoMediaManager provide interface to get InfoMediaDevice list.
*/
@@ -29,9 +31,13 @@
private static final String TAG = "InfoMediaManager";
- private final MediaRouterCallback mMediaRouterCallback = new MediaRouterCallback();
+ @VisibleForTesting
+ final MediaRouterCallback mMediaRouterCallback = new MediaRouterCallback();
+ @VisibleForTesting
+ MediaRouteSelector mSelector;
+ @VisibleForTesting
+ MediaRouter mMediaRouter;
- private MediaRouter mMediaRouter;
private String mPackageName;
InfoMediaManager(Context context, String packageName, Notification notification) {
@@ -39,24 +45,20 @@
mMediaRouter = MediaRouter.getInstance(context);
mPackageName = packageName;
+ mSelector = new MediaRouteSelector.Builder()
+ .addControlCategory(getControlCategoryByPackageName(mPackageName))
+ .build();
}
@Override
public void startScan() {
mMediaDevices.clear();
- startScanCastDevice();
- }
-
- private void startScanCastDevice() {
- final MediaRouteSelector selector = new MediaRouteSelector.Builder()
- .addControlCategory(getControlCategoryByPackageName(mPackageName))
- .build();
-
- mMediaRouter.addCallback(selector, mMediaRouterCallback,
+ mMediaRouter.addCallback(mSelector, mMediaRouterCallback,
MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);
}
- private String getControlCategoryByPackageName(String packageName) {
+ @VisibleForTesting
+ String getControlCategoryByPackageName(String packageName) {
//TODO(b/117129183): Use package name to get ControlCategory.
//Since api not ready, return fixed ControlCategory for prototype.
return "com.google.android.gms.cast.CATEGORY_CAST/4F8B3483";
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java
index c9479d4..44d945a 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java
@@ -16,12 +16,15 @@
package com.android.settingslib.media;
import android.app.Notification;
+import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.util.Log;
import androidx.annotation.IntDef;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.settingslib.bluetooth.BluetoothCallback;
+import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import java.lang.annotation.Retention;
@@ -50,16 +53,20 @@
}
private final Collection<DeviceCallback> mCallbacks = new ArrayList<>();
- private final MediaDeviceCallback mMediaDeviceCallback = new MediaDeviceCallback();
+ @VisibleForTesting
+ final MediaDeviceCallback mMediaDeviceCallback = new MediaDeviceCallback();
private Context mContext;
- private List<MediaDevice> mMediaDevices = new ArrayList<>();
private BluetoothMediaManager mBluetoothMediaManager;
private InfoMediaManager mInfoMediaManager;
-
private LocalBluetoothManager mLocalBluetoothManager;
- private MediaDevice mLastConnectedDevice;
- private MediaDevice mPhoneDevice;
+
+ @VisibleForTesting
+ List<MediaDevice> mMediaDevices = new ArrayList<>();
+ @VisibleForTesting
+ MediaDevice mPhoneDevice;
+ @VisibleForTesting
+ MediaDevice mCurrentConnectedDevice;
/**
* Register to start receiving callbacks for MediaDevice events.
@@ -93,28 +100,40 @@
mInfoMediaManager = new InfoMediaManager(context, packageName, notification);
}
+ @VisibleForTesting
+ LocalMediaManager(Context context, LocalBluetoothManager localBluetoothManager,
+ BluetoothMediaManager bluetoothMediaManager, InfoMediaManager infoMediaManager) {
+ mContext = context;
+ mLocalBluetoothManager = localBluetoothManager;
+ mBluetoothMediaManager = bluetoothMediaManager;
+ mInfoMediaManager = infoMediaManager;
+ }
+
/**
* Connect the MediaDevice to transfer media
* @param connectDevice the MediaDevice
*/
public void connectDevice(MediaDevice connectDevice) {
- if (connectDevice == mLastConnectedDevice) {
+ final MediaDevice device = getMediaDeviceById(mMediaDevices, connectDevice.getId());
+ if (device == mCurrentConnectedDevice) {
+ Log.d(TAG, "connectDevice() this device all ready connected! : " + device.getName());
return;
}
- if (mLastConnectedDevice != null) {
- mLastConnectedDevice.disconnect();
+ //TODO(b/121083246): Update it once remote media API is ready.
+ if (mCurrentConnectedDevice != null && !(connectDevice instanceof InfoMediaDevice)) {
+ mCurrentConnectedDevice.disconnect();
}
- connectDevice.connect();
- if (connectDevice.isConnected()) {
- mLastConnectedDevice = connectDevice;
+ final boolean isConnected = device.connect();
+ if (isConnected) {
+ mCurrentConnectedDevice = device;
}
- final int state = connectDevice.isConnected()
+ final int state = isConnected
? MediaDeviceState.STATE_CONNECTED
: MediaDeviceState.STATE_DISCONNECTED;
- dispatchSelectedDeviceStateChanged(connectDevice, state);
+ dispatchSelectedDeviceStateChanged(device, state);
}
void dispatchSelectedDeviceStateChanged(MediaDevice device, @MediaDeviceState int state) {
@@ -189,6 +208,31 @@
return null;
}
+ /**
+ * Find the current connected MediaDevice.
+ *
+ * @return MediaDevice
+ */
+ public MediaDevice getCurrentConnectedDevice() {
+ return mCurrentConnectedDevice;
+ }
+
+ private MediaDevice updateCurrentConnectedDevice() {
+ for (MediaDevice device : mMediaDevices) {
+ if (device instanceof BluetoothMediaDevice) {
+ if (isConnected(((BluetoothMediaDevice) device).getCachedDevice())) {
+ return device;
+ }
+ }
+ }
+ return mMediaDevices.contains(mPhoneDevice) ? mPhoneDevice : null;
+ }
+
+ private boolean isConnected(CachedBluetoothDevice device) {
+ return device.isActiveDevice(BluetoothProfile.A2DP)
+ || device.isActiveDevice(BluetoothProfile.HEARING_AID);
+ }
+
class MediaDeviceCallback implements MediaManager.MediaDeviceCallback {
@Override
public void onDeviceAdded(MediaDevice device) {
@@ -201,8 +245,13 @@
@Override
public void onDeviceListAdded(List<MediaDevice> devices) {
- mMediaDevices.addAll(devices);
+ for (MediaDevice device : devices) {
+ if (getMediaDeviceById(mMediaDevices, device.getId()) == null) {
+ mMediaDevices.add(device);
+ }
+ }
addPhoneDeviceIfNecessary();
+ mCurrentConnectedDevice = updateCurrentConnectedDevice();
dispatchDeviceListUpdate();
}
@@ -226,6 +275,20 @@
public void onDeviceAttributesChanged() {
dispatchDeviceListUpdate();
}
+
+ @Override
+ public void onConnectedDeviceChanged(String id) {
+ final MediaDevice connectDevice = getMediaDeviceById(mMediaDevices, id);
+
+ if (connectDevice == mCurrentConnectedDevice) {
+ Log.d(TAG, "onConnectedDeviceChanged() this device all ready connected! : "
+ + connectDevice.getName());
+ return;
+ }
+ mCurrentConnectedDevice = connectDevice;
+
+ dispatchDeviceListUpdate();
+ }
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java b/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java
index 33b621c..f35c30e 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/MediaDevice.java
@@ -41,7 +41,6 @@
private int mConnectedRecord;
- protected boolean mIsConnected = false;
protected Context mContext;
protected int mType;
@@ -57,15 +56,6 @@
}
/**
- * Check the MediaDevice is be connected to transfer.
- *
- * @return true if the MediaDevice is be connected to transfer, false otherwise.
- */
- public boolean isConnected() {
- return mIsConnected;
- }
-
- /**
* Get name from MediaDevice.
*
* @return name of MediaDevice.
@@ -87,8 +77,12 @@
/**
* Transfer MediaDevice for media
+ *
+ * @return result of transfer media
*/
- public void connect() {
+ public abstract boolean connect();
+
+ void setConnectedRecord() {
mConnectedRecord++;
ConnectionRecordManager.getInstance().setConnectionRecord(mContext, getId(),
mConnectedRecord);
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/MediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/MediaManager.java
index 72b6b09..2c3a96c 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/MediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/MediaManager.java
@@ -96,7 +96,7 @@
protected void dispatchDeviceListAdded() {
synchronized (mCallbacks) {
for (MediaDeviceCallback callback : mCallbacks) {
- callback.onDeviceListAdded(mMediaDevices);
+ callback.onDeviceListAdded(new ArrayList<>(mMediaDevices));
}
}
}
@@ -109,10 +109,10 @@
}
}
- protected void dispatchDeviceAttributesChanged() {
+ protected void dispatchConnectedDeviceChanged(String id) {
synchronized (mCallbacks) {
for (MediaDeviceCallback callback : mCallbacks) {
- callback.onDeviceAttributesChanged();
+ callback.onConnectedDeviceChanged(id);
}
}
}
@@ -153,5 +153,12 @@
* Callback for notifying MediaDevice attributes is changed.
*/
void onDeviceAttributesChanged();
+
+ /**
+ * Callback for notifying connected MediaDevice is changed.
+ *
+ * @param id the id of MediaDevice
+ */
+ void onConnectedDeviceChanged(String id);
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/MediaOutputSliceConstants.java b/packages/SettingsLib/src/com/android/settingslib/media/MediaOutputSliceConstants.java
new file mode 100644
index 0000000..e600cb8
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/media/MediaOutputSliceConstants.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.media;
+
+/**
+ * Class to access MediaOutput constants.
+ */
+public class MediaOutputSliceConstants {
+
+ /**
+ * Key for the Media output setting.
+ */
+ public static final String KEY_MEDIA_OUTPUT = "media_output";
+
+ /**
+ * Activity Action: Show a settings dialog containing {@link MediaDevice} to transfer media.
+ */
+ public static final String ACTION_MEDIA_OUTPUT =
+ "com.android.settings.panel.action.MEDIA_OUTPUT";
+
+ /**
+ * An string extra specifying a media package name.
+ */
+ public static final String EXTRA_PACKAGE_NAME =
+ "com.android.settings.panel.extra.PACKAGE_NAME";
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/PhoneMediaDevice.java b/packages/SettingsLib/src/com/android/settingslib/media/PhoneMediaDevice.java
index e0f3c2f..c808214 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/PhoneMediaDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/PhoneMediaDevice.java
@@ -62,20 +62,22 @@
}
@Override
- public void connect() {
+ public boolean connect() {
final HearingAidProfile hapProfile = mProfileManager.getHearingAidProfile();
final A2dpProfile a2dpProfile = mProfileManager.getA2dpProfile();
+ boolean isConnected = false;
+
if (hapProfile != null && a2dpProfile != null) {
- mIsConnected = hapProfile.setActiveDevice(null) && a2dpProfile.setActiveDevice(null);
- super.connect();
+ isConnected = hapProfile.setActiveDevice(null) && a2dpProfile.setActiveDevice(null);
+ setConnectedRecord();
}
- Log.d(TAG, "connect() device : " + getName() + ", is selected : " + mIsConnected);
+ Log.d(TAG, "connect() device : " + getName() + ", is selected : " + isConnected);
+ return isConnected;
}
@Override
public void disconnect() {
//TODO(b/117129183): disconnected last select device
- mIsConnected = false;
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
index 27dc628..f9f1dda 100644
--- a/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
+++ b/packages/SettingsLib/src/com/android/settingslib/wifi/AccessPoint.java
@@ -1555,7 +1555,7 @@
mOsuFailure = mContext.getString(
R.string.osu_failure_provisioning_not_available);
break;
- case OSU_FAILURE_INVALID_SERVER_URL:
+ case OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU:
mOsuFailure = mContext.getString(R.string.osu_failure_invalid_server_url);
break;
case OSU_FAILURE_UNEXPECTED_COMMAND_TYPE:
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaDeviceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaDeviceTest.java
new file mode 100644
index 0000000..e5d1b18
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaDeviceTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.media;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.when;
+
+import android.bluetooth.BluetoothProfile;
+import android.content.Context;
+
+import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class BluetoothMediaDeviceTest {
+
+ @Mock
+ private CachedBluetoothDevice mDevice;
+
+ private Context mContext;
+ private BluetoothMediaDevice mBluetoothMediaDevice;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mContext = RuntimeEnvironment.application;
+
+ when(mDevice.isActiveDevice(BluetoothProfile.A2DP)).thenReturn(true);
+ when(mDevice.isActiveDevice(BluetoothProfile.HEARING_AID)).thenReturn(true);
+
+ mBluetoothMediaDevice = new BluetoothMediaDevice(mContext, mDevice);
+ }
+
+ @Test
+ public void connect_setActiveSuccess_isConnectedReturnTrue() {
+ when(mDevice.setActive()).thenReturn(true);
+
+ assertThat(mBluetoothMediaDevice.connect()).isTrue();
+ }
+
+ @Test
+ public void connect_setActiveFail_isConnectedReturnFalse() {
+ when(mDevice.setActive()).thenReturn(false);
+
+ assertThat(mBluetoothMediaDevice.connect()).isFalse();
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaManagerTest.java
new file mode 100644
index 0000000..a20e22b
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/BluetoothMediaManagerTest.java
@@ -0,0 +1,416 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.media;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothDevice;
+import android.bluetooth.BluetoothProfile;
+import android.content.Context;
+
+import com.android.settingslib.bluetooth.A2dpProfile;
+import com.android.settingslib.bluetooth.BluetoothEventManager;
+import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
+import com.android.settingslib.bluetooth.HearingAidProfile;
+import com.android.settingslib.bluetooth.LocalBluetoothManager;
+import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+@RunWith(RobolectricTestRunner.class)
+public class BluetoothMediaManagerTest {
+
+ private static final String TEST_ADDRESS = "11:22:33:44:55:66";
+
+ @Mock
+ private LocalBluetoothManager mLocalBluetoothManager;
+ @Mock
+ private LocalBluetoothProfileManager mProfileManager;
+ @Mock
+ private A2dpProfile mA2dpProfile;
+ @Mock
+ private HearingAidProfile mHapProfile;
+ @Mock
+ private CachedBluetoothDeviceManager mCachedDeviceManager;
+ @Mock
+ private BluetoothEventManager mEventManager;
+ @Mock
+ private MediaManager.MediaDeviceCallback mCallback;
+
+ private BluetoothMediaManager mMediaManager;
+ private Context mContext;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mContext = RuntimeEnvironment.application;
+
+ when(mLocalBluetoothManager.getProfileManager()).thenReturn(mProfileManager);
+ when(mLocalBluetoothManager.getCachedDeviceManager()).thenReturn(mCachedDeviceManager);
+ when(mProfileManager.getA2dpProfile()).thenReturn(mA2dpProfile);
+ when(mProfileManager.getHearingAidProfile()).thenReturn(mHapProfile);
+ when(mLocalBluetoothManager.getEventManager()).thenReturn(mEventManager);
+
+ mMediaManager = new BluetoothMediaManager(mContext, mLocalBluetoothManager, null);
+ }
+
+ @Test
+ public void startScan_haveA2dpProfileConnectedBluetoothDevice_shouldAddDevice() {
+ final List<BluetoothDevice> devices = new ArrayList<>();
+ final CachedBluetoothDevice cachedDevice = mock(CachedBluetoothDevice.class);
+ final BluetoothDevice bluetoothDevice = mock(BluetoothDevice.class);
+ devices.add(bluetoothDevice);
+
+ when(mA2dpProfile.getConnectedDevices()).thenReturn(devices);
+ when(mCachedDeviceManager.findDevice(bluetoothDevice)).thenReturn(cachedDevice);
+ when(cachedDevice.isConnected()).thenReturn(true);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ mMediaManager.startScan();
+ assertThat(mMediaManager.mMediaDevices).hasSize(devices.size());
+ }
+
+ @Test
+ public void startScan_haveA2dpProfileDisconnectedBluetoothDevice_shouldNotAddDevice() {
+ final List<BluetoothDevice> devices = new ArrayList<>();
+ final CachedBluetoothDevice cachedDevice = mock(CachedBluetoothDevice.class);
+ final BluetoothDevice bluetoothDevice = mock(BluetoothDevice.class);
+ devices.add(bluetoothDevice);
+
+ when(mA2dpProfile.getConnectedDevices()).thenReturn(devices);
+ when(mCachedDeviceManager.findDevice(bluetoothDevice)).thenReturn(cachedDevice);
+ when(cachedDevice.isConnected()).thenReturn(false);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ mMediaManager.startScan();
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ }
+
+ @Test
+ public void startScan_noA2dpProfileBluetoothDevice_shouldNotAddDevice() {
+ final List<BluetoothDevice> devices = new ArrayList<>();
+
+ when(mA2dpProfile.getConnectedDevices()).thenReturn(devices);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ mMediaManager.startScan();
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ }
+
+ @Test
+ public void startScan_haveHapProfileConnectedBluetoothDevice_shouldAddDevice() {
+ final List<BluetoothDevice> devices = new ArrayList<>();
+ final CachedBluetoothDevice cachedDevice = mock(CachedBluetoothDevice.class);
+ final BluetoothDevice bluetoothDevice = mock(BluetoothDevice.class);
+ devices.add(bluetoothDevice);
+
+ when(mHapProfile.getConnectedDevices()).thenReturn(devices);
+ when(mCachedDeviceManager.findDevice(bluetoothDevice)).thenReturn(cachedDevice);
+ when(cachedDevice.isConnected()).thenReturn(true);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ mMediaManager.startScan();
+ assertThat(mMediaManager.mMediaDevices).hasSize(devices.size());
+ }
+
+ @Test
+ public void startScan_noHapProfileBluetoothDevice_shouldNotAddDevice() {
+ final List<BluetoothDevice> devices = new ArrayList<>();
+
+ when(mHapProfile.getConnectedDevices()).thenReturn(devices);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ mMediaManager.startScan();
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ }
+
+ @Test
+ public void starScan_a2dpAndHapProfileNotReady_shouldRegisterCallback() {
+ final Collection<CachedBluetoothDevice> mDevices = new ArrayList<>();
+ final CachedBluetoothDevice cachedDevice = mock(CachedBluetoothDevice.class);
+ mDevices.add(cachedDevice);
+
+ when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn(mDevices);
+ when(mA2dpProfile.isProfileReady()).thenReturn(false);
+ when(mHapProfile.isProfileReady()).thenReturn(false);
+
+ mMediaManager.startScan();
+
+ verify(mProfileManager).addServiceListener(mMediaManager);
+ }
+
+ @Test
+ public void starScan_a2dpAndHapProfileReady_shouldNotRegisterCallback() {
+ final Collection<CachedBluetoothDevice> mDevices = new ArrayList<>();
+ final CachedBluetoothDevice cachedDevice = mock(CachedBluetoothDevice.class);
+ mDevices.add(cachedDevice);
+
+ when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn(mDevices);
+ when(mA2dpProfile.isProfileReady()).thenReturn(true);
+ when(mHapProfile.isProfileReady()).thenReturn(true);
+
+ mMediaManager.startScan();
+
+ verify(mProfileManager, never()).addServiceListener(mMediaManager);
+ }
+
+ @Test
+ public void onServiceConnected_a2dpAndHapProfileNotReady_doNothing() {
+ final Collection<CachedBluetoothDevice> mDevices = new ArrayList<>();
+ final CachedBluetoothDevice cachedDevice = mock(CachedBluetoothDevice.class);
+ mDevices.add(cachedDevice);
+
+ when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn(mDevices);
+ when(mA2dpProfile.isProfileReady()).thenReturn(false);
+ when(mHapProfile.isProfileReady()).thenReturn(false);
+
+ mMediaManager.startScan();
+ mMediaManager.onServiceConnected();
+
+ verify(mProfileManager, never()).removeServiceListener(mMediaManager);
+ }
+
+ @Test
+ public void onDeviceAttributesChanged_a2dpAndHapProfileReady_shouldUnregisterCallback() {
+ final Collection<CachedBluetoothDevice> mDevices = new ArrayList<>();
+ final CachedBluetoothDevice cachedDevice = mock(CachedBluetoothDevice.class);
+ mDevices.add(cachedDevice);
+
+ when(mCachedDeviceManager.getCachedDevicesCopy()).thenReturn(mDevices);
+ when(mA2dpProfile.isProfileReady()).thenReturn(true);
+ when(mHapProfile.isProfileReady()).thenReturn(true);
+
+ mMediaManager.startScan();
+ mMediaManager.onServiceConnected();
+
+ verify(mProfileManager).removeServiceListener(mMediaManager);
+ }
+
+ @Test
+ public void onBluetoothStateChanged_bluetoothStateIsOn_callOnDeviceListAdded() {
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onBluetoothStateChanged(BluetoothAdapter.STATE_ON);
+
+ verify(mCallback).onDeviceListAdded(any());
+ }
+
+ @Test
+ public void onBluetoothStateChanged_bluetoothStateIsOff_callOnDeviceListRemoved() {
+ final BluetoothMediaDevice device1 = mock(BluetoothMediaDevice.class);
+ final BluetoothMediaDevice device2 = mock(BluetoothMediaDevice.class);
+ mMediaManager.mMediaDevices.add(device1);
+ mMediaManager.mMediaDevices.add(device2);
+
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onBluetoothStateChanged(BluetoothAdapter.STATE_OFF);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ verify(mCallback).onDeviceListRemoved(any());
+ }
+
+ @Test
+ public void onDeviceAdded_cachedDeviceIsConnected_callOnDeviceAdded() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+
+ when(device.isConnectedHearingAidDevice()).thenReturn(true);
+ when(device.isConnectedA2dpDevice()).thenReturn(true);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onDeviceAdded(device);
+
+ assertThat(mMediaManager.mMediaDevices).hasSize(1);
+ verify(mCallback).onDeviceAdded(any());
+
+ }
+
+ @Test
+ public void onDeviceAdded_cachedDeviceIsDisconnected_doNothing() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+
+ when(device.isConnectedHearingAidDevice()).thenReturn(false);
+ when(device.isConnectedA2dpDevice()).thenReturn(false);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onDeviceAdded(device);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ verify(mCallback, never()).onDeviceAdded(any());
+
+ }
+
+ @Test
+ public void onDeviceDeleted_cachedDeviceIsConnected_doNothing() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+ final BluetoothMediaDevice bluetoothMediaDevice = mock(BluetoothMediaDevice.class);
+ mMediaManager.mMediaDevices.add(bluetoothMediaDevice);
+
+ when(device.isConnectedHearingAidDevice()).thenReturn(true);
+ when(device.isConnectedA2dpDevice()).thenReturn(true);
+ when(device.getAddress()).thenReturn(TEST_ADDRESS);
+ when(bluetoothMediaDevice.getId()).thenReturn(TEST_ADDRESS);
+
+ assertThat(mMediaManager.mMediaDevices).hasSize(1);
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onDeviceDeleted(device);
+
+ assertThat(mMediaManager.mMediaDevices).hasSize(1);
+ verify(mCallback, never()).onDeviceRemoved(any());
+ }
+
+ @Test
+ public void onDeviceDeleted_cachedDeviceIsDisconnected_callOnDeviceRemoved() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+ final BluetoothMediaDevice bluetoothMediaDevice = mock(BluetoothMediaDevice.class);
+ mMediaManager.mMediaDevices.add(bluetoothMediaDevice);
+
+ when(device.isConnectedHearingAidDevice()).thenReturn(false);
+ when(device.isConnectedA2dpDevice()).thenReturn(false);
+ when(device.getAddress()).thenReturn(TEST_ADDRESS);
+ when(bluetoothMediaDevice.getId()).thenReturn(TEST_ADDRESS);
+
+ assertThat(mMediaManager.mMediaDevices).hasSize(1);
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onDeviceDeleted(device);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ verify(mCallback).onDeviceRemoved(any());
+ }
+
+ @Test
+ public void onProfileConnectionStateChanged_cachedDeviceIsConnect_callOnDeviceAdded() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+
+ when(device.isConnectedHearingAidDevice()).thenReturn(true);
+ when(device.isConnectedA2dpDevice()).thenReturn(true);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onProfileConnectionStateChanged(device, 0, 0);
+
+ assertThat(mMediaManager.mMediaDevices).hasSize(1);
+ verify(mCallback).onDeviceAdded(any());
+ }
+
+ @Test
+ public void onProfileConnectionStateChanged_cachedDeviceIsDisconnect_callOnDeviceRemoved() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+ final BluetoothMediaDevice bluetoothMediaDevice = mock(BluetoothMediaDevice.class);
+ mMediaManager.mMediaDevices.add(bluetoothMediaDevice);
+
+ when(device.isConnectedHearingAidDevice()).thenReturn(false);
+ when(device.isConnectedA2dpDevice()).thenReturn(false);
+ when(device.getAddress()).thenReturn(TEST_ADDRESS);
+ when(bluetoothMediaDevice.getId()).thenReturn(TEST_ADDRESS);
+
+ assertThat(mMediaManager.mMediaDevices).hasSize(1);
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onProfileConnectionStateChanged(device, 0, 0);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ verify(mCallback).onDeviceRemoved(any());
+ }
+
+ @Test
+ public void onAclConnectionStateChanged_cachedDeviceIsConnect_callOnDeviceAdded() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+
+ when(device.isConnectedHearingAidDevice()).thenReturn(true);
+ when(device.isConnectedA2dpDevice()).thenReturn(true);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onAclConnectionStateChanged(device, 0);
+
+ assertThat(mMediaManager.mMediaDevices).hasSize(1);
+ verify(mCallback).onDeviceAdded(any());
+ }
+
+ @Test
+ public void onAclConnectionStateChanged_cachedDeviceIsDisconnect_callOnDeviceRemoved() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+ final BluetoothMediaDevice bluetoothMediaDevice = mock(BluetoothMediaDevice.class);
+ mMediaManager.mMediaDevices.add(bluetoothMediaDevice);
+
+ when(device.isConnectedHearingAidDevice()).thenReturn(false);
+ when(device.isConnectedA2dpDevice()).thenReturn(false);
+ when(device.getAddress()).thenReturn(TEST_ADDRESS);
+ when(bluetoothMediaDevice.getId()).thenReturn(TEST_ADDRESS);
+
+ assertThat(mMediaManager.mMediaDevices).hasSize(1);
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onAclConnectionStateChanged(device, 0);
+
+ assertThat(mMediaManager.mMediaDevices).isEmpty();
+ verify(mCallback).onDeviceRemoved(any());
+ }
+
+ @Test
+ public void onActiveDeviceChanged_isHapProfile_callOnActiveDeviceChanged() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+
+ when(device.getAddress()).thenReturn(TEST_ADDRESS);
+
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onActiveDeviceChanged(device, BluetoothProfile.HEARING_AID);
+
+ verify(mCallback).onConnectedDeviceChanged(any());
+ }
+
+ @Test
+ public void onActiveDeviceChanged_isA2dpProfile_callOnActiveDeviceChanged() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+
+ when(device.getAddress()).thenReturn(TEST_ADDRESS);
+
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onActiveDeviceChanged(device, BluetoothProfile.A2DP);
+
+ verify(mCallback).onConnectedDeviceChanged(any());
+ }
+
+ @Test
+ public void onActiveDeviceChanged_isNotA2dpAndHapProfile_doNothing() {
+ final CachedBluetoothDevice device = mock(CachedBluetoothDevice.class);
+
+ when(device.getAddress()).thenReturn(TEST_ADDRESS);
+
+ mMediaManager.registerCallback(mCallback);
+ mMediaManager.onActiveDeviceChanged(device, BluetoothProfile.HEALTH);
+
+ verify(mCallback, never()).onConnectedDeviceChanged(any());
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/InfoMediaManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/InfoMediaManagerTest.java
new file mode 100644
index 0000000..b11cf69
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/InfoMediaManagerTest.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.media;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+
+import androidx.mediarouter.media.MediaRouteSelector;
+import androidx.mediarouter.media.MediaRouter;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class InfoMediaManagerTest {
+
+ private static final String TEST_PACKAGE_NAME = "com.test.packagename";
+ private static final String TEST_ID = "test_id";
+
+ @Mock
+ private MediaRouter mMediaRouter;
+ @Mock
+ private MediaRouteSelector mSelector;
+
+ private InfoMediaManager mInfoMediaManager;
+ private Context mContext;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mContext = RuntimeEnvironment.application;
+
+ mInfoMediaManager = new InfoMediaManager(mContext, TEST_PACKAGE_NAME, null);
+ mInfoMediaManager.mMediaRouter = mMediaRouter;
+ mInfoMediaManager.mSelector = mSelector;
+ }
+
+ @Test
+ public void stopScan_shouldRemoveCallback() {
+ mInfoMediaManager.stopScan();
+
+ verify(mMediaRouter).removeCallback(mInfoMediaManager.mMediaRouterCallback);
+ }
+
+ @Test
+ public void startScan_shouldAddCallback() {
+ mInfoMediaManager.startScan();
+
+ verify(mMediaRouter).addCallback(mSelector, mInfoMediaManager.mMediaRouterCallback,
+ MediaRouter.CALLBACK_FLAG_REQUEST_DISCOVERY);
+ }
+
+ @Test
+ public void onRouteAdded_mediaDeviceNotExistInList_addMediaDevice() {
+ final MediaRouter.RouteInfo info = mock(MediaRouter.RouteInfo.class);
+ when(info.getId()).thenReturn(TEST_ID);
+
+ final MediaDevice mediaDevice = mInfoMediaManager.findMediaDevice(TEST_ID);
+ assertThat(mediaDevice).isNull();
+
+ mInfoMediaManager.mMediaRouterCallback.onRouteAdded(mMediaRouter, info);
+
+ final MediaDevice infoDevice = mInfoMediaManager.mMediaDevices.get(0);
+ assertThat(infoDevice.getId()).isEqualTo(TEST_ID);
+ }
+
+ @Test
+ public void onRouteAdded_mediaDeviceExistInList_doNothing() {
+ final MediaRouter.RouteInfo info = mock(MediaRouter.RouteInfo.class);
+ when(info.getId()).thenReturn(TEST_ID);
+ final InfoMediaDevice infoDevice = new InfoMediaDevice(mContext, info);
+ mInfoMediaManager.mMediaDevices.add(infoDevice);
+
+ final MediaDevice mediaDevice = mInfoMediaManager.findMediaDevice(TEST_ID);
+ final int size = mInfoMediaManager.mMediaDevices.size();
+ assertThat(mediaDevice).isNotNull();
+
+ mInfoMediaManager.mMediaRouterCallback.onRouteAdded(mMediaRouter, info);
+
+ assertThat(mInfoMediaManager.mMediaDevices).hasSize(size);
+ }
+
+ @Test
+ public void onRouteRemoved_mediaDeviceExistInList_removeMediaDevice() {
+ final MediaRouter.RouteInfo info = mock(MediaRouter.RouteInfo.class);
+ when(info.getId()).thenReturn(TEST_ID);
+ final InfoMediaDevice infoDevice = new InfoMediaDevice(mContext, info);
+ mInfoMediaManager.mMediaDevices.add(infoDevice);
+
+ final MediaDevice mediaDevice = mInfoMediaManager.findMediaDevice(TEST_ID);
+ assertThat(mediaDevice).isNotNull();
+ assertThat(mInfoMediaManager.mMediaDevices).hasSize(1);
+
+ mInfoMediaManager.mMediaRouterCallback.onRouteRemoved(mMediaRouter, info);
+
+ assertThat(mInfoMediaManager.mMediaDevices).isEmpty();
+ }
+
+ @Test
+ public void onRouteRemoved_mediaDeviceNotExistInList_doNothing() {
+ final MediaRouter.RouteInfo info = mock(MediaRouter.RouteInfo.class);
+ when(info.getId()).thenReturn(TEST_ID);
+
+ final MediaDevice mediaDevice = mInfoMediaManager.findMediaDevice(TEST_ID);
+ final int size = mInfoMediaManager.mMediaDevices.size();
+ assertThat(mediaDevice).isNull();
+
+ mInfoMediaManager.mMediaRouterCallback.onRouteRemoved(mMediaRouter, info);
+
+ assertThat(mInfoMediaManager.mMediaDevices).hasSize(size);
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/LocalMediaManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/LocalMediaManagerTest.java
new file mode 100644
index 0000000..3556814
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/LocalMediaManagerTest.java
@@ -0,0 +1,369 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.media;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+
+import com.android.settingslib.bluetooth.A2dpProfile;
+import com.android.settingslib.bluetooth.HearingAidProfile;
+import com.android.settingslib.bluetooth.LocalBluetoothManager;
+import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@RunWith(RobolectricTestRunner.class)
+public class LocalMediaManagerTest {
+
+ private static final String TEST_DEVICE_ID_1 = "device_id_1";
+ private static final String TEST_DEVICE_ID_2 = "device_id_2";
+ private static final String TEST_DEVICE_ID_3 = "device_id_3";
+ private static final String TEST_CURRENT_DEVICE_ID = "currentDevice_id";
+
+ @Mock
+ private BluetoothMediaManager mBluetoothMediaManager;
+ @Mock
+ private InfoMediaManager mInfoMediaManager;
+ @Mock
+ private LocalBluetoothManager mLocalBluetoothManager;
+ @Mock
+ private LocalMediaManager.DeviceCallback mCallback;
+ @Mock
+ private HearingAidProfile mHapProfile;
+ @Mock
+ private A2dpProfile mA2dpProfile;
+ @Mock
+ private LocalBluetoothProfileManager mLocalProfileManager;
+
+ private Context mContext;
+ private LocalMediaManager mLocalMediaManager;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mContext = RuntimeEnvironment.application;
+
+ when(mLocalBluetoothManager.getProfileManager()).thenReturn(mLocalProfileManager);
+ when(mLocalProfileManager.getA2dpProfile()).thenReturn(mA2dpProfile);
+ when(mLocalProfileManager.getHearingAidProfile()).thenReturn(mHapProfile);
+
+ mLocalMediaManager = new LocalMediaManager(mContext, mLocalBluetoothManager,
+ mBluetoothMediaManager, mInfoMediaManager);
+ }
+
+ @Test
+ public void startScan_mediaDevicesListShouldBeClear() {
+ final MediaDevice device = mock(MediaDevice.class);
+ mLocalMediaManager.mMediaDevices.add(device);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(1);
+ mLocalMediaManager.startScan();
+ assertThat(mLocalMediaManager.mMediaDevices).isEmpty();
+ }
+
+ @Test
+ public void connectDevice_deviceNotEqualCurrentConnectedDevice_connectDevice() {
+ final MediaDevice currentDevice = mock(MediaDevice.class);
+ final MediaDevice device = mock(MediaDevice.class);
+ mLocalMediaManager.mMediaDevices.add(currentDevice);
+ mLocalMediaManager.mMediaDevices.add(device);
+ mLocalMediaManager.mCurrentConnectedDevice = currentDevice;
+
+ when(device.getId()).thenReturn(TEST_DEVICE_ID_1);
+ when(currentDevice.getId()).thenReturn(TEST_CURRENT_DEVICE_ID);
+
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.connectDevice(device);
+
+ verify(currentDevice).disconnect();
+ verify(device).connect();
+ verify(mCallback).onSelectedDeviceStateChanged(any(),
+ eq(LocalMediaManager.MediaDeviceState.STATE_DISCONNECTED));
+ }
+
+ @Test
+ public void getMediaDeviceById_idExist_shouldReturnMediaDevice() {
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(device2);
+
+ when(device1.getId()).thenReturn(TEST_DEVICE_ID_1);
+ when(device2.getId()).thenReturn(TEST_DEVICE_ID_2);
+
+ final MediaDevice device = mLocalMediaManager
+ .getMediaDeviceById(mLocalMediaManager.mMediaDevices, TEST_DEVICE_ID_2);
+
+ assertThat(device.getId()).isEqualTo(TEST_DEVICE_ID_2);
+ }
+
+ @Test
+ public void getMediaDeviceById_idNotExist_shouldReturnNull() {
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(device2);
+
+ when(device1.getId()).thenReturn(TEST_DEVICE_ID_1);
+ when(device2.getId()).thenReturn(TEST_DEVICE_ID_2);
+
+ final MediaDevice device = mLocalMediaManager
+ .getMediaDeviceById(mLocalMediaManager.mMediaDevices, TEST_CURRENT_DEVICE_ID);
+
+ assertThat(device).isNull();
+ }
+
+ @Test
+ public void onDeviceAdded_mediaDeviceAndPhoneDeviceNotExistInList_addBothDevice() {
+ final MediaDevice device = mock(MediaDevice.class);
+
+ assertThat(mLocalMediaManager.mMediaDevices).isEmpty();
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceAdded(device);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceAdded_mediaDeviceNotExistAndPhoneDeviceExistInList_addMediaDevice() {
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+ mLocalMediaManager.mPhoneDevice = mock(PhoneMediaDevice.class);
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(mLocalMediaManager.mPhoneDevice);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceAdded(device2);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(3);
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceAdded_mediaDeviceAndPhoneDeviceExistInList_doNothing() {
+ final MediaDevice device1 = mock(MediaDevice.class);
+ mLocalMediaManager.mPhoneDevice = mock(PhoneMediaDevice.class);
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(mLocalMediaManager.mPhoneDevice);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceAdded(device1);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ verify(mCallback, never()).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceListAdded_phoneDeviceNotExistInList_addPhoneDeviceAndDevicesList() {
+ final List<MediaDevice> devices = new ArrayList<>();
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+ devices.add(device1);
+ devices.add(device2);
+
+ when(device1.getId()).thenReturn(TEST_DEVICE_ID_1);
+ when(device2.getId()).thenReturn(TEST_DEVICE_ID_2);
+
+ assertThat(mLocalMediaManager.mMediaDevices).isEmpty();
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceListAdded(devices);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(3);
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceListAdded_phoneDeviceExistInList_addDeviceList() {
+ final List<MediaDevice> devices = new ArrayList<>();
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+ final MediaDevice device3 = mock(MediaDevice.class);
+ mLocalMediaManager.mPhoneDevice = mock(PhoneMediaDevice.class);
+ devices.add(device1);
+ devices.add(device2);
+ mLocalMediaManager.mMediaDevices.add(device3);
+ mLocalMediaManager.mMediaDevices.add(mLocalMediaManager.mPhoneDevice);
+
+ when(device1.getId()).thenReturn(TEST_DEVICE_ID_1);
+ when(device2.getId()).thenReturn(TEST_DEVICE_ID_2);
+ when(device3.getId()).thenReturn(TEST_DEVICE_ID_3);
+ when(mLocalMediaManager.mPhoneDevice.getId()).thenReturn("test_phone_id");
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceListAdded(devices);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(4);
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceRemoved_phoneDeviceIsLastDeviceAfterRemoveMediaDevice_removeBothDevice() {
+ final MediaDevice device1 = mock(MediaDevice.class);
+ mLocalMediaManager.mPhoneDevice = mock(PhoneMediaDevice.class);
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(mLocalMediaManager.mPhoneDevice);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceRemoved(device1);
+
+ assertThat(mLocalMediaManager.mMediaDevices).isEmpty();
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceRemoved_phoneDeviceNotLastDeviceAfterRemoveMediaDevice_removeMediaDevice() {
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+ mLocalMediaManager.mPhoneDevice = mock(PhoneMediaDevice.class);
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(device2);
+ mLocalMediaManager.mMediaDevices.add(mLocalMediaManager.mPhoneDevice);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(3);
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceRemoved(device2);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceRemoved_removeMediaDeviceNotInList_doNothing() {
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+ mLocalMediaManager.mPhoneDevice = mock(PhoneMediaDevice.class);
+ mLocalMediaManager.mMediaDevices.add(device2);
+ mLocalMediaManager.mMediaDevices.add(mLocalMediaManager.mPhoneDevice);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceRemoved(device1);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ verify(mCallback, never()).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceListRemoved_phoneDeviceIsLastDeviceAfterRemoveDeviceList_removeAll() {
+ final List<MediaDevice> devices = new ArrayList<>();
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+ mLocalMediaManager.mPhoneDevice = mock(PhoneMediaDevice.class);
+ devices.add(device1);
+ devices.add(device2);
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(device2);
+ mLocalMediaManager.mMediaDevices.add(mLocalMediaManager.mPhoneDevice);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(3);
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceListRemoved(devices);
+
+ assertThat(mLocalMediaManager.mMediaDevices).isEmpty();
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceListRemoved_phoneDeviceNotLastDeviceAfterRemoveDeviceList_removeList() {
+ final List<MediaDevice> devices = new ArrayList<>();
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+ final MediaDevice device3 = mock(MediaDevice.class);
+ mLocalMediaManager.mPhoneDevice = mock(PhoneMediaDevice.class);
+ devices.add(device1);
+ devices.add(device3);
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(device2);
+ mLocalMediaManager.mMediaDevices.add(device3);
+ mLocalMediaManager.mMediaDevices.add(mLocalMediaManager.mPhoneDevice);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(4);
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceListRemoved(devices);
+
+ assertThat(mLocalMediaManager.mMediaDevices).hasSize(2);
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onDeviceAttributesChanged_shouldDispatchDeviceListUpdate() {
+ mLocalMediaManager.registerCallback(mCallback);
+
+ mLocalMediaManager.mMediaDeviceCallback.onDeviceAttributesChanged();
+
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onConnectedDeviceChanged_connectedAndCurrentDeviceAreDifferent_notifyThemChanged() {
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(device2);
+ mLocalMediaManager.mCurrentConnectedDevice = device1;
+
+ when(device1.getId()).thenReturn(TEST_DEVICE_ID_1);
+ when(device2.getId()).thenReturn(TEST_DEVICE_ID_2);
+
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onConnectedDeviceChanged(TEST_DEVICE_ID_2);
+
+ assertThat(mLocalMediaManager.getCurrentConnectedDevice()).isEqualTo(device2);
+ verify(mCallback).onDeviceListUpdate(any());
+ }
+
+ @Test
+ public void onConnectedDeviceChanged_connectedAndCurrentDeviceAreSame_doNothing() {
+ final MediaDevice device1 = mock(MediaDevice.class);
+ final MediaDevice device2 = mock(MediaDevice.class);
+
+ mLocalMediaManager.mMediaDevices.add(device1);
+ mLocalMediaManager.mMediaDevices.add(device2);
+ mLocalMediaManager.mCurrentConnectedDevice = device1;
+
+ when(device1.getId()).thenReturn(TEST_DEVICE_ID_1);
+ when(device2.getId()).thenReturn(TEST_DEVICE_ID_2);
+
+ mLocalMediaManager.registerCallback(mCallback);
+ mLocalMediaManager.mMediaDeviceCallback.onConnectedDeviceChanged(TEST_DEVICE_ID_1);
+
+ verify(mCallback, never()).onDeviceListUpdate(any());
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaDeviceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaDeviceTest.java
index 9bbdd01..fc514f0 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaDeviceTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaDeviceTest.java
@@ -25,8 +25,11 @@
import androidx.mediarouter.media.MediaRouter;
+import com.android.settingslib.bluetooth.A2dpProfile;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+import com.android.settingslib.bluetooth.HearingAidProfile;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
+import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
import org.junit.Before;
import org.junit.Test;
@@ -78,6 +81,14 @@
private MediaRouter.RouteInfo mRouteInfo2;
@Mock
private MediaRouter.RouteInfo mRouteInfo3;
+ @Mock
+ private LocalBluetoothProfileManager mProfileManager;
+ @Mock
+ private HearingAidProfile mHapProfile;
+ @Mock
+ private A2dpProfile mA2dpProfile;
+ @Mock
+ private BluetoothDevice mDevice;
private BluetoothMediaDevice mBluetoothMediaDevice1;
private BluetoothMediaDevice mBluetoothMediaDevice2;
@@ -109,6 +120,10 @@
when(mRouteInfo1.getName()).thenReturn(DEVICE_NAME_1);
when(mRouteInfo2.getName()).thenReturn(DEVICE_NAME_2);
when(mRouteInfo3.getName()).thenReturn(DEVICE_NAME_3);
+ when(mLocalBluetoothManager.getProfileManager()).thenReturn(mProfileManager);
+ when(mProfileManager.getA2dpProfile()).thenReturn(mA2dpProfile);
+ when(mProfileManager.getHearingAidProfile()).thenReturn(mHapProfile);
+ when(mA2dpProfile.getActiveDevice()).thenReturn(mDevice);
mBluetoothMediaDevice1 = new BluetoothMediaDevice(mContext, mCachedDevice1);
mBluetoothMediaDevice2 = new BluetoothMediaDevice(mContext, mCachedDevice2);
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaDeviceUtilsTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaDeviceUtilsTest.java
new file mode 100644
index 0000000..6e29e13
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaDeviceUtilsTest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.media;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.when;
+
+import androidx.mediarouter.media.MediaRouter;
+
+import com.android.settingslib.bluetooth.CachedBluetoothDevice;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+
+@RunWith(RobolectricTestRunner.class)
+public class MediaDeviceUtilsTest {
+
+ private static final String TEST_ADDRESS = "11:22:33:44:55:66";
+ private static final String TEST_ROUTE_ID = "test_route_id";
+
+ @Mock
+ private CachedBluetoothDevice mDevice;
+ @Mock
+ private MediaRouter.RouteInfo mRouteInfo;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Test
+ public void getId_returnBluetoothDeviceAddress() {
+ when(mDevice.getAddress()).thenReturn(TEST_ADDRESS);
+
+ final String id = MediaDeviceUtils.getId(mDevice);
+
+ assertThat(id).isEqualTo(TEST_ADDRESS);
+ }
+
+ @Test
+ public void getId_returnRouteInfoId() {
+ when(mRouteInfo.getId()).thenReturn(TEST_ROUTE_ID);
+
+ final String id = MediaDeviceUtils.getId(mRouteInfo);
+
+ assertThat(id).isEqualTo(TEST_ROUTE_ID);
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaManagerTest.java
new file mode 100644
index 0000000..98eccb5
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/MediaManagerTest.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.media;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class MediaManagerTest {
+
+ private static final String TEST_ID = "test_id";
+
+ @Mock
+ private MediaManager.MediaDeviceCallback mCallback;
+ @Mock
+ private MediaDevice mDevice;
+
+ private MediaManager mMediaManager;
+ private Context mContext;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mContext = RuntimeEnvironment.application;
+
+ when(mDevice.getId()).thenReturn(TEST_ID);
+
+ mMediaManager = new MediaManager(mContext, null) {
+ @Override
+ public void startScan() {
+
+ }
+
+ @Override
+ public void stopScan() {
+
+ }
+ };
+ }
+
+ @Test
+ public void dispatchDeviceAdded_registerCallback_shouldDispatchCallback() {
+ mMediaManager.registerCallback(mCallback);
+
+ mMediaManager.dispatchDeviceAdded(mDevice);
+
+ verify(mCallback).onDeviceAdded(mDevice);
+ }
+
+ @Test
+ public void dispatchDeviceRemoved_registerCallback_shouldDispatchCallback() {
+ mMediaManager.registerCallback(mCallback);
+
+ mMediaManager.dispatchDeviceRemoved(mDevice);
+
+ verify(mCallback).onDeviceRemoved(mDevice);
+ }
+
+ @Test
+ public void dispatchDeviceListAdded_registerCallback_shouldDispatchCallback() {
+ mMediaManager.registerCallback(mCallback);
+
+ mMediaManager.dispatchDeviceListAdded();
+
+ verify(mCallback).onDeviceListAdded(any());
+ }
+
+ @Test
+ public void dispatchDeviceListRemoved_registerCallback_shouldDispatchCallback() {
+ mMediaManager.registerCallback(mCallback);
+
+ mMediaManager.dispatchDeviceListRemoved(mMediaManager.mMediaDevices);
+
+ verify(mCallback).onDeviceListRemoved(mMediaManager.mMediaDevices);
+ }
+
+ @Test
+ public void dispatchActiveDeviceChanged_registerCallback_shouldDispatchCallback() {
+ mMediaManager.registerCallback(mCallback);
+
+ mMediaManager.dispatchConnectedDeviceChanged(TEST_ID);
+
+ verify(mCallback).onConnectedDeviceChanged(TEST_ID);
+ }
+
+ @Test
+ public void findMediaDevice_idExist_shouldReturnMediaDevice() {
+ mMediaManager.mMediaDevices.add(mDevice);
+
+ final MediaDevice device = mMediaManager.findMediaDevice(TEST_ID);
+
+ assertThat(device.getId()).isEqualTo(mDevice.getId());
+ }
+
+ @Test
+ public void findMediaDevice_idNotExist_shouldReturnNull() {
+ mMediaManager.mMediaDevices.add(mDevice);
+
+ final MediaDevice device = mMediaManager.findMediaDevice("123");
+
+ assertThat(device).isNull();
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/PhoneMediaDeviceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/PhoneMediaDeviceTest.java
new file mode 100644
index 0000000..5ba33f5
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/PhoneMediaDeviceTest.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.media;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.when;
+
+import android.bluetooth.BluetoothDevice;
+import android.content.Context;
+
+import com.android.settingslib.bluetooth.A2dpProfile;
+import com.android.settingslib.bluetooth.HearingAidProfile;
+import com.android.settingslib.bluetooth.LocalBluetoothManager;
+import com.android.settingslib.bluetooth.LocalBluetoothProfileManager;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class PhoneMediaDeviceTest {
+
+ @Mock
+ private LocalBluetoothProfileManager mLocalProfileManager;
+ @Mock
+ private LocalBluetoothManager mLocalBluetoothManager;
+ @Mock
+ private HearingAidProfile mHapProfile;
+ @Mock
+ private A2dpProfile mA2dpProfile;
+ @Mock
+ private BluetoothDevice mDevice;
+
+ private Context mContext;
+ private PhoneMediaDevice mPhoneMediaDevice;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mContext = RuntimeEnvironment.application;
+
+ when(mLocalBluetoothManager.getProfileManager()).thenReturn(mLocalProfileManager);
+ when(mLocalProfileManager.getA2dpProfile()).thenReturn(mA2dpProfile);
+ when(mLocalProfileManager.getHearingAidProfile()).thenReturn(mHapProfile);
+ when(mA2dpProfile.getActiveDevice()).thenReturn(mDevice);
+
+ mPhoneMediaDevice = new PhoneMediaDevice(mContext, mLocalBluetoothManager);
+ }
+
+ @Test
+ public void connect_phoneDeviceSetActiveSuccess_isConnectedReturnTrue() {
+ when(mA2dpProfile.setActiveDevice(null)).thenReturn(true);
+ when(mHapProfile.setActiveDevice(null)).thenReturn(true);
+
+ assertThat(mPhoneMediaDevice.connect()).isTrue();
+ }
+
+ @Test
+ public void connect_a2dpProfileSetActiveFail_isConnectedReturnFalse() {
+ when(mA2dpProfile.setActiveDevice(null)).thenReturn(false);
+ when(mHapProfile.setActiveDevice(null)).thenReturn(true);
+
+ assertThat(mPhoneMediaDevice.connect()).isFalse();
+ }
+
+ @Test
+ public void connect_hearingAidProfileSetActiveFail_isConnectedReturnFalse() {
+ when(mA2dpProfile.setActiveDevice(null)).thenReturn(true);
+ when(mHapProfile.setActiveDevice(null)).thenReturn(false);
+
+ assertThat(mPhoneMediaDevice.connect()).isFalse();
+ }
+
+ @Test
+ public void connect_hearingAidAndA2dpProfileSetActiveFail_isConnectedReturnFalse() {
+ when(mA2dpProfile.setActiveDevice(null)).thenReturn(false);
+ when(mHapProfile.setActiveDevice(null)).thenReturn(false);
+
+ assertThat(mPhoneMediaDevice.connect()).isFalse();
+ }
+}
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java
index 1aff394..7218acf 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitch.java
@@ -1,15 +1,9 @@
package com.android.keyguard;
-import android.content.ContentResolver;
import android.content.Context;
-import android.database.ContentObserver;
import android.graphics.Paint;
import android.graphics.Paint.Style;
-import android.os.Handler;
-import android.os.Looper;
-import android.provider.Settings;
import android.util.AttributeSet;
-import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -18,29 +12,19 @@
import androidx.annotation.VisibleForTesting;
-import com.android.keyguard.clock.BubbleClockController;
-import com.android.keyguard.clock.StretchAnalogClockController;
-import com.android.keyguard.clock.TypeClockController;
+import com.android.keyguard.clock.ClockManager;
import com.android.systemui.Dependency;
import com.android.systemui.plugins.ClockPlugin;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.StatusBarStateController;
-import com.android.systemui.statusbar.policy.ExtensionController;
-import com.android.systemui.statusbar.policy.ExtensionController.Extension;
-import java.util.Objects;
import java.util.TimeZone;
-import java.util.function.Consumer;
-import java.util.function.Supplier;
/**
* Switch to show plugin clock when plugin is connected, otherwise it will show default clock.
*/
public class KeyguardClockSwitch extends RelativeLayout {
- private LayoutInflater mLayoutInflater;
-
- private final ContentResolver mContentResolver;
/**
* Optional/alternative clock injected via plugin.
*/
@@ -63,14 +47,6 @@
*/
private View mKeyguardStatusArea;
/**
- * Used to select between plugin or default implementations of ClockPlugin interface.
- */
- private Extension<ClockPlugin> mClockExtension;
- /**
- * Consumer that accepts the a new ClockPlugin implementation when the Extension reloads.
- */
- private final Consumer<ClockPlugin> mClockPluginConsumer = plugin -> setClockPlugin(plugin);
- /**
* Maintain state so that a newly connected plugin can be initialized.
*/
private float mDarkAmount;
@@ -94,16 +70,7 @@
}
};
- private final ContentObserver mContentObserver =
- new ContentObserver(new Handler(Looper.getMainLooper())) {
- @Override
- public void onChange(boolean selfChange) {
- super.onChange(selfChange);
- if (mClockExtension != null) {
- mClockExtension.reload();
- }
- }
- };
+ private ClockManager.ClockChangedListener mClockChangedListener = this::setClockPlugin;
public KeyguardClockSwitch(Context context) {
this(context, null);
@@ -111,8 +78,6 @@
public KeyguardClockSwitch(Context context, AttributeSet attrs) {
super(context, attrs);
- mLayoutInflater = LayoutInflater.from(context);
- mContentResolver = context.getContentResolver();
}
/**
@@ -133,45 +98,14 @@
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
- mClockExtension = Dependency.get(ExtensionController.class).newExtension(ClockPlugin.class)
- .withPlugin(ClockPlugin.class)
- .withCallback(mClockPluginConsumer)
- // Using withDefault even though this isn't the default as a workaround.
- // ExtensionBulider doesn't provide the ability to supply a ClockPlugin
- // instance based off of the value of a setting. Since multiple "default"
- // can be provided, using a supplier that changes the settings value.
- // A null return will cause Extension#reload to look at the next "default"
- // supplier.
- .withDefault(
- new SettingsGattedSupplier(
- mContentResolver,
- Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE,
- BubbleClockController.class.getName(),
- () -> BubbleClockController.build(mLayoutInflater)))
- .withDefault(
- new SettingsGattedSupplier(
- mContentResolver,
- Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE,
- StretchAnalogClockController.class.getName(),
- () -> StretchAnalogClockController.build(mLayoutInflater)))
- .withDefault(
- new SettingsGattedSupplier(
- mContentResolver,
- Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE,
- TypeClockController.class.getName(),
- () -> TypeClockController.build(mLayoutInflater)))
- .build();
- mContentResolver.registerContentObserver(
- Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE),
- false, mContentObserver);
+ Dependency.get(ClockManager.class).addOnClockChangedListener(mClockChangedListener);
Dependency.get(StatusBarStateController.class).addCallback(mStateListener);
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
- mClockExtension.destroy();
- mContentResolver.unregisterContentObserver(mContentObserver);
+ Dependency.get(ClockManager.class).removeOnClockChangedListener(mClockChangedListener);
Dependency.get(StatusBarStateController.class).removeCallback(mStateListener);
}
@@ -313,52 +247,12 @@
}
@VisibleForTesting (otherwise = VisibleForTesting.NONE)
- Consumer<ClockPlugin> getClockPluginConsumer() {
- return mClockPluginConsumer;
+ ClockManager.ClockChangedListener getClockChangedListener() {
+ return mClockChangedListener;
}
@VisibleForTesting (otherwise = VisibleForTesting.NONE)
StatusBarStateController.StateListener getStateListener() {
return mStateListener;
}
-
- /**
- * Supplier that only gets an instance when a settings value matches expected value.
- */
- private static class SettingsGattedSupplier implements Supplier<ClockPlugin> {
-
- private final ContentResolver mContentResolver;
- private final String mKey;
- private final String mValue;
- private final Supplier<ClockPlugin> mSupplier;
-
- /**
- * Constructs a supplier that changes secure setting key against value.
- *
- * @param contentResolver Used to look up settings value.
- * @param key Settings key.
- * @param value If the setting matches this values that get supplies a ClockPlugin
- * instance.
- * @param supplier Supplier of ClockPlugin instance, only used if the setting
- * matches value.
- */
- SettingsGattedSupplier(ContentResolver contentResolver, String key, String value,
- Supplier<ClockPlugin> supplier) {
- mContentResolver = contentResolver;
- mKey = key;
- mValue = value;
- mSupplier = supplier;
- }
-
- /**
- * Returns null if the settings value doesn't match the expected value.
- *
- * A null return causes Extension#reload to skip this supplier and move to the next.
- */
- @Override
- public ClockPlugin get() {
- final String currentValue = Settings.Secure.getString(mContentResolver, mKey);
- return Objects.equals(currentValue, mValue) ? mSupplier.get() : null;
- }
- }
}
diff --git a/packages/SystemUI/src/com/android/keyguard/clock/ClockManager.java b/packages/SystemUI/src/com/android/keyguard/clock/ClockManager.java
new file mode 100644
index 0000000..3217ca6
--- /dev/null
+++ b/packages/SystemUI/src/com/android/keyguard/clock/ClockManager.java
@@ -0,0 +1,202 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.keyguard.clock;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.database.ContentObserver;
+import android.os.Handler;
+import android.os.Looper;
+import android.provider.Settings;
+import android.view.LayoutInflater;
+
+import com.android.systemui.plugins.ClockPlugin;
+import com.android.systemui.statusbar.policy.ExtensionController;
+import com.android.systemui.statusbar.policy.ExtensionController.Extension;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.function.Consumer;
+import java.util.function.Supplier;
+
+import javax.inject.Inject;
+import javax.inject.Singleton;
+
+/**
+ * Manages custom clock faces.
+ */
+@Singleton
+public final class ClockManager {
+
+ private final LayoutInflater mLayoutInflater;
+ private final ContentResolver mContentResolver;
+
+ /**
+ * Observe settings changes to know when to switch the clock face.
+ */
+ private final ContentObserver mContentObserver =
+ new ContentObserver(new Handler(Looper.getMainLooper())) {
+ @Override
+ public void onChange(boolean selfChange) {
+ super.onChange(selfChange);
+ if (mClockExtension != null) {
+ mClockExtension.reload();
+ }
+ }
+ };
+
+ private final ExtensionController mExtensionController;
+ /**
+ * Used to select between plugin or default implementations of ClockPlugin interface.
+ */
+ private Extension<ClockPlugin> mClockExtension;
+ /**
+ * Consumer that accepts the a new ClockPlugin implementation when the Extension reloads.
+ */
+ private final Consumer<ClockPlugin> mClockPluginConsumer = this::setClockPlugin;
+
+ private final List<ClockChangedListener> mListeners = new ArrayList<>();
+
+ @Inject
+ public ClockManager(Context context, ExtensionController extensionController) {
+ mExtensionController = extensionController;
+ mLayoutInflater = LayoutInflater.from(context);
+ mContentResolver = context.getContentResolver();
+ }
+
+ /**
+ * Add listener to be notified when clock implementation should change.
+ */
+ public void addOnClockChangedListener(ClockChangedListener listener) {
+ if (mListeners.isEmpty()) {
+ register();
+ }
+ mListeners.add(listener);
+ if (mClockExtension != null) {
+ mClockExtension.reload();
+ }
+ }
+
+ /**
+ * Remove listener added with {@link addOnClockChangedListener}.
+ */
+ public void removeOnClockChangedListener(ClockChangedListener listener) {
+ mListeners.remove(listener);
+ if (mListeners.isEmpty()) {
+ unregister();
+ }
+ }
+
+ private void setClockPlugin(ClockPlugin plugin) {
+ for (int i = 0; i < mListeners.size(); i++) {
+ // It probably doesn't make sense to supply the same plugin instances to multiple
+ // listeners. This should be fine for now since there is only a single listener.
+ mListeners.get(i).onClockChanged(plugin);
+ }
+ }
+
+ private void register() {
+ mContentResolver.registerContentObserver(
+ Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE),
+ false, mContentObserver);
+ mClockExtension = mExtensionController.newExtension(ClockPlugin.class)
+ .withPlugin(ClockPlugin.class)
+ .withCallback(mClockPluginConsumer)
+ // Using withDefault even though this isn't the default as a workaround.
+ // ExtensionBuilder doesn't provide the ability to supply a ClockPlugin
+ // instance based off of the value of a setting. Since multiple "default"
+ // can be provided, using a supplier that changes the settings value.
+ // A null return will cause Extension#reload to look at the next "default"
+ // supplier.
+ .withDefault(
+ new SettingsGattedSupplier(
+ mContentResolver,
+ Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE,
+ BubbleClockController.class.getName(),
+ () -> BubbleClockController.build(mLayoutInflater)))
+ .withDefault(
+ new SettingsGattedSupplier(
+ mContentResolver,
+ Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE,
+ StretchAnalogClockController.class.getName(),
+ () -> StretchAnalogClockController.build(mLayoutInflater)))
+ .withDefault(
+ new SettingsGattedSupplier(
+ mContentResolver,
+ Settings.Secure.LOCK_SCREEN_CUSTOM_CLOCK_FACE,
+ TypeClockController.class.getName(),
+ () -> TypeClockController.build(mLayoutInflater)))
+ .build();
+ }
+
+ private void unregister() {
+ mContentResolver.unregisterContentObserver(mContentObserver);
+ mClockExtension.destroy();
+ }
+
+ /**
+ * Listener for events that should cause the custom clock face to change.
+ */
+ public interface ClockChangedListener {
+ /**
+ * Called when custom clock should change.
+ *
+ * @param clock Custom clock face to use. A null value indicates the default clock face.
+ */
+ void onClockChanged(ClockPlugin clock);
+ }
+
+ /**
+ * Supplier that only gets an instance when a settings value matches expected value.
+ */
+ private static class SettingsGattedSupplier implements Supplier<ClockPlugin> {
+
+ private final ContentResolver mContentResolver;
+ private final String mKey;
+ private final String mValue;
+ private final Supplier<ClockPlugin> mSupplier;
+
+ /**
+ * Constructs a supplier that changes secure setting key against value.
+ *
+ * @param contentResolver Used to look up settings value.
+ * @param key Settings key.
+ * @param value If the setting matches this values that get supplies a ClockPlugin
+ * instance.
+ * @param supplier Supplier of ClockPlugin instance, only used if the setting
+ * matches value.
+ */
+ SettingsGattedSupplier(ContentResolver contentResolver, String key, String value,
+ Supplier<ClockPlugin> supplier) {
+ mContentResolver = contentResolver;
+ mKey = key;
+ mValue = value;
+ mSupplier = supplier;
+ }
+
+ /**
+ * Returns null if the settings value doesn't match the expected value.
+ *
+ * A null return causes Extension#reload to skip this supplier and move to the next.
+ */
+ @Override
+ public ClockPlugin get() {
+ final String currentValue = Settings.Secure.getString(mContentResolver, mKey);
+ return Objects.equals(currentValue, mValue) ? mSupplier.get() : null;
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/Dependency.java b/packages/SystemUI/src/com/android/systemui/Dependency.java
index ec6ecc6..d99f234 100644
--- a/packages/SystemUI/src/com/android/systemui/Dependency.java
+++ b/packages/SystemUI/src/com/android/systemui/Dependency.java
@@ -29,6 +29,7 @@
import com.android.internal.logging.MetricsLogger;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.util.Preconditions;
+import com.android.keyguard.clock.ClockManager;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.systemui.appops.AppOpsController;
import com.android.systemui.assist.AssistManager;
@@ -283,6 +284,7 @@
@Inject @Named(TIME_TICK_HANDLER_NAME) Lazy<Handler> mTimeTickHandler;
@Nullable
@Inject @Named(LEAK_REPORT_EMAIL_NAME) Lazy<String> mLeakReportEmail;
+ @Inject Lazy<ClockManager> mClockManager;
@Inject
public Dependency() {
@@ -449,6 +451,7 @@
mProviders.put(NotificationAlertingManager.class, mNotificationAlertingManager::get);
mProviders.put(ForegroundServiceNotificationListener.class,
mForegroundServiceNotificationListener::get);
+ mProviders.put(ClockManager.class, mClockManager::get);
// TODO(b/118592525): to support multi-display , we start to add something which is
// per-display, while others may be global. I think it's time to add
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index 957d772..a457dee 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -267,8 +267,9 @@
BubbleView bubble = (BubbleView) mInflater.inflate(
R.layout.bubble_view, mStackView, false /* attachToRoot */);
bubble.setNotif(notif);
- if (shouldUseActivityView(mContext)) {
- bubble.setAppOverlayIntent(getAppOverlayIntent(notif));
+ PendingIntent bubbleIntent = getValidBubbleIntent(notif);
+ if (shouldUseActivityView(mContext) || bubbleIntent != null) {
+ bubble.setBubbleIntent(getValidBubbleIntent(notif));
}
mBubbles.put(bubble.getKey(), bubble);
mStackView.addBubble(bubble);
@@ -282,7 +283,7 @@
}
@Nullable
- private PendingIntent getAppOverlayIntent(NotificationEntry notif) {
+ private PendingIntent getValidBubbleIntent(NotificationEntry notif) {
Notification notification = notif.notification.getNotification();
if (canLaunchInActivityView(notification.getBubbleMetadata() != null
? notification.getBubbleMetadata().getIntent() : null)) {
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
index 9a11b96..dcd121b 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
@@ -38,9 +38,11 @@
import android.view.animation.AccelerateInterpolator;
import android.view.animation.OvershootInterpolator;
import android.widget.FrameLayout;
+import android.widget.LinearLayout;
import androidx.annotation.Nullable;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.widget.ViewClippingUtil;
import com.android.systemui.R;
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
@@ -226,6 +228,19 @@
}
/**
+ * Sets the entry that should be expanded and expands if needed.
+ */
+ @VisibleForTesting
+ public void setExpandedBubble(NotificationEntry entry) {
+ for (int i = 0; i < mBubbleContainer.getChildCount(); i++) {
+ BubbleView bv = (BubbleView) mBubbleContainer.getChildAt(i);
+ if (entry.equals(bv.getEntry())) {
+ setExpandedBubble(bv);
+ }
+ }
+ }
+
+ /**
* Adds a bubble to the top of the stack.
*
* @param bubbleView the view to add to the stack.
@@ -456,7 +471,8 @@
if (mExpandedBubble.hasAppOverlayIntent()) {
// Bubble with activity view expanded state
ActivityView expandedView = mExpandedBubble.getActivityView();
- expandedView.setLayoutParams(new ViewGroup.LayoutParams(
+ // XXX: gets added to linear layout
+ expandedView.setLayoutParams(new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT, mExpandedBubbleHeight));
final PendingIntent intent = mExpandedBubble.getAppOverlayIntent();
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java
index 91893ef..7b6e79b 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleView.java
@@ -298,7 +298,7 @@
}
- public void setAppOverlayIntent(PendingIntent intent) {
+ public void setBubbleIntent(PendingIntent intent) {
mAppOverlayIntent = intent;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/dock/DockManager.java b/packages/SystemUI/src/com/android/systemui/dock/DockManager.java
index fa5a114..d332f59 100644
--- a/packages/SystemUI/src/com/android/systemui/dock/DockManager.java
+++ b/packages/SystemUI/src/com/android/systemui/dock/DockManager.java
@@ -48,6 +48,11 @@
*/
void removeListener(DockEventListener callback);
+ /**
+ * Returns true if the device is in docking state.
+ */
+ boolean isDocked();
+
/** Callback for receiving dock events */
interface DockEventListener {
/**
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeDockHandler.java b/packages/SystemUI/src/com/android/systemui/doze/DozeDockHandler.java
index 9fc2234..5353ee6 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeDockHandler.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeDockHandler.java
@@ -22,7 +22,6 @@
import android.util.Log;
import com.android.internal.hardware.AmbientDisplayConfiguration;
-import com.android.systemui.SysUiServiceProvider;
import com.android.systemui.dock.DockManager;
import com.android.systemui.doze.DozeMachine.State;
@@ -46,12 +45,12 @@
private int mDockState = DockManager.STATE_NONE;
public DozeDockHandler(Context context, DozeMachine machine, DozeHost dozeHost,
- AmbientDisplayConfiguration config, Handler handler) {
+ AmbientDisplayConfiguration config, Handler handler, DockManager dockManager) {
mMachine = machine;
mDozeHost = dozeHost;
mConfig = config;
mHandler = handler;
- mDockManager = SysUiServiceProvider.getComponent(context, DockManager.class);
+ mDockManager = dockManager;
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java b/packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java
index 58ae555..e338a34 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeFactory.java
@@ -27,8 +27,10 @@
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.Dependency;
import com.android.systemui.R;
+import com.android.systemui.SysUiServiceProvider;
import com.android.systemui.SystemUIApplication;
import com.android.systemui.classifier.FalsingManager;
+import com.android.systemui.dock.DockManager;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.util.AsyncSensorManager;
import com.android.systemui.util.wakelock.DelayedWakeLock;
@@ -44,6 +46,7 @@
Context context = dozeService;
SensorManager sensorManager = Dependency.get(AsyncSensorManager.class);
AlarmManager alarmManager = context.getSystemService(AlarmManager.class);
+ DockManager dockManager = SysUiServiceProvider.getComponent(context, DockManager.class);
DozeHost host = getHost(dozeService);
AmbientDisplayConfiguration config = new AmbientDisplayConfiguration(context);
@@ -63,13 +66,13 @@
new DozePauser(handler, machine, alarmManager, params.getPolicy()),
new DozeFalsingManagerAdapter(FalsingManager.getInstance(context)),
createDozeTriggers(context, sensorManager, host, alarmManager, config, params,
- handler, wakeLock, machine),
+ handler, wakeLock, machine, dockManager),
createDozeUi(context, host, wakeLock, machine, handler, alarmManager, params),
new DozeScreenState(wrappedService, handler, params, wakeLock),
createDozeScreenBrightness(context, wrappedService, sensorManager, host, params,
handler),
new DozeWallpaperState(context),
- new DozeDockHandler(context, machine, host, config, handler)
+ new DozeDockHandler(context, machine, host, config, handler, dockManager)
});
return machine;
@@ -86,10 +89,11 @@
private DozeTriggers createDozeTriggers(Context context, SensorManager sensorManager,
DozeHost host, AlarmManager alarmManager, AmbientDisplayConfiguration config,
- DozeParameters params, Handler handler, WakeLock wakeLock, DozeMachine machine) {
+ DozeParameters params, Handler handler, WakeLock wakeLock, DozeMachine machine,
+ DockManager dockManager) {
boolean allowPulseTriggers = true;
return new DozeTriggers(context, machine, host, alarmManager, config, params,
- sensorManager, handler, wakeLock, allowPulseTriggers);
+ sensorManager, handler, wakeLock, allowPulseTriggers, dockManager);
}
private DozeMachine.Part createDozeUi(Context context, DozeHost host, WakeLock wakeLock,
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java
index 78374a0..562edd6 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java
@@ -214,6 +214,15 @@
mPickupSensor.setDisabled(disable);
}
+ /** Ignore the setting value of only the sensors that require the touchscreen. */
+ public void ignoreTouchScreenSensorsSettingInterferingWithDocking(boolean ignore) {
+ for (TriggerSensor sensor : mSensors) {
+ if (sensor.mRequiresTouchscreen) {
+ sensor.ignoreSetting(ignore);
+ }
+ }
+ }
+
/** Dump current state */
public void dump(PrintWriter pw) {
for (TriggerSensor s : mSensors) {
@@ -323,6 +332,7 @@
protected boolean mRequested;
protected boolean mRegistered;
protected boolean mDisabled;
+ protected boolean mIgnoresSetting;
public TriggerSensor(Sensor sensor, String setting, boolean configured, int pulseReason,
boolean reportsTouchCoordinates, boolean requiresTouchscreen) {
@@ -333,6 +343,13 @@
public TriggerSensor(Sensor sensor, String setting, boolean settingDef,
boolean configured, int pulseReason, boolean reportsTouchCoordinates,
boolean requiresTouchscreen) {
+ this(sensor, setting, settingDef, configured, pulseReason, reportsTouchCoordinates,
+ requiresTouchscreen, false /* ignoresSetting */);
+ }
+
+ private TriggerSensor(Sensor sensor, String setting, boolean settingDef,
+ boolean configured, int pulseReason, boolean reportsTouchCoordinates,
+ boolean requiresTouchscreen, boolean ignoresSetting) {
mSensor = sensor;
mSetting = setting;
mSettingDefault = settingDef;
@@ -340,6 +357,7 @@
mPulseReason = pulseReason;
mReportsTouchCoordinates = reportsTouchCoordinates;
mRequiresTouchscreen = requiresTouchscreen;
+ mIgnoresSetting = ignoresSetting;
}
public void setListening(boolean listen) {
@@ -354,9 +372,16 @@
updateListener();
}
+ public void ignoreSetting(boolean ignored) {
+ if (mIgnoresSetting == ignored) return;
+ mIgnoresSetting = ignored;
+ updateListener();
+ }
+
public void updateListener() {
if (!mConfigured || mSensor == null) return;
- if (mRequested && !mDisabled && enabledBySetting() && !mRegistered) {
+ if (mRequested && !mDisabled && (enabledBySetting() || mIgnoresSetting)
+ && !mRegistered) {
mRegistered = mSensorManager.requestTriggerSensor(this, mSensor);
if (DEBUG) Log.d(TAG, "requestTriggerSensor " + mRegistered);
} else if (mRegistered) {
@@ -382,6 +407,7 @@
.append(", mRequested=").append(mRequested)
.append(", mDisabled=").append(mDisabled)
.append(", mConfigured=").append(mConfigured)
+ .append(", mIgnoresSetting=").append(mIgnoresSetting)
.append(", mSensor=").append(mSensor).append("}").toString();
}
@@ -464,7 +490,8 @@
public void updateListener() {
if (!mConfigured) return;
AsyncSensorManager asyncSensorManager = (AsyncSensorManager) mSensorManager;
- if (mRequested && !mDisabled && enabledBySetting() && !mRegistered) {
+ if (mRequested && !mDisabled && (enabledBySetting() || mIgnoresSetting)
+ && !mRegistered) {
asyncSensorManager.registerPluginListener(mPluginSensor, mTriggerEventListener);
mRegistered = true;
if (DEBUG) Log.d(TAG, "registerPluginListener");
@@ -481,6 +508,7 @@
.append(", mRequested=").append(mRequested)
.append(", mDisabled=").append(mDisabled)
.append(", mConfigured=").append(mConfigured)
+ .append(", mIgnoresSetting=").append(mIgnoresSetting)
.append(", mSensor=").append(mPluginSensor).append("}").toString();
}
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java
index e2e448b..dc505b5 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java
@@ -33,8 +33,10 @@
import android.text.format.Formatter;
import android.util.Log;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.internal.util.Preconditions;
+import com.android.systemui.dock.DockManager;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.util.Assert;
import com.android.systemui.util.wakelock.WakeLock;
@@ -71,6 +73,8 @@
private final boolean mAllowPulseTriggers;
private final UiModeManager mUiModeManager;
private final TriggerReceiver mBroadcastReceiver = new TriggerReceiver();
+ private final DockEventListener mDockEventListener = new DockEventListener();
+ private final DockManager mDockManager;
private long mNotificationPulseTime;
private boolean mPulsePending;
@@ -79,7 +83,7 @@
public DozeTriggers(Context context, DozeMachine machine, DozeHost dozeHost,
AlarmManager alarmManager, AmbientDisplayConfiguration config,
DozeParameters dozeParameters, SensorManager sensorManager, Handler handler,
- WakeLock wakeLock, boolean allowPulseTriggers) {
+ WakeLock wakeLock, boolean allowPulseTriggers, DockManager dockManager) {
mContext = context;
mMachine = machine;
mDozeHost = dozeHost;
@@ -93,6 +97,7 @@
config, wakeLock, this::onSensor, this::onProximityFar,
dozeParameters.getPolicy());
mUiModeManager = mContext.getSystemService(UiModeManager.class);
+ mDockManager = dockManager;
}
private void onNotification() {
@@ -129,7 +134,8 @@
}
}
- private void onSensor(int pulseReason, boolean sensorPerformedProxCheck,
+ @VisibleForTesting
+ void onSensor(int pulseReason, boolean sensorPerformedProxCheck,
float screenX, float screenY, float[] rawValues) {
boolean isDoubleTap = pulseReason == DozeLog.PULSE_REASON_SENSOR_DOUBLE_TAP;
boolean isTap = pulseReason == DozeLog.PULSE_REASON_SENSOR_TAP;
@@ -159,7 +165,7 @@
} else {
mDozeHost.extendPulse();
}
- }, sensorPerformedProxCheck, pulseReason);
+ }, sensorPerformedProxCheck || mDockManager.isDocked(), pulseReason);
}
if (isPickup) {
@@ -223,6 +229,7 @@
case INITIALIZED:
mBroadcastReceiver.register(mContext);
mDozeHost.addCallback(mHostCallback);
+ mDockManager.addListener(mDockEventListener);
checkTriggersAtInit();
break;
case DOZE:
@@ -248,6 +255,7 @@
case FINISH:
mBroadcastReceiver.unregister(mContext);
mDozeHost.removeCallback(mHostCallback);
+ mDockManager.removeListener(mDockEventListener);
mDozeSensors.setListening(false);
mDozeSensors.setProxListening(false);
break;
@@ -423,6 +431,24 @@
}
}
+ private class DockEventListener implements DockManager.DockEventListener {
+ @Override
+ public void onEvent(int event) {
+ if (DEBUG) Log.d(TAG, "dock event = " + event);
+ switch (event) {
+ case DockManager.STATE_DOCKED:
+ case DockManager.STATE_DOCKED_HIDE:
+ mDozeSensors.ignoreTouchScreenSensorsSettingInterferingWithDocking(true);
+ break;
+ case DockManager.STATE_NONE:
+ mDozeSensors.ignoreTouchScreenSensorsSettingInterferingWithDocking(false);
+ break;
+ default:
+ // no-op
+ }
+ }
+ }
+
private DozeHost.Callback mHostCallback = new DozeHost.Callback() {
@Override
public void onNotificationAlerted() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java
index 5ba9b4b..76d394d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/logging/NotificationLogger.java
@@ -32,6 +32,7 @@
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.NotificationVisibility;
+import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
import com.android.systemui.UiOffloadThread;
import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.StatusBarStateController;
@@ -460,7 +461,9 @@
mUiOffloadThread.submit(() -> {
try {
mBarService.onNotificationExpansionChanged(
- key, stateToBeLogged.mIsUserAction, stateToBeLogged.mIsExpanded);
+ key, stateToBeLogged.mIsUserAction, stateToBeLogged.mIsExpanded,
+ // TODO (b/120767764): fill in location
+ ExpandableViewState.LOCATION_UNKNOWN /* notificationLocation */);
} catch (RemoteException e) {
Log.e(TAG, "Failed to call onNotificationExpansionChanged: ", e);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java
index 2a11c26..d022808 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NearestTouchFrame.java
@@ -97,10 +97,11 @@
}
return mClickableChildren
.stream()
- .filter(v -> v.isAttachedToWindow())
+ .filter(View::isAttachedToWindow)
.map(v -> new Pair<>(distance(v, event), v))
.min(Comparator.comparingInt(f -> f.first))
- .get().second;
+ .map(data -> data.second)
+ .orElse(null);
}
private int distance(View v, MotionEvent event) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java
index 88f9048..ffaa236 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowController.java
@@ -69,13 +69,13 @@
private final WindowManager mWindowManager;
private final IActivityManager mActivityManager;
private final DozeParameters mDozeParameters;
+ private final WindowManager.LayoutParams mLpChanged;
+ private final boolean mKeyguardScreenRotation;
private ViewGroup mStatusBarView;
private WindowManager.LayoutParams mLp;
- private WindowManager.LayoutParams mLpChanged;
private boolean mHasTopUi;
private boolean mHasTopUiChanged;
private int mBarHeight;
- private final boolean mKeyguardScreenRotation;
private float mScreenBrightnessDoze;
private final State mCurrentState = new State();
private OtherwisedCollapsedListener mListener;
@@ -97,6 +97,7 @@
mKeyguardScreenRotation = shouldEnableKeyguardScreenRotation();
mDozeParameters = dozeParameters;
mScreenBrightnessDoze = mDozeParameters.getScreenBrightnessDoze();
+ mLpChanged = new WindowManager.LayoutParams();
Dependency.get(StatusBarStateController.class).addCallback(
mStateListener, StatusBarStateController.RANK_STATUS_BAR_WINDOW_CONTROLLER);
Dependency.get(ConfigurationController.class).addCallback(this);
@@ -138,7 +139,6 @@
mStatusBarView = statusBarView;
mBarHeight = barHeight;
mWindowManager.addView(mStatusBarView, mLp);
- mLpChanged = new WindowManager.LayoutParams();
mLpChanged.copyFrom(mLp);
onThemeChanged();
}
@@ -228,7 +228,9 @@
private void applyHeight(State state) {
boolean expanded = isExpanded(state);
if (state.forcePluginOpen) {
- mListener.setWouldOtherwiseCollapse(expanded);
+ if (mListener != null) {
+ mListener.setWouldOtherwiseCollapse(expanded);
+ }
expanded = true;
}
if (expanded) {
@@ -247,7 +249,7 @@
private void applyFitsSystemWindows(State state) {
boolean fitsSystemWindows = !state.isKeyguardShowingAndNotOccluded();
- if (mStatusBarView.getFitsSystemWindows() != fitsSystemWindows) {
+ if (mStatusBarView != null && mStatusBarView.getFitsSystemWindows() != fitsSystemWindows) {
mStatusBarView.setFitsSystemWindows(fitsSystemWindows);
mStatusBarView.requestApplyInsets();
}
@@ -289,7 +291,7 @@
applyBrightness(state);
applyHasTopUi(state);
applyNotTouchable(state);
- if (mLp.copyFrom(mLpChanged) != 0) {
+ if (mLp != null && mLp.copyFrom(mLpChanged) != 0) {
mWindowManager.updateViewLayout(mStatusBarView, mLp);
}
if (mHasTopUi != mHasTopUiChanged) {
diff --git a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java
index fbc1c20..d80b444 100644
--- a/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java
+++ b/packages/SystemUI/tests/src/com/android/keyguard/KeyguardClockSwitchTest.java
@@ -39,6 +39,7 @@
import android.widget.FrameLayout;
import android.widget.TextClock;
+import com.android.keyguard.clock.ClockManager;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.plugins.ClockPlugin;
import com.android.systemui.statusbar.StatusBarState;
@@ -51,8 +52,6 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-import java.util.function.Consumer;
-
@SmallTest
@RunWith(AndroidTestingRunner.class)
// Need to run on the main thread because KeyguardSliceView$Row init checks for
@@ -85,7 +84,7 @@
TextClock pluginView = new TextClock(getContext());
when(plugin.getView()).thenReturn(pluginView);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin);
verify(mClockView).setVisibility(GONE);
assertThat(plugin.getView().getParent()).isEqualTo(mClockContainer);
@@ -102,7 +101,7 @@
TextClock pluginView = new TextClock(getContext());
when(plugin.getBigClockView()).thenReturn(pluginView);
// WHEN the plugin is connected
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin);
// THEN the big clock container is visible and it is the parent of the
// big clock view.
assertThat(bigClockContainer.getVisibility()).isEqualTo(VISIBLE);
@@ -112,7 +111,7 @@
@Test
public void onPluginConnected_nullView() {
ClockPlugin plugin = mock(ClockPlugin.class);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin);
verify(mClockView, never()).setVisibility(GONE);
}
@@ -121,11 +120,11 @@
// GIVEN a plugin has already connected
ClockPlugin plugin1 = mock(ClockPlugin.class);
when(plugin1.getView()).thenReturn(new TextClock(getContext()));
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin1);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin1);
// WHEN a second plugin is connected
ClockPlugin plugin2 = mock(ClockPlugin.class);
when(plugin2.getView()).thenReturn(new TextClock(getContext()));
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin2);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin2);
// THEN only the view from the second plugin should be a child of KeyguardClockSwitch.
assertThat(plugin2.getView().getParent()).isEqualTo(mClockContainer);
assertThat(plugin1.getView().getParent()).isNull();
@@ -137,7 +136,7 @@
mKeyguardClockSwitch.setDarkAmount(0.5f);
// WHEN a plugin is connected
ClockPlugin plugin = mock(ClockPlugin.class);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin);
// THEN dark amount should be initalized on the plugin.
verify(plugin).setDarkAmount(0.5f);
}
@@ -149,8 +148,8 @@
when(plugin.getView()).thenReturn(pluginView);
mClockView.setVisibility(GONE);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(null);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(null);
verify(mClockView).setVisibility(VISIBLE);
assertThat(plugin.getView().getParent()).isNull();
@@ -167,8 +166,8 @@
TextClock pluginView = new TextClock(getContext());
when(plugin.getBigClockView()).thenReturn(pluginView);
// WHEN the plugin is connected and then disconnected
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(null);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(null);
// THEN the big lock container is GONE and the big clock view doesn't have
// a parent.
assertThat(bigClockContainer.getVisibility()).isEqualTo(GONE);
@@ -178,8 +177,8 @@
@Test
public void onPluginDisconnected_nullView() {
ClockPlugin plugin = mock(ClockPlugin.class);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(null);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(null);
verify(mClockView, never()).setVisibility(GONE);
}
@@ -188,13 +187,13 @@
// GIVEN two plugins are connected
ClockPlugin plugin1 = mock(ClockPlugin.class);
when(plugin1.getView()).thenReturn(new TextClock(getContext()));
- Consumer<ClockPlugin> consumer = mKeyguardClockSwitch.getClockPluginConsumer();
- consumer.accept(plugin1);
+ ClockManager.ClockChangedListener listener = mKeyguardClockSwitch.getClockChangedListener();
+ listener.onClockChanged(plugin1);
ClockPlugin plugin2 = mock(ClockPlugin.class);
when(plugin2.getView()).thenReturn(new TextClock(getContext()));
- consumer.accept(plugin2);
+ listener.onClockChanged(plugin2);
// WHEN the second plugin is disconnected
- consumer.accept(null);
+ listener.onClockChanged(null);
// THEN the default clock should be shown.
verify(mClockView).setVisibility(VISIBLE);
assertThat(plugin1.getView().getParent()).isNull();
@@ -213,7 +212,7 @@
ClockPlugin plugin = mock(ClockPlugin.class);
TextClock pluginView = new TextClock(getContext());
when(plugin.getView()).thenReturn(pluginView);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin);
mKeyguardClockSwitch.setTextColor(Color.WHITE);
@@ -237,7 +236,7 @@
TextClock pluginView = new TextClock(getContext());
when(plugin.getView()).thenReturn(pluginView);
Style style = mock(Style.class);
- mKeyguardClockSwitch.getClockPluginConsumer().accept(plugin);
+ mKeyguardClockSwitch.getClockChangedListener().onClockChanged(plugin);
mKeyguardClockSwitch.setStyle(style);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java
index fa5cf04..60a20cf 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java
@@ -16,6 +16,7 @@
package com.android.systemui.bubbles;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.atLeastOnce;
@@ -160,6 +161,12 @@
stackView.expandStack();
assertTrue(mBubbleController.isStackExpanded());
+ stackView.setExpandedBubble(mRow.getEntry());
+ assertEquals(stackView.getExpandedBubble().getEntry(), mRow.getEntry());
+
+ stackView.setExpandedBubble(mRow2.getEntry());
+ assertEquals(stackView.getExpandedBubble().getEntry(), mRow2.getEntry());
+
mBubbleController.collapseStack();
assertFalse(mBubbleController.isStackExpanded());
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/dock/DockManagerFake.java b/packages/SystemUI/tests/src/com/android/systemui/dock/DockManagerFake.java
index b368876..839b5e4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/dock/DockManagerFake.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/dock/DockManagerFake.java
@@ -32,6 +32,11 @@
this.mCallback = null;
}
+ @Override
+ public boolean isDocked() {
+ return false;
+ }
+
public void setDockEvent(int event) {
mCallback.onEvent(event);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationUtil.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationUtil.java
index f45500a..e4558df 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationUtil.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeConfigurationUtil.java
@@ -36,6 +36,8 @@
when(params.getPickupVibrationThreshold()).thenReturn(0);
when(params.getProxCheckBeforePulse()).thenReturn(true);
when(params.getPickupSubtypePerformsProxCheck(anyInt())).thenReturn(true);
+ when(params.getPolicy()).thenReturn(mock(AlwaysOnDisplayPolicy.class));
+ when(params.doubleTapReportsTouchCoordinates()).thenReturn(false);
doneHolder[0] = true;
return params;
@@ -48,9 +50,14 @@
when(config.doubleTapGestureEnabled(anyInt())).thenReturn(false);
when(config.pickupGestureEnabled(anyInt())).thenReturn(false);
when(config.pulseOnNotificationEnabled(anyInt())).thenReturn(true);
+ when(config.alwaysOnEnabled(anyInt())).thenReturn(false);
when(config.doubleTapSensorType()).thenReturn(null);
+ when(config.tapSensorType()).thenReturn(null);
+ when(config.longPressSensorType()).thenReturn(null);
+
when(config.dozePickupSensorAvailable()).thenReturn(false);
+ when(config.wakeScreenGestureAvailable()).thenReturn(false);
doneHolder[0] = true;
return config;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeDockHandlerTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeDockHandlerTest.java
index 926ff69..0fc0953 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeDockHandlerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeDockHandlerTest.java
@@ -75,7 +75,7 @@
mContext.putComponent(DockManager.class, mDockManagerFake);
mDockHandler = new DozeDockHandler(mContext, mMachine, mHost, mConfig,
- Handler.createAsync(Looper.myLooper()));
+ Handler.createAsync(Looper.myLooper()), mDockManagerFake);
}
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java
index 31fc625..7b358b9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/doze/DozeTriggersTest.java
@@ -18,8 +18,10 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -34,6 +36,8 @@
import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.dock.DockManager;
+import com.android.systemui.dock.DockManagerFake;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.util.wakelock.WakeLock;
import com.android.systemui.util.wakelock.WakeLockFake;
@@ -59,6 +63,7 @@
private WakeLock mWakeLock;
private Instrumentation mInstrumentation;
private AlarmManager mAlarmManager;
+ private DockManagerFake mDockManagerFake;
@BeforeClass
public static void setupSuite() {
@@ -76,9 +81,12 @@
mParameters = DozeConfigurationUtil.createMockParameters();
mSensors = new FakeSensorManager(mContext);
mWakeLock = new WakeLockFake();
+ mDockManagerFake = spy(new DockManagerFake());
+ mContext.putComponent(DockManager.class, mDockManagerFake);
mTriggers = new DozeTriggers(mContext, mMachine, mHost, mAlarmManager, mConfig, mParameters,
- mSensors, Handler.createAsync(Looper.myLooper()), mWakeLock, true);
+ mSensors, Handler.createAsync(Looper.myLooper()), mWakeLock, true,
+ mDockManagerFake);
}
@Test
@@ -102,4 +110,38 @@
verify(mMachine).requestPulse(anyInt());
}
+ @Test
+ public void testDockEventListener_registerAndUnregister() {
+ mTriggers.transitionTo(DozeMachine.State.UNINITIALIZED, DozeMachine.State.INITIALIZED);
+
+ verify(mDockManagerFake).addListener(any());
+
+ mTriggers.transitionTo(DozeMachine.State.DOZE, DozeMachine.State.FINISH);
+
+ verify(mDockManagerFake).removeListener(any());
+ }
+
+ @Test
+ public void testOnSensor_whenUndockedWithNearAndDoubleTapScreen_shouldNotWakeUp() {
+ mSensors.getMockProximitySensor().sendProximityResult(false /* far */);
+
+ mTriggers.onSensor(DozeLog.PULSE_REASON_SENSOR_DOUBLE_TAP,
+ false /* sensorPerformedProxCheck */, 50 /* screenX */, 50 /* screenY */,
+ null /* rawValues */);
+
+ verify(mMachine, never()).wakeUp();
+ }
+
+ @Test
+ public void testOnSensor_whenDockedWithNearAndDoubleTapScreen_shouldWakeUp() {
+ doReturn(true).when(mDockManagerFake).isDocked();
+ mSensors.getMockProximitySensor().sendProximityResult(false /* far */);
+
+ mTriggers.onSensor(DozeLog.PULSE_REASON_SENSOR_DOUBLE_TAP,
+ false /* sensorPerformedProxCheck */, 50 /* screenX */, 50 /* screenY */,
+ null /* rawValues */);
+
+ verify(mMachine).wakeUp();
+ }
+
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java
index 4b03399..2f6b221 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java
@@ -17,6 +17,7 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
@@ -27,6 +28,7 @@
import com.android.internal.statusbar.IStatusBarService;
import com.android.internal.statusbar.NotificationVisibility;
+import com.android.systemui.statusbar.notification.stack.ExpandableViewState;
import com.android.systemui.Dependency;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.UiOffloadThread;
@@ -66,7 +68,7 @@
waitForUiOffloadThread();
verify(mBarService, Mockito.never()).onNotificationExpansionChanged(
- eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean());
+ eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean(), anyInt());
}
@Test
@@ -75,7 +77,7 @@
waitForUiOffloadThread();
verify(mBarService, Mockito.never()).onNotificationExpansionChanged(
- eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean());
+ eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean(), anyInt());
}
@Test
@@ -87,7 +89,7 @@
waitForUiOffloadThread();
verify(mBarService, Mockito.never()).onNotificationExpansionChanged(
- eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean());
+ eq(NOTIFICATION_KEY), anyBoolean(), anyBoolean(), anyInt());
}
@Test
@@ -99,7 +101,7 @@
waitForUiOffloadThread();
verify(mBarService).onNotificationExpansionChanged(
- NOTIFICATION_KEY, true, true);
+ NOTIFICATION_KEY, true, true, ExpandableViewState.LOCATION_UNKNOWN);
}
@Test
@@ -111,7 +113,7 @@
waitForUiOffloadThread();
verify(mBarService).onNotificationExpansionChanged(
- NOTIFICATION_KEY, false, true);
+ NOTIFICATION_KEY, false, true, ExpandableViewState.LOCATION_UNKNOWN);
}
@Test
@@ -123,7 +125,7 @@
waitForUiOffloadThread();
verify(mBarService).onNotificationExpansionChanged(
- NOTIFICATION_KEY, false, true);
+ NOTIFICATION_KEY, false, true, ExpandableViewState.LOCATION_UNKNOWN);
}
@Test
@@ -136,7 +138,7 @@
waitForUiOffloadThread();
verify(mBarService).onNotificationExpansionChanged(
- NOTIFICATION_KEY, false, true);
+ NOTIFICATION_KEY, false, true, ExpandableViewState.LOCATION_UNKNOWN);
}
private NotificationVisibility createNotificationVisibility(String key, boolean visibility) {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java
index 667a508..4dee438 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NearestTouchFrameTest.java
@@ -17,7 +17,6 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
-import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
@@ -171,6 +170,19 @@
ev.recycle();
}
+ @Test
+ public void testViewNotAttachedNoCrash() {
+ View view = mockViewAt(0, 20, 10, 10);
+ when(view.isAttachedToWindow()).thenReturn(false);
+ mNearestTouchFrame.addView(view);
+ mNearestTouchFrame.onMeasure(0, 0);
+
+ MotionEvent ev = MotionEvent.obtain(0, 0, 0, 5 /* x */, 18 /* y */, 0);
+ mNearestTouchFrame.onTouchEvent(ev);
+ verify(view, never()).onTouchEvent(eq(ev));
+ ev.recycle();
+ }
+
private View mockViewAt(int x, int y, int width, int height) {
View v = spy(new View(mContext));
doAnswer(invocation -> {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java
index 98d0c6b..9996a9e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java
@@ -95,4 +95,11 @@
public void testAdd_updatesVisibilityFlags() {
verify(mStatusBarView).setSystemUiVisibility(anyInt());
}
+
+ @Test
+ public void testSetForcePluginOpen_beforeStatusBarInitialization() {
+ mStatusBarWindowController = new StatusBarWindowController(mContext, mWindowManager,
+ mActivityManager, mDozeParameters);
+ mStatusBarWindowController.setForcePluginOpen(true);
+ }
}
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-af/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-af/strings.xml
new file mode 100644
index 0000000..9ac5fd6
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-af/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Eksperiment met verstek navigasiebalk (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-am/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-am/strings.xml
new file mode 100644
index 0000000..c15f374
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-am/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ነባሪ የዳሰሳ አሞሌ ሙከራ (48 ዲፒ)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ar/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ar/strings.xml
new file mode 100644
index 0000000..26abf03
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ar/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"تجربة شريط التنقل التلقائي (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-as/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-as/strings.xml
new file mode 100644
index 0000000..cfd21b1
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-as/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ডিফ’ল্ট নেভিগে’শ্বন বাৰ সম্পৰীক্ষা (৪৮ডিপি)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-az/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-az/strings.xml
new file mode 100644
index 0000000..a7e9110
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-az/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Defolt Naviqasiya Paneli Təcrübəsi (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-b+sr+Latn/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-b+sr+Latn/strings.xml
new file mode 100644
index 0000000..1222625
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-b+sr+Latn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Eksperiment sa tankom trakom za navigaciju (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-be/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-be/strings.xml
new file mode 100644
index 0000000..da91427
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-be/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Эксперымент са стандартнай панэллю навігацыі (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-bg/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-bg/strings.xml
new file mode 100644
index 0000000..7295457
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-bg/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Експеримент със стандартна лента за навигация (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-bn/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-bn/strings.xml
new file mode 100644
index 0000000..1515805
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-bn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ডিফল্ট নেভিগেশন বার সম্পর্কিত পরীক্ষা (৪৮ ডিপি)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-bs/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-bs/strings.xml
new file mode 100644
index 0000000..dea0884
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-bs/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Eksperiment sa zadanom trakom za navigaciju (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ca/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ca/strings.xml
new file mode 100644
index 0000000..d422c86
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ca/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experiment amb barra de navegació predeterminada (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-cs/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-cs/strings.xml
new file mode 100644
index 0000000..61d4131
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-cs/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Výchozí navigační panel – experiment (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-da/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-da/strings.xml
new file mode 100644
index 0000000..78c5ff3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-da/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Test med standardnavigationslinje (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-de/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-de/strings.xml
new file mode 100644
index 0000000..a0779b5
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-de/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Test mit Standard-Navigationsleiste (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-el/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-el/strings.xml
new file mode 100644
index 0000000..b34cf5afb
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-el/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Πείραμα προεπιλεγμένης γραμμής πλοήγησης (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rAU/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rAU/strings.xml
new file mode 100644
index 0000000..aa3bf66
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rAU/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Default Navigation Bar Experiment (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rCA/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rCA/strings.xml
new file mode 100644
index 0000000..aa3bf66
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rCA/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Default Navigation Bar Experiment (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rGB/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rGB/strings.xml
new file mode 100644
index 0000000..aa3bf66
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rGB/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Default Navigation Bar Experiment (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rIN/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rIN/strings.xml
new file mode 100644
index 0000000..aa3bf66
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-en-rIN/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Default Navigation Bar Experiment (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-es-rUS/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-es-rUS/strings.xml
new file mode 100644
index 0000000..81297d0
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-es-rUS/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experimento de la barra navegación predeterminada (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-es/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-es/strings.xml
new file mode 100644
index 0000000..81297d0
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-es/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experimento de la barra navegación predeterminada (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-et/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-et/strings.xml
new file mode 100644
index 0000000..8a442be
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-et/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Vaikenavigeerimisriba katse (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-eu/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-eu/strings.xml
new file mode 100644
index 0000000..fdf4c4e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-eu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Nabigazio-barra lehenetsiaren esperimentua (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fa/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fa/strings.xml
new file mode 100644
index 0000000..d521f79
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fa/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"آزمایش نوار پیمایش پیشفرض (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fi/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fi/strings.xml
new file mode 100644
index 0000000..2e538a3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Oletusnavigointipalkin kokeilu (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fr-rCA/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fr-rCA/strings.xml
new file mode 100644
index 0000000..171a37e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fr-rCA/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Expérience de barre de navigation par défaut (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fr/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fr/strings.xml
new file mode 100644
index 0000000..bcbf94d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-fr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Test relatif à la barre de navigation par défaut (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-gl/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-gl/strings.xml
new file mode 100644
index 0000000..b9a0165
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-gl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experimento da barra de navegación predeterminada (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-gu/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-gu/strings.xml
new file mode 100644
index 0000000..f4cdb38
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-gu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ડિફૉલ્ટ નૅવિગેશન બારનો પ્રયોગ (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hi/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hi/strings.xml
new file mode 100644
index 0000000..ee8a739
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"डिफ़ॉल्ट नेविगेशन बार प्रयोग (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hr/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hr/strings.xml
new file mode 100644
index 0000000..63a5b044
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Eksperiment s tankom navigacijskom trakom (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hu/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hu/strings.xml
new file mode 100644
index 0000000..110347c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Kísérleti alapértelmezett navigációs sáv (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hy/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hy/strings.xml
new file mode 100644
index 0000000..9ef0d82
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-hy/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Նավարկման կանխադրված գոտու փորձարկում (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-in/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-in/strings.xml
new file mode 100644
index 0000000..c48e0a7
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-in/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Eksperimen Menu Navigasi Default (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-is/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-is/strings.xml
new file mode 100644
index 0000000..1950f5d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-is/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Tilraun með sjálfgefna yfirlitsstiku (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-it/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-it/strings.xml
new file mode 100644
index 0000000..45985d9
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-it/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Esperimento Barra di navigazione predefinita (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-iw/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-iw/strings.xml
new file mode 100644
index 0000000..1d99dfe
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-iw/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ניסוי של סרגל ניווט דק (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ja/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ja/strings.xml
new file mode 100644
index 0000000..80e6954
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ja/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"デフォルト ナビゲーション バー テスト(48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ka/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ka/strings.xml
new file mode 100644
index 0000000..f623c11
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ka/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ნავიგაციის ნაგულისხმევი ზოლის ექსპერიმენტი (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-kk/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-kk/strings.xml
new file mode 100644
index 0000000..f42d9ac
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-kk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Әдепкі навигация жолағы (эксперимент) (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-km/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-km/strings.xml
new file mode 100644
index 0000000..a1316b7
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-km/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ការពិសោធនៃរបាររុករកលំនាំដើម (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-kn/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-kn/strings.xml
new file mode 100644
index 0000000..15f3f4a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-kn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ಡೀಫಾಲ್ಟ್ ನ್ಯಾವಿಗೇಶನ್ ಬಾರ್ ಪ್ರಯೋಗ (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ko/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ko/strings.xml
new file mode 100644
index 0000000..08a93df
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ko/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"기본 탐색 메뉴 실험(48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ky/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ky/strings.xml
new file mode 100644
index 0000000..e352c7f3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ky/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Демейки чабыттоо тилкесин сыноо (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-lo/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-lo/strings.xml
new file mode 100644
index 0000000..6dfeacf
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-lo/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ການທົດສອບແຖບນໍາທາງແບບບາງ (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-lt/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-lt/strings.xml
new file mode 100644
index 0000000..0752655
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-lt/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Numatytosios naršymo juostos eksperimentas (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-lv/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-lv/strings.xml
new file mode 100644
index 0000000..c72c9eb
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-lv/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Noklusējuma navigācijas joslas eksperiments (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-mk/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-mk/strings.xml
new file mode 100644
index 0000000..de21e96
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-mk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Експеримент со стандардна лента за навигација (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ml/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ml/strings.xml
new file mode 100644
index 0000000..8870ae7
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ml/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"സ്ലിം നാവിഗേഷൻ ബാർ പരീക്ഷണം (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-mn/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-mn/strings.xml
new file mode 100644
index 0000000..29377d1
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-mn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Өгөгдмөл навигацийн самбарын туршилт (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-mr/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-mr/strings.xml
new file mode 100644
index 0000000..3057fe7
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-mr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"डीफॉल्ट नॅव्हिगेशन बार प्रयोग (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ms/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ms/strings.xml
new file mode 100644
index 0000000..047a6ce
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ms/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Pengalaman Bar Navigasi Lalai (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-my/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-my/strings.xml
new file mode 100644
index 0000000..37b559a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-my/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"မူရင်း လမ်းညွှန်ဘား စမ်းသပ်မှု (၄၈dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-nb/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-nb/strings.xml
new file mode 100644
index 0000000..e6cc2af
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-nb/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Eksperiment med standard navigasjonsrad (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ne/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ne/strings.xml
new file mode 100644
index 0000000..5df6f56
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ne/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"पूर्वनिर्धारित नेभिगेसन पट्टीको परीक्षण (४८dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-nl/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-nl/strings.xml
new file mode 100644
index 0000000..f97a352
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-nl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experiment voor standaard navigatiebalk (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-or/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-or/strings.xml
new file mode 100644
index 0000000..e602159
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-or/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ଡିଫଲ୍ଟ ନାଭିଗେସନ୍ ବାର୍ର ପ୍ରୟୋଗ (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pa/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pa/strings.xml
new file mode 100644
index 0000000..0c26291
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pa/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ਪੂਰਵ-ਨਿਰਧਾਰਤ ਦਿਸ਼ਾ-ਨਿਰਦੇਸ਼ ਪੱਟੀ ਪ੍ਰਯੋਗ (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pl/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pl/strings.xml
new file mode 100644
index 0000000..395e678
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Eksperyment z domyślnym paskiem nawigacyjnym (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pt-rBR/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pt-rBR/strings.xml
new file mode 100644
index 0000000..06f1966
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pt-rBR/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experimento de barra de navegação padrão (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pt-rPT/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pt-rPT/strings.xml
new file mode 100644
index 0000000..e2bb116
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pt-rPT/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experiência de barra de navegação predefinida (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pt/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pt/strings.xml
new file mode 100644
index 0000000..06f1966
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-pt/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experimento de barra de navegação padrão (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ro/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ro/strings.xml
new file mode 100644
index 0000000..2547137
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ro/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experiment cu bară de navigare prestabilită (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ru/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ru/strings.xml
new file mode 100644
index 0000000..b5e26b3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ru/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Экспериментальная панель навигации по умолчанию (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-si/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-si/strings.xml
new file mode 100644
index 0000000..7ef2c3e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-si/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"පෙරනිමි සංචලන තීරු පරීක්ෂණය (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sk/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sk/strings.xml
new file mode 100644
index 0000000..9946848
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Experiment s predvoleným navigačným panelom (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sl/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sl/strings.xml
new file mode 100644
index 0000000..34b33ae
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Preizkus s privzeto vrstico za krmarjenje (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sq/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sq/strings.xml
new file mode 100644
index 0000000..428e43d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sq/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Eksperimenti i shiritit të parazgjedhur të navigimit (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sr/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sr/strings.xml
new file mode 100644
index 0000000..a1f914c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Експеримент са танком траком за навигацију (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sv/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sv/strings.xml
new file mode 100644
index 0000000..96f4f56
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sv/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Standardnavigeringsfält för experiment (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sw/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sw/strings.xml
new file mode 100644
index 0000000..3ca80c2
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-sw/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Jaribio Chaguomsingi la Sehemu ya Viungo Muhimu (dp 48)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ta/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ta/strings.xml
new file mode 100644
index 0000000..2ff46e8
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ta/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"இயல்புநிலை வழிசெலுத்துதல் பட்டி சோதனை (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-te/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-te/strings.xml
new file mode 100644
index 0000000..99a32ed
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-te/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"డిఫాల్ట్ నావిగేషన్ పట్టీ ప్రయోగం (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-th/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-th/strings.xml
new file mode 100644
index 0000000..acfb209
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-th/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"การทดสอบแถบนำทางเริ่มต้น (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-tl/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-tl/strings.xml
new file mode 100644
index 0000000..6284190
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-tl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Eksperimentong Default na Navigation Bar (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-tr/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-tr/strings.xml
new file mode 100644
index 0000000..518e801
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-tr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Varsayılan Gezinme Çubuğu Denemesi (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-uk/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-uk/strings.xml
new file mode 100644
index 0000000..bff10a6
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-uk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Експеримент зі стандартною панеллю навігації (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ur/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ur/strings.xml
new file mode 100644
index 0000000..ff19804
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-ur/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"ڈیفالٹ نیویگیشن بار کا تجربہ (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-uz/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-uz/strings.xml
new file mode 100644
index 0000000..d208c7b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-uz/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Standart navigatsiya paneli tajribasi (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-vi/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-vi/strings.xml
new file mode 100644
index 0000000..067de92
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-vi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Thử nghiệm thanh điều hướng mặc định (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zh-rCN/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000..75a1207
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zh-rCN/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"默认导航栏实验 (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zh-rHK/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zh-rHK/strings.xml
new file mode 100644
index 0000000..32ff1b2
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zh-rHK/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"預設導覽列實驗 (48 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zh-rTW/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zh-rTW/strings.xml
new file mode 100644
index 0000000..f8fe18c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zh-rTW/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"預設導覽列實驗 (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zu/strings.xml b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zu/strings.xml
new file mode 100644
index 0000000..0e56660
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarDefaultOverlay/res/values-zu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="3475628315769912732">"Ukuhlolwa kwebha yokuzulazula ezenzakalelayo (48dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-af/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-af/strings.xml
new file mode 100644
index 0000000..7e52c2a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-af/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Eksperiment met dun navigasiebalk (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-am/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-am/strings.xml
new file mode 100644
index 0000000..533bf95
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-am/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"የቀጭን ዳሰሳ አሞሌ ሙከራ (24 ዲፒ)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ar/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ar/strings.xml
new file mode 100644
index 0000000..b338de5
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ar/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"تجربة شريط التنقل الصغير الحجم (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-as/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-as/strings.xml
new file mode 100644
index 0000000..1c15d70
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-as/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"লাহী নেভিগে’শ্বন বাৰ সম্পৰীক্ষা (২৪ডিপি)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-az/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-az/strings.xml
new file mode 100644
index 0000000..1696946
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-az/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Ensiz Naviqasiya Paneli Təcrübəsi (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-b+sr+Latn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-b+sr+Latn/strings.xml
new file mode 100644
index 0000000..fafec1d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-b+sr+Latn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Eksperiment sa tankom trakom za navigaciju (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-be/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-be/strings.xml
new file mode 100644
index 0000000..ba572a5
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-be/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Эксперымент з тонкай панэллю навігацыі (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-bg/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-bg/strings.xml
new file mode 100644
index 0000000..752eb1d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-bg/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Експеримент с тънка лента за навигация (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-bn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-bn/strings.xml
new file mode 100644
index 0000000..b486c9f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-bn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"স্লিম নেভিগেশন বার সম্পর্কিত পরীক্ষা (২৪ ডিপি)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-bs/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-bs/strings.xml
new file mode 100644
index 0000000..25fb785
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-bs/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Eksperiment s tankom trakom za navigaciju (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ca/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ca/strings.xml
new file mode 100644
index 0000000..d859f0a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ca/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experiment amb barra de navegació fina (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-cs/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-cs/strings.xml
new file mode 100644
index 0000000..d81c6e3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-cs/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Úzký navigační panel – experiment (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-da/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-da/strings.xml
new file mode 100644
index 0000000..2f10bfe
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-da/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Test med smal navigationslinje (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-de/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-de/strings.xml
new file mode 100644
index 0000000..2c0937b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-de/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Test mit schmaler Navigationsleiste (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-el/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-el/strings.xml
new file mode 100644
index 0000000..ef522b3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-el/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Πείραμα λεπτής γραμμής πλοήγησης (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rAU/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rAU/strings.xml
new file mode 100644
index 0000000..d9958ec
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rAU/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Slim Navigation Bar Experiment (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rCA/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rCA/strings.xml
new file mode 100644
index 0000000..d9958ec
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rCA/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Slim Navigation Bar Experiment (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rGB/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rGB/strings.xml
new file mode 100644
index 0000000..d9958ec
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rGB/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Slim Navigation Bar Experiment (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rIN/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rIN/strings.xml
new file mode 100644
index 0000000..d9958ec
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-en-rIN/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Slim Navigation Bar Experiment (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-es-rUS/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-es-rUS/strings.xml
new file mode 100644
index 0000000..7c47655
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-es-rUS/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experimento de la barra navegación delgada (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-es/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-es/strings.xml
new file mode 100644
index 0000000..7c47655
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-es/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experimento de la barra navegación delgada (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-et/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-et/strings.xml
new file mode 100644
index 0000000..bf23377
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-et/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Kitsa navigeerimisriba katse (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-eu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-eu/strings.xml
new file mode 100644
index 0000000..cc4276ed
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-eu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Nabigazio-barra finaren esperimentua (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fa/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fa/strings.xml
new file mode 100644
index 0000000..3c584d4
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fa/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"آزمایش نوار پیمایش باریک (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fi/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fi/strings.xml
new file mode 100644
index 0000000..33236aa
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Ohuen navigointipalkin kokeilu (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fr-rCA/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fr-rCA/strings.xml
new file mode 100644
index 0000000..523a593
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fr-rCA/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Expérience de barre de navigation mince (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fr/strings.xml
new file mode 100644
index 0000000..f5a75c7f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-fr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Test relatif à la barre de navigation fine (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-gl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-gl/strings.xml
new file mode 100644
index 0000000..8a4b2ab
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-gl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experimento de barra de navegación estreita (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-gu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-gu/strings.xml
new file mode 100644
index 0000000..aa3466d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-gu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"સ્લિમ નૅવિગેશન બારનો પ્રયોગ (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hi/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hi/strings.xml
new file mode 100644
index 0000000..f3a5b02
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"स्लिम नेविगेशन बार प्रयोग (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hr/strings.xml
new file mode 100644
index 0000000..6532bf8
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Eksperiment s tankom navigacijskom trakom (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hu/strings.xml
new file mode 100644
index 0000000..2a8adf9
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Kísérleti keskeny navigációs sáv (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hy/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hy/strings.xml
new file mode 100644
index 0000000..a48dfc5
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-hy/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Նավարկման նեղ գոտու փորձարկում (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-in/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-in/strings.xml
new file mode 100644
index 0000000..961b639
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-in/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Eksperimen Menu Navigasi Ramping (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-is/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-is/strings.xml
new file mode 100644
index 0000000..659f126
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-is/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Tilraun með þunna yfirlitsstiku (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-it/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-it/strings.xml
new file mode 100644
index 0000000..57df77d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-it/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Esperimento Barra di navigazione sottile (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-iw/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-iw/strings.xml
new file mode 100644
index 0000000..5fbc0a2
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-iw/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"ניסוי של סרגל ניווט דק (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ja/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ja/strings.xml
new file mode 100644
index 0000000..ab2d149
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ja/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"スリム ナビゲーション バー テスト(24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ka/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ka/strings.xml
new file mode 100644
index 0000000..2605327
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ka/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"ნავიგაციის მჭიდრო ზოლის ექსპერიმენტი (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-kk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-kk/strings.xml
new file mode 100644
index 0000000..99c6085
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-kk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Жіңішке навигация жолағы (эксперимент) (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-km/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-km/strings.xml
new file mode 100644
index 0000000..f63a7bc
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-km/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"ការពិសោធនៃរបាររុករកស្ដើង (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-kn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-kn/strings.xml
new file mode 100644
index 0000000..74a72df
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-kn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"ಸ್ಲಿಮ್ ನ್ಯಾವಿಗೇಶನ್ ಬಾರ್ ಪ್ರಯೋಗ (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ko/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ko/strings.xml
new file mode 100644
index 0000000..0b8acb5
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ko/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"슬림한 탐색 메뉴 실험(24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ky/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ky/strings.xml
new file mode 100644
index 0000000..5629ecd
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ky/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Чакан чабыттоо тилкесин сыноо (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-lo/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-lo/strings.xml
new file mode 100644
index 0000000..71846dc
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-lo/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"ການທົດສອບແຖບນໍາທາງແບບບາງ (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-lt/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-lt/strings.xml
new file mode 100644
index 0000000..e340412
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-lt/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Plonos naršymo juostos eksperimentas (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-lv/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-lv/strings.xml
new file mode 100644
index 0000000..eb963eb
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-lv/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Plānas navigācijas joslas eksperiments (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-mk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-mk/strings.xml
new file mode 100644
index 0000000..9e57314
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-mk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Експеримент со тенка лента за навигација (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ml/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ml/strings.xml
new file mode 100644
index 0000000..41862af
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ml/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"സ്ലിം നാവിഗേഷൻ ബാർ പരീക്ഷണം (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-mn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-mn/strings.xml
new file mode 100644
index 0000000..e83a219
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-mn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Нимгэн навигацийн самбарын туршилт (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-mr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-mr/strings.xml
new file mode 100644
index 0000000..e9ac6ee
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-mr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"स्लिम नॅव्हिगेशन बार प्रयोग (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ms/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ms/strings.xml
new file mode 100644
index 0000000..134293c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ms/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Pengalaman Bar Navigasi Nipis (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-my/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-my/strings.xml
new file mode 100644
index 0000000..a525c08d3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-my/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"လမ်းညွှန်ဘားအသေး စမ်းသပ်မှု (၂၄dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-nb/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-nb/strings.xml
new file mode 100644
index 0000000..e431c90
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-nb/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Eksperiment med tynn navigasjonsrad (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ne/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ne/strings.xml
new file mode 100644
index 0000000..ff71d9a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ne/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"पातलो नेभिगेसन पट्टीको परीक्षण (२४dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-nl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-nl/strings.xml
new file mode 100644
index 0000000..b3a09cc
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-nl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experiment voor smalle navigatiebalk (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-or/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-or/strings.xml
new file mode 100644
index 0000000..98ee79b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-or/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"ସ୍ଲିମ୍ ନାଭିଗେସନ୍ ବାର୍ର ପ୍ରୟୋଗ (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pa/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pa/strings.xml
new file mode 100644
index 0000000..06e4fd5
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pa/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"ਸਲਿਮ ਦਿਸ਼ਾ-ਨਿਰਦੇਸ਼ ਪੱਟੀ ਪ੍ਰਯੋਗ (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pl/strings.xml
new file mode 100644
index 0000000..e466973
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Eksperyment z wąskim paskiem nawigacyjnym (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pt-rBR/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pt-rBR/strings.xml
new file mode 100644
index 0000000..df3c38a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pt-rBR/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experimento de barra de navegação fina (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pt-rPT/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pt-rPT/strings.xml
new file mode 100644
index 0000000..dc72eab
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pt-rPT/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experiência de barra de navegação fina (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pt/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pt/strings.xml
new file mode 100644
index 0000000..df3c38a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-pt/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experimento de barra de navegação fina (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ro/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ro/strings.xml
new file mode 100644
index 0000000..dc9200c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ro/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experiment cu bară de navigare subțire (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ru/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ru/strings.xml
new file mode 100644
index 0000000..99d5ce4
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ru/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Экспериментальная узкая панель навигации (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-si/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-si/strings.xml
new file mode 100644
index 0000000..501010f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-si/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"සිහින් සංචලන තීරු පරීක්ෂණය (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sk/strings.xml
new file mode 100644
index 0000000..eaddff1
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experiment s úzkym navigačným panelom (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sl/strings.xml
new file mode 100644
index 0000000..69d777e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Preizkus z vitko vrstico za krmarjenje (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sq/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sq/strings.xml
new file mode 100644
index 0000000..9109a0e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sq/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Eksperimenti i shiritit të hollë të navigimit (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sr/strings.xml
new file mode 100644
index 0000000..eb68b0b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Експеримент са танком траком за навигацију (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sv/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sv/strings.xml
new file mode 100644
index 0000000..ed9ffa2
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sv/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Experimentellt tunt navigeringsfält (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sw/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sw/strings.xml
new file mode 100644
index 0000000..bf120d6
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-sw/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Jaribio la Sehemu ya Viungo Muhimu Inayoweza Kupunguzwa (dp 24)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ta/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ta/strings.xml
new file mode 100644
index 0000000..29590cf
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ta/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"மெலிதான வழிசெலுத்துதல் பட்டி சோதனை (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-te/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-te/strings.xml
new file mode 100644
index 0000000..fa95dec
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-te/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"సన్నని నావిగేషన్ పట్టీ ప్రయోగం (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-th/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-th/strings.xml
new file mode 100644
index 0000000..e46eda2
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-th/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"การทดสอบแถบนำทางแบบบาง (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-tl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-tl/strings.xml
new file mode 100644
index 0000000..3457f4b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-tl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Eksperimentong Slim na Navigation Bar (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-tr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-tr/strings.xml
new file mode 100644
index 0000000..bab4695
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-tr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"İnce Gezinme Çubuğu Denemesi (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-uk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-uk/strings.xml
new file mode 100644
index 0000000..8f790be
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-uk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Експеримент із тонкою панеллю навігації (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ur/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ur/strings.xml
new file mode 100644
index 0000000..a34cf80
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-ur/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"پتلے نیویگیشن بار کا تجربہ (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-uz/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-uz/strings.xml
new file mode 100644
index 0000000..a20309a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-uz/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Ingichka navigatsiya paneli tajribasi (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-vi/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-vi/strings.xml
new file mode 100644
index 0000000..530feeb
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-vi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Thử nghiệm thanh điều hướng mỏng (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zh-rCN/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000..6472d4f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zh-rCN/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"精简导航栏实验 (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zh-rHK/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zh-rHK/strings.xml
new file mode 100644
index 0000000..181e41c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zh-rHK/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"精簡導覽列實驗 (24 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zh-rTW/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zh-rTW/strings.xml
new file mode 100644
index 0000000..a6d53f4
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zh-rTW/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"細長導覽列實驗 (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zu/strings.xml
new file mode 100644
index 0000000..338d906
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim24Overlay/res/values-zu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="9207872199884142345">"Ukuhlolwa kwebha yokuzulazula encane (24dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-af/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-af/strings.xml
new file mode 100644
index 0000000..e3d7313
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-af/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Eksperiment met dun navigasiebalk (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-am/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-am/strings.xml
new file mode 100644
index 0000000..f3128dd
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-am/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"የቀጭን ዳሰሳ አሞሌ ሙከራ (32 ዲፒ)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ar/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ar/strings.xml
new file mode 100644
index 0000000..670d09e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ar/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"تجربة شريط التنقل الصغير الحجم (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-as/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-as/strings.xml
new file mode 100644
index 0000000..42d135a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-as/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"লাহী নেভিগে’শ্বন বাৰ সম্পৰীক্ষা (৩২ডিপি)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-az/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-az/strings.xml
new file mode 100644
index 0000000..ef07c44
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-az/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Ensiz Naviqasiya Paneli Təcrübəsi (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-b+sr+Latn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-b+sr+Latn/strings.xml
new file mode 100644
index 0000000..024e5d5
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-b+sr+Latn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Eksperiment sa tankom trakom za navigaciju (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-be/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-be/strings.xml
new file mode 100644
index 0000000..71ffb20
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-be/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Эксперымент з тонкай панэллю навігацыі (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-bg/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-bg/strings.xml
new file mode 100644
index 0000000..fc159b2
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-bg/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Експеримент с тънка лента за навигация (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-bn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-bn/strings.xml
new file mode 100644
index 0000000..cba2ffb
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-bn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"স্লিম নেভিগেশন বার সম্পর্কিত পরীক্ষা (৩২ ডিপি)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-bs/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-bs/strings.xml
new file mode 100644
index 0000000..378c39b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-bs/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Eksperiment s tankom trakom za navigaciju (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ca/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ca/strings.xml
new file mode 100644
index 0000000..6b5c71b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ca/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experiment amb barra de navegació fina (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-cs/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-cs/strings.xml
new file mode 100644
index 0000000..c779583
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-cs/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Úzký navigační panel – experiment (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-da/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-da/strings.xml
new file mode 100644
index 0000000..2f83f76
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-da/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Test med smal navigationslinje (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-de/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-de/strings.xml
new file mode 100644
index 0000000..2446b8a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-de/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Test mit schmaler Navigationsleiste (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-el/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-el/strings.xml
new file mode 100644
index 0000000..97c52cf4
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-el/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Πείραμα λεπτής γραμμής πλοήγησης (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rAU/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rAU/strings.xml
new file mode 100644
index 0000000..90e7fae
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rAU/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Slim Navigation Bar Experiment (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rCA/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rCA/strings.xml
new file mode 100644
index 0000000..90e7fae
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rCA/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Slim Navigation Bar Experiment (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rGB/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rGB/strings.xml
new file mode 100644
index 0000000..90e7fae
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rGB/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Slim Navigation Bar Experiment (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rIN/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rIN/strings.xml
new file mode 100644
index 0000000..90e7fae
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-en-rIN/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Slim Navigation Bar Experiment (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-es-rUS/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-es-rUS/strings.xml
new file mode 100644
index 0000000..02bb563
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-es-rUS/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experimento de la barra navegación delgada (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-es/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-es/strings.xml
new file mode 100644
index 0000000..02bb563
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-es/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experimento de la barra navegación delgada (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-et/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-et/strings.xml
new file mode 100644
index 0000000..d979cc3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-et/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Kitsa navigeerimisriba katse (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-eu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-eu/strings.xml
new file mode 100644
index 0000000..a9b869c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-eu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Nabigazio-barra finaren esperimentua (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fa/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fa/strings.xml
new file mode 100644
index 0000000..fb724e0
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fa/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"آزمایش نوار پیمایش باریک (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fi/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fi/strings.xml
new file mode 100644
index 0000000..88fa2b9
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Ohuen navigointipalkin kokeilu (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fr-rCA/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fr-rCA/strings.xml
new file mode 100644
index 0000000..2a73bd3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fr-rCA/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Expérience de barre de navigation mince (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fr/strings.xml
new file mode 100644
index 0000000..1530d81
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-fr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Test relatif à la barre de navigation fine (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-gl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-gl/strings.xml
new file mode 100644
index 0000000..174f501
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-gl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experimento da barra de navegación estreita (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-gu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-gu/strings.xml
new file mode 100644
index 0000000..1e9de62
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-gu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"સ્લિમ નૅવિગેશન બારનો પ્રયોગ (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hi/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hi/strings.xml
new file mode 100644
index 0000000..f52b1fd
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"स्लिम नेविगेशन बार प्रयोग (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hr/strings.xml
new file mode 100644
index 0000000..04aed15
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Eksperiment s tankom navigacijskom trakom (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hu/strings.xml
new file mode 100644
index 0000000..500b45e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Kísérleti keskeny navigációs sáv (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hy/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hy/strings.xml
new file mode 100644
index 0000000..a5f684b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-hy/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Նավարկման նեղ գոտու փորձարկում (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-in/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-in/strings.xml
new file mode 100644
index 0000000..fe78b4c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-in/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Eksperimen Menu Navigasi Ramping (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-is/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-is/strings.xml
new file mode 100644
index 0000000..1d6da50
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-is/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Tilraun með þunna yfirlitsstiku (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-it/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-it/strings.xml
new file mode 100644
index 0000000..dc3530e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-it/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Esperimento Barra di navigazione sottile (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-iw/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-iw/strings.xml
new file mode 100644
index 0000000..8832941
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-iw/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"ניסוי של סרגל ניווט דק (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ja/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ja/strings.xml
new file mode 100644
index 0000000..7bab58a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ja/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"スリム ナビゲーション バー テスト(32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ka/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ka/strings.xml
new file mode 100644
index 0000000..8a7f3bf
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ka/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"ნავიგაციის მჭიდრო ზოლის ექსპერიმენტი (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-kk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-kk/strings.xml
new file mode 100644
index 0000000..182ac1a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-kk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Жіңішке навигация жолағы (эксперимент) (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-km/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-km/strings.xml
new file mode 100644
index 0000000..0a52f66
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-km/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"ការពិសោធនៃរបាររុករកស្ដើង (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-kn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-kn/strings.xml
new file mode 100644
index 0000000..118303f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-kn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"ಸ್ಲಿಮ್ ನ್ಯಾವಿಗೇಶನ್ ಬಾರ್ ಪ್ರಯೋಗ (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ko/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ko/strings.xml
new file mode 100644
index 0000000..11f28ce
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ko/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"슬림한 탐색 메뉴 실험(32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ky/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ky/strings.xml
new file mode 100644
index 0000000..4418c4d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ky/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Чакан чабыттоо тилкесин сыноо (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-lo/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-lo/strings.xml
new file mode 100644
index 0000000..090ab09
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-lo/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"ການທົດສອບແຖບນໍາທາງແບບບາງ (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-lt/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-lt/strings.xml
new file mode 100644
index 0000000..cb72a0f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-lt/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Plonos naršymo juostos eksperimentas (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-lv/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-lv/strings.xml
new file mode 100644
index 0000000..164e7d2
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-lv/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Plānas navigācijas joslas eksperiments (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-mk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-mk/strings.xml
new file mode 100644
index 0000000..e10d685
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-mk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Експеримент со тенка лента за навигација (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ml/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ml/strings.xml
new file mode 100644
index 0000000..878ea10
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ml/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"സ്ലിം നാവിഗേഷൻ ബാർ പരീക്ഷണം (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-mn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-mn/strings.xml
new file mode 100644
index 0000000..a808c5c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-mn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Нимгэн навигацийн самбарын туршилт (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-mr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-mr/strings.xml
new file mode 100644
index 0000000..8454ba7
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-mr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"स्लिम नॅव्हिगेशन बार प्रयोग (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ms/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ms/strings.xml
new file mode 100644
index 0000000..6494245
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ms/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Pengalaman Bar Navigasi Nipis (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-my/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-my/strings.xml
new file mode 100644
index 0000000..11586c0
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-my/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"လမ်းညွှန်ဘားအသေး စမ်းသပ်မှု (၃၂dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-nb/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-nb/strings.xml
new file mode 100644
index 0000000..625c605
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-nb/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Eksperiment med tynn navigasjonsrad (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ne/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ne/strings.xml
new file mode 100644
index 0000000..b0d019c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ne/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"पातलो नेभिगेसन पट्टीको परीक्षण (३२dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-nl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-nl/strings.xml
new file mode 100644
index 0000000..9d14cef
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-nl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experiment voor smalle navigatiebalk (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-or/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-or/strings.xml
new file mode 100644
index 0000000..e941c52
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-or/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"ସ୍ଲିମ୍ ନାଭିଗେସନ୍ ବାର୍ର ପ୍ରୟୋଗ (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pa/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pa/strings.xml
new file mode 100644
index 0000000..c85e9d6
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pa/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"ਸਲਿਮ ਦਿਸ਼ਾ-ਨਿਰਦੇਸ਼ ਪੱਟੀ ਪ੍ਰਯੋਗ (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pl/strings.xml
new file mode 100644
index 0000000..a254e62
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Eksperyment z wąskim paskiem nawigacyjnym (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pt-rBR/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pt-rBR/strings.xml
new file mode 100644
index 0000000..8bab19c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pt-rBR/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experimento de barra de navegação fina (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pt-rPT/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pt-rPT/strings.xml
new file mode 100644
index 0000000..133d97d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pt-rPT/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experiência de barra de navegação fina (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pt/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pt/strings.xml
new file mode 100644
index 0000000..8bab19c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-pt/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experimento de barra de navegação fina (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ro/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ro/strings.xml
new file mode 100644
index 0000000..f1518718
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ro/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experiment cu bară de navigare subțire (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ru/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ru/strings.xml
new file mode 100644
index 0000000..3031ae0
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ru/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Экспериментальная узкая панель навигации (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-si/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-si/strings.xml
new file mode 100644
index 0000000..a257a76
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-si/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"සිහින් සංචලන තීරු පරීක්ෂණය (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sk/strings.xml
new file mode 100644
index 0000000..f9fe39b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experiment s úzkym navigačným panelom (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sl/strings.xml
new file mode 100644
index 0000000..5849b03
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Preizkus z vitko vrstico za krmarjenje (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sq/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sq/strings.xml
new file mode 100644
index 0000000..719f233
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sq/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Eksperimenti i shiritit të hollë të navigimit (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sr/strings.xml
new file mode 100644
index 0000000..3d67560
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Експеримент са танком траком за навигацију (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sv/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sv/strings.xml
new file mode 100644
index 0000000..daee00a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sv/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Experimentellt tunt navigeringsfält (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sw/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sw/strings.xml
new file mode 100644
index 0000000..cf44256
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-sw/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Jaribio la Sehemu ya Viungo Muhimu Inayoweza Kupunguzwa (dp 32)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ta/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ta/strings.xml
new file mode 100644
index 0000000..e69442a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ta/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"மெலிதான வழிசெலுத்துதல் பட்டி சோதனை (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-te/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-te/strings.xml
new file mode 100644
index 0000000..5a39ccf
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-te/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"సన్నని నావిగేషన్ పట్టీ ప్రయోగం (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-th/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-th/strings.xml
new file mode 100644
index 0000000..e197554
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-th/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"การทดสอบแถบนำทางแบบบาง (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-tl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-tl/strings.xml
new file mode 100644
index 0000000..bbaa96f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-tl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Eksperimentong Slim na Navigation Bar (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-tr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-tr/strings.xml
new file mode 100644
index 0000000..d315cf4
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-tr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"İnce Gezinme Çubuğu Denemesi (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-uk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-uk/strings.xml
new file mode 100644
index 0000000..e75f766
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-uk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Експеримент із тонкою панеллю навігації (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ur/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ur/strings.xml
new file mode 100644
index 0000000..743903d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-ur/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"پتلے نیویگیشن بار کا تجربہ (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-uz/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-uz/strings.xml
new file mode 100644
index 0000000..d8519a7
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-uz/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Ingichka navigatsiya paneli tajribasi (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-vi/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-vi/strings.xml
new file mode 100644
index 0000000..bc22ff8
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-vi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Thử nghiệm thanh điều hướng mỏng (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zh-rCN/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000..b0e6f58
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zh-rCN/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"精简导航栏实验 (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zh-rHK/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zh-rHK/strings.xml
new file mode 100644
index 0000000..5dd0d79
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zh-rHK/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"精簡導覽列實驗 (32 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zh-rTW/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zh-rTW/strings.xml
new file mode 100644
index 0000000..b1f6b06
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zh-rTW/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"細長導覽列實驗 (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zu/strings.xml
new file mode 100644
index 0000000..9a8bb4f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim32Overlay/res/values-zu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="2616250866244714325">"Ukuhlolwa kwebha yokuzulazula encane (32dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-af/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-af/strings.xml
new file mode 100644
index 0000000..e815299
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-af/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Eksperiment met dun navigasiebalk (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-am/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-am/strings.xml
new file mode 100644
index 0000000..5644a85
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-am/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"የቀጭን ዳሰሳ አሞሌ ሙከራ (40 ዲፒ)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ar/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ar/strings.xml
new file mode 100644
index 0000000..40a11de
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ar/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"تجربة شريط التنقل الصغير الحجم (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-as/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-as/strings.xml
new file mode 100644
index 0000000..1c4003f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-as/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"লাহী নেভিগে’শ্বন বাৰ সম্পৰীক্ষা (৪০ডিপি)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-az/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-az/strings.xml
new file mode 100644
index 0000000..5897e75
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-az/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Ensiz Naviqasiya Paneli Təcrübəsi (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-b+sr+Latn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-b+sr+Latn/strings.xml
new file mode 100644
index 0000000..1f49607
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-b+sr+Latn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Eksperiment sa tankom trakom za navigaciju (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-be/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-be/strings.xml
new file mode 100644
index 0000000..2c46430
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-be/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Эксперымент з тонкай панэллю навігацыі (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-bg/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-bg/strings.xml
new file mode 100644
index 0000000..25a1496
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-bg/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Експеримент с тънка лента за навигация (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-bn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-bn/strings.xml
new file mode 100644
index 0000000..66ba5b0
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-bn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"স্লিম নেভিগেশন বার সম্পর্কিত পরীক্ষা (৪০ ডিপি)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-bs/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-bs/strings.xml
new file mode 100644
index 0000000..21597ce
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-bs/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Eksperiment s tankom trakom za navigaciju (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ca/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ca/strings.xml
new file mode 100644
index 0000000..34ce751
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ca/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experiment amb barra de navegació fina (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-cs/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-cs/strings.xml
new file mode 100644
index 0000000..cd87611
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-cs/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Úzký navigační panel – experiment (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-da/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-da/strings.xml
new file mode 100644
index 0000000..fcbd7b5
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-da/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Test med smal navigationslinje (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-de/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-de/strings.xml
new file mode 100644
index 0000000..8ee35b7
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-de/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Test mit schmaler Navigationsleiste (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-el/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-el/strings.xml
new file mode 100644
index 0000000..c016e83
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-el/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Πείραμα λεπτής γραμμής πλοήγησης (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rAU/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rAU/strings.xml
new file mode 100644
index 0000000..b3621cb
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rAU/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Slim Navigation Bar Experiment (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rCA/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rCA/strings.xml
new file mode 100644
index 0000000..b3621cb
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rCA/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Slim Navigation Bar Experiment (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rGB/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rGB/strings.xml
new file mode 100644
index 0000000..b3621cb
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rGB/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Slim Navigation Bar Experiment (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rIN/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rIN/strings.xml
new file mode 100644
index 0000000..b3621cb
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-en-rIN/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Slim Navigation Bar Experiment (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-es-rUS/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-es-rUS/strings.xml
new file mode 100644
index 0000000..d1cc0fe
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-es-rUS/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experimento de la barra navegación delgada (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-es/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-es/strings.xml
new file mode 100644
index 0000000..d1cc0fe
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-es/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experimento de la barra navegación delgada (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-et/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-et/strings.xml
new file mode 100644
index 0000000..64dc9ae
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-et/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Kitsa navigeerimisriba katse (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-eu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-eu/strings.xml
new file mode 100644
index 0000000..98a4dd9
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-eu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Nabigazio-barra finaren esperimentua (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fa/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fa/strings.xml
new file mode 100644
index 0000000..987ab4a
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fa/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"آزمایش نوار پیمایش باریک (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fi/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fi/strings.xml
new file mode 100644
index 0000000..e850c3f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Ohuen navigointipalkin kokeilu (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fr-rCA/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fr-rCA/strings.xml
new file mode 100644
index 0000000..c196ef9
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fr-rCA/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Expérience de barre de navigation mince (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fr/strings.xml
new file mode 100644
index 0000000..dd1ec9c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-fr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Test relatif à la barre de navigation fine (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-gl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-gl/strings.xml
new file mode 100644
index 0000000..5c44987
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-gl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experimento da barra de navegación estreita (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-gu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-gu/strings.xml
new file mode 100644
index 0000000..ed1f5ce
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-gu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"સ્લિમ નૅવિગેશન બારનો પ્રયોગ (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hi/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hi/strings.xml
new file mode 100644
index 0000000..64141ce
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"स्लिम नेविगेशन बार प्रयोग (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hr/strings.xml
new file mode 100644
index 0000000..41ec2e7
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Eksperiment s tankom navigacijskom trakom (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hu/strings.xml
new file mode 100644
index 0000000..3fb2907
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Kísérleti keskeny navigációs sáv (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hy/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hy/strings.xml
new file mode 100644
index 0000000..04d6995
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-hy/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Նավարկման նեղ գոտու փորձարկում (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-in/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-in/strings.xml
new file mode 100644
index 0000000..2f01577
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-in/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Eksperimen Menu Navigasi Ramping (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-is/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-is/strings.xml
new file mode 100644
index 0000000..5ccf607
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-is/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Tilraun með þunna yfirlitsstiku (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-it/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-it/strings.xml
new file mode 100644
index 0000000..1522bd3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-it/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Esperimento Barra di navigazione sottile (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-iw/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-iw/strings.xml
new file mode 100644
index 0000000..cf40958
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-iw/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"ניסוי של סרגל ניווט דק (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ja/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ja/strings.xml
new file mode 100644
index 0000000..51797e6
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ja/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"スリム ナビゲーション バー テスト(40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ka/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ka/strings.xml
new file mode 100644
index 0000000..575b453
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ka/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"ნავიგაციის მჭიდრო ზოლის ექსპერიმენტი (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-kk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-kk/strings.xml
new file mode 100644
index 0000000..4febe3f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-kk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Жіңішке навигация жолағы (эксперимент) (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-km/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-km/strings.xml
new file mode 100644
index 0000000..58b9e16
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-km/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"ការពិសោធនៃរបាររុករកស្ដើង (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-kn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-kn/strings.xml
new file mode 100644
index 0000000..35a6776
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-kn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"ಸ್ಲಿಮ್ ನ್ಯಾವಿಗೇಶನ್ ಬಾರ್ ಪ್ರಯೋಗ (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ko/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ko/strings.xml
new file mode 100644
index 0000000..bced462
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ko/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"슬림한 탐색 메뉴 실험(40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ky/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ky/strings.xml
new file mode 100644
index 0000000..8b34990
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ky/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Чакан чабыттоо тилкесин сыноо (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-lo/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-lo/strings.xml
new file mode 100644
index 0000000..b7fe3cf
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-lo/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"ການທົດສອບແຖບນໍາທາງແບບບາງ (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-lt/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-lt/strings.xml
new file mode 100644
index 0000000..808a90c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-lt/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Plonos naršymo juostos eksperimentas (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-lv/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-lv/strings.xml
new file mode 100644
index 0000000..002e8687
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-lv/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Plānas navigācijas joslas eksperiments (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-mk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-mk/strings.xml
new file mode 100644
index 0000000..148b5ed
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-mk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Експеримент со тенка лента за навигација (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ml/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ml/strings.xml
new file mode 100644
index 0000000..be37488
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ml/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"സ്ലിം നാവിഗേഷൻ ബാർ പരീക്ഷണം (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-mn/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-mn/strings.xml
new file mode 100644
index 0000000..41e2ce1
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-mn/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Нимгэн навигацийн самбарын туршилт (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-mr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-mr/strings.xml
new file mode 100644
index 0000000..d946257
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-mr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"स्लिम नॅव्हिगेशन बार प्रयोग (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ms/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ms/strings.xml
new file mode 100644
index 0000000..a442be3
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ms/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Pengalaman Bar Navigasi Nipis (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-my/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-my/strings.xml
new file mode 100644
index 0000000..f12cf41
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-my/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"လမ်းညွှန်ဘားအသေး စမ်းသပ်မှု (၄၀dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-nb/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-nb/strings.xml
new file mode 100644
index 0000000..d138836
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-nb/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Eksperiment med tynn navigasjonsrad (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ne/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ne/strings.xml
new file mode 100644
index 0000000..9fce6c2
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ne/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"पातलो नेभिगेसन पट्टीको परीक्षण (४०dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-nl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-nl/strings.xml
new file mode 100644
index 0000000..8eae8ce
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-nl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experiment voor smalle navigatiebalk (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-or/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-or/strings.xml
new file mode 100644
index 0000000..aff8e9c
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-or/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"ସ୍ଲିମ୍ ନାଭିଗେସନ୍ ବାର୍ର ପ୍ରୟୋଗ (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pa/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pa/strings.xml
new file mode 100644
index 0000000..c23a03f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pa/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"ਸਲਿਮ ਦਿਸ਼ਾ-ਨਿਰਦੇਸ਼ ਪੱਟੀ ਪ੍ਰਯੋਗ (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pl/strings.xml
new file mode 100644
index 0000000..7cd3e4e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Eksperyment z wąskim paskiem nawigacyjnym (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pt-rBR/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pt-rBR/strings.xml
new file mode 100644
index 0000000..dbc47fd
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pt-rBR/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experimento de barra de navegação fina (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pt-rPT/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pt-rPT/strings.xml
new file mode 100644
index 0000000..82ef087
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pt-rPT/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experiência de barra de navegação fina (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pt/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pt/strings.xml
new file mode 100644
index 0000000..dbc47fd
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-pt/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experimento de barra de navegação fina (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ro/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ro/strings.xml
new file mode 100644
index 0000000..18a96e0
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ro/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experiment cu bară de navigare subțire (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ru/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ru/strings.xml
new file mode 100644
index 0000000..195ab10
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ru/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Экспериментальная узкая панель навигации (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-si/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-si/strings.xml
new file mode 100644
index 0000000..0bda351
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-si/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"සිහින් සංචලන තීරු පරීක්ෂණය (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sk/strings.xml
new file mode 100644
index 0000000..9aebdfbe
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experiment s úzkym navigačným panelom (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sl/strings.xml
new file mode 100644
index 0000000..68f6e6d
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Preizkus z vitko vrstico za krmarjenje (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sq/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sq/strings.xml
new file mode 100644
index 0000000..18c1ff0
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sq/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Eksperimenti i shiritit të hollë të navigimit (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sr/strings.xml
new file mode 100644
index 0000000..8067165
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Експеримент са танком траком за навигацију (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sv/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sv/strings.xml
new file mode 100644
index 0000000..d91626e
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sv/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Experimentellt tunt navigeringsfält (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sw/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sw/strings.xml
new file mode 100644
index 0000000..f3ca208
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-sw/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Jaribio la Sehemu ya Viungo Muhimu Inayoweza Kupunguzwa (dp 40)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ta/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ta/strings.xml
new file mode 100644
index 0000000..04bee67
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ta/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"மெலிதான வழிசெலுத்துதல் பட்டி சோதனை (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-te/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-te/strings.xml
new file mode 100644
index 0000000..fc0cd55
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-te/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"సన్నని నావిగేషన్ పట్టీ ప్రయోగం (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-th/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-th/strings.xml
new file mode 100644
index 0000000..33d46e4
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-th/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"การทดสอบแถบนำทางแบบบาง (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-tl/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-tl/strings.xml
new file mode 100644
index 0000000..bf6451f
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-tl/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Eksperimentong Slim na Navigation Bar (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-tr/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-tr/strings.xml
new file mode 100644
index 0000000..7918059
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-tr/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"İnce Gezinme Çubuğu Denemesi (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-uk/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-uk/strings.xml
new file mode 100644
index 0000000..b45b9b4
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-uk/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Експеримент із тонкою панеллю навігації (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ur/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ur/strings.xml
new file mode 100644
index 0000000..9281ff8
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-ur/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"پتلے نیویگیشن بار کا تجربہ (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-uz/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-uz/strings.xml
new file mode 100644
index 0000000..46e7334
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-uz/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Ingichka navigatsiya paneli tajribasi (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-vi/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-vi/strings.xml
new file mode 100644
index 0000000..ea0f155
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-vi/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Thử nghiệm thanh điều hướng mỏng (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zh-rCN/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zh-rCN/strings.xml
new file mode 100644
index 0000000..5746854
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zh-rCN/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"精简导航栏实验 (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zh-rHK/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zh-rHK/strings.xml
new file mode 100644
index 0000000..aad885b
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zh-rHK/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"精簡導覽列實驗 (40 dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zh-rTW/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zh-rTW/strings.xml
new file mode 100644
index 0000000..590e4f5
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zh-rTW/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"細長導覽列實驗 (40dp)"</string>
+</resources>
diff --git a/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zu/strings.xml b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zu/strings.xml
new file mode 100644
index 0000000..e077f08
--- /dev/null
+++ b/packages/overlays/ExperimentNavigationBarSlim40Overlay/res/values-zu/strings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Copyright (c) 2018, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <string name="experiment_navigationbar_overlay" msgid="6415947279345789008">"Ukuhlolwa kwebha yokuzulazula encane (40dp)"</string>
+</resources>
diff --git a/proto/src/metrics_constants/metrics_constants.proto b/proto/src/metrics_constants/metrics_constants.proto
index 8261fe8..48eaa08 100644
--- a/proto/src/metrics_constants/metrics_constants.proto
+++ b/proto/src/metrics_constants/metrics_constants.proto
@@ -232,6 +232,17 @@
BLOCKING_HELPER_CLICK_UNDO = 7;
}
+ // The (visual) location of a Notification.
+ enum NotificationLocation {
+ LOCATION_UNKNOWN = 0;
+ LOCATION_FIRST_HEADS_UP = 1; // visible heads-up
+ LOCATION_HIDDEN_TOP = 2; // hidden/scrolled away on the top
+ LOCATION_MAIN_AREA = 3; // visible in the shade
+ LOCATION_BOTTOM_STACK_PEEKING = 4; // in the bottom stack, and peeking
+ LOCATION_BOTTOM_STACK_HIDDEN = 5; // in the bottom stack, and hidden
+ LOCATION_GONE = 6; // the view isn't laid out at all
+ }
+
// Known visual elements: views or controls.
enum View {
// Unknown view
@@ -6820,6 +6831,17 @@
// OS: Q
MOBILE_NETWORK_LIST = 1627;
+ // OPEN: Settings > Display > Adaptive sleep
+ // OS: Q
+ SETTINGS_ADAPTIVE_SLEEP = 1628;
+
+ // Tagged data for SMART_REPLY_VISIBLE and NOTIFICATION_ITEM_ACTION.
+ // The UI location of the notification containing the smart suggestions.
+ // This is a NotificationLocation object (see the NotificationLocation
+ // enum).
+ // OS: Q
+ NOTIFICATION_LOCATION = 1629;
+
// ---- End Q Constants, all Q constants go above this line ----
// Add new aosp constants above this line.
// END OF AOSP CONSTANTS
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index ff378b3..14322ec 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -124,6 +124,11 @@
*/
@VisibleForTesting
protected void startServiceForUser(int userId) {
+ if (mServiceUsers.get(userId) != null) {
+ Slog.i(TAG, "userId " + userId + " already started, so not starting again");
+ return;
+ }
+
UserBackupManagerService userBackupManagerService =
UserBackupManagerService.createAndInitializeService(
userId, mContext, mTrampoline, mTransportWhitelist);
@@ -155,7 +160,12 @@
}
}
- SparseArray<UserBackupManagerService> getServiceUsers() {
+ /**
+ * Returns a lst of users currently unlocked that have a
+ * {@link UserBackupManagerService} registered.
+ */
+ @VisibleForTesting
+ public SparseArray<UserBackupManagerService> getServiceUsers() {
return mServiceUsers;
}
diff --git a/services/backup/java/com/android/server/backup/Trampoline.java b/services/backup/java/com/android/server/backup/Trampoline.java
index 4ca2545..b9a6f3c 100644
--- a/services/backup/java/com/android/server/backup/Trampoline.java
+++ b/services/backup/java/com/android/server/backup/Trampoline.java
@@ -32,7 +32,6 @@
import android.content.Context;
import android.content.Intent;
import android.os.Binder;
-import android.os.Environment;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
@@ -45,7 +44,6 @@
import android.provider.Settings;
import android.util.Slog;
-import com.android.internal.annotations.GuardedBy;
import com.android.internal.util.DumpUtils;
import java.io.File;
@@ -65,8 +63,8 @@
* following two ways:
*
* <ul>
- * <li>Temporary - create the file {@link #BACKUP_SUPPRESS_FILENAME}, or
- * <li>Permanent - set the system property {@link #BACKUP_DISABLE_PROPERTY} to true.
+ * <li>Temporary - create the file {@link #BACKUP_SUPPRESS_FILENAME}, or
+ * <li>Permanent - set the system property {@link #BACKUP_DISABLE_PROPERTY} to true.
* </ul>
*
* Temporary disabling is controlled by {@link #setBackupServiceActive(int, boolean)} through
@@ -91,10 +89,9 @@
private final Context mContext;
- @GuardedBy("mStateLock")
- private final File mSuppressFile;
-
private final boolean mGlobalDisable;
+ // Lock to write backup suppress files.
+ // TODD(b/121198006): remove this object and synchronized all methods on "this".
private final Object mStateLock = new Object();
private volatile BackupManagerService mService;
@@ -104,9 +101,6 @@
public Trampoline(Context context) {
mContext = context;
mGlobalDisable = isBackupDisabled();
- mSuppressFile = getSuppressFile();
- mSuppressFile.getParentFile().mkdirs();
-
mHandlerThread = new HandlerThread(BACKUP_THREAD, Process.THREAD_PRIORITY_BACKGROUND);
mHandlerThread.start();
mHandler = new Handler(mHandlerThread.getLooper());
@@ -132,11 +126,42 @@
return Binder.getCallingUid();
}
- protected File getSuppressFile() {
- return new File(new File(Environment.getDataDirectory(), "backup"),
+ protected File getSuppressFileForUser(int userId) {
+ return new File(UserBackupManagerFiles.getBaseStateDir(userId),
BACKUP_SUPPRESS_FILENAME);
}
+ protected void createBackupSuppressFileForUser(int userId) throws IOException {
+ synchronized (mStateLock) {
+ getSuppressFileForUser(userId).getParentFile().mkdirs();
+ getSuppressFileForUser(userId).createNewFile();
+ }
+ }
+
+ private void deleteBackupSuppressFileForUser(int userId) {
+ if (!getSuppressFileForUser(userId).delete()) {
+ Slog.w(TAG, "Failed deleting backup suppressed file for user: " + userId);
+ }
+ }
+
+ // A user is ready for a backup if it's unlocked and is not suppressed by a device
+ // admin (device owner or profile owner).
+ private boolean isUserReadyForBackup(int userId) {
+ return mService != null && mService.getServiceUsers().get(userId) != null
+ && !isBackupSuppressedForUser(userId);
+ }
+
+ private boolean isBackupSuppressedForUser(int userId) {
+ // If backup is disabled for system user, it's disabled for all other users on device.
+ if (getSuppressFileForUser(UserHandle.USER_SYSTEM).exists()) {
+ return true;
+ }
+ if (userId != UserHandle.USER_SYSTEM) {
+ return getSuppressFileForUser(userId).exists();
+ }
+ return false;
+ }
+
protected Context getContext() {
return mContext;
}
@@ -162,12 +187,9 @@
Slog.i(TAG, "Backup service not supported");
return;
}
-
synchronized (mStateLock) {
- if (!mSuppressFile.exists()) {
+ if (mService == null) {
mService = createBackupManagerService();
- } else {
- Slog.i(TAG, "Backup service inactive");
}
}
Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
@@ -190,10 +212,11 @@
}
private void startServiceForUser(int userId) {
- BackupManagerService service = mService;
- if (service != null) {
+ // We know that the user is unlocked here because it is called from setBackupServiceActive
+ // and unlockUser which have these guarantees. So we can check if the file exists.
+ if (mService != null && !isBackupSuppressedForUser(userId)) {
Slog.i(TAG, "Starting service for user: " + userId);
- service.startServiceForUser(userId);
+ mService.startServiceForUser(userId);
}
}
@@ -209,10 +232,9 @@
postToHandler(
() -> {
- BackupManagerService service = mService;
- if (service != null) {
+ if (mService != null) {
Slog.i(TAG, "Stopping service for user: " + userId);
- service.stopServiceForUser(userId);
+ mService.stopServiceForUser(userId);
}
});
}
@@ -221,6 +243,8 @@
* Only privileged callers should be changing the backup state. This method only acts on {@link
* UserHandle#USER_SYSTEM} and is a no-op if passed non-system users. Deactivating backup in the
* system user also deactivates backup in all users.
+ *
+ * This call will only work if the calling {@code userID} is unlocked.
*/
public void setBackupServiceActive(int userId, boolean makeActive) {
int caller = binderGetCallingUid();
@@ -246,16 +270,21 @@
synchronized (mStateLock) {
Slog.i(TAG, "Making backup " + (makeActive ? "" : "in") + "active");
if (makeActive) {
- mService = createBackupManagerService();
- mSuppressFile.delete();
+ if (mService == null) {
+ mService = createBackupManagerService();
+ }
+ deleteBackupSuppressFileForUser(userId);
startServiceForUser(userId);
} else {
- mService = null;
try {
- mSuppressFile.createNewFile();
+ //TODO(b/121198006): what if this throws an exception?
+ createBackupSuppressFileForUser(userId);
} catch (IOException e) {
Slog.e(TAG, "Unable to persist backup service inactivity");
}
+ //TODO(b/121198006): loop through active users that have work profile and
+ // stop them as well.
+ stopUser(userId);
}
}
}
@@ -271,20 +300,15 @@
*/
@Override
public boolean isBackupServiceActive(int userId) {
- // TODO: http://b/22388012
- if (userId == UserHandle.USER_SYSTEM) {
- synchronized (mStateLock) {
- return mService != null;
- }
+ synchronized (mStateLock) {
+ return isUserReadyForBackup(userId);
}
- return false;
}
@Override
public void dataChangedForUser(int userId, String packageName) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.dataChanged(userId, packageName);
+ if (isUserReadyForBackup(userId)) {
+ mService.dataChanged(userId, packageName);
}
}
@@ -296,18 +320,16 @@
@Override
public void initializeTransportsForUser(
int userId, String[] transportNames, IBackupObserver observer) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.initializeTransports(userId, transportNames, observer);
+ if (isUserReadyForBackup(userId)) {
+ mService.initializeTransports(userId, transportNames, observer);
}
}
@Override
public void clearBackupDataForUser(int userId, String transportName, String packageName)
throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.clearBackupData(userId, transportName, packageName);
+ if (isUserReadyForBackup(userId)) {
+ mService.clearBackupData(userId, transportName, packageName);
}
}
@@ -320,9 +342,8 @@
@Override
public void agentConnectedForUser(int userId, String packageName, IBinder agent)
throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.agentConnected(userId, packageName, agent);
+ if (isUserReadyForBackup(userId)) {
+ mService.agentConnected(userId, packageName, agent);
}
}
@@ -333,9 +354,8 @@
@Override
public void agentDisconnectedForUser(int userId, String packageName) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.agentDisconnected(userId, packageName);
+ if (isUserReadyForBackup(userId)) {
+ mService.agentDisconnected(userId, packageName);
}
}
@@ -347,9 +367,8 @@
@Override
public void restoreAtInstallForUser(int userId, String packageName, int token)
throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.restoreAtInstall(userId, packageName, token);
+ if (isUserReadyForBackup(userId)) {
+ mService.restoreAtInstall(userId, packageName, token);
}
}
@@ -361,9 +380,8 @@
@Override
public void setBackupEnabledForUser(@UserIdInt int userId, boolean isEnabled)
throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.setBackupEnabled(userId, isEnabled);
+ if (isUserReadyForBackup(userId)) {
+ mService.setBackupEnabled(userId, isEnabled);
}
}
@@ -374,9 +392,8 @@
@Override
public void setAutoRestoreForUser(int userId, boolean doAutoRestore) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.setAutoRestore(userId, doAutoRestore);
+ if (isUserReadyForBackup(userId)) {
+ mService.setAutoRestore(userId, doAutoRestore);
}
}
@@ -387,8 +404,7 @@
@Override
public boolean isBackupEnabledForUser(@UserIdInt int userId) throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.isBackupEnabled(userId) : false;
+ return isUserReadyForBackup(userId) && mService.isBackupEnabled(userId);
}
@Override
@@ -398,21 +414,20 @@
@Override
public boolean setBackupPassword(String currentPw, String newPw) throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.setBackupPassword(currentPw, newPw) : false;
+ int userId = binderGetCallingUserId();
+ return (isUserReadyForBackup(userId)) && mService.setBackupPassword(currentPw, newPw);
}
@Override
public boolean hasBackupPassword() throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.hasBackupPassword() : false;
+ int userId = binderGetCallingUserId();
+ return (isUserReadyForBackup(userId)) && mService.hasBackupPassword();
}
@Override
public void backupNowForUser(@UserIdInt int userId) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.backupNow(userId);
+ if (isUserReadyForBackup(userId)) {
+ mService.backupNow(userId);
}
}
@@ -425,9 +440,8 @@
boolean includeApks, boolean includeObbs, boolean includeShared, boolean doWidgets,
boolean allApps, boolean allIncludesSystem, boolean doCompress, boolean doKeyValue,
String[] packageNames) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.adbBackup(userId, fd, includeApks, includeObbs, includeShared, doWidgets,
+ if (isUserReadyForBackup(userId)) {
+ mService.adbBackup(userId, fd, includeApks, includeObbs, includeShared, doWidgets,
allApps, allIncludesSystem, doCompress, doKeyValue, packageNames);
}
}
@@ -435,17 +449,15 @@
@Override
public void fullTransportBackupForUser(int userId, String[] packageNames)
throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.fullTransportBackup(userId, packageNames);
+ if (isUserReadyForBackup(userId)) {
+ mService.fullTransportBackup(userId, packageNames);
}
}
@Override
public void adbRestore(@UserIdInt int userId, ParcelFileDescriptor fd) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.adbRestore(userId, fd);
+ if (isUserReadyForBackup(userId)) {
+ mService.adbRestore(userId, fd);
}
}
@@ -458,9 +470,8 @@
String encryptionPassword,
IFullBackupRestoreObserver observer)
throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.acknowledgeAdbBackupOrRestore(userId, token, allow,
+ if (isUserReadyForBackup(userId)) {
+ mService.acknowledgeAdbBackupOrRestore(userId, token, allow,
curPassword, encryptionPassword, observer);
}
}
@@ -468,8 +479,7 @@
@Override
public void acknowledgeFullBackupOrRestore(int token, boolean allow, String curPassword,
String encryptionPassword, IFullBackupRestoreObserver observer)
- throws RemoteException {
- BackupManagerService svc = mService;
+ throws RemoteException {
acknowledgeFullBackupOrRestoreForUser(
binderGetCallingUserId(), token, allow, curPassword, encryptionPassword, observer);
}
@@ -477,8 +487,7 @@
@Override
public String getCurrentTransportForUser(int userId) throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.getCurrentTransport(userId) : null;
+ return (isUserReadyForBackup(userId)) ? mService.getCurrentTransport(userId) : null;
}
@Override
@@ -493,14 +502,13 @@
@Override
@Nullable
public ComponentName getCurrentTransportComponentForUser(int userId) {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.getCurrentTransportComponent(userId) : null;
+ return (isUserReadyForBackup(userId)) ? mService.getCurrentTransportComponent(userId)
+ : null;
}
@Override
public String[] listAllTransportsForUser(int userId) throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.listAllTransports(userId) : null;
+ return (isUserReadyForBackup(userId)) ? mService.listAllTransports(userId) : null;
}
@Override
@@ -510,14 +518,14 @@
@Override
public ComponentName[] listAllTransportComponentsForUser(int userId) throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.listAllTransportComponents(userId) : null;
+ return (isUserReadyForBackup(userId)) ? mService.listAllTransportComponents(userId)
+ : null;
}
@Override
public String[] getTransportWhitelist() {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.getTransportWhitelist() : null;
+ int userId = binderGetCallingUserId();
+ return (isUserReadyForBackup(userId)) ? mService.getTransportWhitelist() : null;
}
@Override
@@ -529,9 +537,9 @@
String currentDestinationString,
@Nullable Intent dataManagementIntent,
String dataManagementLabel) {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.updateTransportAttributes(
+
+ if (isUserReadyForBackup(userId)) {
+ mService.updateTransportAttributes(
userId,
transportComponent,
name,
@@ -545,8 +553,8 @@
@Override
public String selectBackupTransportForUser(int userId, String transport)
throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.selectBackupTransport(userId, transport) : null;
+ return (isUserReadyForBackup(userId)) ? mService.selectBackupTransport(userId, transport)
+ : null;
}
@Override
@@ -557,9 +565,8 @@
@Override
public void selectBackupTransportAsyncForUser(int userId, ComponentName transport,
ISelectBackupTransportCallback listener) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.selectBackupTransportAsync(userId, transport, listener);
+ if (isUserReadyForBackup(userId)) {
+ mService.selectBackupTransportAsync(userId, transport, listener);
} else {
if (listener != null) {
try {
@@ -574,8 +581,8 @@
@Override
public Intent getConfigurationIntentForUser(int userId, String transport)
throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.getConfigurationIntent(userId, transport) : null;
+ return isUserReadyForBackup(userId) ? mService.getConfigurationIntent(userId, transport)
+ : null;
}
@Override
@@ -586,8 +593,8 @@
@Override
public String getDestinationStringForUser(int userId, String transport) throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.getDestinationString(userId, transport) : null;
+ return isUserReadyForBackup(userId) ? mService.getDestinationString(userId, transport)
+ : null;
}
@Override
@@ -598,8 +605,8 @@
@Override
public Intent getDataManagementIntentForUser(int userId, String transport)
throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.getDataManagementIntent(userId, transport) : null;
+ return isUserReadyForBackup(userId) ? mService.getDataManagementIntent(userId, transport)
+ : null;
}
@Override
@@ -611,8 +618,8 @@
@Override
public String getDataManagementLabelForUser(int userId, String transport)
throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.getDataManagementLabel(userId, transport) : null;
+ return isUserReadyForBackup(userId) ? mService.getDataManagementLabel(userId, transport)
+ : null;
}
@Override
@@ -624,44 +631,43 @@
@Override
public IRestoreSession beginRestoreSessionForUser(
int userId, String packageName, String transportID) throws RemoteException {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.beginRestoreSession(userId, packageName, transportID) : null;
+ return isUserReadyForBackup(userId) ? mService.beginRestoreSession(userId, packageName,
+ transportID) : null;
}
@Override
public void opComplete(int token, long result) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.opComplete(binderGetCallingUserId(), token, result);
+ int userId = binderGetCallingUserId();
+ if (isUserReadyForBackup(userId)) {
+ mService.opComplete(binderGetCallingUserId(), token, result);
}
}
@Override
public long getAvailableRestoreTokenForUser(int userId, String packageName) {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.getAvailableRestoreToken(userId, packageName) : 0;
+ return isUserReadyForBackup(userId) ? mService.getAvailableRestoreToken(userId,
+ packageName) : 0;
}
@Override
public boolean isAppEligibleForBackupForUser(int userId, String packageName) {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.isAppEligibleForBackup(userId, packageName) : false;
+ return isUserReadyForBackup(userId) && mService.isAppEligibleForBackup(userId,
+ packageName);
}
@Override
public String[] filterAppsEligibleForBackupForUser(int userId, String[] packages) {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.filterAppsEligibleForBackup(userId, packages) : null;
+ return isUserReadyForBackup(userId) ? mService.filterAppsEligibleForBackup(userId,
+ packages) : null;
}
@Override
public int requestBackupForUser(@UserIdInt int userId, String[] packages, IBackupObserver
observer, IBackupManagerMonitor monitor, int flags) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc == null) {
+ if (!isUserReadyForBackup(userId)) {
return BackupManager.ERROR_BACKUP_NOT_ALLOWED;
}
- return svc.requestBackup(userId, packages, observer, monitor, flags);
+ return mService.requestBackup(userId, packages, observer, monitor, flags);
}
@Override
@@ -673,9 +679,8 @@
@Override
public void cancelBackupsForUser(@UserIdInt int userId) throws RemoteException {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.cancelBackups(userId);
+ if (isUserReadyForBackup(userId)) {
+ mService.cancelBackups(userId);
}
}
@@ -687,10 +692,9 @@
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
-
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.dump(fd, pw, args);
+ int userId = binderGetCallingUserId();
+ if (isUserReadyForBackup(userId)) {
+ mService.dump(fd, pw, args);
} else {
pw.println("Inactive");
}
@@ -699,14 +703,12 @@
// Full backup/restore entry points - non-Binder; called directly
// by the full-backup scheduled job
/* package */ boolean beginFullBackup(@UserIdInt int userId, FullBackupJob scheduledJob) {
- BackupManagerService svc = mService;
- return (svc != null) ? svc.beginFullBackup(userId, scheduledJob) : false;
+ return (isUserReadyForBackup(userId)) && mService.beginFullBackup(userId, scheduledJob);
}
/* package */ void endFullBackup(@UserIdInt int userId) {
- BackupManagerService svc = mService;
- if (svc != null) {
- svc.endFullBackup(userId);
+ if (isUserReadyForBackup(userId)) {
+ mService.endFullBackup(userId);
}
}
}
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 00550d9..919a5ab 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -6346,6 +6346,20 @@
}
}
+ @GuardedBy("mVpns")
+ private Vpn getVpnIfOwner() {
+ final int uid = Binder.getCallingUid();
+ final int user = UserHandle.getUserId(uid);
+
+ final Vpn vpn = mVpns.get(user);
+ if (vpn == null) {
+ return null;
+ } else {
+ final VpnInfo info = vpn.getVpnInfo();
+ return (info == null || info.ownerUid != uid) ? null : vpn;
+ }
+ }
+
/**
* Caller either needs to be an active VPN, or hold the NETWORK_STACK permission
* for testing.
@@ -6354,14 +6368,10 @@
if (checkNetworkStackPermission()) {
return null;
}
- final int uid = Binder.getCallingUid();
- final int user = UserHandle.getUserId(uid);
synchronized (mVpns) {
- Vpn vpn = mVpns.get(user);
- try {
- if (vpn.getVpnInfo().ownerUid == uid) return vpn;
- } catch (NullPointerException e) {
- /* vpn is null, or VPN is not connected and getVpnInfo() is null. */
+ Vpn vpn = getVpnIfOwner();
+ if (vpn != null) {
+ return vpn;
}
}
throw new SecurityException("App must either be an active VPN or have the NETWORK_STACK "
@@ -6390,4 +6400,20 @@
return uid;
}
+
+ @Override
+ public boolean isCallerCurrentAlwaysOnVpnApp() {
+ synchronized (mVpns) {
+ Vpn vpn = getVpnIfOwner();
+ return vpn != null && vpn.getAlwaysOn();
+ }
+ }
+
+ @Override
+ public boolean isCallerCurrentAlwaysOnVpnLockdownApp() {
+ synchronized (mVpns) {
+ Vpn vpn = getVpnIfOwner();
+ return vpn != null && vpn.getLockdown();
+ }
+ }
}
diff --git a/services/core/java/com/android/server/LocationManagerService.java b/services/core/java/com/android/server/LocationManagerService.java
index add5e5f..0b4c01e 100644
--- a/services/core/java/com/android/server/LocationManagerService.java
+++ b/services/core/java/com/android/server/LocationManagerService.java
@@ -46,6 +46,7 @@
import android.content.pm.Signature;
import android.content.res.Resources;
import android.database.ContentObserver;
+import android.hardware.location.ActivityRecognitionHardware;
import android.location.Address;
import android.location.Criteria;
import android.location.GeocoderParams;
@@ -92,6 +93,7 @@
import com.android.internal.util.DumpUtils;
import com.android.internal.util.Preconditions;
import com.android.server.location.AbstractLocationProvider;
+import com.android.server.location.ActivityRecognitionProxy;
import com.android.server.location.GeocoderProxy;
import com.android.server.location.GeofenceManager;
import com.android.server.location.GeofenceProxy;
@@ -736,6 +738,25 @@
Slog.d(TAG, "Unable to bind FLP Geofence proxy.");
}
+ // bind to hardware activity recognition
+ boolean activityRecognitionHardwareIsSupported = ActivityRecognitionHardware.isSupported();
+ ActivityRecognitionHardware activityRecognitionHardware = null;
+ if (activityRecognitionHardwareIsSupported) {
+ activityRecognitionHardware = ActivityRecognitionHardware.getInstance(mContext);
+ } else {
+ Slog.d(TAG, "Hardware Activity-Recognition not supported.");
+ }
+ ActivityRecognitionProxy proxy = ActivityRecognitionProxy.createAndBind(
+ mContext,
+ activityRecognitionHardwareIsSupported,
+ activityRecognitionHardware,
+ com.android.internal.R.bool.config_enableActivityRecognitionHardwareOverlay,
+ com.android.internal.R.string.config_activityRecognitionHardwarePackageName,
+ com.android.internal.R.array.config_locationProviderPackageNames);
+ if (proxy == null) {
+ Slog.d(TAG, "Unable to bind ActivityRecognitionProxy.");
+ }
+
String[] testProviderStrings = resources.getStringArray(
com.android.internal.R.array.config_testLocationProviders);
for (String testProviderString : testProviderStrings) {
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index aed0684..c84389b 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -39,14 +39,6 @@
import static android.net.NetworkStats.UID_ALL;
import static android.net.TrafficStats.UID_TETHERING;
-import static com.android.server.NetworkManagementService.NetdResponseCode.ClatdStatusResult;
-import static com.android.server.NetworkManagementService.NetdResponseCode.InterfaceGetCfgResult;
-import static com.android.server.NetworkManagementService.NetdResponseCode.InterfaceListResult;
-import static com.android.server.NetworkManagementService.NetdResponseCode.IpFwdStatusResult;
-import static com.android.server.NetworkManagementService.NetdResponseCode.TetherDnsFwdTgtListResult;
-import static com.android.server.NetworkManagementService.NetdResponseCode.TetherInterfaceListResult;
-import static com.android.server.NetworkManagementService.NetdResponseCode.TetherStatusResult;
-import static com.android.server.NetworkManagementService.NetdResponseCode.TetheringStatsListResult;
import static com.android.server.NetworkManagementService.NetdResponseCode.TtyListResult;
import static com.android.server.NetworkManagementSocketTagger.PROP_QTAGUID_ENABLED;
diff --git a/services/core/java/com/android/server/am/BroadcastQueue.java b/services/core/java/com/android/server/am/BroadcastQueue.java
index 65aacdc..353749f 100644
--- a/services/core/java/com/android/server/am/BroadcastQueue.java
+++ b/services/core/java/com/android/server/am/BroadcastQueue.java
@@ -45,6 +45,7 @@
import android.os.UserHandle;
import android.util.EventLog;
import android.util.Slog;
+import android.util.StatsLog;
import android.util.TimeUtils;
import android.util.proto.ProtoOutputStream;
@@ -157,6 +158,9 @@
static final int BROADCAST_INTENT_MSG = ActivityManagerService.FIRST_BROADCAST_QUEUE_MSG;
static final int BROADCAST_TIMEOUT_MSG = ActivityManagerService.FIRST_BROADCAST_QUEUE_MSG + 1;
+ // log latency metrics for ordered broadcasts during BOOT_COMPLETED processing
+ boolean mLogLatencyMetrics = true;
+
final BroadcastHandler mHandler;
private final class BroadcastHandler extends Handler {
@@ -941,6 +945,12 @@
// adjustments.
mService.updateOomAdjLocked();
}
+
+ // when we have no more ordered broadcast on this queue, stop logging
+ if (mService.mUserController.mBootCompleted && mLogLatencyMetrics) {
+ mLogLatencyMetrics = false;
+ }
+
return;
}
r = mOrderedBroadcasts.get(0);
@@ -1036,6 +1046,13 @@
if (recIdx == 0) {
r.dispatchTime = r.receiverTime;
r.dispatchClockTime = System.currentTimeMillis();
+
+ if (mLogLatencyMetrics) {
+ StatsLog.write(
+ StatsLog.BROADCAST_DISPATCH_LATENCY_REPORTED,
+ r.dispatchClockTime - r.enqueueClockTime);
+ }
+
if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) {
Trace.asyncTraceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER,
createBroadcastTraceTitle(r, BroadcastRecord.DELIVERY_PENDING),
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java
index bcce052..c981e68 100644
--- a/services/core/java/com/android/server/am/UserController.java
+++ b/services/core/java/com/android/server/am/UserController.java
@@ -240,6 +240,8 @@
private final LockPatternUtils mLockPatternUtils;
+ volatile boolean mBootCompleted;
+
UserController(ActivityManagerService service) {
this(new Injector(service));
}
@@ -567,6 +569,7 @@
Bundle extras, boolean ordered, boolean sticky, int sendingUser)
throws RemoteException {
Slog.i(UserController.TAG, "Finished processing BOOT_COMPLETED for u" + userId);
+ mBootCompleted = true;
}
}, 0, null, null,
new String[]{android.Manifest.permission.RECEIVE_BOOT_COMPLETED},
diff --git a/services/core/java/com/android/server/appop/HistoricalRegistry.java b/services/core/java/com/android/server/appop/HistoricalRegistry.java
index c5842e5..708de73 100644
--- a/services/core/java/com/android/server/appop/HistoricalRegistry.java
+++ b/services/core/java/com/android/server/appop/HistoricalRegistry.java
@@ -27,7 +27,9 @@
import android.content.ContentResolver;
import android.database.ContentObserver;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
+import android.os.Debug;
import android.os.Environment;
import android.os.Message;
import android.os.Process;
@@ -38,6 +40,7 @@
import android.util.Slog;
import android.util.TimeUtils;
import android.util.Xml;
+
import com.android.internal.annotations.GuardedBy;
import com.android.internal.os.AtomicDirectory;
import com.android.internal.os.BackgroundThread;
@@ -45,6 +48,7 @@
import com.android.internal.util.XmlUtils;
import com.android.internal.util.function.pooled.PooledLambda;
import com.android.server.FgThread;
+
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;
@@ -59,10 +63,12 @@
import java.nio.file.Files;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
+import java.util.Set;
import java.util.concurrent.TimeUnit;
/**
@@ -105,6 +111,7 @@
// TODO (bug:122218838): Validate changed time is handled correctly
final class HistoricalRegistry {
private static final boolean DEBUG = false;
+ private static final boolean KEEP_WTF_LOG = Build.IS_DEBUGGABLE;
private static final String LOG_TAG = HistoricalRegistry.class.getSimpleName();
@@ -123,7 +130,7 @@
private static final int MSG_WRITE_PENDING_HISTORY = 1;
// See mMode
- private static final int DEFAULT_MODE = AppOpsManager.HISTORICAL_MODE_DISABLED;
+ private static final int DEFAULT_MODE = AppOpsManager.HISTORICAL_MODE_ENABLED_ACTIVE;
// See mBaseSnapshotInterval
private static final long DEFAULT_SNAPSHOT_INTERVAL_MILLIS = TimeUnit.MINUTES.toMillis(15);
@@ -131,11 +138,13 @@
// See mIntervalCompressionMultiplier
private static final long DEFAULT_COMPRESSION_STEP = 10;
+ private static final String HISTORY_FILE_SUFFIX = ".xml";
+
/**
* Whether history is enabled.
*/
@GuardedBy("mInMemoryLock")
- private int mMode = AppOpsManager.HISTORICAL_MODE_DISABLED;
+ private int mMode = AppOpsManager.HISTORICAL_MODE_ENABLED_ACTIVE;
/**
* This granularity has been chosen to allow clean delineation for intervals
@@ -172,10 +181,16 @@
HistoricalRegistry(@NonNull Object lock) {
mInMemoryLock = lock;
if (mMode != AppOpsManager.HISTORICAL_MODE_DISABLED) {
- synchronized (mInMemoryLock) {
- // When starting always adjust history to now.
- mPendingHistoryOffsetMillis = System.currentTimeMillis()
- - mPersistence.getLastPersistTimeMillisDLocked();
+ synchronized (mOnDiskLock) {
+ synchronized (mInMemoryLock) {
+ // When starting always adjust history to now.
+ final long lastPersistTimeMills =
+ mPersistence.getLastPersistTimeMillisDLocked();
+ if (lastPersistTimeMills > 0) {
+ mPendingHistoryOffsetMillis =
+ System.currentTimeMillis() - lastPersistTimeMills;
+ }
+ }
}
}
}
@@ -236,8 +251,8 @@
+ "=" + setting + " resetting!");
}
- void dump(String prefix, PrintWriter pw, int filterUid,
- String filterPackage, int filterOp) {
+ void dump(String prefix, PrintWriter pw, int filterUid,
+ String filterPackage, int filterOp) {
synchronized (mOnDiskLock) {
synchronized (mInMemoryLock) {
pw.println();
@@ -522,6 +537,7 @@
persistPendingHistory(pendingWrites);
}
}
+
private void persistPendingHistory(@NonNull List<HistoricalOps> pendingWrites) {
synchronized (mOnDiskLock) {
BackgroundThread.getHandler().removeMessages(MSG_WRITE_PENDING_HISTORY);
@@ -574,8 +590,6 @@
private static final String LOG_TAG = Persistence.class.getSimpleName();
- private static final String HISTORY_FILE_SUFFIX = ".xml";
-
private static final String TAG_HISTORY = "history";
private static final String TAG_OPS = "ops";
private static final String TAG_UID = "uid";
@@ -603,7 +617,7 @@
}
private final AtomicDirectory mHistoricalAppOpsDir = new AtomicDirectory(
- new File(new File(Environment.getDataSystemDeDirectory(), "appops"), "history"));
+ new File(new File(Environment.getDataSystemDirectory(), "appops"), "history"));
private File generateFile(@NonNull File baseDir, int depth) {
final long globalBeginMillis = computeGlobalIntervalBeginMillis(depth);
@@ -622,10 +636,20 @@
try {
final File newBaseDir = mHistoricalAppOpsDir.startWrite();
final File oldBaseDir = mHistoricalAppOpsDir.getBackupDirectory();
- handlePersistHistoricalOpsRecursiveDLocked(newBaseDir, oldBaseDir, ops, 0);
+ final HistoricalFilesInvariant filesInvariant;
+ if (DEBUG) {
+ filesInvariant = new HistoricalFilesInvariant();
+ filesInvariant.startTracking(oldBaseDir);
+ }
+ final Set<String> oldFileNames = getHistoricalFileNames(oldBaseDir);
+ handlePersistHistoricalOpsRecursiveDLocked(newBaseDir, oldBaseDir, ops,
+ oldFileNames, 0);
+ if (DEBUG) {
+ filesInvariant.stopTracking(newBaseDir);
+ }
mHistoricalAppOpsDir.finishWrite();
} catch (Throwable t) {
- Slog.wtf(LOG_TAG, "Failed to write historical app ops, restoring backup", t);
+ wtf("Failed to write historical app ops, restoring backup", t, null);
mHistoricalAppOpsDir.failWrite();
}
}
@@ -649,15 +673,23 @@
}
long getLastPersistTimeMillisDLocked() {
+ File baseDir = null;
try {
- final File baseDir = mHistoricalAppOpsDir.startRead();
- final File file = generateFile(baseDir, 0);
- if (file.exists()) {
- return file.lastModified();
+ baseDir = mHistoricalAppOpsDir.startRead();
+ final File[] files = baseDir.listFiles();
+ if (files != null && files.length > 0) {
+ final Set<File> historyFiles = new ArraySet<>();
+ Collections.addAll(historyFiles, files);
+ for (int i = 0;; i++) {
+ final File file = generateFile(baseDir, i);
+ if (historyFiles.contains(file)) {
+ return file.lastModified();
+ }
+ }
}
mHistoricalAppOpsDir.finishRead();
- } catch (IOException e) {
- Slog.wtf("Error reading historical app ops. Deleting history.", e);
+ } catch (Throwable e) {
+ wtf("Error reading historical app ops. Deleting history.", e, baseDir);
mHistoricalAppOpsDir.delete();
}
return 0;
@@ -680,27 +712,27 @@
private @Nullable LinkedList<HistoricalOps> collectHistoricalOpsBaseDLocked(
int filterUid, @NonNull String filterPackageName, @Nullable String[] filterOpNames,
long filterBeginTimeMillis, long filterEndTimeMillis) {
+ File baseDir = null;
try {
- final File baseDir = mHistoricalAppOpsDir.startRead();
- final File[] files = baseDir.listFiles();
- if (files == null) {
- return null;
+ baseDir = mHistoricalAppOpsDir.startRead();
+ final HistoricalFilesInvariant filesInvariant;
+ if (DEBUG) {
+ filesInvariant = new HistoricalFilesInvariant();
+ filesInvariant.startTracking(baseDir);
}
- final ArraySet<File> historyFiles = new ArraySet<>(files.length);
- for (File file : files) {
- if (file.isFile() && file.getName().endsWith(HISTORY_FILE_SUFFIX)) {
- historyFiles.add(file);
- }
- }
+ final Set<String> historyFiles = getHistoricalFileNames(baseDir);
final long[] globalContentOffsetMillis = {0};
final LinkedList<HistoricalOps> ops = collectHistoricalOpsRecursiveDLocked(
baseDir, filterUid, filterPackageName, filterOpNames, filterBeginTimeMillis,
filterEndTimeMillis, globalContentOffsetMillis, null /*outOps*/,
0 /*depth*/, historyFiles);
+ if (DEBUG) {
+ filesInvariant.stopTracking(baseDir);
+ }
mHistoricalAppOpsDir.finishRead();
return ops;
- } catch (IOException | XmlPullParserException e) {
- Slog.wtf("Error reading historical app ops. Deleting history.", e);
+ } catch (Throwable t) {
+ wtf("Error reading historical app ops. Deleting history.", t, baseDir);
mHistoricalAppOpsDir.delete();
}
return null;
@@ -711,7 +743,7 @@
@Nullable String[] filterOpNames, long filterBeginTimeMillis,
long filterEndTimeMillis, @NonNull long[] globalContentOffsetMillis,
@Nullable LinkedList<HistoricalOps> outOps, int depth,
- @NonNull ArraySet<File> historyFiles)
+ @NonNull Set<String> historyFiles)
throws IOException, XmlPullParserException {
final long previousIntervalEndMillis = (long) Math.pow(mIntervalCompressionMultiplier,
depth) * mBaseSnapshotInterval;
@@ -761,17 +793,9 @@
return outOps;
}
- private boolean createHardLinkToExistingFile(@NonNull File fromFile, @NonNull File toFile)
- throws IOException {
- if (!fromFile.exists()) {
- return false;
- }
- Files.createLink(toFile.toPath(), fromFile.toPath());
- return true;
- }
-
private void handlePersistHistoricalOpsRecursiveDLocked(@NonNull File newBaseDir,
- @NonNull File oldBaseDir, @Nullable List<HistoricalOps> passedOps, int depth)
+ @NonNull File oldBaseDir, @Nullable List<HistoricalOps> passedOps,
+ @NonNull Set<String> oldFileNames, int depth)
throws IOException, XmlPullParserException {
final long previousIntervalEndMillis = (long) Math.pow(mIntervalCompressionMultiplier,
depth) * mBaseSnapshotInterval;
@@ -779,12 +803,15 @@
depth + 1) * mBaseSnapshotInterval;
if (passedOps == null || passedOps.isEmpty()) {
- // If there is an old file we need to copy it over to the new state.
- final File oldFile = generateFile(oldBaseDir, depth);
- final File newFile = generateFile(newBaseDir, depth);
- if (createHardLinkToExistingFile(oldFile, newFile)) {
+ if (!oldFileNames.isEmpty()) {
+ // If there is an old file we need to copy it over to the new state.
+ final File oldFile = generateFile(oldBaseDir, depth);
+ if (oldFileNames.remove(oldFile.getName())) {
+ final File newFile = generateFile(newBaseDir, depth);
+ Files.createLink(newFile.toPath(), oldFile.toPath());
+ }
handlePersistHistoricalOpsRecursiveDLocked(newBaseDir, oldBaseDir,
- passedOps, depth + 1);
+ passedOps, oldFileNames, depth + 1);
}
return;
}
@@ -900,9 +927,11 @@
enforceOpsWellFormed(overflowedOps);
}
+ final File newFile = generateFile(newBaseDir, depth);
+ oldFileNames.remove(newFile.getName());
+
if (persistedOps != null) {
normalizeSnapshotForSlotDuration(persistedOps, slotDurationMillis);
- final File newFile = generateFile(newBaseDir, depth);
writeHistoricalOpsDLocked(persistedOps, intervalOverflowMillis, newFile);
if (DEBUG) {
Slog.i(LOG_TAG, "Persisted at depth: " + depth
@@ -912,7 +941,7 @@
}
handlePersistHistoricalOpsRecursiveDLocked(newBaseDir, oldBaseDir,
- overflowedOps, depth + 1);
+ overflowedOps, oldFileNames, depth + 1);
}
private @NonNull List<HistoricalOps> readHistoricalOpsLocked(File baseDir,
@@ -920,11 +949,11 @@
@Nullable String filterPackageName, @Nullable String[] filterOpNames,
long filterBeginTimeMillis, long filterEndTimeMillis,
@Nullable long[] cumulativeOverflowMillis, int depth,
- @NonNull ArraySet<File> historyFiles)
+ @NonNull Set<String> historyFiles)
throws IOException, XmlPullParserException {
final File file = generateFile(baseDir, depth);
if (historyFiles != null) {
- historyFiles.remove(file);
+ historyFiles.remove(file.getName());
}
if (filterBeginTimeMillis >= filterEndTimeMillis
|| filterEndTimeMillis < intervalBeginMillis) {
@@ -1364,6 +1393,61 @@
}
return builder.toString();
}
+
+ private static Set<String> getHistoricalFileNames(@NonNull File historyDir) {
+ final File[] files = historyDir.listFiles();
+ if (files == null) {
+ return Collections.emptySet();
+ }
+ final ArraySet<String> fileNames = new ArraySet<>(files.length);
+ for (File file : files) {
+ fileNames.add(file.getName());
+
+ }
+ return fileNames;
+ }
+ }
+
+ private static class HistoricalFilesInvariant {
+ private final @NonNull List<File> mBeginFiles = new ArrayList<>();
+
+ public void startTracking(@NonNull File folder) {
+ final File[] files = folder.listFiles();
+ if (files != null) {
+ Collections.addAll(mBeginFiles, files);
+ }
+ }
+
+ public void stopTracking(@NonNull File folder) {
+ final List<File> endFiles = new ArrayList<>();
+ final File[] files = folder.listFiles();
+ if (files != null) {
+ Collections.addAll(endFiles, files);
+ }
+ final long beginOldestFileOffsetMillis = getOldestFileOffsetMillis(mBeginFiles);
+ final long endOldestFileOffsetMillis = getOldestFileOffsetMillis(endFiles);
+ if (endOldestFileOffsetMillis < beginOldestFileOffsetMillis) {
+ final String message = "History loss detected!"
+ + "\nold files: " + mBeginFiles;
+ wtf(message, null, folder);
+ throw new IllegalStateException(message);
+ }
+ }
+
+ private static long getOldestFileOffsetMillis(@NonNull List<File> files) {
+ if (files.isEmpty()) {
+ return 0;
+ }
+ String longestName = files.get(0).getName();
+ final int fileCount = files.size();
+ for (int i = 1; i < fileCount; i++) {
+ final File file = files.get(i);
+ if (file.getName().length() > longestName.length()) {
+ longestName = file.getName();
+ }
+ }
+ return Long.parseLong(longestName.replace(HISTORY_FILE_SUFFIX, ""));
+ }
}
private final class StringDumpVisitor implements AppOpsManager.HistoricalOpsVisitor {
@@ -1493,4 +1577,30 @@
}
}
}
+
+ private static void wtf(@Nullable String message, @Nullable Throwable t,
+ @Nullable File storage) {
+ Slog.wtf(LOG_TAG, message, t);
+ if (KEEP_WTF_LOG) {
+ try {
+ final File file = new File(new File(Environment.getDataSystemDirectory(), "appops"),
+ "wtf" + TimeUtils.formatForLogging(System.currentTimeMillis()));
+ if (file.createNewFile()) {
+ try (PrintWriter writer = new PrintWriter(file)) {
+ if (t != null) {
+ writer.append('\n').append(t.toString());
+ }
+ writer.append('\n').append(Debug.getCallers(10));
+ if (storage != null) {
+ writer.append("\nfiles: " + Arrays.toString(storage.listFiles()));
+ } else {
+ writer.append("\nfiles: none");
+ }
+ }
+ }
+ } catch (IOException e) {
+ /* ignore */
+ }
+ }
+ }
}
diff --git a/services/core/java/com/android/server/attention/AttentionManagerService.java b/services/core/java/com/android/server/attention/AttentionManagerService.java
index f60d6b0..8f1befe 100644
--- a/services/core/java/com/android/server/attention/AttentionManagerService.java
+++ b/services/core/java/com/android/server/attention/AttentionManagerService.java
@@ -73,7 +73,6 @@
private final Context mContext;
private final PowerManager mPowerManager;
- private final ActivityManager mActivityManager;
private final Object mLock;
@GuardedBy("mLock")
private final SparseArray<UserState> mUserStates = new SparseArray<>();
@@ -85,7 +84,6 @@
super(context);
mContext = Preconditions.checkNotNull(context);
mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
- mActivityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
mLock = new Object();
mAttentionHandler = new AttentionHandler();
}
@@ -96,7 +94,7 @@
}
@Override
- public void onStopUser(int userId) {
+ public void onSwitchUser(int userId) {
cancelAndUnbindLocked(peekUserStateLocked(userId),
AttentionService.ATTENTION_FAILURE_UNKNOWN);
}
@@ -201,11 +199,20 @@
/** Cancels the specified attention check. */
public void cancelAttentionCheck(int requestCode) {
- final UserState userState = getOrCreateCurrentUserStateLocked();
- try {
- userState.mService.cancelAttentionCheck(requestCode);
- } catch (RemoteException e) {
- Slog.e(LOG_TAG, "Cannot call into the AttentionService");
+ synchronized (mLock) {
+ final UserState userState = getOrCreateCurrentUserStateLocked();
+ if (userState.mService == null) {
+ if (userState.mPendingAttentionCheck != null
+ && userState.mPendingAttentionCheck.mRequestCode == requestCode) {
+ userState.mPendingAttentionCheck = null;
+ }
+ return;
+ }
+ try {
+ userState.mService.cancelAttentionCheck(requestCode);
+ } catch (RemoteException e) {
+ Slog.e(LOG_TAG, "Cannot call into the AttentionService");
+ }
}
}
@@ -224,7 +231,7 @@
@GuardedBy("mLock")
private UserState getOrCreateCurrentUserStateLocked() {
- return getOrCreateUserStateLocked(mActivityManager.getCurrentUser());
+ return getOrCreateUserStateLocked(ActivityManager.getCurrentUser());
}
@GuardedBy("mLock")
@@ -239,7 +246,7 @@
@GuardedBy("mLock")
UserState peekCurrentUserStateLocked() {
- return peekUserStateLocked(mActivityManager.getCurrentUser());
+ return peekUserStateLocked(ActivityManager.getCurrentUser());
}
@GuardedBy("mLock")
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index 602aedb..c72c9dd 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -60,7 +60,6 @@
import android.net.NetworkUtils;
import android.net.RouteInfo;
import android.net.UidRange;
-import android.net.Uri;
import android.net.VpnService;
import android.os.Binder;
import android.os.Build.VERSION_CODES;
@@ -71,7 +70,6 @@
import android.os.Looper;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
-import android.os.PatternMatcher;
import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
@@ -100,6 +98,8 @@
import com.android.server.LocalServices;
import com.android.server.net.BaseNetworkObserver;
+import libcore.io.IoUtils;
+
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -121,8 +121,6 @@
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicInteger;
-import libcore.io.IoUtils;
-
/**
* @hide
*/
@@ -346,11 +344,18 @@
*
* @return {@code true} if VPN lockdown is enabled.
*/
- public boolean getLockdown() {
+ public synchronized boolean getLockdown() {
return mLockdown;
}
/**
+ * Returns whether VPN is configured as always-on.
+ */
+ public synchronized boolean getAlwaysOn() {
+ return mAlwaysOn;
+ }
+
+ /**
* Checks if a VPN app supports always-on mode.
*
* In order to support the always-on feature, an app has to
diff --git a/services/core/java/com/android/server/display/ColorDisplayService.java b/services/core/java/com/android/server/display/ColorDisplayService.java
index 9223739..3a58160 100644
--- a/services/core/java/com/android/server/display/ColorDisplayService.java
+++ b/services/core/java/com/android/server/display/ColorDisplayService.java
@@ -28,6 +28,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.Size;
+import android.annotation.UserIdInt;
import android.app.AlarmManager;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
@@ -51,6 +52,7 @@
import android.provider.Settings.System;
import android.util.MathUtils;
import android.util.Slog;
+import android.view.SurfaceControl;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.AnimationUtils;
@@ -866,6 +868,12 @@
if (mDisplayWhiteBalanceListener != null && oldActivated != activated) {
mDisplayWhiteBalanceListener.onDisplayWhiteBalanceStatusChanged(activated);
}
+
+ // If disabled, clear the tint. If enabled, do nothing more here and let the next
+ // temperature update set the correct tint.
+ if (!activated) {
+ applyTint(mDisplayWhiteBalanceTintController, false);
+ }
}
private boolean isDisplayWhiteBalanceSettingEnabled() {
@@ -878,6 +886,21 @@
return dtm.isDeviceColorManaged();
}
+ private int getTransformCapabilitiesInternal() {
+ int availabilityFlags = ColorDisplayManager.CAPABILITY_NONE;
+ if (SurfaceControl.getProtectedContentSupport()) {
+ availabilityFlags |= ColorDisplayManager.CAPABILITY_PROTECTED_CONTENT;
+ }
+ final Resources res = getContext().getResources();
+ if (res.getBoolean(R.bool.config_setColorTransformAccelerated)) {
+ availabilityFlags |= ColorDisplayManager.CAPABILITY_HARDWARE_ACCELERATION_GLOBAL;
+ }
+ if (res.getBoolean(R.bool.config_setColorTransformAcceleratedPerLayer)) {
+ availabilityFlags |= ColorDisplayManager.CAPABILITY_HARDWARE_ACCELERATION_PER_APP;
+ }
+ return availabilityFlags;
+ }
+
/**
* Returns the last time the night display transform activation state was changed, or {@link
* LocalDateTime#MIN} if night display has never been activated.
@@ -1226,10 +1249,10 @@
* Adds a {@link WeakReference<ColorTransformController>} for a newly started activity, and
* invokes {@link ColorTransformController#applyAppSaturation(float[], float[])} if needed.
*/
- public boolean attachColorTransformController(String packageName, int uid,
+ public boolean attachColorTransformController(String packageName, @UserIdInt int userId,
WeakReference<ColorTransformController> controller) {
return mAppSaturationController
- .addColorTransformController(packageName, uid, controller);
+ .addColorTransformController(packageName, userId, controller);
}
}
@@ -1318,6 +1341,18 @@
}
}
+ public int getTransformCapabilities() {
+ getContext().enforceCallingPermission(
+ Manifest.permission.CONTROL_DISPLAY_COLOR_TRANSFORMS,
+ "Permission required to query transform capabilities");
+ final long token = Binder.clearCallingIdentity();
+ try {
+ return getTransformCapabilitiesInternal();
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
@Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (!DumpUtils.checkDumpPermission(getContext(), TAG, pw)) return;
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
index 63214ed..cac1a95 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java
@@ -268,7 +268,7 @@
mTvSystemAudioModeSupport = false;
// Record the last state of System Audio Control before going to standby
synchronized (mLock) {
- mService.writeStringSetting(
+ mService.writeStringSystemProperty(
Constants.PROPERTY_LAST_SYSTEM_AUDIO_CONTROL,
mSystemAudioActivated ? "true" : "false");
}
@@ -330,7 +330,7 @@
@ServiceThreadOnly
protected void setPreferredAddress(int addr) {
assertRunOnServiceThread();
- mService.writeStringSetting(
+ mService.writeStringSystemProperty(
Constants.PROPERTY_PREFERRED_ADDRESS_AUDIO_SYSTEM, String.valueOf(addr));
}
@@ -469,7 +469,7 @@
protected boolean handleRequestArcInitiate(HdmiCecMessage message) {
assertRunOnServiceThread();
removeAction(ArcInitiationActionFromAvr.class);
- if (!mService.readBooleanSetting(Constants.PROPERTY_ARC_SUPPORT, true)) {
+ if (!mService.readBooleanSystemProperty(Constants.PROPERTY_ARC_SUPPORT, true)) {
mService.maySendFeatureAbortCommand(message, Constants.ABORT_UNRECOGNIZED_OPCODE);
} else if (!isDirectConnectToTv()) {
HdmiLogger.debug("AVR device is not directly connected with TV");
@@ -829,7 +829,7 @@
boolean currentMuteStatus =
mService.getAudioManager().isStreamMute(AudioManager.STREAM_MUSIC);
if (currentMuteStatus == newSystemAudioMode) {
- if (mService.readBooleanSetting(
+ if (mService.readBooleanSystemProperty(
Constants.PROPERTY_SYSTEM_AUDIO_MODE_MUTING_ENABLE, true)
|| newSystemAudioMode) {
mService.getAudioManager()
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
index 7a0c279..ef7d241 100644
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java
@@ -100,7 +100,7 @@
@ServiceThreadOnly
protected void setPreferredAddress(int addr) {
assertRunOnServiceThread();
- mService.writeStringSetting(Constants.PROPERTY_PREFERRED_ADDRESS_PLAYBACK,
+ mService.writeStringSystemProperty(Constants.PROPERTY_PREFERRED_ADDRESS_PLAYBACK,
String.valueOf(addr));
}
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 46219d5..f3a1e46 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -657,9 +657,13 @@
Global.putInt(cr, key, toInt(value));
}
- void writeStringSetting(String key, String value) {
- ContentResolver cr = getContext().getContentResolver();
- Global.putString(cr, key, value);
+ void writeStringSystemProperty(String key, String value) {
+ SystemProperties.set(key, value);
+ }
+
+ @VisibleForTesting
+ boolean readBooleanSystemProperty(String key, boolean defVal) {
+ return SystemProperties.getBoolean(key, defVal);
}
private void initializeCec(int initiatedBy) {
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 6c3cc58..52074a7 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -1607,7 +1607,7 @@
// 1) it comes from the system process
// 2) the calling process' user id is identical to the current user id IMMS thinks.
@GuardedBy("mMethodMap")
- private boolean calledFromValidUserLocked(boolean allowCrossProfileAccess) {
+ private boolean calledFromValidUserLocked() {
final int uid = Binder.getCallingUid();
final int userId = UserHandle.getUserId(uid);
if (DEBUG) {
@@ -1623,7 +1623,7 @@
if (userId == mSettings.getCurrentUserId()) {
return true;
}
- if (allowCrossProfileAccess && mSettings.isCurrentProfile(userId)) {
+ if (!PER_PROFILE_IME_ENABLED && mSettings.isCurrentProfile(userId)) {
return true;
}
@@ -2651,7 +2651,7 @@
ResultReceiver resultReceiver) {
int uid = Binder.getCallingUid();
synchronized (mMethodMap) {
- if (!calledFromValidUserLocked(!PER_PROFILE_IME_ENABLED)) {
+ if (!calledFromValidUserLocked()) {
return false;
}
final long ident = Binder.clearCallingIdentity();
@@ -2736,7 +2736,7 @@
ResultReceiver resultReceiver) {
int uid = Binder.getCallingUid();
synchronized (mMethodMap) {
- if (!calledFromValidUserLocked(!PER_PROFILE_IME_ENABLED)) {
+ if (!calledFromValidUserLocked()) {
return false;
}
final long ident = Binder.clearCallingIdentity();
@@ -2845,7 +2845,7 @@
int unverifiedTargetSdkVersion) {
final int callingUserId = UserHandle.getCallingUserId();
final int userId;
- if (PER_PROFILE_IME_ENABLED && attribute != null && attribute.targetInputMethodUser != null
+ if (attribute != null && attribute.targetInputMethodUser != null
&& attribute.targetInputMethodUser.getIdentifier() != callingUserId) {
mContext.enforceCallingPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL,
"Using EditorInfo.user requires INTERACT_ACROSS_USERS_FULL.");
@@ -2862,9 +2862,6 @@
}
InputBindResult res = null;
synchronized (mMethodMap) {
- // Needs to check the validity before clearing calling identity
- // Note that cross-profile access is always allowed here to allow profile-switching.
- final boolean calledFromValidUser = calledFromValidUserLocked(true);
final int windowDisplayId =
mWindowManagerInternal.getDisplayIdForWindow(windowToken);
final long ident = Binder.clearCallingIdentity();
@@ -2908,10 +2905,12 @@
return InputBindResult.NOT_IME_TARGET_WINDOW;
}
- if (!calledFromValidUser) {
+ // cross-profile access is always allowed here to allow profile-switching.
+ if (!mSettings.isCurrentProfile(userId)) {
Slog.w(TAG, "A background user is requesting window. Hiding IME.");
- Slog.w(TAG, "If you want to interect with IME, you need "
- + "android.permission.INTERACT_ACROSS_USERS_FULL");
+ Slog.w(TAG, "If you need to impersonate a foreground user/profile from"
+ + " a background user, use EditorInfo.targetInputMethodUser with"
+ + " INTERACT_ACROSS_USERS_FULL permission.");
hideCurrentInputLocked(0, null);
return InputBindResult.INVALID_USER;
}
@@ -3088,7 +3087,7 @@
public void showInputMethodPickerFromClient(
IInputMethodClient client, int auxiliarySubtypeMode) {
synchronized (mMethodMap) {
- if (!calledFromValidUserLocked(!PER_PROFILE_IME_ENABLED)) {
+ if (!calledFromValidUserLocked()) {
return;
}
if(!canShowInputMethodPickerLocked(client)) {
@@ -3160,7 +3159,7 @@
IInputMethodClient client, String inputMethodId) {
synchronized (mMethodMap) {
// TODO(yukawa): Should we verify the display ID?
- if (!calledFromValidUserLocked(!PER_PROFILE_IME_ENABLED)) {
+ if (!calledFromValidUserLocked()) {
return;
}
executeOrSendMessage(mCurMethod, mCaller.obtainMessageO(
@@ -3275,7 +3274,7 @@
@Override
public InputMethodSubtype getLastInputMethodSubtype() {
synchronized (mMethodMap) {
- if (!calledFromValidUserLocked(!PER_PROFILE_IME_ENABLED)) {
+ if (!calledFromValidUserLocked()) {
return null;
}
final Pair<String, String> lastIme = mSettings.getLastInputMethodAndSubtypeLocked();
@@ -3313,7 +3312,7 @@
}
}
synchronized (mMethodMap) {
- if (!calledFromValidUserLocked(!PER_PROFILE_IME_ENABLED)) {
+ if (!calledFromValidUserLocked()) {
return;
}
if (!mSystemReady) {
@@ -4159,7 +4158,7 @@
public InputMethodSubtype getCurrentInputMethodSubtype() {
synchronized (mMethodMap) {
// TODO: Make this work even for non-current users?
- if (!calledFromValidUserLocked(!PER_PROFILE_IME_ENABLED)) {
+ if (!calledFromValidUserLocked()) {
return null;
}
return getCurrentInputMethodSubtypeLocked();
@@ -4209,7 +4208,7 @@
public boolean setCurrentInputMethodSubtype(InputMethodSubtype subtype) {
synchronized (mMethodMap) {
// TODO: Make this work even for non-current users?
- if (!calledFromValidUserLocked(!PER_PROFILE_IME_ENABLED)) {
+ if (!calledFromValidUserLocked()) {
return false;
}
if (subtype != null && mCurMethodId != null) {
diff --git a/services/core/java/com/android/server/location/ActivityRecognitionProxy.java b/services/core/java/com/android/server/location/ActivityRecognitionProxy.java
new file mode 100644
index 0000000..22fabb2
--- /dev/null
+++ b/services/core/java/com/android/server/location/ActivityRecognitionProxy.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.server.location;
+
+import android.content.Context;
+import android.hardware.location.ActivityRecognitionHardware;
+import android.hardware.location.IActivityRecognitionHardwareClient;
+import android.hardware.location.IActivityRecognitionHardwareWatcher;
+import android.os.IBinder;
+import android.os.RemoteException;
+import android.util.Log;
+
+import com.android.internal.os.BackgroundThread;
+import com.android.server.ServiceWatcher;
+
+/**
+ * Proxy class to bind GmsCore to the ActivityRecognitionHardware.
+ *
+ * @hide
+ */
+public class ActivityRecognitionProxy {
+
+ private static final String TAG = "ActivityRecognitionProxy";
+
+ /**
+ * Creates an instance of the proxy and binds it to the appropriate FusedProvider.
+ *
+ * @return An instance of the proxy if it could be bound, null otherwise.
+ */
+ public static ActivityRecognitionProxy createAndBind(
+ Context context,
+ boolean activityRecognitionHardwareIsSupported,
+ ActivityRecognitionHardware activityRecognitionHardware,
+ int overlaySwitchResId,
+ int defaultServicePackageNameResId,
+ int initialPackageNameResId) {
+ ActivityRecognitionProxy activityRecognitionProxy = new ActivityRecognitionProxy(
+ context,
+ activityRecognitionHardwareIsSupported,
+ activityRecognitionHardware,
+ overlaySwitchResId,
+ defaultServicePackageNameResId,
+ initialPackageNameResId);
+
+ if (activityRecognitionProxy.mServiceWatcher.start()) {
+ return activityRecognitionProxy;
+ } else {
+ return null;
+ }
+ }
+
+ private final ServiceWatcher mServiceWatcher;
+ private final boolean mIsSupported;
+ private final ActivityRecognitionHardware mInstance;
+
+ private ActivityRecognitionProxy(
+ Context context,
+ boolean activityRecognitionHardwareIsSupported,
+ ActivityRecognitionHardware activityRecognitionHardware,
+ int overlaySwitchResId,
+ int defaultServicePackageNameResId,
+ int initialPackageNameResId) {
+ mIsSupported = activityRecognitionHardwareIsSupported;
+ mInstance = activityRecognitionHardware;
+
+ mServiceWatcher = new ServiceWatcher(
+ context,
+ TAG,
+ "com.android.location.service.ActivityRecognitionProvider",
+ overlaySwitchResId,
+ defaultServicePackageNameResId,
+ initialPackageNameResId,
+ BackgroundThread.getHandler()) {
+ @Override
+ protected void onBind() {
+ runOnBinder(ActivityRecognitionProxy.this::initializeService);
+ }
+ };
+ }
+
+ private void initializeService(IBinder binder) {
+ try {
+ String descriptor = binder.getInterfaceDescriptor();
+
+ if (IActivityRecognitionHardwareWatcher.class.getCanonicalName().equals(
+ descriptor)) {
+ IActivityRecognitionHardwareWatcher watcher =
+ IActivityRecognitionHardwareWatcher.Stub.asInterface(binder);
+ if (mInstance != null) {
+ watcher.onInstanceChanged(mInstance);
+ }
+ } else if (IActivityRecognitionHardwareClient.class.getCanonicalName()
+ .equals(descriptor)) {
+ IActivityRecognitionHardwareClient client =
+ IActivityRecognitionHardwareClient.Stub.asInterface(binder);
+ client.onAvailabilityChanged(mIsSupported, mInstance);
+ } else {
+ Log.e(TAG, "Invalid descriptor found on connection: " + descriptor);
+ }
+ } catch (RemoteException e) {
+ Log.w(TAG, e);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/notification/NotificationDelegate.java b/services/core/java/com/android/server/notification/NotificationDelegate.java
index ee60daa..c2dc554 100644
--- a/services/core/java/com/android/server/notification/NotificationDelegate.java
+++ b/services/core/java/com/android/server/notification/NotificationDelegate.java
@@ -42,7 +42,8 @@
void onNotificationVisibilityChanged(
NotificationVisibility[] newlyVisibleKeys,
NotificationVisibility[] noLongerVisibleKeys);
- void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded);
+ void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded,
+ int notificationLocation);
void onNotificationDirectReplied(String key);
void onNotificationSettingsViewed(String key);
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 20c4da4..47a5597 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -868,7 +868,7 @@
@Override
public void onNotificationExpansionChanged(String key,
- boolean userAction, boolean expanded) {
+ boolean userAction, boolean expanded, int notificationLocation) {
synchronized (mNotificationLock) {
NotificationRecord r = mNotificationsByKey.get(key);
if (r != null) {
diff --git a/services/core/java/com/android/server/pm/LauncherAppsService.java b/services/core/java/com/android/server/pm/LauncherAppsService.java
index b6dae19..a33f14b 100644
--- a/services/core/java/com/android/server/pm/LauncherAppsService.java
+++ b/services/core/java/com/android/server/pm/LauncherAppsService.java
@@ -33,6 +33,7 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.ILauncherApps;
import android.content.pm.IOnAppsChangedListener;
+import android.content.pm.LauncherApps;
import android.content.pm.LauncherApps.ShortcutQuery;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@@ -42,6 +43,8 @@
import android.content.pm.ShortcutInfo;
import android.content.pm.ShortcutServiceInternal;
import android.content.pm.ShortcutServiceInternal.ShortcutChangeListener;
+import android.content.pm.Signature;
+import android.content.pm.SigningInfo;
import android.content.pm.UserInfo;
import android.graphics.Rect;
import android.net.Uri;
@@ -56,21 +59,31 @@
import android.os.UserManager;
import android.os.UserManagerInternal;
import android.provider.Settings;
+import android.util.ByteStringUtils;
import android.util.Log;
import android.util.Slog;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.content.PackageMonitor;
import com.android.internal.os.BackgroundThread;
+import com.android.internal.util.DumpUtils;
import com.android.internal.util.Preconditions;
+import com.android.internal.util.StatLogger;
import com.android.server.LocalServices;
import com.android.server.SystemService;
import com.android.server.wm.ActivityTaskManagerInternal;
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
/**
* Service that manages requests and callbacks for launchers that support
@@ -108,6 +121,17 @@
static class LauncherAppsImpl extends ILauncherApps.Stub {
private static final boolean DEBUG = false;
private static final String TAG = "LauncherAppsService";
+
+ // Stats
+ @VisibleForTesting
+ interface Stats {
+ int INIT_VOUCHED_SIGNATURES = 0;
+ int COUNT = INIT_VOUCHED_SIGNATURES + 1;
+ }
+ private final StatLogger mStatLogger = new StatLogger(new String[] {
+ "initVouchedSignatures"
+ });
+
private final Context mContext;
private final UserManager mUm;
private final UserManagerInternal mUserManagerInternal;
@@ -117,11 +141,16 @@
private final PackageCallbackList<IOnAppsChangedListener> mListeners
= new PackageCallbackList<IOnAppsChangedListener>();
private final DevicePolicyManager mDpm;
+ private final ConcurrentHashMap<UserHandle, Set<String>> mVouchedSignaturesByUser;
+ private final Set<String> mVouchProviders;
private final MyPackageMonitor mPackageMonitor = new MyPackageMonitor();
+ private final VouchesChangedMonitor mVouchesChangedMonitor = new VouchesChangedMonitor();
private final Handler mCallbackHandler;
+ private final Object mVouchedSignaturesLocked = new Object();
+
public LauncherAppsImpl(Context context) {
mContext = context;
mUm = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
@@ -136,6 +165,9 @@
mShortcutServiceInternal.addListener(mPackageMonitor);
mCallbackHandler = BackgroundThread.getHandler();
mDpm = (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
+ mVouchedSignaturesByUser = new ConcurrentHashMap<>();
+ mVouchProviders = Collections.newSetFromMap(new ConcurrentHashMap<String, Boolean>());
+ mVouchesChangedMonitor.register(mContext, UserHandle.ALL, true, mCallbackHandler);
}
@VisibleForTesting
@@ -355,7 +387,7 @@
}
ApplicationInfo appInfo = pmInt.getApplicationInfo(packageName, /*flags*/ 0,
callingUid, user.getIdentifier());
- if (shouldShowHiddenApp(appInfo)) {
+ if (shouldShowHiddenApp(user, appInfo)) {
ResolveInfo info = getHiddenAppActivityInfo(packageName, callingUid, user);
if (info != null) {
result.add(info);
@@ -371,7 +403,7 @@
user.getIdentifier(), callingUid);
for (ApplicationInfo applicationInfo : installedPackages) {
if (!visiblePackages.contains(applicationInfo.packageName)) {
- if (!shouldShowHiddenApp(applicationInfo)) {
+ if (!shouldShowHiddenApp(user, applicationInfo)) {
continue;
}
ResolveInfo info = getHiddenAppActivityInfo(applicationInfo.packageName,
@@ -387,13 +419,130 @@
}
}
- private static boolean shouldShowHiddenApp(ApplicationInfo appInfo) {
+ private boolean shouldShowHiddenApp(UserHandle user, ApplicationInfo appInfo) {
if (appInfo == null || appInfo.isSystemApp() || appInfo.isUpdatedSystemApp()) {
return false;
}
+ if (!mVouchedSignaturesByUser.containsKey(user)) {
+ initVouchedSignatures(user);
+ }
+ if (mVouchProviders.contains(appInfo.packageName)) {
+ // If it's a vouching packages then we must show hidden app
+ return true;
+ }
+ // If app's signature is in vouch list, do not show hidden app
+ final Set<String> vouches = mVouchedSignaturesByUser.get(user);
+ try {
+ final PackageInfo pkgInfo = mContext.getPackageManager().getPackageInfo(
+ appInfo.packageName, PackageManager.GET_SIGNING_CERTIFICATES);
+ final Signature[] signatures = getLatestSignatures(pkgInfo.signingInfo);
+ // If any of the signatures appears in vouches, then we don't show hidden app
+ for (Signature signature : signatures) {
+ final String certDigest = computePackageCertDigest(signature);
+ if (vouches.contains(certDigest)) {
+ return false;
+ }
+ }
+ } catch (PackageManager.NameNotFoundException e) {
+ // Should not happen
+ }
return true;
}
+ @VisibleForTesting
+ static String computePackageCertDigest(Signature signature) {
+ MessageDigest messageDigest;
+ try {
+ messageDigest = MessageDigest.getInstance("SHA1");
+ } catch (NoSuchAlgorithmException e) {
+ // Should not happen
+ return null;
+ }
+ messageDigest.update(signature.toByteArray());
+ final byte[] digest = messageDigest.digest();
+ return ByteStringUtils.toHexString(digest);
+ }
+
+ @VisibleForTesting
+ static Signature[] getLatestSignatures(SigningInfo signingInfo) {
+ if (signingInfo.hasMultipleSigners()) {
+ return signingInfo.getApkContentsSigners();
+ } else {
+ final Signature[] signatures = signingInfo.getSigningCertificateHistory();
+ return new Signature[]{signatures[0]};
+ }
+ }
+
+ private void updateVouches(String packageName, UserHandle user) {
+ final PackageManagerInternal pmInt =
+ LocalServices.getService(PackageManagerInternal.class);
+ ApplicationInfo appInfo = pmInt.getApplicationInfo(packageName,
+ PackageManager.GET_META_DATA, Binder.getCallingUid(), user.getIdentifier());
+ if (appInfo == null) {
+ Log.w(TAG, "appInfo " + packageName + " is null");
+ return;
+ }
+ updateVouches(appInfo, user);
+ }
+
+ private void updateVouches(ApplicationInfo appInfo, UserHandle user) {
+ if (appInfo == null || appInfo.metaData == null) {
+ // No meta-data
+ return;
+ }
+ int tokenResourceId = appInfo.metaData.getInt(LauncherApps.VOUCHED_CERTS_KEY);
+ if (tokenResourceId == 0) {
+ // No xml file
+ return;
+ }
+ mVouchProviders.add(appInfo.packageName);
+ Set<String> vouches = mVouchedSignaturesByUser.get(user);
+ try {
+ List<String> signatures = Arrays.asList(
+ mContext.getPackageManager().getResourcesForApplication(
+ appInfo.packageName).getStringArray(tokenResourceId));
+ for (String signature : signatures) {
+ vouches.add(signature.toUpperCase());
+ }
+ } catch (PackageManager.NameNotFoundException e) {
+ // Should not happen
+ }
+ }
+
+ private void initVouchedSignatures(UserHandle user) {
+ synchronized (mVouchedSignaturesLocked) {
+ if (mVouchedSignaturesByUser.contains(user)) {
+ return;
+ }
+ final long startTime = mStatLogger.getTime();
+
+ Set<String> vouches = Collections.newSetFromMap(
+ new ConcurrentHashMap<String, Boolean>());
+
+ final int callingUid = injectBinderCallingUid();
+ long ident = Binder.clearCallingIdentity();
+ try {
+ final PackageManagerInternal pmInt =
+ LocalServices.getService(PackageManagerInternal.class);
+ List<ApplicationInfo> installedPackages = pmInt.getInstalledApplications(
+ PackageManager.GET_META_DATA, user.getIdentifier(), callingUid);
+ for (ApplicationInfo appInfo : installedPackages) {
+ updateVouches(appInfo, user);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(ident);
+ }
+ mVouchedSignaturesByUser.putIfAbsent(user, vouches);
+ mStatLogger.logDurationStat(Stats.INIT_VOUCHED_SIGNATURES, startTime);
+ }
+ }
+
+ @Override
+ public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw)) return;
+ mStatLogger.dump(pw, " ");
+ }
+
@Override
public ActivityInfo resolveActivity(
String callingPackage, ComponentName component, UserHandle user)
@@ -760,6 +909,18 @@
mCallbackHandler.post(r);
}
+ private class VouchesChangedMonitor extends PackageMonitor {
+ @Override
+ public void onPackageAdded(String packageName, int uid) {
+ updateVouches(packageName, new UserHandle(getChangingUserId()));
+ }
+
+ @Override
+ public void onPackageModified(String packageName) {
+ updateVouches(packageName, new UserHandle(getChangingUserId()));
+ }
+ }
+
private class MyPackageMonitor extends PackageMonitor implements ShortcutChangeListener {
// TODO Simplify with lambdas.
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java
index bf4e272..0ab2a73 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerService.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerService.java
@@ -310,7 +310,6 @@
in.setInput(fis, StandardCharsets.UTF_8.name());
int type;
- PackageInstallerSession currentSession = null;
while ((type = in.next()) != END_DOCUMENT) {
if (type == START_TAG) {
final String tag = in.getName();
@@ -320,9 +319,7 @@
session = PackageInstallerSession.readFromXml(in, mInternalCallback,
mContext, mPm, mInstallThread.getLooper(), mStagingManager,
mSessionsDir, this);
- currentSession = session;
} catch (Exception e) {
- currentSession = null;
Slog.e(TAG, "Could not read session", e);
continue;
}
@@ -347,10 +344,6 @@
addHistoricalSessionLocked(session);
}
mAllocatedSessions.put(session.sessionId, true);
- } else if (currentSession != null
- && PackageInstallerSession.TAG_CHILD_SESSION.equals(tag)) {
- currentSession.addChildSessionIdInternal(
- PackageInstallerSession.readChildSessionIdFromXml(in));
}
}
}
@@ -1132,6 +1125,7 @@
public void onStagedSessionChanged(PackageInstallerSession session) {
writeSessionsAsync();
+ // TODO(b/118865310): don't send broadcast if system is not ready.
mPm.sendSessionUpdatedBroadcast(session.generateInfo(false), session.userId);
}
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index 12d335d..b8825bb 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -992,8 +992,12 @@
// Read transfers from the original owner stay open, but as the session's data
// cannot be modified anymore, there is no leak of information. For staged sessions,
- // further validation may be performed by the staging manager.
+ // further validation is performed by the staging manager.
if (!params.isMultiPackage) {
+ if ((params.installFlags & PackageManager.INSTALL_APEX) != 0) {
+ // For APEX, validation is done by StagingManager post-commit.
+ return;
+ }
final PackageInfo pkgInfo = mPm.getPackageInfo(
params.appPackageName, PackageManager.GET_SIGNATURES
| PackageManager.MATCH_STATIC_SHARED_LIBRARIES /*flags*/, userId);
@@ -1001,16 +1005,7 @@
resolveStageDirLocked();
try {
- if ((params.installFlags & PackageManager.INSTALL_APEX) != 0) {
- // TODO(b/118865310): Remove this when APEX validation is done via
- // StagingManager.
- validateApexInstallLocked(pkgInfo);
- } else {
- // Verify that stage looks sane with respect to existing application.
- // This currently only ensures packageName, versionCode, and certificate
- // consistency.
- validateApkInstallLocked(pkgInfo);
- }
+ validateApkInstallLocked(pkgInfo);
} catch (PackageManagerException e) {
throw e;
} catch (Throwable e) {
@@ -1301,54 +1296,6 @@
(params.installFlags & PackageManager.DONT_KILL_APP) != 0;
}
- @GuardedBy("mLock")
- private void validateApexInstallLocked(@Nullable PackageInfo pkgInfo)
- throws PackageManagerException {
- mResolvedStagedFiles.clear();
- mResolvedInheritedFiles.clear();
-
- try {
- resolveStageDirLocked();
- } catch (IOException e) {
- throw new PackageManagerException(INSTALL_FAILED_CONTAINER_ERROR,
- "Failed to resolve stage location", e);
- }
-
- final File[] addedFiles = mResolvedStageDir.listFiles(sAddedFilter);
- if (ArrayUtils.isEmpty(addedFiles)) {
- throw new PackageManagerException(INSTALL_FAILED_INVALID_APK, "No packages staged");
- }
-
- if (addedFiles.length > 1) {
- throw new PackageManagerException(INSTALL_FAILED_INVALID_APK,
- "Only one APEX file at a time might be installed");
- }
- File addedFile = addedFiles[0];
- final ApkLite apk;
- try {
- apk = PackageParser.parseApkLite(
- addedFile, PackageParser.PARSE_COLLECT_CERTIFICATES);
- } catch (PackageParserException e) {
- throw PackageManagerException.from(e);
- }
-
- mPackageName = apk.packageName;
- mVersionCode = apk.getLongVersionCode();
- mSigningDetails = apk.signingDetails;
- mResolvedBaseFile = addedFile;
-
- // STOPSHIP: Ensure that we remove the non-staged version of APEX installs in production
- // because we currently do not verify that signatures are consistent with the previously
- // installed version in that case.
- //
- // When that happens, this hack can be reverted and we can rely on APEXd to map between
- // APEX files and their package names instead of parsing it out of the AndroidManifest
- // such as here.
- if (params.appPackageName == null) {
- params.appPackageName = mPackageName;
- }
- }
-
/**
* Validate install by confirming that all application packages are have
* consistent package name, version code, and signing certificates.
@@ -1911,22 +1858,30 @@
}
@Override
- public void addChildSessionId(int sessionId) {
- final PackageInstallerSession session = mSessionProvider.getSession(sessionId);
- if (session == null) {
+ public void addChildSessionId(int childSessionId) {
+ final PackageInstallerSession childSession = mSessionProvider.getSession(childSessionId);
+ if (childSession == null) {
throw new RemoteException("Unable to add child.",
- new PackageManagerException("Child session " + sessionId + " does not exist"),
+ new PackageManagerException("Child session " + childSessionId
+ + " does not exist"),
+ false, true).rethrowAsRuntimeException();
+ }
+ // Session groups must be consistent wrt to isStaged parameter. Non-staging session
+ // cannot be grouped with staging sessions.
+ if (this.params.isStaged ^ childSession.params.isStaged) {
+ throw new RemoteException("Unable to add child.",
+ new PackageManagerException("Child session " + childSessionId
+ + " and parent session " + this.sessionId + " do not have consistent"
+ + " staging session settings."),
false, true).rethrowAsRuntimeException();
}
synchronized (mLock) {
- final int indexOfSession = mChildSessionIds.indexOfKey(sessionId);
+ final int indexOfSession = mChildSessionIds.indexOfKey(childSessionId);
if (indexOfSession >= 0) {
return;
}
- session.setParentSessionId(this.sessionId);
- // TODO: sanity check, if parent session is staged then child session should be
- // marked as staged.
- addChildSessionIdInternal(sessionId);
+ childSession.setParentSessionId(this.sessionId);
+ addChildSessionIdInternal(childSessionId);
}
}
@@ -2057,6 +2012,11 @@
return mStagedSessionFailed;
}
+ /** {@hide} */
+ @StagedSessionErrorCode int getStagedSessionErrorCode() {
+ return mStagedSessionErrorCode;
+ }
+
private void destroyInternal() {
synchronized (mLock) {
mSealed = true;
@@ -2221,35 +2181,6 @@
out.endTag(null, TAG_SESSION);
}
- private static String[] readGrantedRuntimePermissions(XmlPullParser in)
- throws IOException, XmlPullParserException {
- List<String> permissions = null;
-
- final int outerDepth = in.getDepth();
- int type;
- while ((type = in.next()) != XmlPullParser.END_DOCUMENT
- && (type != XmlPullParser.END_TAG || in.getDepth() > outerDepth)) {
- if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
- continue;
- }
- if (TAG_GRANTED_RUNTIME_PERMISSION.equals(in.getName())) {
- String permission = readStringAttribute(in, ATTR_NAME);
- if (permissions == null) {
- permissions = new ArrayList<>();
- }
- permissions.add(permission);
- }
- }
-
- if (permissions == null) {
- return null;
- }
-
- String[] permissionsArray = new String[permissions.size()];
- permissions.toArray(permissionsArray);
- return permissionsArray;
- }
-
// Sanity check to be performed when the session is restored from an external file. Only one
// of the session states should be true, or none of them.
private static boolean isStagedSessionStateValid(boolean isReady, boolean isApplied,
@@ -2273,8 +2204,6 @@
* @param sessionProvider
* @return The newly created session
*/
- // TODO(patb,109941548): modify readFromXml to consume to the next tag session tag so we
- // can have a complete session for the constructor
public static PackageInstallerSession readFromXml(@NonNull XmlPullParser in,
@NonNull PackageInstallerService.InternalCallback callback, @NonNull Context context,
@NonNull PackageManagerService pm, Looper installerThread,
@@ -2314,8 +2243,6 @@
params.volumeUuid = readStringAttribute(in, ATTR_VOLUME_UUID);
params.installReason = readIntAttribute(in, ATTR_INSTALL_REASON);
- params.grantedRuntimePermissions = readGrantedRuntimePermissions(in);
-
final File appIconFile = buildAppIconFile(sessionId, sessionsDir);
if (appIconFile.exists()) {
params.appIcon = BitmapFactory.decodeFile(appIconFile.getAbsolutePath());
@@ -2324,16 +2251,51 @@
final boolean isReady = readBooleanAttribute(in, ATTR_IS_READY);
final boolean isFailed = readBooleanAttribute(in, ATTR_IS_FAILED);
final boolean isApplied = readBooleanAttribute(in, ATTR_IS_APPLIED);
- final int stagedSessionErrorCode = readIntAttribute(in, ATTR_STAGED_SESSION_ERROR_CODE);
+ final int stagedSessionErrorCode = readIntAttribute(in, ATTR_STAGED_SESSION_ERROR_CODE,
+ SessionInfo.NO_ERROR);
if (!isStagedSessionStateValid(isReady, isApplied, isFailed)) {
throw new IllegalArgumentException("Can't restore staged session with invalid state.");
}
+ // Parse sub tags of this session, typically used for repeated values / arrays.
+ // Sub tags can come in any order, therefore we need to keep track of what we find while
+ // parsing and only set the right values at the end.
+
+ // Store the current depth. We should stop parsing when we reach an end tag at the same
+ // depth.
+ List<String> permissions = new ArrayList<>();
+ List<Integer> childSessionIds = new ArrayList<>();
+ int outerDepth = in.getDepth();
+ int type;
+ while ((type = in.next()) != XmlPullParser.END_DOCUMENT
+ && (type != XmlPullParser.END_TAG || in.getDepth() > outerDepth)) {
+ if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
+ continue;
+ }
+ if (TAG_GRANTED_RUNTIME_PERMISSION.equals(in.getName())) {
+ permissions.add(readStringAttribute(in, ATTR_NAME));
+ }
+ if (TAG_CHILD_SESSION.equals(in.getName())) {
+ childSessionIds.add(readIntAttribute(in, ATTR_SESSION_ID, SessionInfo.INVALID_ID));
+ }
+ }
+
+ if (permissions.size() > 0) {
+ params.grantedRuntimePermissions = permissions.stream().toArray(String[]::new);
+ }
+
+ int[] childSessionIdsArray;
+ if (childSessionIds.size() > 0) {
+ childSessionIdsArray = childSessionIds.stream().mapToInt(i -> i).toArray();
+ } else {
+ childSessionIdsArray = EMPTY_CHILD_SESSION_ARRAY;
+ }
+
return new PackageInstallerSession(callback, context, pm, sessionProvider,
installerThread, stagingManager, sessionId, userId, installerPackageName,
installerUid, params, createdMillis, stageDir, stageCid, prepared, sealed,
- EMPTY_CHILD_SESSION_ARRAY, parentSessionId, isReady, isFailed, isApplied,
+ childSessionIdsArray, parentSessionId, isReady, isFailed, isApplied,
stagedSessionErrorCode);
}
diff --git a/services/core/java/com/android/server/pm/StagingManager.java b/services/core/java/com/android/server/pm/StagingManager.java
index 7bab0bb..5311c2a 100644
--- a/services/core/java/com/android/server/pm/StagingManager.java
+++ b/services/core/java/com/android/server/pm/StagingManager.java
@@ -41,7 +41,9 @@
import com.android.internal.os.BackgroundThread;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
+import java.util.stream.Collectors;
/**
* This class handles staged install sessions, i.e. install sessions that require packages to
@@ -126,12 +128,24 @@
return false;
}
- private static boolean submitSessionToApexService(int sessionId, ApexInfoList apexInfoList) {
+ private static boolean submitSessionToApexService(@NonNull PackageInstallerSession session,
+ List<PackageInstallerSession> childSessions,
+ ApexInfoList apexInfoList) {
+ return sendSubmitStagedSessionRequest(
+ session.sessionId,
+ childSessions != null
+ ? childSessions.stream().mapToInt(s -> s.sessionId).toArray() :
+ new int[]{},
+ apexInfoList);
+ }
+
+ private static boolean sendSubmitStagedSessionRequest(
+ int sessionId, int[] childSessionIds, ApexInfoList apexInfoList) {
final IApexService apex = IApexService.Stub.asInterface(
ServiceManager.getService("apexservice"));
boolean success;
try {
- success = apex.submitStagedSession(sessionId, new int[0], apexInfoList);
+ success = apex.submitStagedSession(sessionId, childSessionIds, apexInfoList);
} catch (RemoteException re) {
Slog.e(TAG, "Unable to contact apexservice", re);
return false;
@@ -139,31 +153,49 @@
return success;
}
+ private static boolean isApexSession(@NonNull PackageInstallerSession session) {
+ return (session.params.installFlags & PackageManager.INSTALL_APEX) != 0;
+ }
+
private void preRebootVerification(@NonNull PackageInstallerSession session) {
boolean success = true;
- if ((session.params.installFlags & PackageManager.INSTALL_APEX) != 0) {
- final ApexInfoList apexInfoList = new ApexInfoList();
+ final ApexInfoList apexInfoList = new ApexInfoList();
+ // APEX checks. For single-package sessions, check if they contain an APEX. For
+ // multi-package sessions, find all the child sessions that contain an APEX.
+ if (!session.isMultiPackage()
+ && isApexSession(session)) {
+ success = submitSessionToApexService(session, null, apexInfoList);
+ } else if (session.isMultiPackage()) {
+ List<PackageInstallerSession> childSessions =
+ Arrays.stream(session.getChildSessionIds())
+ // Retrieve cached sessions matching ids.
+ .mapToObj(i -> mStagedSessions.get(i))
+ // Filter only the ones containing APEX.
+ .filter(childSession -> isApexSession(childSession))
+ .collect(Collectors.toList());
+ if (!childSessions.isEmpty()) {
+ success = submitSessionToApexService(session, childSessions, apexInfoList);
+ } // else this is a staged multi-package session with no APEX files.
+ }
- if (!submitSessionToApexService(session.sessionId, apexInfoList)) {
- success = false;
- } else {
- // For APEXes, we validate the signature here before we mark the session as ready,
- // so we fail the session early if there is a signature mismatch. For APKs, the
- // signature verification will be done by the package manager at the point at which
- // it applies the staged install.
- //
- // TODO: Decide whether we want to fail fast by detecting signature mismatches right
- // away.
- for (ApexInfo apexPackage : apexInfoList.apexInfos) {
- if (!validateApexSignatureLocked(apexPackage.packagePath,
- apexPackage.packageName)) {
- success = false;
- break;
- }
+ if (success && (apexInfoList.apexInfos.length > 0)) {
+ // For APEXes, we validate the signature here before we mark the session as ready,
+ // so we fail the session early if there is a signature mismatch. For APKs, the
+ // signature verification will be done by the package manager at the point at which
+ // it applies the staged install.
+ //
+ // TODO: Decide whether we want to fail fast by detecting signature mismatches for APKs,
+ // right away.
+ for (ApexInfo apexPackage : apexInfoList.apexInfos) {
+ if (!validateApexSignatureLocked(apexPackage.packagePath,
+ apexPackage.packageName)) {
+ success = false;
+ break;
}
}
}
+
if (success) {
session.setStagedSessionReady();
} else {
@@ -206,15 +238,59 @@
}
}
- void abortSession(@NonNull PackageInstallerSession sessionInfo) {
- updateStoredSession(sessionInfo);
+ void abortSession(@NonNull PackageInstallerSession session) {
synchronized (mStagedSessions) {
- mStagedSessions.remove(sessionInfo.sessionId);
+ updateStoredSession(session);
+ mStagedSessions.remove(session.sessionId);
}
}
+ @GuardedBy("mStagedSessions")
+ private boolean isMultiPackageSessionComplete(@NonNull PackageInstallerSession session) {
+ // This method assumes that the argument is either a parent session of a multi-package
+ // i.e. isMultiPackage() returns true, or that it is a child session, i.e.
+ // hasParentSessionId() returns true.
+ if (session.isMultiPackage()) {
+ // Parent session of a multi-package group. Check that we restored all the children.
+ for (int childSession : session.getChildSessionIds()) {
+ if (mStagedSessions.get(childSession) == null) {
+ return false;
+ }
+ }
+ return true;
+ }
+ if (session.hasParentSessionId()) {
+ PackageInstallerSession parent = mStagedSessions.get(session.getParentSessionId());
+ if (parent == null) {
+ return false;
+ }
+ return isMultiPackageSessionComplete(parent);
+ }
+ Slog.wtf(TAG, "Attempting to restore an invalid multi-package session.");
+ return false;
+ }
+
void restoreSession(@NonNull PackageInstallerSession session) {
- updateStoredSession(session);
+ PackageInstallerSession sessionToResume = session;
+ synchronized (mStagedSessions) {
+ mStagedSessions.append(session.sessionId, session);
+ // For multi-package sessions, we don't know in which order they will be restored. We
+ // need to wait until we have restored all the session in a group before restoring them.
+ if (session.isMultiPackage() || session.hasParentSessionId()) {
+ if (!isMultiPackageSessionComplete(session)) {
+ // Still haven't recovered all sessions of the group, return.
+ return;
+ }
+ // Group recovered, find the parent if necessary and resume the installation.
+ if (session.hasParentSessionId()) {
+ sessionToResume = mStagedSessions.get(session.getParentSessionId());
+ }
+ }
+ }
+ checkStateAndResume(sessionToResume);
+ }
+
+ private void checkStateAndResume(@NonNull PackageInstallerSession session) {
// Check the state of the session and decide what to do next.
if (session.isStagedSessionFailed() || session.isStagedSessionApplied()) {
// Final states, nothing to do.
@@ -227,6 +303,8 @@
} else {
// Session had already being marked ready. Start the checks to verify if there is any
// follow-up work.
+ // TODO(b/118865310): should this be synchronous to ensure it completes before
+ // systemReady() finishes?
mBgHandler.post(() -> resumeSession(session));
}
}
diff --git a/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java b/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java
index d12f7ed..9df0f72 100644
--- a/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java
+++ b/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java
@@ -49,18 +49,9 @@
import com.android.server.LocalServices;
import com.android.server.pm.PackageManagerServiceUtils;
-import libcore.io.IoUtils;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
import java.io.File;
import java.io.IOException;
-import java.io.PrintWriter;
-import java.nio.file.Files;
import java.time.Instant;
-import java.time.format.DateTimeParseException;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.HashMap;
@@ -108,34 +99,7 @@
@GuardedBy("mLock")
private List<RollbackInfo> mRecentlyExecutedRollbacks;
- // Data for available rollbacks and recently executed rollbacks is
- // persisted in storage. Assuming the rollback data directory is
- // /data/rollback, we use the following directory structure
- // to store this data:
- // /data/rollback/
- // available/
- // XXX/
- // com.package.A/
- // base.apk
- // info.json
- // enabled.txt
- // YYY/
- // com.package.B/
- // base.apk
- // info.json
- // enabled.txt
- // recently_executed.json
- //
- // * XXX, YYY are random strings from Files.createTempDirectory
- // * info.json contains the package version to roll back from/to.
- // * enabled.txt contains a timestamp for when the rollback was first
- // made available. This file is not written until the rollback is made
- // available.
- //
- // TODO: Use AtomicFile for all the .json files?
- private final File mRollbackDataDir;
- private final File mAvailableRollbacksDir;
- private final File mRecentlyExecutedRollbacksFile;
+ private final RollbackStore mRollbackStore;
private final Context mContext;
private final HandlerThread mHandlerThread;
@@ -145,9 +109,7 @@
mHandlerThread = new HandlerThread("RollbackManagerServiceHandler");
mHandlerThread.start();
- mRollbackDataDir = new File(Environment.getDataDirectory(), "rollback");
- mAvailableRollbacksDir = new File(mRollbackDataDir, "available");
- mRecentlyExecutedRollbacksFile = new File(mRollbackDataDir, "recently_executed.json");
+ mRollbackStore = new RollbackStore(new File(Environment.getDataDirectory(), "rollback"));
// Kick off loading of the rollback data from strorage in a background
// thread.
@@ -357,8 +319,14 @@
PackageManager pm = context.getPackageManager();
try {
PackageInstaller packageInstaller = pm.getPackageInstaller();
+ String installerPackageName = pm.getInstallerPackageName(targetPackageName);
+ if (installerPackageName == null) {
+ sendFailure(statusReceiver, "Cannot find installer package");
+ return;
+ }
PackageInstaller.SessionParams parentParams = new PackageInstaller.SessionParams(
PackageInstaller.SessionParams.MODE_FULL_INSTALL);
+ parentParams.setInstallerPackageName(installerPackageName);
parentParams.setAllowDowngrade(true);
parentParams.setMultiPackage();
int parentSessionId = packageInstaller.createSession(parentParams);
@@ -367,6 +335,7 @@
for (PackageRollbackInfo info : data.packages) {
PackageInstaller.SessionParams params = new PackageInstaller.SessionParams(
PackageInstaller.SessionParams.MODE_FULL_INSTALL);
+ params.setInstallerPackageName(installerPackageName);
params.setAllowDowngrade(true);
int sessionId = packageInstaller.createSession(params);
PackageInstaller.Session session = packageInstaller.openSession(sessionId);
@@ -447,7 +416,7 @@
for (PackageRollbackInfo info : data.packages) {
if (info.packageName.equals(packageName)) {
iter.remove();
- removeFile(data.backupDir);
+ mRollbackStore.deleteAvailableRollback(data);
break;
}
}
@@ -474,87 +443,20 @@
@GuardedBy("mLock")
private void ensureRollbackDataLoadedLocked() {
if (mAvailableRollbacks == null) {
- loadRollbackDataLocked();
+ loadAllRollbackDataLocked();
}
}
/**
- * Load rollback data from storage.
+ * Load all rollback data from storage.
* Note: We do potentially heavy IO here while holding mLock, because we
* have to have the rollback data loaded before we can do anything else
* meaningful.
*/
@GuardedBy("mLock")
- private void loadRollbackDataLocked() {
- mAvailableRollbacksDir.mkdirs();
- mAvailableRollbacks = new ArrayList<>();
- for (File rollbackDir : mAvailableRollbacksDir.listFiles()) {
- File enabledFile = new File(rollbackDir, "enabled.txt");
- // TODO: Delete any directories without an enabled.txt? That could
- // potentially delete pending rollback data if reloadPersistedData
- // is called, though there's no reason besides testing for that to
- // be called.
- if (rollbackDir.isDirectory() && enabledFile.isFile()) {
- RollbackData data = new RollbackData(rollbackDir);
- try {
- PackageRollbackInfo info = null;
- for (File packageDir : rollbackDir.listFiles()) {
- if (packageDir.isDirectory()) {
- File jsonFile = new File(packageDir, "info.json");
- String jsonString = IoUtils.readFileAsString(
- jsonFile.getAbsolutePath());
- JSONObject jsonObject = new JSONObject(jsonString);
- String packageName = jsonObject.getString("packageName");
- long higherVersionCode = jsonObject.getLong("higherVersionCode");
- long lowerVersionCode = jsonObject.getLong("lowerVersionCode");
-
- data.packages.add(new PackageRollbackInfo(packageName,
- new PackageRollbackInfo.PackageVersion(higherVersionCode),
- new PackageRollbackInfo.PackageVersion(lowerVersionCode)));
- }
- }
-
- if (data.packages.isEmpty()) {
- throw new IOException("No package rollback info found");
- }
-
- String enabledString = IoUtils.readFileAsString(enabledFile.getAbsolutePath());
- data.timestamp = Instant.parse(enabledString.trim());
- mAvailableRollbacks.add(data);
- } catch (IOException | JSONException | DateTimeParseException e) {
- Log.e(TAG, "Unable to read rollback data at " + rollbackDir, e);
- removeFile(rollbackDir);
- }
- }
- }
-
- mRecentlyExecutedRollbacks = new ArrayList<>();
- if (mRecentlyExecutedRollbacksFile.exists()) {
- try {
- // TODO: How to cope with changes to the format of this file from
- // when RollbackStore is updated in the future?
- String jsonString = IoUtils.readFileAsString(
- mRecentlyExecutedRollbacksFile.getAbsolutePath());
- JSONObject object = new JSONObject(jsonString);
- JSONArray array = object.getJSONArray("recentlyExecuted");
- for (int i = 0; i < array.length(); ++i) {
- JSONObject element = array.getJSONObject(i);
- String packageName = element.getString("packageName");
- long higherVersionCode = element.getLong("higherVersionCode");
- long lowerVersionCode = element.getLong("lowerVersionCode");
- PackageRollbackInfo target = new PackageRollbackInfo(packageName,
- new PackageRollbackInfo.PackageVersion(higherVersionCode),
- new PackageRollbackInfo.PackageVersion(lowerVersionCode));
- RollbackInfo rollback = new RollbackInfo(target);
- mRecentlyExecutedRollbacks.add(rollback);
- }
- } catch (IOException | JSONException e) {
- // TODO: What to do here? Surely we shouldn't just forget about
- // everything after the point of exception?
- Log.e(TAG, "Failed to read recently executed rollbacks", e);
- }
- }
-
+ private void loadAllRollbackDataLocked() {
+ mAvailableRollbacks = mRollbackStore.loadAvailableRollbacks();
+ mRecentlyExecutedRollbacks = mRollbackStore.loadRecentlyExecutedRollbacks();
scheduleExpiration(0);
}
@@ -578,7 +480,7 @@
if (info.packageName.equals(packageName)
&& !info.higherVersion.equals(installedVersion)) {
iter.remove();
- removeFile(data.backupDir);
+ mRollbackStore.deleteAvailableRollback(data);
break;
}
}
@@ -606,42 +508,12 @@
}
if (changed) {
- saveRecentlyExecutedRollbacksLocked();
+ mRollbackStore.saveRecentlyExecutedRollbacks(mRecentlyExecutedRollbacks);
}
}
}
/**
- * Write the list of recently executed rollbacks to storage.
- * Note: This happens while mLock is held, which should be okay because we
- * expect executed rollbacks to be modified only in exceptional cases.
- */
- @GuardedBy("mLock")
- private void saveRecentlyExecutedRollbacksLocked() {
- try {
- JSONObject json = new JSONObject();
- JSONArray array = new JSONArray();
- json.put("recentlyExecuted", array);
-
- for (int i = 0; i < mRecentlyExecutedRollbacks.size(); ++i) {
- RollbackInfo rollback = mRecentlyExecutedRollbacks.get(i);
- JSONObject element = new JSONObject();
- element.put("packageName", rollback.targetPackage.packageName);
- element.put("higherVersionCode", rollback.targetPackage.higherVersion.versionCode);
- element.put("lowerVersionCode", rollback.targetPackage.lowerVersion.versionCode);
- array.put(element);
- }
-
- PrintWriter pw = new PrintWriter(mRecentlyExecutedRollbacksFile);
- pw.println(json.toString());
- pw.close();
- } catch (IOException | JSONException e) {
- // TODO: What to do here?
- Log.e(TAG, "Failed to save recently executed rollbacks", e);
- }
- }
-
- /**
* Records that the given package has been recently rolled back.
*/
private void addRecentlyExecutedRollback(RollbackInfo rollback) {
@@ -650,7 +522,7 @@
synchronized (mLock) {
ensureRollbackDataLoadedLocked();
mRecentlyExecutedRollbacks.add(rollback);
- saveRecentlyExecutedRollbacksLocked();
+ mRollbackStore.saveRecentlyExecutedRollbacks(mRecentlyExecutedRollbacks);
}
}
@@ -701,7 +573,7 @@
RollbackData data = iter.next();
if (!now.isBefore(data.timestamp.plusMillis(ROLLBACK_LIFETIME_DURATION_MILLIS))) {
iter.remove();
- removeFile(data.backupDir);
+ mRollbackStore.deleteAvailableRollback(data);
} else if (oldest == null || oldest.isAfter(data.timestamp)) {
oldest = data.timestamp;
}
@@ -827,9 +699,7 @@
mChildSessions.put(childSessionId, parentSessionId);
data = mPendingRollbacks.get(parentSessionId);
if (data == null) {
- File backupDir = Files.createTempDirectory(
- mAvailableRollbacksDir.toPath(), null).toFile();
- data = new RollbackData(backupDir);
+ data = mRollbackStore.createAvailableRollback();
mPendingRollbacks.put(parentSessionId, data);
}
data.packages.add(info);
@@ -839,29 +709,13 @@
return false;
}
- File packageDir = new File(data.backupDir, packageName);
+ File packageDir = mRollbackStore.packageCodePathForAvailableRollback(data, packageName);
packageDir.mkdirs();
- try {
- JSONObject json = new JSONObject();
- json.put("packageName", packageName);
- json.put("higherVersionCode", newVersion.versionCode);
- json.put("lowerVersionCode", installedVersion.versionCode);
-
- File jsonFile = new File(packageDir, "info.json");
- PrintWriter pw = new PrintWriter(jsonFile);
- pw.println(json.toString());
- pw.close();
- } catch (IOException | JSONException e) {
- Log.e(TAG, "Unable to create rollback for " + packageName, e);
- removeFile(packageDir);
- return false;
- }
// TODO: Copy by hard link instead to save on cpu and storage space?
int status = PackageManagerServiceUtils.copyPackage(installedPackage.codePath, packageDir);
if (status != PackageManager.INSTALL_SUCCEEDED) {
Log.e(TAG, "Unable to copy package for rollback for " + packageName);
- removeFile(packageDir);
return false;
}
@@ -898,22 +752,6 @@
}
/**
- * Deletes a file completely.
- * If the file is a directory, its contents are deleted as well.
- * Has no effect if the directory does not exist.
- */
- private void removeFile(File file) {
- if (file.isDirectory()) {
- for (File child : file.listFiles()) {
- removeFile(child);
- }
- }
- if (file.exists()) {
- file.delete();
- }
- }
-
- /**
* Gets the version of the package currently installed.
* Returns null if the package is not currently installed.
*/
@@ -958,11 +796,8 @@
if (success) {
try {
data.timestamp = Instant.now();
- File enabledFile = new File(data.backupDir, "enabled.txt");
- PrintWriter pw = new PrintWriter(enabledFile);
- pw.println(data.timestamp.toString());
- pw.close();
+ mRollbackStore.saveAvailableRollback(data);
synchronized (mLock) {
// Note: There is a small window of time between when
// the session has been committed by the package
@@ -981,12 +816,12 @@
scheduleExpiration(ROLLBACK_LIFETIME_DURATION_MILLIS);
} catch (IOException e) {
Log.e(TAG, "Unable to enable rollback", e);
- removeFile(data.backupDir);
+ mRollbackStore.deleteAvailableRollback(data);
}
} else {
// The install session was aborted, clean up the pending
// install.
- removeFile(data.backupDir);
+ mRollbackStore.deleteAvailableRollback(data);
}
}
}
diff --git a/services/core/java/com/android/server/rollback/RollbackStore.java b/services/core/java/com/android/server/rollback/RollbackStore.java
new file mode 100644
index 0000000..f9a838f
--- /dev/null
+++ b/services/core/java/com/android/server/rollback/RollbackStore.java
@@ -0,0 +1,254 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.rollback;
+
+import android.content.rollback.PackageRollbackInfo;
+import android.content.rollback.RollbackInfo;
+import android.util.Log;
+
+import libcore.io.IoUtils;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.nio.file.Files;
+import java.time.Instant;
+import java.time.format.DateTimeParseException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Helper class for loading and saving rollback data to persistent storage.
+ */
+class RollbackStore {
+ private static final String TAG = "RollbackManager";
+
+ // Assuming the rollback data directory is /data/rollback, we use the
+ // following directory structure to store persisted data for available and
+ // recently executed rollbacks:
+ // /data/rollback/
+ // available/
+ // XXX/
+ // rollback.json
+ // com.package.A/
+ // base.apk
+ // com.package.B/
+ // base.apk
+ // YYY/
+ // rollback.json
+ // com.package.C/
+ // base.apk
+ // recently_executed.json
+ //
+ // * XXX, YYY are random strings from Files.createTempDirectory
+ // * rollback.json contains all relevant metadata for the rollback. This
+ // file is not written until the rollback is made available.
+ //
+ // TODO: Use AtomicFile for all the .json files?
+ private final File mRollbackDataDir;
+ private final File mAvailableRollbacksDir;
+ private final File mRecentlyExecutedRollbacksFile;
+
+ RollbackStore(File rollbackDataDir) {
+ mRollbackDataDir = rollbackDataDir;
+ mAvailableRollbacksDir = new File(mRollbackDataDir, "available");
+ mRecentlyExecutedRollbacksFile = new File(mRollbackDataDir, "recently_executed.json");
+ }
+
+ /**
+ * Reads the list of available rollbacks from persistent storage.
+ */
+ List<RollbackData> loadAvailableRollbacks() {
+ List<RollbackData> availableRollbacks = new ArrayList<>();
+ mAvailableRollbacksDir.mkdirs();
+ for (File rollbackDir : mAvailableRollbacksDir.listFiles()) {
+ if (rollbackDir.isDirectory()) {
+ try {
+ RollbackData data = loadRollbackData(rollbackDir);
+ availableRollbacks.add(data);
+ } catch (IOException e) {
+ // Note: Deleting the rollbackDir here will cause pending
+ // rollbacks to be deleted. This should only ever happen
+ // if reloadPersistedData is called while there are
+ // pending rollbacks. The reloadPersistedData method is
+ // currently only for testing, so that should be okay.
+ Log.e(TAG, "Unable to read rollback data at " + rollbackDir, e);
+ removeFile(rollbackDir);
+ }
+ }
+ }
+ return availableRollbacks;
+ }
+
+ /**
+ * Reads the list of recently executed rollbacks from persistent storage.
+ */
+ List<RollbackInfo> loadRecentlyExecutedRollbacks() {
+ List<RollbackInfo> recentlyExecutedRollbacks = new ArrayList<>();
+ if (mRecentlyExecutedRollbacksFile.exists()) {
+ try {
+ // TODO: How to cope with changes to the format of this file from
+ // when RollbackStore is updated in the future?
+ String jsonString = IoUtils.readFileAsString(
+ mRecentlyExecutedRollbacksFile.getAbsolutePath());
+ JSONObject object = new JSONObject(jsonString);
+ JSONArray array = object.getJSONArray("recentlyExecuted");
+ for (int i = 0; i < array.length(); ++i) {
+ JSONObject element = array.getJSONObject(i);
+ String packageName = element.getString("packageName");
+ long higherVersionCode = element.getLong("higherVersionCode");
+ long lowerVersionCode = element.getLong("lowerVersionCode");
+ PackageRollbackInfo target = new PackageRollbackInfo(packageName,
+ new PackageRollbackInfo.PackageVersion(higherVersionCode),
+ new PackageRollbackInfo.PackageVersion(lowerVersionCode));
+ RollbackInfo rollback = new RollbackInfo(target);
+ recentlyExecutedRollbacks.add(rollback);
+ }
+ } catch (IOException | JSONException e) {
+ // TODO: What to do here? Surely we shouldn't just forget about
+ // everything after the point of exception?
+ Log.e(TAG, "Failed to read recently executed rollbacks", e);
+ }
+ }
+
+ return recentlyExecutedRollbacks;
+ }
+
+ /**
+ * Creates a new RollbackData instance with backupDir assigned.
+ */
+ RollbackData createAvailableRollback() throws IOException {
+ File backupDir = Files.createTempDirectory(mAvailableRollbacksDir.toPath(), null).toFile();
+ return new RollbackData(backupDir);
+ }
+
+ /**
+ * Returns the directory where the code for a package should be stored for
+ * given rollback <code>data</code> and <code>packageName</code>.
+ */
+ File packageCodePathForAvailableRollback(RollbackData data, String packageName) {
+ return new File(data.backupDir, packageName);
+ }
+
+ /**
+ * Writes the metadata for an available rollback to persistent storage.
+ */
+ void saveAvailableRollback(RollbackData data) throws IOException {
+ try {
+ JSONObject dataJson = new JSONObject();
+ JSONArray packagesJson = new JSONArray();
+ for (PackageRollbackInfo info : data.packages) {
+ JSONObject infoJson = new JSONObject();
+ infoJson.put("packageName", info.packageName);
+ infoJson.put("higherVersionCode", info.higherVersion.versionCode);
+ infoJson.put("lowerVersionCode", info.lowerVersion.versionCode);
+ packagesJson.put(infoJson);
+ }
+ dataJson.put("packages", packagesJson);
+ dataJson.put("timestamp", data.timestamp.toString());
+
+ PrintWriter pw = new PrintWriter(new File(data.backupDir, "rollback.json"));
+ pw.println(dataJson.toString());
+ pw.close();
+ } catch (JSONException e) {
+ throw new IOException(e);
+ }
+ }
+
+ /**
+ * Removes all persistant storage associated with the given available
+ * rollback.
+ */
+ void deleteAvailableRollback(RollbackData data) {
+ removeFile(data.backupDir);
+ }
+
+ /**
+ * Writes the list of recently executed rollbacks to storage.
+ */
+ void saveRecentlyExecutedRollbacks(List<RollbackInfo> recentlyExecutedRollbacks) {
+ try {
+ JSONObject json = new JSONObject();
+ JSONArray array = new JSONArray();
+ json.put("recentlyExecuted", array);
+
+ for (int i = 0; i < recentlyExecutedRollbacks.size(); ++i) {
+ RollbackInfo rollback = recentlyExecutedRollbacks.get(i);
+ JSONObject element = new JSONObject();
+ element.put("packageName", rollback.targetPackage.packageName);
+ element.put("higherVersionCode", rollback.targetPackage.higherVersion.versionCode);
+ element.put("lowerVersionCode", rollback.targetPackage.lowerVersion.versionCode);
+ array.put(element);
+ }
+
+ PrintWriter pw = new PrintWriter(mRecentlyExecutedRollbacksFile);
+ pw.println(json.toString());
+ pw.close();
+ } catch (IOException | JSONException e) {
+ // TODO: What to do here?
+ Log.e(TAG, "Failed to save recently executed rollbacks", e);
+ }
+ }
+
+ /**
+ * Reads the metadata for a rollback from the given directory.
+ * @throws IOException in case of error reading the data.
+ */
+ private RollbackData loadRollbackData(File backupDir) throws IOException {
+ try {
+ RollbackData data = new RollbackData(backupDir);
+ File rollbackJsonFile = new File(backupDir, "rollback.json");
+ JSONObject dataJson = new JSONObject(
+ IoUtils.readFileAsString(rollbackJsonFile.getAbsolutePath()));
+ JSONArray packagesJson = dataJson.getJSONArray("packages");
+ for (int i = 0; i < packagesJson.length(); ++i) {
+ JSONObject infoJson = packagesJson.getJSONObject(i);
+ String packageName = infoJson.getString("packageName");
+ long higherVersionCode = infoJson.getLong("higherVersionCode");
+ long lowerVersionCode = infoJson.getLong("lowerVersionCode");
+ data.packages.add(new PackageRollbackInfo(packageName,
+ new PackageRollbackInfo.PackageVersion(higherVersionCode),
+ new PackageRollbackInfo.PackageVersion(lowerVersionCode)));
+ }
+
+ data.timestamp = Instant.parse(dataJson.getString("timestamp"));
+ return data;
+ } catch (JSONException | DateTimeParseException e) {
+ throw new IOException(e);
+ }
+ }
+
+ /**
+ * Deletes a file completely.
+ * If the file is a directory, its contents are deleted as well.
+ * Has no effect if the directory does not exist.
+ */
+ private void removeFile(File file) {
+ if (file.isDirectory()) {
+ for (File child : file.listFiles()) {
+ removeFile(child);
+ }
+ }
+ if (file.exists()) {
+ file.delete();
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/stats/StatsCompanionService.java b/services/core/java/com/android/server/stats/StatsCompanionService.java
index 4e71a05..40664fe 100644
--- a/services/core/java/com/android/server/stats/StatsCompanionService.java
+++ b/services/core/java/com/android/server/stats/StatsCompanionService.java
@@ -96,10 +96,10 @@
import com.android.internal.os.BinderCallsStats.ExportedCallStat;
import com.android.internal.os.KernelCpuSpeedReader;
import com.android.internal.os.KernelCpuThreadReader;
-import com.android.internal.os.KernelUidCpuActiveTimeReader;
-import com.android.internal.os.KernelUidCpuClusterTimeReader;
-import com.android.internal.os.KernelUidCpuFreqTimeReader;
-import com.android.internal.os.KernelUidCpuTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidActiveTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidClusterTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidFreqTimeReader;
+import com.android.internal.os.KernelCpuUidTimeReader.KernelCpuUidUserSysTimeReader;
import com.android.internal.os.KernelWakelockReader;
import com.android.internal.os.KernelWakelockStats;
import com.android.internal.os.LooperStats;
@@ -231,14 +231,16 @@
private final HashMap<Long, String> mDeletedFiles = new HashMap<>();
private final CompanionHandler mHandler;
- private KernelUidCpuTimeReader mKernelUidCpuTimeReader = new KernelUidCpuTimeReader();
+ // Disables throttler on CPU time readers.
+ private KernelCpuUidUserSysTimeReader mCpuUidUserSysTimeReader =
+ new KernelCpuUidUserSysTimeReader(false);
private KernelCpuSpeedReader[] mKernelCpuSpeedReaders;
- private KernelUidCpuFreqTimeReader mKernelUidCpuFreqTimeReader =
- new KernelUidCpuFreqTimeReader();
- private KernelUidCpuActiveTimeReader mKernelUidCpuActiveTimeReader =
- new KernelUidCpuActiveTimeReader();
- private KernelUidCpuClusterTimeReader mKernelUidCpuClusterTimeReader =
- new KernelUidCpuClusterTimeReader();
+ private KernelCpuUidFreqTimeReader mCpuUidFreqTimeReader =
+ new KernelCpuUidFreqTimeReader(false);
+ private KernelCpuUidActiveTimeReader mCpuUidActiveTimeReader =
+ new KernelCpuUidActiveTimeReader(false);
+ private KernelCpuUidClusterTimeReader mCpuUidClusterTimeReader =
+ new KernelCpuUidClusterTimeReader(false);
private StoragedUidIoStatsReader mStoragedUidIoStatsReader =
new StoragedUidIoStatsReader();
@Nullable
@@ -294,12 +296,6 @@
numSpeedSteps);
firstCpuOfCluster += powerProfile.getNumCoresInCpuCluster(i);
}
- // use default throttling in
- // frameworks/base/core/java/com/android/internal/os/KernelCpuProcReader
- mKernelUidCpuFreqTimeReader.setThrottleInterval(0);
- long[] freqs = mKernelUidCpuFreqTimeReader.readFreqs(powerProfile);
- mKernelUidCpuClusterTimeReader.setThrottleInterval(0);
- mKernelUidCpuActiveTimeReader.setThrottleInterval(0);
// Enable push notifications of throttling from vendor thermal
// management subsystem via thermalservice.
@@ -914,7 +910,8 @@
private void pullKernelUidCpuTime(
int tagId, long elapsedNanos, long wallClockNanos,
List<StatsLogEventWrapper> pulledData) {
- mKernelUidCpuTimeReader.readAbsolute((uid, userTimeUs, systemTimeUs) -> {
+ mCpuUidUserSysTimeReader.readAbsolute((uid, timesUs) -> {
+ long userTimeUs = timesUs[0], systemTimeUs = timesUs[1];
StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, elapsedNanos, wallClockNanos);
e.writeInt(uid);
e.writeLong(userTimeUs);
@@ -926,7 +923,7 @@
private void pullKernelUidCpuFreqTime(
int tagId, long elapsedNanos, long wallClockNanos,
List<StatsLogEventWrapper> pulledData) {
- mKernelUidCpuFreqTimeReader.readAbsolute((uid, cpuFreqTimeMs) -> {
+ mCpuUidFreqTimeReader.readAbsolute((uid, cpuFreqTimeMs) -> {
for (int freqIndex = 0; freqIndex < cpuFreqTimeMs.length; ++freqIndex) {
if (cpuFreqTimeMs[freqIndex] != 0) {
StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, elapsedNanos,
@@ -943,7 +940,7 @@
private void pullKernelUidCpuClusterTime(
int tagId, long elapsedNanos, long wallClockNanos,
List<StatsLogEventWrapper> pulledData) {
- mKernelUidCpuClusterTimeReader.readAbsolute((uid, cpuClusterTimesMs) -> {
+ mCpuUidClusterTimeReader.readAbsolute((uid, cpuClusterTimesMs) -> {
for (int i = 0; i < cpuClusterTimesMs.length; i++) {
StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, elapsedNanos,
wallClockNanos);
@@ -958,7 +955,7 @@
private void pullKernelUidCpuActiveTime(
int tagId, long elapsedNanos, long wallClockNanos,
List<StatsLogEventWrapper> pulledData) {
- mKernelUidCpuActiveTimeReader.readAbsolute((uid, cpuActiveTimesMs) -> {
+ mCpuUidActiveTimeReader.readAbsolute((uid, cpuActiveTimesMs) -> {
StatsLogEventWrapper e = new StatsLogEventWrapper(tagId, elapsedNanos, wallClockNanos);
e.writeInt(uid);
e.writeLong((long) cpuActiveTimesMs);
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index 7c1e619..8d2bab4 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -1219,13 +1219,13 @@
}
@Override
- public void onNotificationExpansionChanged(String key, boolean userAction,
- boolean expanded) throws RemoteException {
+ public void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded,
+ int location) throws RemoteException {
enforceStatusBarService();
long identity = Binder.clearCallingIdentity();
try {
mNotificationDelegate.onNotificationExpansionChanged(
- key, userAction, expanded);
+ key, userAction, expanded, location);
} finally {
Binder.restoreCallingIdentity(identity);
}
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index 780eda49..711ca00 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -1975,7 +1975,7 @@
} else if (newTask || !processRunning || (taskSwitch && !activityCreated)) {
return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
} else if (taskSwitch && allowTaskSnapshot) {
- if (mWmService.mLowRamTaskSnapshots) {
+ if (mWmService.mLowRamTaskSnapshotsAndRecents) {
// For low RAM devices, we use the splash screen starting window instead of the
// task snapshot starting window.
return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 6527ca0..8026a04 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -30,11 +30,14 @@
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.FLAG_PRIVATE;
import static android.view.InsetsState.TYPE_IME;
+import static android.view.InsetsState.TYPE_NAVIGATION_BAR;
+import static android.view.InsetsState.TYPE_TOP_BAR;
import static android.view.Surface.ROTATION_0;
import static android.view.Surface.ROTATION_180;
import static android.view.Surface.ROTATION_270;
import static android.view.Surface.ROTATION_90;
import static android.view.View.GONE;
+import static android.view.ViewRootImpl.NEW_INSETS_MODE_FULL;
import static android.view.WindowManager.DOCKED_BOTTOM;
import static android.view.WindowManager.DOCKED_INVALID;
import static android.view.WindowManager.DOCKED_TOP;
@@ -164,6 +167,7 @@
import android.view.SurfaceControl.Transaction;
import android.view.SurfaceSession;
import android.view.View;
+import android.view.ViewRootImpl;
import android.view.WindowManager;
import android.view.WindowManagerPolicyConstants.PointerEventListener;
@@ -1051,6 +1055,11 @@
*/
void setInsetProvider(@InternalInsetType int type, WindowState win,
@Nullable TriConsumer<DisplayFrames, WindowState, Rect> frameProvider) {
+ if (ViewRootImpl.sNewInsetsMode != NEW_INSETS_MODE_FULL) {
+ if (type == TYPE_TOP_BAR || type == TYPE_NAVIGATION_BAR) {
+ return;
+ }
+ }
mInsetsStateController.getSourceProvider(type).setWindow(win, frameProvider);
}
diff --git a/services/core/java/com/android/server/wm/InsetsSourceProvider.java b/services/core/java/com/android/server/wm/InsetsSourceProvider.java
index d6f1616..e49e4c0 100644
--- a/services/core/java/com/android/server/wm/InsetsSourceProvider.java
+++ b/services/core/java/com/android/server/wm/InsetsSourceProvider.java
@@ -16,6 +16,8 @@
package com.android.server.wm;
+import static android.view.ViewRootImpl.NEW_INSETS_MODE_NONE;
+
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.graphics.Rect;
@@ -159,7 +161,7 @@
}
boolean isClientVisible() {
- return !ViewRootImpl.USE_NEW_INSETS || mClientVisible;
+ return ViewRootImpl.sNewInsetsMode == NEW_INSETS_MODE_NONE || mClientVisible;
}
private class ControlAdapter implements AnimationAdapter {
diff --git a/services/core/java/com/android/server/wm/InsetsStateController.java b/services/core/java/com/android/server/wm/InsetsStateController.java
index bc01f7c..32dbe96 100644
--- a/services/core/java/com/android/server/wm/InsetsStateController.java
+++ b/services/core/java/com/android/server/wm/InsetsStateController.java
@@ -19,6 +19,9 @@
import static android.view.InsetsState.TYPE_IME;
import static android.view.InsetsState.TYPE_NAVIGATION_BAR;
import static android.view.InsetsState.TYPE_TOP_BAR;
+import static android.view.ViewRootImpl.NEW_INSETS_MODE_FULL;
+import static android.view.ViewRootImpl.NEW_INSETS_MODE_NONE;
+import static android.view.ViewRootImpl.sNewInsetsMode;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -160,7 +163,7 @@
}
private void onControlChanged(int type, @Nullable WindowState win) {
- if (!ViewRootImpl.USE_NEW_INSETS) {
+ if (sNewInsetsMode == NEW_INSETS_MODE_NONE) {
return;
}
final WindowState previous = mTypeWinControlMap.get(type);
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotController.java b/services/core/java/com/android/server/wm/TaskSnapshotController.java
index 01a5622..beb3d82 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotController.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotController.java
@@ -17,7 +17,6 @@
package com.android.server.wm;
import static com.android.server.wm.TaskSnapshotPersister.DISABLE_FULL_SIZED_BITMAPS;
-import static com.android.server.wm.TaskSnapshotPersister.REDUCED_SCALE;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_SCREENSHOT;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
@@ -90,9 +89,8 @@
private final WindowManagerService mService;
private final TaskSnapshotCache mCache;
- private final TaskSnapshotPersister mPersister = new TaskSnapshotPersister(
- Environment::getDataSystemCeDirectory);
- private final TaskSnapshotLoader mLoader = new TaskSnapshotLoader(mPersister);
+ private final TaskSnapshotPersister mPersister;
+ private final TaskSnapshotLoader mLoader;
private final ArraySet<Task> mSkipClosingAppSnapshotTasks = new ArraySet<>();
private final ArraySet<Task> mTmpTasks = new ArraySet<>();
private final Handler mHandler = new Handler();
@@ -116,6 +114,8 @@
TaskSnapshotController(WindowManagerService service) {
mService = service;
+ mPersister = new TaskSnapshotPersister(mService, Environment::getDataSystemCeDirectory);
+ mLoader = new TaskSnapshotLoader(mPersister);
mCache = new TaskSnapshotCache(mService, mLoader);
mIsRunningOnTv = mService.mContext.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_LEANBACK);
@@ -270,7 +270,7 @@
}
final boolean isLowRamDevice = ActivityManager.isLowRamDeviceStatic();
- final float scaleFraction = isLowRamDevice ? REDUCED_SCALE : 1f;
+ final float scaleFraction = isLowRamDevice ? mPersister.getReducedScale() : 1f;
task.getBounds(mTmpRect);
mTmpRect.offsetTo(0, 0);
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotLoader.java b/services/core/java/com/android/server/wm/TaskSnapshotLoader.java
index 0e1570b..d30843b 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotLoader.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotLoader.java
@@ -16,7 +16,6 @@
package com.android.server.wm;
-import static com.android.server.wm.TaskSnapshotPersister.*;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
@@ -92,7 +91,7 @@
proto.topActivityComponent);
return new TaskSnapshot(topActivityComponent, buffer, proto.orientation,
new Rect(proto.insetLeft, proto.insetTop, proto.insetRight, proto.insetBottom),
- reducedResolution, reducedResolution ? REDUCED_SCALE : 1f,
+ reducedResolution, reducedResolution ? mPersister.getReducedScale() : 1f,
proto.isRealSnapshot, proto.windowingMode, proto.systemUiVisibility,
proto.isTranslucent);
} catch (IOException e) {
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotPersister.java b/services/core/java/com/android/server/wm/TaskSnapshotPersister.java
index 24b5b61..e6d646c 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotPersister.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotPersister.java
@@ -52,7 +52,9 @@
private static final String TAG = TAG_WITH_CLASS_NAME ? "TaskSnapshotPersister" : TAG_WM;
private static final String SNAPSHOTS_DIRNAME = "snapshots";
private static final String REDUCED_POSTFIX = "_reduced";
- static final float REDUCED_SCALE = ActivityManager.isLowRamDeviceStatic() ? 0.6f : 0.5f;
+ private static final float REDUCED_SCALE = .5f;
+ private static final float LOW_RAM_REDUCED_SCALE = .6f;
+ private static final float LOW_RAM_RECENTS_REDUCED_SCALE = .1f;
static final boolean DISABLE_FULL_SIZED_BITMAPS = ActivityManager.isLowRamDeviceStatic();
private static final long DELAY_MS = 100;
private static final int QUALITY = 95;
@@ -71,6 +73,7 @@
private boolean mStarted;
private final Object mLock = new Object();
private final DirectoryResolver mDirectoryResolver;
+ private final float mReducedScale;
/**
* The list of ids of the tasks that have been persisted since {@link #removeObsoleteFiles} was
@@ -79,8 +82,16 @@
@GuardedBy("mLock")
private final ArraySet<Integer> mPersistedTaskIdsSinceLastRemoveObsolete = new ArraySet<>();
- TaskSnapshotPersister(DirectoryResolver resolver) {
+ TaskSnapshotPersister(WindowManagerService service, DirectoryResolver resolver) {
mDirectoryResolver = resolver;
+ if (service.mLowRamTaskSnapshotsAndRecents) {
+ // Use very low res snapshots if we are using Go version of recents.
+ mReducedScale = LOW_RAM_RECENTS_REDUCED_SCALE;
+ } else {
+ // TODO(122671846) Replace the low RAM value scale with the above when it is fully built
+ mReducedScale = ActivityManager.isLowRamDeviceStatic()
+ ? LOW_RAM_REDUCED_SCALE : REDUCED_SCALE;
+ }
}
/**
@@ -144,6 +155,15 @@
}
}
+ /**
+ * Gets the scaling the persister uses for low resolution task snapshots.
+ *
+ * @return the reduced scale of task snapshots when they are set to be low res
+ */
+ float getReducedScale() {
+ return mReducedScale;
+ }
+
@TestApi
void waitForQueueEmpty() {
while (true) {
@@ -350,8 +370,8 @@
final Bitmap reduced = mSnapshot.isReducedResolution()
? swBitmap
: Bitmap.createScaledBitmap(swBitmap,
- (int) (bitmap.getWidth() * REDUCED_SCALE),
- (int) (bitmap.getHeight() * REDUCED_SCALE), true /* filter */);
+ (int) (bitmap.getWidth() * mReducedScale),
+ (int) (bitmap.getHeight() * mReducedScale), true /* filter */);
try {
FileOutputStream reducedFos = new FileOutputStream(reducedFile);
reduced.compress(JPEG, QUALITY, reducedFos);
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index fda7a85..efb38f5 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -433,11 +433,12 @@
final long mDrawLockTimeoutMillis;
final boolean mAllowAnimationsInLowPowerMode;
+ // TODO(b/122671846) Remove the flag below in favor of isLowRam once feature is stable
/**
* Use very low resolution task snapshots. Replaces task snapshot starting windows with
* splashscreen starting windows. Used on low RAM devices to save memory.
*/
- final boolean mLowRamTaskSnapshots;
+ final boolean mLowRamTaskSnapshotsAndRecents;
final boolean mAllowBootMessages;
@@ -955,7 +956,7 @@
com.android.internal.R.bool.config_disableTransitionAnimation);
mPerDisplayFocusEnabled = context.getResources().getBoolean(
com.android.internal.R.bool.config_perDisplayFocusEnabled);
- mLowRamTaskSnapshots = context.getResources().getBoolean(
+ mLowRamTaskSnapshotsAndRecents = context.getResources().getBoolean(
com.android.internal.R.bool.config_lowRamTaskSnapshotsAndRecents);
mInputManager = inputManager; // Must be before createDisplayContentLocked.
mDisplayManagerInternal = LocalServices.getService(DisplayManagerInternal.class);
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index f8e24ff..0977323 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -7656,18 +7656,7 @@
}
// Shutting down backup manager service permanently.
- long ident = mInjector.binderClearCallingIdentity();
- try {
- if (mInjector.getIBackupManager() != null) {
- mInjector.getIBackupManager()
- .setBackupServiceActive(UserHandle.USER_SYSTEM, false);
- }
- } catch (RemoteException e) {
- throw new IllegalStateException("Failed deactivating backup service.", e);
- } finally {
- mInjector.binderRestoreCallingIdentity(ident);
- }
-
+ toggleBackupServiceActive(UserHandle.USER_SYSTEM, /* makeActive= */ false);
if (isAdb()) {
// Log device owner provisioning was started using adb.
MetricsLogger.action(mContext, PROVISIONING_ENTRY_POINT_ADB, LOG_TAG_DEVICE_OWNER);
@@ -7695,7 +7684,7 @@
saveUserRestrictionsLocked(userId);
}
- ident = mInjector.binderClearCallingIdentity();
+ long ident = mInjector.binderClearCallingIdentity();
try {
// TODO Send to system too?
sendOwnerChangedBroadcast(DevicePolicyManager.ACTION_DEVICE_OWNER_CHANGED, userId);
@@ -7952,6 +7941,9 @@
.write();
}
+ // Shutting down backup manager service permanently.
+ toggleBackupServiceActive(userHandle, /* makeActive= */ false);
+
mOwners.setProfileOwner(who, ownerName, userHandle);
mOwners.writeProfileOwner(userHandle);
Slog.i(LOG_TAG, "Profile owner set: " + who + " on user " + userHandle);
@@ -7975,6 +7967,24 @@
}
}
+
+ private void toggleBackupServiceActive(int userId, boolean makeActive) {
+ // Shutting down backup manager service permanently.
+ enforceUserUnlocked(userId);
+ long ident = mInjector.binderClearCallingIdentity();
+ try {
+ if (mInjector.getIBackupManager() != null) {
+ mInjector.getIBackupManager()
+ .setBackupServiceActive(userId, makeActive);
+ }
+ } catch (RemoteException e) {
+ throw new IllegalStateException("Failed deactivating backup service.", e);
+ } finally {
+ mInjector.binderRestoreCallingIdentity(ident);
+ }
+
+ }
+
@Override
public void clearProfileOwner(ComponentName who) {
if (!mHasFeature) {
@@ -12727,22 +12737,9 @@
return;
}
Preconditions.checkNotNull(admin);
- synchronized (getLockObject()) {
- getActiveAdminForCallerLocked(admin, DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
- }
-
- final long ident = mInjector.binderClearCallingIdentity();
- try {
- IBackupManager ibm = mInjector.getIBackupManager();
- if (ibm != null) {
- ibm.setBackupServiceActive(UserHandle.USER_SYSTEM, enabled);
- }
- } catch (RemoteException e) {
- throw new IllegalStateException(
- "Failed " + (enabled ? "" : "de") + "activating backup service.", e);
- } finally {
- mInjector.binderRestoreCallingIdentity(ident);
- }
+ enforceProfileOrDeviceOwner(admin);
+ int userId = mInjector.userHandleGetCallingUserId();
+ toggleBackupServiceActive(userId, enabled);
}
@Override
@@ -12751,11 +12748,13 @@
if (!mHasFeature) {
return true;
}
+
+ enforceProfileOrDeviceOwner(admin);
synchronized (getLockObject()) {
try {
- getActiveAdminForCallerLocked(admin, DeviceAdminInfo.USES_POLICY_DEVICE_OWNER);
IBackupManager ibm = mInjector.getIBackupManager();
- return ibm != null && ibm.isBackupServiceActive(UserHandle.USER_SYSTEM);
+ return ibm != null && ibm.isBackupServiceActive(
+ mInjector.userHandleGetCallingUserId());
} catch (RemoteException e) {
throw new IllegalStateException("Failed requesting backup service state.", e);
}
@@ -13009,7 +13008,12 @@
throw new IllegalStateException("logging is not available");
}
if (mNetworkLogger != null) {
- return mNetworkLogger.forceBatchFinalization();
+ final long ident = mInjector.binderClearCallingIdentity();
+ try {
+ return mNetworkLogger.forceBatchFinalization();
+ } finally {
+ mInjector.binderRestoreCallingIdentity(ident);
+ }
}
return 0;
}
diff --git a/services/net/java/android/net/apf/ApfFilter.java b/services/net/java/android/net/apf/ApfFilter.java
index d8e2869..4943952 100644
--- a/services/net/java/android/net/apf/ApfFilter.java
+++ b/services/net/java/android/net/apf/ApfFilter.java
@@ -20,6 +20,7 @@
import static android.net.util.NetworkConstants.ICMPV6_NEIGHBOR_ADVERTISEMENT;
import static android.net.util.NetworkConstants.ICMPV6_ROUTER_ADVERTISEMENT;
import static android.net.util.NetworkConstants.ICMPV6_ROUTER_SOLICITATION;
+import static android.net.util.SocketUtils.makePacketSocketAddress;
import static android.system.OsConstants.AF_PACKET;
import static android.system.OsConstants.ARPHRD_ETHER;
import static android.system.OsConstants.ETH_P_ARP;
@@ -55,7 +56,6 @@
import android.os.SystemClock;
import android.system.ErrnoException;
import android.system.Os;
-import android.system.PacketSocketAddress;
import android.text.format.DateUtils;
import android.util.Log;
import android.util.Pair;
@@ -72,6 +72,7 @@
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
+import java.net.SocketAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.nio.BufferUnderflowException;
@@ -188,7 +189,13 @@
private final byte[] mPacket = new byte[1514];
private final FileDescriptor mSocket;
private final long mStart = SystemClock.elapsedRealtime();
- private final ApfStats mStats = new ApfStats();
+
+ private int mReceivedRas = 0;
+ private int mMatchingRas = 0;
+ private int mDroppedRas = 0;
+ private int mParseErrors = 0;
+ private int mZeroLifetimeRas = 0;
+ private int mProgramUpdates = 0;
private volatile boolean mStopped;
@@ -221,26 +228,26 @@
}
private void updateStats(ProcessRaResult result) {
- mStats.receivedRas++;
+ mReceivedRas++;
switch(result) {
case MATCH:
- mStats.matchingRas++;
+ mMatchingRas++;
return;
case DROPPED:
- mStats.droppedRas++;
+ mDroppedRas++;
return;
case PARSE_ERROR:
- mStats.parseErrors++;
+ mParseErrors++;
return;
case ZERO_LIFETIME:
- mStats.zeroLifetimeRas++;
+ mZeroLifetimeRas++;
return;
case UPDATE_EXPIRY:
- mStats.matchingRas++;
- mStats.programUpdates++;
+ mMatchingRas++;
+ mProgramUpdates++;
return;
case UPDATE_NEW_RA:
- mStats.programUpdates++;
+ mProgramUpdates++;
return;
}
}
@@ -248,11 +255,19 @@
private void logStats() {
final long nowMs = SystemClock.elapsedRealtime();
synchronized (this) {
- mStats.durationMs = nowMs - mStart;
- mStats.maxProgramSize = mApfCapabilities.maximumApfProgramSize;
- mStats.programUpdatesAll = mNumProgramUpdates;
- mStats.programUpdatesAllowingMulticast = mNumProgramUpdatesAllowingMulticast;
- mMetricsLog.log(mStats);
+ final ApfStats stats = new ApfStats.Builder()
+ .setReceivedRas(mReceivedRas)
+ .setMatchingRas(mMatchingRas)
+ .setDroppedRas(mDroppedRas)
+ .setParseErrors(mParseErrors)
+ .setZeroLifetimeRas(mZeroLifetimeRas)
+ .setProgramUpdates(mProgramUpdates)
+ .setDurationMs(nowMs - mStart)
+ .setMaxProgramSize(mApfCapabilities.maximumApfProgramSize)
+ .setProgramUpdatesAll(mNumProgramUpdates)
+ .setProgramUpdatesAllowingMulticast(mNumProgramUpdatesAllowingMulticast)
+ .build();
+ mMetricsLog.log(stats);
logApfProgramEventLocked(nowMs / DateUtils.SECOND_IN_MILLIS);
}
}
@@ -458,7 +473,7 @@
installNewProgramLocked();
}
socket = Os.socket(AF_PACKET, SOCK_RAW, ETH_P_IPV6);
- PacketSocketAddress addr = new PacketSocketAddress(
+ SocketAddress addr = makePacketSocketAddress(
(short) ETH_P_IPV6, mInterfaceParams.index);
Os.bind(socket, addr);
NetworkUtils.attachRaFilter(socket, mApfCapabilities.apfPacketFormat);
@@ -863,7 +878,7 @@
@GuardedBy("this")
private long mLastInstalledProgramMinLifetime;
@GuardedBy("this")
- private ApfProgramEvent mLastInstallEvent;
+ private ApfProgramEvent.Builder mLastInstallEvent;
// For debugging only. The last program installed.
@GuardedBy("this")
@@ -1295,12 +1310,12 @@
}
mIpClientCallback.installPacketFilter(program);
logApfProgramEventLocked(now);
- mLastInstallEvent = new ApfProgramEvent();
- mLastInstallEvent.lifetime = programMinLifetime;
- mLastInstallEvent.filteredRas = rasToFilter.size();
- mLastInstallEvent.currentRas = mRas.size();
- mLastInstallEvent.programLength = program.length;
- mLastInstallEvent.flags = ApfProgramEvent.flagsFor(mIPv4Address != null, mMulticastFilter);
+ mLastInstallEvent = new ApfProgramEvent.Builder()
+ .setLifetime(programMinLifetime)
+ .setFilteredRas(rasToFilter.size())
+ .setCurrentRas(mRas.size())
+ .setProgramLength(program.length)
+ .setFlags(mIPv4Address != null, mMulticastFilter);
}
@GuardedBy("this")
@@ -1308,13 +1323,14 @@
if (mLastInstallEvent == null) {
return;
}
- ApfProgramEvent ev = mLastInstallEvent;
+ ApfProgramEvent.Builder ev = mLastInstallEvent;
mLastInstallEvent = null;
- ev.actualLifetime = now - mLastTimeInstalledProgram;
- if (ev.actualLifetime < APF_PROGRAM_EVENT_LIFETIME_THRESHOLD) {
+ final long actualLifetime = now - mLastTimeInstalledProgram;
+ ev.setActualLifetime(actualLifetime);
+ if (actualLifetime < APF_PROGRAM_EVENT_LIFETIME_THRESHOLD) {
return;
}
- mMetricsLog.log(ev);
+ mMetricsLog.log(ev.build());
}
/**
diff --git a/services/net/java/android/net/dhcp/DhcpClient.java b/services/net/java/android/net/dhcp/DhcpClient.java
index a956cef..04ac9a3 100644
--- a/services/net/java/android/net/dhcp/DhcpClient.java
+++ b/services/net/java/android/net/dhcp/DhcpClient.java
@@ -16,51 +16,65 @@
package android.net.dhcp;
-import com.android.internal.util.HexDump;
-import com.android.internal.util.Protocol;
-import com.android.internal.util.State;
-import com.android.internal.util.MessageUtils;
-import com.android.internal.util.StateMachine;
-import com.android.internal.util.WakeupMessage;
+import static android.net.dhcp.DhcpPacket.DHCP_BROADCAST_ADDRESS;
+import static android.net.dhcp.DhcpPacket.DHCP_DNS_SERVER;
+import static android.net.dhcp.DhcpPacket.DHCP_DOMAIN_NAME;
+import static android.net.dhcp.DhcpPacket.DHCP_LEASE_TIME;
+import static android.net.dhcp.DhcpPacket.DHCP_MTU;
+import static android.net.dhcp.DhcpPacket.DHCP_REBINDING_TIME;
+import static android.net.dhcp.DhcpPacket.DHCP_RENEWAL_TIME;
+import static android.net.dhcp.DhcpPacket.DHCP_ROUTER;
+import static android.net.dhcp.DhcpPacket.DHCP_SUBNET_MASK;
+import static android.net.dhcp.DhcpPacket.DHCP_VENDOR_INFO;
+import static android.net.dhcp.DhcpPacket.INADDR_ANY;
+import static android.net.dhcp.DhcpPacket.INADDR_BROADCAST;
+import static android.net.util.SocketUtils.makePacketSocketAddress;
+import static android.system.OsConstants.AF_INET;
+import static android.system.OsConstants.AF_PACKET;
+import static android.system.OsConstants.ETH_P_IP;
+import static android.system.OsConstants.IPPROTO_UDP;
+import static android.system.OsConstants.SOCK_DGRAM;
+import static android.system.OsConstants.SOCK_RAW;
+import static android.system.OsConstants.SOL_SOCKET;
+import static android.system.OsConstants.SO_BROADCAST;
+import static android.system.OsConstants.SO_RCVBUF;
+import static android.system.OsConstants.SO_REUSEADDR;
import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
import android.net.DhcpResults;
-import android.net.InterfaceConfiguration;
-import android.net.LinkAddress;
import android.net.NetworkUtils;
import android.net.TrafficStats;
-import android.net.metrics.IpConnectivityLog;
+import android.net.ip.IpClient;
import android.net.metrics.DhcpClientEvent;
import android.net.metrics.DhcpErrorEvent;
+import android.net.metrics.IpConnectivityLog;
import android.net.util.InterfaceParams;
+import android.net.util.SocketUtils;
import android.os.Message;
-import android.os.RemoteException;
-import android.os.ServiceManager;
import android.os.SystemClock;
import android.system.ErrnoException;
import android.system.Os;
-import android.system.PacketSocketAddress;
import android.util.EventLog;
import android.util.Log;
import android.util.SparseArray;
-import android.util.TimeUtils;
+
+import com.android.internal.util.HexDump;
+import com.android.internal.util.MessageUtils;
+import com.android.internal.util.State;
+import com.android.internal.util.StateMachine;
+import com.android.internal.util.WakeupMessage;
+
+import libcore.io.IoBridge;
import java.io.FileDescriptor;
import java.io.IOException;
-import java.lang.Thread;
import java.net.Inet4Address;
+import java.net.SocketAddress;
import java.net.SocketException;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Random;
-import libcore.io.IoBridge;
-
-import static android.system.OsConstants.*;
-import static android.net.dhcp.DhcpPacket.*;
-
/**
* A DHCPv4 client.
*
@@ -103,7 +117,8 @@
// t=0, t=2, t=6, t=14, t=30, allowing for 10% jitter.
private static final int DHCP_TIMEOUT_MS = 36 * SECONDS;
- private static final int PUBLIC_BASE = Protocol.BASE_DHCP;
+ // DhcpClient uses IpClient's handler.
+ private static final int PUBLIC_BASE = IpClient.DHCPCLIENT_CMD_BASE;
/* Commands from controller to start/stop DHCP */
public static final int CMD_START_DHCP = PUBLIC_BASE + 1;
@@ -133,7 +148,7 @@
public static final int DHCP_FAILURE = 2;
// Internal messages.
- private static final int PRIVATE_BASE = Protocol.BASE_DHCP + 100;
+ private static final int PRIVATE_BASE = IpClient.DHCPCLIENT_CMD_BASE + 100;
private static final int CMD_KICK = PRIVATE_BASE + 1;
private static final int CMD_RECEIVED_PACKET = PRIVATE_BASE + 2;
private static final int CMD_TIMEOUT = PRIVATE_BASE + 3;
@@ -190,7 +205,7 @@
private InterfaceParams mIface;
// TODO: MacAddress-ify more of this class hierarchy.
private byte[] mHwAddr;
- private PacketSocketAddress mInterfaceBroadcastAddr;
+ private SocketAddress mInterfaceBroadcastAddr;
private int mTransactionId;
private long mTransactionStartMillis;
private DhcpResults mDhcpLease;
@@ -279,7 +294,7 @@
}
mHwAddr = mIface.macAddr.toByteArray();
- mInterfaceBroadcastAddr = new PacketSocketAddress(mIface.index, DhcpPacket.ETHER_BROADCAST);
+ mInterfaceBroadcastAddr = makePacketSocketAddress(mIface.index, DhcpPacket.ETHER_BROADCAST);
return true;
}
@@ -295,7 +310,7 @@
private boolean initPacketSocket() {
try {
mPacketSock = Os.socket(AF_PACKET, SOCK_RAW, ETH_P_IP);
- PacketSocketAddress addr = new PacketSocketAddress((short) ETH_P_IP, mIface.index);
+ SocketAddress addr = makePacketSocketAddress((short) ETH_P_IP, mIface.index);
Os.bind(mPacketSock, addr);
NetworkUtils.attachDhcpFilter(mPacketSock);
} catch(SocketException|ErrnoException e) {
@@ -309,12 +324,11 @@
final int oldTag = TrafficStats.getAndSetThreadStatsTag(TrafficStats.TAG_SYSTEM_DHCP);
try {
mUdpSock = Os.socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
+ SocketUtils.bindSocketToInterface(mUdpSock, mIfaceName);
Os.setsockoptInt(mUdpSock, SOL_SOCKET, SO_REUSEADDR, 1);
- Os.setsockoptIfreq(mUdpSock, SOL_SOCKET, SO_BINDTODEVICE, mIfaceName);
Os.setsockoptInt(mUdpSock, SOL_SOCKET, SO_BROADCAST, 1);
Os.setsockoptInt(mUdpSock, SOL_SOCKET, SO_RCVBUF, 0);
Os.bind(mUdpSock, Inet4Address.ANY, DhcpPacket.DHCP_CLIENT);
- NetworkUtils.protectFromVpn(mUdpSock);
} catch(SocketException|ErrnoException e) {
Log.e(TAG, "Error creating UDP socket", e);
return false;
@@ -530,13 +544,13 @@
private String messageToString(Message message) {
long now = SystemClock.uptimeMillis();
- StringBuilder b = new StringBuilder(" ");
- TimeUtils.formatDuration(message.getWhen() - now, b);
- b.append(" ").append(messageName(message.what))
+ return new StringBuilder(" ")
+ .append(message.getWhen() - now)
+ .append(messageName(message.what))
.append(" ").append(message.arg1)
.append(" ").append(message.arg2)
- .append(" ").append(message.obj);
- return b.toString();
+ .append(" ").append(message.obj)
+ .toString();
}
@Override
@@ -1029,6 +1043,10 @@
}
private void logState(String name, int durationMs) {
- mMetricsLog.log(mIfaceName, new DhcpClientEvent(name, durationMs));
+ final DhcpClientEvent event = new DhcpClientEvent.Builder()
+ .setMsg(name)
+ .setDurationMs(durationMs)
+ .build();
+ mMetricsLog.log(mIfaceName, event);
}
}
diff --git a/services/net/java/android/net/ip/ConnectivityPacketTracker.java b/services/net/java/android/net/ip/ConnectivityPacketTracker.java
index e6ddbbc..385dd52 100644
--- a/services/net/java/android/net/ip/ConnectivityPacketTracker.java
+++ b/services/net/java/android/net/ip/ConnectivityPacketTracker.java
@@ -16,27 +16,27 @@
package android.net.ip;
-import static android.system.OsConstants.*;
+import static android.net.util.SocketUtils.makePacketSocketAddress;
+import static android.system.OsConstants.AF_PACKET;
+import static android.system.OsConstants.ARPHRD_ETHER;
+import static android.system.OsConstants.ETH_P_ALL;
+import static android.system.OsConstants.SOCK_RAW;
import android.net.NetworkUtils;
-import android.net.util.PacketReader;
import android.net.util.ConnectivityPacketSummary;
import android.net.util.InterfaceParams;
+import android.net.util.PacketReader;
import android.os.Handler;
import android.system.ErrnoException;
import android.system.Os;
-import android.system.PacketSocketAddress;
import android.text.TextUtils;
-import android.util.Log;
import android.util.LocalLog;
+import android.util.Log;
-import libcore.io.IoBridge;
import libcore.util.HexEncoding;
import java.io.FileDescriptor;
-import java.io.InterruptedIOException;
import java.io.IOException;
-import java.net.SocketException;
/**
@@ -103,7 +103,7 @@
try {
s = Os.socket(AF_PACKET, SOCK_RAW, 0);
NetworkUtils.attachControlPacketFilter(s, ARPHRD_ETHER);
- Os.bind(s, new PacketSocketAddress((short) ETH_P_ALL, mInterface.index));
+ Os.bind(s, makePacketSocketAddress((short) ETH_P_ALL, mInterface.index));
} catch (ErrnoException | IOException e) {
logError("Failed to create packet tracking socket: ", e);
closeFd(s);
diff --git a/services/net/java/android/net/ip/InterfaceController.java b/services/net/java/android/net/ip/InterfaceController.java
index 02e4f87..b3af67c 100644
--- a/services/net/java/android/net/ip/InterfaceController.java
+++ b/services/net/java/android/net/ip/InterfaceController.java
@@ -18,14 +18,14 @@
import android.net.INetd;
import android.net.InterfaceConfiguration;
+import android.net.InterfaceConfigurationParcel;
import android.net.LinkAddress;
-import android.net.util.NetdService;
import android.net.util.SharedLog;
-import android.os.INetworkManagementService;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.system.OsConstants;
+import java.net.Inet4Address;
import java.net.InetAddress;
@@ -40,76 +40,96 @@
private final static boolean DBG = false;
private final String mIfName;
- private final INetworkManagementService mNMS;
private final INetd mNetd;
private final SharedLog mLog;
- public InterfaceController(String ifname, INetworkManagementService nms, INetd netd,
- SharedLog log) {
+ public InterfaceController(String ifname, INetd netd, SharedLog log) {
mIfName = ifname;
- mNMS = nms;
mNetd = netd;
mLog = log;
}
+ private boolean setInterfaceConfig(InterfaceConfiguration config) {
+ final InterfaceConfigurationParcel cfgParcel = config.toParcel(mIfName);
+
+ try {
+ mNetd.interfaceSetCfg(cfgParcel);
+ } catch (RemoteException | ServiceSpecificException e) {
+ logError("Setting IPv4 address to %s/%d failed: %s",
+ cfgParcel.ipv4Addr, cfgParcel.prefixLength, e);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Set the IPv4 address of the interface.
+ */
public boolean setIPv4Address(LinkAddress address) {
- final InterfaceConfiguration ifcg = new InterfaceConfiguration();
- ifcg.setLinkAddress(address);
- try {
- mNMS.setInterfaceConfig(mIfName, ifcg);
- if (DBG) mLog.log("IPv4 configuration succeeded");
- } catch (IllegalStateException | RemoteException e) {
- logError("IPv4 configuration failed: %s", e);
+ if (!(address.getAddress() instanceof Inet4Address)) {
return false;
}
- return true;
+ final InterfaceConfiguration ifConfig = new InterfaceConfiguration();
+ ifConfig.setLinkAddress(address);
+ return setInterfaceConfig(ifConfig);
}
+ /**
+ * Clear the IPv4Address of the interface.
+ */
public boolean clearIPv4Address() {
+ final InterfaceConfiguration ifConfig = new InterfaceConfiguration();
+ ifConfig.setLinkAddress(new LinkAddress("0.0.0.0/0"));
+ return setInterfaceConfig(ifConfig);
+ }
+
+ private boolean setEnableIPv6(boolean enabled) {
try {
- final InterfaceConfiguration ifcg = new InterfaceConfiguration();
- ifcg.setLinkAddress(new LinkAddress("0.0.0.0/0"));
- mNMS.setInterfaceConfig(mIfName, ifcg);
- } catch (IllegalStateException | RemoteException e) {
- logError("Failed to clear IPv4 address on interface %s: %s", mIfName, e);
+ mNetd.interfaceSetEnableIPv6(mIfName, enabled);
+ } catch (RemoteException | ServiceSpecificException e) {
+ logError("%s IPv6 failed: %s", (enabled ? "enabling" : "disabling"), e);
return false;
}
return true;
}
+ /**
+ * Enable IPv6 on the interface.
+ */
public boolean enableIPv6() {
- try {
- mNMS.enableIpv6(mIfName);
- } catch (IllegalStateException | RemoteException e) {
- logError("enabling IPv6 failed: %s", e);
- return false;
- }
- return true;
+ return setEnableIPv6(true);
}
+ /**
+ * Disable IPv6 on the interface.
+ */
public boolean disableIPv6() {
- try {
- mNMS.disableIpv6(mIfName);
- } catch (IllegalStateException | RemoteException e) {
- logError("disabling IPv6 failed: %s", e);
- return false;
- }
- return true;
+ return setEnableIPv6(false);
}
+ /**
+ * Enable or disable IPv6 privacy extensions on the interface.
+ * @param enabled Whether the extensions should be enabled.
+ */
public boolean setIPv6PrivacyExtensions(boolean enabled) {
try {
- mNMS.setInterfaceIpv6PrivacyExtensions(mIfName, enabled);
- } catch (IllegalStateException | RemoteException e) {
- logError("error setting IPv6 privacy extensions: %s", e);
+ mNetd.interfaceSetIPv6PrivacyExtensions(mIfName, enabled);
+ } catch (RemoteException | ServiceSpecificException e) {
+ logError("error %s IPv6 privacy extensions: %s",
+ (enabled ? "enabling" : "disabling"), e);
return false;
}
return true;
}
+ /**
+ * Set IPv6 address generation mode on the interface.
+ *
+ * <p>IPv6 should be disabled before changing the mode.
+ */
public boolean setIPv6AddrGenModeIfSupported(int mode) {
try {
- mNMS.setIPv6AddrGenMode(mIfName, mode);
+ mNetd.setIPv6AddrGenMode(mIfName, mode);
} catch (RemoteException e) {
logError("Unable to set IPv6 addrgen mode: %s", e);
return false;
@@ -122,10 +142,16 @@
return true;
}
+ /**
+ * Add an address to the interface.
+ */
public boolean addAddress(LinkAddress addr) {
return addAddress(addr.getAddress(), addr.getPrefixLength());
}
+ /**
+ * Add an address to the interface.
+ */
public boolean addAddress(InetAddress ip, int prefixLen) {
try {
mNetd.interfaceAddAddress(mIfName, ip.getHostAddress(), prefixLen);
@@ -136,6 +162,9 @@
return true;
}
+ /**
+ * Remove an address from the interface.
+ */
public boolean removeAddress(InetAddress ip, int prefixLen) {
try {
mNetd.interfaceDelAddress(mIfName, ip.getHostAddress(), prefixLen);
@@ -146,9 +175,12 @@
return true;
}
+ /**
+ * Remove all addresses from the interface.
+ */
public boolean clearAllAddresses() {
try {
- mNMS.clearInterfaceAddresses(mIfName);
+ mNetd.interfaceClearAddrs(mIfName);
} catch (Exception e) {
logError("Failed to clear addresses: %s", e);
return false;
diff --git a/services/net/java/android/net/ip/IpClient.java b/services/net/java/android/net/ip/IpClient.java
index ff4e280..8187ac5 100644
--- a/services/net/java/android/net/ip/IpClient.java
+++ b/services/net/java/android/net/ip/IpClient.java
@@ -24,7 +24,6 @@
import android.net.IpPrefix;
import android.net.LinkAddress;
import android.net.LinkProperties;
-import android.net.LinkProperties.ProvisioningChange;
import android.net.Network;
import android.net.ProvisioningConfigurationParcelable;
import android.net.ProxyInfo;
@@ -343,7 +342,7 @@
private static final int CMD_START = 3;
private static final int CMD_CONFIRM = 4;
private static final int EVENT_PRE_DHCP_ACTION_COMPLETE = 5;
- // Sent by NetlinkTracker to communicate netlink events.
+ // Triggered by NetlinkTracker to communicate netlink events.
private static final int EVENT_NETLINK_LINKPROPERTIES_CHANGED = 6;
private static final int CMD_UPDATE_TCP_BUFFER_SIZES = 7;
private static final int CMD_UPDATE_HTTP_PROXY = 8;
@@ -359,6 +358,9 @@
private static final int CMD_JUMP_RUNNING_TO_STOPPING = 101;
private static final int CMD_JUMP_STOPPING_TO_STOPPED = 102;
+ // IpClient shares a handler with DhcpClient: commands must not overlap
+ public static final int DHCPCLIENT_CMD_BASE = 1000;
+
private static final int MAX_LOG_RECORDS = 500;
private static final int MAX_PACKET_RECORDS = 100;
@@ -371,6 +373,11 @@
private static final int IMMEDIATE_FAILURE_DURATION = 0;
+ private static final int PROV_CHANGE_STILL_NOT_PROVISIONED = 1;
+ private static final int PROV_CHANGE_LOST_PROVISIONING = 2;
+ private static final int PROV_CHANGE_GAINED_PROVISIONING = 3;
+ private static final int PROV_CHANGE_STILL_PROVISIONED = 4;
+
private final State mStoppedState = new StoppedState();
private final State mStoppingState = new StoppingState();
private final State mStartedState = new StartedState();
@@ -429,6 +436,9 @@
return NetdService.getInstance();
}
+ /**
+ * Get interface parameters for the specified interface.
+ */
public InterfaceParams getInterfaceParams(String ifname) {
return InterfaceParams.getByName(ifname);
}
@@ -446,7 +456,9 @@
INetworkManagementService nwService) {
this(context, ifName, callback, new Dependencies() {
@Override
- public INetworkManagementService getNMS() { return nwService; }
+ public INetworkManagementService getNMS() {
+ return nwService;
+ }
});
}
@@ -474,7 +486,7 @@
// TODO: Consider creating, constructing, and passing in some kind of
// InterfaceController.Dependencies class.
- mInterfaceCtrl = new InterfaceController(mInterfaceName, mNwService, deps.getNetd(), mLog);
+ mInterfaceCtrl = new InterfaceController(mInterfaceName, deps.getNetd(), mLog);
mNetlinkTracker = new NetlinkTracker(
mInterfaceName,
@@ -493,7 +505,7 @@
return;
}
- final String msg = "interfaceAdded(" + iface +")";
+ final String msg = "interfaceAdded(" + iface + ")";
logMsg(msg);
}
@@ -511,13 +523,13 @@
return;
}
- final String msg = "interfaceRemoved(" + iface +")";
+ final String msg = "interfaceRemoved(" + iface + ")";
logMsg(msg);
}
private void logMsg(String msg) {
Log.d(mTag, msg);
- getHandler().post(() -> { mLog.log("OBSERVED " + msg); });
+ getHandler().post(() -> mLog.log("OBSERVED " + msg));
}
};
@@ -590,10 +602,12 @@
}
private void configureAndStartStateMachine() {
+ // CHECKSTYLE:OFF IndentationCheck
addState(mStoppedState);
addState(mStartedState);
addState(mRunningState, mStartedState);
addState(mStoppingState);
+ // CHECKSTYLE:ON IndentationCheck
setInitialState(mStoppedState);
@@ -676,18 +690,34 @@
startProvisioning(new android.net.shared.ProvisioningConfiguration());
}
+ /**
+ * Stop this IpClient.
+ *
+ * <p>This does not shut down the StateMachine itself, which is handled by {@link #shutdown()}.
+ */
public void stop() {
sendMessage(CMD_STOP);
}
+ /**
+ * Confirm the provisioning configuration.
+ */
public void confirmConfiguration() {
sendMessage(CMD_CONFIRM);
}
+ /**
+ * For clients using {@link ProvisioningConfiguration.Builder#withPreDhcpAction()}, must be
+ * called after {@link IIpClientCallbacks#onPreDhcpAction} to indicate that DHCP is clear to
+ * proceed.
+ */
public void completedPreDhcpAction() {
sendMessage(EVENT_PRE_DHCP_ACTION_COMPLETE);
}
+ /**
+ * Indicate that packet filter read is complete.
+ */
public void readPacketFilterComplete(byte[] data) {
sendMessage(EVENT_READ_PACKET_FILTER_COMPLETE, data);
}
@@ -720,6 +750,9 @@
sendMessage(CMD_SET_MULTICAST_FILTER, enabled);
}
+ /**
+ * Dump logs of this IpClient.
+ */
public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
if (args != null && args.length > 0 && DUMP_ARG_CONFIRM.equals(args[0])) {
// Execute confirmConfiguration() and take no further action.
@@ -885,18 +918,18 @@
// object that is a correct and complete assessment of what changed, taking
// account of the asymmetries described in the comments in this function.
// Then switch to using it everywhere (IpReachabilityMonitor, etc.).
- private ProvisioningChange compareProvisioning(LinkProperties oldLp, LinkProperties newLp) {
- ProvisioningChange delta;
+ private int compareProvisioning(LinkProperties oldLp, LinkProperties newLp) {
+ int delta;
InitialConfiguration config = mConfiguration != null ? mConfiguration.mInitialConfig : null;
final boolean wasProvisioned = isProvisioned(oldLp, config);
final boolean isProvisioned = isProvisioned(newLp, config);
if (!wasProvisioned && isProvisioned) {
- delta = ProvisioningChange.GAINED_PROVISIONING;
+ delta = PROV_CHANGE_GAINED_PROVISIONING;
} else if (wasProvisioned && isProvisioned) {
- delta = ProvisioningChange.STILL_PROVISIONED;
+ delta = PROV_CHANGE_STILL_PROVISIONED;
} else if (!wasProvisioned && !isProvisioned) {
- delta = ProvisioningChange.STILL_NOT_PROVISIONED;
+ delta = PROV_CHANGE_STILL_NOT_PROVISIONED;
} else {
// (wasProvisioned && !isProvisioned)
//
@@ -908,7 +941,7 @@
// that to be a network without DNS servers and connect anyway.
//
// See the comment below.
- delta = ProvisioningChange.LOST_PROVISIONING;
+ delta = PROV_CHANGE_LOST_PROVISIONING;
}
final boolean lostIPv6 = oldLp.isIPv6Provisioned() && !newLp.isIPv6Provisioned();
@@ -944,7 +977,7 @@
// delta will never be LOST_PROVISIONING. So check for loss of
// provisioning here too.
if (lostIPv4Address || (lostIPv6 && !ignoreIPv6ProvisioningLoss)) {
- delta = ProvisioningChange.LOST_PROVISIONING;
+ delta = PROV_CHANGE_LOST_PROVISIONING;
}
// Additionally:
@@ -953,28 +986,34 @@
// IPv6 default route then also consider the loss of that default route
// to be a loss of provisioning. See b/27962810.
if (oldLp.hasGlobalIPv6Address() && (lostIPv6Router && !ignoreIPv6ProvisioningLoss)) {
- delta = ProvisioningChange.LOST_PROVISIONING;
+ delta = PROV_CHANGE_LOST_PROVISIONING;
}
return delta;
}
- private void dispatchCallback(ProvisioningChange delta, LinkProperties newLp) {
+ private void dispatchCallback(int delta, LinkProperties newLp) {
switch (delta) {
- case GAINED_PROVISIONING:
- if (DBG) { Log.d(mTag, "onProvisioningSuccess()"); }
+ case PROV_CHANGE_GAINED_PROVISIONING:
+ if (DBG) {
+ Log.d(mTag, "onProvisioningSuccess()");
+ }
recordMetric(IpManagerEvent.PROVISIONING_OK);
mCallback.onProvisioningSuccess(newLp);
break;
- case LOST_PROVISIONING:
- if (DBG) { Log.d(mTag, "onProvisioningFailure()"); }
+ case PROV_CHANGE_LOST_PROVISIONING:
+ if (DBG) {
+ Log.d(mTag, "onProvisioningFailure()");
+ }
recordMetric(IpManagerEvent.PROVISIONING_FAIL);
mCallback.onProvisioningFailure(newLp);
break;
default:
- if (DBG) { Log.d(mTag, "onLinkPropertiesChange()"); }
+ if (DBG) {
+ Log.d(mTag, "onLinkPropertiesChange()");
+ }
mCallback.onLinkPropertiesChange(newLp);
break;
}
@@ -983,7 +1022,7 @@
// Updates all IpClient-related state concerned with LinkProperties.
// Returns a ProvisioningChange for possibly notifying other interested
// parties that are not fronted by IpClient.
- private ProvisioningChange setLinkProperties(LinkProperties newLp) {
+ private int setLinkProperties(LinkProperties newLp) {
if (mApfFilter != null) {
mApfFilter.setLinkProperties(newLp);
}
@@ -991,10 +1030,10 @@
mIpReachabilityMonitor.updateLinkProperties(newLp);
}
- ProvisioningChange delta = compareProvisioning(mLinkProperties, newLp);
+ int delta = compareProvisioning(mLinkProperties, newLp);
mLinkProperties = new LinkProperties(newLp);
- if (delta == ProvisioningChange.GAINED_PROVISIONING) {
+ if (delta == PROV_CHANGE_GAINED_PROVISIONING) {
// TODO: Add a proper ProvisionedState and cancel the alarm in
// its enter() method.
mProvisioningTimeoutAlarm.cancel();
@@ -1090,17 +1129,17 @@
if (Objects.equals(newLp, mLinkProperties)) {
return true;
}
- final ProvisioningChange delta = setLinkProperties(newLp);
+ final int delta = setLinkProperties(newLp);
if (sendCallbacks) {
dispatchCallback(delta, newLp);
}
- return (delta != ProvisioningChange.LOST_PROVISIONING);
+ return (delta != PROV_CHANGE_LOST_PROVISIONING);
}
private void handleIPv4Success(DhcpResults dhcpResults) {
mDhcpResults = new DhcpResults(dhcpResults);
final LinkProperties newLp = assembleLinkProperties();
- final ProvisioningChange delta = setLinkProperties(newLp);
+ final int delta = setLinkProperties(newLp);
if (DBG) {
Log.d(mTag, "onNewDhcpResults(" + Objects.toString(dhcpResults) + ")");
@@ -1118,7 +1157,9 @@
// any addresses upon entry to StoppedState.
mInterfaceCtrl.clearIPv4Address();
mDhcpResults = null;
- if (DBG) { Log.d(mTag, "onNewDhcpResults(null)"); }
+ if (DBG) {
+ Log.d(mTag, "onNewDhcpResults(null)");
+ }
mCallback.onNewDhcpResults(null);
handleProvisioningFailure();
@@ -1126,7 +1167,7 @@
private void handleProvisioningFailure() {
final LinkProperties newLp = assembleLinkProperties();
- ProvisioningChange delta = setLinkProperties(newLp);
+ int delta = setLinkProperties(newLp);
// If we've gotten here and we're still not provisioned treat that as
// a total loss of provisioning.
//
@@ -1135,12 +1176,12 @@
// timeout expired.
//
// Regardless: GAME OVER.
- if (delta == ProvisioningChange.STILL_NOT_PROVISIONED) {
- delta = ProvisioningChange.LOST_PROVISIONING;
+ if (delta == PROV_CHANGE_STILL_NOT_PROVISIONED) {
+ delta = PROV_CHANGE_LOST_PROVISIONING;
}
dispatchCallback(delta, newLp);
- if (delta == ProvisioningChange.LOST_PROVISIONING) {
+ if (delta == PROV_CHANGE_LOST_PROVISIONING) {
transitionTo(mStoppingState);
}
}
@@ -1171,9 +1212,9 @@
}
private boolean startIPv6() {
- return mInterfaceCtrl.setIPv6PrivacyExtensions(true) &&
- mInterfaceCtrl.setIPv6AddrGenModeIfSupported(mConfiguration.mIPv6AddrGenMode) &&
- mInterfaceCtrl.enableIPv6();
+ return mInterfaceCtrl.setIPv6PrivacyExtensions(true)
+ && mInterfaceCtrl.setIPv6AddrGenModeIfSupported(mConfiguration.mIPv6AddrGenMode)
+ && mInterfaceCtrl.enableIPv6();
}
private boolean applyInitialConfig(InitialConfiguration config) {
@@ -1191,10 +1232,10 @@
// settings observer to watch for update and re-program these
// parameters (Q: is this level of dynamic updatability really
// necessary or does reading from settings at startup suffice?).
- final int NUM_SOLICITS = 5;
- final int INTER_SOLICIT_INTERVAL_MS = 750;
+ final int numSolicits = 5;
+ final int interSolicitIntervalMs = 750;
setNeighborParameters(mDependencies.getNetd(), mInterfaceName,
- NUM_SOLICITS, INTER_SOLICIT_INTERVAL_MS);
+ numSolicits, interSolicitIntervalMs);
} catch (Exception e) {
mLog.e("Failed to adjust neighbor parameters", e);
// Carry on using the system defaults (currently: 3, 1000);
@@ -1341,8 +1382,8 @@
mStartTimeMillis = SystemClock.elapsedRealtime();
if (mConfiguration.mProvisioningTimeoutMs > 0) {
- final long alarmTime = SystemClock.elapsedRealtime() +
- mConfiguration.mProvisioningTimeoutMs;
+ final long alarmTime = SystemClock.elapsedRealtime()
+ + mConfiguration.mProvisioningTimeoutMs;
mProvisioningTimeoutAlarm.schedule(alarmTime);
}
@@ -1397,8 +1438,7 @@
}
private boolean readyToProceed() {
- return (!mLinkProperties.hasIPv4Address() &&
- !mLinkProperties.hasGlobalIPv6Address());
+ return (!mLinkProperties.hasIPv4Address() && !mLinkProperties.hasGlobalIPv6Address());
}
}
@@ -1449,7 +1489,7 @@
if (mConfiguration.mUsingMultinetworkPolicyTracker) {
mMultinetworkPolicyTracker = new MultinetworkPolicyTracker(
mContext, getHandler(),
- () -> { mLog.log("OBSERVED AvoidBadWifi changed"); });
+ () -> mLog.log("OBSERVED AvoidBadWifi changed"));
mMultinetworkPolicyTracker.start();
}
@@ -1510,8 +1550,8 @@
if (!mDhcpActionInFlight) {
mCallback.onPreDhcpAction();
mDhcpActionInFlight = true;
- final long alarmTime = SystemClock.elapsedRealtime() +
- mConfiguration.mRequestedPreDhcpActionMs;
+ final long alarmTime = SystemClock.elapsedRealtime()
+ + mConfiguration.mRequestedPreDhcpActionMs;
mDhcpActionTimeoutAlarm.schedule(alarmTime);
}
}
@@ -1613,7 +1653,7 @@
mDhcpClient.sendMessage(DhcpClient.EVENT_LINKADDRESS_CONFIGURED);
} else {
logError("Failed to set IPv4 address.");
- dispatchCallback(ProvisioningChange.LOST_PROVISIONING,
+ dispatchCallback(PROV_CHANGE_LOST_PROVISIONING,
new LinkProperties(mLinkProperties));
transitionTo(mStoppingState);
}
@@ -1680,16 +1720,18 @@
}
private static void setNeighborParameters(
- INetd netd, String ifName, int num_solicits, int inter_solicit_interval_ms)
+ INetd netd, String ifName, int numSolicits, int interSolicitIntervalMs)
throws RemoteException, IllegalArgumentException {
Preconditions.checkNotNull(netd);
Preconditions.checkArgument(!TextUtils.isEmpty(ifName));
- Preconditions.checkArgument(num_solicits > 0);
- Preconditions.checkArgument(inter_solicit_interval_ms > 0);
+ Preconditions.checkArgument(numSolicits > 0);
+ Preconditions.checkArgument(interSolicitIntervalMs > 0);
for (int family : new Integer[]{INetd.IPV4, INetd.IPV6}) {
- netd.setProcSysNet(family, INetd.NEIGH, ifName, "retrans_time_ms", Integer.toString(inter_solicit_interval_ms));
- netd.setProcSysNet(family, INetd.NEIGH, ifName, "ucast_solicit", Integer.toString(num_solicits));
+ netd.setProcSysNet(family, INetd.NEIGH, ifName, "retrans_time_ms",
+ Integer.toString(interSolicitIntervalMs));
+ netd.setProcSysNet(family, INetd.NEIGH, ifName, "ucast_solicit",
+ Integer.toString(numSolicits));
}
}
@@ -1718,7 +1760,7 @@
static <T> T find(Iterable<T> coll, Predicate<T> fn) {
for (T t: coll) {
if (fn.test(t)) {
- return t;
+ return t;
}
}
return null;
diff --git a/services/net/java/android/net/ip/IpNeighborMonitor.java b/services/net/java/android/net/ip/IpNeighborMonitor.java
index 9512f1b..eb993a4 100644
--- a/services/net/java/android/net/ip/IpNeighborMonitor.java
+++ b/services/net/java/android/net/ip/IpNeighborMonitor.java
@@ -16,9 +16,10 @@
package android.net.ip;
-import static android.net.netlink.NetlinkConstants.hexify;
import static android.net.netlink.NetlinkConstants.RTM_DELNEIGH;
+import static android.net.netlink.NetlinkConstants.hexify;
import static android.net.netlink.NetlinkConstants.stringForNlMsgType;
+import static android.net.util.SocketUtils.makeNetlinkSocketAddress;
import android.net.MacAddress;
import android.net.netlink.NetlinkErrorMessage;
@@ -26,13 +27,11 @@
import android.net.netlink.NetlinkSocket;
import android.net.netlink.RtNetlinkNeighborMessage;
import android.net.netlink.StructNdMsg;
-import android.net.netlink.StructNlMsgHdr;
import android.net.util.PacketReader;
import android.net.util.SharedLog;
import android.os.Handler;
import android.os.SystemClock;
import android.system.ErrnoException;
-import android.system.NetlinkSocketAddress;
import android.system.Os;
import android.system.OsConstants;
import android.util.Log;
@@ -149,15 +148,12 @@
try {
fd = NetlinkSocket.forProto(OsConstants.NETLINK_ROUTE);
- Os.bind(fd, (SocketAddress)(new NetlinkSocketAddress(0, OsConstants.RTMGRP_NEIGH)));
- Os.connect(fd, (SocketAddress)(new NetlinkSocketAddress(0, 0)));
+ Os.bind(fd, makeNetlinkSocketAddress(0, OsConstants.RTMGRP_NEIGH));
+ NetlinkSocket.connectToKernel(fd);
if (VDBG) {
- final NetlinkSocketAddress nlAddr = (NetlinkSocketAddress) Os.getsockname(fd);
- Log.d(TAG, "bound to sockaddr_nl{"
- + BitUtils.uint32(nlAddr.getPortId()) + ", "
- + nlAddr.getGroupsMask()
- + "}");
+ final SocketAddress nlAddr = Os.getsockname(fd);
+ Log.d(TAG, "bound to sockaddr_nl{" + nlAddr.toString() + "}");
}
} catch (ErrnoException|SocketException e) {
logError("Failed to create rtnetlink socket", e);
diff --git a/services/net/java/android/net/ip/IpReachabilityMonitor.java b/services/net/java/android/net/ip/IpReachabilityMonitor.java
index 7e02a28..29e2f0c 100644
--- a/services/net/java/android/net/ip/IpReachabilityMonitor.java
+++ b/services/net/java/android/net/ip/IpReachabilityMonitor.java
@@ -16,11 +16,13 @@
package android.net.ip;
+import static android.net.metrics.IpReachabilityEvent.NUD_FAILED;
+import static android.net.metrics.IpReachabilityEvent.NUD_FAILED_ORGANIC;
+import static android.net.metrics.IpReachabilityEvent.PROVISIONING_LOST;
+import static android.net.metrics.IpReachabilityEvent.PROVISIONING_LOST_ORGANIC;
+
import android.content.Context;
-import android.net.LinkAddress;
import android.net.LinkProperties;
-import android.net.LinkProperties.ProvisioningChange;
-import android.net.ProxyInfo;
import android.net.RouteInfo;
import android.net.ip.IpNeighborMonitor.NeighborEvent;
import android.net.metrics.IpConnectivityLog;
@@ -33,28 +35,19 @@
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.os.SystemClock;
-import android.system.ErrnoException;
-import android.system.OsConstants;
import android.util.Log;
-import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.DumpUtils.Dump;
-import java.io.InterruptedIOException;
import java.io.PrintWriter;
import java.net.Inet6Address;
import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Set;
/**
@@ -314,10 +307,11 @@
}
}
- final ProvisioningChange delta = LinkProperties.compareProvisioning(
- mLinkProperties, whatIfLp);
+ final boolean lostProvisioning =
+ (mLinkProperties.isIPv4Provisioned() && !whatIfLp.isIPv4Provisioned())
+ || (mLinkProperties.isIPv6Provisioned() && !whatIfLp.isIPv6Provisioned());
- if (delta == ProvisioningChange.LOST_PROVISIONING) {
+ if (lostProvisioning) {
final String logMsg = "FAILURE: LOST_PROVISIONING, " + event;
Log.w(TAG, logMsg);
if (mCallback != null) {
@@ -326,7 +320,7 @@
mCallback.notifyLost(ip, logMsg);
}
}
- logNudFailed(delta);
+ logNudFailed(lostProvisioning);
}
private boolean avoidingBadLinks() {
@@ -376,11 +370,21 @@
mMetricsLog.log(mInterfaceParams.name, new IpReachabilityEvent(eventType));
}
- private void logNudFailed(ProvisioningChange delta) {
+ private void logNudFailed(boolean lostProvisioning) {
long duration = SystemClock.elapsedRealtime() - mLastProbeTimeMs;
boolean isFromProbe = (duration < getProbeWakeLockDuration());
- boolean isProvisioningLost = (delta == ProvisioningChange.LOST_PROVISIONING);
- int eventType = IpReachabilityEvent.nudFailureEventType(isFromProbe, isProvisioningLost);
+ int eventType = nudFailureEventType(isFromProbe, lostProvisioning);
mMetricsLog.log(mInterfaceParams.name, new IpReachabilityEvent(eventType));
}
+
+ /**
+ * Returns the NUD failure event type code corresponding to the given conditions.
+ */
+ private static int nudFailureEventType(boolean isFromProbe, boolean isProvisioningLost) {
+ if (isFromProbe) {
+ return isProvisioningLost ? PROVISIONING_LOST : NUD_FAILED;
+ } else {
+ return isProvisioningLost ? PROVISIONING_LOST_ORGANIC : NUD_FAILED_ORGANIC;
+ }
+ }
}
diff --git a/services/net/java/android/net/ip/IpServer.java b/services/net/java/android/net/ip/IpServer.java
index 8b22f68..7910c9a 100644
--- a/services/net/java/android/net/ip/IpServer.java
+++ b/services/net/java/android/net/ip/IpServer.java
@@ -226,7 +226,7 @@
mNetd = deps.getNetdService();
mStatsService = statsService;
mCallback = callback;
- mInterfaceCtrl = new InterfaceController(ifaceName, nMService, mNetd, mLog);
+ mInterfaceCtrl = new InterfaceController(ifaceName, mNetd, mLog);
mIfaceName = ifaceName;
mInterfaceType = interfaceType;
mLinkProperties = new LinkProperties();
diff --git a/services/net/java/android/net/ip/RouterAdvertisementDaemon.java b/services/net/java/android/net/ip/RouterAdvertisementDaemon.java
index d197d01..8e3023b 100644
--- a/services/net/java/android/net/ip/RouterAdvertisementDaemon.java
+++ b/services/net/java/android/net/ip/RouterAdvertisementDaemon.java
@@ -18,11 +18,15 @@
import static android.net.util.NetworkConstants.IPV6_MIN_MTU;
import static android.net.util.NetworkConstants.RFC7421_PREFIX_LENGTH;
-import static android.system.OsConstants.*;
+import static android.system.OsConstants.AF_INET6;
+import static android.system.OsConstants.IPPROTO_ICMPV6;
+import static android.system.OsConstants.SOCK_RAW;
+import static android.system.OsConstants.SOL_SOCKET;
+import static android.system.OsConstants.SO_BINDTODEVICE;
+import static android.system.OsConstants.SO_SNDTIMEO;
import android.net.IpPrefix;
import android.net.LinkAddress;
-import android.net.LinkProperties;
import android.net.NetworkUtils;
import android.net.TrafficStats;
import android.net.util.InterfaceParams;
@@ -34,10 +38,8 @@
import com.android.internal.annotations.GuardedBy;
import libcore.io.IoBridge;
-import libcore.util.HexEncoding;
import java.io.FileDescriptor;
-import java.io.InterruptedIOException;
import java.io.IOException;
import java.net.Inet6Address;
import java.net.InetAddress;
@@ -47,7 +49,6 @@
import java.nio.BufferOverflowException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
diff --git a/services/net/java/android/net/netlink/ConntrackMessage.java b/services/net/java/android/net/netlink/ConntrackMessage.java
index 4ee6432..6978739 100644
--- a/services/net/java/android/net/netlink/ConntrackMessage.java
+++ b/services/net/java/android/net/netlink/ConntrackMessage.java
@@ -16,22 +16,15 @@
package android.net.netlink;
-import static android.net.netlink.NetlinkConstants.alignedLengthOf;
-import static android.net.netlink.StructNlAttr.makeNestedType;
-import static android.net.netlink.StructNlAttr.NLA_HEADERLEN;
import static android.net.netlink.StructNlMsgHdr.NLM_F_ACK;
-import static android.net.netlink.StructNlMsgHdr.NLM_F_DUMP;
import static android.net.netlink.StructNlMsgHdr.NLM_F_REPLACE;
import static android.net.netlink.StructNlMsgHdr.NLM_F_REQUEST;
-import static android.net.util.NetworkConstants.IPV4_ADDR_LEN;
+
import static java.nio.ByteOrder.BIG_ENDIAN;
import android.system.OsConstants;
-import android.util.Log;
import java.net.Inet4Address;
-import java.net.Inet6Address;
-import java.net.InetAddress;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
diff --git a/services/net/java/android/net/netlink/NetlinkSocket.java b/services/net/java/android/net/netlink/NetlinkSocket.java
index 40098c1..2a98d90 100644
--- a/services/net/java/android/net/netlink/NetlinkSocket.java
+++ b/services/net/java/android/net/netlink/NetlinkSocket.java
@@ -16,26 +16,26 @@
package android.net.netlink;
+import static android.net.util.SocketUtils.makeNetlinkSocketAddress;
import static android.system.OsConstants.AF_NETLINK;
import static android.system.OsConstants.EIO;
import static android.system.OsConstants.EPROTO;
import static android.system.OsConstants.ETIMEDOUT;
+import static android.system.OsConstants.SOCK_DGRAM;
+import static android.system.OsConstants.SOL_SOCKET;
import static android.system.OsConstants.SO_RCVBUF;
import static android.system.OsConstants.SO_RCVTIMEO;
import static android.system.OsConstants.SO_SNDTIMEO;
-import static android.system.OsConstants.SOCK_DGRAM;
-import static android.system.OsConstants.SOL_SOCKET;
import android.system.ErrnoException;
-import android.system.NetlinkSocketAddress;
import android.system.Os;
import android.system.StructTimeval;
import android.util.Log;
+
import libcore.io.IoUtils;
import java.io.FileDescriptor;
import java.io.InterruptedIOException;
-import java.net.SocketAddress;
import java.net.SocketException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
@@ -106,7 +106,7 @@
}
public static void connectToKernel(FileDescriptor fd) throws ErrnoException, SocketException {
- Os.connect(fd, (SocketAddress) (new NetlinkSocketAddress(0, 0)));
+ Os.connect(fd, makeNetlinkSocketAddress(0, 0));
}
private static void checkTimeout(long timeoutMs) {
diff --git a/services/net/java/android/net/shared/LinkPropertiesParcelableUtil.java b/services/net/java/android/net/shared/LinkPropertiesParcelableUtil.java
index d5213df..51d955d 100644
--- a/services/net/java/android/net/shared/LinkPropertiesParcelableUtil.java
+++ b/services/net/java/android/net/shared/LinkPropertiesParcelableUtil.java
@@ -182,9 +182,6 @@
parcel.mtu = lp.getMtu();
parcel.tcpBufferSizes = lp.getTcpBufferSizes();
parcel.nat64Prefix = toStableParcelable(lp.getNat64Prefix());
- parcel.stackedLinks = toParcelableArray(
- lp.getStackedLinks(), LinkPropertiesParcelableUtil::toStableParcelable,
- LinkPropertiesParcelable.class);
return parcel;
}
@@ -216,9 +213,6 @@
lp.setMtu(parcel.mtu);
lp.setTcpBufferSizes(parcel.tcpBufferSizes);
lp.setNat64Prefix(fromStableParcelable(parcel.nat64Prefix));
- for (LinkPropertiesParcelable stackedLink : parcel.stackedLinks) {
- lp.addStackedLink(fromStableParcelable(stackedLink));
- }
return lp;
}
}
diff --git a/services/net/java/android/net/util/ConnectivityPacketSummary.java b/services/net/java/android/net/util/ConnectivityPacketSummary.java
index 4951400..ec833b0 100644
--- a/services/net/java/android/net/util/ConnectivityPacketSummary.java
+++ b/services/net/java/android/net/util/ConnectivityPacketSummary.java
@@ -16,19 +16,56 @@
package android.net.util;
-import android.net.dhcp.DhcpPacket;
+import static android.net.util.NetworkConstants.ARP_HWTYPE_ETHER;
+import static android.net.util.NetworkConstants.ARP_PAYLOAD_LEN;
+import static android.net.util.NetworkConstants.ARP_REPLY;
+import static android.net.util.NetworkConstants.ARP_REQUEST;
+import static android.net.util.NetworkConstants.DHCP4_CLIENT_PORT;
+import static android.net.util.NetworkConstants.ETHER_ADDR_LEN;
+import static android.net.util.NetworkConstants.ETHER_DST_ADDR_OFFSET;
+import static android.net.util.NetworkConstants.ETHER_HEADER_LEN;
+import static android.net.util.NetworkConstants.ETHER_SRC_ADDR_OFFSET;
+import static android.net.util.NetworkConstants.ETHER_TYPE_ARP;
+import static android.net.util.NetworkConstants.ETHER_TYPE_IPV4;
+import static android.net.util.NetworkConstants.ETHER_TYPE_IPV6;
+import static android.net.util.NetworkConstants.ETHER_TYPE_OFFSET;
+import static android.net.util.NetworkConstants.ICMPV6_HEADER_MIN_LEN;
+import static android.net.util.NetworkConstants.ICMPV6_ND_OPTION_LENGTH_SCALING_FACTOR;
+import static android.net.util.NetworkConstants.ICMPV6_ND_OPTION_MIN_LENGTH;
+import static android.net.util.NetworkConstants.ICMPV6_ND_OPTION_MTU;
+import static android.net.util.NetworkConstants.ICMPV6_ND_OPTION_SLLA;
+import static android.net.util.NetworkConstants.ICMPV6_ND_OPTION_TLLA;
+import static android.net.util.NetworkConstants.ICMPV6_NEIGHBOR_ADVERTISEMENT;
+import static android.net.util.NetworkConstants.ICMPV6_NEIGHBOR_SOLICITATION;
+import static android.net.util.NetworkConstants.ICMPV6_ROUTER_ADVERTISEMENT;
+import static android.net.util.NetworkConstants.ICMPV6_ROUTER_SOLICITATION;
+import static android.net.util.NetworkConstants.IPV4_ADDR_LEN;
+import static android.net.util.NetworkConstants.IPV4_DST_ADDR_OFFSET;
+import static android.net.util.NetworkConstants.IPV4_FLAGS_OFFSET;
+import static android.net.util.NetworkConstants.IPV4_FRAGMENT_MASK;
+import static android.net.util.NetworkConstants.IPV4_HEADER_MIN_LEN;
+import static android.net.util.NetworkConstants.IPV4_IHL_MASK;
+import static android.net.util.NetworkConstants.IPV4_PROTOCOL_OFFSET;
+import static android.net.util.NetworkConstants.IPV4_SRC_ADDR_OFFSET;
+import static android.net.util.NetworkConstants.IPV6_ADDR_LEN;
+import static android.net.util.NetworkConstants.IPV6_HEADER_LEN;
+import static android.net.util.NetworkConstants.IPV6_PROTOCOL_OFFSET;
+import static android.net.util.NetworkConstants.IPV6_SRC_ADDR_OFFSET;
+import static android.net.util.NetworkConstants.UDP_HEADER_LEN;
+import static android.net.util.NetworkConstants.asString;
+import static android.net.util.NetworkConstants.asUint;
+import static android.system.OsConstants.IPPROTO_ICMPV6;
+import static android.system.OsConstants.IPPROTO_UDP;
+
import android.net.MacAddress;
+import android.net.dhcp.DhcpPacket;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
-import java.util.Arrays;
import java.util.StringJoiner;
-import static android.system.OsConstants.*;
-import static android.net.util.NetworkConstants.*;
-
/**
* Critical connectivity packet summarizing class.
diff --git a/services/net/java/android/net/util/NetdService.java b/services/net/java/android/net/util/NetdService.java
index 6e69ff5..80b2c27 100644
--- a/services/net/java/android/net/util/NetdService.java
+++ b/services/net/java/android/net/util/NetdService.java
@@ -19,7 +19,6 @@
import android.net.INetd;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.os.ServiceSpecificException;
import android.os.SystemClock;
import android.util.Log;
diff --git a/services/tests/servicestests/src/com/android/server/backup/TrampolineTest.java b/services/tests/servicestests/src/com/android/server/backup/TrampolineTest.java
index 6a9a121..ac4a5fe 100644
--- a/services/tests/servicestests/src/com/android/server/backup/TrampolineTest.java
+++ b/services/tests/servicestests/src/com/android/server/backup/TrampolineTest.java
@@ -25,7 +25,6 @@
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.Mockito.never;
-import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
@@ -48,6 +47,7 @@
import android.platform.test.annotations.Presubmit;
import android.provider.Settings;
import android.test.mock.MockContentResolver;
+import android.util.SparseArray;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
@@ -90,17 +90,30 @@
};
private static final int NON_USER_SYSTEM = UserHandle.USER_SYSTEM + 1;
- @UserIdInt private int mUserId;
- @Mock private BackupManagerService mBackupManagerServiceMock;
- @Mock private Context mContextMock;
- @Mock private File mSuppressFileMock;
- @Mock private File mSuppressFileParentMock;
- @Mock private IBinder mAgentMock;
- @Mock private ParcelFileDescriptor mParcelFileDescriptorMock;
- @Mock private IFullBackupRestoreObserver mFullBackupRestoreObserverMock;
- @Mock private IBackupObserver mBackupObserverMock;
- @Mock private IBackupManagerMonitor mBackupManagerMonitorMock;
- @Mock private PrintWriter mPrintWriterMock;
+ @UserIdInt
+ private int mUserId;
+ @Mock
+ private BackupManagerService mBackupManagerServiceMock;
+ @Mock
+ private UserBackupManagerService mUserBackupManagerService;
+ @Mock
+ private Context mContextMock;
+ @Mock
+ private File mSuppressFileMock;
+ @Mock
+ private File mSuppressFileParentMock;
+ @Mock
+ private IBinder mAgentMock;
+ @Mock
+ private ParcelFileDescriptor mParcelFileDescriptorMock;
+ @Mock
+ private IFullBackupRestoreObserver mFullBackupRestoreObserverMock;
+ @Mock
+ private IBackupObserver mBackupObserverMock;
+ @Mock
+ private IBackupManagerMonitor mBackupManagerMonitorMock;
+ @Mock
+ private PrintWriter mPrintWriterMock;
private FileDescriptor mFileDescriptorStub = new FileDescriptor();
@@ -110,16 +123,20 @@
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
+ mUserId = NON_USER_SYSTEM;
+
+ SparseArray<UserBackupManagerService> serviceUsers = new SparseArray<>();
+ serviceUsers.append(UserHandle.SYSTEM.getIdentifier(), mUserBackupManagerService);
+ serviceUsers.append(NON_USER_SYSTEM, mUserBackupManagerService);
+ when(mBackupManagerServiceMock.getServiceUsers()).thenReturn(serviceUsers);
TrampolineTestable.sBackupManagerServiceMock = mBackupManagerServiceMock;
- TrampolineTestable.sSuppressFile = mSuppressFileMock;
TrampolineTestable.sCallingUserId = UserHandle.USER_SYSTEM;
TrampolineTestable.sCallingUid = Process.SYSTEM_UID;
TrampolineTestable.sBackupDisabled = false;
when(mSuppressFileMock.getParentFile()).thenReturn(mSuppressFileParentMock);
- mUserId = NON_USER_SYSTEM;
mTrampoline = new TrampolineTestable(mContextMock);
mContentResolver = new MockContentResolver();
@@ -128,11 +145,6 @@
}
@Test
- public void constructor_createsSuppressFileDirectory() {
- verify(mSuppressFileParentMock).mkdirs();
- }
-
- @Test
public void unlockUser_whenMultiUserSettingDisabled_callsBackupManagerServiceForSystemUser() {
Settings.Global.putInt(mContentResolver, Settings.Global.BACKUP_MULTI_USER_ENABLED, 0);
mTrampoline.initializeService();
@@ -147,9 +159,9 @@
Settings.Global.putInt(mContentResolver, Settings.Global.BACKUP_MULTI_USER_ENABLED, 0);
mTrampoline.initializeService();
- mTrampoline.unlockUser(10);
+ mTrampoline.unlockUser(NON_USER_SYSTEM);
- verify(mBackupManagerServiceMock, never()).startServiceForUser(10);
+ verify(mBackupManagerServiceMock, never()).startServiceForUser(NON_USER_SYSTEM);
}
@Test
@@ -157,9 +169,9 @@
Settings.Global.putInt(mContentResolver, Settings.Global.BACKUP_MULTI_USER_ENABLED, 1);
mTrampoline.initializeService();
- mTrampoline.unlockUser(10);
+ mTrampoline.unlockUser(NON_USER_SYSTEM);
- verify(mBackupManagerServiceMock).startServiceForUser(10);
+ verify(mBackupManagerServiceMock).startServiceForUser(NON_USER_SYSTEM);
}
@Test
@@ -177,19 +189,20 @@
Settings.Global.putInt(mContentResolver, Settings.Global.BACKUP_MULTI_USER_ENABLED, 0);
mTrampoline.initializeService();
- mTrampoline.stopUser(10);
+ mTrampoline.stopUser(NON_USER_SYSTEM);
- verify(mBackupManagerServiceMock, never()).stopServiceForUser(10);
+ verify(mBackupManagerServiceMock, never()).stopServiceForUser(NON_USER_SYSTEM);
}
@Test
public void stopUser_whenMultiUserSettingEnabled_callsBackupManagerServiceForNonSystemUser() {
Settings.Global.putInt(mContentResolver, Settings.Global.BACKUP_MULTI_USER_ENABLED, 1);
+
mTrampoline.initializeService();
- mTrampoline.stopUser(10);
+ mTrampoline.stopUser(NON_USER_SYSTEM);
- verify(mBackupManagerServiceMock).stopServiceForUser(10);
+ verify(mBackupManagerServiceMock).stopServiceForUser(NON_USER_SYSTEM);
}
@Test
@@ -211,9 +224,10 @@
// Verify that BackupManagerService is not initialized if suppress file exists.
@Test
- public void initializeService_suppressFileExists_nonInitialized() {
- when(mSuppressFileMock.exists()).thenReturn(true);
+ public void initializeService_suppressFileExists_nonInitialized() throws Exception {
TrampolineTestable trampoline = new TrampolineTestable(mContextMock);
+ trampoline.createBackupSuppressFileForUser(UserHandle.USER_SYSTEM);
+
trampoline.initializeService();
@@ -233,6 +247,14 @@
}
@Test
+ public void isBackupServiceActive_forNonSysUser_whenSysUserIsDeactivated_returnsFalse() {
+ mTrampoline.setBackupServiceActive(NON_USER_SYSTEM, true);
+ mTrampoline.setBackupServiceActive(UserHandle.USER_SYSTEM, false);
+
+ assertFalse(mTrampoline.isBackupServiceActive(NON_USER_SYSTEM));
+ }
+
+ @Test
public void setBackupServiceActive_callerSystemUid_serviceCreated() {
TrampolineTestable.sCallingUid = Process.SYSTEM_UID;
@@ -292,11 +314,18 @@
}
@Test
+ public void setBackupServiceActive_makeNonActive_alreadyNonActive_ignored() {
+ mTrampoline.setBackupServiceActive(UserHandle.USER_SYSTEM, false);
+ mTrampoline.setBackupServiceActive(UserHandle.USER_SYSTEM, false);
+
+ assertFalse(mTrampoline.isBackupServiceActive(UserHandle.USER_SYSTEM));
+ }
+
+ @Test
public void setBackupServiceActive_makeActive_serviceCreatedAndSuppressFileDeleted() {
mTrampoline.setBackupServiceActive(UserHandle.USER_SYSTEM, true);
assertTrue(mTrampoline.isBackupServiceActive(UserHandle.USER_SYSTEM));
- verify(mSuppressFileMock).delete();
}
@Test
@@ -308,40 +337,25 @@
mTrampoline.setBackupServiceActive(UserHandle.USER_SYSTEM, false);
assertFalse(mTrampoline.isBackupServiceActive(UserHandle.USER_SYSTEM));
- verify(mSuppressFileMock).createNewFile();
}
@Test
- public void
- setBackupServiceActive_makeNonActive_serviceDeletedAndSuppressFileCreated_ioExceptionHandled()
- throws IOException {
- when(mSuppressFileMock.createNewFile()).thenThrow(new IOException());
+ public void setBackupActive_nonSystemUser_disabledForSystemUser_ignored() {
mTrampoline.initializeService();
- assertTrue(mTrampoline.isBackupServiceActive(UserHandle.USER_SYSTEM));
-
mTrampoline.setBackupServiceActive(UserHandle.USER_SYSTEM, false);
+ mTrampoline.setBackupServiceActive(NON_USER_SYSTEM, true);
- assertFalse(mTrampoline.isBackupServiceActive(UserHandle.USER_SYSTEM));
- verify(mSuppressFileMock).createNewFile();
+ assertFalse(mTrampoline.isBackupServiceActive(NON_USER_SYSTEM));
}
@Test
- public void setBackupServiceActive_makeNonActive_alreadyNonActive_ignored() throws IOException {
- reset(mSuppressFileMock);
-
- mTrampoline.setBackupServiceActive(UserHandle.USER_SYSTEM, false);
-
- verifyNoMoreInteractions(mSuppressFileMock);
- }
-
- @Test
- public void dataChanged_calledBeforeInitialize_ignored() throws RemoteException {
+ public void dataChanged_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.dataChanged(PACKAGE_NAME);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void dataChangedForUser_forwarded() throws RemoteException {
+ public void dataChangedForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.dataChangedForUser(mUserId, PACKAGE_NAME);
@@ -350,7 +364,7 @@
}
@Test
- public void dataChanged_forwarded() throws RemoteException {
+ public void dataChanged_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -360,13 +374,13 @@
}
@Test
- public void clearBackupData_calledBeforeInitialize_ignored() throws RemoteException {
+ public void clearBackupData_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.clearBackupData(TRANSPORT_NAME, PACKAGE_NAME);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void clearBackupDataForUser_forwarded() throws RemoteException {
+ public void clearBackupDataForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.clearBackupDataForUser(mUserId, TRANSPORT_NAME, PACKAGE_NAME);
@@ -375,7 +389,7 @@
}
@Test
- public void clearBackupData_forwarded() throws RemoteException {
+ public void clearBackupData_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -385,13 +399,13 @@
}
@Test
- public void agentConnected_calledBeforeInitialize_ignored() throws RemoteException {
+ public void agentConnected_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.agentConnected(PACKAGE_NAME, mAgentMock);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void agentConnectedForUser_forwarded() throws RemoteException {
+ public void agentConnectedForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.agentConnectedForUser(mUserId, PACKAGE_NAME, mAgentMock);
@@ -400,7 +414,7 @@
}
@Test
- public void agentConnected_forwarded() throws RemoteException {
+ public void agentConnected_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -410,13 +424,13 @@
}
@Test
- public void agentDisconnected_calledBeforeInitialize_ignored() throws RemoteException {
+ public void agentDisconnected_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.agentDisconnected(PACKAGE_NAME);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void agentDisconnectedForUser_forwarded() throws RemoteException {
+ public void agentDisconnectedForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.agentDisconnectedForUser(mUserId, PACKAGE_NAME);
@@ -425,7 +439,7 @@
}
@Test
- public void agentDisconnected_forwarded() throws RemoteException {
+ public void agentDisconnected_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -435,13 +449,13 @@
}
@Test
- public void restoreAtInstall_calledBeforeInitialize_ignored() throws RemoteException {
+ public void restoreAtInstall_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.restoreAtInstall(PACKAGE_NAME, 123);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void restoreAtInstallForUser_forwarded() throws RemoteException {
+ public void restoreAtInstallForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.restoreAtInstallForUser(mUserId, PACKAGE_NAME, 123);
@@ -450,7 +464,7 @@
}
@Test
- public void restoreAtInstall_forwarded() throws RemoteException {
+ public void restoreAtInstall_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -460,13 +474,13 @@
}
@Test
- public void setBackupEnabled_calledBeforeInitialize_ignored() throws RemoteException {
+ public void setBackupEnabled_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.setBackupEnabled(true);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void setBackupEnabledForUser_forwarded() throws RemoteException {
+ public void setBackupEnabledForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.setBackupEnabledForUser(mUserId, true);
@@ -475,7 +489,7 @@
}
@Test
- public void setBackupEnabled_forwardedToCallingUserId() throws RemoteException {
+ public void setBackupEnabled_forwardedToCallingUserId() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -485,13 +499,13 @@
}
@Test
- public void setAutoRestore_calledBeforeInitialize_ignored() throws RemoteException {
+ public void setAutoRestore_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.setAutoRestore(true);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void setAutoRestoreForUser_forwarded() throws RemoteException {
+ public void setAutoRestoreForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.setAutoRestoreForUser(mUserId, true);
@@ -500,7 +514,7 @@
}
@Test
- public void setAutoRestore_forwarded() throws RemoteException {
+ public void setAutoRestore_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -510,13 +524,13 @@
}
@Test
- public void isBackupEnabled_calledBeforeInitialize_ignored() throws RemoteException {
+ public void isBackupEnabled_calledBeforeInitialize_ignored() throws Exception {
assertFalse(mTrampoline.isBackupEnabled());
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void isBackupEnabledForUser_forwarded() throws RemoteException {
+ public void isBackupEnabledForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.isBackupEnabledForUser(mUserId);
@@ -525,7 +539,7 @@
}
@Test
- public void isBackupEnabled_forwardedToCallingUserId() throws RemoteException {
+ public void isBackupEnabled_forwardedToCallingUserId() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -535,39 +549,39 @@
}
@Test
- public void setBackupPassword_calledBeforeInitialize_ignored() throws RemoteException {
+ public void setBackupPassword_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.setBackupPassword(CURRENT_PASSWORD, NEW_PASSWORD);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void setBackupPassword_forwarded() throws RemoteException {
+ public void setBackupPassword_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.setBackupPassword(CURRENT_PASSWORD, NEW_PASSWORD);
verify(mBackupManagerServiceMock).setBackupPassword(CURRENT_PASSWORD, NEW_PASSWORD);
}
@Test
- public void hasBackupPassword_calledBeforeInitialize_ignored() throws RemoteException {
+ public void hasBackupPassword_calledBeforeInitialize_ignored() throws Exception {
assertFalse(mTrampoline.hasBackupPassword());
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void hasBackupPassword_forwarded() throws RemoteException {
+ public void hasBackupPassword_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.hasBackupPassword();
verify(mBackupManagerServiceMock).hasBackupPassword();
}
@Test
- public void backupNow_calledBeforeInitialize_ignored() throws RemoteException {
+ public void backupNow_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.backupNow();
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void backupNowForUser_forwarded() throws RemoteException {
+ public void backupNowForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.backupNowForUser(mUserId);
@@ -576,7 +590,7 @@
}
@Test
- public void backupNow_forwardedToCallingUserId() throws RemoteException {
+ public void backupNow_forwardedToCallingUserId() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -586,7 +600,7 @@
}
@Test
- public void adbBackup_calledBeforeInitialize_ignored() throws RemoteException {
+ public void adbBackup_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.adbBackup(mUserId, mParcelFileDescriptorMock, true, true,
true, true, true, true, true, true,
PACKAGE_NAMES);
@@ -594,7 +608,7 @@
}
@Test
- public void adbBackup_forwarded() throws RemoteException {
+ public void adbBackup_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.adbBackup(mUserId, mParcelFileDescriptorMock, true, true,
true, true, true, true, true, true,
@@ -604,13 +618,13 @@
}
@Test
- public void fullTransportBackup_calledBeforeInitialize_ignored() throws RemoteException {
+ public void fullTransportBackup_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.fullTransportBackupForUser(mUserId, PACKAGE_NAMES);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void fullTransportBackupForUser_forwarded() throws RemoteException {
+ public void fullTransportBackupForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.fullTransportBackupForUser(mUserId, PACKAGE_NAMES);
@@ -619,13 +633,13 @@
}
@Test
- public void adbRestore_calledBeforeInitialize_ignored() throws RemoteException {
+ public void adbRestore_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.adbRestore(mUserId, mParcelFileDescriptorMock);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void adbRestore_forwarded() throws RemoteException {
+ public void adbRestore_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.adbRestore(mUserId, mParcelFileDescriptorMock);
verify(mBackupManagerServiceMock).adbRestore(mUserId, mParcelFileDescriptorMock);
@@ -633,14 +647,14 @@
@Test
public void acknowledgeFullBackupOrRestore_calledBeforeInitialize_ignored()
- throws RemoteException {
+ throws Exception {
mTrampoline.acknowledgeFullBackupOrRestore(123, true, CURRENT_PASSWORD, ENCRYPTION_PASSWORD,
mFullBackupRestoreObserverMock);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void acknowledgeFullBackupOrRestoreForUser_forwarded() throws RemoteException {
+ public void acknowledgeFullBackupOrRestoreForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.acknowledgeFullBackupOrRestoreForUser(
@@ -662,7 +676,7 @@
}
@Test
- public void acknowledgeFullBackupOrRestore_forwarded() throws RemoteException {
+ public void acknowledgeFullBackupOrRestore_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -680,13 +694,13 @@
}
@Test
- public void getCurrentTransport_calledBeforeInitialize_ignored() throws RemoteException {
+ public void getCurrentTransport_calledBeforeInitialize_ignored() throws Exception {
assertNull(mTrampoline.getCurrentTransport());
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void getCurrentTransportForUser_forwarded() throws RemoteException {
+ public void getCurrentTransportForUser_forwarded() throws Exception {
when(mBackupManagerServiceMock.getCurrentTransport(mUserId)).thenReturn(TRANSPORT_NAME);
mTrampoline.initializeService();
@@ -695,7 +709,7 @@
}
@Test
- public void getCurrentTransport_forwarded() throws RemoteException {
+ public void getCurrentTransport_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
when(mBackupManagerServiceMock.getCurrentTransport(mUserId)).thenReturn(TRANSPORT_NAME);
mTrampoline.initializeService();
@@ -705,13 +719,13 @@
}
@Test
- public void listAllTransports_calledBeforeInitialize_ignored() throws RemoteException {
+ public void listAllTransports_calledBeforeInitialize_ignored() throws Exception {
assertNull(mTrampoline.listAllTransports());
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void listAllTransportsForUser_forwarded() throws RemoteException {
+ public void listAllTransportsForUser_forwarded() throws Exception {
when(mBackupManagerServiceMock.listAllTransports(mUserId)).thenReturn(TRANSPORTS);
mTrampoline.initializeService();
@@ -721,7 +735,7 @@
@Test
- public void listAllTransports_forwarded() throws RemoteException {
+ public void listAllTransports_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
when(mBackupManagerServiceMock.listAllTransports(mUserId)).thenReturn(TRANSPORTS);
mTrampoline.initializeService();
@@ -732,13 +746,13 @@
@Test
public void listAllTransportComponentsForUser_calledBeforeInitialize_ignored()
- throws RemoteException {
+ throws Exception {
assertNull(mTrampoline.listAllTransportComponentsForUser(mUserId));
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void listAllTransportComponentsForUser_forwarded() throws RemoteException {
+ public void listAllTransportComponentsForUser_forwarded() throws Exception {
when(mBackupManagerServiceMock.listAllTransportComponents(mUserId)).thenReturn(
TRANSPORT_COMPONENTS);
mTrampoline.initializeService();
@@ -748,13 +762,13 @@
}
@Test
- public void getTransportWhitelist_calledBeforeInitialize_ignored() throws RemoteException {
+ public void getTransportWhitelist_calledBeforeInitialize_ignored() throws Exception {
assertNull(mTrampoline.getTransportWhitelist());
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void getTransportWhitelist_forwarded() throws RemoteException {
+ public void getTransportWhitelist_forwarded() {
when(mBackupManagerServiceMock.getTransportWhitelist()).thenReturn(TRANSPORTS);
mTrampoline.initializeService();
@@ -763,8 +777,7 @@
}
@Test
- public void updateTransportAttributesForUser_calledBeforeInitialize_ignored()
- throws RemoteException {
+ public void updateTransportAttributesForUser_calledBeforeInitialize_ignored() {
mTrampoline.updateTransportAttributesForUser(
mUserId,
TRANSPORT_COMPONENT_NAME,
@@ -778,7 +791,7 @@
}
@Test
- public void updateTransportAttributesForUser_forwarded() throws RemoteException {
+ public void updateTransportAttributesForUser_forwarded() {
when(mBackupManagerServiceMock.getTransportWhitelist()).thenReturn(TRANSPORTS);
mTrampoline.initializeService();
@@ -809,7 +822,7 @@
}
@Test
- public void selectBackupTransportForUser_forwarded() throws RemoteException {
+ public void selectBackupTransportForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.selectBackupTransportForUser(mUserId, TRANSPORT_NAME);
@@ -818,7 +831,7 @@
}
@Test
- public void selectBackupTransport_forwarded() throws RemoteException {
+ public void selectBackupTransport_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -895,7 +908,7 @@
}
@Test
- public void selectBackupTransportAsyncForUser_forwarded() throws RemoteException {
+ public void selectBackupTransportAsyncForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.selectBackupTransportAsyncForUser(mUserId, TRANSPORT_COMPONENT_NAME, null);
@@ -905,13 +918,13 @@
}
@Test
- public void getConfigurationIntent_calledBeforeInitialize_ignored() throws RemoteException {
+ public void getConfigurationIntent_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.getConfigurationIntent(TRANSPORT_NAME);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void getConfigurationIntentForUser_forwarded() throws RemoteException {
+ public void getConfigurationIntentForUser_forwarded() throws Exception {
Intent configurationIntentStub = new Intent();
when(mBackupManagerServiceMock.getConfigurationIntent(mUserId, TRANSPORT_NAME)).thenReturn(
configurationIntentStub);
@@ -924,7 +937,7 @@
}
@Test
- public void getConfigurationIntent_forwarded() throws RemoteException {
+ public void getConfigurationIntent_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
Intent configurationIntentStub = new Intent();
when(mBackupManagerServiceMock.getConfigurationIntent(mUserId, TRANSPORT_NAME)).thenReturn(
@@ -936,13 +949,13 @@
}
@Test
- public void getDestinationString_calledBeforeInitialize_ignored() throws RemoteException {
+ public void getDestinationString_calledBeforeInitialize_ignored() throws Exception {
assertNull(mTrampoline.getDestinationString(TRANSPORT_NAME));
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void getDestinationStringForUser_forwarded() throws RemoteException {
+ public void getDestinationStringForUser_forwarded() throws Exception {
when(mBackupManagerServiceMock.getDestinationString(mUserId, TRANSPORT_NAME)).thenReturn(
DESTINATION_STRING);
mTrampoline.initializeService();
@@ -954,7 +967,7 @@
}
@Test
- public void getDestinationString_forwarded() throws RemoteException {
+ public void getDestinationString_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
when(mBackupManagerServiceMock.getDestinationString(mUserId, TRANSPORT_NAME)).thenReturn(
DESTINATION_STRING);
@@ -965,13 +978,13 @@
}
@Test
- public void getDataManagementIntent_calledBeforeInitialize_ignored() throws RemoteException {
+ public void getDataManagementIntent_calledBeforeInitialize_ignored() throws Exception {
assertNull(mTrampoline.getDataManagementIntent(TRANSPORT_NAME));
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void getDataManagementIntentForUser_forwarded() throws RemoteException {
+ public void getDataManagementIntentForUser_forwarded() throws Exception {
Intent dataManagementIntent = new Intent();
when(mBackupManagerServiceMock.getDataManagementIntent(mUserId, TRANSPORT_NAME)).thenReturn(
dataManagementIntent);
@@ -984,7 +997,7 @@
}
@Test
- public void getDataManagementIntent_forwarded() throws RemoteException {
+ public void getDataManagementIntent_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
Intent dataManagementIntent = new Intent();
when(mBackupManagerServiceMock.getDataManagementIntent(mUserId, TRANSPORT_NAME)).thenReturn(
@@ -996,13 +1009,13 @@
}
@Test
- public void getDataManagementLabel_calledBeforeInitialize_ignored() throws RemoteException {
+ public void getDataManagementLabel_calledBeforeInitialize_ignored() throws Exception {
assertNull(mTrampoline.getDataManagementLabel(TRANSPORT_NAME));
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void getDataManagementLabelForUser_forwarded() throws RemoteException {
+ public void getDataManagementLabelForUser_forwarded() throws Exception {
when(mBackupManagerServiceMock.getDataManagementLabel(mUserId, TRANSPORT_NAME)).thenReturn(
DATA_MANAGEMENT_LABEL);
mTrampoline.initializeService();
@@ -1014,7 +1027,7 @@
}
@Test
- public void getDataManagementLabel_forwarded() throws RemoteException {
+ public void getDataManagementLabel_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
when(mBackupManagerServiceMock.getDataManagementLabel(mUserId, TRANSPORT_NAME)).thenReturn(
DATA_MANAGEMENT_LABEL);
@@ -1025,13 +1038,13 @@
}
@Test
- public void beginRestoreSession_calledBeforeInitialize_ignored() throws RemoteException {
+ public void beginRestoreSession_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.beginRestoreSessionForUser(mUserId, PACKAGE_NAME, TRANSPORT_NAME);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void beginRestoreSessionForUser_forwarded() throws RemoteException {
+ public void beginRestoreSessionForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.beginRestoreSessionForUser(mUserId, PACKAGE_NAME, TRANSPORT_NAME);
@@ -1041,13 +1054,13 @@
}
@Test
- public void opComplete_calledBeforeInitialize_ignored() throws RemoteException {
+ public void opComplete_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.opComplete(1, 2);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void opComplete_forwarded() throws RemoteException {
+ public void opComplete_forwarded() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -1057,14 +1070,13 @@
}
@Test
- public void getAvailableRestoreTokenForUser_calledBeforeInitialize_ignored()
- throws RemoteException {
+ public void getAvailableRestoreTokenForUser_calledBeforeInitialize_ignored() {
assertEquals(0, mTrampoline.getAvailableRestoreTokenForUser(mUserId, PACKAGE_NAME));
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void getAvailableRestoreTokenForUser_forwarded() throws RemoteException {
+ public void getAvailableRestoreTokenForUser_forwarded() {
when(mBackupManagerServiceMock.getAvailableRestoreToken(mUserId, PACKAGE_NAME))
.thenReturn(123L);
mTrampoline.initializeService();
@@ -1074,14 +1086,13 @@
}
@Test
- public void isAppEligibleForBackupForUser_calledBeforeInitialize_ignored()
- throws RemoteException {
+ public void isAppEligibleForBackupForUser_calledBeforeInitialize_ignored() {
assertFalse(mTrampoline.isAppEligibleForBackupForUser(mUserId, PACKAGE_NAME));
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void isAppEligibleForBackupForUser_forwarded() throws RemoteException {
+ public void isAppEligibleForBackupForUser_forwarded() {
when(mBackupManagerServiceMock.isAppEligibleForBackup(mUserId, PACKAGE_NAME))
.thenReturn(true);
mTrampoline.initializeService();
@@ -1098,7 +1109,7 @@
}
@Test
- public void requestBackupForUser_forwarded() throws RemoteException {
+ public void requestBackupForUser_forwarded() throws Exception {
when(mBackupManagerServiceMock.requestBackup(mUserId, PACKAGE_NAMES,
mBackupObserverMock, mBackupManagerMonitorMock, 123)).thenReturn(456);
mTrampoline.initializeService();
@@ -1110,7 +1121,7 @@
}
@Test
- public void requestBackup_forwardedToCallingUserId() throws RemoteException {
+ public void requestBackup_forwardedToCallingUserId() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
when(mBackupManagerServiceMock.requestBackup(NON_USER_SYSTEM, PACKAGE_NAMES,
mBackupObserverMock, mBackupManagerMonitorMock, 123)).thenReturn(456);
@@ -1123,13 +1134,13 @@
}
@Test
- public void cancelBackups_calledBeforeInitialize_ignored() throws RemoteException {
+ public void cancelBackups_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.cancelBackups();
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void cancelBackupsForUser_forwarded() throws RemoteException {
+ public void cancelBackupsForUser_forwarded() throws Exception {
mTrampoline.initializeService();
mTrampoline.cancelBackupsForUser(mUserId);
@@ -1138,7 +1149,7 @@
}
@Test
- public void cancelBackups_forwardedToCallingUserId() throws RemoteException {
+ public void cancelBackups_forwardedToCallingUserId() throws Exception {
TrampolineTestable.sCallingUserId = mUserId;
mTrampoline.initializeService();
@@ -1148,13 +1159,13 @@
}
@Test
- public void beginFullBackup_calledBeforeInitialize_ignored() throws RemoteException {
+ public void beginFullBackup_calledBeforeInitialize_ignored() throws Exception {
mTrampoline.beginFullBackup(mUserId, new FullBackupJob());
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void beginFullBackup_forwarded() throws RemoteException {
+ public void beginFullBackup_forwarded() throws Exception {
FullBackupJob fullBackupJob = new FullBackupJob();
when(mBackupManagerServiceMock.beginFullBackup(mUserId, fullBackupJob)).thenReturn(true);
@@ -1164,20 +1175,20 @@
}
@Test
- public void endFullBackup_calledBeforeInitialize_ignored() throws RemoteException {
+ public void endFullBackup_calledBeforeInitialize_ignored() {
mTrampoline.endFullBackup(mUserId);
verifyNoMoreInteractions(mBackupManagerServiceMock);
}
@Test
- public void endFullBackup_forwarded() throws RemoteException {
+ public void endFullBackup_forwarded() {
mTrampoline.initializeService();
mTrampoline.endFullBackup(mUserId);
verify(mBackupManagerServiceMock).endFullBackup(mUserId);
}
@Test
- public void dump_callerDoesNotHavePermission_ignored() throws RemoteException {
+ public void dump_callerDoesNotHavePermission_ignored() {
when(mContextMock.checkCallingOrSelfPermission(
android.Manifest.permission.DUMP)).thenReturn(
PackageManager.PERMISSION_DENIED);
@@ -1189,7 +1200,7 @@
}
@Test
- public void dump_calledBeforeInitialize_ignored() throws RemoteException {
+ public void dump_calledBeforeInitialize_ignored() {
when(mContextMock.checkCallingOrSelfPermission(
android.Manifest.permission.DUMP)).thenReturn(
PackageManager.PERMISSION_GRANTED);
@@ -1200,7 +1211,7 @@
}
@Test
- public void dump_callerHasPermission_forwarded() throws RemoteException {
+ public void dump_callerHasPermission_forwarded() {
when(mContextMock.checkCallingOrSelfPermission(
android.Manifest.permission.DUMP)).thenReturn(
PackageManager.PERMISSION_GRANTED);
@@ -1213,11 +1224,36 @@
private static class TrampolineTestable extends Trampoline {
static boolean sBackupDisabled = false;
- static File sSuppressFile = null;
static int sCallingUserId = -1;
static int sCallingUid = -1;
static BackupManagerService sBackupManagerServiceMock = null;
private int mCreateServiceCallsCount = 0;
+ private SparseArray<FakeFile> mSuppressFiles = new SparseArray<>();
+
+ private static class FakeFile extends File {
+ private boolean mExists;
+
+ FakeFile(String pathname) {
+ super(pathname);
+ }
+
+ @Override
+ public boolean exists() {
+ return mExists;
+ }
+
+ @Override
+ public boolean delete() {
+ mExists = false;
+ return true;
+ }
+
+ @Override
+ public boolean createNewFile() throws IOException {
+ mExists = true;
+ return true;
+ }
+ }
TrampolineTestable(Context context) {
super(context);
@@ -1229,8 +1265,12 @@
}
@Override
- public File getSuppressFile() {
- return sSuppressFile;
+ public File getSuppressFileForUser(int userId) {
+ if (mSuppressFiles.get(userId) == null) {
+ FakeFile file = new FakeFile(Integer.toString(userId));
+ mSuppressFiles.append(userId, file);
+ }
+ return mSuppressFiles.get(userId);
}
protected int binderGetCallingUserId() {
@@ -1249,6 +1289,11 @@
}
@Override
+ protected void createBackupSuppressFileForUser(int userId) throws IOException {
+ getSuppressFileForUser(userId).createNewFile();
+ }
+
+ @Override
protected void postToHandler(Runnable runnable) {
runnable.run();
}
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java
index 3a6cdc2..a89198a 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java
@@ -147,12 +147,12 @@
}
@Override
- void writeStringSetting(String key, String value) {
+ void writeStringSystemProperty(String key, String value) {
// do nothing
}
@Override
- boolean readBooleanSetting(String key, boolean defVal) {
+ boolean readBooleanSystemProperty(String key, boolean defVal) {
switch (key) {
case Constants.PROPERTY_SYSTEM_AUDIO_MODE_MUTING_ENABLE:
return mMutingEnabled;
diff --git a/services/tests/servicestests/src/com/android/server/pm/LauncherAppsServiceTest.java b/services/tests/servicestests/src/com/android/server/pm/LauncherAppsServiceTest.java
new file mode 100644
index 0000000..d7dc58d
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/pm/LauncherAppsServiceTest.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.pm;
+
+import static org.junit.Assert.assertEquals;
+
+import android.content.pm.PackageParser;
+import android.content.pm.Signature;
+import android.content.pm.SigningInfo;
+import android.platform.test.annotations.Presubmit;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.junit.MockitoJUnitRunner;
+
+@Presubmit
+@RunWith(MockitoJUnitRunner.class)
+public class LauncherAppsServiceTest {
+
+ private static final Signature SIGNATURE_1 = new Signature(new byte[]{0x00, 0x01, 0x02, 0x03});
+ private static final Signature SIGNATURE_2 = new Signature(new byte[]{0x04, 0x05, 0x06, 0x07});
+ private static final Signature SIGNATURE_3 = new Signature(new byte[]{0x08, 0x09, 0x10, 0x11});
+
+ @Test
+ public void testComputePackageCertDigest() {
+ String digest = LauncherAppsService.LauncherAppsImpl.computePackageCertDigest(SIGNATURE_1);
+ assertEquals("A02A05B025B928C039CF1AE7E8EE04E7C190C0DB", digest);
+ }
+
+ @Test
+ public void testGetLatestSignaturesWithSingleCert() {
+ SigningInfo signingInfo = new SigningInfo(
+ new PackageParser.SigningDetails(
+ new Signature[]{SIGNATURE_1},
+ PackageParser.SigningDetails.SignatureSchemeVersion.SIGNING_BLOCK_V3,
+ null,
+ null));
+ Signature[] signatures = LauncherAppsService.LauncherAppsImpl.getLatestSignatures(
+ signingInfo);
+ assertEquals(1, signatures.length);
+ assertEquals(SIGNATURE_1, signatures[0]);
+ }
+
+ @Test
+ public void testGetLatestSignaturesWithMultiCert() {
+ SigningInfo signingInfo = new SigningInfo(
+ new PackageParser.SigningDetails(
+ new Signature[]{SIGNATURE_1, SIGNATURE_2},
+ PackageParser.SigningDetails.SignatureSchemeVersion.SIGNING_BLOCK_V3,
+ null,
+ null));
+ Signature[] signatures = LauncherAppsService.LauncherAppsImpl.getLatestSignatures(
+ signingInfo);
+ assertEquals(2, signatures.length);
+ assertEquals(SIGNATURE_1, signatures[0]);
+ assertEquals(SIGNATURE_2, signatures[1]);
+ }
+
+ @Test
+ public void testGetLatestSignaturesWithCertHistory() {
+ SigningInfo signingInfo = new SigningInfo(
+ new PackageParser.SigningDetails(
+ new Signature[]{SIGNATURE_1},
+ PackageParser.SigningDetails.SignatureSchemeVersion.SIGNING_BLOCK_V3,
+ null,
+ new Signature[]{SIGNATURE_2, SIGNATURE_3}));
+ Signature[] signatures = LauncherAppsService.LauncherAppsImpl.getLatestSignatures(
+ signingInfo);
+ assertEquals(1, signatures.length);
+ assertEquals(SIGNATURE_2, signatures[0]);
+ }
+
+}
diff --git a/services/tests/servicestests/src/com/android/server/pm/PackageInstallerSessionTest.java b/services/tests/servicestests/src/com/android/server/pm/PackageInstallerSessionTest.java
new file mode 100644
index 0000000..73e9613
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/pm/PackageInstallerSessionTest.java
@@ -0,0 +1,305 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.pm;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
+import static org.xmlpull.v1.XmlPullParser.START_TAG;
+
+import android.content.pm.PackageInstaller;
+import android.util.AtomicFile;
+import android.util.Slog;
+import android.util.Xml;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import com.android.internal.os.BackgroundThread;
+import com.android.internal.util.FastXmlSerializer;
+
+import libcore.io.IoUtils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlSerializer;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+@RunWith(AndroidJUnit4.class)
+public class PackageInstallerSessionTest {
+ private File mTmpDir;
+ private AtomicFile mSessionsFile;
+ private static final String TAG_SESSIONS = "sessions";
+
+ @Mock
+ PackageManagerService mMockPackageManagerInternal;
+
+ @Before
+ public void setUp() throws Exception {
+ mTmpDir = IoUtils.createTemporaryDirectory("PackageInstallerSessionTest");
+ mSessionsFile = new AtomicFile(
+ new File(mTmpDir.getAbsolutePath() + "/sessions.xml"), "package-session");
+ MockitoAnnotations.initMocks(this);
+ }
+
+ @Test
+ public void testWriteAndRestoreSessionXmlSimpleSession() {
+ PackageInstallerSession session = createSimpleSession();
+ dumpSession(session);
+ List<PackageInstallerSession> restored = restoreSessions();
+ assertEquals(1, restored.size());
+ assertSessionsEquivalent(session, restored.get(0));
+ }
+
+ @Test
+ public void testWriteAndRestoreSessionXmlStagedSession() {
+ PackageInstallerSession session = createStagedSession();
+ dumpSession(session);
+ List<PackageInstallerSession> restored = restoreSessions();
+ assertEquals(1, restored.size());
+ assertSessionsEquivalent(session, restored.get(0));
+ }
+
+ @Test
+ public void testWriteAndRestoreSessionXmlGrantedPermission() {
+ PackageInstallerSession session = createSessionWithGrantedPermissions();
+ dumpSession(session);
+ List<PackageInstallerSession> restored = restoreSessions();
+ assertEquals(1, restored.size());
+ assertSessionsEquivalent(session, restored.get(0));
+ }
+
+ @Test
+ public void testWriteAndRestoreSessionXmlMultiPackageSessions() {
+ PackageInstallerSession session = createMultiPackageParentSession(123, new int[]{234, 345});
+ PackageInstallerSession childSession1 = createMultiPackageChildSession(234, 123);
+ PackageInstallerSession childSession2 = createMultiPackageChildSession(345, 123);
+ List<PackageInstallerSession> sessionGroup =
+ Arrays.asList(session, childSession1, childSession2);
+ dumpSessions(sessionGroup);
+ List<PackageInstallerSession> restored = restoreSessions();
+ assertEquals(3, restored.size());
+ assertSessionsEquivalent(sessionGroup, restored);
+ }
+
+ private PackageInstallerSession createSimpleSession() {
+ return createSession(false, false, 123, false, PackageInstaller.SessionInfo.INVALID_ID,
+ null);
+ }
+
+ private PackageInstallerSession createStagedSession() {
+ return createSession(true, false, 123, false, PackageInstaller.SessionInfo.INVALID_ID,
+ null);
+ }
+
+ private PackageInstallerSession createSessionWithGrantedPermissions() {
+ return createSession(false, true, 123, false, PackageInstaller.SessionInfo.INVALID_ID,
+ null);
+ }
+
+ private PackageInstallerSession createMultiPackageParentSession(int sessionId,
+ int[] childSessionIds) {
+ return createSession(false, false, sessionId, true,
+ PackageInstaller.SessionInfo.INVALID_ID, childSessionIds);
+ }
+
+ private PackageInstallerSession createMultiPackageChildSession(int sessionId,
+ int parentSessionId) {
+ return createSession(false, false, sessionId, false, parentSessionId, null);
+ }
+
+ private PackageInstallerSession createSession(boolean staged, boolean withGrantedPermissions,
+ int sessionId, boolean isMultiPackage,
+ int parentSessionId, int[] childSessionIds) {
+ PackageInstaller.SessionParams params = new PackageInstaller.SessionParams(
+ PackageInstaller.SessionParams.MODE_FULL_INSTALL);
+ if (staged) {
+ params.isStaged = true;
+ }
+ if (withGrantedPermissions) {
+ params.grantedRuntimePermissions = new String[]{"permission1", "permission2"};
+ }
+ if (isMultiPackage) {
+ params.isMultiPackage = true;
+ }
+ return new PackageInstallerSession(
+ /* callback */ null,
+ /* context */null,
+ /* pm */ mMockPackageManagerInternal,
+ /* sessionProvider */ null,
+ /* looper */ BackgroundThread.getHandler().getLooper(),
+ /* stagingManager */ null,
+ /* sessionId */ sessionId,
+ /* userId */ 456,
+ /* installerPackageName */ "testInstaller",
+ /* installerUid */ -1,
+ /* sessionParams */ params,
+ /* createdMillis */ 0L,
+ /* stageDir */ mTmpDir,
+ /* stageCid */ null,
+ /* prepared */ true,
+ /* sealed */ false, // Setting to true would trigger some PM logic.
+ /* childSessionIds */ childSessionIds != null ? childSessionIds : new int[0],
+ /* parentSessionId */ parentSessionId,
+ /* isReady */ staged ? true : false,
+ /* isFailed */ false,
+ /* isApplied */false,
+ /* stagedSessionErrorCode */ PackageInstaller.SessionInfo.VERIFICATION_FAILED);
+ }
+
+ private void dumpSession(PackageInstallerSession session) {
+ dumpSessions(Arrays.asList(session));
+ }
+
+ private void dumpSessions(List<PackageInstallerSession> sessions) {
+ FileOutputStream fos = null;
+ try {
+ fos = mSessionsFile.startWrite();
+
+ XmlSerializer out = new FastXmlSerializer();
+ out.setOutput(fos, StandardCharsets.UTF_8.name());
+ out.startDocument(null, true);
+ out.startTag(null, TAG_SESSIONS);
+ for (PackageInstallerSession session : sessions) {
+ session.write(out, mTmpDir);
+ }
+ out.endTag(null, TAG_SESSIONS);
+ out.endDocument();
+
+ mSessionsFile.finishWrite(fos);
+ Slog.d("PackageInstallerSessionTest", new String(mSessionsFile.readFully()));
+ } catch (IOException e) {
+ if (fos != null) {
+ mSessionsFile.failWrite(fos);
+ }
+ }
+ }
+
+ // This is roughly the logic used in PackageInstallerService to read the session. Note that
+ // this test stresses readFromXml method from PackageInstallerSession, and doesn't cover the
+ // PackageInstallerService portion of the parsing.
+ private List<PackageInstallerSession> restoreSessions() {
+ List<PackageInstallerSession> ret = new ArrayList<>();
+ FileInputStream fis = null;
+ try {
+ fis = mSessionsFile.openRead();
+ final XmlPullParser in = Xml.newPullParser();
+ in.setInput(fis, StandardCharsets.UTF_8.name());
+
+ int type;
+ while ((type = in.next()) != END_DOCUMENT) {
+ if (type == START_TAG) {
+ final String tag = in.getName();
+ if (PackageInstallerSession.TAG_SESSION.equals(tag)) {
+ final PackageInstallerSession session;
+ try {
+ session = PackageInstallerSession.readFromXml(in, null,
+ null, mMockPackageManagerInternal,
+ BackgroundThread.getHandler().getLooper(), null,
+ mTmpDir, null);
+ ret.add(session);
+ } catch (Exception e) {
+ Slog.e("PackageInstallerSessionTest", "Exception ", e);
+ continue;
+ }
+ }
+ }
+ }
+ } catch (FileNotFoundException e) {
+ // Missing sessions are okay, probably first boot
+ } catch (IOException | XmlPullParserException e) {
+
+ } finally {
+ IoUtils.closeQuietly(fis);
+ }
+ return ret;
+ }
+
+ private void assertSessionParamsEquivalent(PackageInstaller.SessionParams expected,
+ PackageInstaller.SessionParams actual) {
+ assertEquals(expected.mode, actual.mode);
+ assertEquals(expected.installFlags, actual.installFlags);
+ assertEquals(expected.installLocation, actual.installLocation);
+ assertEquals(expected.installReason, actual.installReason);
+ assertEquals(expected.sizeBytes, actual.sizeBytes);
+ assertEquals(expected.appPackageName, actual.appPackageName);
+ assertEquals(expected.appIcon, actual.appIcon);
+ assertEquals(expected.originatingUri, actual.originatingUri);
+ assertEquals(expected.originatingUid, actual.originatingUid);
+ assertEquals(expected.referrerUri, actual.referrerUri);
+ assertEquals(expected.abiOverride, actual.abiOverride);
+ assertEquals(expected.volumeUuid, actual.volumeUuid);
+ assertArrayEquals(expected.grantedRuntimePermissions, actual.grantedRuntimePermissions);
+ assertEquals(expected.installerPackageName, actual.installerPackageName);
+ assertEquals(expected.isMultiPackage, actual.isMultiPackage);
+ assertEquals(expected.isStaged, actual.isStaged);
+ }
+
+ private void assertSessionsEquivalent(List<PackageInstallerSession> expected,
+ List<PackageInstallerSession> actual) {
+ assertEquals(expected.size(), actual.size());
+ for (PackageInstallerSession expectedSession : expected) {
+ boolean foundSession = false;
+ for (PackageInstallerSession actualSession : actual) {
+ if (expectedSession.sessionId == actualSession.sessionId) {
+ // We should only encounter each expected session once.
+ assertFalse(foundSession);
+ foundSession = true;
+ assertSessionsEquivalent(expectedSession, actualSession);
+ }
+ }
+ assertTrue(foundSession);
+ }
+ }
+
+ private void assertSessionsEquivalent(PackageInstallerSession expected,
+ PackageInstallerSession actual) {
+ assertEquals(expected.sessionId, actual.sessionId);
+ assertEquals(expected.userId, actual.userId);
+ assertSessionParamsEquivalent(expected.params, actual.params);
+ assertEquals(expected.getInstallerUid(), actual.getInstallerUid());
+ assertEquals(expected.stageDir.getAbsolutePath(), actual.stageDir.getAbsolutePath());
+ assertEquals(expected.stageCid, actual.stageCid);
+ assertEquals(expected.isPrepared(), actual.isPrepared());
+ assertEquals(expected.isStaged(), actual.isStaged());
+ assertEquals(expected.isStagedSessionApplied(), actual.isStagedSessionApplied());
+ assertEquals(expected.isStagedSessionFailed(), actual.isStagedSessionFailed());
+ assertEquals(expected.isStagedSessionReady(), actual.isStagedSessionReady());
+ assertEquals(expected.getStagedSessionErrorCode(), actual.getStagedSessionErrorCode());
+ assertEquals(expected.isPrepared(), actual.isPrepared());
+ assertEquals(expected.isSealed(), actual.isSealed());
+ assertEquals(expected.isMultiPackage(), actual.isMultiPackage());
+ assertEquals(expected.hasParentSessionId(), actual.hasParentSessionId());
+ assertEquals(expected.getParentSessionId(), actual.getParentSessionId());
+ assertArrayEquals(expected.getChildSessionIds(), actual.getChildSessionIds());
+ }
+}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 94b21af..c0f9b80 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -185,6 +185,9 @@
private NotificationChannel mTestNotificationChannel = new NotificationChannel(
TEST_CHANNEL_ID, TEST_CHANNEL_ID, IMPORTANCE_DEFAULT);
+
+ private static final int NOTIFICATION_LOCATION_UNKNOWN = 0;
+
@Mock
private NotificationListeners mListeners;
@Mock private NotificationAssistants mAssistants;
@@ -2528,11 +2531,13 @@
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
mService.addNotification(r);
- mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), true, true);
+ mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), true, true,
+ NOTIFICATION_LOCATION_UNKNOWN);
verify(mAssistants).notifyAssistantExpansionChangedLocked(eq(r.sbn), eq(true), eq((true)));
assertTrue(mService.getNotificationRecord(r.getKey()).getStats().hasExpanded());
- mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), true, false);
+ mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), true, false,
+ NOTIFICATION_LOCATION_UNKNOWN);
verify(mAssistants).notifyAssistantExpansionChangedLocked(eq(r.sbn), eq(true), eq((false)));
assertTrue(mService.getNotificationRecord(r.getKey()).getStats().hasExpanded());
}
@@ -2542,11 +2547,13 @@
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
mService.addNotification(r);
- mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, true);
+ mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, true,
+ NOTIFICATION_LOCATION_UNKNOWN);
assertFalse(mService.getNotificationRecord(r.getKey()).getStats().hasExpanded());
verify(mAssistants).notifyAssistantExpansionChangedLocked(eq(r.sbn), eq(false), eq((true)));
- mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, false);
+ mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, false,
+ NOTIFICATION_LOCATION_UNKNOWN);
assertFalse(mService.getNotificationRecord(r.getKey()).getStats().hasExpanded());
verify(mAssistants).notifyAssistantExpansionChangedLocked(
eq(r.sbn), eq(false), eq((false)));
@@ -3793,7 +3800,8 @@
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
mService.addNotification(r);
- mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, true);
+ mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, true,
+ NOTIFICATION_LOCATION_UNKNOWN);
NotificationVisibility[] notificationVisibility = new NotificationVisibility[] {
NotificationVisibility.obtain(r.getKey(), 0, 0, true)
};
@@ -3808,7 +3816,8 @@
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
mService.addNotification(r);
- mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, true);
+ mService.mNotificationDelegate.onNotificationExpansionChanged(r.getKey(), false, true,
+ NOTIFICATION_LOCATION_UNKNOWN);
assertEquals(0, mService.countLogSmartSuggestionsVisible);
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
index 946ffb60..d29e3fa 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskSnapshotPersisterTestBase.java
@@ -53,7 +53,7 @@
public void setUp() {
final UserManager um = UserManager.get(getInstrumentation().getTargetContext());
mTestUserId = um.getUserHandle();
- mPersister = new TaskSnapshotPersister(userId -> FILES_DIR);
+ mPersister = new TaskSnapshotPersister(mWm, userId -> FILES_DIR);
mLoader = new TaskSnapshotLoader(mPersister);
mPersister.start();
}
diff --git a/telecomm/java/android/telecom/Conference.java b/telecomm/java/android/telecom/Conference.java
index a39e885..7d1f8ce 100644
--- a/telecomm/java/android/telecom/Conference.java
+++ b/telecomm/java/android/telecom/Conference.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
+import android.net.Uri;
import android.os.Bundle;
import android.os.SystemClock;
import android.telecom.Connection.VideoProvider;
@@ -64,6 +65,10 @@
public void onStatusHintsChanged(Conference conference, StatusHints statusHints) {}
public void onExtrasChanged(Conference c, Bundle extras) {}
public void onExtrasRemoved(Conference c, List<String> keys) {}
+ public void onConferenceStateChanged(Conference c, boolean isConference) {}
+ public void onAddressChanged(Conference c, Uri newAddress, int presentation) {}
+ public void onCallerDisplayNameChanged(
+ Conference c, String callerDisplayName, int presentation) {}
}
private final Set<Listener> mListeners = new CopyOnWriteArraySet<>();
@@ -946,6 +951,62 @@
public void onExtrasChanged(Bundle extras) {}
/**
+ * Set whether Telecom should treat this {@link Conference} as a conference call or if it
+ * should treat it as a single-party call.
+ * This method is used as part of a workaround regarding IMS conference calls and user
+ * expectation. In IMS, once a conference is formed, the UE is connected to an IMS conference
+ * server. If all participants of the conference drop out of the conference except for one, the
+ * UE is still connected to the IMS conference server. At this point, the user logically
+ * assumes they're no longer in a conference, yet the underlying network actually is.
+ * To help provide a better user experiece, IMS conference calls can pretend to actually be a
+ * single-party call when the participant count drops to 1. Although the dialer/phone app
+ * could perform this trickery, it makes sense to do this in Telephony since a fix there will
+ * ensure that bluetooth head units, auto and wearable apps all behave consistently.
+ *
+ * @param isConference {@code true} if this {@link Conference} should be treated like a
+ * conference call, {@code false} if it should be treated like a single-party call.
+ * @hide
+ */
+ public void setConferenceState(boolean isConference) {
+ for (Listener l : mListeners) {
+ l.onConferenceStateChanged(this, isConference);
+ }
+ }
+
+ /**
+ * Sets the address of this {@link Conference}. Used when {@link #setConferenceState(boolean)}
+ * is called to mark a conference temporarily as NOT a conference.
+ *
+ * @param address The new address.
+ * @param presentation The presentation requirements for the address.
+ * See {@link TelecomManager} for valid values.
+ * @hide
+ */
+ public final void setAddress(Uri address, int presentation) {
+ Log.d(this, "setAddress %s", address);
+ for (Listener l : mListeners) {
+ l.onAddressChanged(this, address, presentation);
+ }
+ }
+
+ /**
+ * Sets the caller display name (CNAP) of this {@link Conference}. Used when
+ * {@link #setConferenceState(boolean)} is called to mark a conference temporarily as NOT a
+ * conference.
+ *
+ * @param callerDisplayName The new display name.
+ * @param presentation The presentation requirements for the handle.
+ * See {@link TelecomManager} for valid values.
+ * @hide
+ */
+ public final void setCallerDisplayName(String callerDisplayName, int presentation) {
+ Log.d(this, "setCallerDisplayName %s", callerDisplayName);
+ for (Listener l : mListeners) {
+ l.onCallerDisplayNameChanged(this, callerDisplayName, presentation);
+ }
+ }
+
+ /**
* Handles a change to extras received from Telecom.
*
* @param extras The new extras.
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 4d5f5e1..9bafbe0 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -1254,6 +1254,31 @@
mAdapter.removeExtras(id, keys);
}
}
+
+ @Override
+ public void onConferenceStateChanged(Conference c, boolean isConference) {
+ String id = mIdByConference.get(c);
+ if (id != null) {
+ mAdapter.setConferenceState(id, isConference);
+ }
+ }
+
+ @Override
+ public void onAddressChanged(Conference c, Uri newAddress, int presentation) {
+ String id = mIdByConference.get(c);
+ if (id != null) {
+ mAdapter.setAddress(id, newAddress, presentation);
+ }
+ }
+
+ @Override
+ public void onCallerDisplayNameChanged(Conference c, String callerDisplayName,
+ int presentation) {
+ String id = mIdByConference.get(c);
+ if (id != null) {
+ mAdapter.setCallerDisplayName(id, callerDisplayName, presentation);
+ }
+ }
};
private final Connection.Listener mConnectionListener = new Connection.Listener() {
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapter.java b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
index 520e7ed..6c3f4f3 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapter.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapter.java
@@ -653,4 +653,22 @@
}
}
}
+
+ /**
+ * Sets whether a conference is treated as a conference or a single party call.
+ * See {@link Conference#setConferenceState(boolean)} for more information.
+ *
+ * @param callId The ID of the telecom call.
+ * @param isConference {@code true} if this call should be treated as a conference,
+ * {@code false} otherwise.
+ */
+ void setConferenceState(String callId, boolean isConference) {
+ Log.v(this, "setConferenceState: %s %b", callId, isConference);
+ for (IConnectionServiceAdapter adapter : mAdapters) {
+ try {
+ adapter.setConferenceState(callId, isConference, Log.getExternalSession());
+ } catch (RemoteException ignored) {
+ }
+ }
+ }
}
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
index 78d65e6..f99b218 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -74,6 +74,7 @@
private static final int MSG_ON_RTT_UPGRADE_REQUEST = 33;
private static final int MSG_SET_PHONE_ACCOUNT_CHANGED = 34;
private static final int MSG_CONNECTION_SERVICE_FOCUS_RELEASED = 35;
+ private static final int MSG_SET_CONFERENCE_STATE = 36;
private final IConnectionServiceAdapter mDelegate;
@@ -333,6 +334,14 @@
case MSG_CONNECTION_SERVICE_FOCUS_RELEASED:
mDelegate.onConnectionServiceFocusReleased(null /*Session.Info*/);
break;
+ case MSG_SET_CONFERENCE_STATE:
+ SomeArgs args = (SomeArgs) msg.obj;
+ try {
+ mDelegate.setConferenceState((String) args.arg1, (Boolean) args.arg2,
+ (Session.Info) args.arg3);
+ } finally {
+ args.recycle();
+ }
}
}
};
@@ -615,6 +624,16 @@
public void resetConnectionTime(String callId, Session.Info sessionInfo) {
// Do nothing
}
+
+ @Override
+ public void setConferenceState(String callId, boolean isConference,
+ Session.Info sessionInfo) {
+ SomeArgs args = SomeArgs.obtain();
+ args.arg1 = callId;
+ args.arg2 = isConference;
+ args.arg3 = sessionInfo;
+ mHandler.obtainMessage(MSG_SET_CONFERENCE_STATE, args).sendToTarget();
+ }
};
public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {
diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java
index 9821dcb..744544e 100644
--- a/telecomm/java/android/telecom/RemoteConnectionService.java
+++ b/telecomm/java/android/telecom/RemoteConnectionService.java
@@ -471,6 +471,12 @@
public void resetConnectionTime(String callId, Session.Info sessionInfo) {
// Do nothing
}
+
+ @Override
+ public void setConferenceState(String callId, boolean isConference,
+ Session.Info sessionInfo) {
+ // Do nothing
+ }
};
private final ConnectionServiceAdapterServant mServant =
diff --git a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
index 0157a58..76ac88e 100644
--- a/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
+++ b/telecomm/java/com/android/internal/telecom/IConnectionServiceAdapter.aidl
@@ -123,4 +123,6 @@
void onConnectionServiceFocusReleased(in Session.Info sessionInfo);
void resetConnectionTime(String callIdi, in Session.Info sessionInfo);
+
+ void setConferenceState(String callId, boolean isConference, in Session.Info sessionInfo);
}
diff --git a/telephony/java/android/telephony/DataFailCause.java b/telephony/java/android/telephony/DataFailCause.java
index 26ec6de..85c53f2 100644
--- a/telephony/java/android/telephony/DataFailCause.java
+++ b/telephony/java/android/telephony/DataFailCause.java
@@ -42,7 +42,7 @@
// This series of errors as specified by the standards
// specified in ril.h
- /** Operator determined barring. */
+ /** Operator determined barring. (no retry) */
public static final int OPERATOR_BARRED = 0x08;
/** NAS signalling. */
public static final int NAS_SIGNALLING = 0x0E;
@@ -91,6 +91,11 @@
public static final int FILTER_SYTAX_ERROR = 0x2D;
/** Packet Data Protocol (PDP) without active traffic flow template (TFT). */
public static final int PDP_WITHOUT_ACTIVE_TFT = 0x2E;
+ /**
+ * UE requested to modify QoS parameters or the bearer control mode, which is not compatible
+ * with the selected bearer control mode.
+ */
+ public static final int ACTIVATION_REJECTED_BCM_VIOLATION = 0x30;
/** Packet Data Protocol (PDP) type IPv4 only allowed. */
public static final int ONLY_IPV4_ALLOWED = 0x32; /* no retry */
/** Packet Data Protocol (PDP) type IPv6 only allowed. */
@@ -103,6 +108,27 @@
public static final int PDN_CONN_DOES_NOT_EXIST = 0x36;
/** Multiple connections to a same PDN is not allowed. */
public static final int MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED = 0x37;
+ /**
+ * Network has already initiated the activation, modification, or deactivation of bearer
+ * resources that was requested by the UE.
+ */
+ public static final int COLLISION_WITH_NETWORK_INITIATED_REQUEST = 0x38;
+ /**
+ * Network supports IPv4v6 PDP type only. Non-IP type is not allowed. In LTE mode of operation,
+ * this is a PDN throttling cause code, meaning the UE may throttle further requests to the
+ * same APN.
+ */
+ public static final int ONLY_IPV4V6_ALLOWED = 0x39;
+ /**
+ * Network supports non-IP PDP type only. IPv4, IPv6 and IPv4v6 is not allowed. In LTE mode of
+ * operation, this is a PDN throttling cause code, meaning the UE can throttle further requests
+ * to the same APN.
+ */
+ public static final int ONLY_NON_IP_ALLOWED = 0x3A;
+ /** QCI (QoS Class Identifier) indicated in the UE request cannot be supported. */
+ public static final int UNSUPPORTED_QCI_VALUE = 0x3B;
+ /** Procedure requested by the UE was rejected because the bearer handling is not supported. */
+ public static final int BEARER_HANDLING_NOT_SUPPORTED = 0x3C;
/** Max number of Packet Data Protocol (PDP) context reached. */
public static final int ACTIVE_PDP_CONTEXT_MAX_NUMBER_REACHED = 0x41;
/** Unsupported APN in current public land mobile network (PLMN). */
@@ -146,6 +172,742 @@
public static final int EMM_ACCESS_BARRED_INFINITE_RETRY = 0x79;
/** Authentication failure on emergency call. */
public static final int AUTH_FAILURE_ON_EMERGENCY_CALL = 0x7A;
+ /** Not receiving a DNS address that was mandatory. */
+ public static final int INVALID_DNS_ADDR = 0x7B;
+ /** Not receiving either a PCSCF or a DNS address, one of them being mandatory. */
+ public static final int INVALID_PCSCF_OR_DNS_ADDRESS = 0x7C;
+ /** Emergency call bring up on a different ePDG. */
+ public static final int CALL_PREEMPT_BY_EMERGENCY_APN = 0x7F;
+ /** UE performs a detach or disconnect PDN action based on TE requirements. */
+ public static final int UE_INITIATED_DETACH_OR_DISCONNECT = 0x80;
+
+ /** Reason unspecified for foreign agent rejected MIP (Mobile IP) registration. */
+ public static final int MIP_FA_REASON_UNSPECIFIED = 0x7D0;
+ /** Foreign agent administratively prohibited MIP (Mobile IP) registration. */
+ public static final int MIP_FA_ADMIN_PROHIBITED = 0x7D1;
+ /** Foreign agent rejected MIP (Mobile IP) registration because of insufficient resources. */
+ public static final int MIP_FA_INSUFFICIENT_RESOURCES = 0x7D2;
+ /**
+ * Foreign agent rejected MIP (Mobile IP) registration because of MN-AAA authenticator was
+ * wrong.
+ */
+ public static final int MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7D3;
+ /**
+ * Foreign agent rejected MIP (Mobile IP) registration because of home agent authentication
+ * failure.
+ */
+ public static final int MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE = 0x7D4;
+ /**
+ * Foreign agent rejected MIP (Mobile IP) registration because of requested lifetime was too
+ * long.
+ */
+ public static final int MIP_FA_REQUESTED_LIFETIME_TOO_LONG = 0x7D5;
+ /** Foreign agent rejected MIP (Mobile IP) registration because of malformed request. */
+ public static final int MIP_FA_MALFORMED_REQUEST = 0x7D6;
+ /** Foreign agent rejected MIP (Mobile IP) registration because of malformed reply. */
+ public static final int MIP_FA_MALFORMED_REPLY = 0x7D7;
+ /**
+ * Foreign agent rejected MIP (Mobile IP) registration because of requested encapsulation was
+ * unavailable.
+ */
+ public static final int MIP_FA_ENCAPSULATION_UNAVAILABLE = 0x7D8;
+ /**
+ * Foreign agent rejected MIP (Mobile IP) registration of VJ Header Compression was
+ * unavailable.
+ */
+ public static final int MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE = 0x7D9;
+ /**
+ * Foreign agent rejected MIP (Mobile IP) registration because of reverse tunnel was
+ * unavailable.
+ */
+ public static final int MIP_FA_REVERSE_TUNNEL_UNAVAILABLE = 0x7DA;
+ /**
+ * Foreign agent rejected MIP (Mobile IP) registration because of reverse tunnel was mandatory
+ * but not requested by device.
+ */
+ public static final int MIP_FA_REVERSE_TUNNEL_IS_MANDATORY = 0x7DB;
+ /**
+ * Foreign agent rejected MIP (Mobile IP) registration because of delivery style was not
+ * supported.
+ */
+ public static final int MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED = 0x7DC;
+ /**
+ * Foreign agent rejected MIP (Mobile IP) registration because of missing NAI (Network Access
+ * Identifier).
+ */
+ public static final int MIP_FA_MISSING_NAI = 0x7DD;
+ /** Foreign agent rejected MIP (Mobile IP) registration because of missing Home Agent. */
+ public static final int MIP_FA_MISSING_HOME_AGENT = 0x7DE;
+ /** Foreign agent rejected MIP (Mobile IP) registration because of missing Home Address. */
+ public static final int MIP_FA_MISSING_HOME_ADDRESS = 0x7DF;
+ /** Foreign agent rejected MIP (Mobile IP) registration because of unknown challenge. */
+ public static final int MIP_FA_UNKNOWN_CHALLENGE = 0x7E0;
+ /** Foreign agent rejected MIP (Mobile IP) registration because of missing challenge. */
+ public static final int MIP_FA_MISSING_CHALLENGE = 0x7E1;
+ /** Foreign agent rejected MIP (Mobile IP) registration because of stale challenge. */
+ public static final int MIP_FA_STALE_CHALLENGE = 0x7E2;
+ /** Reason unspecified for home agent rejected MIP (Mobile IP) registration. */
+ public static final int MIP_HA_REASON_UNSPECIFIED = 0x7E3;
+ /** Home agent administratively prohibited MIP (Mobile IP) registration. */
+ public static final int MIP_HA_ADMIN_PROHIBITED = 0x7E4;
+ /** Home agent rejected MIP (Mobile IP) registration because of insufficient resources. */
+ public static final int MIP_HA_INSUFFICIENT_RESOURCES = 0x7E5;
+ /**
+ * Home agent rejected MIP (Mobile IP) registration because of MN-HA authenticator was
+ * wrong.
+ */
+ public static final int MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE = 0x7E6;
+ /**
+ * Home agent rejected MIP (Mobile IP) registration because of foreign agent authentication
+ * failure.
+ */
+ public static final int MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE = 0x7E7;
+ /** Home agent rejected MIP (Mobile IP) registration because of registration id mismatch. */
+ public static final int MIP_HA_REGISTRATION_ID_MISMATCH = 0x7E8;
+ /** Home agent rejected MIP (Mobile IP) registration because of malformed request. */
+ public static final int MIP_HA_MALFORMED_REQUEST = 0x7E9;
+ /** Home agent rejected MIP (Mobile IP) registration because of unknown home agent address. */
+ public static final int MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS = 0x7EA;
+ /**
+ * Home agent rejected MIP (Mobile IP) registration because of reverse tunnel was
+ * unavailable.
+ */
+ public static final int MIP_HA_REVERSE_TUNNEL_UNAVAILABLE = 0x7EB;
+ /**
+ * Home agent rejected MIP (Mobile IP) registration because of reverse tunnel is mandatory but
+ * not requested by device.
+ */
+ public static final int MIP_HA_REVERSE_TUNNEL_IS_MANDATORY = 0x7EC;
+ /** Home agent rejected MIP (Mobile IP) registration because of encapsulation unavailable. */
+ public static final int MIP_HA_ENCAPSULATION_UNAVAILABLE = 0x7ED;
+ /** Tearing down is in progress. */
+ public static final int CLOSE_IN_PROGRESS = 0x7EE;
+ /** Brought down by the network. */
+ public static final int NETWORK_INITIATED_TERMINATION = 0x7EF;
+ /** Another application in modem preempts the data call. */
+ public static final int MODEM_APP_PREEMPTED = 0x7F0;
+ /**
+ * IPV4 PDN is in throttled state due to network providing only IPV6 address during the
+ * previous VSNCP bringup (subs_limited_to_v6).
+ */
+ public static final int PDN_IPV4_CALL_DISALLOWED = 0x7F1;
+ /** IPV4 PDN is in throttled state due to previous VSNCP bringup failure(s). */
+ public static final int PDN_IPV4_CALL_THROTTLED = 0x7F2;
+ /**
+ * IPV6 PDN is in throttled state due to network providing only IPV4 address during the
+ * previous VSNCP bringup (subs_limited_to_v4).
+ */
+ public static final int PDN_IPV6_CALL_DISALLOWED = 0x7F3;
+ /** IPV6 PDN is in throttled state due to previous VSNCP bringup failure(s). */
+ public static final int PDN_IPV6_CALL_THROTTLED = 0x7F4;
+ /** Modem restart. */
+ public static final int MODEM_RESTART = 0x7F5;
+ /** PDP PPP calls are not supported. */
+ public static final int PDP_PPP_NOT_SUPPORTED = 0x7F6;
+ /** RAT on which the data call is attempted/connected is no longer the preferred RAT. */
+ public static final int UNPREFERRED_RAT = 0x7F7;
+ /** Physical link is in the process of cleanup. */
+ public static final int PHYSICAL_LINK_CLOSE_IN_PROGRESS = 0x7F8;
+ /** Interface bring up is attempted for an APN that is yet to be handed over to target RAT. */
+ public static final int APN_PENDING_HANDOVER = 0x7F9;
+ /** APN bearer type in the profile does not match preferred network mode. */
+ public static final int PROFILE_BEARER_INCOMPATIBLE = 0x7FA;
+ /** Card was refreshed or removed. */
+ public static final int SIM_CARD_CHANGED = 0x7FB;
+ /** Device is going into lower power mode or powering down. */
+ public static final int LOW_POWER_MODE_OR_POWERING_DOWN = 0x7FC;
+ /** APN has been disabled. */
+ public static final int APN_DISABLED = 0x7FD;
+ /** Maximum PPP inactivity timer expired. */
+ public static final int MAX_PPP_INACTIVITY_TIMER_EXPIRED = 0x7FE;
+ /** IPv6 address transfer failed. */
+ public static final int IPV6_ADDRESS_TRANSFER_FAILED = 0x7FF;
+ /** Target RAT swap failed. */
+ public static final int TRAT_SWAP_FAILED = 0x800;
+ /** Device falls back from eHRPD to HRPD. */
+ public static final int EHRPD_TO_HRPD_FALLBACK = 0x801;
+ /**
+ * UE is in MIP-only configuration but the MIP configuration fails on call bring up due to
+ * incorrect provisioning.
+ */
+ public static final int MIP_CONFIG_FAILURE = 0x802;
+ /**
+ * PDN inactivity timer expired due to no data transmission in a configurable duration of time.
+ */
+ public static final int PDN_INACTIVITY_TIMER_EXPIRED = 0x803;
+ /**
+ * IPv4 data call bring up is rejected because the UE already maintains the allotted maximum
+ * number of IPv4 data connections.
+ */
+ public static final int MAX_IPV4_CONNECTIONS = 0x804;
+ /**
+ * IPv6 data call bring up is rejected because the UE already maintains the allotted maximum
+ * number of IPv6 data connections.
+ */
+ public static final int MAX_IPV6_CONNECTIONS = 0x805;
+ /**
+ * New PDN bring up is rejected during interface selection because the UE has already allotted
+ * the available interfaces for other PDNs.
+ */
+ public static final int APN_MISMATCH = 0x806;
+ /**
+ * New call bring up is rejected since the existing data call IP type doesn't match the
+ * requested IP.
+ */
+ public static final int IP_VERSION_MISMATCH = 0x807;
+ /** Dial up networking (DUN) call bring up is rejected since UE is in eHRPD RAT. */
+ public static final int DUN_CALL_DISALLOWED = 0x808;
+ /*** Rejected/Brought down since UE is transition between EPC and NONEPC RAT. */
+ public static final int INTERNAL_EPC_NONEPC_TRANSITION = 0x809;
+ /** The current interface is being in use. */
+ public static final int INTERFACE_IN_USE = 0x80A;
+ /** PDN connection to the APN is disallowed on the roaming network. */
+ public static final int APN_DISALLOWED_ON_ROAMING = 0x80B;
+ /** APN-related parameters are changed. */
+ public static final int APN_PARAMETERS_CHANGED = 0x80C;
+ /** PDN is attempted to be brought up with NULL APN but NULL APN is not supported. */
+ public static final int NULL_APN_DISALLOWED = 0x80D;
+ /**
+ * Thermal level increases and causes calls to be torn down when normal mode of operation is
+ * not allowed.
+ */
+ public static final int THERMAL_MITIGATION = 0x80E;
+ /**
+ * PDN Connection to a given APN is disallowed because data is disabled from the device user
+ * interface settings.
+ */
+ public static final int DATA_SETTINGS_DISABLED = 0x80F;
+ /**
+ * PDN Connection to a given APN is disallowed because data roaming is disabled from the device
+ * user interface settings and the UE is roaming.
+ */
+ public static final int DATA_ROAMING_SETTINGS_DISABLED = 0x810;
+ /** DDS (Default data subscription) switch occurs. */
+ public static final int DDS_SWITCHED = 0x811;
+ /** PDN being brought up with an APN that is part of forbidden APN Name list. */
+ public static final int FORBIDDEN_APN_NAME = 0x812;
+ /** Default data subscription switch is in progress. */
+ public static final int DDS_SWITCH_IN_PROGRESS = 0x813;
+ /** Roaming is disallowed during call bring up. */
+ public static final int CALL_DISALLOWED_IN_ROAMING = 0x814;
+ /**
+ * UE is unable to bring up a non-IP data call because the device is not camped on a NB1 cell.
+ */
+ public static final int NON_IP_NOT_SUPPORTED = 0x815;
+ /** Non-IP PDN is in throttled state due to previous VSNCP bringup failure(s). */
+ public static final int PDN_NON_IP_CALL_THROTTLED = 0x816;
+ /** Non-IP PDN is in disallowed state due to the network providing only an IP address. */
+ public static final int PDN_NON_IP_CALL_DISALLOWED = 0x817;
+ /** Device in CDMA locked state. */
+ public static final int CDMA_LOCK = 0x818;
+ /** Received an intercept order from the base station. */
+ public static final int CDMA_INTERCEPT = 0x819;
+ /** Receiving a reorder from the base station. */
+ public static final int CDMA_REORDER = 0x81A;
+ /** Receiving a release from the base station with a SO (Service Option) Reject reason. */
+ public static final int CDMA_RELEASE_DUE_TO_SO_REJECTION = 0x81B;
+ /** Receiving an incoming call from the base station. */
+ public static final int CDMA_INCOMING_CALL = 0x81C;
+ /** Received an alert stop from the base station due to incoming only. */
+ public static final int CDMA_ALERT_STOP = 0x81D;
+ /**
+ * Channel acquisition failures. This indicates that device has failed acquiring all the
+ * channels in the PRL.
+ */
+ public static final int CHANNEL_ACQUISITION_FAILURE = 0x81E;
+ /** Maximum access probes transmitted. */
+ public static final int MAX_ACCESS_PROBE = 0x81F;
+ /** Concurrent service is not supported by base station. */
+ public static final int CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION = 0x820;
+ /** There was no response received from the base station. */
+ public static final int NO_RESPONSE_FROM_BASE_STATION = 0x821;
+ /** The base station rejecting the call. */
+ public static final int REJECTED_BY_BASE_STATION = 0x822;
+ /** The concurrent services requested were not compatible. */
+ public static final int CONCURRENT_SERVICES_INCOMPATIBLE = 0x823;
+ /** Device does not have CDMA service. */
+ public static final int NO_CDMA_SERVICE = 0x824;
+ /** RUIM not being present. */
+ public static final int RUIM_NOT_PRESENT = 0x825;
+ /** Receiving a retry order from the base station. */
+ public static final int CDMA_RETRY_ORDER = 0x826;
+ /** Access blocked by the base station. */
+ public static final int ACCESS_BLOCK = 0x827;
+ /** Access blocked by the base station for all mobile devices. */
+ public static final int ACCESS_BLOCK_ALL = 0x828;
+ /** Maximum access probes for the IS-707B call. */
+ public static final int IS707B_MAX_ACCESS_PROBES = 0x829;
+ /** Put device in thermal emergency. */
+ public static final int THERMAL_EMERGENCY = 0x82A;
+ /** In favor of a voice call or SMS when concurrent voice and data are not supported. */
+ public static final int CONCURRENT_SERVICES_NOT_ALLOWED = 0x82B;
+ /** The other clients rejected incoming call. */
+ public static final int INCOMING_CALL_REJECTED = 0x82C;
+ /** No service on the gateway. */
+ public static final int NO_SERVICE_ON_GATEWAY = 0x82D;
+ /** GPRS context is not available. */
+ public static final int NO_GPRS_CONTEXT = 0x82E;
+ /**
+ * Network refuses service to the MS because either an identity of the MS is not acceptable to
+ * the network or the MS does not pass the authentication check.
+ */
+ public static final int ILLEGAL_MS = 0x82F;
+ /** ME could not be authenticated and the ME used is not acceptable to the network. */
+ public static final int ILLEGAL_ME = 0x830;
+ /** Not allowed to operate either GPRS or non-GPRS services. */
+ public static final int GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED = 0x831;
+ /** MS is not allowed to operate GPRS services. */
+ public static final int GPRS_SERVICES_NOT_ALLOWED = 0x832;
+ /** No matching identity or context could be found in the network. */
+ public static final int MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK = 0x833;
+ /**
+ * Mobile reachable timer has expired, or the GMM context data related to the subscription does
+ * not exist in the SGSN.
+ */
+ public static final int IMPLICITLY_DETACHED = 0x834;
+ /**
+ * UE requests GPRS service, or the network initiates a detach request in a PLMN which does not
+ * offer roaming for GPRS services to that MS.
+ */
+ public static final int PLMN_NOT_ALLOWED = 0x835;
+ /**
+ * MS requests service, or the network initiates a detach request, in a location area where the
+ * HPLMN determines that the MS, by subscription, is not allowed to operate.
+ */
+ public static final int LOCATION_AREA_NOT_ALLOWED = 0x836;
+ /**
+ * UE requests GPRS service or the network initiates a detach request in a PLMN that does not
+ * offer roaming for GPRS services.
+ */
+ public static final int GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN = 0x837;
+ /** PDP context already exists. */
+ public static final int PDP_DUPLICATE = 0x838;
+ /** RAT change on the UE. */
+ public static final int UE_RAT_CHANGE = 0x839;
+ /** Network cannot serve a request from the MS due to congestion. */
+ public static final int CONGESTION = 0x83A;
+ /**
+ * MS requests an establishment of the radio access bearers for all active PDP contexts by
+ * sending a service request message indicating data to the network, but the SGSN does not have
+ * any active PDP context.
+ */
+ public static final int NO_PDP_CONTEXT_ACTIVATED = 0x83B;
+ /** Access class blocking restrictions for the current camped cell. */
+ public static final int ACCESS_CLASS_DSAC_REJECTION = 0x83C;
+ /** SM attempts PDP activation for a maximum of four attempts. */
+ public static final int PDP_ACTIVATE_MAX_RETRY_FAILED = 0x83D;
+ /** Radio access bearer failure. */
+ public static final int RADIO_ACCESS_BEARER_FAILURE = 0x83E;
+ /** Invalid EPS bearer identity in the request. */
+ public static final int ESM_UNKNOWN_EPS_BEARER_CONTEXT = 0x83F;
+ /** Data radio bearer is released by the RRC. */
+ public static final int DRB_RELEASED_BY_RRC = 0x840;
+ /** Indicate the connection was released. */
+ public static final int CONNECTION_RELEASED = 0x841;
+ /** UE is detached. */
+ public static final int EMM_DETACHED = 0x842;
+ /** Attach procedure is rejected by the network. */
+ public static final int EMM_ATTACH_FAILED = 0x843;
+ /** Attach procedure is started for EMC purposes. */
+ public static final int EMM_ATTACH_STARTED = 0x844;
+ /** Service request procedure failure. */
+ public static final int LTE_NAS_SERVICE_REQUEST_FAILED = 0x845;
+ /** Active dedicated bearer was requested using the same default bearer ID. */
+ public static final int DUPLICATE_BEARER_ID = 0x846;
+ /** Collision scenarios for the UE and network-initiated procedures. */
+ public static final int ESM_COLLISION_SCENARIOS = 0x847;
+ /** Bearer must be deactivated to synchronize with the network. */
+ public static final int ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK = 0x848;
+ /** Active dedicated bearer was requested for an existing default bearer. */
+ public static final int ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER = 0x849;
+ /** Bad OTA message is received from the network. */
+ public static final int ESM_BAD_OTA_MESSAGE = 0x84A;
+ /** Download server rejected the call. */
+ public static final int ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL = 0x84B;
+ /** PDN was disconnected by the downlaod server due to IRAT. */
+ public static final int ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT = 0x84C;
+ /** Dedicated bearer will be deactivated regardless of the network response. */
+ public static final int DS_EXPLICIT_DEACTIVATION = 0x84D;
+ /** No specific local cause is mentioned, usually a valid OTA cause. */
+ public static final int ESM_LOCAL_CAUSE_NONE = 0x84E;
+ /** Throttling is not needed for this service request failure. */
+ public static final int LTE_THROTTLING_NOT_REQUIRED = 0x84F;
+ /** Access control list check failure at the lower layer. */
+ public static final int ACCESS_CONTROL_LIST_CHECK_FAILURE = 0x850;
+ /** Service is not allowed on the requested PLMN. */
+ public static final int SERVICE_NOT_ALLOWED_ON_PLMN = 0x851;
+ /** T3417 timer expiration of the service request procedure. */
+ public static final int EMM_T3417_EXPIRED = 0x852;
+ /** Extended service request fails due to expiration of the T3417 EXT timer. */
+ public static final int EMM_T3417_EXT_EXPIRED = 0x853;
+ /** Transmission failure of radio resource control (RRC) uplink data. */
+ public static final int RRC_UPLINK_DATA_TRANSMISSION_FAILURE = 0x854;
+ /** Radio resource control (RRC) uplink data delivery failed due to a handover. */
+ public static final int RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER = 0x855;
+ /** Radio resource control (RRC) uplink data delivery failed due to a connection release. */
+ public static final int RRC_UPLINK_CONNECTION_RELEASE = 0x856;
+ /** Radio resource control (RRC) uplink data delivery failed due to a radio link failure. */
+ public static final int RRC_UPLINK_RADIO_LINK_FAILURE = 0x857;
+ /**
+ * Radio resource control (RRC) is not connected but the non-access stratum (NAS) sends an
+ * uplink data request.
+ */
+ public static final int RRC_UPLINK_ERROR_REQUEST_FROM_NAS = 0x858;
+ /** Radio resource control (RRC) connection failure at access stratum. */
+ public static final int RRC_CONNECTION_ACCESS_STRATUM_FAILURE = 0x859;
+ /**
+ * Radio resource control (RRC) connection establishment is aborted due to another procedure.
+ */
+ public static final int RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS = 0x85A;
+ /** Radio resource control (RRC) connection establishment failed due to access barrred. */
+ public static final int RRC_CONNECTION_ACCESS_BARRED = 0x85B;
+ /**
+ * Radio resource control (RRC) connection establishment failed due to cell reselection at
+ * access stratum.
+ */
+ public static final int RRC_CONNECTION_CELL_RESELECTION = 0x85C;
+ /**
+ * Connection establishment failed due to configuration failure at the radio resource control
+ * (RRC).
+ */
+ public static final int RRC_CONNECTION_CONFIG_FAILURE = 0x85D;
+ /** Radio resource control (RRC) connection could not be established in the time limit. */
+ public static final int RRC_CONNECTION_TIMER_EXPIRED = 0x85E;
+ /**
+ * Connection establishment failed due to a link failure at the radio resource control (RRC).
+ */
+ public static final int RRC_CONNECTION_LINK_FAILURE = 0x85F;
+ /**
+ * Connection establishment failed as the radio resource control (RRC) is not camped on any
+ * cell.
+ */
+ public static final int RRC_CONNECTION_CELL_NOT_CAMPED = 0x860;
+ /**
+ * Connection establishment failed due to a service interval failure at the radio resource
+ * control (RRC).
+ */
+ public static final int RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE = 0x861;
+ /**
+ * Radio resource control (RRC) connection establishment failed due to the network rejecting
+ * the UE connection request.
+ */
+ public static final int RRC_CONNECTION_REJECT_BY_NETWORK = 0x862;
+ /** Normal radio resource control (RRC) connection release. */
+ public static final int RRC_CONNECTION_NORMAL_RELEASE = 0x863;
+ /**
+ * Radio resource control (RRC) connection release failed due to radio link failure conditions.
+ */
+ public static final int RRC_CONNECTION_RADIO_LINK_FAILURE = 0x864;
+ /** Radio resource control (RRC) connection re-establishment failure. */
+ public static final int RRC_CONNECTION_REESTABLISHMENT_FAILURE = 0x865;
+ /** UE is out of service during the call register. */
+ public static final int RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER = 0x866;
+ /**
+ * Connection has been released by the radio resource control (RRC) due to an abort request.
+ */
+ public static final int RRC_CONNECTION_ABORT_REQUEST = 0x867;
+ /**
+ * Radio resource control (RRC) connection released due to a system information block read
+ * error.
+ */
+ public static final int RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR = 0x868;
+ /** Network-initiated detach with reattach. */
+ public static final int NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH = 0x869;
+ /** Network-initiated detach without reattach. */
+ public static final int NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH = 0x86A;
+ /** ESM procedure maximum attempt timeout failure. */
+ public static final int ESM_PROCEDURE_TIME_OUT = 0x86B;
+ /**
+ * No PDP exists with the given connection ID while modifying or deactivating or activation for
+ * an already active PDP.
+ */
+ public static final int INVALID_CONNECTION_ID = 0x86C;
+ /** Maximum NSAPIs have been exceeded during PDP activation. */
+ public static final int MAXIMIUM_NSAPIS_EXCEEDED = 0x86D;
+ /** Primary context for NSAPI does not exist. */
+ public static final int INVALID_PRIMARY_NSAPI = 0x86E;
+ /** Unable to encode the OTA message for MT PDP or deactivate PDP. */
+ public static final int CANNOT_ENCODE_OTA_MESSAGE = 0x86F;
+ /**
+ * Radio access bearer is not established by the lower layers during activation, modification,
+ * or deactivation.
+ */
+ public static final int RADIO_ACCESS_BEARER_SETUP_FAILURE = 0x870;
+ /** Expiration of the PDP establish timer with a maximum of five retries. */
+ public static final int PDP_ESTABLISH_TIMEOUT_EXPIRED = 0x871;
+ /** Expiration of the PDP modify timer with a maximum of four retries. */
+ public static final int PDP_MODIFY_TIMEOUT_EXPIRED = 0x872;
+ /** Expiration of the PDP deactivate timer with a maximum of four retries. */
+ public static final int PDP_INACTIVE_TIMEOUT_EXPIRED = 0x873;
+ /** PDP activation failed due to RRC_ABORT or a forbidden PLMN. */
+ public static final int PDP_LOWERLAYER_ERROR = 0x874;
+ /** MO PDP modify collision when the MT PDP is already in progress. */
+ public static final int PDP_MODIFY_COLLISION = 0x875;
+ /** Maximum size of the L2 message was exceeded. */
+ public static final int MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED = 0x876;
+ /** Non-access stratum (NAS) request was rejected by the network. */
+ public static final int NAS_REQUEST_REJECTED_BY_NETWORK = 0x877;
+ /**
+ * Radio resource control (RRC) connection establishment failure due to an error in the request
+ * message.
+ */
+ public static final int RRC_CONNECTION_INVALID_REQUEST = 0x878;
+ /**
+ * Radio resource control (RRC) connection establishment failure due to a change in the
+ * tracking area ID.
+ */
+ public static final int RRC_CONNECTION_TRACKING_AREA_ID_CHANGED = 0x879;
+ /**
+ * Radio resource control (RRC) connection establishment failure due to the RF was unavailable.
+ */
+ public static final int RRC_CONNECTION_RF_UNAVAILABLE = 0x87A;
+ /**
+ * Radio resource control (RRC) connection was aborted before deactivating the LTE stack due to
+ * a successful LTE to WCDMA/GSM/TD-SCDMA IRAT change.
+ */
+ public static final int RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE = 0x87B;
+ /**
+ * If the UE has an LTE radio link failure before security is established, the radio resource
+ * control (RRC) connection must be released and the UE must return to idle.
+ */
+ public static final int RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE = 0x87C;
+ /**
+ * Radio resource control (RRC) connection was aborted by the non-access stratum (NAS) after an
+ * IRAT to LTE IRAT handover.
+ */
+ public static final int RRC_CONNECTION_ABORTED_AFTER_HANDOVER = 0x87D;
+ /**
+ * Radio resource control (RRC) connection was aborted before deactivating the LTE stack after
+ * a successful LTE to GSM/EDGE IRAT cell change order procedure.
+ */
+ public static final int RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE = 0x87E;
+ /**
+ * Radio resource control (RRC) connection was aborted in the middle of a LTE to GSM IRAT cell
+ * change order procedure.
+ */
+ public static final int RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE = 0x87F;
+ /** IMSI present in the UE is unknown in the home subscriber server. */
+ public static final int IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER = 0x880;
+ /** IMEI of the UE is not accepted by the network. */
+ public static final int IMEI_NOT_ACCEPTED = 0x881;
+ /** EPS and non-EPS services are not allowed by the network. */
+ public static final int EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED = 0x882;
+ /** EPS services are not allowed in the PLMN. */
+ public static final int EPS_SERVICES_NOT_ALLOWED_IN_PLMN = 0x883;
+ /** Mobile switching center is temporarily unreachable. */
+ public static final int MSC_TEMPORARILY_NOT_REACHABLE = 0x884;
+ /** CS domain is not available. */
+ public static final int CS_DOMAIN_NOT_AVAILABLE = 0x885;
+ /** ESM level failure. */
+ public static final int ESM_FAILURE = 0x886;
+ /** MAC level failure. */
+ public static final int MAC_FAILURE = 0x887;
+ /** Synchronization failure. */
+ public static final int SYNCHRONIZATION_FAILURE = 0x888;
+ /** UE security capabilities mismatch. */
+ public static final int UE_SECURITY_CAPABILITIES_MISMATCH = 0x889;
+ /** Unspecified security mode reject. */
+ public static final int SECURITY_MODE_REJECTED = 0x88A;
+ /** Unacceptable non-EPS authentication. */
+ public static final int UNACCEPTABLE_NON_EPS_AUTHENTICATION = 0x88B;
+ /** CS fallback call establishment is not allowed. */
+ public static final int CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED = 0x88C;
+ /** No EPS bearer context was activated. */
+ public static final int NO_EPS_BEARER_CONTEXT_ACTIVATED = 0x88D;
+ /** Invalid EMM state. */
+ public static final int INVALID_EMM_STATE = 0x88E;
+ /** Non-Access Spectrum layer failure. */
+ public static final int NAS_LAYER_FAILURE = 0x88F;
+ /** Multiple PDP call feature is disabled. */
+ public static final int MULTIPLE_PDP_CALL_NOT_ALLOWED = 0x890;
+ /** Data call has been brought down because EMBMS is not enabled at the RRC layer. */
+ public static final int EMBMS_NOT_ENABLED = 0x891;
+ /** Data call was unsuccessfully transferred during the IRAT handover. */
+ public static final int IRAT_HANDOVER_FAILED = 0x892;
+ /** EMBMS data call has been successfully brought down. */
+ public static final int EMBMS_REGULAR_DEACTIVATION = 0x893;
+ /** Test loop-back data call has been successfully brought down. */
+ public static final int TEST_LOOPBACK_REGULAR_DEACTIVATION = 0x894;
+ /** Lower layer registration failure. */
+ public static final int LOWER_LAYER_REGISTRATION_FAILURE = 0x895;
+ /**
+ * Network initiates a detach on LTE with error cause ""data plan has been replenished or has
+ * expired.
+ */
+ public static final int DATA_PLAN_EXPIRED = 0x896;
+ /** UMTS interface is brought down due to handover from UMTS to iWLAN. */
+ public static final int UMTS_HANDOVER_TO_IWLAN = 0x897;
+ /** Received a connection deny due to general or network busy on EVDO network. */
+ public static final int EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY = 0x898;
+ /** Received a connection deny due to billing or authentication failure on EVDO network. */
+ public static final int EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE = 0x899;
+ /** HDR system has been changed due to redirection or the PRL was not preferred. */
+ public static final int EVDO_HDR_CHANGED = 0x89A;
+ /** Device exited HDR due to redirection or the PRL was not preferred. */
+ public static final int EVDO_HDR_EXITED = 0x89B;
+ /** Device does not have an HDR session. */
+ public static final int EVDO_HDR_NO_SESSION = 0x89C;
+ /** It is ending an HDR call origination in favor of a GPS fix. */
+ public static final int EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL = 0x89D;
+ /** Connection setup on the HDR system was time out. */
+ public static final int EVDO_HDR_CONNECTION_SETUP_TIMEOUT = 0x89E;
+ /** Device failed to acquire a co-located HDR for origination. */
+ public static final int FAILED_TO_ACQUIRE_COLOCATED_HDR = 0x89F;
+ /** OTASP commit is in progress. */
+ public static final int OTASP_COMMIT_IN_PROGRESS = 0x8A0;
+ /** Device has no hybrid HDR service. */
+ public static final int NO_HYBRID_HDR_SERVICE = 0x8A1;
+ /** HDR module could not be obtained because of the RF locked. */
+ public static final int HDR_NO_LOCK_GRANTED = 0x8A2;
+ /** DBM or SMS is in progress. */
+ public static final int DBM_OR_SMS_IN_PROGRESS = 0x8A3;
+ /** HDR module released the call due to fade. */
+ public static final int HDR_FADE = 0x8A4;
+ /** HDR system access failure. */
+ public static final int HDR_ACCESS_FAILURE = 0x8A5;
+ /**
+ * P_rev supported by 1 base station is less than 6, which is not supported for a 1X data call.
+ * The UE must be in the footprint of BS which has p_rev >= 6 to support this SO33 call.
+ */
+ public static final int UNSUPPORTED_1X_PREV = 0x8A6;
+ /** Client ended the data call. */
+ public static final int LOCAL_END = 0x8A7;
+ /** Device has no service. */
+ public static final int NO_SERVICE = 0x8A8;
+ /** Device lost the system due to fade. */
+ public static final int FADE = 0x8A9;
+ /** Receiving a release from the base station with no reason. */
+ public static final int NORMAL_RELEASE = 0x8AA;
+ /** Access attempt is already in progress. */
+ public static final int ACCESS_ATTEMPT_ALREADY_IN_PROGRESS = 0x8AB;
+ /** Device is in the process of redirecting or handing off to a different target system. */
+ public static final int REDIRECTION_OR_HANDOFF_IN_PROGRESS = 0x8AC;
+ /** Device is operating in Emergency mode. */
+ public static final int EMERGENCY_MODE = 0x8AD;
+ /** Device is in use (e.g., voice call). */
+ public static final int PHONE_IN_USE = 0x8AE;
+ /**
+ * Device operational mode is different from the mode requested in the traffic channel bring up.
+ */
+ public static final int INVALID_MODE = 0x8AF;
+ /** SIM was marked by the network as invalid for the circuit and/or packet service domain. */
+ public static final int INVALID_SIM_STATE = 0x8B0;
+ /** There is no co-located HDR. */
+ public static final int NO_COLLOCATED_HDR = 0x8B1;
+ /** UE is entering power save mode. */
+ public static final int UE_IS_ENTERING_POWERSAVE_MODE = 0x8B2;
+ /** Dual switch from single standby to dual standby is in progress. */
+ public static final int DUAL_SWITCH = 0x8B3;
+ /**
+ * Data call bring up fails in the PPP setup due to a timeout.
+ * (e.g., an LCP conf ack was not received from the network)
+ */
+ public static final int PPP_TIMEOUT = 0x8B4;
+ /**
+ * Data call bring up fails in the PPP setup due to an authorization failure.
+ * (e.g., authorization is required, but not negotiated with the network during an LCP phase)
+ */
+ public static final int PPP_AUTH_FAILURE = 0x8B5;
+ /** Data call bring up fails in the PPP setup due to an option mismatch. */
+ public static final int PPP_OPTION_MISMATCH = 0x8B6;
+ /** Data call bring up fails in the PPP setup due to a PAP failure. */
+ public static final int PPP_PAP_FAILURE = 0x8B7;
+ /** Data call bring up fails in the PPP setup due to a CHAP failure. */
+ public static final int PPP_CHAP_FAILURE = 0x8B8;
+ /**
+ * Data call bring up fails in the PPP setup because the PPP is in the process of cleaning the
+ * previous PPP session.
+ */
+ public static final int PPP_CLOSE_IN_PROGRESS = 0x8B9;
+ /**
+ * IPv6 interface bring up fails because the network provided only the IPv4 address for the
+ * upcoming PDN permanent client can reattempt a IPv6 call bring up after the IPv4 interface is
+ * also brought down. However, there is no guarantee that the network will provide a IPv6
+ * address.
+ */
+ public static final int LIMITED_TO_IPV4 = 0x8BA;
+ /**
+ * IPv4 interface bring up fails because the network provided only the IPv6 address for the
+ * upcoming PDN permanent client can reattempt a IPv4 call bring up after the IPv6 interface is
+ * also brought down. However there is no guarantee that the network will provide a IPv4
+ * address.
+ */
+ public static final int LIMITED_TO_IPV6 = 0x8BB;
+ /** Data call bring up fails in the VSNCP phase due to a VSNCP timeout error. */
+ public static final int VSNCP_TIMEOUT = 0x8BC;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a general error. It's used when there is
+ * no other specific error code available to report the failure.
+ */
+ public static final int VSNCP_GEN_ERROR = 0x8BD;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request because the requested APN is unauthorized.
+ */
+ public static final int VSNCP_APN_UNATHORIZED = 0x8BE;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request because the PDN limit has been exceeded.
+ */
+ public static final int VSNCP_PDN_LIMIT_EXCEEDED = 0x8BF;
+ /**
+ * Data call bring up fails in the VSNCP phase due to the network rejected the VSNCP
+ * configuration request due to no PDN gateway address.
+ */
+ public static final int VSNCP_NO_PDN_GATEWAY_ADDRESS = 0x8C0;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request because the PDN gateway is unreachable.
+ */
+ public static final int VSNCP_PDN_GATEWAY_UNREACHABLE = 0x8C1;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request due to a PDN gateway reject.
+ */
+ public static final int VSNCP_PDN_GATEWAY_REJECT = 0x8C2;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request with the reason of insufficient parameter.
+ */
+ public static final int VSNCP_INSUFFICIENT_PARAMETERS = 0x8C3;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request with the reason of resource unavailable.
+ */
+ public static final int VSNCP_RESOURCE_UNAVAILABLE = 0x8C4;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request with the reason of administratively prohibited at the HSGW.
+ */
+ public static final int VSNCP_ADMINISTRATIVELY_PROHIBITED = 0x8C5;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of PDN ID in use, or
+ * all existing PDNs are brought down with this end reason because one of the PDN bring up was
+ * rejected by the network with the reason of PDN ID in use.
+ */
+ public static final int VSNCP_PDN_ID_IN_USE = 0x8C6;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request for the reason of subscriber limitation.
+ */
+ public static final int VSNCP_SUBSCRIBER_LIMITATION = 0x8C7;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request because the PDN exists for this APN.
+ */
+ public static final int VSNCP_PDN_EXISTS_FOR_THIS_APN = 0x8C8;
+ /**
+ * Data call bring up fails in the VSNCP phase due to a network rejection of the VSNCP
+ * configuration request with reconnect to this PDN not allowed, or an active data call is
+ * terminated by the network because reconnection to this PDN is not allowed. Upon receiving
+ * this error code from the network, the modem infinitely throttles the PDN until the next
+ * power cycle.
+ */
+ public static final int VSNCP_RECONNECT_NOT_ALLOWED = 0x8C9;
+ /** Device failure to obtain the prefix from the network. */
+ public static final int IPV6_PREFIX_UNAVAILABLE = 0x8CA;
+ /** System preference change back to SRAT during handoff */
+ public static final int HANDOFF_PREFERENCE_CHANGED = 0x8CB;
// OEM sepecific error codes. To be used by OEMs when they don't
// want to reveal error code which would be replaced by ERROR_UNSPECIFIED
@@ -226,12 +988,18 @@
FILTER_SEMANTIC_ERROR,
FILTER_SYTAX_ERROR,
PDP_WITHOUT_ACTIVE_TFT,
+ ACTIVATION_REJECTED_BCM_VIOLATION,
ONLY_IPV4_ALLOWED,
ONLY_IPV6_ALLOWED,
ONLY_SINGLE_BEARER_ALLOWED,
ESM_INFO_NOT_RECEIVED,
PDN_CONN_DOES_NOT_EXIST,
MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED,
+ COLLISION_WITH_NETWORK_INITIATED_REQUEST,
+ ONLY_IPV4V6_ALLOWED,
+ ONLY_NON_IP_ALLOWED,
+ UNSUPPORTED_QCI_VALUE,
+ BEARER_HANDLING_NOT_SUPPORTED,
ACTIVE_PDP_CONTEXT_MAX_NUMBER_REACHED,
UNSUPPORTED_APN_IN_CURRENT_PLMN,
INVALID_TRANSACTION_ID,
@@ -242,7 +1010,7 @@
UNKNOWN_INFO_ELEMENT,
CONDITIONAL_IE_ERROR,
MSG_AND_PROTOCOL_STATE_UNCOMPATIBLE,
- PROTOCOL_ERRORS, /* no retry */
+ PROTOCOL_ERRORS,
APN_TYPE_CONFLICT,
INVALID_PCSCF_ADDR,
INTERNAL_CALL_PREEMPT_BY_HIGH_PRIO_APN,
@@ -254,6 +1022,262 @@
IFACE_AND_POL_FAMILY_MISMATCH,
EMM_ACCESS_BARRED_INFINITE_RETRY,
AUTH_FAILURE_ON_EMERGENCY_CALL,
+ INVALID_DNS_ADDR,
+ INVALID_PCSCF_OR_DNS_ADDRESS,
+ CALL_PREEMPT_BY_EMERGENCY_APN,
+ UE_INITIATED_DETACH_OR_DISCONNECT,
+ MIP_FA_REASON_UNSPECIFIED,
+ MIP_FA_ADMIN_PROHIBITED,
+ MIP_FA_INSUFFICIENT_RESOURCES,
+ MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE,
+ MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE,
+ MIP_FA_REQUESTED_LIFETIME_TOO_LONG,
+ MIP_FA_MALFORMED_REQUEST,
+ MIP_FA_MALFORMED_REPLY,
+ MIP_FA_ENCAPSULATION_UNAVAILABLE,
+ MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE,
+ MIP_FA_REVERSE_TUNNEL_UNAVAILABLE,
+ MIP_FA_REVERSE_TUNNEL_IS_MANDATORY,
+ MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED,
+ MIP_FA_MISSING_NAI,
+ MIP_FA_MISSING_HOME_AGENT,
+ MIP_FA_MISSING_HOME_ADDRESS,
+ MIP_FA_UNKNOWN_CHALLENGE,
+ MIP_FA_MISSING_CHALLENGE,
+ MIP_FA_STALE_CHALLENGE,
+ MIP_HA_REASON_UNSPECIFIED,
+ MIP_HA_ADMIN_PROHIBITED,
+ MIP_HA_INSUFFICIENT_RESOURCES,
+ MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE,
+ MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE,
+ MIP_HA_REGISTRATION_ID_MISMATCH,
+ MIP_HA_MALFORMED_REQUEST,
+ MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS,
+ MIP_HA_REVERSE_TUNNEL_UNAVAILABLE,
+ MIP_HA_REVERSE_TUNNEL_IS_MANDATORY,
+ MIP_HA_ENCAPSULATION_UNAVAILABLE,
+ CLOSE_IN_PROGRESS,
+ NETWORK_INITIATED_TERMINATION,
+ MODEM_APP_PREEMPTED,
+ PDN_IPV4_CALL_DISALLOWED,
+ PDN_IPV4_CALL_THROTTLED,
+ PDN_IPV6_CALL_DISALLOWED,
+ PDN_IPV6_CALL_THROTTLED,
+ MODEM_RESTART,
+ PDP_PPP_NOT_SUPPORTED,
+ UNPREFERRED_RAT,
+ PHYSICAL_LINK_CLOSE_IN_PROGRESS,
+ APN_PENDING_HANDOVER,
+ PROFILE_BEARER_INCOMPATIBLE,
+ SIM_CARD_CHANGED,
+ LOW_POWER_MODE_OR_POWERING_DOWN,
+ APN_DISABLED,
+ MAX_PPP_INACTIVITY_TIMER_EXPIRED,
+ IPV6_ADDRESS_TRANSFER_FAILED,
+ TRAT_SWAP_FAILED,
+ EHRPD_TO_HRPD_FALLBACK,
+ MIP_CONFIG_FAILURE,
+ PDN_INACTIVITY_TIMER_EXPIRED,
+ MAX_IPV4_CONNECTIONS,
+ MAX_IPV6_CONNECTIONS,
+ APN_MISMATCH,
+ IP_VERSION_MISMATCH,
+ DUN_CALL_DISALLOWED,
+ INTERNAL_EPC_NONEPC_TRANSITION,
+ INTERFACE_IN_USE,
+ APN_DISALLOWED_ON_ROAMING,
+ APN_PARAMETERS_CHANGED,
+ NULL_APN_DISALLOWED,
+ THERMAL_MITIGATION,
+ DATA_SETTINGS_DISABLED,
+ DATA_ROAMING_SETTINGS_DISABLED,
+ DDS_SWITCHED,
+ FORBIDDEN_APN_NAME,
+ DDS_SWITCH_IN_PROGRESS,
+ CALL_DISALLOWED_IN_ROAMING,
+ NON_IP_NOT_SUPPORTED,
+ PDN_NON_IP_CALL_THROTTLED,
+ PDN_NON_IP_CALL_DISALLOWED,
+ CDMA_LOCK,
+ CDMA_INTERCEPT,
+ CDMA_REORDER,
+ CDMA_RELEASE_DUE_TO_SO_REJECTION,
+ CDMA_INCOMING_CALL,
+ CDMA_ALERT_STOP,
+ CHANNEL_ACQUISITION_FAILURE,
+ MAX_ACCESS_PROBE,
+ CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION,
+ NO_RESPONSE_FROM_BASE_STATION,
+ REJECTED_BY_BASE_STATION,
+ CONCURRENT_SERVICES_INCOMPATIBLE,
+ NO_CDMA_SERVICE,
+ RUIM_NOT_PRESENT,
+ CDMA_RETRY_ORDER,
+ ACCESS_BLOCK,
+ ACCESS_BLOCK_ALL,
+ IS707B_MAX_ACCESS_PROBES,
+ THERMAL_EMERGENCY,
+ CONCURRENT_SERVICES_NOT_ALLOWED,
+ INCOMING_CALL_REJECTED,
+ NO_SERVICE_ON_GATEWAY,
+ NO_GPRS_CONTEXT,
+ ILLEGAL_MS,
+ ILLEGAL_ME,
+ GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED,
+ GPRS_SERVICES_NOT_ALLOWED,
+ MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK,
+ IMPLICITLY_DETACHED,
+ PLMN_NOT_ALLOWED,
+ LOCATION_AREA_NOT_ALLOWED,
+ GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN,
+ PDP_DUPLICATE,
+ UE_RAT_CHANGE,
+ CONGESTION,
+ NO_PDP_CONTEXT_ACTIVATED,
+ ACCESS_CLASS_DSAC_REJECTION,
+ PDP_ACTIVATE_MAX_RETRY_FAILED,
+ RADIO_ACCESS_BEARER_FAILURE,
+ ESM_UNKNOWN_EPS_BEARER_CONTEXT,
+ DRB_RELEASED_BY_RRC,
+ CONNECTION_RELEASED,
+ EMM_DETACHED,
+ EMM_ATTACH_FAILED,
+ EMM_ATTACH_STARTED,
+ LTE_NAS_SERVICE_REQUEST_FAILED,
+ DUPLICATE_BEARER_ID,
+ ESM_COLLISION_SCENARIOS,
+ ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK,
+ ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER,
+ ESM_BAD_OTA_MESSAGE,
+ ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL,
+ ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT,
+ DS_EXPLICIT_DEACTIVATION,
+ ESM_LOCAL_CAUSE_NONE,
+ LTE_THROTTLING_NOT_REQUIRED,
+ ACCESS_CONTROL_LIST_CHECK_FAILURE,
+ SERVICE_NOT_ALLOWED_ON_PLMN,
+ EMM_T3417_EXPIRED,
+ EMM_T3417_EXT_EXPIRED,
+ RRC_UPLINK_DATA_TRANSMISSION_FAILURE,
+ RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER,
+ RRC_UPLINK_CONNECTION_RELEASE,
+ RRC_UPLINK_RADIO_LINK_FAILURE,
+ RRC_UPLINK_ERROR_REQUEST_FROM_NAS,
+ RRC_CONNECTION_ACCESS_STRATUM_FAILURE,
+ RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS,
+ RRC_CONNECTION_ACCESS_BARRED,
+ RRC_CONNECTION_CELL_RESELECTION,
+ RRC_CONNECTION_CONFIG_FAILURE,
+ RRC_CONNECTION_TIMER_EXPIRED,
+ RRC_CONNECTION_LINK_FAILURE,
+ RRC_CONNECTION_CELL_NOT_CAMPED,
+ RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE,
+ RRC_CONNECTION_REJECT_BY_NETWORK,
+ RRC_CONNECTION_NORMAL_RELEASE,
+ RRC_CONNECTION_RADIO_LINK_FAILURE,
+ RRC_CONNECTION_REESTABLISHMENT_FAILURE,
+ RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER,
+ RRC_CONNECTION_ABORT_REQUEST,
+ RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR,
+ NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH,
+ NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH,
+ ESM_PROCEDURE_TIME_OUT,
+ INVALID_CONNECTION_ID,
+ MAXIMIUM_NSAPIS_EXCEEDED,
+ INVALID_PRIMARY_NSAPI,
+ CANNOT_ENCODE_OTA_MESSAGE,
+ RADIO_ACCESS_BEARER_SETUP_FAILURE,
+ PDP_ESTABLISH_TIMEOUT_EXPIRED,
+ PDP_MODIFY_TIMEOUT_EXPIRED,
+ PDP_INACTIVE_TIMEOUT_EXPIRED,
+ PDP_LOWERLAYER_ERROR,
+ PDP_MODIFY_COLLISION,
+ MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED,
+ NAS_REQUEST_REJECTED_BY_NETWORK,
+ RRC_CONNECTION_INVALID_REQUEST,
+ RRC_CONNECTION_TRACKING_AREA_ID_CHANGED,
+ RRC_CONNECTION_RF_UNAVAILABLE,
+ RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE,
+ RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE,
+ RRC_CONNECTION_ABORTED_AFTER_HANDOVER,
+ RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE,
+ RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE,
+ IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER,
+ IMEI_NOT_ACCEPTED,
+ EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED,
+ EPS_SERVICES_NOT_ALLOWED_IN_PLMN,
+ MSC_TEMPORARILY_NOT_REACHABLE,
+ CS_DOMAIN_NOT_AVAILABLE,
+ ESM_FAILURE,
+ MAC_FAILURE,
+ SYNCHRONIZATION_FAILURE,
+ UE_SECURITY_CAPABILITIES_MISMATCH,
+ SECURITY_MODE_REJECTED,
+ UNACCEPTABLE_NON_EPS_AUTHENTICATION,
+ CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED,
+ NO_EPS_BEARER_CONTEXT_ACTIVATED,
+ INVALID_EMM_STATE,
+ NAS_LAYER_FAILURE,
+ MULTIPLE_PDP_CALL_NOT_ALLOWED,
+ EMBMS_NOT_ENABLED,
+ IRAT_HANDOVER_FAILED,
+ EMBMS_REGULAR_DEACTIVATION,
+ TEST_LOOPBACK_REGULAR_DEACTIVATION,
+ LOWER_LAYER_REGISTRATION_FAILURE,
+ DATA_PLAN_EXPIRED,
+ UMTS_HANDOVER_TO_IWLAN,
+ EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY,
+ EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE,
+ EVDO_HDR_CHANGED,
+ EVDO_HDR_EXITED,
+ EVDO_HDR_NO_SESSION,
+ EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL,
+ EVDO_HDR_CONNECTION_SETUP_TIMEOUT,
+ FAILED_TO_ACQUIRE_COLOCATED_HDR,
+ OTASP_COMMIT_IN_PROGRESS,
+ NO_HYBRID_HDR_SERVICE,
+ HDR_NO_LOCK_GRANTED,
+ DBM_OR_SMS_IN_PROGRESS,
+ HDR_FADE,
+ HDR_ACCESS_FAILURE,
+ UNSUPPORTED_1X_PREV,
+ LOCAL_END,
+ NO_SERVICE,
+ FADE,
+ NORMAL_RELEASE,
+ ACCESS_ATTEMPT_ALREADY_IN_PROGRESS,
+ REDIRECTION_OR_HANDOFF_IN_PROGRESS,
+ EMERGENCY_MODE,
+ PHONE_IN_USE,
+ INVALID_MODE,
+ INVALID_SIM_STATE,
+ NO_COLLOCATED_HDR,
+ UE_IS_ENTERING_POWERSAVE_MODE,
+ DUAL_SWITCH,
+ PPP_TIMEOUT,
+ PPP_AUTH_FAILURE,
+ PPP_OPTION_MISMATCH,
+ PPP_PAP_FAILURE,
+ PPP_CHAP_FAILURE,
+ PPP_CLOSE_IN_PROGRESS,
+ LIMITED_TO_IPV4,
+ LIMITED_TO_IPV6,
+ VSNCP_TIMEOUT,
+ VSNCP_GEN_ERROR,
+ VSNCP_APN_UNATHORIZED,
+ VSNCP_PDN_LIMIT_EXCEEDED,
+ VSNCP_NO_PDN_GATEWAY_ADDRESS,
+ VSNCP_PDN_GATEWAY_UNREACHABLE,
+ VSNCP_PDN_GATEWAY_REJECT,
+ VSNCP_INSUFFICIENT_PARAMETERS,
+ VSNCP_RESOURCE_UNAVAILABLE,
+ VSNCP_ADMINISTRATIVELY_PROHIBITED,
+ VSNCP_PDN_ID_IN_USE,
+ VSNCP_SUBSCRIBER_LIMITATION,
+ VSNCP_PDN_EXISTS_FOR_THIS_APN,
+ VSNCP_RECONNECT_NOT_ALLOWED,
+ IPV6_PREFIX_UNAVAILABLE,
+ HANDOFF_PREFERENCE_CHANGED,
OEM_DCFAILCAUSE_1,
OEM_DCFAILCAUSE_2,
OEM_DCFAILCAUSE_3,
@@ -317,6 +1341,7 @@
sFailCauseMap.put(FILTER_SEMANTIC_ERROR, "FILTER_SEMANTIC_ERROR");
sFailCauseMap.put(FILTER_SYTAX_ERROR, "FILTER_SYTAX_ERROR");
sFailCauseMap.put(PDP_WITHOUT_ACTIVE_TFT, "PDP_WITHOUT_ACTIVE_TFT");
+ sFailCauseMap.put(ACTIVATION_REJECTED_BCM_VIOLATION, "ACTIVATION_REJECTED_BCM_VIOLATION");
sFailCauseMap.put(ONLY_IPV4_ALLOWED, "ONLY_IPV4_ALLOWED");
sFailCauseMap.put(ONLY_IPV6_ALLOWED, "ONLY_IPV6_ALLOWED");
sFailCauseMap.put(ONLY_SINGLE_BEARER_ALLOWED, "ONLY_SINGLE_BEARER_ALLOWED");
@@ -324,6 +1349,12 @@
sFailCauseMap.put(PDN_CONN_DOES_NOT_EXIST, "PDN_CONN_DOES_NOT_EXIST");
sFailCauseMap.put(MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED,
"MULTI_CONN_TO_SAME_PDN_NOT_ALLOWED");
+ sFailCauseMap.put(COLLISION_WITH_NETWORK_INITIATED_REQUEST,
+ "COLLISION_WITH_NETWORK_INITIATED_REQUEST");
+ sFailCauseMap.put(ONLY_IPV4V6_ALLOWED, "ONLY_IPV4V6_ALLOWED");
+ sFailCauseMap.put(ONLY_NON_IP_ALLOWED, "ONLY_NON_IP_ALLOWED");
+ sFailCauseMap.put(UNSUPPORTED_QCI_VALUE, "UNSUPPORTED_QCI_VALUE");
+ sFailCauseMap.put(BEARER_HANDLING_NOT_SUPPORTED, "BEARER_HANDLING_NOT_SUPPORTED");
sFailCauseMap.put(ACTIVE_PDP_CONTEXT_MAX_NUMBER_REACHED,
"ACTIVE_PDP_CONTEXT_MAX_NUMBER_REACHED");
sFailCauseMap.put(UNSUPPORTED_APN_IN_CURRENT_PLMN,
@@ -353,6 +1384,301 @@
"EMM_ACCESS_BARRED_INFINITE_RETRY");
sFailCauseMap.put(AUTH_FAILURE_ON_EMERGENCY_CALL,
"AUTH_FAILURE_ON_EMERGENCY_CALL");
+ sFailCauseMap.put(INVALID_DNS_ADDR, "INVALID_DNS_ADDR");
+ sFailCauseMap.put(INVALID_PCSCF_OR_DNS_ADDRESS, "INVALID_PCSCF_OR_DNS_ADDRESS");
+ sFailCauseMap.put(CALL_PREEMPT_BY_EMERGENCY_APN, "CALL_PREEMPT_BY_EMERGENCY_APN");
+ sFailCauseMap.put(UE_INITIATED_DETACH_OR_DISCONNECT, "UE_INITIATED_DETACH_OR_DISCONNECT");
+ sFailCauseMap.put(MIP_FA_REASON_UNSPECIFIED, "MIP_FA_REASON_UNSPECIFIED");
+ sFailCauseMap.put(MIP_FA_ADMIN_PROHIBITED, "MIP_FA_ADMIN_PROHIBITED");
+ sFailCauseMap.put(MIP_FA_INSUFFICIENT_RESOURCES, "MIP_FA_INSUFFICIENT_RESOURCES");
+ sFailCauseMap.put(MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE,
+ "MIP_FA_MOBILE_NODE_AUTHENTICATION_FAILURE");
+ sFailCauseMap.put(MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE,
+ "MIP_FA_HOME_AGENT_AUTHENTICATION_FAILURE");
+ sFailCauseMap.put(MIP_FA_REQUESTED_LIFETIME_TOO_LONG, "MIP_FA_REQUESTED_LIFETIME_TOO_LONG");
+ sFailCauseMap.put(MIP_FA_MALFORMED_REQUEST, "MIP_FA_MALFORMED_REQUEST");
+ sFailCauseMap.put(MIP_FA_MALFORMED_REPLY, "MIP_FA_MALFORMED_REPLY");
+ sFailCauseMap.put(MIP_FA_ENCAPSULATION_UNAVAILABLE, "MIP_FA_ENCAPSULATION_UNAVAILABLE");
+ sFailCauseMap.put(MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE,
+ "MIP_FA_VJ_HEADER_COMPRESSION_UNAVAILABLE");
+ sFailCauseMap.put(MIP_FA_REVERSE_TUNNEL_UNAVAILABLE, "MIP_FA_REVERSE_TUNNEL_UNAVAILABLE");
+ sFailCauseMap.put(MIP_FA_REVERSE_TUNNEL_IS_MANDATORY, "MIP_FA_REVERSE_TUNNEL_IS_MANDATORY");
+ sFailCauseMap.put(MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED,
+ "MIP_FA_DELIVERY_STYLE_NOT_SUPPORTED");
+ sFailCauseMap.put(MIP_FA_MISSING_NAI, "MIP_FA_MISSING_NAI");
+ sFailCauseMap.put(MIP_FA_MISSING_HOME_AGENT, "MIP_FA_MISSING_HOME_AGENT");
+ sFailCauseMap.put(MIP_FA_MISSING_HOME_ADDRESS, "MIP_FA_MISSING_HOME_ADDRESS");
+ sFailCauseMap.put(MIP_FA_UNKNOWN_CHALLENGE, "MIP_FA_UNKNOWN_CHALLENGE");
+ sFailCauseMap.put(MIP_FA_MISSING_CHALLENGE, "MIP_FA_MISSING_CHALLENGE");
+ sFailCauseMap.put(MIP_FA_STALE_CHALLENGE, "MIP_FA_STALE_CHALLENGE");
+ sFailCauseMap.put(MIP_HA_REASON_UNSPECIFIED, "MIP_HA_REASON_UNSPECIFIED");
+ sFailCauseMap.put(MIP_HA_ADMIN_PROHIBITED, "MIP_HA_ADMIN_PROHIBITED");
+ sFailCauseMap.put(MIP_HA_INSUFFICIENT_RESOURCES, "MIP_HA_INSUFFICIENT_RESOURCES");
+ sFailCauseMap.put(MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE,
+ "MIP_HA_MOBILE_NODE_AUTHENTICATION_FAILURE");
+ sFailCauseMap.put(MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE,
+ "MIP_HA_FOREIGN_AGENT_AUTHENTICATION_FAILURE");
+ sFailCauseMap.put(MIP_HA_REGISTRATION_ID_MISMATCH, "MIP_HA_REGISTRATION_ID_MISMATCH");
+ sFailCauseMap.put(MIP_HA_MALFORMED_REQUEST, "MIP_HA_MALFORMED_REQUEST");
+ sFailCauseMap.put(MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS, "MIP_HA_UNKNOWN_HOME_AGENT_ADDRESS");
+ sFailCauseMap.put(MIP_HA_REVERSE_TUNNEL_UNAVAILABLE, "MIP_HA_REVERSE_TUNNEL_UNAVAILABLE");
+ sFailCauseMap.put(MIP_HA_REVERSE_TUNNEL_IS_MANDATORY, "MIP_HA_REVERSE_TUNNEL_IS_MANDATORY");
+ sFailCauseMap.put(MIP_HA_ENCAPSULATION_UNAVAILABLE, "MIP_HA_ENCAPSULATION_UNAVAILABLE");
+ sFailCauseMap.put(CLOSE_IN_PROGRESS, "CLOSE_IN_PROGRESS");
+ sFailCauseMap.put(NETWORK_INITIATED_TERMINATION, "NETWORK_INITIATED_TERMINATION");
+ sFailCauseMap.put(MODEM_APP_PREEMPTED, "MODEM_APP_PREEMPTED");
+ sFailCauseMap.put(PDN_IPV4_CALL_DISALLOWED, "PDN_IPV4_CALL_DISALLOWED");
+ sFailCauseMap.put(PDN_IPV4_CALL_THROTTLED, "PDN_IPV4_CALL_THROTTLED");
+ sFailCauseMap.put(PDN_IPV6_CALL_DISALLOWED, "PDN_IPV6_CALL_DISALLOWED");
+ sFailCauseMap.put(PDN_IPV6_CALL_THROTTLED, "PDN_IPV6_CALL_THROTTLED");
+ sFailCauseMap.put(MODEM_RESTART, "MODEM_RESTART");
+ sFailCauseMap.put(PDP_PPP_NOT_SUPPORTED, "PDP_PPP_NOT_SUPPORTED");
+ sFailCauseMap.put(UNPREFERRED_RAT, "UNPREFERRED_RAT");
+ sFailCauseMap.put(PHYSICAL_LINK_CLOSE_IN_PROGRESS, "PHYSICAL_LINK_CLOSE_IN_PROGRESS");
+ sFailCauseMap.put(APN_PENDING_HANDOVER, "APN_PENDING_HANDOVER");
+ sFailCauseMap.put(PROFILE_BEARER_INCOMPATIBLE, "PROFILE_BEARER_INCOMPATIBLE");
+ sFailCauseMap.put(SIM_CARD_CHANGED, "SIM_CARD_CHANGED");
+ sFailCauseMap.put(LOW_POWER_MODE_OR_POWERING_DOWN, "LOW_POWER_MODE_OR_POWERING_DOWN");
+ sFailCauseMap.put(APN_DISABLED, "APN_DISABLED");
+ sFailCauseMap.put(MAX_PPP_INACTIVITY_TIMER_EXPIRED, "MAX_PPP_INACTIVITY_TIMER_EXPIRED");
+ sFailCauseMap.put(IPV6_ADDRESS_TRANSFER_FAILED, "IPV6_ADDRESS_TRANSFER_FAILED");
+ sFailCauseMap.put(TRAT_SWAP_FAILED, "TRAT_SWAP_FAILED");
+ sFailCauseMap.put(EHRPD_TO_HRPD_FALLBACK, "EHRPD_TO_HRPD_FALLBACK");
+ sFailCauseMap.put(MIP_CONFIG_FAILURE, "MIP_CONFIG_FAILURE");
+ sFailCauseMap.put(PDN_INACTIVITY_TIMER_EXPIRED, "PDN_INACTIVITY_TIMER_EXPIRED");
+ sFailCauseMap.put(MAX_IPV4_CONNECTIONS, "MAX_IPV4_CONNECTIONS");
+ sFailCauseMap.put(MAX_IPV6_CONNECTIONS, "MAX_IPV6_CONNECTIONS");
+ sFailCauseMap.put(APN_MISMATCH, "APN_MISMATCH");
+ sFailCauseMap.put(IP_VERSION_MISMATCH, "IP_VERSION_MISMATCH");
+ sFailCauseMap.put(DUN_CALL_DISALLOWED, "DUN_CALL_DISALLOWED");
+ sFailCauseMap.put(INTERNAL_EPC_NONEPC_TRANSITION, "INTERNAL_EPC_NONEPC_TRANSITION");
+ sFailCauseMap.put(INTERFACE_IN_USE, "INTERFACE_IN_USE");
+ sFailCauseMap.put(APN_DISALLOWED_ON_ROAMING, "APN_DISALLOWED_ON_ROAMING");
+ sFailCauseMap.put(APN_PARAMETERS_CHANGED, "APN_PARAMETERS_CHANGED");
+ sFailCauseMap.put(NULL_APN_DISALLOWED, "NULL_APN_DISALLOWED");
+ sFailCauseMap.put(THERMAL_MITIGATION, "THERMAL_MITIGATION");
+ sFailCauseMap.put(DATA_SETTINGS_DISABLED, "DATA_SETTINGS_DISABLED");
+ sFailCauseMap.put(DATA_ROAMING_SETTINGS_DISABLED, "DATA_ROAMING_SETTINGS_DISABLED");
+ sFailCauseMap.put(DDS_SWITCHED, "DDS_SWITCHED");
+ sFailCauseMap.put(FORBIDDEN_APN_NAME, "FORBIDDEN_APN_NAME");
+ sFailCauseMap.put(DDS_SWITCH_IN_PROGRESS, "DDS_SWITCH_IN_PROGRESS");
+ sFailCauseMap.put(CALL_DISALLOWED_IN_ROAMING, "CALL_DISALLOWED_IN_ROAMING");
+ sFailCauseMap.put(NON_IP_NOT_SUPPORTED, "NON_IP_NOT_SUPPORTED");
+ sFailCauseMap.put(PDN_NON_IP_CALL_THROTTLED, "PDN_NON_IP_CALL_THROTTLED");
+ sFailCauseMap.put(PDN_NON_IP_CALL_DISALLOWED, "PDN_NON_IP_CALL_DISALLOWED");
+ sFailCauseMap.put(CDMA_LOCK, "CDMA_LOCK");
+ sFailCauseMap.put(CDMA_INTERCEPT, "CDMA_INTERCEPT");
+ sFailCauseMap.put(CDMA_REORDER, "CDMA_REORDER");
+ sFailCauseMap.put(CDMA_RELEASE_DUE_TO_SO_REJECTION, "CDMA_RELEASE_DUE_TO_SO_REJECTION");
+ sFailCauseMap.put(CDMA_INCOMING_CALL, "CDMA_INCOMING_CALL");
+ sFailCauseMap.put(CDMA_ALERT_STOP, "CDMA_ALERT_STOP");
+ sFailCauseMap.put(CHANNEL_ACQUISITION_FAILURE, "CHANNEL_ACQUISITION_FAILURE");
+ sFailCauseMap.put(MAX_ACCESS_PROBE, "MAX_ACCESS_PROBE");
+ sFailCauseMap.put(CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION,
+ "CONCURRENT_SERVICE_NOT_SUPPORTED_BY_BASE_STATION");
+ sFailCauseMap.put(NO_RESPONSE_FROM_BASE_STATION, "NO_RESPONSE_FROM_BASE_STATION");
+ sFailCauseMap.put(REJECTED_BY_BASE_STATION, "REJECTED_BY_BASE_STATION");
+ sFailCauseMap.put(CONCURRENT_SERVICES_INCOMPATIBLE, "CONCURRENT_SERVICES_INCOMPATIBLE");
+ sFailCauseMap.put(NO_CDMA_SERVICE, "NO_CDMA_SERVICE");
+ sFailCauseMap.put(RUIM_NOT_PRESENT, "RUIM_NOT_PRESENT");
+ sFailCauseMap.put(CDMA_RETRY_ORDER, "CDMA_RETRY_ORDER");
+ sFailCauseMap.put(ACCESS_BLOCK, "ACCESS_BLOCK");
+ sFailCauseMap.put(ACCESS_BLOCK_ALL, "ACCESS_BLOCK_ALL");
+ sFailCauseMap.put(IS707B_MAX_ACCESS_PROBES, "IS707B_MAX_ACCESS_PROBES");
+ sFailCauseMap.put(THERMAL_EMERGENCY, "THERMAL_EMERGENCY");
+ sFailCauseMap.put(CONCURRENT_SERVICES_NOT_ALLOWED, "CONCURRENT_SERVICES_NOT_ALLOWED");
+ sFailCauseMap.put(INCOMING_CALL_REJECTED, "INCOMING_CALL_REJECTED");
+ sFailCauseMap.put(NO_SERVICE_ON_GATEWAY, "NO_SERVICE_ON_GATEWAY");
+ sFailCauseMap.put(NO_GPRS_CONTEXT, "NO_GPRS_CONTEXT");
+ sFailCauseMap.put(ILLEGAL_MS, "ILLEGAL_MS");
+ sFailCauseMap.put(ILLEGAL_ME, "ILLEGAL_ME");
+ sFailCauseMap.put(GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED,
+ "GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED");
+ sFailCauseMap.put(GPRS_SERVICES_NOT_ALLOWED, "GPRS_SERVICES_NOT_ALLOWED");
+ sFailCauseMap.put(MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK,
+ "MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK");
+ sFailCauseMap.put(IMPLICITLY_DETACHED, "IMPLICITLY_DETACHED");
+ sFailCauseMap.put(PLMN_NOT_ALLOWED, "PLMN_NOT_ALLOWED");
+ sFailCauseMap.put(LOCATION_AREA_NOT_ALLOWED, "LOCATION_AREA_NOT_ALLOWED");
+ sFailCauseMap.put(GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN,
+ "GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN");
+ sFailCauseMap.put(PDP_DUPLICATE, "PDP_DUPLICATE");
+ sFailCauseMap.put(UE_RAT_CHANGE, "UE_RAT_CHANGE");
+ sFailCauseMap.put(CONGESTION, "CONGESTION");
+ sFailCauseMap.put(NO_PDP_CONTEXT_ACTIVATED, "NO_PDP_CONTEXT_ACTIVATED");
+ sFailCauseMap.put(ACCESS_CLASS_DSAC_REJECTION, "ACCESS_CLASS_DSAC_REJECTION");
+ sFailCauseMap.put(PDP_ACTIVATE_MAX_RETRY_FAILED, "PDP_ACTIVATE_MAX_RETRY_FAILED");
+ sFailCauseMap.put(RADIO_ACCESS_BEARER_FAILURE, "RADIO_ACCESS_BEARER_FAILURE");
+ sFailCauseMap.put(ESM_UNKNOWN_EPS_BEARER_CONTEXT, "ESM_UNKNOWN_EPS_BEARER_CONTEXT");
+ sFailCauseMap.put(DRB_RELEASED_BY_RRC, "DRB_RELEASED_BY_RRC");
+ sFailCauseMap.put(CONNECTION_RELEASED, "CONNECTION_RELEASED");
+ sFailCauseMap.put(EMM_DETACHED, "EMM_DETACHED");
+ sFailCauseMap.put(EMM_ATTACH_FAILED, "EMM_ATTACH_FAILED");
+ sFailCauseMap.put(EMM_ATTACH_STARTED, "EMM_ATTACH_STARTED");
+ sFailCauseMap.put(LTE_NAS_SERVICE_REQUEST_FAILED, "LTE_NAS_SERVICE_REQUEST_FAILED");
+ sFailCauseMap.put(DUPLICATE_BEARER_ID, "DUPLICATE_BEARER_ID");
+ sFailCauseMap.put(ESM_COLLISION_SCENARIOS, "ESM_COLLISION_SCENARIOS");
+ sFailCauseMap.put(ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK,
+ "ESM_BEARER_DEACTIVATED_TO_SYNC_WITH_NETWORK");
+ sFailCauseMap.put(ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER,
+ "ESM_NW_ACTIVATED_DED_BEARER_WITH_ID_OF_DEF_BEARER");
+ sFailCauseMap.put(ESM_BAD_OTA_MESSAGE, "ESM_BAD_OTA_MESSAGE");
+ sFailCauseMap.put(ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL,
+ "ESM_DOWNLOAD_SERVER_REJECTED_THE_CALL");
+ sFailCauseMap.put(ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT,
+ "ESM_CONTEXT_TRANSFERRED_DUE_TO_IRAT");
+ sFailCauseMap.put(DS_EXPLICIT_DEACTIVATION, "DS_EXPLICIT_DEACTIVATION");
+ sFailCauseMap.put(ESM_LOCAL_CAUSE_NONE, "ESM_LOCAL_CAUSE_NONE");
+ sFailCauseMap.put(LTE_THROTTLING_NOT_REQUIRED, "LTE_THROTTLING_NOT_REQUIRED");
+ sFailCauseMap.put(ACCESS_CONTROL_LIST_CHECK_FAILURE,
+ "ACCESS_CONTROL_LIST_CHECK_FAILURE");
+ sFailCauseMap.put(SERVICE_NOT_ALLOWED_ON_PLMN, "SERVICE_NOT_ALLOWED_ON_PLMN");
+ sFailCauseMap.put(EMM_T3417_EXPIRED, "EMM_T3417_EXPIRED");
+ sFailCauseMap.put(EMM_T3417_EXT_EXPIRED, "EMM_T3417_EXT_EXPIRED");
+ sFailCauseMap.put(RRC_UPLINK_DATA_TRANSMISSION_FAILURE,
+ "RRC_UPLINK_DATA_TRANSMISSION_FAILURE");
+ sFailCauseMap.put(RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER,
+ "RRC_UPLINK_DELIVERY_FAILED_DUE_TO_HANDOVER");
+ sFailCauseMap.put(RRC_UPLINK_CONNECTION_RELEASE, "RRC_UPLINK_CONNECTION_RELEASE");
+ sFailCauseMap.put(RRC_UPLINK_RADIO_LINK_FAILURE, "RRC_UPLINK_RADIO_LINK_FAILURE");
+ sFailCauseMap.put(RRC_UPLINK_ERROR_REQUEST_FROM_NAS, "RRC_UPLINK_ERROR_REQUEST_FROM_NAS");
+ sFailCauseMap.put(RRC_CONNECTION_ACCESS_STRATUM_FAILURE,
+ "RRC_CONNECTION_ACCESS_STRATUM_FAILURE");
+ sFailCauseMap.put(RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS,
+ "RRC_CONNECTION_ANOTHER_PROCEDURE_IN_PROGRESS");
+ sFailCauseMap.put(RRC_CONNECTION_ACCESS_BARRED, "RRC_CONNECTION_ACCESS_BARRED");
+ sFailCauseMap.put(RRC_CONNECTION_CELL_RESELECTION, "RRC_CONNECTION_CELL_RESELECTION");
+ sFailCauseMap.put(RRC_CONNECTION_CONFIG_FAILURE, "RRC_CONNECTION_CONFIG_FAILURE");
+ sFailCauseMap.put(RRC_CONNECTION_TIMER_EXPIRED, "RRC_CONNECTION_TIMER_EXPIRED");
+ sFailCauseMap.put(RRC_CONNECTION_LINK_FAILURE, "RRC_CONNECTION_LINK_FAILURE");
+ sFailCauseMap.put(RRC_CONNECTION_CELL_NOT_CAMPED, "RRC_CONNECTION_CELL_NOT_CAMPED");
+ sFailCauseMap.put(RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE,
+ "RRC_CONNECTION_SYSTEM_INTERVAL_FAILURE");
+ sFailCauseMap.put(RRC_CONNECTION_REJECT_BY_NETWORK, "RRC_CONNECTION_REJECT_BY_NETWORK");
+ sFailCauseMap.put(RRC_CONNECTION_NORMAL_RELEASE, "RRC_CONNECTION_NORMAL_RELEASE");
+ sFailCauseMap.put(RRC_CONNECTION_RADIO_LINK_FAILURE, "RRC_CONNECTION_RADIO_LINK_FAILURE");
+ sFailCauseMap.put(RRC_CONNECTION_REESTABLISHMENT_FAILURE,
+ "RRC_CONNECTION_REESTABLISHMENT_FAILURE");
+ sFailCauseMap.put(RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER,
+ "RRC_CONNECTION_OUT_OF_SERVICE_DURING_CELL_REGISTER");
+ sFailCauseMap.put(RRC_CONNECTION_ABORT_REQUEST, "RRC_CONNECTION_ABORT_REQUEST");
+ sFailCauseMap.put(RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR,
+ "RRC_CONNECTION_SYSTEM_INFORMATION_BLOCK_READ_ERROR");
+ sFailCauseMap.put(NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH,
+ "NETWORK_INITIATED_DETACH_WITH_AUTO_REATTACH");
+ sFailCauseMap.put(NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH,
+ "NETWORK_INITIATED_DETACH_NO_AUTO_REATTACH");
+ sFailCauseMap.put(ESM_PROCEDURE_TIME_OUT, "ESM_PROCEDURE_TIME_OUT");
+ sFailCauseMap.put(INVALID_CONNECTION_ID, "INVALID_CONNECTION_ID");
+ sFailCauseMap.put(MAXIMIUM_NSAPIS_EXCEEDED, "MAXIMIUM_NSAPIS_EXCEEDED");
+ sFailCauseMap.put(INVALID_PRIMARY_NSAPI, "INVALID_PRIMARY_NSAPI");
+ sFailCauseMap.put(CANNOT_ENCODE_OTA_MESSAGE, "CANNOT_ENCODE_OTA_MESSAGE");
+ sFailCauseMap.put(RADIO_ACCESS_BEARER_SETUP_FAILURE, "RADIO_ACCESS_BEARER_SETUP_FAILURE");
+ sFailCauseMap.put(PDP_ESTABLISH_TIMEOUT_EXPIRED, "PDP_ESTABLISH_TIMEOUT_EXPIRED");
+ sFailCauseMap.put(PDP_MODIFY_TIMEOUT_EXPIRED, "PDP_MODIFY_TIMEOUT_EXPIRED");
+ sFailCauseMap.put(PDP_INACTIVE_TIMEOUT_EXPIRED, "PDP_INACTIVE_TIMEOUT_EXPIRED");
+ sFailCauseMap.put(PDP_LOWERLAYER_ERROR, "PDP_LOWERLAYER_ERROR");
+ sFailCauseMap.put(PDP_MODIFY_COLLISION, "PDP_MODIFY_COLLISION");
+ sFailCauseMap.put(MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED,
+ "MAXINUM_SIZE_OF_L2_MESSAGE_EXCEEDED");
+ sFailCauseMap.put(NAS_REQUEST_REJECTED_BY_NETWORK, "NAS_REQUEST_REJECTED_BY_NETWORK");
+ sFailCauseMap.put(RRC_CONNECTION_INVALID_REQUEST, "RRC_CONNECTION_INVALID_REQUEST");
+ sFailCauseMap.put(RRC_CONNECTION_TRACKING_AREA_ID_CHANGED,
+ "RRC_CONNECTION_TRACKING_AREA_ID_CHANGED");
+ sFailCauseMap.put(RRC_CONNECTION_RF_UNAVAILABLE, "RRC_CONNECTION_RF_UNAVAILABLE");
+ sFailCauseMap.put(RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE,
+ "RRC_CONNECTION_ABORTED_DUE_TO_IRAT_CHANGE");
+ sFailCauseMap.put(RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE,
+ "RRC_CONNECTION_RELEASED_SECURITY_NOT_ACTIVE");
+ sFailCauseMap.put(RRC_CONNECTION_ABORTED_AFTER_HANDOVER,
+ "RRC_CONNECTION_ABORTED_AFTER_HANDOVER");
+ sFailCauseMap.put(RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE,
+ "RRC_CONNECTION_ABORTED_AFTER_IRAT_CELL_CHANGE");
+ sFailCauseMap.put(RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE,
+ "RRC_CONNECTION_ABORTED_DURING_IRAT_CELL_CHANGE");
+ sFailCauseMap.put(IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER,
+ "IMSI_UNKNOWN_IN_HOME_SUBSCRIBER_SERVER");
+ sFailCauseMap.put(IMEI_NOT_ACCEPTED, "IMEI_NOT_ACCEPTED");
+ sFailCauseMap.put(EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED,
+ "EPS_SERVICES_AND_NON_EPS_SERVICES_NOT_ALLOWED");
+ sFailCauseMap.put(EPS_SERVICES_NOT_ALLOWED_IN_PLMN, "EPS_SERVICES_NOT_ALLOWED_IN_PLMN");
+ sFailCauseMap.put(MSC_TEMPORARILY_NOT_REACHABLE, "MSC_TEMPORARILY_NOT_REACHABLE");
+ sFailCauseMap.put(CS_DOMAIN_NOT_AVAILABLE, "CS_DOMAIN_NOT_AVAILABLE");
+ sFailCauseMap.put(ESM_FAILURE, "ESM_FAILURE");
+ sFailCauseMap.put(MAC_FAILURE, "MAC_FAILURE");
+ sFailCauseMap.put(SYNCHRONIZATION_FAILURE, "SYNCHRONIZATION_FAILURE");
+ sFailCauseMap.put(UE_SECURITY_CAPABILITIES_MISMATCH, "UE_SECURITY_CAPABILITIES_MISMATCH");
+ sFailCauseMap.put(SECURITY_MODE_REJECTED, "SECURITY_MODE_REJECTED");
+ sFailCauseMap.put(UNACCEPTABLE_NON_EPS_AUTHENTICATION,
+ "UNACCEPTABLE_NON_EPS_AUTHENTICATION");
+ sFailCauseMap.put(CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED,
+ "CS_FALLBACK_CALL_ESTABLISHMENT_NOT_ALLOWED");
+ sFailCauseMap.put(NO_EPS_BEARER_CONTEXT_ACTIVATED, "NO_EPS_BEARER_CONTEXT_ACTIVATED");
+ sFailCauseMap.put(INVALID_EMM_STATE, "INVALID_EMM_STATE");
+ sFailCauseMap.put(NAS_LAYER_FAILURE, "NAS_LAYER_FAILURE");
+ sFailCauseMap.put(MULTIPLE_PDP_CALL_NOT_ALLOWED, "MULTIPLE_PDP_CALL_NOT_ALLOWED");
+ sFailCauseMap.put(EMBMS_NOT_ENABLED, "EMBMS_NOT_ENABLED");
+ sFailCauseMap.put(IRAT_HANDOVER_FAILED, "IRAT_HANDOVER_FAILED");
+ sFailCauseMap.put(EMBMS_REGULAR_DEACTIVATION, "EMBMS_REGULAR_DEACTIVATION");
+ sFailCauseMap.put(TEST_LOOPBACK_REGULAR_DEACTIVATION, "TEST_LOOPBACK_REGULAR_DEACTIVATION");
+ sFailCauseMap.put(LOWER_LAYER_REGISTRATION_FAILURE, "LOWER_LAYER_REGISTRATION_FAILURE");
+ sFailCauseMap.put(DATA_PLAN_EXPIRED, "DATA_PLAN_EXPIRED");
+ sFailCauseMap.put(UMTS_HANDOVER_TO_IWLAN, "UMTS_HANDOVER_TO_IWLAN");
+ sFailCauseMap.put(EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY,
+ "EVDO_CONNECTION_DENY_BY_GENERAL_OR_NETWORK_BUSY");
+ sFailCauseMap.put(EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE,
+ "EVDO_CONNECTION_DENY_BY_BILLING_OR_AUTHENTICATION_FAILURE");
+ sFailCauseMap.put(EVDO_HDR_CHANGED, "EVDO_HDR_CHANGED");
+ sFailCauseMap.put(EVDO_HDR_EXITED, "EVDO_HDR_EXITED");
+ sFailCauseMap.put(EVDO_HDR_NO_SESSION, "EVDO_HDR_NO_SESSION");
+ sFailCauseMap.put(EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL,
+ "EVDO_USING_GPS_FIX_INSTEAD_OF_HDR_CALL");
+ sFailCauseMap.put(EVDO_HDR_CONNECTION_SETUP_TIMEOUT, "EVDO_HDR_CONNECTION_SETUP_TIMEOUT");
+ sFailCauseMap.put(FAILED_TO_ACQUIRE_COLOCATED_HDR, "FAILED_TO_ACQUIRE_COLOCATED_HDR");
+ sFailCauseMap.put(OTASP_COMMIT_IN_PROGRESS, "OTASP_COMMIT_IN_PROGRESS");
+ sFailCauseMap.put(NO_HYBRID_HDR_SERVICE, "NO_HYBRID_HDR_SERVICE");
+ sFailCauseMap.put(HDR_NO_LOCK_GRANTED, "HDR_NO_LOCK_GRANTED");
+ sFailCauseMap.put(DBM_OR_SMS_IN_PROGRESS, "DBM_OR_SMS_IN_PROGRESS");
+ sFailCauseMap.put(HDR_FADE, "HDR_FADE");
+ sFailCauseMap.put(HDR_ACCESS_FAILURE, "HDR_ACCESS_FAILURE");
+ sFailCauseMap.put(UNSUPPORTED_1X_PREV, "UNSUPPORTED_1X_PREV");
+ sFailCauseMap.put(LOCAL_END, "LOCAL_END");
+ sFailCauseMap.put(NO_SERVICE, "NO_SERVICE");
+ sFailCauseMap.put(FADE, "FADE");
+ sFailCauseMap.put(NORMAL_RELEASE, "NORMAL_RELEASE");
+ sFailCauseMap.put(ACCESS_ATTEMPT_ALREADY_IN_PROGRESS, "ACCESS_ATTEMPT_ALREADY_IN_PROGRESS");
+ sFailCauseMap.put(REDIRECTION_OR_HANDOFF_IN_PROGRESS, "REDIRECTION_OR_HANDOFF_IN_PROGRESS");
+ sFailCauseMap.put(EMERGENCY_MODE, "EMERGENCY_MODE");
+ sFailCauseMap.put(PHONE_IN_USE, "PHONE_IN_USE");
+ sFailCauseMap.put(INVALID_MODE, "INVALID_MODE");
+ sFailCauseMap.put(INVALID_SIM_STATE, "INVALID_SIM_STATE");
+ sFailCauseMap.put(NO_COLLOCATED_HDR, "NO_COLLOCATED_HDR");
+ sFailCauseMap.put(UE_IS_ENTERING_POWERSAVE_MODE, "UE_IS_ENTERING_POWERSAVE_MODE");
+ sFailCauseMap.put(DUAL_SWITCH, "DUAL_SWITCH");
+ sFailCauseMap.put(PPP_TIMEOUT, "PPP_TIMEOUT");
+ sFailCauseMap.put(PPP_AUTH_FAILURE, "PPP_AUTH_FAILURE");
+ sFailCauseMap.put(PPP_OPTION_MISMATCH, "PPP_OPTION_MISMATCH");
+ sFailCauseMap.put(PPP_PAP_FAILURE, "PPP_PAP_FAILURE");
+ sFailCauseMap.put(PPP_CHAP_FAILURE, "PPP_CHAP_FAILURE");
+ sFailCauseMap.put(PPP_CLOSE_IN_PROGRESS, "PPP_CLOSE_IN_PROGRESS");
+ sFailCauseMap.put(LIMITED_TO_IPV4, "LIMITED_TO_IPV4");
+ sFailCauseMap.put(LIMITED_TO_IPV6, "LIMITED_TO_IPV6");
+ sFailCauseMap.put(VSNCP_TIMEOUT, "VSNCP_TIMEOUT");
+ sFailCauseMap.put(VSNCP_GEN_ERROR, "VSNCP_GEN_ERROR");
+ sFailCauseMap.put(VSNCP_APN_UNATHORIZED, "VSNCP_APN_UNATHORIZED");
+ sFailCauseMap.put(VSNCP_PDN_LIMIT_EXCEEDED, "VSNCP_PDN_LIMIT_EXCEEDED");
+ sFailCauseMap.put(VSNCP_NO_PDN_GATEWAY_ADDRESS, "VSNCP_NO_PDN_GATEWAY_ADDRESS");
+ sFailCauseMap.put(VSNCP_PDN_GATEWAY_UNREACHABLE, "VSNCP_PDN_GATEWAY_UNREACHABLE");
+ sFailCauseMap.put(VSNCP_PDN_GATEWAY_REJECT, "VSNCP_PDN_GATEWAY_REJECT");
+ sFailCauseMap.put(VSNCP_INSUFFICIENT_PARAMETERS, "VSNCP_INSUFFICIENT_PARAMETERS");
+ sFailCauseMap.put(VSNCP_RESOURCE_UNAVAILABLE, "VSNCP_RESOURCE_UNAVAILABLE");
+ sFailCauseMap.put(VSNCP_ADMINISTRATIVELY_PROHIBITED, "VSNCP_ADMINISTRATIVELY_PROHIBITED");
+ sFailCauseMap.put(VSNCP_PDN_ID_IN_USE, "VSNCP_PDN_ID_IN_USE");
+ sFailCauseMap.put(VSNCP_SUBSCRIBER_LIMITATION, "VSNCP_SUBSCRIBER_LIMITATION");
+ sFailCauseMap.put(VSNCP_PDN_EXISTS_FOR_THIS_APN, "VSNCP_PDN_EXISTS_FOR_THIS_APN");
+ sFailCauseMap.put(VSNCP_RECONNECT_NOT_ALLOWED, "VSNCP_RECONNECT_NOT_ALLOWED");
+ sFailCauseMap.put(IPV6_PREFIX_UNAVAILABLE, "IPV6_PREFIX_UNAVAILABLE");
+ sFailCauseMap.put(HANDOFF_PREFERENCE_CHANGED, "HANDOFF_PREFERENCE_CHANGED");
sFailCauseMap.put(OEM_DCFAILCAUSE_1, "OEM_DCFAILCAUSE_1");
sFailCauseMap.put(OEM_DCFAILCAUSE_2, "OEM_DCFAILCAUSE_2");
sFailCauseMap.put(OEM_DCFAILCAUSE_3, "OEM_DCFAILCAUSE_3");
diff --git a/telephony/java/android/telephony/data/ApnSetting.java b/telephony/java/android/telephony/data/ApnSetting.java
index 8d148c3..0e69530 100644
--- a/telephony/java/android/telephony/data/ApnSetting.java
+++ b/telephony/java/android/telephony/data/ApnSetting.java
@@ -140,15 +140,19 @@
@Retention(RetentionPolicy.SOURCE)
public @interface AuthType {}
- // Possible values for protocol.
- /** Protocol type for IP. */
+ // Possible values for protocol which is defined in TS 27.007 section 10.1.1.
+ /** Internet protocol. */
public static final int PROTOCOL_IP = 0;
- /** Protocol type for IPV6. */
+ /** Internet protocol, version 6. */
public static final int PROTOCOL_IPV6 = 1;
- /** Protocol type for IPV4V6. */
+ /** Virtual PDP type introduced to handle dual IP stack UE capability. */
public static final int PROTOCOL_IPV4V6 = 2;
- /** Protocol type for PPP. */
+ /** Point to point protocol. */
public static final int PROTOCOL_PPP = 3;
+ /** Transfer of Non-IP data to external packet data network. */
+ public static final int PROTOCOL_NON_IP = 4;
+ /** Transfer of Unstructured data to the Data Network via N6. */
+ public static final int PROTOCOL_UNSTRUCTURED = 5;
/** @hide */
@IntDef(prefix = { "PROTOCOL_" }, value = {
@@ -156,6 +160,8 @@
PROTOCOL_IPV6,
PROTOCOL_IPV4V6,
PROTOCOL_PPP,
+ PROTOCOL_NON_IP,
+ PROTOCOL_UNSTRUCTURED,
})
@Retention(RetentionPolicy.SOURCE)
public @interface ProtocolType {}
@@ -217,11 +223,15 @@
PROTOCOL_STRING_MAP.put("IPV6", PROTOCOL_IPV6);
PROTOCOL_STRING_MAP.put("IPV4V6", PROTOCOL_IPV4V6);
PROTOCOL_STRING_MAP.put("PPP", PROTOCOL_PPP);
+ PROTOCOL_STRING_MAP.put("NON-IP", PROTOCOL_NON_IP);
+ PROTOCOL_STRING_MAP.put("UNSTRUCTURED", PROTOCOL_UNSTRUCTURED);
PROTOCOL_INT_MAP = new ArrayMap<Integer, String>();
PROTOCOL_INT_MAP.put(PROTOCOL_IP, "IP");
PROTOCOL_INT_MAP.put(PROTOCOL_IPV6, "IPV6");
PROTOCOL_INT_MAP.put(PROTOCOL_IPV4V6, "IPV4V6");
PROTOCOL_INT_MAP.put(PROTOCOL_PPP, "PPP");
+ PROTOCOL_INT_MAP.put(PROTOCOL_NON_IP, "NON-IP");
+ PROTOCOL_INT_MAP.put(PROTOCOL_UNSTRUCTURED, "UNSTRUCTURED");
MVNO_TYPE_STRING_MAP = new ArrayMap<String, Integer>();
MVNO_TYPE_STRING_MAP.put("spn", MVNO_TYPE_SPN);
diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java
index 25f5133..294c79b 100644
--- a/telephony/java/android/telephony/data/DataCallResponse.java
+++ b/telephony/java/android/telephony/data/DataCallResponse.java
@@ -52,8 +52,7 @@
* @param status Data call fail cause. 0 indicates no error.
* @param suggestedRetryTime The suggested data retry time in milliseconds.
* @param cid The unique id of the data connection.
- * @param active Data connection active status. 0 = inactive, 1 = active/physical link down,
- * 2 = active/physical link up.
+ * @param active Data connection active status. 0 = inactive, 1 = dormant, 2 = active.
* @param type The connection protocol, should be one of the PDP_type values in TS 27.007
* section 10.1.1. For example, "IP", "IPV6", "IPV4V6", or "PPP".
* @param ifname The network interface name.
@@ -124,7 +123,7 @@
public int getCallId() { return mCid; }
/**
- * @return 0 = inactive, 1 = active/physical link down, 2 = active/physical link up.
+ * @return 0 = inactive, 1 = dormant, 2 = active.
*/
public int getActive() { return mActive; }
diff --git a/test-mock/api/current.txt b/test-mock/api/current.txt
index a181bc38..1110790 100644
--- a/test-mock/api/current.txt
+++ b/test-mock/api/current.txt
@@ -32,7 +32,6 @@
public class MockContext extends android.content.Context {
ctor public MockContext();
- method public boolean bindIsolatedService(android.content.Intent, android.content.ServiceConnection, int, String);
method public boolean bindService(android.content.Intent, android.content.ServiceConnection, int);
method public int checkCallingOrSelfPermission(String);
method public int checkCallingOrSelfUriPermission(android.net.Uri, int);
@@ -81,7 +80,6 @@
method public java.io.File getNoBackupFilesDir();
method public java.io.File getObbDir();
method public java.io.File[] getObbDirs();
- method public String getOpPackageName();
method public String getPackageCodePath();
method public android.content.pm.PackageManager getPackageManager();
method public String getPackageName();
@@ -137,7 +135,6 @@
method public boolean stopService(android.content.Intent);
method public void unbindService(android.content.ServiceConnection);
method public void unregisterReceiver(android.content.BroadcastReceiver);
- method public void updateServiceGroup(android.content.ServiceConnection, int, int);
}
@Deprecated public class MockCursor implements android.database.Cursor {
diff --git a/tests/net/java/android/net/apf/ApfTest.java b/tests/net/java/android/net/apf/ApfTest.java
index aaed659..3c3e7ce 100644
--- a/tests/net/java/android/net/apf/ApfTest.java
+++ b/tests/net/java/android/net/apf/ApfTest.java
@@ -1522,7 +1522,8 @@
}
private void verifyRaEvent(RaEvent expected) {
- ArgumentCaptor<Parcelable> captor = ArgumentCaptor.forClass(Parcelable.class);
+ ArgumentCaptor<IpConnectivityLog.Event> captor =
+ ArgumentCaptor.forClass(IpConnectivityLog.Event.class);
verify(mLog, atLeastOnce()).log(captor.capture());
RaEvent got = lastRaEvent(captor.getAllValues());
if (!raEventEquals(expected, got)) {
@@ -1530,7 +1531,7 @@
}
}
- private RaEvent lastRaEvent(List<Parcelable> events) {
+ private RaEvent lastRaEvent(List<IpConnectivityLog.Event> events) {
RaEvent got = null;
for (Parcelable ev : events) {
if (ev instanceof RaEvent) {
diff --git a/tests/net/java/android/net/ip/IpClientTest.java b/tests/net/java/android/net/ip/IpClientTest.java
index a2dcfef..7a83757 100644
--- a/tests/net/java/android/net/ip/IpClientTest.java
+++ b/tests/net/java/android/net/ip/IpClientTest.java
@@ -122,13 +122,14 @@
private IpClient makeIpClient(String ifname) throws Exception {
setTestInterfaceParams(ifname);
final IpClient ipc = new IpClient(mContext, ifname, mCb, mDependecies);
- verify(mNMService, timeout(TEST_TIMEOUT_MS).times(1)).disableIpv6(ifname);
- verify(mNMService, timeout(TEST_TIMEOUT_MS).times(1)).clearInterfaceAddresses(ifname);
+ verify(mNetd, timeout(TEST_TIMEOUT_MS).times(1)).interfaceSetEnableIPv6(ifname, false);
+ verify(mNetd, timeout(TEST_TIMEOUT_MS).times(1)).interfaceClearAddrs(ifname);
ArgumentCaptor<BaseNetworkObserver> arg =
ArgumentCaptor.forClass(BaseNetworkObserver.class);
verify(mNMService, times(1)).registerObserver(arg.capture());
mObserver = arg.getValue();
reset(mNMService);
+ reset(mNetd);
// Verify IpClient doesn't call onLinkPropertiesChange() when it starts.
verify(mCb, never()).onLinkPropertiesChange(any());
reset(mCb);
@@ -200,8 +201,8 @@
verify(mCb, never()).onProvisioningFailure(any());
ipc.shutdown();
- verify(mNMService, timeout(TEST_TIMEOUT_MS).times(1)).disableIpv6(iface);
- verify(mNMService, timeout(TEST_TIMEOUT_MS).times(1)).clearInterfaceAddresses(iface);
+ verify(mNetd, timeout(TEST_TIMEOUT_MS).times(1)).interfaceSetEnableIPv6(iface, false);
+ verify(mNetd, timeout(TEST_TIMEOUT_MS).times(1)).interfaceClearAddrs(iface);
verify(mCb, timeout(TEST_TIMEOUT_MS).times(1))
.onLinkPropertiesChange(eq(makeEmptyLinkProperties(iface)));
}
@@ -251,8 +252,8 @@
verify(mCb, timeout(TEST_TIMEOUT_MS).times(1)).onProvisioningSuccess(eq(want));
ipc.shutdown();
- verify(mNMService, timeout(TEST_TIMEOUT_MS).times(1)).disableIpv6(iface);
- verify(mNMService, timeout(TEST_TIMEOUT_MS).times(1)).clearInterfaceAddresses(iface);
+ verify(mNetd, timeout(TEST_TIMEOUT_MS).times(1)).interfaceSetEnableIPv6(iface, false);
+ verify(mNetd, timeout(TEST_TIMEOUT_MS).times(1)).interfaceClearAddrs(iface);
verify(mCb, timeout(TEST_TIMEOUT_MS).times(1))
.onLinkPropertiesChange(eq(makeEmptyLinkProperties(iface)));
}
diff --git a/tests/net/java/android/net/ip/IpServerTest.java b/tests/net/java/android/net/ip/IpServerTest.java
index c3162af..80aac04 100644
--- a/tests/net/java/android/net/ip/IpServerTest.java
+++ b/tests/net/java/android/net/ip/IpServerTest.java
@@ -33,6 +33,7 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
@@ -47,6 +48,7 @@
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
+import android.net.INetd;
import android.net.INetworkStatsService;
import android.net.InterfaceConfiguration;
import android.net.IpPrefix;
@@ -92,6 +94,7 @@
private static final int MAKE_DHCPSERVER_TIMEOUT_MS = 1000;
@Mock private INetworkManagementService mNMService;
+ @Mock private INetd mNetd;
@Mock private INetworkStatsService mStatsService;
@Mock private IpServer.Callback mCallback;
@Mock private InterfaceConfiguration mInterfaceConfiguration;
@@ -112,16 +115,6 @@
}
private void initStateMachine(int interfaceType, boolean usingLegacyDhcp) throws Exception {
- mIpServer = new IpServer(
- IFACE_NAME, mLooper.getLooper(), interfaceType, mSharedLog,
- mNMService, mStatsService, mCallback, usingLegacyDhcp, mDependencies);
- mIpServer.start();
- // Starting the state machine always puts us in a consistent state and notifies
- // the rest of the world that we've changed from an unknown to available state.
- mLooper.dispatchAll();
- reset(mNMService, mStatsService, mCallback);
- when(mNMService.getInterfaceConfig(IFACE_NAME)).thenReturn(mInterfaceConfiguration);
-
doAnswer(inv -> {
final IDhcpServerCallbacks cb = inv.getArgument(2);
new Thread(() -> {
@@ -135,6 +128,17 @@
}).when(mDependencies).makeDhcpServer(any(), mDhcpParamsCaptor.capture(), any());
when(mDependencies.getRouterAdvertisementDaemon(any())).thenReturn(mRaDaemon);
when(mDependencies.getInterfaceParams(IFACE_NAME)).thenReturn(TEST_IFACE_PARAMS);
+ when(mDependencies.getNetdService()).thenReturn(mNetd);
+
+ mIpServer = new IpServer(
+ IFACE_NAME, mLooper.getLooper(), interfaceType, mSharedLog,
+ mNMService, mStatsService, mCallback, usingLegacyDhcp, mDependencies);
+ mIpServer.start();
+ // Starting the state machine always puts us in a consistent state and notifies
+ // the rest of the world that we've changed from an unknown to available state.
+ mLooper.dispatchAll();
+ reset(mNMService, mStatsService, mCallback);
+ when(mNMService.getInterfaceConfig(IFACE_NAME)).thenReturn(mInterfaceConfiguration);
when(mRaDaemon.start()).thenReturn(true);
}
@@ -223,9 +227,9 @@
initTetheredStateMachine(TETHERING_BLUETOOTH, null);
dispatchCommand(IpServer.CMD_TETHER_UNREQUESTED);
- InOrder inOrder = inOrder(mNMService, mStatsService, mCallback);
+ InOrder inOrder = inOrder(mNMService, mNetd, mStatsService, mCallback);
inOrder.verify(mNMService).untetherInterface(IFACE_NAME);
- inOrder.verify(mNMService).setInterfaceConfig(eq(IFACE_NAME), any());
+ inOrder.verify(mNetd).interfaceSetCfg(argThat(cfg -> IFACE_NAME.equals(cfg.ifName)));
inOrder.verify(mCallback).updateInterfaceState(
mIpServer, STATE_AVAILABLE, TETHER_ERROR_NO_ERROR);
inOrder.verify(mCallback).updateLinkProperties(
@@ -318,12 +322,12 @@
initTetheredStateMachine(TETHERING_BLUETOOTH, UPSTREAM_IFACE);
dispatchCommand(IpServer.CMD_TETHER_UNREQUESTED);
- InOrder inOrder = inOrder(mNMService, mStatsService, mCallback);
+ InOrder inOrder = inOrder(mNMService, mNetd, mStatsService, mCallback);
inOrder.verify(mStatsService).forceUpdate();
inOrder.verify(mNMService).stopInterfaceForwarding(IFACE_NAME, UPSTREAM_IFACE);
inOrder.verify(mNMService).disableNat(IFACE_NAME, UPSTREAM_IFACE);
inOrder.verify(mNMService).untetherInterface(IFACE_NAME);
- inOrder.verify(mNMService).setInterfaceConfig(eq(IFACE_NAME), any());
+ inOrder.verify(mNetd).interfaceSetCfg(argThat(cfg -> IFACE_NAME.equals(cfg.ifName)));
inOrder.verify(mCallback).updateInterfaceState(
mIpServer, STATE_AVAILABLE, TETHER_ERROR_NO_ERROR);
inOrder.verify(mCallback).updateLinkProperties(
diff --git a/tests/net/java/android/net/shared/LinkPropertiesParcelableUtilTest.java b/tests/net/java/android/net/shared/LinkPropertiesParcelableUtilTest.java
index 6f711c0..b6d01db 100644
--- a/tests/net/java/android/net/shared/LinkPropertiesParcelableUtilTest.java
+++ b/tests/net/java/android/net/shared/LinkPropertiesParcelableUtilTest.java
@@ -48,61 +48,52 @@
private LinkProperties mLinkProperties;
private static final String TEST_LINKPROPS_IFACE = "TEST_IFACE";
- private static final String TEST_STACKED_LINK_1_IFACE = "TEST_STACKED_IFACE_1";
- private static final String TEST_STACKED_LINK_2_IFACE = "TEST_STACKED_IFACE_2";
@Before
public void setUp() {
- mLinkProperties = makeLinkProperties(TEST_LINKPROPS_IFACE);
- mLinkProperties.addStackedLink(makeLinkProperties(TEST_STACKED_LINK_1_IFACE));
- mLinkProperties.addStackedLink(makeLinkProperties(TEST_STACKED_LINK_2_IFACE));
- }
-
- private static LinkProperties makeLinkProperties(String iface) {
- final LinkProperties lp = new LinkProperties();
- lp.setInterfaceName(iface);
- lp.setLinkAddresses(Arrays.asList(
+ mLinkProperties = new LinkProperties();
+ mLinkProperties.setInterfaceName(TEST_LINKPROPS_IFACE);
+ mLinkProperties.setLinkAddresses(Arrays.asList(
new LinkAddress(InetAddresses.parseNumericAddress("192.168.0.42"), 16),
new LinkAddress(InetAddresses.parseNumericAddress("2001:db8::7"), 42)));
- lp.setDnsServers(Arrays.asList(
+ mLinkProperties.setDnsServers(Arrays.asList(
InetAddresses.parseNumericAddress("2001:db8::42"),
InetAddresses.parseNumericAddress("192.168.1.1")
));
- lp.setValidatedPrivateDnsServers(Arrays.asList(
+ mLinkProperties.setValidatedPrivateDnsServers(Arrays.asList(
InetAddresses.parseNumericAddress("2001:db8::43"),
InetAddresses.parseNumericAddress("192.168.42.43")
));
- lp.setPcscfServers(Arrays.asList(
+ mLinkProperties.setPcscfServers(Arrays.asList(
InetAddresses.parseNumericAddress("2001:db8::47"),
InetAddresses.parseNumericAddress("192.168.42.47")
));
- lp.setUsePrivateDns(true);
- lp.setPrivateDnsServerName("test.example.com");
- lp.setDomains("test1.example.com,test2.example.com");
- lp.addRoute(new RouteInfo(
+ mLinkProperties.setUsePrivateDns(true);
+ mLinkProperties.setPrivateDnsServerName("test.example.com");
+ mLinkProperties.setDomains("test1.example.com,test2.example.com");
+ mLinkProperties.addRoute(new RouteInfo(
new IpPrefix(InetAddresses.parseNumericAddress("2001:db8::44"), 45),
InetAddresses.parseNumericAddress("2001:db8::45"),
- iface,
+ TEST_LINKPROPS_IFACE,
RouteInfo.RTN_UNICAST
));
- lp.addRoute(new RouteInfo(
+ mLinkProperties.addRoute(new RouteInfo(
new IpPrefix(InetAddresses.parseNumericAddress("192.168.44.45"), 16),
InetAddresses.parseNumericAddress("192.168.45.1"),
- iface,
+ TEST_LINKPROPS_IFACE,
RouteInfo.RTN_THROW
));
- lp.setHttpProxy(new ProxyInfo("test3.example.com", 8000,
+ mLinkProperties.setHttpProxy(new ProxyInfo("test3.example.com", 8000,
"excl1.example.com,excl2.example.com"));
- lp.setMtu(5000);
- lp.setTcpBufferSizes("1,2,3,4,5,6");
- lp.setNat64Prefix(new IpPrefix(InetAddresses.parseNumericAddress("2001:db8::48"), 96));
+ mLinkProperties.setMtu(5000);
+ mLinkProperties.setTcpBufferSizes("1,2,3,4,5,6");
+ mLinkProperties.setNat64Prefix(
+ new IpPrefix(InetAddresses.parseNumericAddress("2001:db8::48"), 96));
// Verify that this test does not miss any new field added later.
// If any added field is not included in LinkProperties#equals, assertLinkPropertiesEquals
// must also be updated.
assertFieldCountEquals(14, LinkProperties.class);
-
- return lp;
}
@Test
@@ -186,7 +177,7 @@
private static void assertLinkPropertiesEquals(LinkProperties expected, LinkProperties actual) {
assertEquals(expected, actual);
- // LinkProperties equals() does not include stacked links
- assertEquals(expected.getStackedLinks(), actual.getStackedLinks());
+ // Equality on stacked links is not tested as they should not be passed to processes using
+ // LinkPropertiesParcelable.
}
}
diff --git a/tests/net/java/android/net/util/ConnectivityPacketSummaryTest.java b/tests/net/java/android/net/util/ConnectivityPacketSummaryTest.java
index f9b7ec8..dfaf52a 100644
--- a/tests/net/java/android/net/util/ConnectivityPacketSummaryTest.java
+++ b/tests/net/java/android/net/util/ConnectivityPacketSummaryTest.java
@@ -16,19 +16,18 @@
package android.net.util;
-import static android.net.util.NetworkConstants.*;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import android.net.MacAddress;
-import android.support.test.runner.AndroidJUnit4;
import android.support.test.filters.SmallTest;
-
-import org.junit.runner.RunWith;
-import org.junit.Test;
+import android.support.test.runner.AndroidJUnit4;
import libcore.util.HexEncoding;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
/**
* Tests for ConnectivityPacketSummary.
*
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index 882babf..1c26418 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -4775,7 +4775,7 @@
// Clat iface up, expect stack link updated.
clat.interfaceLinkStateChanged(CLAT_PREFIX + MOBILE_IFNAME, true);
- waitForIdle();
+ networkCallback.expectCallback(CallbackState.LINK_PROPERTIES, mCellNetworkAgent);
List<LinkProperties> stackedLps = mCm.getLinkProperties(mCellNetworkAgent.getNetwork())
.getStackedLinks();
assertEquals(makeClatLinkProperties(myIpv4), stackedLps.get(0));
@@ -4783,7 +4783,6 @@
// Change trivial linkproperties and see if stacked link is preserved.
cellLp.addDnsServer(InetAddress.getByName("8.8.8.8"));
mCellNetworkAgent.sendLinkProperties(cellLp);
- waitForIdle();
networkCallback.expectCallback(CallbackState.LINK_PROPERTIES, mCellNetworkAgent);
List<LinkProperties> stackedLpsAfterChange =
@@ -4795,19 +4794,19 @@
cellLp.addLinkAddress(myIpv4);
cellLp.addRoute(new RouteInfo(myIpv4, null, MOBILE_IFNAME));
mCellNetworkAgent.sendLinkProperties(cellLp);
- waitForIdle();
networkCallback.expectCallback(CallbackState.LINK_PROPERTIES, mCellNetworkAgent);
verify(mMockNetd, times(1)).clatdStop(MOBILE_IFNAME);
// Clat iface removed, expect linkproperties revert to original one
clat.interfaceRemoved(CLAT_PREFIX + MOBILE_IFNAME);
- waitForIdle();
networkCallback.expectCallback(CallbackState.LINK_PROPERTIES, mCellNetworkAgent);
LinkProperties actualLpAfterIpv4 = mCm.getLinkProperties(mCellNetworkAgent.getNetwork());
assertEquals(cellLp, actualLpAfterIpv4);
// Clean up
mCellNetworkAgent.disconnect();
+ networkCallback.expectCallback(CallbackState.LOST, mCellNetworkAgent);
+ networkCallback.assertNoCallback();
mCm.unregisterNetworkCallback(networkCallback);
}
diff --git a/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java b/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java
index 8359fe2..1a0cb74 100644
--- a/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java
+++ b/tests/net/java/com/android/server/connectivity/IpConnectivityMetricsTest.java
@@ -18,14 +18,15 @@
import static android.net.metrics.INetdEventListener.EVENT_GETADDRINFO;
import static android.net.metrics.INetdEventListener.EVENT_GETHOSTBYNAME;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.timeout;
-import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.when;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.timeout;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
import android.content.Context;
import android.net.ConnectivityManager;
@@ -34,12 +35,11 @@
import android.net.IpPrefix;
import android.net.LinkAddress;
import android.net.LinkProperties;
-import android.net.RouteInfo;
import android.net.Network;
import android.net.NetworkCapabilities;
+import android.net.RouteInfo;
import android.net.metrics.ApfProgramEvent;
import android.net.metrics.ApfStats;
-import android.net.metrics.DefaultNetworkEvent;
import android.net.metrics.DhcpClientEvent;
import android.net.metrics.IpConnectivityLog;
import android.net.metrics.IpManagerEvent;
@@ -55,6 +55,13 @@
import com.android.internal.util.BitUtils;
import com.android.server.connectivity.metrics.nano.IpConnectivityLogClass;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collections;
@@ -62,13 +69,6 @@
import java.util.Iterator;
import java.util.List;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
@RunWith(AndroidJUnit4.class)
@SmallTest
public class IpConnectivityMetricsTest {
@@ -154,7 +154,7 @@
@Test
public void testRateLimiting() {
final IpConnectivityLog logger = new IpConnectivityLog(mService.impl);
- final ApfProgramEvent ev = new ApfProgramEvent();
+ final ApfProgramEvent ev = new ApfProgramEvent.Builder().build();
final long fakeTimestamp = 1;
int attempt = 100; // More than burst quota, but less than buffer size.
@@ -304,26 +304,31 @@
when(mCm.getNetworkCapabilities(new Network(100))).thenReturn(ncWifi);
when(mCm.getNetworkCapabilities(new Network(101))).thenReturn(ncCell);
- ApfStats apfStats = new ApfStats();
- apfStats.durationMs = 45000;
- apfStats.receivedRas = 10;
- apfStats.matchingRas = 2;
- apfStats.droppedRas = 2;
- apfStats.parseErrors = 2;
- apfStats.zeroLifetimeRas = 1;
- apfStats.programUpdates = 4;
- apfStats.programUpdatesAll = 7;
- apfStats.programUpdatesAllowingMulticast = 3;
- apfStats.maxProgramSize = 2048;
+ ApfStats apfStats = new ApfStats.Builder()
+ .setDurationMs(45000)
+ .setReceivedRas(10)
+ .setMatchingRas(2)
+ .setDroppedRas(2)
+ .setParseErrors(2)
+ .setZeroLifetimeRas(1)
+ .setProgramUpdates(4)
+ .setProgramUpdatesAll(7)
+ .setProgramUpdatesAllowingMulticast(3)
+ .setMaxProgramSize(2048)
+ .build();
- ValidationProbeEvent validationEv = new ValidationProbeEvent();
- validationEv.durationMs = 40730;
- validationEv.probeType = ValidationProbeEvent.PROBE_HTTP;
- validationEv.returnCode = 204;
+ final ValidationProbeEvent validationEv = new ValidationProbeEvent.Builder()
+ .setDurationMs(40730)
+ .setProbeType(ValidationProbeEvent.PROBE_HTTP, true)
+ .setReturnCode(204)
+ .build();
+ final DhcpClientEvent event = new DhcpClientEvent.Builder()
+ .setMsg("SomeState")
+ .setDurationMs(192)
+ .build();
Parcelable[] events = {
- new IpReachabilityEvent(IpReachabilityEvent.NUD_FAILED),
- new DhcpClientEvent("SomeState", 192),
+ new IpReachabilityEvent(IpReachabilityEvent.NUD_FAILED), event,
new IpManagerEvent(IpManagerEvent.PROVISIONING_OK, 5678),
validationEv,
apfStats,
@@ -424,7 +429,7 @@
" validation_probe_event <",
" latency_ms: 40730",
" probe_result: 204",
- " probe_type: 1",
+ " probe_type: 257",
" >",
">",
"events <",
diff --git a/tests/net/java/com/android/server/connectivity/TetheringTest.java b/tests/net/java/com/android/server/connectivity/TetheringTest.java
index 1ea83c2..b635607 100644
--- a/tests/net/java/com/android/server/connectivity/TetheringTest.java
+++ b/tests/net/java/com/android/server/connectivity/TetheringTest.java
@@ -803,13 +803,14 @@
sendWifiApStateChanged(WIFI_AP_STATE_ENABLED, TEST_WLAN_IFNAME, IFACE_IP_MODE_TETHERED);
mLooper.dispatchAll();
- // We verify get/set called thrice here: once for setup and twice during
- // teardown because all events happen over the course of the single
+ // We verify get/set called thrice here: twice for setup (on NMService) and once during
+ // teardown (on Netd) because all events happen over the course of the single
// dispatchAll() above. Note that once the IpServer IPv4 address config
// code is refactored the two calls during shutdown will revert to one.
verify(mNMService, times(2)).getInterfaceConfig(TEST_WLAN_IFNAME);
- verify(mNMService, times(3))
+ verify(mNMService, times(2))
.setInterfaceConfig(eq(TEST_WLAN_IFNAME), any(InterfaceConfiguration.class));
+ verify(mNetd, times(1)).interfaceSetCfg(argThat(p -> TEST_WLAN_IFNAME.equals(p.ifName)));
verify(mNMService, times(1)).tetherInterface(TEST_WLAN_IFNAME);
verify(mWifiManager).updateInterfaceIpState(
TEST_WLAN_IFNAME, WifiManager.IFACE_IP_MODE_TETHERED);
diff --git a/tests/net/java/com/android/server/connectivity/VpnTest.java b/tests/net/java/com/android/server/connectivity/VpnTest.java
index 9bf7587..0b74d87 100644
--- a/tests/net/java/com/android/server/connectivity/VpnTest.java
+++ b/tests/net/java/com/android/server/connectivity/VpnTest.java
@@ -57,7 +57,6 @@
import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.net.ConnectivityManager;
-import android.net.IConnectivityManager;
import android.net.IpPrefix;
import android.net.LinkProperties;
import android.net.Network;
@@ -97,7 +96,6 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
-import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
@@ -240,6 +238,30 @@
}
@Test
+ public void testGetAlwaysAndOnGetLockDown() throws Exception {
+ final Vpn vpn = createVpn(primaryUser.id);
+
+ // Default state.
+ assertFalse(vpn.getAlwaysOn());
+ assertFalse(vpn.getLockdown());
+
+ // Set always-on without lockdown.
+ assertTrue(vpn.setAlwaysOnPackage(PKGS[1], false));
+ assertTrue(vpn.getAlwaysOn());
+ assertFalse(vpn.getLockdown());
+
+ // Set always-on with lockdown.
+ assertTrue(vpn.setAlwaysOnPackage(PKGS[1], true));
+ assertTrue(vpn.getAlwaysOn());
+ assertTrue(vpn.getLockdown());
+
+ // Remove always-on configuration.
+ assertTrue(vpn.setAlwaysOnPackage(null, false));
+ assertFalse(vpn.getAlwaysOn());
+ assertFalse(vpn.getLockdown());
+ }
+
+ @Test
public void testLockdownChangingPackage() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
final UidRange user = UidRange.createForUser(primaryUser.id);
diff --git a/tools/apilint/apilint.py b/tools/apilint/apilint.py
index d1fe43e..75c3eba 100644
--- a/tools/apilint/apilint.py
+++ b/tools/apilint/apilint.py
@@ -297,6 +297,7 @@
class V2LineParser(object):
__slots__ = ["tokenized", "current", "len"]
+ FIELD_KINDS = ("field", "property", "enum_constant")
MODIFIERS = set("public protected internal private abstract default static final transient volatile synchronized native operator sealed strictfp infix inline suspend vararg".split())
JAVA_LANG_TYPES = set("AbstractMethodError AbstractStringBuilder Appendable ArithmeticException ArrayIndexOutOfBoundsException ArrayStoreException AssertionError AutoCloseable Boolean BootstrapMethodError Byte Character CharSequence Class ClassCastException ClassCircularityError ClassFormatError ClassLoader ClassNotFoundException Cloneable CloneNotSupportedException Comparable Compiler Deprecated Double Enum EnumConstantNotPresentException Error Exception ExceptionInInitializerError Float FunctionalInterface IllegalAccessError IllegalAccessException IllegalArgumentException IllegalMonitorStateException IllegalStateException IllegalThreadStateException IncompatibleClassChangeError IndexOutOfBoundsException InheritableThreadLocal InstantiationError InstantiationException Integer InternalError InterruptedException Iterable LinkageError Long Math NegativeArraySizeException NoClassDefFoundError NoSuchFieldError NoSuchFieldException NoSuchMethodError NoSuchMethodException NullPointerException Number NumberFormatException Object OutOfMemoryError Override Package package-info.java Process ProcessBuilder ProcessEnvironment ProcessImpl Readable ReflectiveOperationException Runnable Runtime RuntimeException RuntimePermission SafeVarargs SecurityException SecurityManager Short StackOverflowError StackTraceElement StrictMath String StringBuffer StringBuilder StringIndexOutOfBoundsException SuppressWarnings System Thread ThreadDeath ThreadGroup ThreadLocal Throwable TypeNotPresentException UNIXProcess UnknownError UnsatisfiedLinkError UnsupportedClassVersionError UnsupportedOperationException VerifyError VirtualMachineError Void".split())
@@ -355,7 +356,7 @@
self.parse_eof()
def parse_into_field(self, field):
- kind = self.parse_one_of("field", "property")
+ kind = self.parse_one_of(*V2LineParser.FIELD_KINDS)
field.split = [kind]
annotations = self.parse_annotations()
if "@Deprecated" in annotations:
@@ -591,6 +592,14 @@
sig_format = 1
re_blame = re.compile("^([a-z0-9]{7,}) \(<([^>]+)>.+?\) (.+?)$")
+
+ field_prefixes = map(lambda kind: " %s" % (kind,), V2LineParser.FIELD_KINDS)
+ def startsWithFieldPrefix(raw):
+ for prefix in field_prefixes:
+ if raw.startswith(prefix):
+ return True
+ return False
+
for raw in f:
line += 1
raw = raw.rstrip()
@@ -611,7 +620,7 @@
clazz.ctors.append(Method(clazz, line, raw, blame, sig_format=sig_format))
elif raw.startswith(" method"):
clazz.methods.append(Method(clazz, line, raw, blame, sig_format=sig_format))
- elif raw.startswith(" field") or raw.startswith(" property"):
+ elif startsWithFieldPrefix(raw):
clazz.fields.append(Field(clazz, line, raw, blame, sig_format=sig_format))
elif raw.startswith(" }") and clazz:
yield clazz
diff --git a/tools/apilint/apilint_test.py b/tools/apilint/apilint_test.py
index fde61a9..9c261d5 100644
--- a/tools/apilint/apilint_test.py
+++ b/tools/apilint/apilint_test.py
@@ -143,6 +143,27 @@
out_classes_with_base=classes_with_base)
self.assertEquals(map(lambda x: x.fullname, classes_with_base), ["android.app.WallpaperColors"])
+class ParseV2Stream(unittest.TestCase):
+ def test_field_kinds(self):
+ api = apilint._parse_stream("""
+// Signature format: 2.0
+package android {
+ public enum SomeEnum {
+ enum_constant public static final android.SomeEnum ENUM_CONST;
+ field public static final int FIELD_CONST;
+ property public final int someProperty;
+ ctor public SomeEnum();
+ method public Object? getObject();
+ }
+}
+ """.strip().split('\n'))
+
+ self.assertEquals(api['android.SomeEnum'].fields[0].split[0], 'enum_constant')
+ self.assertEquals(api['android.SomeEnum'].fields[1].split[0], 'field')
+ self.assertEquals(api['android.SomeEnum'].fields[2].split[0], 'property')
+ self.assertEquals(api['android.SomeEnum'].ctors[0].split[0], 'ctor')
+ self.assertEquals(api['android.SomeEnum'].methods[0].split[0], 'method')
+
class V2TokenizerTests(unittest.TestCase):
def _test(self, raw, expected):
self.assertEquals(apilint.V2Tokenizer(raw).tokenize(), expected)
@@ -211,6 +232,10 @@
self.assertEquals('Interface', cls.implements)
self.assertEquals('pkg.Some.Name', cls.fullname)
+ def test_enum(self):
+ cls = self._cls("public enum Some.Name {")
+ self._field("enum_constant public static final android.ValueType COLOR;")
+
def test_interface(self):
cls = self._cls("@Deprecated @IntRange(from=1, to=2) public interface Some.Name extends Interface<Class> {")
self.assertTrue('deprecated' in cls.split)
diff --git a/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java b/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java
index 1ee874a..1d499b6 100644
--- a/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java
+++ b/wifi/java/android/net/wifi/hotspot2/ProvisioningCallback.java
@@ -65,9 +65,9 @@
public static final int OSU_FAILURE_PROVISIONING_NOT_AVAILABLE = 7;
/**
- * The reason code for provisioning failure due to invalid server url.
+ * The reason code for provisioning failure due to invalid web url format for an OSU web page.
*/
- public static final int OSU_FAILURE_INVALID_SERVER_URL = 8;
+ public static final int OSU_FAILURE_INVALID_URL_FORMAT_FOR_OSU = 8;
/**
* The reason code for provisioning failure when a command received is not the expected command