OSDN Git Service

Merge "MediaSessionService: Fix NPE" into pi-dev
authorJaewan Kim <jaewan@google.com>
Thu, 7 Jun 2018 21:19:03 +0000 (21:19 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Thu, 7 Jun 2018 21:19:03 +0000 (21:19 +0000)
28 files changed:
cmds/statsd/statsd.rc
config/hiddenapi-light-greylist.txt
config/preloaded-classes
core/java/android/app/ActivityManager.java
core/java/android/app/backup/BackupManager.java
core/java/android/content/pm/IPackageManager.aidl
core/java/android/content/pm/PackageManager.java
core/java/android/content/pm/PackageParser.java
core/java/android/view/View.java
core/res/AndroidManifest.xml
data/etc/platform.xml
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/values-land/dimens.xml
packages/SystemUI/res/values/dimens.xml
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/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
services/core/java/com/android/server/pm/PackageManagerService.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/com/android/internal/telephony/CarrierAppUtils.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 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 03e600e..c988fa9 100644 (file)
@@ -598,8 +598,6 @@ interface IPackageManager {
     boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, int userId);
     boolean getApplicationHiddenSettingAsUser(String packageName, int userId);
 
-    boolean setSystemAppInstallState(String packageName, boolean installed, int userId);
-
     IPackageInstaller getPackageInstaller();
 
     boolean setBlockUninstallForUser(String packageName, boolean blockUninstall, int userId);
index b677b5e..6508a88 100644 (file)
@@ -147,7 +147,6 @@ public abstract class PackageManager {
             GET_DISABLED_COMPONENTS,
             GET_DISABLED_UNTIL_USED_COMPONENTS,
             GET_UNINSTALLED_PACKAGES,
-            MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS,
     })
     @Retention(RetentionPolicy.SOURCE)
     public @interface PackageInfoFlags {}
@@ -165,7 +164,6 @@ public abstract class PackageManager {
             MATCH_STATIC_SHARED_LIBRARIES,
             GET_DISABLED_UNTIL_USED_COMPONENTS,
             GET_UNINSTALLED_PACKAGES,
-            MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS,
     })
     @Retention(RetentionPolicy.SOURCE)
     public @interface ApplicationInfoFlags {}
