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

Commit e34e8dd5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Expose UpdateEngine.triggerPostinstall to modules." into main

parents e459c459 b84db1de
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -499,6 +499,10 @@ package android.os {
    field public static final long TRACE_TAG_NETWORK = 2097152L; // 0x200000L
  }

  public class UpdateEngine {
    method @FlaggedApi("android.os.update_engine_api") public void triggerPostinstall(@NonNull String);
  }

}

package android.os.storage {
+20 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.os;

import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SystemApi;
@@ -667,4 +668,23 @@ public class UpdateEngine {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Run postinstall script for specified partition |partition|
     *
     * @param partition The partition to trigger postinstall runs
     *
     * @throws ServiceSpecificException error code of this exception would be one of
     * https://cs.android.com/android/platform/superproject/main/+/main:system/update_engine/common/error_code.h
     * @hide
     */
    @FlaggedApi(Flags.FLAG_UPDATE_ENGINE_API)
    @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
    public void triggerPostinstall(@NonNull String partition) {
        try {
            mUpdateEngine.triggerPostinstall(partition);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}