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

Commit 10d43b18 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6321095 from 1316d9ad to mainline-release

Change-Id: I14552f42e3a68fdc82235ca8e40f91916f1e1343
parents ad21d9f4 1316d9ad
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -239,6 +239,7 @@ filegroup {
        ":framework-sax-sources",
        ":framework-telecomm-sources",
        ":framework-telephony-common-sources",
        ":framework-telephony-sources",
        ":framework-wifi-annotations",
        ":framework-wifi-non-updatable-sources",
        ":PacProcessor-aidl-sources",
@@ -285,7 +286,6 @@ filegroup {
        ":framework-permission-sources",
        ":framework-sdkextensions-sources",
        ":framework-statsd-sources",
        ":framework-telephony-sources",
        ":framework-tethering-srcs",
        ":framework-wifi-updatable-sources",
        ":updatable-media-srcs",
@@ -300,7 +300,6 @@ java_library {
        "framework-permission-stubs-module_libs_api",
        "framework-sdkextensions-stubs-module_libs_api",
        "framework-statsd-stubs-module_libs_api",
        "framework-telephony-stubs", // TODO: Update to module_libs_api when there is one.
        "framework-tethering-stubs-module_libs_api",
        "framework-wifi-stubs-module_libs_api",
    ],
@@ -418,7 +417,6 @@ java_defaults {
        "app-compat-annotations",
        "ext",
        "unsupportedappusage",
        "framework-updatable-stubs-module_libs_api",
    ],

    jarjar_rules: ":framework-jarjar-rules",
@@ -492,6 +490,7 @@ java_library {
        "services-platform-compat-config",
        "documents-ui-compat-config",
    ],
    libs: ["framework-updatable-stubs-module_libs_api"],
    static_libs: [
        // If MimeMap ever becomes its own APEX, then this dependency would need to be removed
        // in favor of an API stubs dependency in java_library "framework" below.
@@ -523,9 +522,8 @@ java_library {
    defaults: ["framework-aidl-export-defaults"],
    installable: false, // this lib is a build-only library
    static_libs: [
        "app-compat-annotations",
        "framework-minus-apex",
        // TODO (b/147688669) should be removed
        "framework-telephony",
        "framework-updatable-stubs-module_libs_api",
    ],
    sdk_version: "core_platform",
@@ -545,6 +543,7 @@ java_library {
    visibility: [
        // DO NOT ADD ANY MORE ENTRIES TO THIS LIST
        "//external/robolectric-shadows:__subpackages__",
        "//frameworks/base",
        "//frameworks/layoutlib:__subpackages__",
    ],
}
@@ -1326,8 +1325,8 @@ java_library {
java_library {
    name: "framework-telephony",
    srcs: [
        ":framework-telephony-sources",
        ":framework-telephony-shared-srcs",
        //":framework-telephony-sources",
        //":framework-telephony-shared-srcs",
    ],
    // TODO: change to framework-system-stub to build against system APIs.
    libs: [
+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ $(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE))
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_API_FILE):apistubs/android/public/api/android.txt)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_API_FILE):apistubs/android/system/api/android.txt)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_TEST_API_FILE):apistubs/android/test/api/android.txt)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_MODULE_LIB_API_FILE):apistubs/android/module-lib/api/android.txt)
$(call dist-for-goals,sdk,$(INTERNAL_PLATFORM_SYSTEM_SERVER_API_FILE):apistubs/android/system-server/api/android.txt)

