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

Commit 53b03967 authored by Nishith  Khanna's avatar Nishith Khanna
Browse files

Merge remote-tracking branch 'origin/lineage-22.2' into a15

parents d6af30ae f02cc438
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -23,12 +23,13 @@ import android.os.IBinder;
import com.android.internal.util.Preconditions;

import java.util.List;
import java.util.Objects;

/**
 * Privileges granted to a Process that allows it to execute starts from the background.
 * @hide
 */
public class BackgroundStartPrivileges {
public final class BackgroundStartPrivileges {
    /** No privileges. */
    public static final BackgroundStartPrivileges NONE = new BackgroundStartPrivileges(
            false, false, null);
@@ -190,4 +191,22 @@ public class BackgroundStartPrivileges {
                + ", originatingToken=" + mOriginatingToken
                + ']';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BackgroundStartPrivileges that = (BackgroundStartPrivileges) o;
        return mAllowsBackgroundActivityStarts == that.mAllowsBackgroundActivityStarts
                && mAllowsBackgroundForegroundServiceStarts
                == that.mAllowsBackgroundForegroundServiceStarts
                && Objects.equals(mOriginatingToken, that.mOriginatingToken);
    }

    @Override
    public int hashCode() {
        return Objects.hash(mAllowsBackgroundActivityStarts,
                mAllowsBackgroundForegroundServiceStarts,
                mOriginatingToken);
    }
}
+5 −0
Original line number Diff line number Diff line
@@ -2358,8 +2358,13 @@ public final class Configuration implements Parcelable, Comparable<Configuration
     * @param locales The locale list. If null, an empty LocaleList will be assigned.
     */
    public void setLocales(@Nullable LocaleList locales) {
        LocaleList oldList = mLocaleList;
        mLocaleList = locales == null ? LocaleList.getEmptyLocaleList() : locales;
        locale = mLocaleList.get(0);
        if (!mLocaleList.equals(oldList)) {
            Slog.v(TAG, "Updating configuration, locales updated from " + oldList
                    + " to " + mLocaleList);
        }
        setLayoutDirection(locale);
    }

+4 −0
Original line number Diff line number Diff line
@@ -491,6 +491,9 @@ public class ResourcesImpl {
                            }
                            defaultLocale =
                                    adjustLanguageTag(lc.getDefaultLocale().toLanguageTag());
                            Slog.v(TAG, "Updating configuration, with default locale "
                                    + defaultLocale + " and selected locales "
                                    + Arrays.toString(selectedLocales));
                        } else {
                            String[] availableLocales;
                            // The LocaleList has changed. We must query the AssetManager's
@@ -526,6 +529,7 @@ public class ResourcesImpl {
                        for (int i = 0; i < locales.size(); i++) {
                            selectedLocales[i] = adjustLanguageTag(locales.get(i).toLanguageTag());
                        }
                        defaultLocale = adjustLanguageTag(lc.getDefaultLocale().toLanguageTag());
                    } else {
                        selectedLocales = new String[]{
                                adjustLanguageTag(locales.get(0).toLanguageTag())};
+12 −0
Original line number Diff line number Diff line
@@ -75,4 +75,16 @@ flag {
    bug: "362575865"
}

flag {
    name: "bal_strict_mode_grace_period"
    namespace: "responsible_apis"
    description: "Strict mode violation triggered by grace period usage"
    bug: "384807495"
}

flag {
    name: "bal_clear_allowlist_duration"
    namespace: "responsible_apis"
    description: "Clear the allowlist duration when clearAllowBgActivityStarts is called"
    bug: "322159724"
}
+6 −8
Original line number Diff line number Diff line
@@ -409,19 +409,17 @@ static void NativeSetConfiguration(JNIEnv* env, jclass /*clazz*/, jlong ptr, jin
    configs.push_back(configuration);
  }

  uint32_t default_locale_int = 0;
  std::optional<ResTable_config> default_locale_opt;
  if (default_locale != nullptr) {
    ResTable_config config;
    static_assert(std::is_same_v<decltype(config.locale), decltype(default_locale_int)>);
      ScopedUtfChars locale_utf8(env, default_locale);
      CHECK(locale_utf8.c_str() != nullptr);
    config.setBcp47Locale(locale_utf8.c_str());
    default_locale_int = config.locale;
      default_locale_opt.emplace();
      default_locale_opt->setBcp47Locale(locale_utf8.c_str());
  }

  auto assetmanager = LockAndStartAssetManager(ptr);
  assetmanager->SetConfigurations(std::move(configs), force_refresh != JNI_FALSE);
  assetmanager->SetDefaultLocale(default_locale_int);
  assetmanager->SetDefaultLocale(default_locale_opt);
}

static jobject NativeGetAssignedPackageIdentifiers(JNIEnv* env, jclass /*clazz*/, jlong ptr,
Loading