OSDN Git Service

Snap for 4829593 from 551328eaaa90e770076079a80f8c4e4565787493 to pi-release
authorandroid-build-team Robot <android-build-team-robot@google.com>
Fri, 8 Jun 2018 07:27:45 +0000 (07:27 +0000)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Fri, 8 Jun 2018 07:27:45 +0000 (07:27 +0000)
Change-Id: I9fd67c3d6af565d3aac7aaeb54485637c53cdc53

41 files changed:
cmds/statsd/statsd.rc
config/hiddenapi-light-greylist.txt
config/preloaded-classes
core/java/android/app/ActivityManager.java
core/java/android/app/Dialog.java
core/java/android/app/backup/BackupManager.java
core/java/android/content/pm/PackageManager.java
core/java/android/view/View.java
core/java/android/view/ViewRootImpl.java
core/java/com/android/internal/policy/PhoneWindow.java
data/etc/platform.xml
docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png
docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png
docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png
docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png
docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png
packages/SystemUI/res/drawable-nodpi/icon.xml
packages/SystemUI/res/drawable-nodpi/icon_bg.xml [new file with mode: 0644]
packages/SystemUI/res/drawable-nodpi/p.xml [new file with mode: 0644]
packages/SystemUI/res/layout/car_fullscreen_user_switcher.xml
packages/SystemUI/res/layout/car_qs_panel.xml
packages/SystemUI/res/values-land/dimens.xml
packages/SystemUI/res/values/dimens.xml
packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java
packages/SystemUI/src/com/android/systemui/qs/QSSecurityFooter.java
packages/SystemUI/src/com/android/systemui/statusbar/car/FullscreenUserSwitcher.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/FingerprintUnlockController.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
packages/SystemUI/src/com/android/systemui/volume/CarVolumeDialogImpl.java
packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
services/core/java/com/android/server/am/ActivityManagerService.java
services/core/java/com/android/server/location/GnssLocationProvider.java
services/core/java/com/android/server/media/MediaSessionService.java
services/core/java/com/android/server/wm/AppWindowToken.java
services/core/java/com/android/server/wm/PinnedStackController.java
services/core/java/com/android/server/wm/TaskSnapshotController.java
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
telephony/java/android/telephony/data/ApnSetting.java
tools/stats_log_api_gen/Android.bp
tools/stats_log_api_gen/main.cpp

index f349292..cbf2a8d 100644 (file)
@@ -19,6 +19,9 @@ service statsd /system/bin/statsd
     group statsd log
     writepid /dev/cpuset/system-background/tasks
 
+on property:ro.statsd.enable=false
+    stop statsd
+
 on post-fs-data
     # Create directory for statsd
     mkdir /data/misc/stats-data/ 0770 statsd system
index cee71b2..e296304 100644 (file)
@@ -171,6 +171,7 @@ Landroid/app/ActivityManagerNative;->getDefault()Landroid/app/IActivityManager;
 Landroid/app/ActivityManagerNative;->isSystemReady()Z
 Landroid/app/ActivityOptions;->makeCustomAnimation(Landroid/content/Context;IILandroid/os/Handler;Landroid/app/ActivityOptions$OnAnimationStartedListener;)Landroid/app/ActivityOptions;
 Landroid/app/ActivityOptions;->makeMultiThumbFutureAspectScaleAnimation(Landroid/content/Context;Landroid/os/Handler;Landroid/view/IAppTransitionAnimationSpecsFuture;Landroid/app/ActivityOptions$OnAnimationStartedListener;Z)Landroid/app/ActivityOptions;
+Landroid/app/ActivityThread$ActivityClientRecord;-><init>()V
 Landroid/app/ActivityThread$ActivityClientRecord;->activity:Landroid/app/Activity;
 Landroid/app/ActivityThread$ActivityClientRecord;->activityInfo:Landroid/content/pm/ActivityInfo;
 Landroid/app/ActivityThread$ActivityClientRecord;->compatInfo:Landroid/content/res/CompatibilityInfo;
@@ -180,6 +181,7 @@ Landroid/app/ActivityThread$ActivityClientRecord;->packageInfo:Landroid/app/Load
 Landroid/app/ActivityThread$ActivityClientRecord;->paused:Z
 Landroid/app/ActivityThread$ActivityClientRecord;->stopped:Z
 Landroid/app/ActivityThread$ActivityClientRecord;->token:Landroid/os/IBinder;
+Landroid/app/ActivityThread$AppBindData;-><init>()V
 Landroid/app/ActivityThread$AppBindData;->appInfo:Landroid/content/pm/ApplicationInfo;
 Landroid/app/ActivityThread$AppBindData;->compatInfo:Landroid/content/res/CompatibilityInfo;
 Landroid/app/ActivityThread$AppBindData;->info:Landroid/app/LoadedApk;
@@ -504,6 +506,7 @@ Landroid/app/ContentProviderHolder;-><init>(Landroid/os/Parcel;)V
 Landroid/app/ContentProviderHolder;->info:Landroid/content/pm/ProviderInfo;
 Landroid/app/ContentProviderHolder;->noReleaseNeeded:Z
 Landroid/app/ContentProviderHolder;->provider:Landroid/content/IContentProvider;
+Landroid/app/ContextImpl$ApplicationContentResolver;->acquireProvider(Landroid/content/Context;Ljava/lang/String;)Landroid/content/IContentProvider;
 Landroid/app/ContextImpl$ApplicationContentResolver;->mMainThread:Landroid/app/ActivityThread;
 Landroid/app/ContextImpl;->createActivityContext(Landroid/app/ActivityThread;Landroid/app/LoadedApk;Landroid/content/pm/ActivityInfo;Landroid/os/IBinder;ILandroid/content/res/Configuration;)Landroid/app/ContextImpl;
 Landroid/app/ContextImpl;->createAppContext(Landroid/app/ActivityThread;Landroid/app/LoadedApk;)Landroid/app/ContextImpl;
