Loading graphics/java/android/graphics/drawable/DrawableWrapper.java +9 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,15 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb } } @Override public ColorFilter getColorFilter() { final Drawable drawable = getDrawable(); if (drawable != null) { return drawable.getColorFilter(); } return super.getColorFilter(); } @Override public void setTintList(@Nullable ColorStateList tint) { if (mDrawable != null) { Loading packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java +10 −6 Original line number Diff line number Diff line Loading @@ -217,7 +217,8 @@ public class ScreenPinningRequest implements View.OnClickListener { mLayout.findViewById(R.id.screen_pinning_text_area) .setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); View buttons = mLayout.findViewById(R.id.screen_pinning_buttons); if (Recents.getSystemServices().hasSoftNavigationBar()) { if (Recents.getSystemServices() != null && Recents.getSystemServices().hasSoftNavigationBar()) { buttons.setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); swapChildrenIfRtlAndVertical(buttons); } else { Loading @@ -235,7 +236,8 @@ public class ScreenPinningRequest implements View.OnClickListener { } StatusBar statusBar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); NavigationBarView navigationBarView = statusBar.getNavigationBarView(); NavigationBarView navigationBarView = statusBar != null ? statusBar.getNavigationBarView() : null; final boolean recentsVisible = navigationBarView != null && navigationBarView.isRecentsButtonVisible(); boolean touchExplorationEnabled = mAccessibilityService.isTouchExplorationEnabled(); Loading @@ -256,10 +258,12 @@ public class ScreenPinningRequest implements View.OnClickListener { : R.string.screen_pinning_description_recents_invisible; } if (navigationBarView != null) { ((ImageView) mLayout.findViewById(R.id.screen_pinning_back_icon)) .setImageDrawable(navigationBarView.getBackDrawable(mContext)); ((ImageView) mLayout.findViewById(R.id.screen_pinning_home_icon)) .setImageDrawable(navigationBarView.getHomeDrawable(mContext)); } ((TextView) mLayout.findViewById(R.id.screen_pinning_description)) .setText(descriptionStringResId); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenPinningNotify.java +3 −3 Original line number Diff line number Diff line Loading @@ -42,17 +42,17 @@ public class ScreenPinningNotify { } /** Show "Screen pinned" toast. */ void showPinningStartToast() { public void showPinningStartToast() { makeAllUserToastAndShow(R.string.screen_pinning_start); } /** Show "Screen unpinned" toast. */ void showPinningExitToast() { public void showPinningExitToast() { makeAllUserToastAndShow(R.string.screen_pinning_exit); } /** Show a toast that describes the gesture the user should use to escape pinned mode. */ void showEscapeToast(boolean isRecentsButtonVisible) { public void showEscapeToast(boolean isRecentsButtonVisible) { long showToastTime = SystemClock.elapsedRealtime(); if ((showToastTime - mLastShowToastTime) < SHOW_TOAST_MINIMUM_INTERVAL) { Slog.i(TAG, "Ignore toast since it is requested in very short interval."); Loading services/core/java/com/android/server/location/GnssLocationProvider.java +14 −20 Original line number Diff line number Diff line Loading @@ -16,11 +16,11 @@ package com.android.server.location; import android.annotation.Nullable; import android.app.AlarmManager; import android.app.AppOpsManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; Loading Loading @@ -251,8 +251,6 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt private static final int TCP_MIN_PORT = 0; private static final int TCP_MAX_PORT = 0xffff; // 10 seconds. private static final long LOCATION_TIME_FRESHNESS_THESHOLD_MILLIS = 10 * 1000; // 1 second, or 1 Hz frequency. private static final long LOCATION_UPDATE_MIN_TIME_INTERVAL_MILLIS = 1000; // 30 seconds. Loading Loading @@ -1038,6 +1036,15 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt } return; } ContentResolver resolver = mContext.getContentResolver(); long durationMillis = Settings.Global.getLong( resolver, Settings.Global.GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS, LOCATION_UPDATE_DURATION_MILLIS); if (durationMillis == 0) { Log.i(TAG, "GNSS HAL location request is disabled by Settings."); return; } LocationManager locationManager = (LocationManager) mContext.getSystemService( Context.LOCATION_SERVICE); Loading @@ -1055,7 +1062,9 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt } Log.i(TAG, String.format("GNSS HAL Requesting location updates from %s provider.", provider)); String.format( "GNSS HAL Requesting location updates from %s provider for %d millis.", provider, durationMillis)); locationManager.requestLocationUpdates(provider, LOCATION_UPDATE_MIN_TIME_INTERVAL_MILLIS, /*minDistance=*/ 0, locationListener, mHandler.getLooper()); Loading @@ -1065,7 +1074,7 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt Log.i(TAG, String.format("Removing location updates from %s provider.", provider)); locationManager.removeUpdates(locationListener); } }, LOCATION_UPDATE_DURATION_MILLIS); }, durationMillis); } private void injectBestLocation(Location location) { Loading Loading @@ -1094,21 +1103,6 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt timestamp); } /** * Get the last fresh location. * * Return null if the last location is not available or not fresh. */ private @Nullable Location getLastFreshLocation(LocationManager locationManager, String provider) { Location location = locationManager.getLastKnownLocation(provider); if (location != null && System.currentTimeMillis() - location.getTime() < LOCATION_TIME_FRESHNESS_THESHOLD_MILLIS) { return location; } return null; } /** Returns true if the location request is too frequent. */ private boolean isRequestLocationRateLimited() { // TODO(b/73198123): implement exponential backoff. Loading Loading
graphics/java/android/graphics/drawable/DrawableWrapper.java +9 −0 Original line number Diff line number Diff line Loading @@ -295,6 +295,15 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb } } @Override public ColorFilter getColorFilter() { final Drawable drawable = getDrawable(); if (drawable != null) { return drawable.getColorFilter(); } return super.getColorFilter(); } @Override public void setTintList(@Nullable ColorStateList tint) { if (mDrawable != null) { Loading
packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java +10 −6 Original line number Diff line number Diff line Loading @@ -217,7 +217,8 @@ public class ScreenPinningRequest implements View.OnClickListener { mLayout.findViewById(R.id.screen_pinning_text_area) .setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); View buttons = mLayout.findViewById(R.id.screen_pinning_buttons); if (Recents.getSystemServices().hasSoftNavigationBar()) { if (Recents.getSystemServices() != null && Recents.getSystemServices().hasSoftNavigationBar()) { buttons.setLayoutDirection(View.LAYOUT_DIRECTION_LOCALE); swapChildrenIfRtlAndVertical(buttons); } else { Loading @@ -235,7 +236,8 @@ public class ScreenPinningRequest implements View.OnClickListener { } StatusBar statusBar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); NavigationBarView navigationBarView = statusBar.getNavigationBarView(); NavigationBarView navigationBarView = statusBar != null ? statusBar.getNavigationBarView() : null; final boolean recentsVisible = navigationBarView != null && navigationBarView.isRecentsButtonVisible(); boolean touchExplorationEnabled = mAccessibilityService.isTouchExplorationEnabled(); Loading @@ -256,10 +258,12 @@ public class ScreenPinningRequest implements View.OnClickListener { : R.string.screen_pinning_description_recents_invisible; } if (navigationBarView != null) { ((ImageView) mLayout.findViewById(R.id.screen_pinning_back_icon)) .setImageDrawable(navigationBarView.getBackDrawable(mContext)); ((ImageView) mLayout.findViewById(R.id.screen_pinning_home_icon)) .setImageDrawable(navigationBarView.getHomeDrawable(mContext)); } ((TextView) mLayout.findViewById(R.id.screen_pinning_description)) .setText(descriptionStringResId); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScreenPinningNotify.java +3 −3 Original line number Diff line number Diff line Loading @@ -42,17 +42,17 @@ public class ScreenPinningNotify { } /** Show "Screen pinned" toast. */ void showPinningStartToast() { public void showPinningStartToast() { makeAllUserToastAndShow(R.string.screen_pinning_start); } /** Show "Screen unpinned" toast. */ void showPinningExitToast() { public void showPinningExitToast() { makeAllUserToastAndShow(R.string.screen_pinning_exit); } /** Show a toast that describes the gesture the user should use to escape pinned mode. */ void showEscapeToast(boolean isRecentsButtonVisible) { public void showEscapeToast(boolean isRecentsButtonVisible) { long showToastTime = SystemClock.elapsedRealtime(); if ((showToastTime - mLastShowToastTime) < SHOW_TOAST_MINIMUM_INTERVAL) { Slog.i(TAG, "Ignore toast since it is requested in very short interval."); Loading
services/core/java/com/android/server/location/GnssLocationProvider.java +14 −20 Original line number Diff line number Diff line Loading @@ -16,11 +16,11 @@ package com.android.server.location; import android.annotation.Nullable; import android.app.AlarmManager; import android.app.AppOpsManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; Loading Loading @@ -251,8 +251,6 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt private static final int TCP_MIN_PORT = 0; private static final int TCP_MAX_PORT = 0xffff; // 10 seconds. private static final long LOCATION_TIME_FRESHNESS_THESHOLD_MILLIS = 10 * 1000; // 1 second, or 1 Hz frequency. private static final long LOCATION_UPDATE_MIN_TIME_INTERVAL_MILLIS = 1000; // 30 seconds. Loading Loading @@ -1038,6 +1036,15 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt } return; } ContentResolver resolver = mContext.getContentResolver(); long durationMillis = Settings.Global.getLong( resolver, Settings.Global.GNSS_HAL_LOCATION_REQUEST_DURATION_MILLIS, LOCATION_UPDATE_DURATION_MILLIS); if (durationMillis == 0) { Log.i(TAG, "GNSS HAL location request is disabled by Settings."); return; } LocationManager locationManager = (LocationManager) mContext.getSystemService( Context.LOCATION_SERVICE); Loading @@ -1055,7 +1062,9 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt } Log.i(TAG, String.format("GNSS HAL Requesting location updates from %s provider.", provider)); String.format( "GNSS HAL Requesting location updates from %s provider for %d millis.", provider, durationMillis)); locationManager.requestLocationUpdates(provider, LOCATION_UPDATE_MIN_TIME_INTERVAL_MILLIS, /*minDistance=*/ 0, locationListener, mHandler.getLooper()); Loading @@ -1065,7 +1074,7 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt Log.i(TAG, String.format("Removing location updates from %s provider.", provider)); locationManager.removeUpdates(locationListener); } }, LOCATION_UPDATE_DURATION_MILLIS); }, durationMillis); } private void injectBestLocation(Location location) { Loading Loading @@ -1094,21 +1103,6 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt timestamp); } /** * Get the last fresh location. * * Return null if the last location is not available or not fresh. */ private @Nullable Location getLastFreshLocation(LocationManager locationManager, String provider) { Location location = locationManager.getLastKnownLocation(provider); if (location != null && System.currentTimeMillis() - location.getTime() < LOCATION_TIME_FRESHNESS_THESHOLD_MILLIS) { return location; } return null; } /** Returns true if the location request is too frequent. */ private boolean isRequestLocationRateLimited() { // TODO(b/73198123): implement exponential backoff. Loading