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

Commit b4d2d59c authored by Nextbit's avatar Nextbit Committed by Adnan Begovic
Browse files

Add system|signature permission for intercepting package launch.

The preLaunchCheck (add, remove) functions which allows an application to
perform any checks before the framework launches the app
needs to be a protected with a system|signature permission.
This change defines the permission and protects the functions with it.

Change-Id: Ib62e25b780df39c4a7d9d1e4eaf3fc98ffa4089c
parent 86aa924b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2627,6 +2627,14 @@
        android:description="@string/permdesc_keyguardApplicationWidget"
        android:protectionLevel="system|signature" />

    <!-- Allows an application to intercept package launch actions.
         <p> Not for use by third-party applications.
         @hide -->
    <permission android:name="android.permission.INTERCEPT_PACKAGE_LAUNCH"
        android:label="@string/permlab_interceptPackageLaunch"
        android:description="@string/permdesc_interceptPackageLaunch"
        android:protectionLevel="system|signature" />

    <!-- The system process is explicitly the only one allowed to launch the
         confirmation UI for full backup/restore -->
    <uses-permission android:name="android.permission.CONFIRM_FULL_BACKUP"/>
+5 −0
Original line number Diff line number Diff line
@@ -172,6 +172,11 @@
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_keyguardApplicationWidget">Allows an app to set the app widget on the keyguard.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want the application to do this. -->
    <string name="permlab_interceptPackageLaunch">intercept application launch</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permdesc_interceptPackageLaunch">Allows an app to intercept launch of other applications</string>

    <string name="immersive_mode_confirmation_bottom">Swipe up from the bottom to exit full screen.</string>

    <!-- App ops requests -->
+4 −0
Original line number Diff line number Diff line
@@ -12614,11 +12614,15 @@ public class PackageManagerService extends IPackageManager.Stub {
    @Override
    public final void addPreLaunchCheckPackage(String packageName) {
        mContext.enforceCallingOrSelfPermission(
                android.Manifest.permission.INTERCEPT_PACKAGE_LAUNCH, null);
        mPreLaunchCheckPackages.add(packageName);
    }
    @Override
    public final void removePreLaunchCheckPackage(String packageName) {
        mContext.enforceCallingOrSelfPermission(
                android.Manifest.permission.INTERCEPT_PACKAGE_LAUNCH, null);
        mPreLaunchCheckPackages.remove(packageName);
    }