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

Commit dca87445 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6203188 from c2daf3cb to qt-qpr3-release

Change-Id: I7b96d5a9f0fec4de13cc00e5acec2a823a69d4bf
parents 9ef7d783 c2daf3cb
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -16,25 +16,22 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:fitsSystemWindows="true"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

  <ImageView
      android:id="@+id/user_loading_avatar"
      android:layout_width="@dimen/car_fullscreen_user_pod_image_avatar_width"
      android:layout_height="@dimen/car_fullscreen_user_pod_image_avatar_height"
      android:layout_centerHorizontal="true"
  />
      android:layout_centerHorizontal="true"/>

  <TextView android:id="@+id/user_loading"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="@dimen/car_padding_4"
      android:textSize="@dimen/car_body1_size"
      android:textColor="@color/car_body1_light"
      android:textColor="@color/car_body1"
      android:layout_below="@id/user_loading_avatar"
      android:gravity="center"
  />
      android:gravity="center"/>

</RelativeLayout>
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -4273,7 +4273,11 @@
    <!-- Boolean indicating whether frameworks needs to reset cell broadcast geo-fencing
         check after reboot or airplane mode toggling -->
    <bool translatable="false" name="reset_geo_fencing_check_after_boot_or_apm">false</bool>

    <!-- Boolean indicating that the system will use autoSuspend. If set to false, autoSuspend
         is not used and the system will only suspend upon an explicit request. -->
    <bool translatable="false" name="config_enableAutoSuspend">true</bool>

    <!-- Class name of the custom country detector to be used. -->
    <string name="config_customCountryDetector" translatable="false">com.android.server.location.ComprehensiveCountryDetector</string>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -3689,6 +3689,8 @@

  <java-symbol type="bool" name="config_maskMainBuiltInDisplayCutout" />

  <java-symbol type="string" name="config_customCountryDetector" />

  <!-- For Foldables -->
  <java-symbol type="bool" name="config_lidControlsDisplayFold" />
  <java-symbol type="string" name="config_foldedArea" />
+4 −3
Original line number Diff line number Diff line
@@ -641,9 +641,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
        if (previewBefore != null) {
            mPreviewContainer.removeView(previewBefore);
        }
        if (mLeftIsVoiceAssist) {
            mLeftPreview = mPreviewInflater.inflatePreviewFromService(
                    mAssistManager.getVoiceInteractorComponentName());
        ComponentName voiceInteractorComponentName =
                mAssistManager.getVoiceInteractorComponentName();
        if (mLeftIsVoiceAssist && voiceInteractorComponentName != null) {
            mLeftPreview = mPreviewInflater.inflatePreviewFromService(voiceInteractorComponentName);
        } else {
            mLeftPreview = mPreviewInflater.inflatePreview(mLeftButton.getIntent());
        }
+45 −5
Original line number Diff line number Diff line
@@ -24,21 +24,29 @@ import android.location.ICountryListener;
import android.os.Handler;
import android.os.IBinder;
import android.os.RemoteException;
import android.text.TextUtils;
import android.util.PrintWriterPrinter;
import android.util.Printer;
import android.util.Slog;

import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.BackgroundThread;
import com.android.internal.util.DumpUtils;
import com.android.server.location.ComprehensiveCountryDetector;
import com.android.server.location.CountryDetectorBase;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;

/**
 * This class detects the country that the user is in through {@link ComprehensiveCountryDetector}.
 * This class detects the country that the user is in. The default country detection is made through
 * {@link com.android.server.location.ComprehensiveCountryDetector}. It is possible to overlay the
 * detection algorithm by overlaying the attribute R.string.config_customCountryDetector with the
 * custom class name to use instead. The custom class must extend
 * {@link com.android.server.location.CountryDetectorBase}
 *
 * @hide
 */
@@ -88,7 +96,7 @@ public class CountryDetectorService extends ICountryDetector.Stub {

    private final HashMap<IBinder, Receiver> mReceivers;
    private final Context mContext;
    private ComprehensiveCountryDetector mCountryDetector;
    private CountryDetectorBase mCountryDetector;
    private boolean mSystemReady;
    private Handler mHandler;
    private CountryListener mLocationBasedDetectorListener;
@@ -184,8 +192,17 @@ public class CountryDetectorService extends ICountryDetector.Stub {
                });
    }

    private void initialize() {
    @VisibleForTesting
    void initialize() {
        final String customCountryClass = mContext.getString(R.string.config_customCountryDetector);
        if (!TextUtils.isEmpty(customCountryClass)) {
            mCountryDetector = loadCustomCountryDetectorIfAvailable(customCountryClass);
        }

        if (mCountryDetector == null) {
            Slog.d(TAG, "Using default country detector");
            mCountryDetector = new ComprehensiveCountryDetector(mContext);
        }
        mLocationBasedDetectorListener = country -> mHandler.post(() -> notifyReceivers(country));
    }

@@ -193,11 +210,33 @@ public class CountryDetectorService extends ICountryDetector.Stub {
        mHandler.post(() -> mCountryDetector.setCountryListener(listener));
    }

    @VisibleForTesting
    CountryDetectorBase getCountryDetector() {
        return mCountryDetector;
    }

    @VisibleForTesting
    boolean isSystemReady() {
        return mSystemReady;
    }

    private CountryDetectorBase loadCustomCountryDetectorIfAvailable(
            final String customCountryClass) {
        CountryDetectorBase customCountryDetector = null;

        Slog.d(TAG, "Using custom country detector class: " + customCountryClass);
        try {
            customCountryDetector = Class.forName(customCountryClass).asSubclass(
                    CountryDetectorBase.class).getConstructor(Context.class).newInstance(
                    mContext);
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException
                | NoSuchMethodException | InvocationTargetException e) {
            Slog.e(TAG, "Could not instantiate the custom country detector class");
        }

        return customCountryDetector;
    }

    @SuppressWarnings("unused")
    @Override
    protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
@@ -206,9 +245,10 @@ public class CountryDetectorService extends ICountryDetector.Stub {
        try {
            final Printer p = new PrintWriterPrinter(fout);
            p.println("CountryDetectorService state:");
            p.println("Country detector class=" + mCountryDetector.getClass().getName());
            p.println("  Number of listeners=" + mReceivers.keySet().size());
            if (mCountryDetector == null) {
                p.println("  ComprehensiveCountryDetector not initialized");
                p.println("  CountryDetector not initialized");
            } else {
                p.println("  " + mCountryDetector.toString());
            }
Loading