@@ -524,12 +522,6 @@ public abstract class PackageManager {
     public static final int MATCH_DEBUG_TRIAGED_MISSING = 0x10000000;
 
     /**
-     * Internal flag used to indicate that a package is a hidden system app.
-     * @hide
-     */
-    public static final int MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS =  0x20000000;
-
-    /**
      * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when
      * resolving an intent that matches the {@code CrossProfileIntentFilter},
      * the current profile will be skipped. Only activities in the target user
@@ -4851,8 +4843,7 @@ public abstract class PackageManager {
      * on the system for other users, also install it for the specified user.
      * @hide
      */
-    @RequiresPermission(anyOf = {
-            Manifest.permission.INSTALL_EXISTING_PACKAGES,
+     @RequiresPermission(anyOf = {
             Manifest.permission.INSTALL_PACKAGES,
             Manifest.permission.INTERACT_ACROSS_USERS_FULL})
     public abstract int installExistingPackageAsUser(String packageName, @UserIdInt int userId)
index b8eb074..2da2cb4 100644 (file)
@@ -639,19 +639,11 @@ public class PackageParser {
      */
     private static boolean checkUseInstalledOrHidden(int flags, PackageUserState state,
             ApplicationInfo appInfo) {
-        // Returns false if the package is hidden system app until installed.
-        if ((flags & PackageManager.MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS) == 0
-                && !state.installed
-                && appInfo != null && appInfo.isSystemApp()) {
-            return false;
-        }
-
         // If available for the target user, or trying to match uninstalled packages and it's
         // a system app.
         return state.isAvailable(flags)
                 || (appInfo != null && appInfo.isSystemApp()
-                        && ((flags & PackageManager.MATCH_KNOWN_PACKAGES) != 0
-                        || (flags & PackageManager.MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS) != 0));
+                        && (flags & PackageManager.MATCH_KNOWN_PACKAGES) != 0);
     }
 
     public static boolean isAvailable(PackageUserState state) {
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 dced0ad..66c497e 100644 (file)
     <permission android:name="android.permission.INSTALL_PACKAGE_UPDATES"
         android:protectionLevel="signature|privileged" />
 
-    <!-- Allows an application to install existing system packages. This is a limited
-         version of {@link android.Manifest.permission#INSTALL_PACKAGES}.
-         <p>Not for use by third-party applications.
-         TODO(b/80204953): remove this permission once we have a long-term solution.
-         @hide
-    -->
-    <permission android:name="com.android.permission.INSTALL_EXISTING_PACKAGES"
-        android:protectionLevel="signature|privileged" />
-
     <!-- @SystemApi Allows an application to clear user data.
          <p>Not for use by third-party applications
          @hide
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 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 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 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 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 1010ce1..1b8c2cc 100644 (file)
@@ -13967,43 +13967,6 @@ public class PackageManagerService extends IPackageManager.Stub
         return false;
     }
 
-    @Override
-    public boolean setSystemAppInstallState(String packageName, boolean installed, int userId) {
-        enforceSystemOrPhoneCaller("setSystemAppInstallState");
-        PackageSetting pkgSetting = mSettings.mPackages.get(packageName);
-        // The target app should always be in system
-        if (pkgSetting == null || !pkgSetting.isSystem()) {
-            return false;
-        }
-        // Check if the install state is the same
-        if (pkgSetting.getInstalled(userId) == installed) {
-            return false;
-        }
-
-        long callingId = Binder.clearCallingIdentity();
-        try {
-            if (installed) {
-                // install the app from uninstalled state
-                installExistingPackageAsUser(
-                        packageName,
-                        userId,
-                        0 /*installFlags*/,
-                        PackageManager.INSTALL_REASON_DEVICE_SETUP);
-                return true;
-            }
-
-            // uninstall the app from installed state
-            deletePackageVersioned(
-                    new VersionedPackage(packageName, PackageManager.VERSION_CODE_HIGHEST),
-                    new LegacyPackageDeleteObserver(null).getBinder(),
-                    userId,
-                    PackageManager.DELETE_SYSTEM_APP);
-            return true;
-        } finally {
-            Binder.restoreCallingIdentity(callingId);
-        }
-    }
-
     private void sendApplicationHiddenForUser(String packageName, PackageSetting pkgSetting,
             int userId) {
         final PackageRemovedInfo info = new PackageRemovedInfo(this);
@@ -14068,16 +14031,10 @@ public class PackageManagerService extends IPackageManager.Stub
     @Override
     public int installExistingPackageAsUser(String packageName, int userId, int installFlags,
             int installReason) {
-        final int callingUid = Binder.getCallingUid();
-        if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.INSTALL_PACKAGES)
-                != PackageManager.PERMISSION_GRANTED
-                && mContext.checkCallingOrSelfPermission(
-                        android.Manifest.permission.INSTALL_EXISTING_PACKAGES)
-                != PackageManager.PERMISSION_GRANTED) {
-            throw new SecurityException("Neither user " + callingUid + " nor current process has "
-                    + android.Manifest.permission.INSTALL_PACKAGES + ".");
-        }
+        mContext.enforceCallingOrSelfPermission(android.Manifest.permission.INSTALL_PACKAGES,
+                null);
         PackageSetting pkgSetting;
+        final int callingUid = Binder.getCallingUid();
         mPermissionManager.enforceCrossUserPermission(callingUid, userId,
                 true /* requireFullPermission */, true /* checkShell */,
                 "installExistingPackage for user " + userId);
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 676684c..bcad554 100644 (file)
@@ -152,14 +152,9 @@ public final class CarrierAppUtils {
                             && (ai.enabledSetting ==
                             PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
                             || ai.enabledSetting ==
-                            PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED
-                            || (ai.flags & ApplicationInfo.FLAG_INSTALLED) == 0)) {
+                            PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED)) {
                         Slog.i(TAG, "Update state(" + packageName + "): ENABLED for user "
                                 + userId);
-                        packageManager.setSystemAppInstallState(
-                                packageName,
-                                true /*installed*/,
-                                userId);
                         packageManager.setApplicationEnabledSetting(
                                 packageName,
                                 PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
@@ -175,14 +170,9 @@ public final class CarrierAppUtils {
                             if (associatedApp.enabledSetting ==
                                     PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
                                     || associatedApp.enabledSetting ==
-                                    PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED
-                                    || (ai.flags & ApplicationInfo.FLAG_INSTALLED) == 0) {
+                                    PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED) {
                                 Slog.i(TAG, "Update associated state(" + associatedApp.packageName
                                         + "): ENABLED for user " + userId);
-                                packageManager.setSystemAppInstallState(
-                                        associatedApp.packageName,
-                                        true /*installed*/,
-                                        userId);
                                 packageManager.setApplicationEnabledSetting(
                                         associatedApp.packageName,
                                         PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
@@ -200,14 +190,15 @@ public final class CarrierAppUtils {
                     // updated we shouldn't touch it.
                     if (!ai.isUpdatedSystemApp()
                             && ai.enabledSetting ==
-                            PackageManager.COMPONENT_ENABLED_STATE_DEFAULT
-                            && (ai.flags & ApplicationInfo.FLAG_INSTALLED) != 0) {
+                            PackageManager.COMPONENT_ENABLED_STATE_DEFAULT) {
                         Slog.i(TAG, "Update state(" + packageName
                                 + "): DISABLED_UNTIL_USED for user " + userId);
-                        packageManager.setSystemAppInstallState(
+                        packageManager.setApplicationEnabledSetting(
                                 packageName,
-                                false /*installed*/,
-                                userId);
+                                PackageManager.COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED,
+                                0,
+                                userId,
+                                callingPackage);
                     }
 
                     // Also disable any associated apps for this carrier app if this is the first
@@ -222,10 +213,13 @@ public final class CarrierAppUtils {
                                     Slog.i(TAG,
                                             "Update associated state(" + associatedApp.packageName
                                                     + "): DISABLED_UNTIL_USED for user " + userId);
-                                    packageManager.setSystemAppInstallState(
+                                    packageManager.setApplicationEnabledSetting(
                                             associatedApp.packageName,
-                                            false /*installed*/,
-                                            userId);
+                                            PackageManager
+                                                    .COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED,
+                                            0,
+                                            userId,
+                                            callingPackage);
                                 }
                             }
                         }
@@ -363,8 +357,7 @@ public final class CarrierAppUtils {
             String packageName) {
         try {
             ApplicationInfo ai = packageManager.getApplicationInfo(packageName,
-                    PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS
-                    | PackageManager.MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS, userId);
+                    PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS, userId);
             if (ai != null && ai.isSystemApp()) {
                 return ai;
             }
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
+}