# sdk.atree needs to copy the whole dir: $(OUT_DOCS)/offline-sdk to the final zip.
# So keep offline-sdk-timestamp target here, and unzip offline-sdk-docs.zip to
+6 −1
Original line number Diff line number Diff line
@@ -79,7 +79,11 @@ stubs_defaults {
stubs_defaults {
    name: "metalava-non-updatable-api-stubs-default",
    defaults: ["metalava-base-api-stubs-default"],
    sdk_version: "system_current",
    sdk_version: "core_platform",
    libs: ["framework-all"],
    aidl: {
        local_include_dirs: ["apex/media/framework/java"],
    },
}

/////////////////////////////////////////////////////////////////////
@@ -195,6 +199,7 @@ droidstubs {
droidstubs {
    name: "module-lib-api",
    defaults: ["metalava-full-api-stubs-default"],
    api_tag_name: "MODULE_LIB",
    arg_files: ["core/res/AndroidManifest.xml"],
    args: metalava_framework_docs_args + module_libs,
    check_api: {
+42 −9
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@ import static android.app.usage.UsageStatsManager.REASON_MAIN_MASK;
import static android.app.usage.UsageStatsManager.REASON_MAIN_PREDICTED;
import static android.app.usage.UsageStatsManager.REASON_MAIN_TIMEOUT;
import static android.app.usage.UsageStatsManager.REASON_MAIN_USAGE;
import static android.app.usage.UsageStatsManager.REASON_SUB_DEFAULT_APP_UPDATE;
import static android.app.usage.UsageStatsManager.REASON_SUB_FORCED_SYSTEM_FLAG_BUGGY;
import static android.app.usage.UsageStatsManager.REASON_SUB_MASK;
import static android.app.usage.UsageStatsManager.REASON_SUB_PREDICTED_RESTORED;
import static android.app.usage.UsageStatsManager.REASON_SUB_USAGE_ACTIVE_TIMEOUT;
@@ -73,7 +75,6 @@ import android.content.pm.PackageManagerInternal;
import android.content.pm.ParceledListSlice;
import android.database.ContentObserver;
import android.hardware.display.DisplayManager;
import android.net.ConnectivityManager;
import android.net.NetworkScoreManager;
import android.os.BatteryManager;
import android.os.BatteryStats;
@@ -304,10 +305,7 @@ public class AppStandbyController implements AppStandbyInternal {
    private final AppStandbyHandler mHandler;
    private final Context mContext;

    // TODO: Provide a mechanism to set an external bucketing service

    private AppWidgetManager mAppWidgetManager;
    private ConnectivityManager mConnectivityManager;
    private PackageManager mPackageManager;
    Injector mInjector;

@@ -411,7 +409,6 @@ public class AppStandbyController implements AppStandbyInternal {
            settingsObserver.updateSettings();

            mAppWidgetManager = mContext.getSystemService(AppWidgetManager.class);
            mConnectivityManager = mContext.getSystemService(ConnectivityManager.class);

            mInjector.registerDisplayListener(mDisplayListener, mHandler);
            synchronized (mAppIdleLock) {
@@ -1519,6 +1516,38 @@ public class AppStandbyController implements AppStandbyInternal {
        }
    }

    /**
     * Remove an app from the {@link android.app.usage.UsageStatsManager#STANDBY_BUCKET_RESTRICTED}
     * bucket if it was forced into the bucket by the system because it was buggy.
     */
    @VisibleForTesting
    void maybeUnrestrictBuggyApp(String packageName, int userId) {
        synchronized (mAppIdleLock) {
            final long elapsedRealtime = mInjector.elapsedRealtime();
            final AppIdleHistory.AppUsageHistory app =
                    mAppIdleHistory.getAppUsageHistory(packageName, userId, elapsedRealtime);
            if (app.currentBucket != STANDBY_BUCKET_RESTRICTED
                    || (app.bucketingReason & REASON_MAIN_MASK) != REASON_MAIN_FORCED_BY_SYSTEM) {
                return;
            }

            final int newBucket;
            final int newReason;
            if ((app.bucketingReason & REASON_SUB_MASK) == REASON_SUB_FORCED_SYSTEM_FLAG_BUGGY) {
                // If bugginess was the only reason the app should be restricted, then lift it out.
                newBucket = STANDBY_BUCKET_RARE;
                newReason = REASON_MAIN_DEFAULT | REASON_SUB_DEFAULT_APP_UPDATE;
            } else {
                // There's another reason the app was restricted. Remove the buggy bit and call
                // it a day.
                newBucket = STANDBY_BUCKET_RESTRICTED;
                newReason = app.bucketingReason & ~REASON_SUB_FORCED_SYSTEM_FLAG_BUGGY;
            }
            mAppIdleHistory.setAppStandbyBucket(
                    packageName, userId, elapsedRealtime, newBucket, newReason);
        }
    }

    private class PackageReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
@@ -1528,10 +1557,14 @@ public class AppStandbyController implements AppStandbyInternal {
                clearCarrierPrivilegedApps();
            }
            if ((Intent.ACTION_PACKAGE_REMOVED.equals(action) ||
                    Intent.ACTION_PACKAGE_ADDED.equals(action))
                    && !intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
                clearAppIdleForPackage(intent.getData().getSchemeSpecificPart(),
                        getSendingUserId());
                    Intent.ACTION_PACKAGE_ADDED.equals(action))) {
                final String pkgName = intent.getData().getSchemeSpecificPart();
                final int userId = getSendingUserId();
                if (intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
                    maybeUnrestrictBuggyApp(pkgName, userId);
                } else {
                    clearAppIdleForPackage(pkgName, userId);
                }
            }
        }
    }
+7 −0
Original line number Diff line number Diff line
{
  "presubmit": [
    {
      "name": "CtsMediaParserTestCases"
    }
  ]
}
Loading