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

Commit 6316e41c authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge branch 'epic340-a15-a15_bringup' into 'a15'

Port framework changes from A14

See merge request e/os/android_frameworks_base!273
parents 2e661779 c3522cf6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -252,6 +252,7 @@ package android {
    field public static final String READ_CONTACTS = "android.permission.READ_CONTACTS";
    field @FlaggedApi("com.android.server.feature.flags.enable_read_dropbox_permission") public static final String READ_DROPBOX_DATA = "android.permission.READ_DROPBOX_DATA";
    field public static final String READ_EXTERNAL_STORAGE = "android.permission.READ_EXTERNAL_STORAGE";
    field public static final String READ_FAKE_LOCATION_SETTINGS = "foundation.e.permission.READ_FAKE_LOCATION_SETTINGS";
    field public static final String READ_HOME_APP_SEARCH_DATA = "android.permission.READ_HOME_APP_SEARCH_DATA";
    field @Deprecated public static final String READ_INPUT_STATE = "android.permission.READ_INPUT_STATE";
    field public static final String READ_LOGS = "android.permission.READ_LOGS";
+2 −0
Original line number Diff line number Diff line
@@ -1629,3 +1629,5 @@ UnflaggedApi: android.view.inputmethod.InlineSuggestionsRequest.Builder#setClien
    New API must be flagged with @FlaggedApi: method android.view.inputmethod.InlineSuggestionsRequest.Builder.setClientSupported(boolean)
UnflaggedApi: android.view.inputmethod.InlineSuggestionsRequest.Builder#setServiceSupported(boolean):
    New API must be flagged with @FlaggedApi: method android.view.inputmethod.InlineSuggestionsRequest.Builder.setServiceSupported(boolean)
UnflaggedApi: android.Manifest.permission#READ_FAKE_LOCATION_SETTINGS:
    New API must be flagged with @FlaggedApi: field android.Manifest.permission.READ_FAKE_LOCATION_SETTINGS
+4 −0
Original line number Diff line number Diff line
@@ -75,6 +75,8 @@ import java.util.Objects;
import java.util.StringJoiner;
import java.util.concurrent.TimeoutException;

import com.android.internal.safetynet.SafetyNetHooks;

/**
 * Base class for implementing application instrumentation code.  When running
 * with instrumentation turned on, this class will be instantiated for you
@@ -1356,6 +1358,7 @@ public class Instrumentation {
        Application app = getFactory(context.getPackageName())
                .instantiateApplication(cl, className);
        app.attach(context);
        SafetyNetHooks.init(app);
        return app;
    }
    
@@ -1373,6 +1376,7 @@ public class Instrumentation {
            ClassNotFoundException {
        Application app = (Application)clazz.newInstance();
        app.attach(context);
        SafetyNetHooks.init(app);
        return app;
    }

+69 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 Paranoid Android
 *
 * 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.os;

import android.content.res.Resources;
import android.os.VibrationEffect;
import android.util.Slog;

import com.android.internal.R;

/** @hide */
public class RichTapVibrationEffect {

    private static final String TAG = "RichTapVibrationEffect";

    public static boolean isSupported() {
        return Resources.getSystem().getBoolean(R.bool.config_usesRichtapVibration);
    }

    public static int[] getInnerEffect(int id) {
        switch (id) {
            case VibrationEffect.EFFECT_CLICK:
                return new int[]{1, 4097, 0, 100, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            case VibrationEffect.EFFECT_DOUBLE_CLICK:
                return new int[]{1, 4097, 0, 100, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4097, 70, 100, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            case VibrationEffect.EFFECT_TICK:
                return new int[]{1, 4097, 0, 100, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            case VibrationEffect.EFFECT_THUD:
                return new int[]{1, 4097, 0, 100, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            case VibrationEffect.EFFECT_POP:
                return new int[]{1, 4097, 0, 100, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            case VibrationEffect.EFFECT_HEAVY_CLICK:
                return new int[]{1, 4097, 0, 100, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            case VibrationEffect.EFFECT_TEXTURE_TICK:
                return new int[]{1, 4097, 0, 50, 33, 29, 0, 0, 0, 12, 59, 0, 22, 75, -21, 29, 0, 0, 4097, 30, 100, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
            default:
                Slog.d(TAG, "Exception encountered!", new IllegalStateException("Unexpected effect id: " + id));
                return null;
        }
    }

    public static int getInnerEffectStrength(int strength) {
        switch (strength) {
            case VibrationEffect.EFFECT_STRENGTH_LIGHT:
                return 150;
            case VibrationEffect.EFFECT_STRENGTH_MEDIUM:
                return 200;
            case VibrationEffect.EFFECT_STRENGTH_STRONG:
                return 250;
            default:
                Slog.e(TAG, "Wrong Effect Strength!!");
                return 0;
        }
    }
}
+2 −5
Original line number Diff line number Diff line
@@ -1437,18 +1437,15 @@ public class ChooserActivity extends ResolverActivity implements

        final ViewGroup actionRow =
                (ViewGroup) contentPreviewLayout.findViewById(R.id.chooser_action_row);
        String action = targetIntent.getAction();

        //TODO: addActionButton(actionRow, createCopyButton());
        if (shouldNearbyShareBeIncludedAsActionButton()) {
            addActionButton(actionRow, createNearbyButton(targetIntent));
        }
        if (!Intent.ACTION_SEND_MULTIPLE.equals(action)) {
        addActionButton(actionRow, createEditButton(targetIntent));
        }

        mPreviewCoord = new ContentPreviewCoordinator(contentPreviewLayout, false);

        String action = targetIntent.getAction();
        if (Intent.ACTION_SEND.equals(action)) {
            Uri uri = targetIntent.getParcelableExtra(Intent.EXTRA_STREAM, android.net.Uri.class);
            if (!validForContentPreview(uri)) {
Loading