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

Commit ac421259 authored by Samiul Islam's avatar Samiul Islam Committed by Mohammad Islam
Browse files

Create new AIDL objects for retrieving information about staged apex

Native clients will be communicating with PackageManagerNative service
for information regarding staged apex packages.

Bug: 187444679
Test: see ag/15462076
Change-Id: If9a4ec3586a23f83229d5fdce271bf69d9073134
Merged-In: If9a4ec3586a23f83229d5fdce271bf69d9073134
(cherry picked from commit 042261d2)
parent b0a8f735
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -298,6 +298,9 @@ filegroup {
        "aidl/android/content/pm/IPackageChangeObserver.aidl",
        "aidl/android/content/pm/IPackageChangeObserver.aidl",
        "aidl/android/content/pm/IPackageManagerNative.aidl",
        "aidl/android/content/pm/IPackageManagerNative.aidl",
        "aidl/android/content/pm/PackageChangeEvent.aidl",
        "aidl/android/content/pm/PackageChangeEvent.aidl",
        "aidl/android/content/pm/IStagedApexObserver.aidl",
        "aidl/android/content/pm/ApexStagedEvent.aidl",
        "aidl/android/content/pm/StagedApexInfo.aidl",
    ],
    ],
    path: "aidl",
    path: "aidl",
}
}
+27 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2021 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;

/**
 * This event is designed for notification to native code listener about
 * any changes to set of apex packages staged for installation on next boot.
 *
 * @hide
 */
parcelable ApexStagedEvent {
  @utf8InCpp String[] stagedApexModuleNames;
}
+22 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,8 @@
package android.content.pm;
package android.content.pm;


import android.content.pm.IPackageChangeObserver;
import android.content.pm.IPackageChangeObserver;
import android.content.pm.IStagedApexObserver;
import android.content.pm.StagedApexInfo;


/**
/**
 * Parallel implementation of certain {@link PackageManager} APIs that need to
 * Parallel implementation of certain {@link PackageManager} APIs that need to
@@ -101,4 +103,24 @@ interface IPackageManagerNative {
     * This does nothing if this observer was not already registered.
     * This does nothing if this observer was not already registered.
     */
     */
    void unregisterPackageChangeObserver(in IPackageChangeObserver observer);
    void unregisterPackageChangeObserver(in IPackageChangeObserver observer);

    /** Register a observer for change in set of staged APEX ready for installation */
    void registerStagedApexObserver(in IStagedApexObserver observer);

    /**
     * Unregister an existing staged apex observer.
     * This does nothing if this observer was not already registered.
     */
    void unregisterStagedApexObserver(in IStagedApexObserver observer);

    /**
     * Get APEX module names of all APEX that are staged ready for installation
     */
    @utf8InCpp String[] getStagedApexModuleNames();

    /**
     * Get information of APEX which is staged ready for installation.
     * Returns null if no such APEX is found.
     */
    StagedApexInfo getStagedApexInfo(in @utf8InCpp String moduleName);
}
}
+28 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2021 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.content.pm.ApexStagedEvent;

/**
 * This is a non-blocking notification when set of staged apex has changed
 *
 * @hide
 */
oneway interface IStagedApexObserver {
  void onApexStaged(in ApexStagedEvent event);
}
+30 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2021 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;

/**
 * This object is designed for returning information regarding
 * staged APEX that are ready to be installed on next reboot.
 *
 * @hide
 */
parcelable StagedApexInfo {
  @utf8InCpp String moduleName;
  @utf8InCpp String diskImagePath;
  long versionCode;
  @utf8InCpp String versionName;
}