@@ -587,6 +590,7 @@ Landroid/app/IActivityManager$Stub$Proxy;->getProcessPss([I)[J
 Landroid/app/IActivityManager$Stub$Proxy;->isAppForeground(I)Z
 Landroid/app/IActivityManager$Stub$Proxy;->mRemote:Landroid/os/IBinder;
 Landroid/app/IActivityManager$Stub$Proxy;->setActivityController(Landroid/app/IActivityController;Z)V
+Landroid/app/IActivityManager$Stub$Proxy;->updatePersistentConfiguration(Landroid/content/res/Configuration;)V
 Landroid/app/IActivityManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/IActivityManager;
 Landroid/app/IActivityManager;->bindService(Landroid/app/IApplicationThread;Landroid/os/IBinder;Landroid/content/Intent;Ljava/lang/String;Landroid/app/IServiceConnection;ILjava/lang/String;I)I
 Landroid/app/IActivityManager;->broadcastIntent(Landroid/app/IApplicationThread;Landroid/content/Intent;Ljava/lang/String;Landroid/content/IIntentReceiver;ILjava/lang/String;Landroid/os/Bundle;[Ljava/lang/String;ILandroid/os/Bundle;ZZI)I
@@ -880,8 +884,10 @@ Landroid/app/ProgressDialog;->mProgress:Landroid/widget/ProgressBar;
 Landroid/app/ProgressDialog;->mProgressNumber:Landroid/widget/TextView;
 Landroid/app/QueuedWork;->addFinisher(Ljava/lang/Runnable;)V
 Landroid/app/QueuedWork;->getHandler()Landroid/os/Handler;
+Landroid/app/QueuedWork;->queue(Ljava/lang/Runnable;Z)V
 Landroid/app/QueuedWork;->removeFinisher(Ljava/lang/Runnable;)V
 Landroid/app/QueuedWork;->sFinishers:Ljava/util/LinkedList;
+Landroid/app/ResourcesManager$ActivityResources;-><init>()V
 Landroid/app/ResourcesManager;-><init>()V
 Landroid/app/ResourcesManager;->appendLibAssetForMainAssetPath(Ljava/lang/String;Ljava/lang/String;)V
 Landroid/app/ResourcesManager;->createAssetManager(Landroid/content/res/ResourcesKey;)Landroid/content/res/AssetManager;
@@ -1356,8 +1362,10 @@ Landroid/content/Context;->sendOrderedBroadcastAsUser(Landroid/content/Intent;La
 Landroid/content/Context;->startActivityAsUser(Landroid/content/Intent;Landroid/os/Bundle;Landroid/os/UserHandle;)V
 Landroid/content/Context;->startActivityForResult(Ljava/lang/String;Landroid/content/Intent;ILandroid/os/Bundle;)V
 Landroid/content/Context;->STATUS_BAR_SERVICE:Ljava/lang/String;
+Landroid/content/ContextWrapper;->createApplicationContext(Landroid/content/pm/ApplicationInfo;I)Landroid/content/Context;
 Landroid/content/ContextWrapper;->getBasePackageName()Ljava/lang/String;
 Landroid/content/ContextWrapper;->getDisplay()Landroid/view/Display;
+Landroid/content/ContextWrapper;->getOpPackageName()Ljava/lang/String;
 Landroid/content/ContextWrapper;->mBase:Landroid/content/Context;
 Landroid/content/ContextWrapper;->registerReceiverAsUser(Landroid/content/BroadcastReceiver;Landroid/os/UserHandle;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent;
 Landroid/content/ContextWrapper;->startActivityAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V
@@ -1848,6 +1856,7 @@ Landroid/content/res/CompatibilityInfo$Translator;->translateRectInScreenToAppWi
 Landroid/content/res/CompatibilityInfo$Translator;->translateRectInScreenToAppWinFrame(Landroid/graphics/Rect;)V
 Landroid/content/res/CompatibilityInfo$Translator;->translateRegionInWindowToScreen(Landroid/graphics/Region;)V
 Landroid/content/res/CompatibilityInfo$Translator;->translateWindowLayout(Landroid/view/WindowManager$LayoutParams;)V
+Landroid/content/res/CompatibilityInfo;-><init>()V
 Landroid/content/res/CompatibilityInfo;-><init>(Landroid/content/pm/ApplicationInfo;IIZ)V
 Landroid/content/res/CompatibilityInfo;->applicationScale:F
 Landroid/content/res/CompatibilityInfo;->computeCompatibleScaling(Landroid/util/DisplayMetrics;Landroid/util/DisplayMetrics;)F
@@ -1861,6 +1870,7 @@ Landroid/content/res/Configuration;->makeDefault()V
 Landroid/content/res/Configuration;->resourceQualifierString(Landroid/content/res/Configuration;)Ljava/lang/String;
 Landroid/content/res/Configuration;->seq:I
 Landroid/content/res/Configuration;->userSetLocale:Z
+Landroid/content/res/ConfigurationBoundResourceCache;-><init>()V
 Landroid/content/res/DrawableCache;-><init>()V
 Landroid/content/res/DrawableCache;->getInstance(JLandroid/content/res/Resources;Landroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
 Landroid/content/res/ObbInfo;->salt:[B
@@ -2765,6 +2775,7 @@ Landroid/media/AudioGainConfig;->mRampDurationMs:I
 Landroid/media/AudioGainConfig;->mValues:[I
 Landroid/media/AudioHandle;-><init>(I)V
 Landroid/media/AudioHandle;->mId:I
+Landroid/media/AudioManager;-><init>()V
 Landroid/media/AudioManager;-><init>(Landroid/content/Context;)V
 Landroid/media/AudioManager;->abandonAudioFocusForCall()V
 Landroid/media/AudioManager;->createAudioPatch([Landroid/media/AudioPatch;[Landroid/media/AudioPortConfig;[Landroid/media/AudioPortConfig;)I
@@ -3024,6 +3035,8 @@ Landroid/media/MediaPlayer;->BYPASS_METADATA_FILTER:Z
 Landroid/media/MediaPlayer;->getMediaTimeProvider()Landroid/media/MediaTimeProvider;
 Landroid/media/MediaPlayer;->getMetadata(ZZ)Landroid/media/Metadata;
 Landroid/media/MediaPlayer;->invoke(Landroid/os/Parcel;Landroid/os/Parcel;)V
+Landroid/media/MediaPlayer;->MEDIA_INFO_EXTERNAL_METADATA_UPDATE:I
+Landroid/media/MediaPlayer;->MEDIA_INFO_TIMED_TEXT_ERROR:I
 Landroid/media/MediaPlayer;->METADATA_ALL:Z
 Landroid/media/MediaPlayer;->mEventHandler:Landroid/media/MediaPlayer$EventHandler;
 Landroid/media/MediaPlayer;->mOnCompletionListener:Landroid/media/MediaPlayer$OnCompletionListener;
@@ -3393,6 +3406,7 @@ Landroid/net/LinkProperties;->addLinkAddress(Landroid/net/LinkAddress;)Z
 Landroid/net/LinkProperties;->getAddresses()Ljava/util/List;
 Landroid/net/LinkProperties;->getAllAddresses()Ljava/util/List;
 Landroid/net/LinkProperties;->getAllLinkAddresses()Ljava/util/List;
+Landroid/net/LinkProperties;->getTcpBufferSizes()Ljava/lang/String;
 Landroid/net/LinkProperties;->isIdenticalHttpProxy(Landroid/net/LinkProperties;)Z
 Landroid/net/LinkProperties;->isIdenticalInterfaceName(Landroid/net/LinkProperties;)Z
 Landroid/net/LinkProperties;->mIfaceName:Ljava/lang/String;
@@ -6935,6 +6949,7 @@ Landroid/widget/Gallery;->mSelectedChild:Landroid/view/View;
 Landroid/widget/Gallery;->mSpacing:I
 Landroid/widget/Gallery;->trackMotionScroll(I)V
 Landroid/widget/GridLayout;->UNDEFINED_ALIGNMENT:Landroid/widget/GridLayout$Alignment;
+Landroid/widget/GridView;->determineColumns(I)Z
 Landroid/widget/GridView;->fillDown(II)Landroid/view/View;
 Landroid/widget/GridView;->fillUp(II)Landroid/view/View;
 Landroid/widget/GridView;->mColumnWidth:I
index 2971ef8..0014793 100644 (file)
@@ -2771,10 +2771,8 @@ android.security.net.config.PinSet
 android.security.net.config.RootTrustManager
 android.security.net.config.RootTrustManagerFactorySpi
 android.security.net.config.SystemCertificateSource
-android.security.net.config.SystemCertificateSource$NoPreloadHolder
 android.security.net.config.TrustedCertificateStoreAdapter
 android.security.net.config.UserCertificateSource
-android.security.net.config.UserCertificateSource$NoPreloadHolder
 android.security.net.config.XmlConfigSource
 android.security.net.config.XmlConfigSource$ParserException
 android.service.media.IMediaBrowserService
@@ -4556,7 +4554,6 @@ com.android.org.conscrypt.OpenSSLX509CertificateFactory$ParsingException
 com.android.org.conscrypt.PeerInfoProvider
 com.android.org.conscrypt.PeerInfoProvider$1
 com.android.org.conscrypt.Platform
-com.android.org.conscrypt.Platform$NoPreloadHolder
 com.android.org.conscrypt.Preconditions
 com.android.org.conscrypt.SSLClientSessionCache
 com.android.org.conscrypt.SSLParametersImpl
@@ -6072,7 +6069,6 @@ javax.net.ssl.ExtendedSSLSession
 javax.net.ssl.HandshakeCompletedListener
 javax.net.ssl.HostnameVerifier
 javax.net.ssl.HttpsURLConnection
-javax.net.ssl.HttpsURLConnection$NoPreloadHolder
 javax.net.ssl.KeyManager
 javax.net.ssl.KeyManagerFactory
 javax.net.ssl.KeyManagerFactory$1
index 3c7541f..83630f4 100644 (file)
@@ -2177,7 +2177,8 @@ public class ActivityManager {
         }
 
         /**
-         * @return Whether or not the snapshot is of a translucent app window.
+         * @return Whether or not the snapshot is of a translucent app window (non-fullscreen or has
+         * a non-opaque pixel format).
          */
         public boolean isTranslucent() {
             return mIsTranslucent;
index e4a0583..8bed105 100644 (file)
@@ -291,10 +291,7 @@ public class Dialog implements DialogInterface, Window.Callback,
                 if (mWindow.hasFeature(Window.FEATURE_ACTION_BAR)) {
                     mWindow.invalidatePanelMenu(Window.FEATURE_ACTION_BAR);
                 }
-                if (mDecor.getVisibility() != View.VISIBLE) {
-                    mDecor.setVisibility(View.VISIBLE);
-                    sendShowMessage();
-                }
+                mDecor.setVisibility(View.VISIBLE);
             }
             return;
         }
index 30f340c..43f69e1 100644 (file)
@@ -253,20 +253,27 @@ public class BackupManager {
     }
 
     /**
-     * @deprecated Since Android P app can no longer request restoring of its backup.
+     * @deprecated Applications shouldn't request a restore operation using this method. In Android
+     * P and later, this method is a no-op.
      *
-     * Restore the calling application from backup.  The data will be restored from the
+     * <p>Restore the calling application from backup. The data will be restored from the
      * current backup dataset if the application has stored data there, or from
      * the dataset used during the last full device setup operation if the current
      * backup dataset has no matching data.  If no backup data exists for this application
-     * in either source, a nonzero value will be returned.
+     * in either source, a non-zero value is returned.
      *
-     * <p>If this method returns zero (meaning success), the OS will attempt to retrieve
-     * a backed-up dataset from the remote transport, instantiate the application's
-     * backup agent, and pass the dataset to the agent's
+     * <p>If this method returns zero (meaning success), the OS attempts to retrieve a backed-up
+     * dataset from the remote transport, instantiate the application's backup agent, and pass the
+     * dataset to the agent's
      * {@link android.app.backup.BackupAgent#onRestore(BackupDataInput, int, android.os.ParcelFileDescriptor) onRestore()}
      * method.
      *
+     * <p class="caution">Unlike other restore operations, this method doesn't terminate the
+     * application after the restore. The application continues running to receive the
+     * {@link RestoreObserver} callbacks on the {@code observer} argument. Full backups use an
+     * {@link android.app.Application Application} base class while key-value backups use the
+     * application subclass declared in the AndroidManifest.xml {@code <application>} tag.
+     *
      * @param observer The {@link RestoreObserver} to receive callbacks during the restore
      * operation. This must not be null.
      *
@@ -282,7 +289,7 @@ public class BackupManager {
     /**
      * @deprecated Since Android P app can no longer request restoring of its backup.
      *
-     * Restore the calling application from backup.  The data will be restored from the
+     * <p>Restore the calling application from backup.  The data will be restored from the
      * current backup dataset if the application has stored data there, or from
      * the dataset used during the last full device setup operation if the current
      * backup dataset has no matching data.  If no backup data exists for this application
@@ -635,7 +642,7 @@ public class BackupManager {
         }
         return false;
     }
-    
+
     /**
      * Request an immediate backup, providing an observer to which results of the backup operation
      * will be published. The Android backup system will decide for each package whether it will
index 6508a88..7253e77 100644 (file)
@@ -1957,8 +1957,6 @@ public abstract class PackageManager {
      * </ul>
      * A version of 1.1.0 or higher also indicates:
      * <ul>
-     * <li>The {@code VK_ANDROID_external_memory_android_hardware_buffer} extension is
-     *     supported.</li>
      * <li>{@code SYNC_FD} external semaphore and fence handles are supported.</li>
      * <li>{@code VkPhysicalDeviceSamplerYcbcrConversionFeatures::samplerYcbcrConversion} is
      *     supported.</li>
index 172e248..2c9e543 100644 (file)
@@ -26933,10 +26933,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
      * version supported by the application. For example, the method
      * {@link View#onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo)} is not available
      * in API version 4 when the accessibility APIs were first introduced. If a
-     * developer would like his application to run on API version 4 devices (assuming
+     * developer would like their application to run on API version 4 devices (assuming
      * all other APIs used by the application are version 4 or lower) and take advantage
      * of this method, instead of overriding the method which would break the application's
-     * backwards compatibility, he can override the corresponding method in this
+     * backwards compatibility, they can override the corresponding method in this
      * delegate and register the delegate in the target View if the API version of
      * the system is high enough, i.e. the API version is the same as or higher than the API
      * version that introduced
index 0506f30..b2e53ed 100644 (file)
@@ -3305,8 +3305,11 @@ public final class ViewRootImpl implements ViewParent,
                 }
 
                 useAsyncReport = true;
-                mAttachInfo.mThreadedRenderer.draw(mView, mAttachInfo, this, mNextRtFrameCallback);
+
+                // draw(...) might invoke post-draw, which might register the next callback already.
+                final FrameDrawingCallback callback = mNextRtFrameCallback;
                 mNextRtFrameCallback = null;
+                mAttachInfo.mThreadedRenderer.draw(mView, mAttachInfo, this, callback);
             } else {
                 // If we get here with a disabled & requested hardware renderer, something went
                 // wrong (an invalidate posted right before we destroyed the hardware surface
index 3fe8f85..daea9a8 100644 (file)
@@ -2032,7 +2032,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
                  * Do this in onKeyUp since the Search key is also used for
                  * chording quick launch shortcuts.
                  */
-                if (getKeyguardManager().inKeyguardRestrictedInputMode()) {
+                if (isNotInstantAppAndKeyguardRestricted()) {
                     break;
                 }
                 if ((getContext().getResources().getConfiguration().uiMode
@@ -2056,6 +2056,11 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
         return false;
     }
 
+    private boolean isNotInstantAppAndKeyguardRestricted() {
+        return !getContext().getPackageManager().isInstantApp()
+            && getKeyguardManager().inKeyguardRestrictedInputMode();
+    }
+
     @Override
     protected void onActive() {
     }
index bde4943..ab90e1b 100644 (file)
 
     <assign-permission name="android.permission.DUMP" uid="incidentd" />
     <assign-permission name="android.permission.PACKAGE_USAGE_STATS" uid="incidentd" />
+    <assign-permission name="android.permission.INTERACT_ACROSS_USERS" uid="incidentd" />
 
     <assign-permission name="android.permission.ACCESS_LOWPAN_STATE" uid="lowpan" />
     <assign-permission name="android.permission.MANAGE_LOWPAN_INTERFACES" uid="lowpan" />
index a02fd89..f739fa2 100644 (file)
Binary files a/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png and b/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/gamma_tonemap.png differ
index c309ac5..4b45e3a 100644 (file)
Binary files a/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png and b/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/inverse_tonemap.png differ
index 414fad4..748d1a2 100644 (file)
Binary files a/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png and b/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/linear_tonemap.png differ
index c147a87..6e436ba 100644 (file)
Binary files a/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png and b/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/rec709_tonemap.png differ
index 4ce2125..9776874 100644 (file)
Binary files a/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png and b/docs/html/reference/images/camera2/metadata/android.tonemap.curveRed/srgb_tonemap.png differ
index abafb68..48094c4 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-Copyright (C) 2017 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.
@@ -13,28 +13,7 @@ Copyright (C) 2017 The Android Open Source Project
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="48dp"
-        android:height="48dp"
-        android:viewportWidth="48.0"
-        android:viewportHeight="48.0">
-    <path
-        android:pathData="M25.0,25.0m-20.5,0.0a20.5,20.5,0,1,1,41.0,0.0a20.5,20.5,0,1,1,-41.0,0.0"
-        android:fillAlpha="0.066"
-        android:fillColor="#000000"/>
-    <path
-        android:pathData="M24.0,24.0m-20.0,0.0a20.0,20.0,0,1,1,40.0,0.0a20.0,20.0,0,1,1,-40.0,0.0"
-        android:fillColor="#FFC107"/>
-    <path
-        android:pathData="M44,24.2010101 L33.9004889,14.101499 L14.101499,33.9004889 L24.2010101,44 C29.2525804,43.9497929 34.2887564,41.9975027 38.1431296,38.1431296 C41.9975027,34.2887564 43.9497929,29.2525804 44,24.2010101 Z"
-        android:fillColor="#FE9F00"/>
-    <path
-        android:pathData="M24.0,24.0m-14.0,0.0a14.0,14.0,0,1,1,28.0,0.0a14.0,14.0,0,1,1,-28.0,0.0"
-        android:fillColor="#FED44F"/>
-    <path
-        android:pathData="M37.7829445,26.469236 L29.6578482,18.3441397 L18.3441397,29.6578482 L26.469236,37.7829445 C29.1911841,37.2979273 31.7972024,36.0037754 33.9004889,33.9004889 C36.0037754,31.7972024 37.2979273,29.1911841 37.7829445,26.469236 Z"
-        android:fillColor="#FFC107"/>
-    <path
-        android:pathData="M24.0,24.0m-8.0,0.0a8.0,8.0,0,1,1,16.0,0.0a8.0,8.0,0,1,1,-16.0,0.0"
-        android:fillColor="#FFFFFF"/>
-</vector>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+    <background android:drawable="@drawable/icon_bg"/>
+    <foreground android:drawable="@drawable/p"/>
+</adaptive-icon>
diff --git a/packages/SystemUI/res/drawable-nodpi/icon_bg.xml b/packages/SystemUI/res/drawable-nodpi/icon_bg.xml
new file mode 100644 (file)
index 0000000..31ecf7e
--- /dev/null
@@ -0,0 +1,18 @@
+<!--
+Copyright (C) 2018 The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<color xmlns:android="http://schemas.android.com/apk/res/android"
+    android:color="#C5E1A5" />
+
diff --git a/packages/SystemUI/res/drawable-nodpi/p.xml b/packages/SystemUI/res/drawable-nodpi/p.xml
new file mode 100644 (file)
index 0000000..596b782
--- /dev/null
@@ -0,0 +1,33 @@
+<!--
+Copyright (C) 2018 The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+  <path
+      android:pathData="M49,65L54,65C60.075,65 65,60.075 65,54C65,47.925 60.075,43 54,43C47.925,43 43,47.925 43,54L43,108"
+      android:strokeWidth="16"
+      android:fillColor="#00000000"
+      android:strokeColor="#7CB342"
+      android:fillType="evenOdd"/>
+  <path
+      android:pathData="M51,65L54,65C60.075,65 65,60.075 65,54C65,47.925 60.075,43 54,43C47.925,43 43,47.925 43,54L43,108"
+      android:strokeWidth="8"
+      android:fillColor="#00000000"
+      android:strokeColor="#FFFFFF"
+      android:fillType="evenOdd"/>
+</vector>
index 2e1487c..37e2b53 100644 (file)
@@ -39,7 +39,7 @@
             android:layout_height="match_parent"
             android:layout_marginTop="@dimen/car_user_switcher_margin_top"
             app:verticallyCenterListContent="true"
-            app:dayNightStyle="force_night"
+            app:dayNightStyle="always_light"
             app:showPagedListViewDivider="false"
             app:gutter="both"
             app:itemSpacing="@dimen/car_user_switcher_vertical_spacing_between_users"/>
index 0e8db77..c43afc9 100644 (file)
@@ -39,7 +39,7 @@
             android:id="@+id/user_grid"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            app:dayNightStyle="force_night"
+            app:dayNightStyle="always_light"
             app:showPagedListViewDivider="false"
             app:gutter="both"
             app:itemSpacing="@dimen/car_user_switcher_vertical_spacing_between_users"/>
index b81d363..c59dbdc 100644 (file)
@@ -22,7 +22,7 @@
     <dimen name="docked_divider_handle_width">2dp</dimen>
     <dimen name="docked_divider_handle_height">16dp</dimen>
 
-    <dimen name="brightness_mirror_height">96dp</dimen>
+    <dimen name="brightness_mirror_height">40dp</dimen>
 
     <!-- Width for the spacer, used between QS tiles. -->
     <dimen name="qs_quick_tile_space_width">38dp</dimen>
index 4433532..f00957a 100644 (file)
 
     <dimen name="notification_panel_width">@dimen/match_parent</dimen>
 
-    <dimen name="brightness_mirror_height">108dp</dimen>
+    <dimen name="brightness_mirror_height">48dp</dimen>
 
     <!-- The width of the panel that holds the quick settings. -->
     <dimen name="qs_panel_width">@dimen/notification_panel_width</dimen>
index 49dba68..41df196 100644 (file)
@@ -282,6 +282,7 @@ public class KeyguardStatusView extends GridLayout implements
         mClockView.setPivotX(mClockView.getWidth() / 2);
         mClockView.setPivotY(0);
         mLastLayoutHeight = getHeight();
+        layoutOwnerInfo();
     }
 
     @Override
@@ -418,9 +419,11 @@ public class KeyguardStatusView extends GridLayout implements
         if (mLogoutView != null) {
             mLogoutView.setAlpha(dark ? 0 : 1);
         }
+
         if (mOwnerInfo != null) {
             boolean hasText = !TextUtils.isEmpty(mOwnerInfo.getText());
-            mOwnerInfo.setVisibility(hasText && mDarkAmount != 1 ? VISIBLE : GONE);
+            mOwnerInfo.setVisibility(hasText ? VISIBLE : GONE);
+            layoutOwnerInfo();
         }
 
         final int blendedTextColor = ColorUtils.blendARGB(mTextColor, Color.WHITE, mDarkAmount);
@@ -430,6 +433,20 @@ public class KeyguardStatusView extends GridLayout implements
         mClockSeparator.setBackgroundColor(blendedTextColor);
     }
 
+    private void layoutOwnerInfo() {
+        if (mOwnerInfo != null && mOwnerInfo.getVisibility() != GONE) {
+            // Animate owner info during wake-up transition
+            mOwnerInfo.setAlpha(1f - mDarkAmount);
+
+            float ratio = mDarkAmount;
+            // Calculate how much of it we should crop in order to have a smooth transition
+            int collapsed = mOwnerInfo.getTop() - mOwnerInfo.getPaddingTop();
+            int expanded = mOwnerInfo.getBottom() + mOwnerInfo.getPaddingBottom();
+            int toRemove = (int) ((expanded - collapsed) * ratio);
+            setBottom(getMeasuredHeight() - toRemove);
+        }
+    }
+
     public void setPulsing(boolean pulsing, boolean animate) {
         mPulsing = pulsing;
         mKeyguardSlice.setPulsing(pulsing, animate);
index a48bcbd..6418c80 100644 (file)
@@ -153,9 +153,14 @@ public class QSSecurityFooter implements OnClickListener, DialogInterface.OnClic
                 hasCACerts, hasCACertsInWorkProfile, isNetworkLoggingEnabled, vpnName,
                 vpnNameWorkProfile, organizationName, workProfileName);
         // Update the icon
-        int footerIconId = vpnName != null || vpnNameWorkProfile != null
-                ? R.drawable.ic_qs_vpn
-                : R.drawable.ic_info_outline;
+        int footerIconId = R.drawable.ic_info_outline;
+        if (vpnName != null || vpnNameWorkProfile != null) {
+            if (mSecurityController.isVpnBranded()) {
+                footerIconId = R.drawable.ic_qs_branded_vpn;
+            } else {
+                footerIconId = R.drawable.ic_qs_vpn;
+            }
+        }
         if (mFooterIconId != footerIconId) {
             mFooterIconId = footerIconId;
             mMainHandler.post(mUpdateIcon);
index ba265d8..f78e391 100644 (file)
@@ -19,6 +19,8 @@ package com.android.systemui.statusbar.car;
 import android.animation.Animator;
 import android.animation.AnimatorListenerAdapter;
 import android.content.Context;
+import android.content.pm.UserInfo;
+import android.util.Log;
 import android.view.View;
 import android.view.ViewStub;
 
@@ -60,6 +62,11 @@ public class FullscreenUserSwitcher {
     }
 
     public void show() {
+        // On a switch from the system user, don't show the user switcher
+        if (mUserManagerHelper.isHeadlessSystemUser() && mUserManagerHelper
+            .userIsSystemUser(mUserManagerHelper.getForegroundUserInfo())) {
+            return;
+        }
         if (mShowing) {
             return;
         }
index 76860e6..f0b1a82 100644 (file)
@@ -403,10 +403,19 @@ public class FingerprintUnlockController extends KeyguardUpdateMonitorCallback {
         pw.print("   mWakeLock="); pw.println(mWakeLock);
     }
 
+    /**
+     * Successful authentication with fingerprint that wakes up the device.
+     */
     public boolean isWakeAndUnlock() {
-        return mMode == MODE_UNLOCK
-                || mMode == MODE_WAKE_AND_UNLOCK
+        return mMode == MODE_WAKE_AND_UNLOCK
                 || mMode == MODE_WAKE_AND_UNLOCK_PULSING
                 || mMode == MODE_WAKE_AND_UNLOCK_FROM_DREAM;
     }
+
+    /**
+     * Successful authentication with fingerprint when the screen was either on or off.
+     */
+    public boolean isFingerprintUnlock() {
+        return isWakeAndUnlock() || mMode == MODE_UNLOCK;
+    }
 }
index 9ba0880..279ede9 100644 (file)
@@ -896,6 +896,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
 
     public void setKeyguardOccluded(boolean keyguardOccluded) {
         mKeyguardOccluded = keyguardOccluded;
+        updateScrims();
     }
 
     public interface Callback {
index c70f034..7bbeed6 100644 (file)
@@ -1599,7 +1599,9 @@ public class StatusBar extends SystemUI implements DemoMode,
             return; // called too early
         }
 
-        if (mLaunchTransitionFadingAway) {
+        boolean wakeAndUnlock = mFingerprintUnlockController != null
+            && mFingerprintUnlockController.isWakeAndUnlock();
+        if (mLaunchTransitionFadingAway || wakeAndUnlock) {
             mBackdrop.setVisibility(View.INVISIBLE);
             Trace.endSection();
             return;
@@ -4712,11 +4714,11 @@ public class StatusBar extends SystemUI implements DemoMode,
 
         // We don't want to end up in KEYGUARD state when we're unlocking with
         // fingerprint from doze. We should cross fade directly from black.
-        final boolean wakeAndUnlocking = mFingerprintUnlockController.getMode()
-                == FingerprintUnlockController.MODE_WAKE_AND_UNLOCK;
+        boolean wakeAndUnlocking = mFingerprintUnlockController.isWakeAndUnlock();
 
         // Do not animate the scrim expansion when triggered by the fingerprint sensor.
-        mScrimController.setExpansionAffectsAlpha(!mFingerprintUnlockController.isWakeAndUnlock());
+        mScrimController.setExpansionAffectsAlpha(
+                !mFingerprintUnlockController.isFingerprintUnlock());
 
         if (mBouncerShowing) {
             // Bouncer needs the front scrim when it's on top of an activity,
index bf962b8..d7fad67 100644 (file)
@@ -38,6 +38,7 @@ import android.graphics.drawable.ColorDrawable;
 import android.graphics.PixelFormat;
 import android.graphics.drawable.Drawable;
 import android.media.AudioAttributes;
+import android.media.AudioManager;
 import android.os.Debug;
 import android.os.Handler;
 import android.os.IBinder;
@@ -527,7 +528,7 @@ public class CarVolumeDialogImpl implements VolumeDialog {
 
   private final ICarVolumeCallback mVolumeChangeCallback = new ICarVolumeCallback.Stub() {
     @Override
-    public void onGroupVolumeChanged(int groupId) {
+    public void onGroupVolumeChanged(int groupId, int flags) {
       VolumeItem volumeItem = mAvailableVolumeItems.get(groupId);
       int value = getSeekbarValue(mCarAudioManager, groupId);
       // Do not update the progress if it is the same as before. When car audio manager sets its
@@ -536,12 +537,14 @@ public class CarVolumeDialogImpl implements VolumeDialog {
       if (value != volumeItem.progress) {
         volumeItem.listItem.setProgress(value);
         volumeItem.progress = value;
-        show(Events.SHOW_REASON_VOLUME_CHANGED);
+        if ((flags & AudioManager.FLAG_SHOW_UI) != 0) {
+          show(Events.SHOW_REASON_VOLUME_CHANGED);
+        }
       }
     }
 
     @Override
-    public void onMasterMuteChanged() {
+    public void onMasterMuteChanged(int flags) {
       // ignored
     }
   };
index 40337b8..e95702c 100644 (file)
@@ -542,6 +542,18 @@ public class ScrimControllerTest extends SysuiTestCase {
     }
 
     @Test
+    public void testHidesShowWhenLockedActivity_whenAlreadyInAod() {
+        mScrimController.setWallpaperSupportsAmbientMode(true);
+        mScrimController.transitionTo(ScrimState.AOD);
+        mScrimController.finishAnimationsImmediately();
+        assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_TRANSPARENT);
+
+        mScrimController.setKeyguardOccluded(true);
+        mScrimController.finishAnimationsImmediately();
+        assertScrimVisibility(VISIBILITY_FULLY_TRANSPARENT, VISIBILITY_FULLY_OPAQUE);
+    }
+
+    @Test
     public void testEatsTouchEvent() {
         HashSet<ScrimState> eatsTouches =
                 new HashSet<>(Arrays.asList(ScrimState.AOD, ScrimState.PULSING));
index 2458234..692d606 100644 (file)
@@ -15311,6 +15311,7 @@ public class ActivityManagerService extends IActivityManager.Stub
             mStackSupervisor.resumeFocusedStackTopActivityLocked();
             mUserController.sendUserSwitchBroadcasts(-1, currentUserId);
 
+            BinderInternal.nSetBinderProxyCountWatermarks(6000,5500);
             BinderInternal.nSetBinderProxyCountEnabled(true);
             BinderInternal.setBinderProxyCountCallback(
                     new BinderInternal.BinderProxyLimitListener() {
@@ -21035,15 +21036,9 @@ public class ActivityManagerService extends IActivityManager.Stub
     }
 
     private List<ResolveInfo> collectReceiverComponents(Intent intent, String resolvedType,
-            int callingUid, boolean callerInstantApp, int[] users) {
+            int callingUid, int[] users) {
         // TODO: come back and remove this assumption to triage all broadcasts
         int pmFlags = STOCK_PM_FLAGS | MATCH_DEBUG_TRIAGED_MISSING;
-        // Instant apps should be able to send broadcasts to themselves, so we would
-        // match instant receivers and later the broadcast queue would enforce that
-        // the broadcast cannot be sent to a receiver outside the instant UID.
-        if (callerInstantApp) {
-            pmFlags |= PackageManager.MATCH_INSTANT;
-        }
 
         List<ResolveInfo> receivers = null;
         try {
@@ -21672,8 +21667,7 @@ public class ActivityManagerService extends IActivityManager.Stub
         // Need to resolve the intent to interested receivers...
         if ((intent.getFlags()&Intent.FLAG_RECEIVER_REGISTERED_ONLY)
                  == 0) {
-            receivers = collectReceiverComponents(intent, resolvedType, callingUid,
-                    callerInstantApp, users);
+            receivers = collectReceiverComponents(intent, resolvedType, callingUid, users);
         }
         if (intent.getComponent() == null) {
             if (userId == UserHandle.USER_ALL && callingUid == SHELL_UID) {
index 0f8c526..8d730b4 100644 (file)
@@ -253,8 +253,8 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt
 
     // 1 second, or 1 Hz frequency.
     private static final long LOCATION_UPDATE_MIN_TIME_INTERVAL_MILLIS = 1000;
-    // 30 seconds.
-    private static final long LOCATION_UPDATE_DURATION_MILLIS = 30 * 1000;
+    // Default update duration in milliseconds for REQUEST_LOCATION.
+    private static final long LOCATION_UPDATE_DURATION_MILLIS = 0;
 
     /** simpler wrapper for ProviderRequest + Worksource */
     private static class GpsRequest {
index 6fff367..68b2a58 100644 (file)
@@ -781,6 +781,9 @@ public class MediaSessionService extends SystemService implements Monitor {
     }
 
     private void dispatchVolumeKeyLongPressLocked(KeyEvent keyEvent) {
+        if (mCurrentFullUserRecord.mOnVolumeKeyLongPressListener == null) {
+            return;
+        }
         try {
             mCurrentFullUserRecord.mOnVolumeKeyLongPressListener.onVolumeKeyLongPress(keyEvent);
         } catch (RemoteException e) {
index e45de45..08d0ae9 100644 (file)
@@ -1334,8 +1334,20 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
             // for the next re-entry into PiP (assuming the activity is not hidden or destroyed)
             final TaskStack pinnedStack = mDisplayContent.getPinnedStack();
             if (pinnedStack != null) {
+                final Rect stackBounds;
+                if (pinnedStack.lastAnimatingBoundsWasToFullscreen()) {
+                    // We are animating the bounds, use the pre-animation bounds to save the snap
+                    // fraction
+                    stackBounds = pinnedStack.mPreAnimationBounds;
+                } else {
+                    // We skip the animation if the fullscreen configuration is not compatible, so
+                    // use the current bounds to calculate the saved snap fraction instead
+                    // (see PinnedActivityStack.skipResizeAnimation())
+                    stackBounds = mTmpRect;
+                    pinnedStack.getBounds(stackBounds);
+                }
                 mDisplayContent.mPinnedStackControllerLocked.saveReentrySnapFraction(this,
-                        pinnedStack.mPreAnimationBounds);
+                        stackBounds);
             }
         }
     }
index 5f1916d..278d2b8 100644 (file)
@@ -589,6 +589,7 @@ class PinnedStackController {
         pw.println(prefix + "  mImeHeight=" + mImeHeight);
         pw.println(prefix + "  mIsShelfShowing=" + mIsShelfShowing);
         pw.println(prefix + "  mShelfHeight=" + mShelfHeight);
+        pw.println(prefix + "  mReentrySnapFraction=" + mReentrySnapFraction);
         pw.println(prefix + "  mIsMinimized=" + mIsMinimized);
         if (mActions.isEmpty()) {
             pw.println(prefix + "  mActions=[]");
@@ -601,6 +602,7 @@ class PinnedStackController {
             }
             pw.println(prefix + "  ]");
         }
+        pw.println(prefix + " mDisplayInfo=" + mDisplayInfo);
     }
 
     void writeToProto(ProtoOutputStream proto, long fieldId) {
index f17bbb9..733a248 100644 (file)
@@ -28,6 +28,7 @@ import android.app.ActivityManager.TaskSnapshot;
 import android.content.pm.PackageManager;
 import android.graphics.Bitmap;
 import android.graphics.GraphicBuffer;
+import android.graphics.PixelFormat;
 import android.graphics.Rect;
 import android.os.Environment;
 import android.os.Handler;
@@ -266,7 +267,7 @@ class TaskSnapshotController {
 
         final GraphicBuffer buffer = SurfaceControl.captureLayers(
                 task.getSurfaceControl().getHandle(), mTmpRect, scaleFraction);
-
+        final boolean isWindowTranslucent = mainWindow.getAttrs().format != PixelFormat.OPAQUE;
         if (buffer == null || buffer.getWidth() <= 1 || buffer.getHeight() <= 1) {
             if (DEBUG_SCREENSHOT) {
                 Slog.w(TAG_WM, "Failed to take screenshot for " + task);
@@ -276,7 +277,7 @@ class TaskSnapshotController {
         return new TaskSnapshot(buffer, top.getConfiguration().orientation,
                 getInsets(mainWindow), isLowRamDevice /* reduced */, scaleFraction /* scale */,
                 true /* isRealSnapshot */, task.getWindowingMode(), getSystemUiVisibility(task),
-                !top.fillsParent());
+                !top.fillsParent() || isWindowTranslucent);
     }
 
     private boolean shouldDisableSnapshots() {
@@ -363,11 +364,13 @@ class TaskSnapshotController {
         if (hwBitmap == null) {
             return null;
         }
+        // Note, the app theme snapshot is never translucent because we enforce a non-translucent
+        // color above
         return new TaskSnapshot(hwBitmap.createGraphicBufferHandle(),
                 topChild.getConfiguration().orientation, mainWindow.mStableInsets,
                 ActivityManager.isLowRamDeviceStatic() /* reduced */, 1.0f /* scale */,
                 false /* isRealSnapshot */, task.getWindowingMode(), getSystemUiVisibility(task),
-                !topChild.fillsParent());
+                false);
     }
 
     /**
index c370a00..b74a582 100644 (file)
@@ -2353,8 +2353,12 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
             final String value = Boolean.toString(hasDeviceOwner);
             mInjector.systemPropertiesSet(PROPERTY_DEVICE_OWNER_PRESENT, value);
             Slog.i(LOG_TAG, "Set ro.device_owner property to " + value);
+        }
+    }
 
-            if (hasDeviceOwner && mInjector.securityLogGetLoggingEnabledProperty()) {
+    private void maybeStartSecurityLogMonitorOnActivityManagerReady() {
+        synchronized (getLockObject()) {
+            if (mInjector.securityLogIsLoggingEnabled()) {
                 mSecurityLogMonitor.start();
                 mInjector.runCryptoSelfTest();
                 maybePauseDeviceWideLoggingLocked();
@@ -3353,6 +3357,9 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                 loadAdminDataAsync();
                 mOwners.systemReady();
                 break;
+            case SystemService.PHASE_ACTIVITY_MANAGER_READY:
+                maybeStartSecurityLogMonitorOnActivityManagerReady();
+                break;
             case SystemService.PHASE_BOOT_COMPLETED:
                 ensureDeviceOwnerUserStarted(); // TODO Consider better place to do this.
                 break;
index 145ed7e..c68a780 100644 (file)
@@ -40,7 +40,14 @@ import java.util.Map;
 import java.util.Objects;
 
 /**
- * A class representing an APN configuration.
+ * An Access Point Name (APN) configuration for a carrier data connection.
+ *
+ * <p>The APN provides configuration to connect a cellular network device to an IP data network. A
+ * carrier uses the name, type and other configuration in an {@code APNSetting} to decide which IP
+ * address to assign, any security methods to apply, and how the device might be connected to
+ * private networks.
+ *
+ * <p>Use {@link ApnSetting.Builder} to create new instances.
  */
 public class ApnSetting implements Parcelable {
 
@@ -336,7 +343,7 @@ public class ApnSetting implements Parcelable {
     }
 
     /**
-     * Returns the entry name of the APN.
+     * Gets the human-readable name that describes the APN.
      *
      * @return the entry name for the APN
      */
@@ -354,18 +361,21 @@ public class ApnSetting implements Parcelable {
     }
 
     /**
-     * Returns the proxy address of the APN.
+     * Gets the HTTP proxy address configured for the APN. The proxy address might be an IP address
+     * or hostname. This method returns {@code null} if system networking (typically DNS) isn’t
+     * available to resolve a hostname value—values set as IP addresses don’t have this restriction.
+     * This is a known problem and will be addressed in a future release.
      *
-     * @return proxy address.
+     * @return the HTTP proxy address or {@code null} if DNS isn’t available to resolve a hostname
      */
     public InetAddress getProxyAddress() {
         return mProxyAddress;
     }
 
     /**
-     * Returns the proxy port of the APN.
+     * Returns the proxy address of the APN.
      *
-     * @return proxy port
+     * @return proxy address.
      */
     public int getProxyPort() {
         return mProxyPort;
@@ -380,9 +390,12 @@ public class ApnSetting implements Parcelable {
     }
 
     /**
-     * Returns the MMS proxy address of the APN.
+     * Gets the MMS proxy address configured for the APN. The MMS proxy address might be an IP
+     * address or hostname. This method returns {@code null} if system networking (typically DNS)
+     * isn’t available to resolve a hostname value—values set as IP addresses don’t have this
+     * restriction. This is a known problem and will be addressed in a future release.
      *
-     * @return MMS proxy address.
+     * @return the MMS proxy address or {@code null} if DNS isn’t available to resolve a hostname
      */
     public InetAddress getMmsProxyAddress() {
         return mMmsProxyAddress;
@@ -1040,6 +1053,39 @@ public class ApnSetting implements Parcelable {
         return value == null ? NOT_IN_MAP_INT : value;
     }
 
+    /**
+     * Provides a convenient way to set the fields of a {@link ApnSetting} when creating a new
+     * instance. The following settings are required to build an {@code ApnSetting}:
+     *
+     * <ul><li>apnTypeBitmask</li>
+     * <li>apnName</li>
+     * <li>entryName</li></ul>
+     *
+     * <p>The example below shows how you might create a new {@code ApnSetting}:
+     *
+     * <pre><code>
+     * // Create an MMS proxy address with a hostname. A network might not be
+     * // available, so supply a dummy (0.0.0.0) IPv4 address to avoid DNS lookup.
+     * String host = "mms.example.com";
+     * byte[] ipAddress = new byte[4];
+     * InetAddress mmsProxy;
+     * try {
+     *   mmsProxy = InetAddress.getByAddress(host, ipAddress);
+     * } catch (UnknownHostException e) {
+     *   e.printStackTrace();
+     *   return;
+     * }
+     *
+     * ApnSetting apn = new ApnSetting.Builder()
+     *     .setApnTypeBitmask(ApnSetting.TYPE_DEFAULT | ApnSetting.TYPE_MMS)
+     *     .setApnName("apn.example.com")
+     *     .setEntryName("Example Carrier APN")
+     *     .setMmsc(Uri.parse("http://mms.example.com:8002"))
+     *     .setMmsProxyAddress(mmsProxy)
+     *     .setMmsProxyPort(8799)
+     *     .build();
+     * </code></pre>
+     */
     public static class Builder{
         private String mEntryName;
         private String mApnName;
@@ -1160,7 +1206,7 @@ public class ApnSetting implements Parcelable {
         }
 
         /**
-         * Sets the entry name of the APN.
+         * Sets a human-readable name that describes the APN.
          *
          * @param entryName the entry name to set for the APN
          */
@@ -1180,7 +1226,15 @@ public class ApnSetting implements Parcelable {
         }
 
         /**
-         * Sets the proxy address of the APN.
+         * Sets the address of an HTTP proxy for the APN. The proxy address can be an IP address or
+         * hostname. If {@code proxy} contains both an IP address and hostname, this method ignores
+         * the IP address.
+         *
+         * <p>The {@link java.net.InetAddress} methods
+         * {@link java.net.InetAddress#getAllByName getAllByName()} require DNS for hostname
+         * resolution. To avoid this requirement when setting a hostname, call
+         * {@link java.net.InetAddress#getByAddress(java.lang.String, byte[])} with both the
+         * hostname and a dummy IP address. See {@link ApnSetting.Builder above} for an example.
          *
          * @param proxy the proxy address to set for the APN
          */
@@ -1210,7 +1264,16 @@ public class ApnSetting implements Parcelable {
         }
 
         /**
-         * Sets the MMS proxy address of the APN.
+         * Sets the address of an MMS proxy for the APN. The MMS proxy address can be an IP address
+         * or hostname. If {@code mmsProxy} contains both an IP address and hostname, this method
+         * ignores the IP address.
+         *
+         * <p>The {@link java.net.InetAddress} methods
+         * {@link java.net.InetAddress#getByName getByName()} and
+         * {@link java.net.InetAddress#getAllByName getAllByName()} require DNS for hostname
+         * resolution. To avoid this requirement when setting a hostname, call
+         * {@link java.net.InetAddress#getByAddress(java.lang.String, byte[])} with both the
+         * hostname and a dummy IP address. See {@link ApnSetting.Builder above} for an example.
          *
          * @param mmsProxy the MMS proxy address to set for the APN
          */
@@ -1358,4 +1421,3 @@ public class ApnSetting implements Parcelable {
         }
     }
 }
-
index 280afad..703a67b 100644 (file)
@@ -106,6 +106,7 @@ cc_library_shared {
     shared_libs: [
         "liblog",
         "libutils",
+        "libcutils",
     ],
     static_libs: ["libstatssocket"],
 }
index 638549d..140653a 100644 (file)
@@ -104,6 +104,7 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms,
     fprintf(out, "#include <mutex>\n");
     fprintf(out, "#include <chrono>\n");
     fprintf(out, "#include <thread>\n");
+    fprintf(out, "#include <cutils/properties.h>\n");
     fprintf(out, "#include <stats_event_list.h>\n");
     fprintf(out, "#include <log/log.h>\n");
     fprintf(out, "#include <statslog.h>\n");
@@ -114,6 +115,7 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms,
     fprintf(out, "namespace util {\n");
     fprintf(out, "// the single event tag id for all stats logs\n");
     fprintf(out, "const static int kStatsEventTag = 1937006964;\n");
+    fprintf(out, "const static bool kStatsdEnabled = property_get_bool(\"ro.statsd.enable\", true);\n");
 
     std::set<string> kTruncatingAtomNames = {"mobile_radio_power_state_changed",
                                              "audio_state_changed",
@@ -242,6 +244,7 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms,
 
         fprintf(out, "{\n");
         argIndex = 1;
+        fprintf(out, "  if (kStatsdEnabled) {\n");
         fprintf(out, "    stats_event_list event(kStatsEventTag);\n");
         fprintf(out, "    event << android::elapsedRealtimeNano();\n\n");
         fprintf(out, "    event << code;\n\n");
@@ -286,6 +289,9 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms,
         }
 
         fprintf(out, "    return event.write(LOG_ID_STATS);\n");
+        fprintf(out, "  } else {\n");
+        fprintf(out, "    return 1;\n");
+        fprintf(out, "  }\n");
         fprintf(out, "}\n");
         fprintf(out, "\n");
     }
@@ -375,6 +381,7 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms,
 
         fprintf(out, "{\n");
         argIndex = 1;
+        fprintf(out, "  if (kStatsdEnabled) {\n");
         fprintf(out, "    stats_event_list event(kStatsEventTag);\n");
         fprintf(out, "    event << android::elapsedRealtimeNano();\n\n");
         fprintf(out, "    event << code;\n\n");
@@ -398,6 +405,9 @@ static int write_stats_log_cpp(FILE *out, const Atoms &atoms,
         }
 
         fprintf(out, "    return event.write(LOG_ID_STATS);\n");
+        fprintf(out, "  } else {\n");
+        fprintf(out, "    return 1;\n");
+        fprintf(out, "  }\n");
         fprintf(out, "}\n");
         fprintf(out, "\n");
     }
@@ -1193,4 +1203,4 @@ main(int argc, char const*const* argv)
     GOOGLE_PROTOBUF_VERIFY_VERSION;
 
     return android::stats_log_api_gen::run(argc, argv);
-}
\ No newline at end of file
+}