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

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

Merge cherrypicks of [3782096, 3782097, 3782098, 3782286, 3783024, 3782099] into pi-release

Change-Id: I0fb3633afd5dedd109eb86b3aa83c1d3cd716342
parents 992cb80d d1b5513b
Loading
Loading
Loading
Loading
+16 −19
Original line number Diff line number Diff line
@@ -861,42 +861,39 @@ include $(BUILD_STATIC_JAVA_LIBRARY)

# ==== hiddenapi lists =======================================

# Copy light and dark greylist over into the build folder.
# Copy blacklist and light greylist over into the build folder.
# This is for ART buildbots which need to mock these lists and have alternative
# rules for building them. Other rules in the build system should depend on the
# files in the build folder.

$(eval $(call copy-one-file,frameworks/base/config/hiddenapi-blacklist.txt,\
                            $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)))

# Temporarily merge light greylist from two files. Vendor list will become dark
# grey once we remove the UI toast.
$(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): frameworks/base/config/hiddenapi-light-greylist.txt \
                                               frameworks/base/config/hiddenapi-vendor-list.txt
	sort $^ > $@

$(eval $(call copy-one-file,frameworks/base/config/hiddenapi-dark-greylist.txt,\
                            $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)))

# Generate dark greylist as private API minus (blacklist plus light greylist).

