Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • Dhina17/platform_frameworks_base
  • itisFarzin/platform_frameworks_base-old
2 results
Show changes
Commits on Source (3418)
Showing
with 178 additions and 28 deletions
drops {
android_build_drop {
build_id: "10093150"
build_id: "11947186"
target: "CtsShim"
source_file: "aosp_arm64/CtsShimPriv.apk"
}
......@@ -8,7 +8,7 @@ drops {
version: ""
version_group: ""
git_project: "platform/frameworks/base"
git_branch: "udc-dev"
git_branch: "main"
transform: TRANSFORM_NONE
transform_options {
}
......
drops {
android_build_drop {
build_id: "10093150"
build_id: "11947186"
target: "CtsShim"
source_file: "aosp_arm64/CtsShim.apk"
}
......@@ -8,7 +8,7 @@ drops {
version: ""
version_group: ""
git_project: "platform/frameworks/base"
git_branch: "udc-dev"
git_branch: "main"
transform: TRANSFORM_NONE
transform_options {
}
......
drops {
android_build_drop {
build_id: "10093150"
build_id: "11947186"
target: "CtsShim"
source_file: "aosp_x86_64/CtsShimPriv.apk"
}
......@@ -8,7 +8,7 @@ drops {
version: ""
version_group: ""
git_project: "platform/frameworks/base"
git_branch: "udc-dev"
git_branch: "main"
transform: TRANSFORM_NONE
transform_options {
}
......
drops {
android_build_drop {
build_id: "10093150"
build_id: "11947186"
target: "CtsShim"
source_file: "aosp_x86_64/CtsShim.apk"
}
......@@ -8,7 +8,7 @@ drops {
version: ""
version_group: ""
git_project: "platform/frameworks/base"
git_branch: "udc-dev"
git_branch: "main"
transform: TRANSFORM_NONE
transform_options {
}
......
......@@ -307,6 +307,11 @@ java_aconfig_library {
defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
cc_aconfig_library {
name: "android_security_flags_aconfig_c_lib",
aconfig_declarations: "android.security.flags-aconfig",
}
// UsageStats
aconfig_declarations {
name: "android.app.usage.flags-aconfig",
......
......@@ -115,7 +115,7 @@ filegroup {
":android.security.legacykeystore-java-source",
":android.security.maintenance-java-source",
":android.security.metrics-java-source",
":android.system.keystore2-V3-java-source",
":android.system.keystore2-V4-java-source",
":android.hardware.cas-V1-java-source",
":credstore_aidl",
":dumpstate_aidl",
......@@ -140,6 +140,8 @@ filegroup {
":vold_aidl",
":deviceproductinfoconstants_aidl",
":adbrootservice_aidl",
// For the generated R.java and Manifest.java
":framework-res{.aapt.srcjar}",
......@@ -404,6 +406,7 @@ java_defaults {
"android.hardware.common.fmq-V1-java",
"bouncycastle-repackaged-unbundled",
"com.android.sysprop.foldlockbehavior",
"com.android.sysprop.view",
"framework-internal-utils",
// 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.
......
brycelee@google.com
......@@ -30,7 +30,7 @@ hidden_api_txt_exclude_hook = ${REPO_ROOT}/frameworks/base/tools/hiddenapi/exclu
ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py --no-verify-format -f ${PREUPLOAD_FILES}
# This flag check hook runs only for "packages/SystemUI" subdirectory. If you want to include this check for other subdirectories, please modify flag_check.py.
flag_hook = ${REPO_ROOT}/frameworks/base/packages/SystemUI/flag_check.py --msg=${PREUPLOAD_COMMIT_MESSAGE} --files=${PREUPLOAD_FILES} --project=${REPO_PATH}
flag_hook = ${REPO_ROOT}/frameworks/base/packages/SystemUI/flag_check.py --msg=${PREUPLOAD_COMMIT_MESSAGE} --files=${PREUPLOAD_FILES} --project=${REPO_PROJECT}
[Tool Paths]
ktfmt = ${REPO_ROOT}/prebuilts/build-tools/common/framework/ktfmt.jar
ktfmt = ${REPO_ROOT}/external/ktfmt/ktfmt.sh
......@@ -8,4 +8,3 @@ philipcuadra@google.com
shayba@google.com
shombert@google.com
timmurray@google.com
wessam@google.com
......@@ -21,7 +21,7 @@ Adapted to use CrystalBall from art/test/2239-varhandle-perf/util-src/generate_j
To run use: python generate_java.py <destination_directory>
And then to correct lint errors (from frameworks/base):
../../tools/repohooks/tools/google-java-format.py --fix --sort-imports --google-java-format-diff ../../external/google-java-format/scripts/google-java-format-diff.py
../../tools/repohooks/tools/google-java-format.py --fix --google-java-format-diff ../../external/google-java-format/scripts/google-java-format-diff.py
"""
......
......@@ -17,8 +17,7 @@ package android.permission
import android.app.AppOpsManager
import android.content.Context
import androidx.benchmark.BenchmarkState
import androidx.benchmark.junit4.BenchmarkRule
import android.perftests.utils.PerfStatusReporter
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.LargeTest
import org.junit.Before
......@@ -34,7 +33,7 @@ import org.junit.Test
* these APIs should be monitored closely for performance.
*/
class AppOpsPerfTest {
@get:Rule val mBenchmarkRule: BenchmarkRule = BenchmarkRule()
@get:Rule val perfStatusReporter = PerfStatusReporter()
private lateinit var appOpsManager: AppOpsManager
private lateinit var opPackageName: String
private var opPackageUid: Int = 0
......@@ -49,7 +48,7 @@ class AppOpsPerfTest {
@Test
fun testNoteOp() {
val state: BenchmarkState = mBenchmarkRule.getState()
val state = perfStatusReporter.benchmarkState
while (state.keepRunning()) {
appOpsManager.noteOp(
AppOpsManager.OPSTR_FINE_LOCATION,
......@@ -63,7 +62,7 @@ class AppOpsPerfTest {
@Test
fun testUnsafeCheckOp() {
val state: BenchmarkState = mBenchmarkRule.getState()
val state = perfStatusReporter.benchmarkState
while (state.keepRunning()) {
appOpsManager.unsafeCheckOp(
AppOpsManager.OPSTR_FINE_LOCATION,
......
/*
* Copyright (C) 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.perftests.permission
import android.app.AppOpsManager
import android.content.Context
import android.perftests.utils.PerfStatusReporter
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class AppOpsPerfTest {
@get:Rule val perfStatusReporter = PerfStatusReporter()
private lateinit var appOpsManager: AppOpsManager
private lateinit var opPackageName: String
private var opPackageUid: Int = 0
@Before
fun setUp() {
val context: Context = ApplicationProvider.getApplicationContext()
appOpsManager = context.getSystemService(AppOpsManager::class.java)!!
opPackageName = context.opPackageName
opPackageUid = context.getPackageManager().getPackageUid(opPackageName, 0)
}
@Test
fun testNoteOp() {
val state = perfStatusReporter.benchmarkState
while (state.keepRunning()) {
appOpsManager.noteOp(
AppOpsManager.OPSTR_FINE_LOCATION,
opPackageUid,
opPackageName,
null,
null
)
}
}
@Test
fun testUnsafeCheckOp() {
val state = perfStatusReporter.benchmarkState
while (state.keepRunning()) {
appOpsManager.unsafeCheckOp(
AppOpsManager.OPSTR_FINE_LOCATION,
opPackageUid,
opPackageName
)
}
}
}
......@@ -74,6 +74,8 @@ public interface DeviceIdleInternal {
boolean isAppOnWhitelist(int appid);
int[] getPowerSaveWhitelistSystemAppIds();
int[] getPowerSaveWhitelistUserAppIds();
int[] getPowerSaveTempWhitelistAppIds();
......
......@@ -111,6 +111,12 @@ public class AppStateTrackerImpl implements AppStateTracker {
@GuardedBy("mLock")
final SparseBooleanArray mActiveUids = new SparseBooleanArray();
/**
* System exemption list in the device idle controller.
*/
@GuardedBy("mLock")
private int[] mPowerExemptSystemAppIds = new int[0];
/**
* System except-idle + user exemption list in the device idle controller.
*/
......@@ -1041,6 +1047,7 @@ public class AppStateTrackerImpl implements AppStateTracker {
* Called by device idle controller to update the power save exemption lists.
*/
public void setPowerSaveExemptionListAppIds(
int[] powerSaveExemptionListSystemAppIdArray,
int[] powerSaveExemptionListExceptIdleAppIdArray,
int[] powerSaveExemptionListUserAppIdArray,
int[] tempExemptionListAppIdArray) {
......@@ -1048,6 +1055,7 @@ public class AppStateTrackerImpl implements AppStateTracker {
final int[] previousExemptionList = mPowerExemptAllAppIds;
final int[] previousTempExemptionList = mTempExemptAppIds;
mPowerExemptSystemAppIds = powerSaveExemptionListSystemAppIdArray;
mPowerExemptAllAppIds = powerSaveExemptionListExceptIdleAppIdArray;
mTempExemptAppIds = tempExemptionListAppIdArray;
mPowerExemptUserAppIds = powerSaveExemptionListUserAppIdArray;
......@@ -1265,6 +1273,18 @@ public class AppStateTrackerImpl implements AppStateTracker {
}
}
/**
* @return whether or not a UID is in either the user defined power-save exemption list or the
system full exemption list (not including except-idle)
*/
public boolean isUidPowerSaveIdleExempt(int uid) {
final int appId = UserHandle.getAppId(uid);
synchronized (mLock) {
return ArrayUtils.contains(mPowerExemptUserAppIds, appId)
|| ArrayUtils.contains(mPowerExemptSystemAppIds, appId);
}
}
/**
* @return whether a UID is in the temp power-save exemption list or not.
*
......@@ -1300,6 +1320,9 @@ public class AppStateTrackerImpl implements AppStateTracker {
pw.print("Active uids: ");
dumpUids(pw, mActiveUids);
pw.print("System exemption list appids: ");
pw.println(Arrays.toString(mPowerExemptSystemAppIds));
pw.print("Except-idle + user exemption list appids: ");
pw.println(Arrays.toString(mPowerExemptAllAppIds));
......@@ -1375,6 +1398,10 @@ public class AppStateTrackerImpl implements AppStateTracker {
}
}
for (int appId : mPowerExemptSystemAppIds) {
proto.write(AppStateTrackerProto.POWER_SAVE_SYSTEM_EXEMPT_APP_IDS, appId);
}
for (int appId : mPowerExemptAllAppIds) {
proto.write(AppStateTrackerProto.POWER_SAVE_EXEMPT_APP_IDS, appId);
}
......
......@@ -580,6 +580,12 @@ public class DeviceIdleController extends SystemService
*/
private final SparseBooleanArray mPowerSaveWhitelistSystemAppIds = new SparseBooleanArray();
/**
* Current system app IDs that are in the complete power save white list. This array can
* be shared with others because it will not be modified once set.
*/
private int[] mPowerSaveWhitelistSystemAppIdArray = new int[0];
/**
* App IDs that have been white-listed to opt out of power save restrictions, except
* for device idle modes.
......@@ -2382,6 +2388,11 @@ public class DeviceIdleController extends SystemService
return DeviceIdleController.this.getFullPowerWhitelistInternalUnchecked();
}
@Override
public int[] getPowerSaveWhitelistSystemAppIds() {
return DeviceIdleController.this.getPowerSaveWhitelistSystemAppIds();
}
/**
* Returns the array of app ids whitelisted by user. Take care not to
* modify this, as it is a reference to the original copy. But the reference
......@@ -2607,6 +2618,12 @@ public class DeviceIdleController extends SystemService
}
}
int[] getPowerSaveWhitelistSystemAppIds() {
synchronized (this) {
return mPowerSaveWhitelistSystemAppIdArray;
}
}
int[] getPowerSaveWhitelistUserAppIds() {
synchronized (this) {
return mPowerSaveWhitelistUserAppIdArray;
......@@ -2617,6 +2634,16 @@ public class DeviceIdleController extends SystemService
return new File(Environment.getDataDirectory(), "system");
}
/** Returns the keys of a SparseBooleanArray, paying no attention to its values. */
private static int[] keysToIntArray(final SparseBooleanArray sparseArray) {
final int size = sparseArray.size();
final int[] array = new int[size];
for (int i = 0; i < size; i++) {
array[i] = sparseArray.keyAt(i);
}
return array;
}
@Override
public void onStart() {
final PackageManager pm = getContext().getPackageManager();
......@@ -2653,6 +2680,7 @@ public class DeviceIdleController extends SystemService
} catch (PackageManager.NameNotFoundException e) {
}
}
mPowerSaveWhitelistSystemAppIdArray = keysToIntArray(mPowerSaveWhitelistSystemAppIds);
mConstants = mInjector.getConstants(this, mHandler, getContext().getContentResolver());
......@@ -4454,6 +4482,7 @@ public class DeviceIdleController extends SystemService
private void passWhiteListsToForceAppStandbyTrackerLocked() {
mAppStateTracker.setPowerSaveExemptionListAppIds(
mPowerSaveWhitelistSystemAppIdArray,
mPowerSaveWhitelistExceptIdleAppIdArray,
mPowerSaveWhitelistUserAppIdArray,
mTempWhitelistAppIdArray);
......
......@@ -2756,7 +2756,7 @@ public class AlarmManagerService extends SystemService {
} else if (workSource == null && (UserHandle.isCore(callingUid)
|| UserHandle.isSameApp(callingUid, mSystemUiUid)
|| ((mAppStateTracker != null)
&& mAppStateTracker.isUidPowerSaveUserExempt(callingUid)))) {
&& mAppStateTracker.isUidPowerSaveIdleExempt(callingUid)))) {
flags |= FLAG_ALLOW_WHILE_IDLE_UNRESTRICTED;
flags &= ~(FLAG_ALLOW_WHILE_IDLE | FLAG_PRIORITIZE);
}
......
......@@ -75,6 +75,7 @@ public final class DeviceIdleJobsController extends StateController {
* True when in device idle mode, so we don't want to schedule any jobs.
*/
private boolean mDeviceIdleMode;
private int[] mPowerSaveWhitelistSystemAppIds;
private int[] mDeviceIdleWhitelistAppIds;
private int[] mPowerSaveTempWhitelistAppIds;
......@@ -134,6 +135,8 @@ public final class DeviceIdleJobsController extends StateController {
mLocalDeviceIdleController =
LocalServices.getService(DeviceIdleInternal.class);
mDeviceIdleWhitelistAppIds = mLocalDeviceIdleController.getPowerSaveWhitelistUserAppIds();
mPowerSaveWhitelistSystemAppIds =
mLocalDeviceIdleController.getPowerSaveWhitelistSystemAppIds();
mPowerSaveTempWhitelistAppIds =
mLocalDeviceIdleController.getPowerSaveTempWhitelistAppIds();
mDeviceIdleUpdateFunctor = new DeviceIdleUpdateFunctor();
......@@ -197,8 +200,9 @@ public final class DeviceIdleJobsController extends StateController {
* Checks if the given job's scheduling app id exists in the device idle user whitelist.
*/
boolean isWhitelistedLocked(JobStatus job) {
return Arrays.binarySearch(mDeviceIdleWhitelistAppIds,
UserHandle.getAppId(job.getSourceUid())) >= 0;
final int appId = UserHandle.getAppId(job.getSourceUid());
return Arrays.binarySearch(mDeviceIdleWhitelistAppIds, appId) >= 0
|| Arrays.binarySearch(mPowerSaveWhitelistSystemAppIds, appId) >= 0;
}
/**
......
......@@ -74,7 +74,4 @@ cc_library_shared {
"libGLESv2",
"libgui",
],
whole_static_libs: [
"libc++fs",
],
}
......@@ -568,7 +568,19 @@ status_t BootAnimation::readyToRun() {
mMaxWidth = android::base::GetIntProperty("ro.surface_flinger.max_graphics_width", 0);
mMaxHeight = android::base::GetIntProperty("ro.surface_flinger.max_graphics_height", 0);
ui::Size resolution = displayMode.resolution;
// check for overridden ui resolution
ui::Size resolution;
char *endptr;
std::string size_override = android::base::GetProperty("ro.config.size_override", "");
resolution.width = strtoimax(size_override.c_str(), &endptr, 10);
if (endptr[0] == ',')
resolution.height = strtoimax(endptr+1, NULL, 10);
if (resolution.width <= 0 || resolution.height <= 0)
resolution = displayMode.resolution;
resolution = limitSurfaceSize(resolution.width, resolution.height);
// create the native surface
sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
......@@ -588,6 +600,11 @@ status_t BootAnimation::readyToRun() {
t.setLayerStack(control, ui::DEFAULT_LAYER_STACK);
}
// Scale forced resolution to physical resolution
Rect forcedRes(0, 0, resolution.width, resolution.height);
Rect physRes(0, 0, displayMode.resolution.width, displayMode.resolution.height);
t.setDisplayProjection(mDisplayToken, ui::ROTATION_0, forcedRes, physRes);
t.setLayer(control, 0x40000000)
.apply();
......@@ -1335,7 +1352,8 @@ bool BootAnimation::preloadZip(Animation& animation) {
if (path.string() == animation.parts[j].path.c_str()) {
uint16_t method;
// supports only stored png files
if (zip->getEntryInfo(entry, &method, nullptr, nullptr, nullptr, nullptr, nullptr)) {
if (zip->getEntryInfo(entry, &method, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr)) {
if (method == ZipFileRO::kCompressStored) {
FileMap* map = zip->createEntryFileMap(entry);
if (map) {
......
......@@ -313,7 +313,6 @@ cc_binary {
"libziparchive",
],
static_libs: [
"libc++fs",
"libidmap2_policies",
"libidmap2_protos",
"libidmap2daidl",
......