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

Commit bea2e823 authored by Yurii Zubrytskyi's avatar Yurii Zubrytskyi Committed by Automerger Merge Worker
Browse files

Merge "Dynamic args complete removal." into rvc-dev am: a7b10f56 am:...

Merge "Dynamic args complete removal." into rvc-dev am: a7b10f56 am: 4604a9bb am: 082322b5 am: 22c5d09f

Change-Id: Iab9be6102f8335f159dcc9f66efb6c19d88c6b8e
parents 65511287 22c5d09f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -961,7 +961,6 @@ filegroup {
        "core/java/android/content/pm/InstallationFileLocation.aidl",
        "core/java/android/content/pm/IDataLoaderStatusListener.aidl",
        "core/java/android/content/pm/IPackageInstallerSessionFileSystemConnector.aidl",
        "core/java/android/content/pm/NamedParcelFileDescriptor.aidl",
    ],
    path: "core/java",
}
+3 −19
Original line number Diff line number Diff line
@@ -17,12 +17,8 @@
package android.content.pm;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.content.ComponentName;
import android.os.ParcelFileDescriptor;

import java.util.Map;

/**
 * This class represents the parameters used to configure a Data Loader.
@@ -44,7 +40,7 @@ public class DataLoaderParams {
     */
    public static final @NonNull DataLoaderParams forStreaming(@NonNull ComponentName componentName,
            @NonNull String arguments) {
        return new DataLoaderParams(DataLoaderType.STREAMING, componentName, arguments, null);
        return new DataLoaderParams(DataLoaderType.STREAMING, componentName, arguments);
    }

    /**
@@ -55,29 +51,17 @@ public class DataLoaderParams {
     */
    public static final @NonNull DataLoaderParams forIncremental(
            @NonNull ComponentName componentName, @NonNull String arguments) {
        return new DataLoaderParams(DataLoaderType.INCREMENTAL, componentName, arguments, null);
        return new DataLoaderParams(DataLoaderType.INCREMENTAL, componentName, arguments);
    }

    /** @hide */
    public DataLoaderParams(@NonNull @DataLoaderType int type, @NonNull ComponentName componentName,
            @NonNull String arguments, @Nullable Map<String, ParcelFileDescriptor> namedFds) {
            @NonNull String arguments) {
        DataLoaderParamsParcel data = new DataLoaderParamsParcel();
        data.type = type;
        data.packageName = componentName.getPackageName();
        data.className = componentName.getClassName();
        data.arguments = arguments;
        if (namedFds == null || namedFds.isEmpty()) {
            data.dynamicArgs = new NamedParcelFileDescriptor[0];
        } else {
            data.dynamicArgs = new NamedParcelFileDescriptor[namedFds.size()];
            int i = 0;
            for (Map.Entry<String, ParcelFileDescriptor> namedFd : namedFds.entrySet()) {
                data.dynamicArgs[i] = new NamedParcelFileDescriptor();
                data.dynamicArgs[i].name = namedFd.getKey();
                data.dynamicArgs[i].fd = namedFd.getValue();
                i += 1;
            }
        }
        mData = data;
    }

+0 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.content.pm;

import android.content.pm.DataLoaderType;
import android.content.pm.NamedParcelFileDescriptor;

/**
 * Class for holding data loader configuration parameters.
@@ -28,5 +27,4 @@ parcelable DataLoaderParamsParcel {
    @utf8InCpp String packageName;
    @utf8InCpp String className;
    @utf8InCpp String arguments;
    NamedParcelFileDescriptor[] dynamicArgs;
}
+0 −28
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 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.content.pm;

import android.os.ParcelFileDescriptor;

/**
 * A named ParcelFileDescriptor.
 * @hide
 */
parcelable NamedParcelFileDescriptor {
    @utf8InCpp String name;
    ParcelFileDescriptor fd;
}
+0 −11
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ import android.content.pm.IDataLoader;
import android.content.pm.IDataLoaderStatusListener;
import android.content.pm.InstallationFile;
import android.content.pm.InstallationFileParcel;
import android.content.pm.NamedParcelFileDescriptor;
import android.os.IBinder;
import android.os.ParcelFileDescriptor;
import android.util.ExceptionUtils;
@@ -133,16 +132,6 @@ public abstract class DataLoaderService extends Service {
                        }
                    }
                }
                if (params.dynamicArgs != null) {
                    NamedParcelFileDescriptor[] fds = params.dynamicArgs;
                    for (NamedParcelFileDescriptor nfd : fds) {
                        try {
                            nfd.fd.close();
                        } catch (IOException e) {
                            Slog.e(TAG, "Failed to close DynamicArgs parcel file descriptor " + e);
                        }
                    }
                }
            }
        }

Loading