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

Commit 5f956572 authored by Romain Hunault's avatar Romain Hunault 💻
Browse files

Merge branch 'v1-nougat-sprint_istanbul' into 'v1-nougat'

[RELEASE] Sprint Istanbul

See merge request e/os/android_frameworks_base!47
parents dd36961f cf0aa9d1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1958,6 +1958,13 @@
        android:description="@string/permdesc_getPackageSize"
        android:protectionLevel="normal" />

    <!-- @hide Allows an application to change the package signature as
         seen by applications -->
    <permission android:name="android.permission.FAKE_PACKAGE_SIGNATURE"
        android:protectionLevel="signature|privileged"
        android:label="@string/permlab_fakePackageSignature"
        android:description="@string/permdesc_fakePackageSignature" />

    <!-- @deprecated No longer useful, see
         {@link android.content.pm.PackageManager#addPackageToPreferred}
         for details. -->
+2 −0
Original line number Diff line number Diff line
@@ -1475,6 +1475,8 @@
    <string-array name="config_locationProviderPackageNames" translatable="false">
        <!-- The standard AOSP fused location provider -->
        <item>com.android.location.fused</item>
        <!-- The (faked) microg fused location provider -->
        <item>com.google.android.gms</item>
    </string-array>

    <!-- This string array can be overriden to enable test location providers initially. -->
+5 −0
Original line number Diff line number Diff line
@@ -678,6 +678,11 @@

    <!--  Permissions -->

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permlab_fakePackageSignature">Spoof package signature</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_fakePackageSignature">Allows the app to pretend to be a different app. Malicious applications might be able to use this to access private application data. Grant this permission with caution only!</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
    <string name="permlab_statusBar">disable or modify status bar</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
+13 −0
Original line number Diff line number Diff line
@@ -733,6 +733,19 @@ final class DefaultPermissionGrantPolicy {
                grantRuntimePermissionsLPw(appsPackage, STORAGE_PERMISSIONS, userId);
            }
            
            // esms sync
            PackageParser.Package esmsPackage = getSystemPackageLPr("foundation.e.esmssync");
            if (esmsPackage != null
                            && doesPackageSupportRuntimePermissions(esmsPackage)) {
                grantRuntimePermissionsLPw(esmsPackage, STORAGE_PERMISSIONS, userId);
                boolean isPhonePermFixed =
                    mService.hasSystemFeature(PackageManager.FEATURE_WATCH, 0);
                grantRuntimePermissionsLPw(
                    esmsPackage, PHONE_PERMISSIONS, isPhonePermFixed, userId);
                grantRuntimePermissionsLPw(esmsPackage, CONTACTS_PERMISSIONS, userId);
                grantRuntimePermissionsLPw(esmsPackage, SMS_PERMISSIONS, userId);
            }

            mService.mSettings.onDefaultRuntimePermissionsGrantedLPr(userId);
        }
    }
+21 −2
Original line number Diff line number Diff line
@@ -3178,8 +3178,27 @@ public class PackageManagerService extends IPackageManager.Stub {
                ? Collections.<String>emptySet() : permissionsState.getPermissions(userId);
        final PackageUserState state = ps.readUserState(userId);
        return PackageParser.generatePackageInfo(p, gids, flags,
                ps.firstInstallTime, ps.lastUpdateTime, permissions, state, userId);
        return mayFakeSignature(p, PackageParser.generatePackageInfo(p, gids, flags,
                ps.firstInstallTime, ps.lastUpdateTime, permissions, state, userId),
                permissions);
    }
    private PackageInfo mayFakeSignature(PackageParser.Package p, PackageInfo pi,
            Set<String> permissions) {
        try {
            if (permissions.contains("android.permission.FAKE_PACKAGE_SIGNATURE")
                    && p.applicationInfo.targetSdkVersion > Build.VERSION_CODES.LOLLIPOP_MR1
                    && p.mAppMetaData != null) {
                String sig = p.mAppMetaData.getString("fake-signature");
                if (sig != null) {
                    pi.signatures = new Signature[] {new Signature(sig)};
                }
            }
        } catch (Throwable t) {
            // We should never die because of any failures, this is system code!
            Log.w("PackageManagerService.FAKE_PACKAGE_SIGNATURE", t);
        }
        return pi;
    }
    @Override