$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
$(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
                                          $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST) \
                                          $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST)
	if [ ! -z "`comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST))`" ]; then \
		echo "There should be no overlap between $(LIGHT_GREYLIST) and $(DARK_GREYLIST)" 1>&2; \
		comm -12 <(sort $(LIGHT_GREYLIST)) <(sort $(DARK_GREYLIST)) 1>&2; \
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): LIGHT_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
$(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \
                                              $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST) \
                                              $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST)
	if [ ! -z "`comm -12 <(sort $(BLACKLIST)) <(sort $(LIGHT_GREYLIST))`" ]; then \
		echo "There should be no overlap between $(BLACKLIST) and $(LIGHT_GREYLIST)" 1>&2; \
		exit 1; \
	elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(BLACKLIST))`" ]; then \
		echo "$(BLACKLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
		exit 2; \
	elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST))`" ]; then \
		echo "$(LIGHT_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
		comm -13 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST)) 1>&2; \
		exit 2; \
	elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST))`" ]; then \
		echo "$(DARK_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \
		comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST)) 1>&2; \
		exit 3; \
	fi
	comm -23 <(sort $(PRIVATE_API)) <(sort $(LIGHT_GREYLIST) $(DARK_GREYLIST)) > $@
	comm -23 <(sort $(PRIVATE_API)) <(sort $(BLACKLIST) $(LIGHT_GREYLIST)) > $@

# Include subdirectory makefiles
# ============================================================
+2 −2
Original line number Diff line number Diff line
@@ -2631,8 +2631,8 @@ public class Notification implements Parcelable
                    if (!Objects.equals(firstRs[j].getLabel(), secondRs[j].getLabel())) {
                        return true;
                    }
                    CharSequence[] firstCs = firstRs[i].getChoices();
                    CharSequence[] secondCs = secondRs[i].getChoices();
                    CharSequence[] firstCs = firstRs[j].getChoices();
                    CharSequence[] secondCs = secondRs[j].getChoices();
                    if (firstCs == null) {
                        firstCs = new CharSequence[0];
                    }
+8 −10
Original line number Diff line number Diff line
@@ -215,6 +215,13 @@ public class BackupManagerService implements BackupManagerServiceInterface {
    // Timeout interval for deciding that a bind or clear-data has taken too long
    private static final long TIMEOUT_INTERVAL = 10 * 1000;

    // Timeout intervals for agent backup & restore operations
    public static final long TIMEOUT_BACKUP_INTERVAL = 30 * 1000;
    public static final long TIMEOUT_FULL_BACKUP_INTERVAL = 5 * 60 * 1000;
    public static final long TIMEOUT_SHARED_BACKUP_INTERVAL = 30 * 60 * 1000;
    public static final long TIMEOUT_RESTORE_INTERVAL = 60 * 1000;
    public static final long TIMEOUT_RESTORE_FINISHED_INTERVAL = 30 * 1000;

    // User confirmation timeout for a full backup/restore operation.  It's this long in
    // order to give them time to enter the backup password.
    private static final long TIMEOUT_FULL_CONFIRMATION = 60 * 1000;
@@ -225,7 +232,6 @@ public class BackupManagerService implements BackupManagerServiceInterface {
    private static final int BUSY_BACKOFF_FUZZ = 1000 * 60 * 60 * 2;  // two hours

    private BackupManagerConstants mConstants;
    private BackupAgentTimeoutParameters mAgentTimeoutParameters;
    private Context mContext;
    private PackageManager mPackageManager;
    private IPackageManager mPackageManagerBinder;
@@ -309,10 +315,6 @@ public class BackupManagerService implements BackupManagerServiceInterface {
        return mConstants;
    }

    public BackupAgentTimeoutParameters getAgentTimeoutParameters() {
        return mAgentTimeoutParameters;
    }

    public Context getContext() {
        return mContext;
    }
@@ -854,10 +856,6 @@ public class BackupManagerService implements BackupManagerServiceInterface {
        // require frequent starting and stopping.
        mConstants.start();

        mAgentTimeoutParameters = new
                BackupAgentTimeoutParameters(mBackupHandler, mContext.getContentResolver());
        mAgentTimeoutParameters.start();

        // Set up the various sorts of package tracking we do
        mFullBackupScheduleFile = new File(mBaseStateDir, "fb-schedule");
        initPackageTracking();
@@ -3409,7 +3407,7 @@ public class BackupManagerService implements BackupManagerServiceInterface {
            }
            mActiveRestoreSession = new ActiveRestoreSession(this, packageName, transport);
            mBackupHandler.sendEmptyMessageDelayed(MSG_RESTORE_SESSION_TIMEOUT,
                    mAgentTimeoutParameters.getRestoreAgentTimeoutMillis());
                    TIMEOUT_RESTORE_INTERVAL);
        }
        return mActiveRestoreSession;
    }
+0 −3
Original line number Diff line number Diff line
@@ -191,7 +191,4 @@ public interface BackupManagerServiceInterface {
  void dump(FileDescriptor fd, PrintWriter pw, String[] args);

  IBackupManager getBackupManagerBinder();

  // Gets access to the backup/restore agent timeout parameters.
  BackupAgentTimeoutParameters getAgentTimeoutParameters();
}
+4 −7
Original line number Diff line number Diff line
@@ -4,8 +4,8 @@ import static android.os.ParcelFileDescriptor.MODE_CREATE;
import static android.os.ParcelFileDescriptor.MODE_READ_ONLY;
import static android.os.ParcelFileDescriptor.MODE_READ_WRITE;
import static android.os.ParcelFileDescriptor.MODE_TRUNCATE;

import static com.android.server.backup.BackupManagerService.OP_TYPE_BACKUP_WAIT;
import static com.android.server.backup.BackupManagerService.TIMEOUT_BACKUP_INTERVAL;

import android.app.ApplicationThreadConstants;
import android.app.IBackupAgent;
@@ -59,7 +59,6 @@ public class KeyValueAdbBackupEngine {
    private ParcelFileDescriptor mSavedState;
    private ParcelFileDescriptor mBackupData;
    private ParcelFileDescriptor mNewState;
    private final BackupAgentTimeoutParameters mAgentTimeoutParameters;

    public KeyValueAdbBackupEngine(OutputStream output, PackageInfo packageInfo,
            BackupManagerServiceInterface backupManagerService, PackageManager packageManager,
@@ -82,7 +81,6 @@ public class KeyValueAdbBackupEngine {
                pkg + BACKUP_KEY_VALUE_NEW_STATE_FILENAME_SUFFIX);

        mManifestFile = new File(mDataDir, BackupManagerService.BACKUP_MANIFEST_FILENAME);
        mAgentTimeoutParameters = backupManagerService.getAgentTimeoutParameters();
    }

    public void backupOnePackage() throws IOException {
@@ -150,9 +148,8 @@ public class KeyValueAdbBackupEngine {
    // Return true on backup success, false otherwise
    private boolean invokeAgentForAdbBackup(String packageName, IBackupAgent agent) {
        int token = mBackupManagerService.generateRandomIntegerToken();
        long kvBackupAgentTimeoutMillis = mAgentTimeoutParameters.getKvBackupAgentTimeoutMillis();
        try {
            mBackupManagerService.prepareOperationTimeout(token, kvBackupAgentTimeoutMillis, null,
            mBackupManagerService.prepareOperationTimeout(token, TIMEOUT_BACKUP_INTERVAL, null,
                    OP_TYPE_BACKUP_WAIT);

            // Start backup and wait for BackupManagerService to get callback for success or timeout
@@ -234,14 +231,14 @@ public class KeyValueAdbBackupEngine {
    }

    private void writeBackupData() throws IOException {

        int token = mBackupManagerService.generateRandomIntegerToken();
        long kvBackupAgentTimeoutMillis = mAgentTimeoutParameters.getKvBackupAgentTimeoutMillis();

        ParcelFileDescriptor[] pipes = null;
        try {
            pipes = ParcelFileDescriptor.createPipe();

            mBackupManagerService.prepareOperationTimeout(token, kvBackupAgentTimeoutMillis, null,
            mBackupManagerService.prepareOperationTimeout(token, TIMEOUT_BACKUP_INTERVAL, null,
                    OP_TYPE_BACKUP_WAIT);

            // We will have to create a runnable that will read the manifest and backup data we
Loading