From e28c03b620c3252b1c24fc326a3a9b4af93ce722 Mon Sep 17 00:00:00 2001 From: Phil Weaver Date: Mon, 24 Apr 2017 13:23:10 -0700 Subject: [PATCH 01/66] Use newest scrap view in ListView When a ListView's contents change, it first measures, using a view at position 0. It then scraps that view, and then scraps all of its other views. Two scrap views thus exist for position 0. Since we were retrieving the oldest scrap view, we would toggle between two different views at position 0. This toggling confuses accessibility. This change takes the newest view from the scap heap, so the view that was recycled last (which is the one shown on the screen) is re-used for the screen. The view used for measuring sticks around and is available for measure again. Bug: 33788047 Test: I verified that the switch state is announced correctly for the cases found in the bug. Change-Id: I936e5ad09c3594e33e80dc39236025bf8bc877b8 --- core/java/android/widget/AbsListView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 1c87726b3ca9..5476ab216f2f 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -7088,7 +7088,8 @@ public abstract class AbsListView extends AdapterView implements Te final int size = scrapViews.size(); if (size > 0) { // See if we still have a view for this position or ID. - for (int i = 0; i < size; i++) { + // Traverse backwards to find the most recently used scrap view + for (int i = size - 1; i >= 0; i--) { final View view = scrapViews.get(i); final AbsListView.LayoutParams params = (AbsListView.LayoutParams) view.getLayoutParams(); -- GitLab From 01354dc85882e4eeef8960bcaf086540652eecac Mon Sep 17 00:00:00 2001 From: msnider Date: Mon, 24 Apr 2017 15:41:48 -0700 Subject: [PATCH 02/66] Removing ACTION_CLEAR_PACKAGE intent See ag/2118129 in master for revert Test: N/A Bug: 37413812 Bug: 37497021 Bug: 37494148 Bug: 37414037 Change-Id: Id39418e7008ef109e058f52eb44d610b29e34125 --- api/current.txt | 1 - api/system-current.txt | 1 - api/test-current.txt | 1 - core/java/android/content/Intent.java | 13 ------------- 4 files changed, 16 deletions(-) diff --git a/api/current.txt b/api/current.txt index f1be1783202c..5da9d74798c7 100644 --- a/api/current.txt +++ b/api/current.txt @@ -9325,7 +9325,6 @@ package android.content { field public static final java.lang.String ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON"; field public static final java.lang.String ACTION_CARRIER_SETUP = "android.intent.action.CARRIER_SETUP"; field public static final java.lang.String ACTION_CHOOSER = "android.intent.action.CHOOSER"; - field public static final java.lang.String ACTION_CLEAR_PACKAGE = "android.intent.action.CLEAR_PACKAGE"; field public static final java.lang.String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS"; field public static final java.lang.String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED"; field public static final java.lang.String ACTION_CREATE_DOCUMENT = "android.intent.action.CREATE_DOCUMENT"; diff --git a/api/system-current.txt b/api/system-current.txt index 4f26fadd307f..34e67e5c6b3e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -9845,7 +9845,6 @@ package android.content { field public static final java.lang.String ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON"; field public static final java.lang.String ACTION_CARRIER_SETUP = "android.intent.action.CARRIER_SETUP"; field public static final java.lang.String ACTION_CHOOSER = "android.intent.action.CHOOSER"; - field public static final java.lang.String ACTION_CLEAR_PACKAGE = "android.intent.action.CLEAR_PACKAGE"; field public static final java.lang.String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS"; field public static final java.lang.String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED"; field public static final java.lang.String ACTION_CREATE_DOCUMENT = "android.intent.action.CREATE_DOCUMENT"; diff --git a/api/test-current.txt b/api/test-current.txt index 776944693e3d..ba4731b4902b 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -9359,7 +9359,6 @@ package android.content { field public static final java.lang.String ACTION_CAMERA_BUTTON = "android.intent.action.CAMERA_BUTTON"; field public static final java.lang.String ACTION_CARRIER_SETUP = "android.intent.action.CARRIER_SETUP"; field public static final java.lang.String ACTION_CHOOSER = "android.intent.action.CHOOSER"; - field public static final java.lang.String ACTION_CLEAR_PACKAGE = "android.intent.action.CLEAR_PACKAGE"; field public static final java.lang.String ACTION_CLOSE_SYSTEM_DIALOGS = "android.intent.action.CLOSE_SYSTEM_DIALOGS"; field public static final java.lang.String ACTION_CONFIGURATION_CHANGED = "android.intent.action.CONFIGURATION_CHANGED"; field public static final java.lang.String ACTION_CREATE_DOCUMENT = "android.intent.action.CREATE_DOCUMENT"; diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index b6f9ac97e727..de043b955077 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -1706,19 +1706,6 @@ public class Intent implements Parcelable, Cloneable { @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_UNINSTALL_PACKAGE = "android.intent.action.UNINSTALL_PACKAGE"; - /** - * Activity Action: Launch application uninstaller. - *

- * Input: The data must be a package: URI whose scheme specific part is - * the package name of the current installed package to be uninstalled. - * You can optionally supply {@link #EXTRA_RETURN_RESULT}. - *

- * Output: Nothing. - *

- */ - @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) - public static final String ACTION_CLEAR_PACKAGE = "android.intent.action.CLEAR_PACKAGE"; - /** * Specify whether the package should be uninstalled for all users. * @hide because these should not be part of normal application flow. -- GitLab From 580ae01c8b6af8c4d75d80b9d61f74fd88a48c7b Mon Sep 17 00:00:00 2001 From: Daniel Nishi Date: Wed, 26 Apr 2017 10:49:50 -0700 Subject: [PATCH 03/66] Make PrivateStorageInfo have a public constructor. This allows us to instatiate it as part of a loader, rather than just relying directly on the StorageVolumeProvider builder. Bug: 37175551 Test: Settings robotest Change-Id: Id465703ecead5881ee9a38d69751ad44c3643b54 --- .../com/android/settingslib/deviceinfo/PrivateStorageInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java index ccf7a0bfdfc6..39dfe0ef6620 100644 --- a/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java +++ b/packages/SettingsLib/src/com/android/settingslib/deviceinfo/PrivateStorageInfo.java @@ -33,7 +33,7 @@ public class PrivateStorageInfo { public final long freeBytes; public final long totalBytes; - private PrivateStorageInfo(long freeBytes, long totalBytes) { + public PrivateStorageInfo(long freeBytes, long totalBytes) { this.freeBytes = freeBytes; this.totalBytes = totalBytes; } -- GitLab From a6f7b25c3d160be02cb7384f154a1f77a8faaffa Mon Sep 17 00:00:00 2001 From: Salvador Martinez Date: Mon, 10 Apr 2017 10:46:15 -0700 Subject: [PATCH 04/66] Added dialog to notify user of thermal shutdown tldr; Have the phone check when it reboots if it last shut down due to heat. If so, we should show the user an notification and dialog giving them more details. - Added hidden api to allow apps to query system_server for the reason the phone last rebooted - Added notification that is shown when the phone is booted if the last shutdown was due to excessive heat. - Added dialog to provide more details about the shutdown if the notification is tapped. - Added tests to verify that file is read and as expected. - Updated code for high temperature warning that is shown while the phone is running to avoid mixups in the future. Test: FrameworksServiceTests Bug: 30994946 Change-Id: Ic25f42539911c89ba7f1834e206f7931d65c2865 --- core/java/android/os/IPowerManager.aidl | 1 + core/java/android/os/PowerManager.java | 62 +++++++++++++ .../power/PowerNotificationWarnings.java | 86 +++++++++++++++---- .../com/android/systemui/power/PowerUI.java | 21 ++++- .../power/PowerNotificationWarningsTest.java | 26 ++++-- .../server/power/PowerManagerService.java | 55 ++++++++++++ .../server/power/PowerManagerServiceTest.java | 29 +++++++ .../bridge/android/BridgePowerManager.java | 6 ++ 8 files changed, 259 insertions(+), 27 deletions(-) diff --git a/core/java/android/os/IPowerManager.aidl b/core/java/android/os/IPowerManager.aidl index b71578060fdc..037cccf14615 100644 --- a/core/java/android/os/IPowerManager.aidl +++ b/core/java/android/os/IPowerManager.aidl @@ -55,6 +55,7 @@ interface IPowerManager void rebootSafeMode(boolean confirm, boolean wait); void shutdown(boolean confirm, String reason, boolean wait); void crash(String message); + int getLastShutdownReason(); void setStayOnSetting(int val); void boostScreenBrightness(long time); diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java index a713eef72c45..7d1369fe1b69 100644 --- a/core/java/android/os/PowerManager.java +++ b/core/java/android/os/PowerManager.java @@ -16,10 +16,13 @@ package android.os; +import android.annotation.IntDef; import android.annotation.SdkConstant; import android.annotation.SystemApi; import android.content.Context; import android.util.Log; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; /** * This class gives you control of the power state of the device. @@ -432,6 +435,49 @@ public final class PowerManager { */ public static final String SHUTDOWN_USER_REQUESTED = "userrequested"; + /** + * @hide + */ + @Retention(RetentionPolicy.SOURCE) + @IntDef({ + SHUTDOWN_REASON_UNKNOWN, + SHUTDOWN_REASON_SHUTDOWN, + SHUTDOWN_REASON_REBOOT, + SHUTDOWN_REASON_USER_REQUESTED, + SHUTDOWN_REASON_THERMAL_SHUTDOWN + }) + public @interface ShutdownReason {} + + /** + * constant for shutdown reason being unknown. + * @hide + */ + public static final int SHUTDOWN_REASON_UNKNOWN = 0; + + /** + * constant for shutdown reason being normal shutdown. + * @hide + */ + public static final int SHUTDOWN_REASON_SHUTDOWN = 1; + + /** + * constant for shutdown reason being reboot. + * @hide + */ + public static final int SHUTDOWN_REASON_REBOOT = 2; + + /** + * constant for shutdown reason being user requested. + * @hide + */ + public static final int SHUTDOWN_REASON_USER_REQUESTED = 3; + + /** + * constant for shutdown reason being overheating. + * @hide + */ + public static final int SHUTDOWN_REASON_THERMAL_SHUTDOWN = 4; + final Context mContext; final IPowerManager mService; final Handler mHandler; @@ -1084,6 +1130,22 @@ public final class PowerManager { com.android.internal.R.bool.config_sustainedPerformanceModeSupported); } + /** + * Returns the reason the phone was last shutdown. Calling app must have the + * {@link android.Manifest.permission#DEVICE_POWER} permission to request this information. + * @return Reason for shutdown as an int, {@link #SHUTDOWN_REASON_UNKNOWN} if the file could + * not be accessed. + * @hide + */ + @ShutdownReason + public int getLastShutdownReason() { + try { + return mService.getLastShutdownReason(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + /** * Intent that is broadcast when the state of {@link #isPowerSaveMode()} changes. * This broadcast is only sent to registered receivers. diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java index daf0622fa7a6..6b3daa306103 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java @@ -36,6 +36,7 @@ import android.os.PowerManager; import android.os.SystemClock; import android.os.UserHandle; import android.provider.Settings; +import android.support.annotation.VisibleForTesting; import android.util.Slog; import com.android.internal.messages.nano.SystemMessageProto.SystemMessage; @@ -71,6 +72,10 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { private static final String ACTION_DISMISSED_WARNING = "PNW.dismissedWarning"; private static final String ACTION_CLICKED_TEMP_WARNING = "PNW.clickedTempWarning"; private static final String ACTION_DISMISSED_TEMP_WARNING = "PNW.dismissedTempWarning"; + private static final String ACTION_CLICKED_THERMAL_SHUTDOWN_WARNING = + "PNW.clickedThermalShutdownWarning"; + private static final String ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING = + "PNW.dismissedThermalShutdownWarning"; private static final AudioAttributes AUDIO_ATTRIBUTES = new AudioAttributes.Builder() .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) @@ -95,8 +100,9 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { private boolean mPlaySound; private boolean mInvalidCharger; private SystemUIDialog mSaverConfirmation; - private boolean mTempWarning; + private boolean mHighTempWarning; private SystemUIDialog mHighTempDialog; + private SystemUIDialog mThermalShutdownDialog; public PowerNotificationWarnings(Context context, NotificationManager notificationManager, StatusBar statusBar) { @@ -113,8 +119,10 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { pw.print("mInvalidCharger="); pw.println(mInvalidCharger); pw.print("mShowing="); pw.println(SHOWING_STRINGS[mShowing]); pw.print("mSaverConfirmation="); pw.println(mSaverConfirmation != null ? "not null" : null); - pw.print("mTempWarning="); pw.println(mTempWarning); + pw.print("mHighTempWarning="); pw.println(mHighTempWarning); pw.print("mHighTempDialog="); pw.println(mHighTempDialog != null ? "not null" : null); + pw.print("mThermalShutdownDialog="); + pw.println(mThermalShutdownDialog != null ? "not null" : null); } @Override @@ -212,29 +220,29 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { } @Override - public void dismissTemperatureWarning() { - if (!mTempWarning) { + public void dismissHighTemperatureWarning() { + if (!mHighTempWarning) { return; } - mTempWarning = false; - dismissTemperatureWarningInternal(); + mHighTempWarning = false; + dismissHighTemperatureWarningInternal(); } /** - * Internal only version of {@link #dismissTemperatureWarning()} that simply dismisses + * Internal only version of {@link #dismissHighTemperatureWarning()} that simply dismisses * the notification. As such, the notification will not show again until - * {@link #dismissTemperatureWarning()} is called. + * {@link #dismissHighTemperatureWarning()} is called. */ - private void dismissTemperatureWarningInternal() { + private void dismissHighTemperatureWarningInternal() { mNoMan.cancelAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_HIGH_TEMP, UserHandle.ALL); } @Override - public void showTemperatureWarning() { - if (mTempWarning) { + public void showHighTemperatureWarning() { + if (mHighTempWarning) { return; } - mTempWarning = true; + mHighTempWarning = true; final Notification.Builder nb = new Notification.Builder(mContext, NotificationChannels.ALERTS) .setSmallIcon(R.drawable.ic_device_thermostat_24) @@ -249,10 +257,9 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { SystemUI.overrideNotificationAppName(mContext, nb); final Notification n = nb.build(); mNoMan.notifyAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_HIGH_TEMP, n, UserHandle.ALL); - } - private void showTemperatureDialog() { + private void showHighTemperatureDialog() { if (mHighTempDialog != null) return; final SystemUIDialog d = new SystemUIDialog(mContext); d.setIconAttribute(android.R.attr.alertDialogIcon); @@ -265,6 +272,44 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { mHighTempDialog = d; } + @VisibleForTesting + void dismissThermalShutdownWarning() { + mNoMan.cancelAsUser(TAG_TEMPERATURE, SystemMessage.NOTE_THERMAL_SHUTDOWN, UserHandle.ALL); + } + + private void showThermalShutdownDialog() { + if (mThermalShutdownDialog != null) return; + final SystemUIDialog d = new SystemUIDialog(mContext); + d.setIconAttribute(android.R.attr.alertDialogIcon); + d.setTitle(R.string.thermal_shutdown_title); + d.setMessage(R.string.thermal_shutdown_dialog_message); + d.setPositiveButton(com.android.internal.R.string.ok, null); + d.setShowForAllUsers(true); + d.setOnDismissListener(dialog -> mThermalShutdownDialog = null); + d.show(); + mThermalShutdownDialog = d; + } + + @Override + public void showThermalShutdownWarning() { + final Notification.Builder nb = + new Notification.Builder(mContext, NotificationChannels.ALERTS) + .setSmallIcon(R.drawable.ic_device_thermostat_24) + .setWhen(0) + .setShowWhen(false) + .setContentTitle(mContext.getString(R.string.thermal_shutdown_title)) + .setContentText(mContext.getString(R.string.thermal_shutdown_message)) + .setVisibility(Notification.VISIBILITY_PUBLIC) + .setContentIntent(pendingBroadcast(ACTION_CLICKED_THERMAL_SHUTDOWN_WARNING)) + .setDeleteIntent( + pendingBroadcast(ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING)) + .setColor(Utils.getColorAttr(mContext, android.R.attr.colorError)); + SystemUI.overrideNotificationAppName(mContext, nb); + final Notification n = nb.build(); + mNoMan.notifyAsUser( + TAG_TEMPERATURE, SystemMessage.NOTE_THERMAL_SHUTDOWN, n, UserHandle.ALL); + } + @Override public void updateLowBatteryWarning() { updateNotification(); @@ -380,6 +425,8 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { filter.addAction(ACTION_DISMISSED_WARNING); filter.addAction(ACTION_CLICKED_TEMP_WARNING); filter.addAction(ACTION_DISMISSED_TEMP_WARNING); + filter.addAction(ACTION_CLICKED_THERMAL_SHUTDOWN_WARNING); + filter.addAction(ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING); mContext.registerReceiverAsUser(this, UserHandle.ALL, filter, android.Manifest.permission.STATUS_BAR_SERVICE, mHandler); } @@ -397,10 +444,15 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI { } else if (action.equals(ACTION_DISMISSED_WARNING)) { dismissLowBatteryWarning(); } else if (ACTION_CLICKED_TEMP_WARNING.equals(action)) { - dismissTemperatureWarningInternal(); - showTemperatureDialog(); + dismissHighTemperatureWarningInternal(); + showHighTemperatureDialog(); } else if (ACTION_DISMISSED_TEMP_WARNING.equals(action)) { - dismissTemperatureWarningInternal(); + dismissHighTemperatureWarningInternal(); + } else if (ACTION_CLICKED_THERMAL_SHUTDOWN_WARNING.equals(action)) { + dismissThermalShutdownWarning(); + showThermalShutdownDialog(); + } else if (ACTION_DISMISSED_THERMAL_SHUTDOWN_WARNING.equals(action)) { + dismissThermalShutdownWarning(); } } } diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java index 471c3aeb9eb5..a64207714093 100644 --- a/packages/SystemUI/src/com/android/systemui/power/PowerUI.java +++ b/packages/SystemUI/src/com/android/systemui/power/PowerUI.java @@ -31,6 +31,7 @@ import android.os.PowerManager; import android.os.SystemClock; import android.os.UserHandle; import android.provider.Settings; +import android.text.TextUtils; import android.text.format.DateUtils; import android.util.Log; import android.util.Slog; @@ -93,6 +94,10 @@ public class PowerUI extends SystemUI { updateBatteryWarningLevels(); mReceiver.init(); + // Check to see if we need to let the user know that the phone previously shut down due + // to the temperature being too high. + showThermalShutdownDialog(); + initTemperatureWarning(); } @@ -256,6 +261,13 @@ public class PowerUI extends SystemUI { updateTemperatureWarning(); } + private void showThermalShutdownDialog() { + if (mPowerManager.getLastShutdownReason() + == PowerManager.SHUTDOWN_REASON_THERMAL_SHUTDOWN) { + mWarnings.showThermalShutdownWarning(); + } + } + private void updateTemperatureWarning() { float[] temps = mHardwarePropertiesManager.getDeviceTemperatures( HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN, @@ -268,9 +280,9 @@ public class PowerUI extends SystemUI { if (statusBar != null && !statusBar.isDeviceInVrMode() && temp >= mThresholdTemp) { logAtTemperatureThreshold(temp); - mWarnings.showTemperatureWarning(); + mWarnings.showHighTemperatureWarning(); } else { - mWarnings.dismissTemperatureWarning(); + mWarnings.dismissHighTemperatureWarning(); } } @@ -369,8 +381,9 @@ public class PowerUI extends SystemUI { void showInvalidChargerWarning(); void updateLowBatteryWarning(); boolean isInvalidChargerWarningShowing(); - void dismissTemperatureWarning(); - void showTemperatureWarning(); + void dismissHighTemperatureWarning(); + void showHighTemperatureWarning(); + void showThermalShutdownWarning(); void dump(PrintWriter pw); void userSwitched(); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java b/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java index 34cfa7be5b53..eb59a341ef0f 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/power/PowerNotificationWarningsTest.java @@ -24,7 +24,6 @@ import static junit.framework.Assert.assertTrue; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.any; -import static org.mockito.Mockito.anyInt; import static org.mockito.Mockito.anyString; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -129,17 +128,32 @@ public class PowerNotificationWarningsTest extends SysuiTestCase { } @Test - public void testShowTemperatureWarning_NotifyAsUser() { - mPowerNotificationWarnings.showTemperatureWarning(); + public void testShowHighTemperatureWarning_NotifyAsUser() { + mPowerNotificationWarnings.showHighTemperatureWarning(); verify(mMockNotificationManager, times(1)) .notifyAsUser(anyString(), eq(SystemMessage.NOTE_HIGH_TEMP), any(), any()); } @Test - public void testDismissTemperatureWarning_CancelAsUser() { - mPowerNotificationWarnings.showTemperatureWarning(); - mPowerNotificationWarnings.dismissTemperatureWarning(); + public void testDismissHighTemperatureWarning_CancelAsUser() { + mPowerNotificationWarnings.showHighTemperatureWarning(); + mPowerNotificationWarnings.dismissHighTemperatureWarning(); verify(mMockNotificationManager, times(1)).cancelAsUser(anyString(), eq(SystemMessage.NOTE_HIGH_TEMP), any()); } + + @Test + public void testShowThermalShutdownWarning_NotifyAsUser() { + mPowerNotificationWarnings.showThermalShutdownWarning(); + verify(mMockNotificationManager, times(1)) + .notifyAsUser(anyString(), eq(SystemMessage.NOTE_THERMAL_SHUTDOWN), any(), any()); + } + + @Test + public void testDismissThermalShutdownWarning_CancelAsUser() { + mPowerNotificationWarnings.showThermalShutdownWarning(); + mPowerNotificationWarnings.dismissThermalShutdownWarning(); + verify(mMockNotificationManager, times(1)).cancelAsUser(anyString(), + eq(SystemMessage.NOTE_THERMAL_SHUTDOWN), any()); + } } diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index 61ed72d990ca..8c3d80f18581 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -65,6 +65,7 @@ import android.service.vr.IVrManager; import android.service.vr.IVrStateCallbacks; import android.util.EventLog; import android.util.KeyValueListParser; +import android.util.Log; import android.util.PrintWriterPrinter; import android.util.Slog; import android.util.SparseArray; @@ -91,6 +92,10 @@ import com.android.server.am.BatteryStatsService; import com.android.server.lights.Light; import com.android.server.lights.LightsManager; import com.android.server.power.BatterySaverPolicy.ServiceType; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; import libcore.util.Objects; import java.io.FileDescriptor; @@ -191,6 +196,12 @@ public final class PowerManagerService extends SystemService // System property indicating that the screen should remain off until an explicit user action private static final String SYSTEM_PROPERTY_QUIESCENT = "ro.boot.quiescent"; + // Possible reasons for shutting down for use in data/misc/reboot/last_shutdown_reason + private static final String REASON_SHUTDOWN = "shutdown"; + private static final String REASON_REBOOT = "reboot"; + private static final String REASON_USERREQUESTED = "userrequested"; + private static final String REASON_THERMAL_SHUTDOWN = "thermal-shutdown"; + private static final String TRACE_SCREEN_ON = "Screen turning on"; /** If turning screen on takes more than this long, we show a warning on logcat. */ @@ -204,6 +215,9 @@ public final class PowerManagerService extends SystemService private static final int HALT_MODE_REBOOT = 1; private static final int HALT_MODE_REBOOT_SAFE_MODE = 2; + // File location for last reboot reason + private static final String LAST_REBOOT_LOCATION = "/data/misc/reboot/last_reboot_reason"; + private final Context mContext; private final ServiceThread mHandlerThread; private final PowerManagerHandler mHandler; @@ -4339,6 +4353,25 @@ public final class PowerManagerService extends SystemService } } + /** + * Gets the reason for the last time the phone had to reboot. + * + * @return The reason the phone last shut down as an int or + * {@link PowerManager.SHUTDOWN_REASON_UNKNOWN} if the file could not be opened. + */ + @Override // Binder call + public int getLastShutdownReason() { + mContext.enforceCallingOrSelfPermission( + android.Manifest.permission.DEVICE_POWER, null); + + final long ident = Binder.clearCallingIdentity(); + try { + return getLastShutdownReasonInternal(new File(LAST_REBOOT_LOCATION)); + } finally { + Binder.restoreCallingIdentity(ident); + } + } + /** * Reboots the device. * @@ -4566,6 +4599,28 @@ public final class PowerManagerService extends SystemService } } + @VisibleForTesting + int getLastShutdownReasonInternal(File lastRebootReason) { + String line = ""; + try (BufferedReader bufferedReader = new BufferedReader(new FileReader(lastRebootReason))){ + line = bufferedReader.readLine(); + } catch (IOException e) { + Slog.e(TAG, "Failed to read last_reboot_reason file", e); + } + switch (line) { + case REASON_SHUTDOWN: + return PowerManager.SHUTDOWN_REASON_SHUTDOWN; + case REASON_REBOOT: + return PowerManager.SHUTDOWN_REASON_REBOOT; + case REASON_USERREQUESTED: + return PowerManager.SHUTDOWN_REASON_USER_REQUESTED; + case REASON_THERMAL_SHUTDOWN: + return PowerManager.SHUTDOWN_REASON_THERMAL_SHUTDOWN; + default: + return PowerManager.SHUTDOWN_REASON_UNKNOWN; + } + } + private final class LocalService extends PowerManagerInternal { @Override public void setScreenBrightnessOverrideFromWindowManager(int screenBrightness) { diff --git a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java index 967b0a44e086..d12c07a84004 100644 --- a/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java +++ b/services/tests/servicestests/src/com/android/server/power/PowerManagerServiceTest.java @@ -16,10 +16,19 @@ package com.android.server.power; +import android.content.Context; import android.hardware.display.DisplayManagerInternal.DisplayPowerRequest; +import android.os.PowerManager; import android.os.PowerSaveState; import android.test.AndroidTestCase; import android.test.suitebuilder.annotation.SmallTest; +import android.text.TextUtils; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.OutputStreamWriter; +import org.junit.Rule; +import org.junit.rules.TemporaryFolder; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -35,11 +44,16 @@ public class PowerManagerServiceTest extends AndroidTestCase { private static final float PRECISION = 0.001f; private static final float BRIGHTNESS_FACTOR = 0.7f; private static final boolean BATTERY_SAVER_ENABLED = true; + private static final String LAST_REBOOT_REASON = "last_reboot_reason"; private @Mock BatterySaverPolicy mBatterySaverPolicy; private PowerManagerService mService; private PowerSaveState mPowerSaveState; private DisplayPowerRequest mDisplayPowerRequest; + private File mTempReason; + + @Rule + public TemporaryFolder temporaryFolder = new TemporaryFolder(); public void setUp() throws Exception { super.setUp(); @@ -54,6 +68,8 @@ public class PowerManagerServiceTest extends AndroidTestCase { .thenReturn(mPowerSaveState); mDisplayPowerRequest = new DisplayPowerRequest(); mService = new PowerManagerService(getContext(), mBatterySaverPolicy); + temporaryFolder.create(); + mTempReason = temporaryFolder.newFile(LAST_REBOOT_REASON); } @SmallTest @@ -63,4 +79,17 @@ public class PowerManagerServiceTest extends AndroidTestCase { assertThat(mDisplayPowerRequest.screenLowPowerBrightnessFactor) .isWithin(PRECISION).of(BRIGHTNESS_FACTOR); } + + @SmallTest + public void testGetLastShutdownReasonInternal() { + try { + FileWriter writer = new FileWriter(mTempReason); + writer.append("thermal-shutdown\n"); + writer.close(); + } catch (IOException e) { + e.printStackTrace(); + } + int reason = mService.getLastShutdownReasonInternal(mTempReason); + assertThat(reason).isEqualTo(PowerManager.SHUTDOWN_REASON_THERMAL_SHUTDOWN); + } } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java index 339019d2ab16..ed428ec9cfe8 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePowerManager.java @@ -18,6 +18,7 @@ package com.android.layoutlib.bridge.android; import android.os.IBinder; import android.os.IPowerManager; +import android.os.PowerManager; import android.os.PowerSaveState; import android.os.RemoteException; import android.os.WorkSource; @@ -170,4 +171,9 @@ public class BridgePowerManager implements IPowerManager { public boolean isScreenBrightnessBoosted() throws RemoteException { return false; } + + @Override + public int getLastShutdownReason() { + return PowerManager.SHUTDOWN_REASON_UNKNOWN; + } } -- GitLab From 002c8e1f58714660750779688ac8bc1957cc7347 Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Thu, 27 Apr 2017 15:32:22 -0700 Subject: [PATCH 05/66] Fix cropping in docked stack. In some cases in the docked stack we end up using the final crop, but we need to be careful not to expand it for the SurfaceInsets like we do for floating tasks. Bug: 36238776 Test: Manual from bug Change-Id: Ieb51d9f4b1b9aa01523dd41a1c54b6d526488b40 --- .../core/java/com/android/server/wm/WindowStateAnimator.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java index 2236b597ac5e..a6b95d635ba7 100644 --- a/services/core/java/com/android/server/wm/WindowStateAnimator.java +++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java @@ -1132,7 +1132,10 @@ class WindowStateAnimator { // Task is non-null per shouldCropToStackBounds final TaskStack stack = w.getTask().mStack; stack.getDimBounds(finalClipRect); - w.expandForSurfaceInsets(finalClipRect); + + if (StackId.tasksAreFloating(stack.mStackId)) { + w.expandForSurfaceInsets(finalClipRect); + } return true; } -- GitLab From 3d2af7f72a2e6be36f0f2cbf899ad4d0bde451b4 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Wed, 19 Apr 2017 19:56:21 -0700 Subject: [PATCH 06/66] SystemApi for dex module registration PackageManager#registerDexModule() allows apps which can call system apis to register a dex module with the Package Manager. The PM may optimize the modules on the spot if needed. This is particular useful for shared dex modules (e.g. chimera modules) which are loaded in multiple processes. Test: adb shell am instrument -e class 'android.content.pm.PackageManagerTests' -w 'com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner' Bug: 37290820 Change-Id: I9ea8f937a76d2549a29e90a6c84c53c2e44a1ee4 --- Android.mk | 1 + api/system-current.txt | 7 + .../app/ApplicationPackageManager.java | 78 +++++++++++ .../pm/IDexModuleRegisterCallback.aidl | 28 ++++ .../android/content/pm/IPackageManager.aidl | 33 +++++ .../android/content/pm/PackageManager.java | 44 +++++++ .../content/pm/PackageManagerTests.java | 121 +++++++++++++++++- .../android/server/pm/InstructionSets.java | 2 +- .../server/pm/PackageManagerService.java | 26 ++++ .../com/android/server/pm/dex/DexManager.java | 64 ++++++++- .../android/test/mock/MockPackageManager.java | 10 ++ .../bridge/android/BridgePackageManager.java | 6 + 12 files changed, 415 insertions(+), 5 deletions(-) create mode 100644 core/java/android/content/pm/IDexModuleRegisterCallback.aidl diff --git a/Android.mk b/Android.mk index 260da03b4f23..57f0881ad1cd 100644 --- a/Android.mk +++ b/Android.mk @@ -157,6 +157,7 @@ LOCAL_SRC_FILES += \ core/java/android/content/ISyncServiceAdapter.aidl \ core/java/android/content/ISyncStatusObserver.aidl \ core/java/android/content/om/IOverlayManager.aidl \ + core/java/android/content/pm/IDexModuleRegisterCallback.aidl \ core/java/android/content/pm/ILauncherApps.aidl \ core/java/android/content/pm/IOnAppsChangedListener.aidl \ core/java/android/content/pm/IOnPermissionsChangeListener.aidl \ diff --git a/api/system-current.txt b/api/system-current.txt index 2eaa31dd0d3f..61535a4c12b4 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -11339,6 +11339,7 @@ package android.content.pm { method public abstract java.util.List queryIntentContentProviders(android.content.Intent, int); method public abstract java.util.List queryIntentServices(android.content.Intent, int); method public abstract java.util.List queryPermissionsByGroup(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException; + method public abstract void registerDexModule(java.lang.String, android.content.pm.PackageManager.DexModuleRegisterCallback); method public abstract void removeOnPermissionsChangeListener(android.content.pm.PackageManager.OnPermissionsChangedListener); method public abstract deprecated void removePackageFromPreferred(java.lang.String); method public abstract void removePermission(java.lang.String); @@ -11559,6 +11560,11 @@ package android.content.pm { field public static final int VERSION_CODE_HIGHEST = -1; // 0xffffffff } + public static abstract class PackageManager.DexModuleRegisterCallback { + ctor public PackageManager.DexModuleRegisterCallback(); + method public abstract void onDexModuleRegistered(java.lang.String, boolean, java.lang.String); + } + public static class PackageManager.NameNotFoundException extends android.util.AndroidException { ctor public PackageManager.NameNotFoundException(); ctor public PackageManager.NameNotFoundException(java.lang.String); @@ -44558,6 +44564,7 @@ package android.test.mock { method public java.util.List queryIntentContentProviders(android.content.Intent, int); method public java.util.List queryIntentServices(android.content.Intent, int); method public java.util.List queryPermissionsByGroup(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException; + method public void registerDexModule(java.lang.String, android.content.pm.PackageManager.DexModuleRegisterCallback); method public void removeOnPermissionsChangeListener(android.content.pm.PackageManager.OnPermissionsChangedListener); method public void removePackageFromPreferred(java.lang.String); method public void removePermission(java.lang.String); diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java index e50c307df854..f6aea96bf7e2 100644 --- a/core/java/android/app/ApplicationPackageManager.java +++ b/core/java/android/app/ApplicationPackageManager.java @@ -78,6 +78,10 @@ import android.os.UserManager; import android.os.storage.StorageManager; import android.os.storage.VolumeInfo; import android.provider.Settings; +import android.system.ErrnoException; +import android.system.Os; +import android.system.OsConstants; +import android.system.StructStat; import android.util.ArrayMap; import android.util.IconDrawableFactory; import android.util.LauncherIcons; @@ -2662,4 +2666,78 @@ public class ApplicationPackageManager extends PackageManager { throw e.rethrowAsRuntimeException(); } } + + private static class DexModuleRegisterResult { + final String dexModulePath; + final boolean success; + final String message; + + private DexModuleRegisterResult(String dexModulePath, boolean success, String message) { + this.dexModulePath = dexModulePath; + this.success = success; + this.message = message; + } + } + + private static class DexModuleRegisterCallbackDelegate + extends android.content.pm.IDexModuleRegisterCallback.Stub + implements Handler.Callback { + private static final int MSG_DEX_MODULE_REGISTERED = 1; + private final DexModuleRegisterCallback callback; + private final Handler mHandler; + + DexModuleRegisterCallbackDelegate(@NonNull DexModuleRegisterCallback callback) { + this.callback = callback; + mHandler = new Handler(Looper.getMainLooper(), this); + } + + @Override + public void onDexModuleRegistered(@NonNull String dexModulePath, boolean success, + @Nullable String message)throws RemoteException { + mHandler.obtainMessage(MSG_DEX_MODULE_REGISTERED, + new DexModuleRegisterResult(dexModulePath, success, message)).sendToTarget(); + } + + @Override + public boolean handleMessage(Message msg) { + if (msg.what != MSG_DEX_MODULE_REGISTERED) { + return false; + } + DexModuleRegisterResult result = (DexModuleRegisterResult)msg.obj; + callback.onDexModuleRegistered(result.dexModulePath, result.success, result.message); + return true; + } + } + + @Override + public void registerDexModule(@NonNull String dexModule, + @Nullable DexModuleRegisterCallback callback) { + // Check if this is a shared module by looking if the others can read it. + boolean isSharedModule = false; + try { + StructStat stat = Os.stat(dexModule); + if ((OsConstants.S_IROTH & stat.st_mode) != 0) { + isSharedModule = true; + } + } catch (ErrnoException e) { + callback.onDexModuleRegistered(dexModule, false, + "Could not get stat the module file: " + e.getMessage()); + return; + } + + // Module path is ok. + // Create the callback delegate to be passed to package manager service. + DexModuleRegisterCallbackDelegate callbackDelegate = null; + if (callback != null) { + callbackDelegate = new DexModuleRegisterCallbackDelegate(callback); + } + + // Invoke the package manager service. + try { + mPM.registerDexModule(mContext.getPackageName(), dexModule, + isSharedModule, callbackDelegate); + } catch (RemoteException e) { + throw e.rethrowAsRuntimeException(); + } + } } diff --git a/core/java/android/content/pm/IDexModuleRegisterCallback.aidl b/core/java/android/content/pm/IDexModuleRegisterCallback.aidl new file mode 100644 index 000000000000..4af6999c09ba --- /dev/null +++ b/core/java/android/content/pm/IDexModuleRegisterCallback.aidl @@ -0,0 +1,28 @@ +/* +** Copyright 2017, The Android Open Source Project +** +** 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.content.pm; + +import android.os.Bundle; + +/** + * Callback for registering a dex module with the Package Manager. + * + * @hide + */ +oneway interface IDexModuleRegisterCallback { + void onDexModuleRegistered(in String dexModulePath, in boolean success, in String message); +} diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl index c7dd1fad4edc..77891fa84f78 100644 --- a/core/java/android/content/pm/IPackageManager.aidl +++ b/core/java/android/content/pm/IPackageManager.aidl @@ -25,6 +25,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.ChangedPackages; import android.content.pm.InstantAppInfo; import android.content.pm.FeatureInfo; +import android.content.pm.IDexModuleRegisterCallback; import android.content.pm.IPackageInstallObserver2; import android.content.pm.IPackageInstaller; import android.content.pm.IPackageDeleteObserver; @@ -473,6 +474,38 @@ interface IPackageManager { */ void notifyDexLoad(String loadingPackageName, in List dexPaths, String loaderIsa); + /** + * Register an application dex module with the package manager. + * The package manager will keep track of the given module for future optimizations. + * + * Dex module optimizations will disable the classpath checking at runtime. The client bares + * the responsibility to ensure that the static assumptions on classes in the optimized code + * hold at runtime (e.g. there's no duplicate classes in the classpath). + * + * Note that the package manager already keeps track of dex modules loaded with + * {@link dalvik.system.DexClassLoader} and {@link dalvik.system.PathClassLoader}. + * This can be called for an eager registration. + * + * The call might take a while and the results will be posted on the main thread, using + * the given callback. + * + * If the module is intended to be shared with other apps, make sure that the file + * permissions allow for it. + * If at registration time the permissions allow for others to read it, the module would + * be marked as a shared module which might undergo a different optimization strategy. + * (usually shared modules will generated larger optimizations artifacts, + * taking more disk space). + * + * @param packageName the package name to which the dex module belongs + * @param dexModulePath the absolute path of the dex module. + * @param isSharedModule whether or not the module is intended to be used by other apps. + * @param callback if not null, + * {@link android.content.pm.IDexModuleRegisterCallback.IDexModuleRegisterCallback#onDexModuleRegistered} + * will be called once the registration finishes. + */ + void registerDexModule(in String packageName, in String dexModulePath, + in boolean isSharedModule, IDexModuleRegisterCallback callback); + /** * Ask the package manager to perform a dex-opt for the given reason. The package * manager will map the reason to a compiler filter according to the current system diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index 10b7965c58ea..07125e035edc 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -5725,4 +5725,48 @@ public abstract class PackageManager { * @hide */ public abstract String getInstantAppAndroidId(String packageName, @NonNull UserHandle user); + + /** + * Callback use to notify the callers of module registration that the operation + * has finished. + * + * @hide + */ + @SystemApi + public static abstract class DexModuleRegisterCallback { + public abstract void onDexModuleRegistered(String dexModulePath, boolean success, + String message); + } + + /** + * Register an application dex module with the package manager. + * The package manager will keep track of the given module for future optimizations. + * + * Dex module optimizations will disable the classpath checking at runtime. The client bares + * the responsibility to ensure that the static assumptions on classes in the optimized code + * hold at runtime (e.g. there's no duplicate classes in the classpath). + * + * Note that the package manager already keeps track of dex modules loaded with + * {@link dalvik.system.DexClassLoader} and {@link dalvik.system.PathClassLoader}. + * This can be called for an eager registration. + * + * The call might take a while and the results will be posted on the main thread, using + * the given callback. + * + * If the module is intended to be shared with other apps, make sure that the file + * permissions allow for it. + * If at registration time the permissions allow for others to read it, the module would + * be marked as a shared module which might undergo a different optimization strategy. + * (usually shared modules will generated larger optimizations artifacts, + * taking more disk space). + * + * @param dexModulePath the absolute path of the dex module. + * @param callback if not null, {@link DexModuleRegisterCallback#onDexModuleRegistered} will + * be called once the registration finishes. + * + * @hide + */ + @SystemApi + public abstract void registerDexModule(String dexModulePath, + @Nullable DexModuleRegisterCallback callback); } diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java index 33a04939387a..698f2ec1c2f3 100644 --- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java +++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java @@ -36,6 +36,7 @@ import android.content.res.Resources; import android.content.res.Resources.NotFoundException; import android.net.Uri; import android.os.Binder; +import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.os.FileUtils; @@ -64,9 +65,14 @@ import android.util.Log; import com.android.frameworks.coretests.R; import com.android.internal.content.PackageHelper; +import dalvik.system.VMRuntime; + import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -78,9 +84,9 @@ public class PackageManagerTests extends AndroidTestCase { public static final String TAG = "PackageManagerTests"; - public final long MAX_WAIT_TIME = 25 * 1000; + public static final long MAX_WAIT_TIME = 25 * 1000; - public final long WAIT_TIME_INCR = 5 * 1000; + public static final long WAIT_TIME_INCR = 5 * 1000; private static final String SECURE_CONTAINERS_PREFIX = "/mnt/asec"; @@ -3861,6 +3867,117 @@ public class PackageManagerTests extends AndroidTestCase { PackageInfo.INSTALL_LOCATION_UNSPECIFIED); } + private static class TestDexModuleRegisterCallback + extends PackageManager.DexModuleRegisterCallback { + private String mDexModulePath = null; + private boolean mSuccess = false; + private String mMessage = null; + CountDownLatch doneSignal = new CountDownLatch(1); + + @Override + public void onDexModuleRegistered(String dexModulePath, boolean success, String message) { + mDexModulePath = dexModulePath; + mSuccess = success; + mMessage = message; + doneSignal.countDown(); + } + + boolean waitTillDone() { + long startTime = System.currentTimeMillis(); + while (System.currentTimeMillis() - startTime < MAX_WAIT_TIME) { + try { + return doneSignal.await(MAX_WAIT_TIME, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + Log.i(TAG, "Interrupted during sleep", e); + } + } + return false; + } + + } + + // Verify that the base code path cannot be registered. + public void testRegisterDexModuleBaseCode() throws Exception { + PackageManager pm = getPm(); + ApplicationInfo info = getContext().getApplicationInfo(); + TestDexModuleRegisterCallback callback = new TestDexModuleRegisterCallback(); + pm.registerDexModule(info.getBaseCodePath(), callback); + assertTrue(callback.waitTillDone()); + assertEquals(info.getBaseCodePath(), callback.mDexModulePath); + assertFalse("BaseCodePath should not be registered", callback.mSuccess); + } + + // Verify thatmodules which are not own by the calling package are not registered. + public void testRegisterDexModuleNotOwningModule() throws Exception { + TestDexModuleRegisterCallback callback = new TestDexModuleRegisterCallback(); + String moduleBelongingToOtherPackage = "/data/user/0/com.google.android.gms/module.apk"; + getPm().registerDexModule(moduleBelongingToOtherPackage, callback); + assertTrue(callback.waitTillDone()); + assertEquals(moduleBelongingToOtherPackage, callback.mDexModulePath); + assertTrue(callback.waitTillDone()); + assertFalse("Only modules belonging to the calling package can be registered", + callback.mSuccess); + } + + // Verify that modules owned by the package are successfully registered. + public void testRegisterDexModuleSuccessfully() throws Exception { + ApplicationInfo info = getContext().getApplicationInfo(); + // Copy the main apk into the data folder and use it as a "module". + File dexModuleDir = new File(info.dataDir, "module-dir"); + File dexModule = new File(dexModuleDir, "module.apk"); + try { + assertNotNull(FileUtils.createDir( + dexModuleDir.getParentFile(), dexModuleDir.getName())); + Files.copy(Paths.get(info.getBaseCodePath()), dexModule.toPath(), + StandardCopyOption.REPLACE_EXISTING); + TestDexModuleRegisterCallback callback = new TestDexModuleRegisterCallback(); + getPm().registerDexModule(dexModule.toString(), callback); + assertTrue(callback.waitTillDone()); + assertEquals(dexModule.toString(), callback.mDexModulePath); + assertTrue(callback.waitTillDone()); + assertTrue(callback.mMessage, callback.mSuccess); + + // NOTE: + // This actually verifies internal behaviour which might change. It's not + // ideal but it's the best we can do since there's no other place we can currently + // write a better test. + for(String isa : getAppDexInstructionSets(info)) { + Files.exists(Paths.get(dexModuleDir.toString(), "oat", isa, "module.odex")); + Files.exists(Paths.get(dexModuleDir.toString(), "oat", isa, "module.vdex")); + } + } finally { + FileUtils.deleteContentsAndDir(dexModuleDir); + } + } + + // If the module does not exist on disk we should get a failure. + public void testRegisterDexModuleNotExists() throws Exception { + ApplicationInfo info = getContext().getApplicationInfo(); + String nonExistentApk = Paths.get(info.dataDir, "non-existent.apk").toString(); + TestDexModuleRegisterCallback callback = new TestDexModuleRegisterCallback(); + getPm().registerDexModule(nonExistentApk, callback); + assertTrue(callback.waitTillDone()); + assertEquals(nonExistentApk, callback.mDexModulePath); + assertTrue(callback.waitTillDone()); + assertFalse("DexModule registration should fail", callback.mSuccess); + } + + // Copied from com.android.server.pm.InstructionSets because we don't have access to it here. + private static String[] getAppDexInstructionSets(ApplicationInfo info) { + if (info.primaryCpuAbi != null) { + if (info.secondaryCpuAbi != null) { + return new String[] { + VMRuntime.getInstructionSet(info.primaryCpuAbi), + VMRuntime.getInstructionSet(info.secondaryCpuAbi) }; + } else { + return new String[] { + VMRuntime.getInstructionSet(info.primaryCpuAbi) }; + } + } + + return new String[] { VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]) }; + } + /*---------- Recommended install location tests ----*/ /* * TODO's diff --git a/services/core/java/com/android/server/pm/InstructionSets.java b/services/core/java/com/android/server/pm/InstructionSets.java index 5092ebf9d4b9..f326f1d20c46 100644 --- a/services/core/java/com/android/server/pm/InstructionSets.java +++ b/services/core/java/com/android/server/pm/InstructionSets.java @@ -34,7 +34,7 @@ import dalvik.system.VMRuntime; */ public class InstructionSets { private static final String PREFERRED_INSTRUCTION_SET = - VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]);; + VMRuntime.getInstructionSet(Build.SUPPORTED_ABIS[0]); public static String[] getAppDexInstructionSets(ApplicationInfo info) { if (info.primaryCpuAbi != null) { if (info.secondaryCpuAbi != null) { diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 99b24e2c42e5..5eca40d143a4 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -127,6 +127,7 @@ import android.content.pm.ApplicationInfo; import android.content.pm.AppsQueryHelper; import android.content.pm.ChangedPackages; import android.content.pm.ComponentInfo; +import android.content.pm.IDexModuleRegisterCallback; import android.content.pm.InstantAppRequest; import android.content.pm.AuxiliaryResolveInfo; import android.content.pm.FallbackCategoryProvider; @@ -8614,6 +8615,31 @@ public class PackageManagerService extends IPackageManager.Stub mDexManager.notifyDexLoad(ai, dexPaths, loaderIsa, userId); } + @Override + public void registerDexModule(String packageName, String dexModulePath, boolean isSharedModule, + IDexModuleRegisterCallback callback) { + int userId = UserHandle.getCallingUserId(); + ApplicationInfo ai = getApplicationInfo(packageName, /*flags*/ 0, userId); + DexManager.RegisterDexModuleResult result; + if (ai == null) { + Slog.w(TAG, "Registering a dex module for a package that does not exist for the" + + " calling user. package=" + packageName + ", user=" + userId); + result = new DexManager.RegisterDexModuleResult(false, "Package not installed"); + } else { + result = mDexManager.registerDexModule(ai, dexModulePath, isSharedModule, userId); + } + + if (callback != null) { + mHandler.post(() -> { + try { + callback.onDexModuleRegistered(dexModulePath, result.success, result.message); + } catch (RemoteException e) { + Slog.w(TAG, "Failed to callback after module registration " + dexModulePath, e); + } + }); + } + } + @Override public boolean performDexOpt(String packageName, boolean checkProfiles, int compileReason, boolean force) { diff --git a/services/core/java/com/android/server/pm/dex/DexManager.java b/services/core/java/com/android/server/pm/dex/DexManager.java index 3d7cedce522a..4a8232da2b35 100644 --- a/services/core/java/com/android/server/pm/dex/DexManager.java +++ b/services/core/java/com/android/server/pm/dex/DexManager.java @@ -30,6 +30,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.server.pm.Installer; import com.android.server.pm.Installer.InstallerException; import com.android.server.pm.PackageDexOptimizer; +import com.android.server.pm.PackageManagerService; import com.android.server.pm.PackageManagerServiceUtils; import com.android.server.pm.PackageManagerServiceCompilerMapping; @@ -41,6 +42,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import static com.android.server.pm.InstructionSets.getAppDexInstructionSets; import static com.android.server.pm.dex.PackageDexUsage.PackageUseInfo; import static com.android.server.pm.dex.PackageDexUsage.DexUseInfo; @@ -431,6 +433,52 @@ public class DexManager { } } + public RegisterDexModuleResult registerDexModule(ApplicationInfo info, String dexPath, + boolean isUsedByOtherApps, int userId) { + // Find the owning package record. + DexSearchResult searchResult = getDexPackage(info, dexPath, userId); + + if (searchResult.mOutcome == DEX_SEARCH_NOT_FOUND) { + return new RegisterDexModuleResult(false, "Package not found"); + } + if (!info.packageName.equals(searchResult.mOwningPackageName)) { + return new RegisterDexModuleResult(false, "Dex path does not belong to package"); + } + if (searchResult.mOutcome == DEX_SEARCH_FOUND_PRIMARY || + searchResult.mOutcome == DEX_SEARCH_FOUND_SPLIT) { + return new RegisterDexModuleResult(false, "Main apks cannot be registered"); + } + + // We found the package. Now record the usage for all declared ISAs. + boolean update = false; + Set isas = new HashSet<>(); + for (String isa : getAppDexInstructionSets(info)) { + isas.add(isa); + boolean newUpdate = mPackageDexUsage.record(searchResult.mOwningPackageName, + dexPath, userId, isa, isUsedByOtherApps, /*primaryOrSplit*/ false); + update |= newUpdate; + } + if (update) { + mPackageDexUsage.maybeWriteAsync(); + } + + // Try to optimize the package according to the install reason. + String compilerFilter = PackageManagerServiceCompilerMapping.getCompilerFilterForReason( + PackageManagerService.REASON_INSTALL); + int result = mPackageDexOptimizer.dexOptSecondaryDexPath(info, dexPath, isas, + compilerFilter, isUsedByOtherApps); + + // If we fail to optimize the package log an error but don't propagate the error + // back to the app. The app cannot do much about it and the background job + // will rety again when it executes. + // TODO(calin): there might be some value to return the error here but it may + // cause red herrings since that doesn't mean the app cannot use the module. + if (result != PackageDexOptimizer.DEX_OPT_FAILED) { + Slog.e(TAG, "Failed to optimize dex module " + dexPath); + } + return new RegisterDexModuleResult(true, "Dex module registered successfully"); + } + /** * Return all packages that contain records of secondary dex files. */ @@ -510,6 +558,20 @@ public class DexManager { return existingValue == null ? newValue : existingValue; } + public static class RegisterDexModuleResult { + public RegisterDexModuleResult() { + this(false, null); + } + + public RegisterDexModuleResult(boolean success, String message) { + this.success = success; + this.message = message; + } + + public final boolean success; + public final String message; + } + /** * Convenience class to store the different locations where a package might * own code. @@ -589,6 +651,4 @@ public class DexManager { return mOwningPackageName + "-" + mOutcome; } } - - } diff --git a/test-runner/src/android/test/mock/MockPackageManager.java b/test-runner/src/android/test/mock/MockPackageManager.java index 2d3d79a03446..9a03c53d95cc 100644 --- a/test-runner/src/android/test/mock/MockPackageManager.java +++ b/test-runner/src/android/test/mock/MockPackageManager.java @@ -17,6 +17,7 @@ package android.test.mock; import android.annotation.NonNull; +import android.annotation.Nullable; import android.app.PackageInstallObserver; import android.content.ComponentName; import android.content.Intent; @@ -1159,4 +1160,13 @@ public class MockPackageManager extends PackageManager { public String getInstantAppAndroidId(String packageName, UserHandle user) { throw new UnsupportedOperationException(); } + + /** + * @hide + */ + @Override + public void registerDexModule(String dexModulePath, + @Nullable DexModuleRegisterCallback callback) { + throw new UnsupportedOperationException(); + } } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePackageManager.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePackageManager.java index 764eeebaef6a..47dad3404beb 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePackageManager.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgePackageManager.java @@ -949,4 +949,10 @@ public class BridgePackageManager extends PackageManager { public String getInstantAppAndroidId(String packageName, UserHandle user) { return null; } + + @Override + public void registerDexModule(String dexModulePath, + @Nullable DexModuleRegisterCallback callback) { + callback.onDexModuleRegistered(dexModulePath, false, null); + } } -- GitLab From bde7b4aa0f65301d46f58116b6e777fb1613edb0 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Fri, 28 Apr 2017 10:45:23 -0700 Subject: [PATCH 07/66] Change MANAGE_OWN_CALLS permission to be a "normal" permission. Also remove from Phone group since this isn't really related to phone calls as much as interacting with Telecom APIs. Test: Manual Bug: 37722558 Change-Id: Icc4d2170cc7c83f653eeb0438938f7c0c91a0a7c --- core/res/AndroidManifest.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index eacb02fa8364..f53ae7c14cfd 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -826,16 +826,6 @@ android:description="@string/permdesc_callPhone" android:protectionLevel="dangerous" /> - - - + -- GitLab From 598d24c55817cfbd00b6dafdf772334a7039fe3e Mon Sep 17 00:00:00 2001 From: Malcolm Chen Date: Mon, 24 Apr 2017 18:37:29 -0700 Subject: [PATCH 08/66] Move intents ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED, ACTION_DEFAULT_SUBSCRIPTION_CHANGED and EXTRA_SUBSCRIPTION_INDEX from Intent class to SubscriptionManager class. Bug: 37497166 Test: Manual Change-Id: Ifeedf974328cd3d839d7f66bf41a91c479d66316 --- api/current.txt | 6 ++-- api/system-current.txt | 6 ++-- api/test-current.txt | 6 ++-- core/java/android/content/Intent.java | 26 ----------------- core/res/AndroidManifest.xml | 4 +-- .../telephony/SubscriptionManager.java | 28 ++++++++++++++++++- .../internal/telephony/TelephonyIntents.java | 9 +++--- 7 files changed, 43 insertions(+), 42 deletions(-) diff --git a/api/current.txt b/api/current.txt index 307eb5cf4409..6b72cf8fd356 100644 --- a/api/current.txt +++ b/api/current.txt @@ -9337,8 +9337,6 @@ package android.content { field public static final java.lang.String ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT"; field public static final java.lang.String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED"; field public static final java.lang.String ACTION_DEFAULT = "android.intent.action.VIEW"; - field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED"; - field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DELETE = "android.intent.action.DELETE"; field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW"; field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK"; @@ -9541,7 +9539,6 @@ package android.content { field public static final java.lang.String EXTRA_SHUTDOWN_USERSPACE_ONLY = "android.intent.extra.SHUTDOWN_USERSPACE_ONLY"; field public static final java.lang.String EXTRA_STREAM = "android.intent.extra.STREAM"; field public static final java.lang.String EXTRA_SUBJECT = "android.intent.extra.SUBJECT"; - field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.intent.extra.SUBSCRIPTION_INDEX"; field public static final java.lang.String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE"; field public static final java.lang.String EXTRA_TEXT = "android.intent.extra.TEXT"; field public static final java.lang.String EXTRA_TITLE = "android.intent.extra.TITLE"; @@ -40083,8 +40080,11 @@ package android.telephony { method public static int getDefaultVoiceSubscriptionId(); method public boolean isNetworkRoaming(int); method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener); + field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED"; + field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED"; field public static final int DATA_ROAMING_DISABLE = 0; // 0x0 field public static final int DATA_ROAMING_ENABLE = 1; // 0x1 + field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX"; field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff } diff --git a/api/system-current.txt b/api/system-current.txt index d21dc2714baa..1455b76b17aa 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -9860,8 +9860,6 @@ package android.content { field public static final java.lang.String ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT"; field public static final java.lang.String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED"; field public static final java.lang.String ACTION_DEFAULT = "android.intent.action.VIEW"; - field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED"; - field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DELETE = "android.intent.action.DELETE"; field public static final deprecated java.lang.String ACTION_DEVICE_INITIALIZATION_WIZARD = "android.intent.action.DEVICE_INITIALIZATION_WIZARD"; field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW"; @@ -10113,7 +10111,6 @@ package android.content { field public static final java.lang.String EXTRA_SPLIT_NAME = "android.intent.extra.SPLIT_NAME"; field public static final java.lang.String EXTRA_STREAM = "android.intent.extra.STREAM"; field public static final java.lang.String EXTRA_SUBJECT = "android.intent.extra.SUBJECT"; - field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.intent.extra.SUBSCRIPTION_INDEX"; field public static final deprecated java.lang.String EXTRA_SYSTEM_ID = "systemId"; field public static final java.lang.String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE"; field public static final java.lang.String EXTRA_TEXT = "android.intent.extra.TEXT"; @@ -43562,8 +43559,11 @@ package android.telephony { method public static int getDefaultVoiceSubscriptionId(); method public boolean isNetworkRoaming(int); method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener); + field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED"; + field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED"; field public static final int DATA_ROAMING_DISABLE = 0; // 0x0 field public static final int DATA_ROAMING_ENABLE = 1; // 0x1 + field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX"; field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff } diff --git a/api/test-current.txt b/api/test-current.txt index 8896e16ec67e..a764bd0fa36d 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -9371,8 +9371,6 @@ package android.content { field public static final java.lang.String ACTION_CREATE_SHORTCUT = "android.intent.action.CREATE_SHORTCUT"; field public static final java.lang.String ACTION_DATE_CHANGED = "android.intent.action.DATE_CHANGED"; field public static final java.lang.String ACTION_DEFAULT = "android.intent.action.VIEW"; - field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED"; - field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED"; field public static final java.lang.String ACTION_DELETE = "android.intent.action.DELETE"; field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_LOW = "android.intent.action.DEVICE_STORAGE_LOW"; field public static final deprecated java.lang.String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK"; @@ -9575,7 +9573,6 @@ package android.content { field public static final java.lang.String EXTRA_SHUTDOWN_USERSPACE_ONLY = "android.intent.extra.SHUTDOWN_USERSPACE_ONLY"; field public static final java.lang.String EXTRA_STREAM = "android.intent.extra.STREAM"; field public static final java.lang.String EXTRA_SUBJECT = "android.intent.extra.SUBJECT"; - field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.intent.extra.SUBSCRIPTION_INDEX"; field public static final java.lang.String EXTRA_TEMPLATE = "android.intent.extra.TEMPLATE"; field public static final java.lang.String EXTRA_TEXT = "android.intent.extra.TEXT"; field public static final java.lang.String EXTRA_TITLE = "android.intent.extra.TITLE"; @@ -40278,8 +40275,11 @@ package android.telephony { method public static int getDefaultVoiceSubscriptionId(); method public boolean isNetworkRoaming(int); method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener); + field public static final java.lang.String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED"; + field public static final java.lang.String ACTION_DEFAULT_SUBSCRIPTION_CHANGED = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED"; field public static final int DATA_ROAMING_DISABLE = 0; // 0x0 field public static final int DATA_ROAMING_ENABLE = 1; // 0x1 + field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX"; field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff } diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index d74637784c57..4a3b2150adae 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -3389,32 +3389,6 @@ public class Intent implements Parcelable, Cloneable { public static final String ACTION_DYNAMIC_SENSOR_CHANGED = "android.intent.action.DYNAMIC_SENSOR_CHANGED"; - /** - * Broadcast Action: The default subscription has changed. This has the following - * extra values:

- * The {@link #EXTRA_SUBSCRIPTION_INDEX} extra indicates the current default subscription index - */ - @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) - public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED - = "android.intent.action.ACTION_DEFAULT_SUBSCRIPTION_CHANGED"; - - /** - * Broadcast Action: The default sms subscription has changed. This has the following - * extra values:

- * {@link #EXTRA_SUBSCRIPTION_INDEX} extra indicates the current default sms - * subscription index - */ - @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) - public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED - = "android.intent.action.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED"; - - /** - * Integer extra used with {@link #ACTION_DEFAULT_SUBSCRIPTION_CHANGED} and - * {@link #ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED} to indicate the subscription - * which has changed. - */ - public static final String EXTRA_SUBSCRIPTION_INDEX = "android.intent.extra.SUBSCRIPTION_INDEX"; - /** * Deprecated - use ACTION_FACTORY_RESET instead. * @hide diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index eacb02fa8364..0ed408aeb880 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -376,8 +376,6 @@ - - @@ -445,6 +443,8 @@ + + diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 81f660047c6b..7f616ad6fb08 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -342,6 +342,32 @@ public class SubscriptionManager { public static final String SUB_DEFAULT_CHANGED_ACTION = "android.intent.action.SUB_DEFAULT_CHANGED"; + /** + * Broadcast Action: The default subscription has changed. This has the following + * extra values:

+ * The {@link #EXTRA_SUBSCRIPTION_INDEX} extra indicates the current default subscription index + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED + = "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED"; + + /** + * Broadcast Action: The default sms subscription has changed. This has the following + * extra values:

+ * {@link #EXTRA_SUBSCRIPTION_INDEX} extra indicates the current default sms + * subscription index + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED + = "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED"; + + /** + * Integer extra used with {@link #ACTION_DEFAULT_SUBSCRIPTION_CHANGED} and + * {@link #ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED} to indicate the subscription + * which has changed. + */ + public static final String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX"; + private final Context mContext; /** @@ -1178,7 +1204,7 @@ public class SubscriptionManager { public static void putPhoneIdAndSubIdExtra(Intent intent, int phoneId, int subId) { if (VDBG) logd("putPhoneIdAndSubIdExtra: phoneId=" + phoneId + " subId=" + subId); intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId); - intent.putExtra(Intent.EXTRA_SUBSCRIPTION_INDEX, subId); + intent.putExtra(EXTRA_SUBSCRIPTION_INDEX, subId); intent.putExtra(PhoneConstants.PHONE_KEY, phoneId); //FIXME this is using phoneId and slotIndex interchangeably //Eventually, this should be removed as it is not the slot id diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java index ec9ca1d31eca..1f327667d301 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java +++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java @@ -17,6 +17,7 @@ package com.android.internal.telephony; import android.content.Intent; +import android.telephony.SubscriptionManager; /** * The intents that the telephony services broadcast. @@ -335,11 +336,11 @@ public class TelephonyIntents { *
    *
  • subscription - A int, the current default subscription.
  • *
- * @deprecated Use {@link Intent#ACTION_DEFAULT_SUBSCRIPTION_CHANGED} + * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SUBSCRIPTION_CHANGED} */ @Deprecated public static final String ACTION_DEFAULT_SUBSCRIPTION_CHANGED - = Intent.ACTION_DEFAULT_SUBSCRIPTION_CHANGED; + = SubscriptionManager.ACTION_DEFAULT_SUBSCRIPTION_CHANGED; /** * Broadcast Action: The default data subscription has changed. This has the following @@ -367,11 +368,11 @@ public class TelephonyIntents { *
    *
  • subscription - A int, the current sms default subscription.
  • *
- * @deprecated Use {@link Intent#ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED} + * @deprecated Use {@link SubscriptionManager#ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED} */ @Deprecated public static final String ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED - = Intent.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED; + = SubscriptionManager.ACTION_DEFAULT_SMS_SUBSCRIPTION_CHANGED; /* * Broadcast Action: An attempt to set phone radio type and access technology has changed. -- GitLab From 1660a27b5d682cbb0bd9e2ce66e5ca39d6ab7816 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Fri, 28 Apr 2017 15:53:59 -0400 Subject: [PATCH 09/66] Fix flaky test? - Fix testAttachDetach, process more messages so it actually does attach and detach - Don't inflate Clocks in QSFragmentTest because they are doing something weird... Test: runtest systemui Change-Id: I05360630ee8d96158b6ab36660f20588ad158a28 Fixes: 37773362 --- .../tests/src/com/android/systemui/qs/QSFragmentTest.java | 2 ++ tests/testables/src/android/testing/BaseFragmentTest.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java index 673ffc5d0fbf..d81224e8507d 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/qs/QSFragmentTest.java @@ -32,6 +32,7 @@ import android.testing.AndroidTestingRunner; import com.android.systemui.SysuiBaseFragmentTest; import com.android.systemui.statusbar.phone.StatusBarIconController; +import com.android.systemui.statusbar.policy.Clock; import com.android.systemui.statusbar.policy.UserSwitcherController; import android.testing.LayoutInflaterBuilder; import android.testing.TestableLooper; @@ -64,6 +65,7 @@ public class QSFragmentTest extends SysuiBaseFragmentTest { FrameLayout.class) .replace("TextClock", View.class) .replace(CarrierText.class, View.class) + .replace(Clock.class, View.class) .build()); mDependency.injectTestDependency(Dependency.BG_LOOPER, diff --git a/tests/testables/src/android/testing/BaseFragmentTest.java b/tests/testables/src/android/testing/BaseFragmentTest.java index b09bcde897d7..32ee091a46c9 100644 --- a/tests/testables/src/android/testing/BaseFragmentTest.java +++ b/tests/testables/src/android/testing/BaseFragmentTest.java @@ -161,12 +161,12 @@ public abstract class BaseFragmentTest { protected void attachFragmentToWindow() { ViewUtils.attachView(mView); - TestableLooper.get(this).processMessages(1); + TestableLooper.get(this).processAllMessages(); } protected void detachFragmentToWindow() { ViewUtils.detachView(mView); - TestableLooper.get(this).processMessages(1); + TestableLooper.get(this).processAllMessages(); } protected void destroyFragments() { -- GitLab From 34488242f889d4d5889a38f796633b0d1c8b5541 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 26 Apr 2017 15:53:51 -0700 Subject: [PATCH 10/66] Fix issue with double tapping PiP - This is only an issue when double tapping while the menu is visible in the initial close state. The problem was that in a double tap, the first tap could trigger a move as the activity is actively resized, which triggers the input consumer to be re-registered. Then the subsequent tap will trigger an unexpected expand on touch up, which then can conflict when the menu gets resized down to the unexpanded state. For now, when expanding to/from the expanded state, disallow touches until after the animation ends, like we do in the input consumer touch handler. Bug: 37657050 Test: Double tap the PIP when it is unexpanded, ensure that it expands Change-Id: Ib68bcb80a54a801181f02ff73e7188678a26dd9b --- .../com/android/systemui/pip/phone/PipManager.java | 1 + .../android/systemui/pip/phone/PipMenuActivity.java | 13 +++++++++++++ .../pip/phone/PipMenuActivityController.java | 13 +++++++++++++ 3 files changed, 27 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java index 28bd23ce9825..df03fdc46d06 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipManager.java @@ -103,6 +103,7 @@ public class PipManager implements BasePipManager { // Re-enable touches after the animation completes mTouchHandler.setTouchEnabled(true); mTouchHandler.onPinnedStackAnimationEnded(); + mMenuController.onPinnedStackAnimationEnded(); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java index 79ac8160c095..80305a5adc02 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java @@ -80,6 +80,7 @@ public class PipMenuActivity extends Activity { public static final int MESSAGE_HIDE_MENU = 3; public static final int MESSAGE_UPDATE_ACTIONS = 4; public static final int MESSAGE_UPDATE_DISMISS_FRACTION = 5; + public static final int MESSAGE_ANIMATION_ENDED = 6; private static final long INITIAL_DISMISS_DELAY = 3500; private static final long POST_INTERACTION_DISMISS_DELAY = 2000; @@ -92,6 +93,7 @@ public class PipMenuActivity extends Activity { private int mMenuState; private boolean mAllowMenuTimeout = true; + private boolean mAllowTouches = true; private final List mActions = new ArrayList<>(); @@ -149,6 +151,10 @@ public class PipMenuActivity extends Activity { updateDismissFraction(data.getFloat(EXTRA_DISMISS_FRACTION)); break; } + case MESSAGE_ANIMATION_ENDED: { + mAllowTouches = true; + break; + } } } }); @@ -245,6 +251,10 @@ public class PipMenuActivity extends Activity { @Override public boolean dispatchTouchEvent(MotionEvent ev) { + if (!mAllowTouches) { + return super.dispatchTouchEvent(ev); + } + // On the first action outside the window, hide the menu switch (ev.getAction()) { case MotionEvent.ACTION_OUTSIDE: @@ -284,6 +294,9 @@ public class PipMenuActivity extends Activity { boolean allowMenuTimeout) { mAllowMenuTimeout = allowMenuTimeout; if (mMenuState != menuState) { + boolean deferTouchesUntilAnimationEnds = (mMenuState == MENU_STATE_FULL) || + (menuState == MENU_STATE_FULL); + mAllowTouches = !deferTouchesUntilAnimationEnds; cancelDelayedFinish(); updateActionViews(stackBounds); if (mMenuContainerAnimator != null) { diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java index c41f898ef4fe..d5cf1dd0387d 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivityController.java @@ -197,6 +197,19 @@ public class PipMenuActivityController { } } + public void onPinnedStackAnimationEnded() { + // Note: Only active menu activities care about this event + if (mToActivityMessenger != null) { + Message m = Message.obtain(); + m.what = PipMenuActivity.MESSAGE_ANIMATION_ENDED; + try { + mToActivityMessenger.send(m); + } catch (RemoteException e) { + Log.e(TAG, "Could not notify menu pinned animation ended", e); + } + } + } + /** * Adds a new menu activity listener. */ -- GitLab From 10682305f0c14cdda8bca3d516fe4bde9e477bad Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Fri, 28 Apr 2017 13:34:11 -0700 Subject: [PATCH 11/66] Move ColorSpace#Renderer tests to APCT Bug: 37779858 Test: adb install -r ${ANDROID_PRODUCT_OUT}/data/app/FrameworksCoreTests/FrameworksCoreTests.apk && adb shell am instrument -w -e class android.graphics.ColorSpaceRendererTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner Change-Id: I2888cdc8f4912721fdfcbbe5861f260781d165aa --- .../graphics/ColorSpaceRendererTest.java | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 core/tests/coretests/src/android/graphics/ColorSpaceRendererTest.java diff --git a/core/tests/coretests/src/android/graphics/ColorSpaceRendererTest.java b/core/tests/coretests/src/android/graphics/ColorSpaceRendererTest.java new file mode 100644 index 000000000000..6e38fb685887 --- /dev/null +++ b/core/tests/coretests/src/android/graphics/ColorSpaceRendererTest.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * 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.graphics; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; + +import android.support.test.filters.SmallTest; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +@SmallTest +@RunWith(AndroidJUnit4.class) +public class ColorSpaceRendererTest { + + @Test + public void testRendererSize() { + Bitmap b = ColorSpace.createRenderer() + .size(0) + .render(); + assertEquals(128, b.getWidth()); + assertEquals(128, b.getHeight()); + + b = ColorSpace.createRenderer() + .size(768) + .render(); + assertEquals(768, b.getWidth()); + assertEquals(768, b.getHeight()); + } + + @Test + public void testRenderer() { + Bitmap b = ColorSpace.createRenderer() + .size(1024) + .clip(true) + .showWhitePoint(false) + .add(ColorSpace.get(ColorSpace.Named.SRGB), 0xffffffff) + .add(ColorSpace.get(ColorSpace.Named.DCI_P3), 0xffffffff) + .add(ColorSpace.get(ColorSpace.Named.PRO_PHOTO_RGB), 0.1f, 0.5f, 0.1f, 0xff000000) + .add(ColorSpace.get(ColorSpace.Named.ADOBE_RGB), 0.1f, 0.5f, 0.1f, 0xff000000) + .render(); + assertNotNull(b); + } + + @Test + public void testUcsRenderer() { + Bitmap b = ColorSpace.createRenderer() + .size(1024) + .clip(true) + .showWhitePoint(false) + .uniformChromaticityScale(true) + .add(ColorSpace.get(ColorSpace.Named.SRGB), 0xffffffff) + .add(ColorSpace.get(ColorSpace.Named.DCI_P3), 0xffffffff) + .add(ColorSpace.get(ColorSpace.Named.PRO_PHOTO_RGB), 0.1f, 0.5f, 0.1f, 0xff000000) + .add(ColorSpace.get(ColorSpace.Named.ADOBE_RGB), 0.1f, 0.5f, 0.1f, 0xff000000) + .render(); + assertNotNull(b); + } +} -- GitLab From e48b7d815969f77aba56cafd3b580c259ca9af4f Mon Sep 17 00:00:00 2001 From: Andrii Kulian Date: Fri, 28 Apr 2017 14:51:05 -0700 Subject: [PATCH 12/66] Set stack bounds to null instead of empty for fullscreen When dragging docked stack divider we evaluate how other stack bounds should change. For non-resizeable launchers computed rect is empty, so we should send null to resize call instead which corresponds to fullscreen. Change-Id: Ie005be2b9872181e31529b592211423049e4ef09 Fixes: 37752990 Test: Drag the divider with non-resizeable launcher. --- .../java/com/android/server/am/ActivityStackSupervisor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index dfeff522fb48..8d57265ab3d4 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -2503,7 +2503,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D tempRect /* outStackBounds */, otherTaskRect /* outTempTaskBounds */, true /* ignoreVisibility */); - resizeStackLocked(i, tempRect, + resizeStackLocked(i, !tempRect.isEmpty() ? tempRect : null, !otherTaskRect.isEmpty() ? otherTaskRect : tempOtherTaskBounds, tempOtherTaskInsetBounds, preserveWindows, true /* allowResizeInDockedMode */, deferResume); -- GitLab From d2afdab226dcff7cfc3fb26ef0a7030edb17b925 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Wed, 26 Apr 2017 10:41:28 -0700 Subject: [PATCH 13/66] Add @TestApi annotation to AdaptiveIconDrawable Bug: 37779858 Bug: 37788590 Test: $ make -j31 Test: $ make update-api -j31 Change-Id: I459317e8b9f6db227a4bb567c17b212639454e9d --- api/current.txt | 1 + api/system-current.txt | 1 + api/test-current.txt | 2 ++ .../java/android/graphics/drawable/AdaptiveIconDrawable.java | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index 5b7f457abb8b..20873c6f0b38 100644 --- a/api/current.txt +++ b/api/current.txt @@ -13836,6 +13836,7 @@ package android.graphics { package android.graphics.drawable { public class AdaptiveIconDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback { + ctor public AdaptiveIconDrawable(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable); method public void draw(android.graphics.Canvas); method public android.graphics.drawable.Drawable getBackground(); method public static float getExtraInsetFraction(); diff --git a/api/system-current.txt b/api/system-current.txt index 921a97dfa8f1..f9a2f34aa063 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -14611,6 +14611,7 @@ package android.graphics { package android.graphics.drawable { public class AdaptiveIconDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback { + ctor public AdaptiveIconDrawable(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable); method public void draw(android.graphics.Canvas); method public android.graphics.drawable.Drawable getBackground(); method public static float getExtraInsetFraction(); diff --git a/api/test-current.txt b/api/test-current.txt index 75ddd8d2b63d..666b78a6240a 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -13878,6 +13878,7 @@ package android.graphics { package android.graphics.drawable { public class AdaptiveIconDrawable extends android.graphics.drawable.Drawable implements android.graphics.drawable.Drawable.Callback { + ctor public AdaptiveIconDrawable(android.graphics.drawable.Drawable, android.graphics.drawable.Drawable); method public void draw(android.graphics.Canvas); method public android.graphics.drawable.Drawable getBackground(); method public static float getExtraInsetFraction(); @@ -13891,6 +13892,7 @@ package android.graphics.drawable { method public void setColorFilter(android.graphics.ColorFilter); method public void setOpacity(int); method public void unscheduleDrawable(android.graphics.drawable.Drawable, java.lang.Runnable); + field public static final float MASK_SIZE = 100.0f; } public abstract interface Animatable { diff --git a/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java index ffadad9d68c5..ab10e978b0f7 100644 --- a/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java +++ b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java @@ -78,6 +78,7 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback * Mask path is defined inside device configuration in following dimension: [100 x 100] * @hide */ + @TestApi public static final float MASK_SIZE = 100f; /** @@ -179,7 +180,6 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback * * @param backgroundDrawable drawable that should be rendered in the background * @param foregroundDrawable drawable that should be rendered in the foreground - * @hide */ public AdaptiveIconDrawable(Drawable backgroundDrawable, Drawable foregroundDrawable) { -- GitLab From d61a19e533bf05f2bf8cb4b3b3d01d3a224a19a0 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 28 Apr 2017 16:36:51 -0700 Subject: [PATCH 14/66] Ensure that the action views are always updated. - Fixes issue where a disable action was never re-enabled. Bug: 37786353 Test: Launch YT, ensure that all actions work after skipping video. Change-Id: I4be0c70034a3fed6ffb7625a159c906761312fb7 --- .../src/com/android/systemui/pip/phone/PipMenuActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java index 80305a5adc02..65f24cf5ba98 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java +++ b/packages/SystemUI/src/com/android/systemui/pip/phone/PipMenuActivity.java @@ -460,8 +460,8 @@ public class PipMenuActivity extends Activity { }); } else { actionView.setAlpha(DISABLED_ACTION_ALPHA); - actionView.setEnabled(false); } + actionView.setEnabled(action.isEnabled()); // Update the margin between actions LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) -- GitLab From 138f034377096b32713fa161a4d78a7221c32a93 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Fri, 28 Apr 2017 09:11:28 -0700 Subject: [PATCH 15/66] AOD: Increase shelf icon size while dark Bug: 37640299 Test: Trigger ambient display, observe that shelf icons are 20dp Change-Id: Ib096cac8c217d5296e60ef7894831f560f26c22a --- packages/SystemUI/res/values/dimens.xml | 3 ++ .../systemui/statusbar/StatusBarIconView.java | 32 ++++++++++++++----- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index cdb5af92c0c8..f0728491bd72 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -130,6 +130,9 @@ 17dp + + @*android:dimen/notification_header_icon_size_ambient + 90% diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java index 263df79318ea..c7fbbf956c68 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarIconView.java @@ -89,6 +89,9 @@ public class StatusBarIconView extends AnimatedImageView { }; private boolean mAlwaysScaleIcon; + private int mStatusBarIconDrawingSizeDark = 1; + private int mStatusBarIconDrawingSize = 1; + private int mStatusBarIconSize = 1; private StatusBarIcon mIcon; @ViewDebug.ExportedProperty private String mSlot; private Drawable mNumberBackground; @@ -139,7 +142,7 @@ public class StatusBarIconView extends AnimatedImageView { mNumberPain.setColor(context.getColor(R.drawable.notification_number_text_color)); mNumberPain.setAntiAlias(true); setNotification(notification); - maybeUpdateIconScale(); + maybeUpdateIconScaleDimens(); setScaleType(ScaleType.CENTER); mDensity = context.getResources().getDisplayMetrics().densityDpi; if (mNotification != null) { @@ -149,18 +152,30 @@ public class StatusBarIconView extends AnimatedImageView { reloadDimens(); } - private void maybeUpdateIconScale() { + private void maybeUpdateIconScaleDimens() { // We do not resize and scale system icons (on the right), only notification icons (on the // left). if (mNotification != null || mAlwaysScaleIcon) { - updateIconScale(); + updateIconScaleDimens(); } } - private void updateIconScale() { + private void updateIconScaleDimens() { Resources res = mContext.getResources(); - final int outerBounds = res.getDimensionPixelSize(R.dimen.status_bar_icon_size); - final int imageBounds = res.getDimensionPixelSize(R.dimen.status_bar_icon_drawing_size); + mStatusBarIconSize = res.getDimensionPixelSize(R.dimen.status_bar_icon_size); + mStatusBarIconDrawingSizeDark = + res.getDimensionPixelSize(R.dimen.status_bar_icon_drawing_size_dark); + mStatusBarIconDrawingSize = + res.getDimensionPixelSize(R.dimen.status_bar_icon_drawing_size); + updateIconScale(); + } + + private void updateIconScale() { + final float imageBounds = NotificationUtils.interpolate( + mStatusBarIconDrawingSize, + mStatusBarIconDrawingSizeDark, + mDarkAmount); + final int outerBounds = mStatusBarIconSize; mIconScale = (float)imageBounds / (float)outerBounds; } @@ -174,7 +189,7 @@ public class StatusBarIconView extends AnimatedImageView { int density = newConfig.densityDpi; if (density != mDensity) { mDensity = density; - maybeUpdateIconScale(); + maybeUpdateIconScaleDimens(); updateDrawable(); reloadDimens(); } @@ -198,7 +213,7 @@ public class StatusBarIconView extends AnimatedImageView { mDozer = new NotificationIconDozeHelper(context); mBlocked = false; mAlwaysScaleIcon = true; - updateIconScale(); + updateIconScaleDimens(); mDensity = context.getResources().getDisplayMetrics().densityDpi; } @@ -681,6 +696,7 @@ public class StatusBarIconView extends AnimatedImageView { public void setDark(boolean dark, boolean fade, long delay) { mDozer.setIntensityDark(f -> { mDarkAmount = f; + updateIconScale(); updateDecorColor(); updateIconColor(); }, dark, fade, delay); -- GitLab From 2402943ae56dab7ea1387780bfdc565dd9a8e9b2 Mon Sep 17 00:00:00 2001 From: Casey Burkhardt Date: Fri, 28 Apr 2017 17:09:57 -0700 Subject: [PATCH 16/66] Fix accessibility button CTS test Ensure accessibility button callbacks are registered with a Handler that has a valid Looper. Bug: 37789861 Test: Passing CTS Change-Id: Idf91547940fe7754bbabe55a729193c4100b8532 --- .../accessibilityservice/AccessibilityButtonController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/android/accessibilityservice/AccessibilityButtonController.java b/core/java/android/accessibilityservice/AccessibilityButtonController.java index ee1976889299..a70085cbde4f 100644 --- a/core/java/android/accessibilityservice/AccessibilityButtonController.java +++ b/core/java/android/accessibilityservice/AccessibilityButtonController.java @@ -19,6 +19,7 @@ package android.accessibilityservice; import android.annotation.NonNull; import android.annotation.Nullable; import android.os.Handler; +import android.os.Looper; import android.os.RemoteException; import android.util.ArrayMap; import android.util.Slog; @@ -91,7 +92,7 @@ public final class AccessibilityButtonController { * @param callback the callback to add, must be non-null */ public void registerAccessibilityButtonCallback(@NonNull AccessibilityButtonCallback callback) { - registerAccessibilityButtonCallback(callback, new Handler()); + registerAccessibilityButtonCallback(callback, new Handler(Looper.getMainLooper())); } /** -- GitLab From eb4b2d056cd905b4b6ca0c985131c102f2254a45 Mon Sep 17 00:00:00 2001 From: Martijn Coenen Date: Fri, 28 Apr 2017 17:05:29 -0700 Subject: [PATCH 17/66] Increase max system_server hwbinder threadpool to 5. system_server hosts HIDL services, but also many different callback interfaces. Subtle deadlocks can occur if there's only one HwBinder thread to handle incoming transactions. Increasing this to 5 threads seems reasonable - we haven't really seen any performance issues due to this. The main danger with this change is that not all callback interfaces may be written in a thread-safe way, but some quick testing revealed no issues. Bug: 37531523 Bug: 37509431 Test: builds, Maps/YouTube/Camera/Music/Netflix Change-Id: I52bff2f2263625c1a33f60b8b27c307c1d31000c --- services/core/jni/com_android_server_SystemServer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/jni/com_android_server_SystemServer.cpp b/services/core/jni/com_android_server_SystemServer.cpp index 4a08ce4aebb7..96c2d7e38232 100644 --- a/services/core/jni/com_android_server_SystemServer.cpp +++ b/services/core/jni/com_android_server_SystemServer.cpp @@ -48,7 +48,7 @@ static void android_server_SystemServer_startHidlServices(JNIEnv* /* env */, job status_t err; - configureRpcThreadpool(1, false /* callerWillJoin */); + configureRpcThreadpool(5, false /* callerWillJoin */); sp sensorService = new SensorManager(); err = sensorService->registerAsService(); -- GitLab From a6830e748dff42e91b73873fcc46d4ac5647a321 Mon Sep 17 00:00:00 2001 From: Chad Brubaker Date: Fri, 28 Apr 2017 17:34:36 -0700 Subject: [PATCH 18/66] Revert "Allow Instant Apps to read Settings defined by apps" This reverts commit 7e794b7d22ab38713f0af9e6dabb127725f9d4c3. Bug: 37765840 Test: builds --- .../providers/settings/SettingsProvider.java | 38 ++++++------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index a6347c67efd8..48429e8b2b05 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -898,14 +898,13 @@ public class SettingsProvider extends ContentProvider { Slog.v(LOG_TAG, "getGlobalSetting(" + name + ")"); } + // Ensure the caller can access the setting. + enforceSettingReadable(name, SETTINGS_TYPE_GLOBAL, UserHandle.getCallingUserId()); + // Get the value. synchronized (mLock) { - Setting setting = mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_GLOBAL, + return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_GLOBAL, UserHandle.USER_SYSTEM, name); - // Ensure the caller can access the setting before we return it. - enforceSettingReadable(setting, name, SETTINGS_TYPE_GLOBAL, - UserHandle.getCallingUserId()); - return setting; } } @@ -1063,6 +1062,9 @@ public class SettingsProvider extends ContentProvider { // Resolve the userId on whose behalf the call is made. final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId); + // Ensure the caller can access the setting. + enforceSettingReadable(name, SETTINGS_TYPE_SECURE, UserHandle.getCallingUserId()); + // Determine the owning user as some profile settings are cloned from the parent. final int owningUserId = resolveOwningUserIdForSecureSettingLocked(callingUserId, name); @@ -1076,7 +1078,6 @@ public class SettingsProvider extends ContentProvider { // As of Android O, the SSAID is read from an app-specific entry in table // SETTINGS_FILE_SSAID, unless accessed by a system process. - // All apps are allowed to access their SSAID, so we skip the permission check. if (isNewSsaidSetting(name)) { PackageInfo callingPkg = getCallingPackageInfo(owningUserId); synchronized (mLock) { @@ -1086,12 +1087,8 @@ public class SettingsProvider extends ContentProvider { // Not the SSAID; do a straight lookup synchronized (mLock) { - Setting setting = mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SECURE, + return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SECURE, owningUserId, name); - // Ensure the caller can access the setting before we return it. - enforceSettingReadable(setting, name, SETTINGS_TYPE_SECURE, - UserHandle.getCallingUserId()); - return setting; } } @@ -1292,18 +1289,15 @@ public class SettingsProvider extends ContentProvider { // Resolve the userId on whose behalf the call is made. final int callingUserId = resolveCallingUserIdEnforcingPermissionsLocked(requestingUserId); + // Ensure the caller can access the setting. + enforceSettingReadable(name, SETTINGS_TYPE_SYSTEM, UserHandle.getCallingUserId()); // Determine the owning user as some profile settings are cloned from the parent. final int owningUserId = resolveOwningUserIdForSystemSettingLocked(callingUserId, name); // Get the value. synchronized (mLock) { - Setting setting = mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SYSTEM, - owningUserId, name); - // Ensure the caller can access the setting before we return it. - enforceSettingReadable(setting, name, SETTINGS_TYPE_SYSTEM, - UserHandle.getCallingUserId()); - return setting; + return mSettingsRegistry.getSettingLocked(SETTINGS_TYPE_SYSTEM, owningUserId, name); } } @@ -1650,22 +1644,14 @@ public class SettingsProvider extends ContentProvider { } } - private void enforceSettingReadable(Setting setting, String settingName, int settingsType, - int userId) { + private void enforceSettingReadable(String settingName, int settingsType, int userId) { if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { return; } ApplicationInfo ai = getCallingApplicationInfoOrThrow(); - // Installed apps are allowed to read all settings. if (!ai.isInstantApp()) { return; } - // Instant Apps are allowed to read settings defined by applications. - // TODO: Replace this with an API that allows the setting application to say if a setting - // shoud/shouldn't be accessible. - if (!setting.isDefaultFromSystem()) { - return; - } if (!getInstantAppAccessibleSettings(settingsType).contains(settingName)) { throw new SecurityException("Setting " + settingName + " is not accessible from" + " ephemeral package " + getCallingPackage()); -- GitLab From 2ee60cefcc47b0b90c6bb20cf4d1f4c8dab0c647 Mon Sep 17 00:00:00 2001 From: jiabin Date: Mon, 24 Apr 2017 17:03:42 -0700 Subject: [PATCH 19/66] Add parameter for accessing channels from 3rd-party TV apps. Test: runtest --path packages/providers/TvProvider/tests Bug: 37576643 Change-Id: Iff797d4cdc9e0a4115d44c4de732f241a9a9f878 --- media/java/android/media/tv/TvContract.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/media/java/android/media/tv/TvContract.java b/media/java/android/media/tv/TvContract.java index 71f9ba257aa3..8678860e1b94 100644 --- a/media/java/android/media/tv/TvContract.java +++ b/media/java/android/media/tv/TvContract.java @@ -429,7 +429,7 @@ public final class TvContract { public static final String PARAM_BROWSABLE_ONLY = "browsable_only"; /** - * A optional query, update or delete URI parameter that allows the caller to specify canonical + * An optional query, update or delete URI parameter that allows the caller to specify canonical * genre to filter programs. * @hide */ @@ -443,6 +443,13 @@ public final class TvContract { */ public static final String PARAM_PREVIEW = "preview"; + /** + * An optional query, update or delete URI parameter that allows the caller to specify package + * name to filter channels. + * @hide + */ + public static final String PARAM_PACKAGE = "package"; + /** * Builds an ID that uniquely identifies a TV input service. * -- GitLab From 20e0dc38628875408e7f0e7f4f0e4c47088792d9 Mon Sep 17 00:00:00 2001 From: Chad Brubaker Date: Fri, 28 Apr 2017 18:24:55 -0700 Subject: [PATCH 20/66] Add overlay for Instant Apps Settings whitelists Some non-platform settings may need to be exposed to Instant Apps. To enable that config_allowed{Global,System,Secure}InstantAppSettings has been added to supplement the hardcoded platform whitelist in Settings. Bug: 37765840 Test: Run instant app from b/37765840 Change-Id: Ie1e9c645068db1d3d961d2f597c6ee2dfa158843 --- core/res/res/values/config.xml | 9 +++++ core/res/res/values/symbols.xml | 4 ++ .../providers/settings/SettingsProvider.java | 37 ++++++++++++++++++- 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 0fa1fdb3e844..a921fd740b7e 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2863,4 +2863,13 @@ + + + + + + + + + diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 0ea9b3961979..60677f5212e5 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -2996,4 +2996,8 @@ + + + + diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 48429e8b2b05..4b304b2353b3 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -35,6 +35,7 @@ import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.pm.UserInfo; +import android.content.res.Resources; import android.database.Cursor; import android.database.MatrixCursor; import android.database.sqlite.SQLiteDatabase; @@ -185,6 +186,26 @@ public class SettingsProvider extends ContentProvider { private static final Bundle NULL_SETTING_BUNDLE = Bundle.forPair( Settings.NameValueTable.VALUE, null); + // Overlay specified settings whitelisted for Instant Apps + private static final Set OVERLAY_ALLOWED_GLOBAL_INSTANT_APP_SETTINGS = new ArraySet<>(); + private static final Set OVERLAY_ALLOWED_SYSTEM_INSTANT_APP_SETTINGS = new ArraySet<>(); + private static final Set OVERLAY_ALLOWED_SECURE_INSTANT_APP_SETTINGS = new ArraySet<>(); + + static { + for (String name : Resources.getSystem().getStringArray( + com.android.internal.R.array.config_allowedGlobalInstantAppSettings)) { + OVERLAY_ALLOWED_GLOBAL_INSTANT_APP_SETTINGS.add(name); + } + for (String name : Resources.getSystem().getStringArray( + com.android.internal.R.array.config_allowedSystemInstantAppSettings)) { + OVERLAY_ALLOWED_SYSTEM_INSTANT_APP_SETTINGS.add(name); + } + for (String name : Resources.getSystem().getStringArray( + com.android.internal.R.array.config_allowedSecureInstantAppSettings)) { + OVERLAY_ALLOWED_SECURE_INSTANT_APP_SETTINGS.add(name); + } + } + // Changes to these global settings are synchronously persisted private static final Set CRITICAL_GLOBAL_SETTINGS = new ArraySet<>(); static { @@ -1629,6 +1650,19 @@ public class SettingsProvider extends ContentProvider { } } + private Set getOverlayInstantAppAccessibleSettings(int settingsType) { + switch (settingsType) { + case SETTINGS_TYPE_GLOBAL: + return OVERLAY_ALLOWED_GLOBAL_INSTANT_APP_SETTINGS; + case SETTINGS_TYPE_SYSTEM: + return OVERLAY_ALLOWED_SYSTEM_INSTANT_APP_SETTINGS; + case SETTINGS_TYPE_SECURE: + return OVERLAY_ALLOWED_SECURE_INSTANT_APP_SETTINGS; + default: + throw new IllegalArgumentException("Invalid settings type: " + settingsType); + } + } + private List getSettingsNamesLocked(int settingsType, int userId) { boolean instantApp; if (UserHandle.getAppId(Binder.getCallingUid()) < Process.FIRST_APPLICATION_UID) { @@ -1652,7 +1686,8 @@ public class SettingsProvider extends ContentProvider { if (!ai.isInstantApp()) { return; } - if (!getInstantAppAccessibleSettings(settingsType).contains(settingName)) { + if (!getInstantAppAccessibleSettings(settingsType).contains(settingName) + && !getOverlayInstantAppAccessibleSettings(settingsType).contains(settingName)) { throw new SecurityException("Setting " + settingName + " is not accessible from" + " ephemeral package " + getCallingPackage()); } -- GitLab From e8ea7f610d30b903e393e92776677f489b3cc8b4 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 28 Apr 2017 19:22:17 -0700 Subject: [PATCH 21/66] Fixed that snooze options were animating Right after inflation, they would animate. Test: manual Change-Id: I347bcb5a9e483da7e315a83c2a05c6afc2ef3fed Fixes: 37796113 --- .../android/systemui/statusbar/NotificationSnooze.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java index ccc99c59e510..8b3d6d9b7021 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationSnooze.java @@ -145,13 +145,15 @@ public class NotificationSnooze extends LinearLayout } private void showSnoozeOptions(boolean show) { - mExpanded = show; - animateSnoozeOptions(show); int drawableId = show ? com.android.internal.R.drawable.ic_collapse_notification : com.android.internal.R.drawable.ic_expand_notification; mExpandButton.setImageResource(drawableId); - if (mGutsContainer != null) { - mGutsContainer.onHeightChanged(); + if (mExpanded != show) { + mExpanded = show; + animateSnoozeOptions(show); + if (mGutsContainer != null) { + mGutsContainer.onHeightChanged(); + } } } -- GitLab From cb75b5454b54f7d443f1552adb7813ca139d22e3 Mon Sep 17 00:00:00 2001 From: Saige McVea Date: Fri, 28 Apr 2017 20:30:25 -0700 Subject: [PATCH 22/66] Change String to CharSequence in #loadSummary. Per API council review, localized strings should return CharSequence. Also updated doc. Test: ag/1813674 Bug: 37723508 Change-Id: I5ae868c2dda64d3756ad477578c65708242fde8c --- api/current.txt | 2 +- api/system-current.txt | 2 +- api/test-current.txt | 2 +- .../accessibilityservice/AccessibilityServiceInfo.java | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/current.txt b/api/current.txt index da601e1519a8..535f63745dc1 100644 --- a/api/current.txt +++ b/api/current.txt @@ -2830,7 +2830,7 @@ package android.accessibilityservice { method public android.content.pm.ResolveInfo getResolveInfo(); method public java.lang.String getSettingsActivityName(); method public java.lang.String loadDescription(android.content.pm.PackageManager); - method public java.lang.String loadSummary(android.content.pm.PackageManager); + method public java.lang.CharSequence loadSummary(android.content.pm.PackageManager); method public void writeToParcel(android.os.Parcel, int); field public static final int CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES = 64; // 0x40 field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10 diff --git a/api/system-current.txt b/api/system-current.txt index 21fce319ebe9..cf4b39c41016 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -2955,7 +2955,7 @@ package android.accessibilityservice { method public android.content.pm.ResolveInfo getResolveInfo(); method public java.lang.String getSettingsActivityName(); method public java.lang.String loadDescription(android.content.pm.PackageManager); - method public java.lang.String loadSummary(android.content.pm.PackageManager); + method public java.lang.CharSequence loadSummary(android.content.pm.PackageManager); method public void writeToParcel(android.os.Parcel, int); field public static final int CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES = 64; // 0x40 field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10 diff --git a/api/test-current.txt b/api/test-current.txt index bd2fed09c9d6..8a64c74dd457 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -2830,7 +2830,7 @@ package android.accessibilityservice { method public android.content.pm.ResolveInfo getResolveInfo(); method public java.lang.String getSettingsActivityName(); method public java.lang.String loadDescription(android.content.pm.PackageManager); - method public java.lang.String loadSummary(android.content.pm.PackageManager); + method public java.lang.CharSequence loadSummary(android.content.pm.PackageManager); method public void writeToParcel(android.os.Parcel, int); field public static final int CAPABILITY_CAN_CAPTURE_FINGERPRINT_GESTURES = 64; // 0x40 field public static final int CAPABILITY_CAN_CONTROL_MAGNIFICATION = 16; // 0x10 diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java index 5937dd951dc4..b2c28004f2a1 100644 --- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java +++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java @@ -693,9 +693,10 @@ public class AccessibilityServiceInfo implements Parcelable { * Statically set from * {@link AccessibilityService#SERVICE_META_DATA meta-data}. *

- * @return The localized summary. + * @return The localized summary if available, and {@code null} if a summary + * has not been provided. */ - public String loadSummary(PackageManager packageManager) { + public CharSequence loadSummary(PackageManager packageManager) { if (mSummaryResId == 0) { return mNonLocalizedSummary; } -- GitLab From 000ce805050f0bdbf485464b84eb2c08bca5ad72 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Sat, 29 Apr 2017 13:13:27 -0600 Subject: [PATCH 23/66] Updates based on API council guidance. Test: builds, boots Change-Id: I223faf55c1e1b4d81d11b4c8b2d93ccd131c969b Fixes: 37775662 Fixes: 37748635 Fixes: 37673408 Fixes: 37672564 Fixes: 37672218 Fixes: 37638323 Fixes: 37637423 --- api/current.txt | 28 +- api/removed.txt | 62 ++++ api/system-current.txt | 29 +- api/system-removed.txt | 62 ++++ api/test-current.txt | 28 +- api/test-removed.txt | 62 ++++ core/java/android/app/Activity.java | 21 +- core/java/android/app/ActivityManager.java | 8 +- core/java/android/app/KeyguardManager.java | 23 +- core/java/android/app/Notification.java | 27 +- .../android/app/PictureInPictureArgs.java | 333 +++++++++++++++--- .../android/app/PictureInPictureParams.java | 32 +- core/java/android/os/TestLooperManager.java | 8 +- .../service/autofill/AutofillService.java | 2 +- .../android/service/autofill/FillRequest.java | 3 +- .../speech/tts/UtteranceProgressListener.java | 5 +- .../view/autofill/AutofillManager.java | 2 +- 17 files changed, 521 insertions(+), 214 deletions(-) diff --git a/api/current.txt b/api/current.txt index 206eeffce96c..ab11ab1e02ed 100644 --- a/api/current.txt +++ b/api/current.txt @@ -3581,7 +3581,6 @@ package android.app { method public boolean dispatchTrackballEvent(android.view.MotionEvent); method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]); method public deprecated void enterPictureInPictureMode(); - method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs); method public boolean enterPictureInPictureMode(android.app.PictureInPictureParams); method public T findViewById(int); method public void finish(); @@ -3756,7 +3755,6 @@ package android.app { method public void setImmersive(boolean); method public void setIntent(android.content.Intent); method public final void setMediaController(android.media.session.MediaController); - method public void setPictureInPictureArgs(android.app.PictureInPictureArgs); method public void setPictureInPictureParams(android.app.PictureInPictureParams); method public final deprecated void setProgress(int); method public final deprecated void setProgressBarIndeterminate(boolean); @@ -3836,7 +3834,6 @@ package android.app { method public int getLauncherLargeIconDensity(); method public int getLauncherLargeIconSize(); method public int getLockTaskModeState(); - method public static deprecated int getMaxNumPictureInPictureActions(); method public int getMemoryClass(); method public void getMemoryInfo(android.app.ActivityManager.MemoryInfo); method public static void getMyMemoryState(android.app.ActivityManager.RunningAppProcessInfo); @@ -4973,7 +4970,6 @@ package android.app { public class KeyguardManager { method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence); - method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler); method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public boolean inKeyguardRestrictedInputMode(); method public boolean isDeviceLocked(); @@ -5122,7 +5118,6 @@ package android.app { method public android.app.Notification clone(); method public int describeContents(); method public int getBadgeIconType(); - method public java.lang.String getChannel(); method public java.lang.String getChannelId(); method public java.lang.String getGroup(); method public int getGroupAlertBehavior(); @@ -5131,7 +5126,6 @@ package android.app { method public java.lang.String getShortcutId(); method public android.graphics.drawable.Icon getSmallIcon(); method public java.lang.String getSortKey(); - method public long getTimeout(); method public long getTimeoutAfter(); method public void writeToParcel(android.os.Parcel, int); field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT; @@ -5334,7 +5328,6 @@ package android.app { method public android.app.Notification.Builder setAutoCancel(boolean); method public android.app.Notification.Builder setBadgeIconType(int); method public android.app.Notification.Builder setCategory(java.lang.String); - method public android.app.Notification.Builder setChannel(java.lang.String); method public android.app.Notification.Builder setChannelId(java.lang.String); method public android.app.Notification.Builder setChronometerCountDown(boolean); method public android.app.Notification.Builder setColor(int); @@ -5379,7 +5372,6 @@ package android.app { method public android.app.Notification.Builder setSubText(java.lang.CharSequence); method public android.app.Notification.Builder setTicker(java.lang.CharSequence); method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews); - method public android.app.Notification.Builder setTimeout(long); method public android.app.Notification.Builder setTimeoutAfter(long); method public android.app.Notification.Builder setUsesChronometer(boolean); method public deprecated android.app.Notification.Builder setVibrate(long[]); @@ -5698,21 +5690,10 @@ package android.app { method public abstract void onSendFinished(android.app.PendingIntent, android.content.Intent, int, java.lang.String, android.os.Bundle); } - public final deprecated class PictureInPictureArgs extends android.app.PictureInPictureParams { - ctor public deprecated PictureInPictureArgs(); - ctor public deprecated PictureInPictureArgs(float, java.util.List); - method public deprecated void setActions(java.util.List); - method public deprecated void setAspectRatio(float); - method public deprecated void setSourceRectHint(android.graphics.Rect); - } - - public class PictureInPictureParams implements android.os.Parcelable { + public final class PictureInPictureParams implements android.os.Parcelable { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; - field protected android.util.Rational mAspectRatio; - field protected android.graphics.Rect mSourceRectHint; - field protected java.util.List mUserActions; } public static class PictureInPictureParams.Builder { @@ -31599,7 +31580,7 @@ package android.os { public class TestLooperManager { method public void execute(android.os.Message); - method public android.os.MessageQueue getQueue(); + method public android.os.MessageQueue getMessageQueue(); method public boolean hasMessages(android.os.Handler, java.lang.Object, int); method public boolean hasMessages(android.os.Handler, java.lang.Object, java.lang.Runnable); method public android.os.Message next(); @@ -37010,7 +36991,7 @@ package android.service.autofill { public final class FillRequest implements android.os.Parcelable { method public int describeContents(); method public android.os.Bundle getClientState(); - method public java.util.ArrayList getFillContexts(); + method public java.util.List getFillContexts(); method public int getFlags(); method public int getId(); method public void writeToParcel(android.os.Parcel, int); @@ -37992,7 +37973,6 @@ package android.speech.tts { method public void onRangeStart(java.lang.String, int, int, int); method public abstract void onStart(java.lang.String); method public void onStop(java.lang.String, boolean); - method public deprecated void onUtteranceRangeStart(java.lang.String, int, int); } public class Voice implements android.os.Parcelable { @@ -47766,7 +47746,7 @@ package android.view.autofill { method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback); field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE"; field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT"; - field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.EXTRA_CLIENT_STATE"; + field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.CLIENT_STATE"; } public static abstract class AutofillManager.AutofillCallback { diff --git a/api/removed.txt b/api/removed.txt index 779ff7cce923..b0dad451611f 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -1,9 +1,59 @@ package android.app { + public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.View.OnCreateContextMenuListener android.view.Window.Callback { + method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs); + method public deprecated void setPictureInPictureArgs(android.app.PictureInPictureArgs); + } + + public class ActivityManager { + method public static deprecated int getMaxNumPictureInPictureActions(); + } + + public class KeyguardManager { + method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler); + } + public class Notification implements android.os.Parcelable { + method public deprecated java.lang.String getChannel(); + method public deprecated long getTimeout(); method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent); } + public static class Notification.Builder { + method public deprecated android.app.Notification.Builder setChannel(java.lang.String); + method public deprecated android.app.Notification.Builder setTimeout(long); + } + + public static final class Notification.TvExtender implements android.app.Notification.Extender { + method public deprecated java.lang.String getChannel(); + } + + public final deprecated class PictureInPictureArgs implements android.os.Parcelable { + method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams); + method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs); + method public void copyOnlySet(android.app.PictureInPictureArgs); + method public java.util.List getActions(); + method public float getAspectRatio(); + method public android.util.Rational getAspectRatioRational(); + method public android.graphics.Rect getSourceRectHint(); + method public android.graphics.Rect getSourceRectHintInsets(); + method public boolean hasSetActions(); + method public boolean hasSetAspectRatio(); + method public boolean hasSourceBoundsHint(); + method public boolean hasSourceBoundsHintInsets(); + method public deprecated void setSourceRectHintInsets(android.graphics.Rect); + method public void truncateActions(int); + field public static final android.os.Parcelable.Creator CREATOR; + } + + public static class PictureInPictureArgs.Builder { + ctor public PictureInPictureArgs.Builder(); + method public android.app.PictureInPictureArgs build(); + method public android.app.PictureInPictureArgs.Builder setActions(java.util.List); + method public android.app.PictureInPictureArgs.Builder setAspectRatio(android.util.Rational); + method public android.app.PictureInPictureArgs.Builder setSourceRectHint(android.graphics.Rect); + } + public final class RecoverableSecurityException extends java.lang.SecurityException implements android.os.Parcelable { method public deprecated void showAsNotification(android.content.Context); } @@ -221,6 +271,10 @@ package android.os { ctor public RecoverySystem(); } + public class TestLooperManager { + method public deprecated android.os.MessageQueue getQueue(); + } + public class UserManager { method public android.graphics.drawable.Drawable getBadgedDrawableForUser(android.graphics.drawable.Drawable, android.os.UserHandle, android.graphics.Rect, int); method public android.graphics.drawable.Drawable getBadgedIconForUser(android.graphics.drawable.Drawable, android.os.UserHandle); @@ -382,6 +436,14 @@ package android.provider { } +package android.speech.tts { + + public abstract class UtteranceProgressListener { + method public deprecated void onUtteranceRangeStart(java.lang.String, int, int); + } + +} + package android.test.mock { public deprecated class MockPackageManager extends android.content.pm.PackageManager { diff --git a/api/system-current.txt b/api/system-current.txt index 22c8cd3c1a3c..bd5c175daaeb 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -3713,7 +3713,6 @@ package android.app { method public boolean dispatchTrackballEvent(android.view.MotionEvent); method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]); method public deprecated void enterPictureInPictureMode(); - method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs); method public boolean enterPictureInPictureMode(android.app.PictureInPictureParams); method public T findViewById(int); method public void finish(); @@ -3891,7 +3890,6 @@ package android.app { method public void setImmersive(boolean); method public void setIntent(android.content.Intent); method public final void setMediaController(android.media.session.MediaController); - method public void setPictureInPictureArgs(android.app.PictureInPictureArgs); method public void setPictureInPictureParams(android.app.PictureInPictureParams); method public final deprecated void setProgress(int); method public final deprecated void setProgressBarIndeterminate(boolean); @@ -3978,7 +3976,6 @@ package android.app { method public int getLauncherLargeIconDensity(); method public int getLauncherLargeIconSize(); method public int getLockTaskModeState(); - method public static deprecated int getMaxNumPictureInPictureActions(); method public int getMemoryClass(); method public void getMemoryInfo(android.app.ActivityManager.MemoryInfo); method public static void getMyMemoryState(android.app.ActivityManager.RunningAppProcessInfo); @@ -5154,7 +5151,6 @@ package android.app { public class KeyguardManager { method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence); - method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler); method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public boolean inKeyguardRestrictedInputMode(); method public boolean isDeviceLocked(); @@ -5303,7 +5299,6 @@ package android.app { method public android.app.Notification clone(); method public int describeContents(); method public int getBadgeIconType(); - method public java.lang.String getChannel(); method public java.lang.String getChannelId(); method public java.lang.String getGroup(); method public int getGroupAlertBehavior(); @@ -5313,7 +5308,6 @@ package android.app { method public java.lang.String getShortcutId(); method public android.graphics.drawable.Icon getSmallIcon(); method public java.lang.String getSortKey(); - method public long getTimeout(); method public long getTimeoutAfter(); method public void writeToParcel(android.os.Parcel, int); field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT; @@ -5519,7 +5513,6 @@ package android.app { method public android.app.Notification.Builder setAutoCancel(boolean); method public android.app.Notification.Builder setBadgeIconType(int); method public android.app.Notification.Builder setCategory(java.lang.String); - method public android.app.Notification.Builder setChannel(java.lang.String); method public android.app.Notification.Builder setChannelId(java.lang.String); method public android.app.Notification.Builder setChronometerCountDown(boolean); method public android.app.Notification.Builder setColor(int); @@ -5564,7 +5557,6 @@ package android.app { method public android.app.Notification.Builder setSubText(java.lang.CharSequence); method public android.app.Notification.Builder setTicker(java.lang.CharSequence); method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews); - method public android.app.Notification.Builder setTimeout(long); method public android.app.Notification.Builder setTimeoutAfter(long); method public android.app.Notification.Builder setUsesChronometer(boolean); method public deprecated android.app.Notification.Builder setVibrate(long[]); @@ -5669,7 +5661,6 @@ package android.app { ctor public Notification.TvExtender(); ctor public Notification.TvExtender(android.app.Notification); method public android.app.Notification.Builder extend(android.app.Notification.Builder); - method public java.lang.String getChannel(); method public java.lang.String getChannelId(); method public android.app.PendingIntent getContentIntent(); method public android.app.PendingIntent getDeleteIntent(); @@ -5904,21 +5895,10 @@ package android.app { method public abstract void onSendFinished(android.app.PendingIntent, android.content.Intent, int, java.lang.String, android.os.Bundle); } - public final deprecated class PictureInPictureArgs extends android.app.PictureInPictureParams { - ctor public deprecated PictureInPictureArgs(); - ctor public deprecated PictureInPictureArgs(float, java.util.List); - method public deprecated void setActions(java.util.List); - method public deprecated void setAspectRatio(float); - method public deprecated void setSourceRectHint(android.graphics.Rect); - } - - public class PictureInPictureParams implements android.os.Parcelable { + public final class PictureInPictureParams implements android.os.Parcelable { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; - field protected android.util.Rational mAspectRatio; - field protected android.graphics.Rect mSourceRectHint; - field protected java.util.List mUserActions; } public static class PictureInPictureParams.Builder { @@ -34424,7 +34404,7 @@ package android.os { public class TestLooperManager { method public void execute(android.os.Message); - method public android.os.MessageQueue getQueue(); + method public android.os.MessageQueue getMessageQueue(); method public boolean hasMessages(android.os.Handler, java.lang.Object, int); method public boolean hasMessages(android.os.Handler, java.lang.Object, java.lang.Runnable); method public android.os.Message next(); @@ -40133,7 +40113,7 @@ package android.service.autofill { public final class FillRequest implements android.os.Parcelable { method public int describeContents(); method public android.os.Bundle getClientState(); - method public java.util.ArrayList getFillContexts(); + method public java.util.List getFillContexts(); method public int getFlags(); method public int getId(); method public void writeToParcel(android.os.Parcel, int); @@ -41258,7 +41238,6 @@ package android.speech.tts { method public void onRangeStart(java.lang.String, int, int, int); method public abstract void onStart(java.lang.String); method public void onStop(java.lang.String, boolean); - method public deprecated void onUtteranceRangeStart(java.lang.String, int, int); } public class Voice implements android.os.Parcelable { @@ -51362,7 +51341,7 @@ package android.view.autofill { method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback); field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE"; field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT"; - field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.EXTRA_CLIENT_STATE"; + field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.CLIENT_STATE"; } public static abstract class AutofillManager.AutofillCallback { diff --git a/api/system-removed.txt b/api/system-removed.txt index fe512481b1ad..2fd30391779c 100644 --- a/api/system-removed.txt +++ b/api/system-removed.txt @@ -1,9 +1,59 @@ package android.app { + public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.View.OnCreateContextMenuListener android.view.Window.Callback { + method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs); + method public deprecated void setPictureInPictureArgs(android.app.PictureInPictureArgs); + } + + public class ActivityManager { + method public static deprecated int getMaxNumPictureInPictureActions(); + } + + public class KeyguardManager { + method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler); + } + public class Notification implements android.os.Parcelable { + method public deprecated java.lang.String getChannel(); + method public deprecated long getTimeout(); method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent); } + public static class Notification.Builder { + method public deprecated android.app.Notification.Builder setChannel(java.lang.String); + method public deprecated android.app.Notification.Builder setTimeout(long); + } + + public static final class Notification.TvExtender implements android.app.Notification.Extender { + method public deprecated java.lang.String getChannel(); + } + + public final deprecated class PictureInPictureArgs implements android.os.Parcelable { + method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams); + method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs); + method public void copyOnlySet(android.app.PictureInPictureArgs); + method public java.util.List getActions(); + method public float getAspectRatio(); + method public android.util.Rational getAspectRatioRational(); + method public android.graphics.Rect getSourceRectHint(); + method public android.graphics.Rect getSourceRectHintInsets(); + method public boolean hasSetActions(); + method public boolean hasSetAspectRatio(); + method public boolean hasSourceBoundsHint(); + method public boolean hasSourceBoundsHintInsets(); + method public deprecated void setSourceRectHintInsets(android.graphics.Rect); + method public void truncateActions(int); + field public static final android.os.Parcelable.Creator CREATOR; + } + + public static class PictureInPictureArgs.Builder { + ctor public PictureInPictureArgs.Builder(); + method public android.app.PictureInPictureArgs build(); + method public android.app.PictureInPictureArgs.Builder setActions(java.util.List); + method public android.app.PictureInPictureArgs.Builder setAspectRatio(android.util.Rational); + method public android.app.PictureInPictureArgs.Builder setSourceRectHint(android.graphics.Rect); + } + public final class RecoverableSecurityException extends java.lang.SecurityException implements android.os.Parcelable { method public deprecated void showAsNotification(android.content.Context); } @@ -215,6 +265,10 @@ package android.os { ctor public RecoverySystem(); } + public class TestLooperManager { + method public deprecated android.os.MessageQueue getQueue(); + } + public class UserManager { method public android.graphics.drawable.Drawable getBadgedDrawableForUser(android.graphics.drawable.Drawable, android.os.UserHandle, android.graphics.Rect, int); method public android.graphics.drawable.Drawable getBadgedIconForUser(android.graphics.drawable.Drawable, android.os.UserHandle); @@ -376,6 +430,14 @@ package android.provider { } +package android.speech.tts { + + public abstract class UtteranceProgressListener { + method public deprecated void onUtteranceRangeStart(java.lang.String, int, int); + } + +} + package android.test.mock { public deprecated class MockPackageManager extends android.content.pm.PackageManager { diff --git a/api/test-current.txt b/api/test-current.txt index 98ee73f3b7a8..10b85ebc4c48 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -3583,7 +3583,6 @@ package android.app { method public boolean dispatchTrackballEvent(android.view.MotionEvent); method public void dump(java.lang.String, java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]); method public deprecated void enterPictureInPictureMode(); - method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs); method public boolean enterPictureInPictureMode(android.app.PictureInPictureParams); method public T findViewById(int); method public void finish(); @@ -3758,7 +3757,6 @@ package android.app { method public void setImmersive(boolean); method public void setIntent(android.content.Intent); method public final void setMediaController(android.media.session.MediaController); - method public void setPictureInPictureArgs(android.app.PictureInPictureArgs); method public void setPictureInPictureParams(android.app.PictureInPictureParams); method public final deprecated void setProgress(int); method public final deprecated void setProgressBarIndeterminate(boolean); @@ -3839,7 +3837,6 @@ package android.app { method public int getLauncherLargeIconDensity(); method public int getLauncherLargeIconSize(); method public int getLockTaskModeState(); - method public static deprecated int getMaxNumPictureInPictureActions(); method public int getMemoryClass(); method public void getMemoryInfo(android.app.ActivityManager.MemoryInfo); method public static void getMyMemoryState(android.app.ActivityManager.RunningAppProcessInfo); @@ -4986,7 +4983,6 @@ package android.app { public class KeyguardManager { method public android.content.Intent createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence); - method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler); method public deprecated void exitKeyguardSecurely(android.app.KeyguardManager.OnKeyguardExitResult); method public boolean inKeyguardRestrictedInputMode(); method public boolean isDeviceLocked(); @@ -5135,7 +5131,6 @@ package android.app { method public android.app.Notification clone(); method public int describeContents(); method public int getBadgeIconType(); - method public java.lang.String getChannel(); method public java.lang.String getChannelId(); method public java.lang.String getGroup(); method public int getGroupAlertBehavior(); @@ -5144,7 +5139,6 @@ package android.app { method public java.lang.String getShortcutId(); method public android.graphics.drawable.Icon getSmallIcon(); method public java.lang.String getSortKey(); - method public long getTimeout(); method public long getTimeoutAfter(); method public void writeToParcel(android.os.Parcel, int); field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT; @@ -5347,7 +5341,6 @@ package android.app { method public android.app.Notification.Builder setAutoCancel(boolean); method public android.app.Notification.Builder setBadgeIconType(int); method public android.app.Notification.Builder setCategory(java.lang.String); - method public android.app.Notification.Builder setChannel(java.lang.String); method public android.app.Notification.Builder setChannelId(java.lang.String); method public android.app.Notification.Builder setChronometerCountDown(boolean); method public android.app.Notification.Builder setColor(int); @@ -5392,7 +5385,6 @@ package android.app { method public android.app.Notification.Builder setSubText(java.lang.CharSequence); method public android.app.Notification.Builder setTicker(java.lang.CharSequence); method public deprecated android.app.Notification.Builder setTicker(java.lang.CharSequence, android.widget.RemoteViews); - method public android.app.Notification.Builder setTimeout(long); method public android.app.Notification.Builder setTimeoutAfter(long); method public android.app.Notification.Builder setUsesChronometer(boolean); method public deprecated android.app.Notification.Builder setVibrate(long[]); @@ -5712,21 +5704,10 @@ package android.app { method public abstract void onSendFinished(android.app.PendingIntent, android.content.Intent, int, java.lang.String, android.os.Bundle); } - public final deprecated class PictureInPictureArgs extends android.app.PictureInPictureParams { - ctor public deprecated PictureInPictureArgs(); - ctor public deprecated PictureInPictureArgs(float, java.util.List); - method public deprecated void setActions(java.util.List); - method public deprecated void setAspectRatio(float); - method public deprecated void setSourceRectHint(android.graphics.Rect); - } - - public class PictureInPictureParams implements android.os.Parcelable { + public final class PictureInPictureParams implements android.os.Parcelable { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; - field protected android.util.Rational mAspectRatio; - field protected android.graphics.Rect mSourceRectHint; - field protected java.util.List mUserActions; } public static class PictureInPictureParams.Builder { @@ -31729,7 +31710,7 @@ package android.os { public class TestLooperManager { method public void execute(android.os.Message); - method public android.os.MessageQueue getQueue(); + method public android.os.MessageQueue getMessageQueue(); method public boolean hasMessages(android.os.Handler, java.lang.Object, int); method public boolean hasMessages(android.os.Handler, java.lang.Object, java.lang.Runnable); method public android.os.Message next(); @@ -37164,7 +37145,7 @@ package android.service.autofill { public final class FillRequest implements android.os.Parcelable { method public int describeContents(); method public android.os.Bundle getClientState(); - method public java.util.ArrayList getFillContexts(); + method public java.util.List getFillContexts(); method public int getFlags(); method public int getId(); method public void writeToParcel(android.os.Parcel, int); @@ -38187,7 +38168,6 @@ package android.speech.tts { method public void onRangeStart(java.lang.String, int, int, int); method public abstract void onStart(java.lang.String); method public void onStop(java.lang.String, boolean); - method public deprecated void onUtteranceRangeStart(java.lang.String, int, int); } public class Voice implements android.os.Parcelable { @@ -48145,7 +48125,7 @@ package android.view.autofill { method public void unregisterCallback(android.view.autofill.AutofillManager.AutofillCallback); field public static final java.lang.String EXTRA_ASSIST_STRUCTURE = "android.view.autofill.extra.ASSIST_STRUCTURE"; field public static final java.lang.String EXTRA_AUTHENTICATION_RESULT = "android.view.autofill.extra.AUTHENTICATION_RESULT"; - field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.EXTRA_CLIENT_STATE"; + field public static final java.lang.String EXTRA_CLIENT_STATE = "android.view.autofill.extra.CLIENT_STATE"; } public static abstract class AutofillManager.AutofillCallback { diff --git a/api/test-removed.txt b/api/test-removed.txt index 779ff7cce923..b0dad451611f 100644 --- a/api/test-removed.txt +++ b/api/test-removed.txt @@ -1,9 +1,59 @@ package android.app { + public class Activity extends android.view.ContextThemeWrapper implements android.content.ComponentCallbacks2 android.view.KeyEvent.Callback android.view.LayoutInflater.Factory2 android.view.View.OnCreateContextMenuListener android.view.Window.Callback { + method public deprecated boolean enterPictureInPictureMode(android.app.PictureInPictureArgs); + method public deprecated void setPictureInPictureArgs(android.app.PictureInPictureArgs); + } + + public class ActivityManager { + method public static deprecated int getMaxNumPictureInPictureActions(); + } + + public class KeyguardManager { + method public deprecated void dismissKeyguard(android.app.Activity, android.app.KeyguardManager.KeyguardDismissCallback, android.os.Handler); + } + public class Notification implements android.os.Parcelable { + method public deprecated java.lang.String getChannel(); + method public deprecated long getTimeout(); method public deprecated void setLatestEventInfo(android.content.Context, java.lang.CharSequence, java.lang.CharSequence, android.app.PendingIntent); } + public static class Notification.Builder { + method public deprecated android.app.Notification.Builder setChannel(java.lang.String); + method public deprecated android.app.Notification.Builder setTimeout(long); + } + + public static final class Notification.TvExtender implements android.app.Notification.Extender { + method public deprecated java.lang.String getChannel(); + } + + public final deprecated class PictureInPictureArgs implements android.os.Parcelable { + method public static android.app.PictureInPictureArgs convert(android.app.PictureInPictureParams); + method public static android.app.PictureInPictureParams convert(android.app.PictureInPictureArgs); + method public void copyOnlySet(android.app.PictureInPictureArgs); + method public java.util.List getActions(); + method public float getAspectRatio(); + method public android.util.Rational getAspectRatioRational(); + method public android.graphics.Rect getSourceRectHint(); + method public android.graphics.Rect getSourceRectHintInsets(); + method public boolean hasSetActions(); + method public boolean hasSetAspectRatio(); + method public boolean hasSourceBoundsHint(); + method public boolean hasSourceBoundsHintInsets(); + method public deprecated void setSourceRectHintInsets(android.graphics.Rect); + method public void truncateActions(int); + field public static final android.os.Parcelable.Creator CREATOR; + } + + public static class PictureInPictureArgs.Builder { + ctor public PictureInPictureArgs.Builder(); + method public android.app.PictureInPictureArgs build(); + method public android.app.PictureInPictureArgs.Builder setActions(java.util.List); + method public android.app.PictureInPictureArgs.Builder setAspectRatio(android.util.Rational); + method public android.app.PictureInPictureArgs.Builder setSourceRectHint(android.graphics.Rect); + } + public final class RecoverableSecurityException extends java.lang.SecurityException implements android.os.Parcelable { method public deprecated void showAsNotification(android.content.Context); } @@ -221,6 +271,10 @@ package android.os { ctor public RecoverySystem(); } + public class TestLooperManager { + method public deprecated android.os.MessageQueue getQueue(); + } + public class UserManager { method public android.graphics.drawable.Drawable getBadgedDrawableForUser(android.graphics.drawable.Drawable, android.os.UserHandle, android.graphics.Rect, int); method public android.graphics.drawable.Drawable getBadgedIconForUser(android.graphics.drawable.Drawable, android.os.UserHandle); @@ -382,6 +436,14 @@ package android.provider { } +package android.speech.tts { + + public abstract class UtteranceProgressListener { + method public deprecated void onUtteranceRangeStart(java.lang.String, int, int); + } + +} + package android.test.mock { public deprecated class MockPackageManager extends android.content.pm.PackageManager { diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index ab4f33d6b6e6..4f6c0c9d8f91 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -2050,20 +2050,10 @@ public class Activity extends ContextThemeWrapper enterPictureInPictureMode(new PictureInPictureParams.Builder().build()); } - /** - * TO BE REMOVED - */ + /** @removed */ @Deprecated public boolean enterPictureInPictureMode(@NonNull PictureInPictureArgs args) { - try { - if (args == null) { - throw new IllegalArgumentException("Expected non-null picture-in-picture args"); - } - updatePictureInPictureParamsForContentInsets(args); - return ActivityManagerNative.getDefault().enterPictureInPictureMode(mToken, args); - } catch (RemoteException e) { - return false; - } + return enterPictureInPictureMode(PictureInPictureArgs.convert(args)); } /** @@ -2095,11 +2085,10 @@ public class Activity extends ContextThemeWrapper } } - /** - * TO BE REMOVED - */ + /** @removed */ + @Deprecated public void setPictureInPictureArgs(@NonNull PictureInPictureArgs args) { - setPictureInPictureParams(args); + setPictureInPictureParams(PictureInPictureArgs.convert(args)); } /** diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index 223047241480..7868bfcdc15f 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -1124,13 +1124,7 @@ public class ActivityManager { com.android.internal.R.bool.config_supportsSplitScreenMultiWindow); } - /** - * Return the number of actions that will be displayed in the picture-in-picture UI when the - * user interacts with the activity currently in picture-in-picture mode. This number may change - * if the global configuration changes (ie. if the device is plugged into an external display). - * - * TO BE REMOVED - */ + /** @removed */ @Deprecated public static int getMaxNumPictureInPictureActions() { return 3; diff --git a/core/java/android/app/KeyguardManager.java b/core/java/android/app/KeyguardManager.java index 4de6e44b0400..fcf0aab0c821 100644 --- a/core/java/android/app/KeyguardManager.java +++ b/core/java/android/app/KeyguardManager.java @@ -362,28 +362,7 @@ public class KeyguardManager { } } - /** - * If the device is currently locked (see {@link #isKeyguardLocked()}, requests the Keyguard to - * be dismissed. - *

- * If the Keyguard is not secure or the device is currently in a trusted state, calling this - * method will immediately dismiss the Keyguard without any user interaction. - *

- * If the Keyguard is secure and the device is not in a trusted state, this will bring up the - * UI so the user can enter their credentials. - * - * @param activity The activity requesting the dismissal. The activity must be either visible - * by using {@link LayoutParams#FLAG_SHOW_WHEN_LOCKED} or must be in a state in - * which it would be visible if Keyguard would not be hiding it. If that's not - * the case, the request will fail immediately and - * {@link KeyguardDismissCallback#onDismissError} will be invoked. - * @param callback The callback to be called if the request to dismiss Keyguard was successful - * or {@code null} if the caller isn't interested in knowing the result. - * @param handler The handler to invoke the callback on, or {@code null} to use the main - * handler. - * - * TO BE REMOVED - */ + /** @removed */ @Deprecated public void dismissKeyguard(@NonNull Activity activity, @Nullable KeyguardDismissCallback callback, @Nullable Handler handler) { diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 28fe3195839d..c8b8c6c1b262 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -2494,9 +2494,8 @@ public class Notification implements Parcelable } } - /** - * Returns the id of the channel this notification posts to. - */ + /** @removed */ + @Deprecated public String getChannel() { return mChannelId; } @@ -2508,10 +2507,8 @@ public class Notification implements Parcelable return mChannelId; } - /** - * Returns the time at which this notification should be canceled by the system, if it's not - * canceled already. - */ + /** @removed */ + @Deprecated public long getTimeout() { return mTimeout; } @@ -2811,9 +2808,8 @@ public class Notification implements Parcelable return this; } - /** - * Specifies the channel the notification should be delivered on. - */ + /** @removed */ + @Deprecated public Builder setChannel(String channelId) { mN.mChannelId = channelId; return this; @@ -2827,10 +2823,8 @@ public class Notification implements Parcelable return this; } - /** - * Specifies a duration in milliseconds after which this notification should be canceled, - * if it is not already canceled. - */ + /** @removed */ + @Deprecated public Builder setTimeout(long durationMs) { mN.mTimeout = durationMs; return this; @@ -8040,9 +8034,8 @@ public class Notification implements Parcelable return this; } - /** - * Returns the id of the channel this notification posts to on TV. - */ + /** @removed */ + @Deprecated public String getChannel() { return mChannelId; } diff --git a/core/java/android/app/PictureInPictureArgs.java b/core/java/android/app/PictureInPictureArgs.java index 63db86aac9a8..88e6b9981486 100644 --- a/core/java/android/app/PictureInPictureArgs.java +++ b/core/java/android/app/PictureInPictureArgs.java @@ -16,91 +16,314 @@ package android.app; +import android.annotation.Nullable; import android.graphics.Rect; +import android.os.Parcel; +import android.os.Parcelable; import android.util.Rational; import java.util.ArrayList; import java.util.List; -/** - * TO BE REMOVED - */ +/** @removed */ @Deprecated -public final class PictureInPictureArgs extends PictureInPictureParams { +public final class PictureInPictureArgs implements Parcelable { /** - * Creates a new set of picture-in-picture arguments. - * - * TODO: Remove once we remove PictureInPictureArgs. + * Builder class for {@link PictureInPictureArgs} objects. */ - @Deprecated - public PictureInPictureArgs() { - // Empty constructor + public static class Builder { + + @Nullable + private Rational mAspectRatio; + + @Nullable + private List mUserActions; + + @Nullable + private Rect mSourceRectHint; + + /** + * Sets the aspect ratio. This aspect ratio is defined as the desired width / height, and + * does not change upon device rotation. + * + * @param aspectRatio the new aspect ratio for the activity in picture-in-picture, must be + * between 2.39:1 and 1:2.39 (inclusive). + * + * @return this builder instance. + */ + public Builder setAspectRatio(Rational aspectRatio) { + mAspectRatio = aspectRatio; + return this; + } + + /** + * Sets the user actions. If there are more than + * {@link Activity#getMaxNumPictureInPictureActions()} actions, then the input list + * will be truncated to that number. + * + * @param actions the new actions to show in the picture-in-picture menu. + * + * @return this builder instance. + * + * @see RemoteAction + */ + public Builder setActions(List actions) { + if (mUserActions != null) { + mUserActions = null; + } + if (actions != null) { + mUserActions = new ArrayList<>(actions); + } + return this; + } + + /** + * Sets the source bounds hint. These bounds are only used when an activity first enters + * picture-in-picture, and describe the bounds in window coordinates of activity entering + * picture-in-picture that will be visible following the transition. For the best effect, + * these bounds should also match the aspect ratio in the arguments. + * + * @param launchBounds window-coordinate bounds indicating the area of the activity that + * will still be visible following the transition into picture-in-picture (eg. the video + * view bounds in a video player) + * + * @return this builder instance. + */ + public Builder setSourceRectHint(Rect launchBounds) { + if (launchBounds == null) { + mSourceRectHint = null; + } else { + mSourceRectHint = new Rect(launchBounds); + } + return this; + } + + public PictureInPictureArgs build() { + PictureInPictureArgs args = new PictureInPictureArgs(mAspectRatio, mUserActions, + mSourceRectHint); + return args; + } } /** - * Creates a new set of picture-in-picture arguments from the given {@param aspectRatio} and - * {@param actions}. - * - * TODO: Remove once we remove PictureInPictureArgs. + * The expected aspect ratio of the picture-in-picture. */ - @Deprecated - public PictureInPictureArgs(float aspectRatio, List actions) { - setAspectRatio(aspectRatio); - if (actions != null) { - setActions(actions); + @Nullable + private Rational mAspectRatio; + + /** + * The set of actions that are associated with this activity when in picture-in-picture. + */ + @Nullable + private List mUserActions; + + /** + * The source bounds hint used when entering picture-in-picture, relative to the window bounds. + * We can use this internally for the transition into picture-in-picture to ensure that a + * particular source rect is visible throughout the whole transition. + */ + @Nullable + private Rect mSourceRectHint; + + /** + * The content insets that are used with the source hint rect for the transition into PiP where + * the insets are removed at the beginning of the transition. + */ + @Nullable + private Rect mSourceRectHintInsets; + + private PictureInPictureArgs() { + } + + private PictureInPictureArgs(Parcel in) { + if (in.readInt() != 0) { + mAspectRatio = new Rational(in.readInt(), in.readInt()); + } + if (in.readInt() != 0) { + mUserActions = new ArrayList<>(); + in.readParcelableList(mUserActions, RemoteAction.class.getClassLoader()); + } + if (in.readInt() != 0) { + mSourceRectHint = Rect.CREATOR.createFromParcel(in); + } + if (in.readInt() != 0) { + mSourceRectHintInsets = Rect.CREATOR.createFromParcel(in); } } + private PictureInPictureArgs(Rational aspectRatio, List actions, + Rect sourceRectHint) { + mAspectRatio = aspectRatio; + mUserActions = actions; + mSourceRectHint = sourceRectHint; + } + /** - * Sets the aspect ratio. - * - * @param aspectRatio the new aspect ratio for picture-in-picture, must be within 2.39:1 and - * 1:2.39. - * - * TODO: Remove once we remove PictureInPictureArgs. + * Copies the set parameters from the other picture-in-picture args. + * @hide */ - @Deprecated - public void setAspectRatio(float aspectRatio) { - // Temporary workaround - mAspectRatio = new Rational((int) (aspectRatio * 1000000000), 1000000000); + public void copyOnlySet(PictureInPictureArgs otherArgs) { + if (otherArgs.hasSetAspectRatio()) { + mAspectRatio = otherArgs.mAspectRatio; + } + if (otherArgs.hasSetActions()) { + mUserActions = otherArgs.mUserActions; + } + if (otherArgs.hasSourceBoundsHint()) { + mSourceRectHint = new Rect(otherArgs.getSourceRectHint()); + } + if (otherArgs.hasSourceBoundsHintInsets()) { + mSourceRectHintInsets = new Rect(otherArgs.getSourceRectHintInsets()); + } } /** - * Sets the user actions. If there are more than - * {@link ActivityManager#getMaxNumPictureInPictureActions()} actions, then the input will be - * truncated to that number. - * - * @param actions the new actions to show in the picture-in-picture menu. - * - * @see RemoteAction - * - * TODO: Remove once we remove PictureInPictureArgs. + * @return the aspect ratio. If none is set, return 0. + * @hide */ - @Deprecated - public void setActions(List actions) { - if (mUserActions != null) { - mUserActions = null; + public float getAspectRatio() { + if (mAspectRatio != null) { + return mAspectRatio.floatValue(); } - if (actions != null) { - mUserActions = new ArrayList<>(actions); + return 0f; + } + + /** {@hide} */ + public Rational getAspectRatioRational() { + return mAspectRatio; + } + + /** + * @return whether the aspect ratio is set. + * @hide + */ + public boolean hasSetAspectRatio() { + return mAspectRatio != null; + } + + /** + * @return the set of user actions. + * @hide + */ + public List getActions() { + return mUserActions; + } + + /** + * @return whether the user actions are set. + * @hide + */ + public boolean hasSetActions() { + return mUserActions != null; + } + + /** + * Truncates the set of actions to the given {@param size}. + * @hide + */ + public void truncateActions(int size) { + if (hasSetActions()) { + mUserActions = mUserActions.subList(0, Math.min(mUserActions.size(), size)); } } /** - * Sets the source bounds hint. These bounds are only used when an activity first enters - * picture-in-picture, and describe the bounds in window coordinates of activity entering - * picture-in-picture that will be visible following the transition. For the best effect, these - * bounds should also match the aspect ratio in the arguments. - * - * TODO: Remove once we remove PictureInPictureArgs. + * Sets the insets to be used with the source rect hint bounds. + * @hide */ @Deprecated - public void setSourceRectHint(Rect launchBounds) { - if (launchBounds == null) { - mSourceRectHint = null; + public void setSourceRectHintInsets(Rect insets) { + if (insets == null) { + mSourceRectHintInsets = null; } else { - mSourceRectHint = new Rect(launchBounds); + mSourceRectHintInsets = new Rect(insets); } } -} \ No newline at end of file + + /** + * @return the source rect hint + * @hide + */ + public Rect getSourceRectHint() { + return mSourceRectHint; + } + + /** + * @return the source rect hint insets. + * @hide + */ + public Rect getSourceRectHintInsets() { + return mSourceRectHintInsets; + } + + /** + * @return whether there are launch bounds set + * @hide + */ + public boolean hasSourceBoundsHint() { + return mSourceRectHint != null && !mSourceRectHint.isEmpty(); + } + + /** + * @return whether there are source rect hint insets set + * @hide + */ + public boolean hasSourceBoundsHintInsets() { + return mSourceRectHintInsets != null; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + if (mAspectRatio != null) { + out.writeInt(1); + out.writeInt(mAspectRatio.getNumerator()); + out.writeInt(mAspectRatio.getDenominator()); + } else { + out.writeInt(0); + } + if (mUserActions != null) { + out.writeInt(1); + out.writeParcelableList(mUserActions, 0); + } else { + out.writeInt(0); + } + if (mSourceRectHint != null) { + out.writeInt(1); + mSourceRectHint.writeToParcel(out, 0); + } else { + out.writeInt(0); + } + if (mSourceRectHintInsets != null) { + out.writeInt(1); + mSourceRectHintInsets.writeToParcel(out, 0); + } else { + out.writeInt(0); + } + } + + public static final Creator CREATOR = + new Creator() { + public PictureInPictureArgs createFromParcel(Parcel in) { + return new PictureInPictureArgs(in); + } + public PictureInPictureArgs[] newArray(int size) { + return new PictureInPictureArgs[size]; + } + }; + + public static PictureInPictureArgs convert(PictureInPictureParams params) { + return new PictureInPictureArgs(params.getAspectRatioRational(), params.getActions(), + params.getSourceRectHint()); + } + + public static PictureInPictureParams convert(PictureInPictureArgs args) { + return new PictureInPictureParams(args.getAspectRatioRational(), args.getActions(), + args.getSourceRectHint()); + } +} diff --git a/core/java/android/app/PictureInPictureParams.java b/core/java/android/app/PictureInPictureParams.java index e1df33b55281..323a0fbaa5b1 100644 --- a/core/java/android/app/PictureInPictureParams.java +++ b/core/java/android/app/PictureInPictureParams.java @@ -28,10 +28,8 @@ import java.util.List; /** * Represents a set of parameters used to initialize and update an Activity in picture-in-picture * mode. - * - * TODO: Make this final after we remove PictureInPictureArgs */ -public class PictureInPictureParams implements Parcelable { +public final class PictureInPictureParams implements Parcelable { /** * Builder class for {@link PictureInPictureParams} objects. @@ -63,7 +61,7 @@ public class PictureInPictureParams implements Parcelable { /** * Sets the user actions. If there are more than - * {@link ActivityManager#getMaxNumPictureInPictureActions()} actions, then the input list + * {@link Activity#getMaxNumPictureInPictureActions()} actions, then the input list * will be truncated to that number. * * @param actions the new actions to show in the picture-in-picture menu. @@ -120,25 +118,22 @@ public class PictureInPictureParams implements Parcelable { /** * The expected aspect ratio of the picture-in-picture. */ - // TODO: Make private once we removed PictureInPictureArgs @Nullable - protected Rational mAspectRatio; + private Rational mAspectRatio; /** * The set of actions that are associated with this activity when in picture-in-picture. */ - // TODO: Make private once we removed PictureInPictureArgs @Nullable - protected List mUserActions; + private List mUserActions; /** * The source bounds hint used when entering picture-in-picture, relative to the window bounds. * We can use this internally for the transition into picture-in-picture to ensure that a * particular source rect is visible throughout the whole transition. */ - // TODO: Make private once we removed PictureInPictureArgs @Nullable - protected Rect mSourceRectHint; + private Rect mSourceRectHint; /** * The content insets that are used with the source hint rect for the transition into PiP where @@ -147,15 +142,12 @@ public class PictureInPictureParams implements Parcelable { @Nullable private Rect mSourceRectHintInsets; - /** - * TO BE REMOVED - */ - @Deprecated + /** {@hide} */ PictureInPictureParams() { - // TODO: Remove once we remove PictureInPictureArgs } - private PictureInPictureParams(Parcel in) { + /** {@hide} */ + PictureInPictureParams(Parcel in) { if (in.readInt() != 0) { mAspectRatio = new Rational(in.readInt(), in.readInt()); } @@ -171,7 +163,8 @@ public class PictureInPictureParams implements Parcelable { } } - private PictureInPictureParams(Rational aspectRatio, List actions, + /** {@hide} */ + PictureInPictureParams(Rational aspectRatio, List actions, Rect sourceRectHint) { mAspectRatio = aspectRatio; mUserActions = actions; @@ -208,6 +201,11 @@ public class PictureInPictureParams implements Parcelable { return 0f; } + /** @hide */ + public Rational getAspectRatioRational() { + return mAspectRatio; + } + /** * @return whether the aspect ratio is set. * @hide diff --git a/core/java/android/os/TestLooperManager.java b/core/java/android/os/TestLooperManager.java index 745642efc423..5e7549fa67d8 100644 --- a/core/java/android/os/TestLooperManager.java +++ b/core/java/android/os/TestLooperManager.java @@ -58,11 +58,17 @@ public class TestLooperManager { /** * Returns the {@link MessageQueue} this object is wrapping. */ - public MessageQueue getQueue() { + public MessageQueue getMessageQueue() { checkReleased(); return mQueue; } + /** @removed */ + @Deprecated + public MessageQueue getQueue() { + return getMessageQueue(); + } + /** * Returns the next message that should be executed by this queue, may block * if no messages are ready. diff --git a/core/java/android/service/autofill/AutofillService.java b/core/java/android/service/autofill/AutofillService.java index 416455d596be..88d17ef32c13 100644 --- a/core/java/android/service/autofill/AutofillService.java +++ b/core/java/android/service/autofill/AutofillService.java @@ -119,7 +119,7 @@ public abstract class AutofillService extends Service { try { onFillRequest(request, cancellation, fillCallback); } catch (AbstractMethodError e) { - final ArrayList contexts = request.getFillContexts(); + final List contexts = request.getFillContexts(); onFillRequest(contexts.get(contexts.size() - 1).getStructure(), request.getClientState(), request.getFlags(), cancellation, fillCallback); diff --git a/core/java/android/service/autofill/FillRequest.java b/core/java/android/service/autofill/FillRequest.java index 8ac399c776ec..b1145ee38929 100644 --- a/core/java/android/service/autofill/FillRequest.java +++ b/core/java/android/service/autofill/FillRequest.java @@ -29,6 +29,7 @@ import com.android.internal.util.Preconditions; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; +import java.util.List; /** * This class represents a request to an {@link AutofillService autofill provider} @@ -96,7 +97,7 @@ public final class FillRequest implements Parcelable { /** * @return The contexts associated with each previous fill request. */ - public @NonNull ArrayList getFillContexts() { + public @NonNull List getFillContexts() { return mContexts; } diff --git a/core/java/android/speech/tts/UtteranceProgressListener.java b/core/java/android/speech/tts/UtteranceProgressListener.java index ef81f1211364..7381a12af083 100644 --- a/core/java/android/speech/tts/UtteranceProgressListener.java +++ b/core/java/android/speech/tts/UtteranceProgressListener.java @@ -144,9 +144,8 @@ public abstract class UtteranceProgressListener { onUtteranceRangeStart(utteranceId, start, end); } - /** - * @deprecated Due to internal API changes. Remove when apps catch up. - */ + /** @removed */ + @Deprecated public void onUtteranceRangeStart(String utteranceId, int start, int end) { } diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java index 94ca562cedc8..bb367fb0ab71 100644 --- a/core/java/android/view/autofill/AutofillManager.java +++ b/core/java/android/view/autofill/AutofillManager.java @@ -95,7 +95,7 @@ public final class AutofillManager { * Type: {@link android.os.Bundle} */ public static final String EXTRA_CLIENT_STATE = - "android.view.autofill.extra.EXTRA_CLIENT_STATE"; + "android.view.autofill.extra.CLIENT_STATE"; static final String SESSION_ID_TAG = "android:sessionId"; static final String LAST_AUTOFILLED_DATA_TAG = "android:lastAutoFilledData"; -- GitLab From d74c0a79b5db12659c2750a0ec32da5ff9512ef1 Mon Sep 17 00:00:00 2001 From: Karthik Ravi Shankar Date: Fri, 28 Apr 2017 11:21:04 -0700 Subject: [PATCH 24/66] Change android.permission.RESTRICTED_VR_ACCESS to SystemAPI android.permission.RESTRICTED_VR_ACCESS is currently an open API. But since it can only be used by System Apps because of it's protection level which is "signature|preinstalled". Change this to a @SystemApi. Bug: 37724255 Test: run gts --module GtsPermissionTestCases 1. Run with two apps having android.permission.RESTRICTED_VR_ACCESS before change -- fails. 2. Run with two appshaving android.permission.RESTRICTED_VR_ACCESS after this change -- passes. Change-Id: I9e640b0794fa16d03ba22e8aa75175e7e08dd88b Signed-off-by: Karthik Ravi Shankar --- api/current.txt | 1 - api/test-current.txt | 1 - core/res/AndroidManifest.xml | 2 ++ 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/current.txt b/api/current.txt index 122f9b0452a2..8ff59cf3b38e 100644 --- a/api/current.txt +++ b/api/current.txt @@ -121,7 +121,6 @@ package android { field public static final java.lang.String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; field public static final java.lang.String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES"; field public static final deprecated java.lang.String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES"; - field public static final java.lang.String RESTRICTED_VR_ACCESS = "android.permission.RESTRICTED_VR_ACCESS"; field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE"; field public static final java.lang.String SEND_SMS = "android.permission.SEND_SMS"; field public static final java.lang.String SET_ALARM = "com.android.alarm.permission.SET_ALARM"; diff --git a/api/test-current.txt b/api/test-current.txt index 4e13e8802829..26e9ea362d91 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -121,7 +121,6 @@ package android { field public static final java.lang.String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; field public static final java.lang.String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES"; field public static final deprecated java.lang.String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES"; - field public static final java.lang.String RESTRICTED_VR_ACCESS = "android.permission.RESTRICTED_VR_ACCESS"; field public static final java.lang.String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE"; field public static final java.lang.String SEND_SMS = "android.permission.SEND_SMS"; field public static final java.lang.String SET_ALARM = "com.android.alarm.permission.SET_ALARM"; diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 5b4a454e3d97..4b39646e69a0 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -3353,6 +3353,8 @@ android:protectionLevel="signature" /> -- GitLab From 06a2d2bf2319eef2f81b6d8d3f980cc484999bc9 Mon Sep 17 00:00:00 2001 From: Yi Kong Date: Sun, 30 Apr 2017 23:51:33 -0700 Subject: [PATCH 25/66] Remove no-op std::max call This was calling std::max on an unsigned integer and 0, which is essentially no-op. Remove this code. Test: Build Bug: 37752547 Change-Id: I74ce45b95960621dff11f574fbe1af60ad147cf0 --- libs/hwui/JankTracker.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp index 2132c2b171dc..9c253c42cd8f 100644 --- a/libs/hwui/JankTracker.cpp +++ b/libs/hwui/JankTracker.cpp @@ -265,7 +265,6 @@ void JankTracker::addFrame(const FrameInfo& frame) { / kSlowFrameBucketIntervalMs; framebucket = std::min(framebucket, static_cast(mData->slowFrameCounts.size() - 1)); - framebucket = std::max(framebucket, 0u); mData->slowFrameCounts[framebucket]++; } -- GitLab From 4734cdbbc38752765376aedb0d5208463674535e Mon Sep 17 00:00:00 2001 From: Lorenzo Colitti Date: Thu, 27 Apr 2017 14:30:21 +0900 Subject: [PATCH 26/66] Add a method to start the captive portal login app. Bug: 36203355 Bug: 36656914 Test: ConnectivityServiceTest (including new test) passes Change-Id: I82a9a9a8da47870ba3f1bbef5941b37e970c844f --- .../java/android/net/ConnectivityManager.java | 16 +++++ .../android/net/IConnectivityManager.aidl | 1 + .../android/server/ConnectivityService.java | 11 +++ .../server/connectivity/NetworkMonitor.java | 8 ++- .../server/ConnectivityServiceTest.java | 72 ++++++++++++++++++- 5 files changed, 104 insertions(+), 4 deletions(-) diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 2f2e79af57d4..b0cc38c2cf3e 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -3355,6 +3355,22 @@ public class ConnectivityManager { } } + /** + * Requests that the system open the captive portal app on the specified network. + * + * @param network The network to log into. + * + * @hide + */ + @RequiresPermission(android.Manifest.permission.CONNECTIVITY_INTERNAL) + public void startCaptivePortalApp(Network network) { + try { + mService.startCaptivePortalApp(network); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + /** * It is acceptable to briefly use multipath data to provide seamless connectivity for * time-sensitive user-facing operations when the system default network is temporarily diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index 425e49407827..6b2da61f74bc 100644 --- a/core/java/android/net/IConnectivityManager.aidl +++ b/core/java/android/net/IConnectivityManager.aidl @@ -160,6 +160,7 @@ interface IConnectivityManager void setAcceptUnvalidated(in Network network, boolean accept, boolean always); void setAvoidUnvalidated(in Network network); + void startCaptivePortalApp(in Network network); int getMultipathPreference(in Network Network); diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index d5adf4856d47..7ae413892733 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -2636,6 +2636,17 @@ public class ConnectivityService extends IConnectivityManager.Stub PROMPT_UNVALIDATED_DELAY_MS); } + @Override + public void startCaptivePortalApp(Network network) { + enforceConnectivityInternalPermission(); + mHandler.post(() -> { + NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(network); + if (nai == null) return; + if (!nai.networkCapabilities.hasCapability(NET_CAPABILITY_CAPTIVE_PORTAL)) return; + nai.networkMonitor.sendMessage(NetworkMonitor.CMD_LAUNCH_CAPTIVE_PORTAL_APP); + }); + } + public boolean avoidBadWifi() { return mMultinetworkPolicyTracker.getAvoidBadWifi(); } diff --git a/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/services/core/java/com/android/server/connectivity/NetworkMonitor.java index d3c74e6d755a..96f6f2d82c4c 100644 --- a/services/core/java/com/android/server/connectivity/NetworkMonitor.java +++ b/services/core/java/com/android/server/connectivity/NetworkMonitor.java @@ -197,11 +197,13 @@ public class NetworkMonitor extends StateMachine { public static final int EVENT_PROVISIONING_NOTIFICATION = BASE + 10; /** - * Message to self indicating sign-in app should be launched. + * Message indicating sign-in app should be launched. * Sent by mLaunchCaptivePortalAppBroadcastReceiver when the - * user touches the sign in notification. + * user touches the sign in notification, or sent by + * ConnectivityService when the user touches the "sign into + * network" button in the wifi access point detail page. */ - private static final int CMD_LAUNCH_CAPTIVE_PORTAL_APP = BASE + 11; + public static final int CMD_LAUNCH_CAPTIVE_PORTAL_APP = BASE + 11; /** * Retest network to see if captive portal is still in place. diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java index 6140a896b1a8..6e5ac8a47b6f 100644 --- a/tests/net/java/com/android/server/ConnectivityServiceTest.java +++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java @@ -39,6 +39,7 @@ import android.content.ContextWrapper; import android.content.Intent; import android.content.IntentFilter; import android.content.res.Resources; +import android.net.CaptivePortal; import android.net.ConnectivityManager; import android.net.ConnectivityManager.NetworkCallback; import android.net.ConnectivityManager.PacketKeepalive; @@ -77,6 +78,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.os.Process; import android.os.SystemClock; +import android.os.UserHandle; import android.provider.Settings; import android.test.AndroidTestCase; import android.test.mock.MockContentResolver; @@ -121,7 +123,7 @@ public class ConnectivityServiceTest extends AndroidTestCase { private static final int TIMEOUT_MS = 500; private static final int TEST_LINGER_DELAY_MS = 120; - private BroadcastInterceptingContext mServiceContext; + private MockContext mServiceContext; private WrappedConnectivityService mService; private WrappedConnectivityManager mCm; private MockNetworkAgent mWiFiNetworkAgent; @@ -152,6 +154,7 @@ public class ConnectivityServiceTest extends AndroidTestCase { private final MockContentResolver mContentResolver; @Spy private Resources mResources; + private final LinkedBlockingQueue mStartedActivities = new LinkedBlockingQueue<>(); MockContext(Context base) { super(base); @@ -168,6 +171,27 @@ public class ConnectivityServiceTest extends AndroidTestCase { mContentResolver.addProvider(Settings.AUTHORITY, new FakeSettingsProvider()); } + @Override + public void startActivityAsUser(Intent intent, UserHandle handle) { + mStartedActivities.offer(intent); + } + + public Intent expectStartActivityIntent(int timeoutMs) { + Intent intent = null; + try { + intent = mStartedActivities.poll(timeoutMs, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) {} + assertNotNull("Did not receive sign-in intent after " + timeoutMs + "ms", intent); + return intent; + } + + public void expectNoStartActivityIntent(int timeoutMs) { + try { + assertNull("Received unexpected Intent to start activity", + mStartedActivities.poll(timeoutMs, TimeUnit.MILLISECONDS)); + } catch (InterruptedException e) {} + } + @Override public Object getSystemService(String name) { if (Context.CONNECTIVITY_SERVICE.equals(name)) return mCm; @@ -1829,6 +1853,52 @@ public class ConnectivityServiceTest extends AndroidTestCase { validatedCallback.expectCallback(CallbackState.LOST, mWiFiNetworkAgent); } + @SmallTest + public void testCaptivePortalApp() { + final TestNetworkCallback captivePortalCallback = new TestNetworkCallback(); + final NetworkRequest captivePortalRequest = new NetworkRequest.Builder() + .addCapability(NET_CAPABILITY_CAPTIVE_PORTAL).build(); + mCm.registerNetworkCallback(captivePortalRequest, captivePortalCallback); + + final TestNetworkCallback validatedCallback = new TestNetworkCallback(); + final NetworkRequest validatedRequest = new NetworkRequest.Builder() + .addCapability(NET_CAPABILITY_VALIDATED).build(); + mCm.registerNetworkCallback(validatedRequest, validatedCallback); + + // Bring up wifi. + mWiFiNetworkAgent = new MockNetworkAgent(TRANSPORT_WIFI); + mWiFiNetworkAgent.connect(true); + validatedCallback.expectAvailableAndValidatedCallbacks(mWiFiNetworkAgent); + Network wifiNetwork = mWiFiNetworkAgent.getNetwork(); + + // Check that calling startCaptivePortalApp does nothing. + final int fastTimeoutMs = 100; + mCm.startCaptivePortalApp(wifiNetwork); + mServiceContext.expectNoStartActivityIntent(fastTimeoutMs); + + // Turn into a captive portal. + mWiFiNetworkAgent.getWrappedNetworkMonitor().gen204ProbeResult = 302; + mCm.reportNetworkConnectivity(wifiNetwork, false); + captivePortalCallback.expectAvailableCallbacks(mWiFiNetworkAgent); + validatedCallback.expectCallback(CallbackState.LOST, mWiFiNetworkAgent); + + // Check that startCaptivePortalApp sends the expected intent. + mCm.startCaptivePortalApp(wifiNetwork); + Intent intent = mServiceContext.expectStartActivityIntent(TIMEOUT_MS); + assertEquals(ConnectivityManager.ACTION_CAPTIVE_PORTAL_SIGN_IN, intent.getAction()); + assertEquals(wifiNetwork, intent.getExtra(ConnectivityManager.EXTRA_NETWORK)); + + // Have the app report that the captive portal is dismissed, and check that we revalidate. + mWiFiNetworkAgent.getWrappedNetworkMonitor().gen204ProbeResult = 204; + CaptivePortal c = (CaptivePortal) intent.getExtra(ConnectivityManager.EXTRA_CAPTIVE_PORTAL); + c.reportCaptivePortalDismissed(); + validatedCallback.expectAvailableCallbacks(mWiFiNetworkAgent); + captivePortalCallback.expectCallback(CallbackState.LOST, mWiFiNetworkAgent); + + mCm.unregisterNetworkCallback(validatedCallback); + mCm.unregisterNetworkCallback(captivePortalCallback); + } + @SmallTest public void testAvoidOrIgnoreCaptivePortals() { final TestNetworkCallback captivePortalCallback = new TestNetworkCallback(); -- GitLab From 287a1310acc608ee2983cc2734616a28e4d113d6 Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Mon, 1 May 2017 10:03:58 -0400 Subject: [PATCH 27/66] remove unused private field Test: CtsGraphicsTests Change-Id: I611f5dc127636f67dc219ef15adc0a591a72a95e --- core/jni/com_google_android_gles_jni_EGLImpl.cpp | 10 ---------- .../com/google/android/gles_jni/EGLSurfaceImpl.java | 3 --- 2 files changed, 13 deletions(-) diff --git a/core/jni/com_google_android_gles_jni_EGLImpl.cpp b/core/jni/com_google_android_gles_jni_EGLImpl.cpp index d0ce1927b108..c00d698770b3 100644 --- a/core/jni/com_google_android_gles_jni_EGLImpl.cpp +++ b/core/jni/com_google_android_gles_jni_EGLImpl.cpp @@ -45,7 +45,6 @@ static jmethodID gConfig_ctorID; static jfieldID gDisplay_EGLDisplayFieldID; static jfieldID gContext_EGLContextFieldID; static jfieldID gSurface_EGLSurfaceFieldID; -static jfieldID gSurface_NativePixelRefFieldID; static jfieldID gConfig_EGLConfigFieldID; static inline EGLDisplay getDisplay(JNIEnv* env, jobject o) { @@ -84,7 +83,6 @@ static void nativeClassInit(JNIEnv *_env, jclass eglImplClass) jclass surface_class = _env->FindClass("com/google/android/gles_jni/EGLSurfaceImpl"); gSurface_EGLSurfaceFieldID = _env->GetFieldID(surface_class, "mEGLSurface", "J"); - gSurface_NativePixelRefFieldID = _env->GetFieldID(surface_class, "mNativePixelRef", "J"); } static const jint gNull_attrib_base[] = {EGL_NONE}; @@ -398,14 +396,6 @@ static jboolean jni_eglDestroySurface(JNIEnv *_env, jobject _this, jobject displ } EGLDisplay dpy = getDisplay(_env, display); EGLSurface sur = getSurface(_env, surface); - - if (sur) { - SkPixelRef* ref = (SkPixelRef*)(_env->GetLongField(surface, - gSurface_NativePixelRefFieldID)); - if (ref) { - SkSafeUnref(ref); - } - } return EglBoolToJBool(eglDestroySurface(dpy, sur)); } diff --git a/opengl/java/com/google/android/gles_jni/EGLSurfaceImpl.java b/opengl/java/com/google/android/gles_jni/EGLSurfaceImpl.java index 7a3ed24f8811..21c350be7c39 100644 --- a/opengl/java/com/google/android/gles_jni/EGLSurfaceImpl.java +++ b/opengl/java/com/google/android/gles_jni/EGLSurfaceImpl.java @@ -20,14 +20,11 @@ import javax.microedition.khronos.egl.*; public class EGLSurfaceImpl extends EGLSurface { long mEGLSurface; - private long mNativePixelRef; public EGLSurfaceImpl() { mEGLSurface = 0; - mNativePixelRef = 0; } public EGLSurfaceImpl(long surface) { mEGLSurface = surface; - mNativePixelRef = 0; } @Override -- GitLab From 316c9ce6949b8a3799227b20f3beecdbf049a9ee Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Sun, 30 Apr 2017 18:33:25 -0700 Subject: [PATCH 28/66] Add missing symbol Bug: 35998031 Test: builds Change-Id: Ie085b4058c5714df9913ceb9fd03fb4658168520 --- core/java/android/provider/Settings.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 35a3c0c0d8c1..3f3f8590abc0 100755 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -4719,6 +4719,13 @@ public final class Settings { @TestApi public static final String VOICE_INTERACTION_SERVICE = "voice_interaction_service"; + /** + * bluetooth HCI snoop log configuration + * @hide + */ + public static final String BLUETOOTH_HCI_LOG = + "bluetooth_hci_log"; + /** * @deprecated Use {@link android.provider.Settings.Global#DEVICE_PROVISIONED} instead */ -- GitLab From a8b766fb73641ab67194a54391305bdc9cfc1cdd Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Tue, 7 Mar 2017 16:30:21 -0500 Subject: [PATCH 29/66] Do not unsnooze canceled notifications. Test: runtest systemui-notification Change-Id: I3edef5822aa74359bf3a34f54f59d4021696365d --- .../NotificationManagerService.java | 14 +++-- .../server/notification/SnoozeHelper.java | 52 +++++++------------ .../server/notification/SnoozeHelperTest.java | 50 ++++++++++++++---- .../statusbartest/NotificationTestList.java | 17 ++++++ 4 files changed, 85 insertions(+), 48 deletions(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 8b8420571db4..ed47c3e55b74 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -4217,7 +4217,9 @@ public class NotificationManagerService extends SystemService { if (wasPosted) { // status bar if (r.getNotification().getSmallIcon() != null) { - r.isCanceled = true; + if (reason != REASON_SNOOZED) { + r.isCanceled = true; + } mListeners.notifyRemovedLocked(r.sbn, reason); mHandler.post(new Runnable() { @Override @@ -4340,9 +4342,11 @@ public class NotificationManagerService extends SystemService { updateLightsLocked(); } else { // No notification was found, assume that it is snoozed and cancel it. - final boolean wasSnoozed = mSnoozeHelper.cancel(userId, pkg, tag, id); - if (wasSnoozed) { - savePolicyFile(); + if (reason != REASON_SNOOZED) { + final boolean wasSnoozed = mSnoozeHelper.cancel(userId, pkg, tag, id); + if (wasSnoozed) { + savePolicyFile(); + } } } } @@ -4472,7 +4476,7 @@ public class NotificationManagerService extends SystemService { void snoozeNotificationInt(String key, long duration, String snoozeCriterionId, ManagedServiceInfo listener) { String listenerName = listener == null ? null : listener.component.toShortString(); - if (duration <= 0 && snoozeCriterionId == null) { + if (duration <= 0 && snoozeCriterionId == null || key == null) { return; } diff --git a/services/core/java/com/android/server/notification/SnoozeHelper.java b/services/core/java/com/android/server/notification/SnoozeHelper.java index 42b4f573dfcc..a178a525cede 100644 --- a/services/core/java/com/android/server/notification/SnoozeHelper.java +++ b/services/core/java/com/android/server/notification/SnoozeHelper.java @@ -167,16 +167,10 @@ public class SnoozeHelper { for (Map.Entry record : records) { final StatusBarNotification sbn = record.getValue().sbn; if (Objects.equals(sbn.getTag(), tag) && sbn.getId() == id) { - key = record.getKey(); + record.getValue().isCanceled = true; + return true; } } - if (key != null) { - recordsForPkg.remove(key); - cancelAlarm(userId, pkg, key); - mPackages.remove(key); - mUsers.remove(key); - return true; - } } } return false; @@ -190,7 +184,7 @@ public class SnoozeHelper { final int N = userIds.length; for (int i = 0; i < N; i++) { final ArrayMap> snoozedPkgs = - mSnoozedNotifications.remove(userIds[i]); + mSnoozedNotifications.get(userIds[i]); if (snoozedPkgs != null) { final int M = snoozedPkgs.size(); for (int j = 0; j < M; j++) { @@ -198,10 +192,7 @@ public class SnoozeHelper { if (records != null) { int P = records.size(); for (int k = 0; k < P; k++) { - final String key = records.keyAt(k); - cancelAlarm(userId, snoozedPkgs.keyAt(j), key); - mPackages.remove(key); - mUsers.remove(key); + records.valueAt(k).isCanceled = true; } } } @@ -215,13 +206,10 @@ public class SnoozeHelper { if (mSnoozedNotifications.containsKey(userId)) { if (mSnoozedNotifications.get(userId).containsKey(pkg)) { ArrayMap records = - mSnoozedNotifications.get(userId).remove(pkg); + mSnoozedNotifications.get(userId).get(pkg); int N = records.size(); for (int i = 0; i < N; i++) { - final String key = records.keyAt(i); - cancelAlarm(userId, pkg, key); - mPackages.remove(key); - mUsers.remove(key); + records.valueAt(i).isCanceled = true; } return true; } @@ -229,16 +217,6 @@ public class SnoozeHelper { return false; } - private void cancelAlarm(int userId, String pkg, String key) { - long identity = Binder.clearCallingIdentity(); - try { - final PendingIntent pi = createPendingIntent(pkg, key, userId); - mAm.cancel(pi); - } finally { - Binder.restoreCallingIdentity(identity); - } - } - /** * Updates the notification record so the most up to date information is shown on re-post. */ @@ -252,6 +230,10 @@ public class SnoozeHelper { if (pkgRecords == null) { return; } + NotificationRecord existing = pkgRecords.get(record.getKey()); + if (existing != null && existing.isCanceled) { + return; + } pkgRecords.put(record.getKey(), record); } @@ -274,8 +256,10 @@ public class SnoozeHelper { return; } final NotificationRecord record = pkgRecords.remove(key); + mPackages.remove(key); + mUsers.remove(key); - if (record != null) { + if (record != null && !record.isCanceled) { MetricsLogger.action(record.getLogMaker() .setCategory(MetricsProto.MetricsEvent.NOTIFICATION_SNOOZED) .setType(MetricsProto.MetricsEvent.TYPE_OPEN)); @@ -309,10 +293,12 @@ public class SnoozeHelper { mPackages.remove(groupSummaryKey); mUsers.remove(groupSummaryKey); - MetricsLogger.action(record.getLogMaker() - .setCategory(MetricsProto.MetricsEvent.NOTIFICATION_SNOOZED) - .setType(MetricsProto.MetricsEvent.TYPE_OPEN)); - mCallback.repost(userId, record); + if (record != null && !record.isCanceled) { + MetricsLogger.action(record.getLogMaker() + .setCategory(MetricsProto.MetricsEvent.NOTIFICATION_SNOOZED) + .setType(MetricsProto.MetricsEvent.TYPE_OPEN)); + mCallback.repost(userId, record); + } } } } diff --git a/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java b/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java index 51ec05c51b07..bc25860e8e92 100644 --- a/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java +++ b/services/tests/notification/src/com/android/server/notification/SnoozeHelperTest.java @@ -107,9 +107,9 @@ public class SnoozeHelperTest { UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey())); mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, r.sbn.getPackageName(), "one", 1); - // 3 = one for each snooze, above + one for cancel itself. - verify(mAm, times(3)).cancel(any(PendingIntent.class)); - assertFalse(mSnoozeHelper.isSnoozed( + // 2 = one for each snooze, above, zero for the cancel. + verify(mAm, times(2)).cancel(any(PendingIntent.class)); + assertTrue(mSnoozeHelper.isSnoozed( UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey())); assertTrue(mSnoozeHelper.isSnoozed( UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey())); @@ -131,11 +131,11 @@ public class SnoozeHelperTest { UserHandle.USER_ALL, r3.sbn.getPackageName(), r3.getKey())); mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, false); - // 5 = once for each snooze above (3) + once for each notification canceled (2). - verify(mAm, times(5)).cancel(any(PendingIntent.class)); - assertFalse(mSnoozeHelper.isSnoozed( + // 3 = once for each snooze above (3), only. + verify(mAm, times(3)).cancel(any(PendingIntent.class)); + assertTrue(mSnoozeHelper.isSnoozed( UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey())); - assertFalse(mSnoozeHelper.isSnoozed( + assertTrue(mSnoozeHelper.isSnoozed( UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey())); assertTrue(mSnoozeHelper.isSnoozed( UserHandle.USER_ALL, r3.sbn.getPackageName(), r3.getKey())); @@ -157,16 +157,46 @@ public class SnoozeHelperTest { UserHandle.USER_SYSTEM, r3.sbn.getPackageName(), r3.getKey())); mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, "pkg2"); - // 4 = once for each snooze above (3) + once for each notification canceled (1). - verify(mAm, times(4)).cancel(any(PendingIntent.class)); + // 3 = once for each snooze above (3), only. + verify(mAm, times(3)).cancel(any(PendingIntent.class)); assertTrue(mSnoozeHelper.isSnoozed( UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey())); assertTrue(mSnoozeHelper.isSnoozed( UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey())); - assertFalse(mSnoozeHelper.isSnoozed( + assertTrue(mSnoozeHelper.isSnoozed( UserHandle.USER_SYSTEM, r3.sbn.getPackageName(), r3.getKey())); } + @Test + public void testCancelDoesNotUnsnooze() throws Exception { + NotificationRecord r = getNotificationRecord("pkg", 1, "one", UserHandle.SYSTEM); + mSnoozeHelper.snooze(r, 1000); + assertTrue(mSnoozeHelper.isSnoozed( + UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey())); + + mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, r.sbn.getPackageName(), "one", 1); + + assertTrue(mSnoozeHelper.isSnoozed( + UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey())); + } + + @Test + public void testCancelDoesNotRepost() throws Exception { + NotificationRecord r = getNotificationRecord("pkg", 1, "one", UserHandle.SYSTEM); + NotificationRecord r2 = getNotificationRecord("pkg", 2, "two", UserHandle.SYSTEM); + mSnoozeHelper.snooze(r, 1000); + mSnoozeHelper.snooze(r2 , 1000); + assertTrue(mSnoozeHelper.isSnoozed( + UserHandle.USER_SYSTEM, r.sbn.getPackageName(), r.getKey())); + assertTrue(mSnoozeHelper.isSnoozed( + UserHandle.USER_SYSTEM, r2.sbn.getPackageName(), r2.getKey())); + + mSnoozeHelper.cancel(UserHandle.USER_SYSTEM, r.sbn.getPackageName(), "one", 1); + + mSnoozeHelper.repost(r.getKey(), UserHandle.USER_SYSTEM); + verify(mCallback, never()).repost(UserHandle.USER_SYSTEM, r); + } + @Test public void testRepost() throws Exception { NotificationRecord r = getNotificationRecord("pkg", 1, "one", UserHandle.SYSTEM); diff --git a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java index 93677e35dc4f..5dd42dd21c90 100644 --- a/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java +++ b/tests/StatusBar/src/com/android/statusbartest/NotificationTestList.java @@ -385,6 +385,23 @@ public class NotificationTestList extends TestActivity mNM.notify("timeout_min", 7013, n); } }, + new Test("Too many cancels") { + public void run() + { + mNM.cancelAll(); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + Notification n = new Notification.Builder(NotificationTestList.this, "default") + .setSmallIcon(R.drawable.icon2) + .setContentTitle("Cancel then post") + .setContentText("instead of just updating the existing notification") + .build(); + mNM.notify("cancel_madness", 7014, n); + } + }, new Test("Off") { public void run() { PowerManager pm = (PowerManager) NotificationTestList.this.getSystemService( -- GitLab From c93c3b9cf378e84b8a6f8fdb519a11c51d748a45 Mon Sep 17 00:00:00 2001 From: Holly Jiuyu Sun Date: Fri, 28 Apr 2017 15:34:44 -0700 Subject: [PATCH 30/66] Rename restartOnConfigChanges to recreateOnConfigChanges. Bug: 37738136 Test: unit test Change-Id: Icea9faf1d7f55b875d6ff9e4cc9aed4868637895 --- api/current.txt | 2 +- api/system-current.txt | 2 +- api/test-current.txt | 2 +- .../android/content/pm/PackageParser.java | 14 +++++----- core/res/res/values/attrs_manifest.xml | 22 ++++++++-------- core/res/res/values/public.xml | 2 +- .../android/content/pm/PackageParserTest.java | 26 +++++++++---------- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/api/current.txt b/api/current.txt index 23919f7df7bf..49f7b9697270 100644 --- a/api/current.txt +++ b/api/current.txt @@ -1062,6 +1062,7 @@ package android { field public static final int ratingBarStyleSmall = 16842877; // 0x101007d field public static final int readPermission = 16842759; // 0x1010007 field public static final int recognitionService = 16843932; // 0x101049c + field public static final int recreateOnConfigChanges = 16844105; // 0x1010549 field public static final int recycleEnabled = 16844124; // 0x101055c field public static final int relinquishTaskIdentity = 16843894; // 0x1010476 field public static final int reparent = 16843964; // 0x10104bc @@ -1086,7 +1087,6 @@ package android { field public static final int resizeable = 16843405; // 0x101028d field public static final int resizeableActivity = 16844022; // 0x10104f6 field public static final int resource = 16842789; // 0x1010025 - field public static final int restartOnConfigChanges = 16844105; // 0x1010549 field public static final int restoreAnyVersion = 16843450; // 0x10102ba field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d field public static final int restrictedAccountType = 16843733; // 0x10103d5 diff --git a/api/system-current.txt b/api/system-current.txt index aff5b1d0b56f..6a7e43c71c28 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -1182,6 +1182,7 @@ package android { field public static final int ratingBarStyleSmall = 16842877; // 0x101007d field public static final int readPermission = 16842759; // 0x1010007 field public static final int recognitionService = 16843932; // 0x101049c + field public static final int recreateOnConfigChanges = 16844105; // 0x1010549 field public static final int recycleEnabled = 16844124; // 0x101055c field public static final int relinquishTaskIdentity = 16843894; // 0x1010476 field public static final int reparent = 16843964; // 0x10104bc @@ -1208,7 +1209,6 @@ package android { field public static final int resizeable = 16843405; // 0x101028d field public static final int resizeableActivity = 16844022; // 0x10104f6 field public static final int resource = 16842789; // 0x1010025 - field public static final int restartOnConfigChanges = 16844105; // 0x1010549 field public static final int restoreAnyVersion = 16843450; // 0x10102ba field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d field public static final int restrictedAccountType = 16843733; // 0x10103d5 diff --git a/api/test-current.txt b/api/test-current.txt index d2e9ff19614d..e8972ad52210 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -1062,6 +1062,7 @@ package android { field public static final int ratingBarStyleSmall = 16842877; // 0x101007d field public static final int readPermission = 16842759; // 0x1010007 field public static final int recognitionService = 16843932; // 0x101049c + field public static final int recreateOnConfigChanges = 16844105; // 0x1010549 field public static final int recycleEnabled = 16844124; // 0x101055c field public static final int relinquishTaskIdentity = 16843894; // 0x1010476 field public static final int reparent = 16843964; // 0x10104bc @@ -1086,7 +1087,6 @@ package android { field public static final int resizeable = 16843405; // 0x101028d field public static final int resizeableActivity = 16844022; // 0x10104f6 field public static final int resource = 16842789; // 0x1010025 - field public static final int restartOnConfigChanges = 16844105; // 0x1010549 field public static final int restoreAnyVersion = 16843450; // 0x10102ba field public static final deprecated int restoreNeedsApplication = 16843421; // 0x101029d field public static final int restrictedAccountType = 16843733; // 0x10103d5 diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 101317784c17..9b0bab427478 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -201,10 +201,10 @@ public class PackageParser { private static final String META_DATA_INSTANT_APPS = "instantapps.clients.allowed"; /** - * Bit mask of all the valid bits that can be set in restartOnConfigChanges. + * Bit mask of all the valid bits that can be set in recreateOnConfigChanges. * @hide */ - private static final int RESTART_ON_CONFIG_CHANGES_MASK = + private static final int RECREATE_ON_CONFIG_CHANGES_MASK = ActivityInfo.CONFIG_MCC | ActivityInfo.CONFIG_MNC; // These are the tags supported by child packages @@ -4219,7 +4219,7 @@ public class PackageParser { ActivityManager.getDefaultAppRecentsLimitStatic()); a.info.configChanges = getActivityConfigChanges( sa.getInt(R.styleable.AndroidManifestActivity_configChanges, 0), - sa.getInt(R.styleable.AndroidManifestActivity_restartOnConfigChanges, 0)); + sa.getInt(R.styleable.AndroidManifestActivity_recreateOnConfigChanges, 0)); a.info.softInputMode = sa.getInt( R.styleable.AndroidManifestActivity_windowSoftInputMode, 0); @@ -4523,13 +4523,13 @@ public class PackageParser { /** * @param configChanges The bit mask of configChanges fetched from AndroidManifest.xml. - * @param restartOnConfigChanges The bit mask restartOnConfigChanges fetched from - * AndroidManifest.xml. + * @param recreateOnConfigChanges The bit mask recreateOnConfigChanges fetched from + * AndroidManifest.xml. * @hide Exposed for unit testing only. */ @TestApi - public static int getActivityConfigChanges(int configChanges, int restartOnConfigChanges) { - return configChanges | ((~restartOnConfigChanges) & RESTART_ON_CONFIG_CHANGES_MASK); + public static int getActivityConfigChanges(int configChanges, int recreateOnConfigChanges) { + return configChanges | ((~recreateOnConfigChanges) & RECREATE_ON_CONFIG_CHANGES_MASK); } private void parseLayout(Resources res, AttributeSet attrs, Activity a) { diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml index b7bc7b7a5fe3..ced22cc37f5a 100644 --- a/core/res/res/values/attrs_manifest.xml +++ b/core/res/res/values/attrs_manifest.xml @@ -784,13 +784,13 @@ - - + be recreated, specify them in recreateOnConfigChanges. --> + @@ -817,15 +817,15 @@ + don't recreate the activity even the app doesn't specify mcc in + configChanges. If the app wants to recreate the activity, specify + mcc in recreateOnConfigChanges. --> + don't recreate the activity even the app doesn't specify mnc in + configChanges. If the app wants to recreate the acvitity, specify + mnc in recreateOnConfigChanges. --> @@ -2048,7 +2048,7 @@ - + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 17f4d39a3251..c0364b61ef67 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2786,7 +2786,7 @@ - + diff --git a/core/tests/coretests/src/android/content/pm/PackageParserTest.java b/core/tests/coretests/src/android/content/pm/PackageParserTest.java index ca4141afae2d..b9bd193ad48c 100644 --- a/core/tests/coretests/src/android/content/pm/PackageParserTest.java +++ b/core/tests/coretests/src/android/content/pm/PackageParserTest.java @@ -220,41 +220,41 @@ public class PackageParserTest { * Unit test for PackageParser.getActivityConfigChanges(). * If the bit is 1 in the original configChanges, it is still 1 in the final configChanges. * If the bit is 0 in the original configChanges and the bit is not set to 1 in - * restartOnConfigChanges, the bit is changed to 1 in the final configChanges by default. + * recreateOnConfigChanges, the bit is changed to 1 in the final configChanges by default. */ @Test public void testGetActivityConfigChanges() { - // Not set in either configChanges or restartOnConfigChanges. + // Not set in either configChanges or recreateOnConfigChanges. int configChanges = 0x0000; // 00000000. - int restartOnConfigChanges = 0x0000; // 00000000. + int recreateOnConfigChanges = 0x0000; // 00000000. int finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0003, finalConfigChanges); // Should be 00000011. - // Not set in configChanges, but set in restartOnConfigChanges. + // Not set in configChanges, but set in recreateOnConfigChanges. configChanges = 0x0000; // 00000000. - restartOnConfigChanges = 0x0003; // 00000011. + recreateOnConfigChanges = 0x0003; // 00000011. finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0000, finalConfigChanges); // Should be 00000000. // Set in configChanges. configChanges = 0x0003; // 00000011. - restartOnConfigChanges = 0X0000; // 00000000. + recreateOnConfigChanges = 0X0000; // 00000000. finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0003, finalConfigChanges); // Should be 00000011. - restartOnConfigChanges = 0x0003; // 00000011. + recreateOnConfigChanges = 0x0003; // 00000011. finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0003, finalConfigChanges); // Should still be 00000011. // Other bit set in configChanges. configChanges = 0x0080; // 10000000, orientation. - restartOnConfigChanges = 0x0000; // 00000000. + recreateOnConfigChanges = 0x0000; // 00000000. finalConfigChanges = - PackageParser.getActivityConfigChanges(configChanges, restartOnConfigChanges); + PackageParser.getActivityConfigChanges(configChanges, recreateOnConfigChanges); assertEquals(0x0083, finalConfigChanges); // Should be 10000011. } } -- GitLab From 5cf8f94273328ab2225e8b8b622e0553b9292189 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 28 Apr 2017 13:07:46 -0700 Subject: [PATCH 31/66] Removing unnecessary asset. Bug: 37743450 Test: None, just removing asset Change-Id: Icbf8c2fd08b3f0ad52ced3dcd8766cd9d055d5fb --- api/current.txt | 1 - api/system-current.txt | 1 - api/test-current.txt | 1 - .../res/drawable/ic_picture_in_picture.xml | 28 ------------------- core/res/res/values/public.xml | 5 ---- 5 files changed, 36 deletions(-) delete mode 100644 core/res/res/drawable/ic_picture_in_picture.xml diff --git a/api/current.txt b/api/current.txt index eec812c47d66..cbb025aa49bf 100644 --- a/api/current.txt +++ b/api/current.txt @@ -1708,7 +1708,6 @@ package android { field public static final int ic_notification_clear_all = 17301594; // 0x108005a field public static final int ic_notification_overlay = 17301595; // 0x108005b field public static final int ic_partial_secure = 17301596; // 0x108005c - field public static final int ic_picture_in_picture = 17301685; // 0x10800b5 field public static final int ic_popup_disk_full = 17301597; // 0x108005d field public static final int ic_popup_reminder = 17301598; // 0x108005e field public static final int ic_popup_sync = 17301599; // 0x108005f diff --git a/api/system-current.txt b/api/system-current.txt index aff5b1d0b56f..f0e58b168fcd 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -1835,7 +1835,6 @@ package android { field public static final int ic_notification_clear_all = 17301594; // 0x108005a field public static final int ic_notification_overlay = 17301595; // 0x108005b field public static final int ic_partial_secure = 17301596; // 0x108005c - field public static final int ic_picture_in_picture = 17301685; // 0x10800b5 field public static final int ic_popup_disk_full = 17301597; // 0x108005d field public static final int ic_popup_reminder = 17301598; // 0x108005e field public static final int ic_popup_sync = 17301599; // 0x108005f diff --git a/api/test-current.txt b/api/test-current.txt index 5bc666e55632..d500c21f164e 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -1708,7 +1708,6 @@ package android { field public static final int ic_notification_clear_all = 17301594; // 0x108005a field public static final int ic_notification_overlay = 17301595; // 0x108005b field public static final int ic_partial_secure = 17301596; // 0x108005c - field public static final int ic_picture_in_picture = 17301685; // 0x10800b5 field public static final int ic_popup_disk_full = 17301597; // 0x108005d field public static final int ic_popup_reminder = 17301598; // 0x108005e field public static final int ic_popup_sync = 17301599; // 0x108005f diff --git a/core/res/res/drawable/ic_picture_in_picture.xml b/core/res/res/drawable/ic_picture_in_picture.xml deleted file mode 100644 index e2dda336f8f7..000000000000 --- a/core/res/res/drawable/ic_picture_in_picture.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 17f4d39a3251..d8b785087ddd 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2834,11 +2834,6 @@ - - - - - -- GitLab From 967501ec982f14fec6a160c03e34cd2d296d7128 Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Mon, 1 May 2017 09:41:14 -0700 Subject: [PATCH 32/66] hotspot2: update method name for timestamp related APIs Bug: 37514629 Test: build Change-Id: Iadd8b7a9ea98bc01f796a261293f87173ba1d52f --- api/current.txt | 20 +++--- api/system-current.txt | 20 +++--- api/test-current.txt | 20 +++--- .../wifi/hotspot2/PasspointConfiguration.java | 72 +++++++++---------- .../net/wifi/hotspot2/omadm/PpsMoParser.java | 10 +-- .../net/wifi/hotspot2/pps/Credential.java | 46 ++++++------ .../hotspot2/PasspointConfigurationTest.java | 6 +- .../wifi/hotspot2/omadm/PpsMoParserTest.java | 10 +-- .../net/wifi/hotspot2/pps/CredentialTest.java | 6 +- 9 files changed, 105 insertions(+), 105 deletions(-) diff --git a/api/current.txt b/api/current.txt index eec812c47d66..44b88a49ab4d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -26764,28 +26764,28 @@ package android.net.wifi.hotspot2 { method public int getCredentialPriority(); method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp(); method public android.net.wifi.hotspot2.pps.Policy getPolicy(); - method public long getSubscriptionCreationTimeInMs(); - method public long getSubscriptionExpirationTimeInMs(); + method public long getSubscriptionCreationTimeInMillis(); + method public long getSubscriptionExpirationTimeInMillis(); method public java.lang.String getSubscriptionType(); method public android.net.wifi.hotspot2.pps.UpdateParameter getSubscriptionUpdate(); method public java.util.Map getTrustRootCertList(); method public int getUpdateIdentifier(); method public long getUsageLimitDataLimit(); - method public long getUsageLimitStartTimeInMs(); + method public long getUsageLimitStartTimeInMillis(); method public long getUsageLimitTimeLimitInMinutes(); method public long getUsageLimitUsageTimePeriodInMinutes(); method public void setCredential(android.net.wifi.hotspot2.pps.Credential); method public void setCredentialPriority(int); method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp); method public void setPolicy(android.net.wifi.hotspot2.pps.Policy); - method public void setSubscriptionCreationTimeInMs(long); - method public void setSubscriptionExpirationTimeInMs(long); + method public void setSubscriptionCreationTimeInMillis(long); + method public void setSubscriptionExpirationTimeInMillis(long); method public void setSubscriptionType(java.lang.String); method public void setSubscriptionUpdate(android.net.wifi.hotspot2.pps.UpdateParameter); method public void setTrustRootCertList(java.util.Map); method public void setUpdateIdentifier(int); method public void setUsageLimitDataLimit(long); - method public void setUsageLimitStartTimeInMs(long); + method public void setUsageLimitStartTimeInMillis(long); method public void setUsageLimitTimeLimitInMinutes(long); method public void setUsageLimitUsageTimePeriodInMinutes(long); method public void writeToParcel(android.os.Parcel, int); @@ -26813,8 +26813,8 @@ package android.net.wifi.hotspot2.pps { method public boolean getCheckAaaServerCertStatus(); method public java.security.cert.X509Certificate[] getClientCertificateChain(); method public java.security.PrivateKey getClientPrivateKey(); - method public long getCreationTimeInMs(); - method public long getExpirationTimeInMs(); + method public long getCreationTimeInMillis(); + method public long getExpirationTimeInMillis(); method public java.lang.String getRealm(); method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential(); method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential(); @@ -26823,8 +26823,8 @@ package android.net.wifi.hotspot2.pps { method public void setCheckAaaServerCertStatus(boolean); method public void setClientCertificateChain(java.security.cert.X509Certificate[]); method public void setClientPrivateKey(java.security.PrivateKey); - method public void setCreationTimeInMs(long); - method public void setExpirationTimeInMs(long); + method public void setCreationTimeInMillis(long); + method public void setExpirationTimeInMillis(long); method public void setRealm(java.lang.String); method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential); method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential); diff --git a/api/system-current.txt b/api/system-current.txt index aff5b1d0b56f..7884b8be655e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -29515,28 +29515,28 @@ package android.net.wifi.hotspot2 { method public int getCredentialPriority(); method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp(); method public android.net.wifi.hotspot2.pps.Policy getPolicy(); - method public long getSubscriptionCreationTimeInMs(); - method public long getSubscriptionExpirationTimeInMs(); + method public long getSubscriptionCreationTimeInMillis(); + method public long getSubscriptionExpirationTimeInMillis(); method public java.lang.String getSubscriptionType(); method public android.net.wifi.hotspot2.pps.UpdateParameter getSubscriptionUpdate(); method public java.util.Map getTrustRootCertList(); method public int getUpdateIdentifier(); method public long getUsageLimitDataLimit(); - method public long getUsageLimitStartTimeInMs(); + method public long getUsageLimitStartTimeInMillis(); method public long getUsageLimitTimeLimitInMinutes(); method public long getUsageLimitUsageTimePeriodInMinutes(); method public void setCredential(android.net.wifi.hotspot2.pps.Credential); method public void setCredentialPriority(int); method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp); method public void setPolicy(android.net.wifi.hotspot2.pps.Policy); - method public void setSubscriptionCreationTimeInMs(long); - method public void setSubscriptionExpirationTimeInMs(long); + method public void setSubscriptionCreationTimeInMillis(long); + method public void setSubscriptionExpirationTimeInMillis(long); method public void setSubscriptionType(java.lang.String); method public void setSubscriptionUpdate(android.net.wifi.hotspot2.pps.UpdateParameter); method public void setTrustRootCertList(java.util.Map); method public void setUpdateIdentifier(int); method public void setUsageLimitDataLimit(long); - method public void setUsageLimitStartTimeInMs(long); + method public void setUsageLimitStartTimeInMillis(long); method public void setUsageLimitTimeLimitInMinutes(long); method public void setUsageLimitUsageTimePeriodInMinutes(long); method public void writeToParcel(android.os.Parcel, int); @@ -29564,8 +29564,8 @@ package android.net.wifi.hotspot2.pps { method public boolean getCheckAaaServerCertStatus(); method public java.security.cert.X509Certificate[] getClientCertificateChain(); method public java.security.PrivateKey getClientPrivateKey(); - method public long getCreationTimeInMs(); - method public long getExpirationTimeInMs(); + method public long getCreationTimeInMillis(); + method public long getExpirationTimeInMillis(); method public java.lang.String getRealm(); method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential(); method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential(); @@ -29574,8 +29574,8 @@ package android.net.wifi.hotspot2.pps { method public void setCheckAaaServerCertStatus(boolean); method public void setClientCertificateChain(java.security.cert.X509Certificate[]); method public void setClientPrivateKey(java.security.PrivateKey); - method public void setCreationTimeInMs(long); - method public void setExpirationTimeInMs(long); + method public void setCreationTimeInMillis(long); + method public void setExpirationTimeInMillis(long); method public void setRealm(java.lang.String); method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential); method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential); diff --git a/api/test-current.txt b/api/test-current.txt index 5bc666e55632..8243f70d9205 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -26872,28 +26872,28 @@ package android.net.wifi.hotspot2 { method public int getCredentialPriority(); method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp(); method public android.net.wifi.hotspot2.pps.Policy getPolicy(); - method public long getSubscriptionCreationTimeInMs(); - method public long getSubscriptionExpirationTimeInMs(); + method public long getSubscriptionCreationTimeInMillis(); + method public long getSubscriptionExpirationTimeInMillis(); method public java.lang.String getSubscriptionType(); method public android.net.wifi.hotspot2.pps.UpdateParameter getSubscriptionUpdate(); method public java.util.Map getTrustRootCertList(); method public int getUpdateIdentifier(); method public long getUsageLimitDataLimit(); - method public long getUsageLimitStartTimeInMs(); + method public long getUsageLimitStartTimeInMillis(); method public long getUsageLimitTimeLimitInMinutes(); method public long getUsageLimitUsageTimePeriodInMinutes(); method public void setCredential(android.net.wifi.hotspot2.pps.Credential); method public void setCredentialPriority(int); method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp); method public void setPolicy(android.net.wifi.hotspot2.pps.Policy); - method public void setSubscriptionCreationTimeInMs(long); - method public void setSubscriptionExpirationTimeInMs(long); + method public void setSubscriptionCreationTimeInMillis(long); + method public void setSubscriptionExpirationTimeInMillis(long); method public void setSubscriptionType(java.lang.String); method public void setSubscriptionUpdate(android.net.wifi.hotspot2.pps.UpdateParameter); method public void setTrustRootCertList(java.util.Map); method public void setUpdateIdentifier(int); method public void setUsageLimitDataLimit(long); - method public void setUsageLimitStartTimeInMs(long); + method public void setUsageLimitStartTimeInMillis(long); method public void setUsageLimitTimeLimitInMinutes(long); method public void setUsageLimitUsageTimePeriodInMinutes(long); method public void writeToParcel(android.os.Parcel, int); @@ -26921,8 +26921,8 @@ package android.net.wifi.hotspot2.pps { method public boolean getCheckAaaServerCertStatus(); method public java.security.cert.X509Certificate[] getClientCertificateChain(); method public java.security.PrivateKey getClientPrivateKey(); - method public long getCreationTimeInMs(); - method public long getExpirationTimeInMs(); + method public long getCreationTimeInMillis(); + method public long getExpirationTimeInMillis(); method public java.lang.String getRealm(); method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential(); method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential(); @@ -26931,8 +26931,8 @@ package android.net.wifi.hotspot2.pps { method public void setCheckAaaServerCertStatus(boolean); method public void setClientCertificateChain(java.security.cert.X509Certificate[]); method public void setClientPrivateKey(java.security.PrivateKey); - method public void setCreationTimeInMs(long); - method public void setExpirationTimeInMs(long); + method public void setCreationTimeInMillis(long); + method public void setExpirationTimeInMillis(long); method public void setRealm(java.lang.String); method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential); method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential); diff --git a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java b/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java index 333a4f7dc3ce..1dbaa80ade72 100644 --- a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java +++ b/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java @@ -144,12 +144,12 @@ public final class PasspointConfiguration implements Parcelable { * * Use Long.MIN_VALUE to indicate unset value. */ - private long mSubscriptionCreationTimeInMs = Long.MIN_VALUE; - public void setSubscriptionCreationTimeInMs(long subscriptionCreationTimeInMs) { - mSubscriptionCreationTimeInMs = subscriptionCreationTimeInMs; + private long mSubscriptionCreationTimeInMillis = Long.MIN_VALUE; + public void setSubscriptionCreationTimeInMillis(long subscriptionCreationTimeInMillis) { + mSubscriptionCreationTimeInMillis = subscriptionCreationTimeInMillis; } - public long getSubscriptionCreationTimeInMs() { - return mSubscriptionCreationTimeInMs; + public long getSubscriptionCreationTimeInMillis() { + return mSubscriptionCreationTimeInMillis; } /** @@ -158,12 +158,12 @@ public final class PasspointConfiguration implements Parcelable { * * Use Long.MIN_VALUE to indicate unset value. */ - private long mSubscriptionExpirationTimeInMs = Long.MIN_VALUE; - public void setSubscriptionExpirationTimeInMs(long subscriptionExpirationTimeInMs) { - mSubscriptionExpirationTimeInMs = subscriptionExpirationTimeInMs; + private long mSubscriptionExpirationTimeInMillis = Long.MIN_VALUE; + public void setSubscriptionExpirationTimeInMillis(long subscriptionExpirationTimeInMillis) { + mSubscriptionExpirationTimeInMillis = subscriptionExpirationTimeInMillis; } - public long getSubscriptionExpirationTimeInMs() { - return mSubscriptionExpirationTimeInMs; + public long getSubscriptionExpirationTimeInMillis() { + return mSubscriptionExpirationTimeInMillis; } /** @@ -197,12 +197,12 @@ public final class PasspointConfiguration implements Parcelable { * * Use Long.MIN_VALUE to indicate unset value. */ - private long mUsageLimitStartTimeInMs = Long.MIN_VALUE; - public void setUsageLimitStartTimeInMs(long usageLimitStartTimeInMs) { - mUsageLimitStartTimeInMs = usageLimitStartTimeInMs; + private long mUsageLimitStartTimeInMillis = Long.MIN_VALUE; + public void setUsageLimitStartTimeInMillis(long usageLimitStartTimeInMillis) { + mUsageLimitStartTimeInMillis = usageLimitStartTimeInMillis; } - public long getUsageLimitStartTimeInMs() { - return mUsageLimitStartTimeInMs; + public long getUsageLimitStartTimeInMillis() { + return mUsageLimitStartTimeInMillis; } /** @@ -263,11 +263,11 @@ public final class PasspointConfiguration implements Parcelable { } mUpdateIdentifier = source.mUpdateIdentifier; mCredentialPriority = source.mCredentialPriority; - mSubscriptionCreationTimeInMs = source.mSubscriptionCreationTimeInMs; - mSubscriptionExpirationTimeInMs = source.mSubscriptionExpirationTimeInMs; + mSubscriptionCreationTimeInMillis = source.mSubscriptionCreationTimeInMillis; + mSubscriptionExpirationTimeInMillis = source.mSubscriptionExpirationTimeInMillis; mSubscriptionType = source.mSubscriptionType; mUsageLimitDataLimit = source.mUsageLimitDataLimit; - mUsageLimitStartTimeInMs = source.mUsageLimitStartTimeInMs; + mUsageLimitStartTimeInMillis = source.mUsageLimitStartTimeInMillis; mUsageLimitTimeLimitInMinutes = source.mUsageLimitTimeLimitInMinutes; mUsageLimitUsageTimePeriodInMinutes = source.mUsageLimitUsageTimePeriodInMinutes; } @@ -286,11 +286,11 @@ public final class PasspointConfiguration implements Parcelable { writeTrustRootCerts(dest, mTrustRootCertList); dest.writeInt(mUpdateIdentifier); dest.writeInt(mCredentialPriority); - dest.writeLong(mSubscriptionCreationTimeInMs); - dest.writeLong(mSubscriptionExpirationTimeInMs); + dest.writeLong(mSubscriptionCreationTimeInMillis); + dest.writeLong(mSubscriptionExpirationTimeInMillis); dest.writeString(mSubscriptionType); dest.writeLong(mUsageLimitUsageTimePeriodInMinutes); - dest.writeLong(mUsageLimitStartTimeInMs); + dest.writeLong(mUsageLimitStartTimeInMillis); dest.writeLong(mUsageLimitDataLimit); dest.writeLong(mUsageLimitTimeLimitInMinutes); } @@ -313,11 +313,11 @@ public final class PasspointConfiguration implements Parcelable { && isTrustRootCertListEquals(mTrustRootCertList, that.mTrustRootCertList) && mUpdateIdentifier == that.mUpdateIdentifier && mCredentialPriority == that.mCredentialPriority - && mSubscriptionCreationTimeInMs == that.mSubscriptionCreationTimeInMs - && mSubscriptionExpirationTimeInMs == that.mSubscriptionExpirationTimeInMs + && mSubscriptionCreationTimeInMillis == that.mSubscriptionCreationTimeInMillis + && mSubscriptionExpirationTimeInMillis == that.mSubscriptionExpirationTimeInMillis && TextUtils.equals(mSubscriptionType, that.mSubscriptionType) && mUsageLimitUsageTimePeriodInMinutes == that.mUsageLimitUsageTimePeriodInMinutes - && mUsageLimitStartTimeInMs == that.mUsageLimitStartTimeInMs + && mUsageLimitStartTimeInMillis == that.mUsageLimitStartTimeInMillis && mUsageLimitDataLimit == that.mUsageLimitDataLimit && mUsageLimitTimeLimitInMinutes == that.mUsageLimitTimeLimitInMinutes; } @@ -325,9 +325,9 @@ public final class PasspointConfiguration implements Parcelable { @Override public int hashCode() { return Objects.hash(mHomeSp, mCredential, mPolicy, mSubscriptionUpdate, mTrustRootCertList, - mUpdateIdentifier, mCredentialPriority, mSubscriptionCreationTimeInMs, - mSubscriptionExpirationTimeInMs, mUsageLimitUsageTimePeriodInMinutes, - mUsageLimitStartTimeInMs, mUsageLimitDataLimit, mUsageLimitTimeLimitInMinutes); + mUpdateIdentifier, mCredentialPriority, mSubscriptionCreationTimeInMillis, + mSubscriptionExpirationTimeInMillis, mUsageLimitUsageTimePeriodInMinutes, + mUsageLimitStartTimeInMillis, mUsageLimitDataLimit, mUsageLimitTimeLimitInMinutes); } @Override @@ -336,13 +336,13 @@ public final class PasspointConfiguration implements Parcelable { builder.append("UpdateIdentifier: ").append(mUpdateIdentifier).append("\n"); builder.append("CredentialPriority: ").append(mCredentialPriority).append("\n"); builder.append("SubscriptionCreationTime: ").append( - mSubscriptionCreationTimeInMs != Long.MIN_VALUE - ? new Date(mSubscriptionCreationTimeInMs) : "Not specified").append("\n"); + mSubscriptionCreationTimeInMillis != Long.MIN_VALUE + ? new Date(mSubscriptionCreationTimeInMillis) : "Not specified").append("\n"); builder.append("SubscriptionExpirationTime: ").append( - mSubscriptionExpirationTimeInMs != Long.MIN_VALUE - ? new Date(mSubscriptionExpirationTimeInMs) : "Not specified").append("\n"); - builder.append("UsageLimitStartTime: ").append(mUsageLimitStartTimeInMs != Long.MIN_VALUE - ? new Date(mUsageLimitStartTimeInMs) : "Not specified").append("\n"); + mSubscriptionExpirationTimeInMillis != Long.MIN_VALUE + ? new Date(mSubscriptionExpirationTimeInMillis) : "Not specified").append("\n"); + builder.append("UsageLimitStartTime: ").append(mUsageLimitStartTimeInMillis != Long.MIN_VALUE + ? new Date(mUsageLimitStartTimeInMillis) : "Not specified").append("\n"); builder.append("UsageTimePeriod: ").append(mUsageLimitUsageTimePeriodInMinutes) .append("\n"); builder.append("UsageLimitDataLimit: ").append(mUsageLimitDataLimit).append("\n"); @@ -433,11 +433,11 @@ public final class PasspointConfiguration implements Parcelable { config.setTrustRootCertList(readTrustRootCerts(in)); config.setUpdateIdentifier(in.readInt()); config.setCredentialPriority(in.readInt()); - config.setSubscriptionCreationTimeInMs(in.readLong()); - config.setSubscriptionExpirationTimeInMs(in.readLong()); + config.setSubscriptionCreationTimeInMillis(in.readLong()); + config.setSubscriptionExpirationTimeInMillis(in.readLong()); config.setSubscriptionType(in.readString()); config.setUsageLimitUsageTimePeriodInMinutes(in.readLong()); - config.setUsageLimitStartTimeInMs(in.readLong()); + config.setUsageLimitStartTimeInMillis(in.readLong()); config.setUsageLimitDataLimit(in.readLong()); config.setUsageLimitTimeLimitInMinutes(in.readLong()); return config; diff --git a/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java b/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java index 5dc5d13569c6..f6183fa219a1 100644 --- a/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java +++ b/wifi/java/android/net/wifi/hotspot2/omadm/PpsMoParser.java @@ -903,10 +903,10 @@ public final class PpsMoParser { for (PPSNode child: node.getChildren()) { switch (child.getName()) { case NODE_CREATION_DATE: - credential.setCreationTimeInMs(parseDate(getPpsNodeValue(child))); + credential.setCreationTimeInMillis(parseDate(getPpsNodeValue(child))); break; case NODE_EXPIRATION_DATE: - credential.setExpirationTimeInMs(parseDate(getPpsNodeValue(child))); + credential.setExpirationTimeInMillis(parseDate(getPpsNodeValue(child))); break; case NODE_USERNAME_PASSWORD: credential.setUserCredential(parseUserCredential(child)); @@ -1517,10 +1517,10 @@ public final class PpsMoParser { for (PPSNode child : node.getChildren()) { switch (child.getName()) { case NODE_CREATION_DATE: - config.setSubscriptionCreationTimeInMs(parseDate(getPpsNodeValue(child))); + config.setSubscriptionCreationTimeInMillis(parseDate(getPpsNodeValue(child))); break; case NODE_EXPIRATION_DATE: - config.setSubscriptionExpirationTimeInMs(parseDate(getPpsNodeValue(child))); + config.setSubscriptionExpirationTimeInMillis(parseDate(getPpsNodeValue(child))); break; case NODE_TYPE_OF_SUBSCRIPTION: config.setSubscriptionType(getPpsNodeValue(child)); @@ -1555,7 +1555,7 @@ public final class PpsMoParser { config.setUsageLimitDataLimit(parseLong(getPpsNodeValue(child), 10)); break; case NODE_START_DATE: - config.setUsageLimitStartTimeInMs(parseDate(getPpsNodeValue(child))); + config.setUsageLimitStartTimeInMillis(parseDate(getPpsNodeValue(child))); break; case NODE_TIME_LIMIT: config.setUsageLimitTimeLimitInMinutes(parseLong(getPpsNodeValue(child), 10)); diff --git a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java index 67fa1bbccd1e..f89efa6265a8 100644 --- a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java +++ b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java @@ -58,12 +58,12 @@ public final class Credential implements Parcelable { * of milliseconds since January 1, 1970, 00:00:00 GMT. * Using Long.MIN_VALUE to indicate unset value. */ - private long mCreationTimeInMs = Long.MIN_VALUE; - public void setCreationTimeInMs(long creationTimeInMs) { - mCreationTimeInMs = creationTimeInMs; + private long mCreationTimeInMillis = Long.MIN_VALUE; + public void setCreationTimeInMillis(long creationTimeInMillis) { + mCreationTimeInMillis = creationTimeInMillis; } - public long getCreationTimeInMs() { - return mCreationTimeInMs; + public long getCreationTimeInMillis() { + return mCreationTimeInMillis; } /** @@ -71,12 +71,12 @@ public final class Credential implements Parcelable { * of milliseconds since January 1, 1970, 00:00:00 GMT. * Using Long.MIN_VALUE to indicate unset value. */ - private long mExpirationTimeInMs = Long.MIN_VALUE; - public void setExpirationTimeInMs(long expirationTimeInMs) { - mExpirationTimeInMs = expirationTimeInMs; + private long mExpirationTimeInMillis = Long.MIN_VALUE; + public void setExpirationTimeInMillis(long expirationTimeInMillis) { + mExpirationTimeInMillis = expirationTimeInMillis; } - public long getExpirationTimeInMs() { - return mExpirationTimeInMs; + public long getExpirationTimeInMillis() { + return mExpirationTimeInMillis; } /** @@ -720,8 +720,8 @@ public final class Credential implements Parcelable { */ public Credential(Credential source) { if (source != null) { - mCreationTimeInMs = source.mCreationTimeInMs; - mExpirationTimeInMs = source.mExpirationTimeInMs; + mCreationTimeInMillis = source.mCreationTimeInMillis; + mExpirationTimeInMillis = source.mExpirationTimeInMillis; mRealm = source.mRealm; mCheckAaaServerCertStatus = source.mCheckAaaServerCertStatus; if (source.mUserCredential != null) { @@ -749,8 +749,8 @@ public final class Credential implements Parcelable { @Override public void writeToParcel(Parcel dest, int flags) { - dest.writeLong(mCreationTimeInMs); - dest.writeLong(mExpirationTimeInMs); + dest.writeLong(mCreationTimeInMillis); + dest.writeLong(mExpirationTimeInMillis); dest.writeString(mRealm); dest.writeInt(mCheckAaaServerCertStatus ? 1 : 0); dest.writeParcelable(mUserCredential, flags); @@ -772,8 +772,8 @@ public final class Credential implements Parcelable { Credential that = (Credential) thatObject; return TextUtils.equals(mRealm, that.mRealm) - && mCreationTimeInMs == that.mCreationTimeInMs - && mExpirationTimeInMs == that.mExpirationTimeInMs + && mCreationTimeInMillis == that.mCreationTimeInMillis + && mExpirationTimeInMillis == that.mExpirationTimeInMillis && mCheckAaaServerCertStatus == that.mCheckAaaServerCertStatus && (mUserCredential == null ? that.mUserCredential == null : mUserCredential.equals(that.mUserCredential)) @@ -788,7 +788,7 @@ public final class Credential implements Parcelable { @Override public int hashCode() { - return Objects.hash(mRealm, mCreationTimeInMs, mExpirationTimeInMs, + return Objects.hash(mRealm, mCreationTimeInMillis, mExpirationTimeInMillis, mCheckAaaServerCertStatus, mUserCredential, mCertCredential, mSimCredential, mCaCertificate, mClientCertificateChain, mClientPrivateKey); } @@ -797,10 +797,10 @@ public final class Credential implements Parcelable { public String toString() { StringBuilder builder = new StringBuilder(); builder.append("Realm: ").append(mRealm).append("\n"); - builder.append("CreationTime: ").append(mCreationTimeInMs != Long.MIN_VALUE - ? new Date(mCreationTimeInMs) : "Not specified").append("\n"); - builder.append("ExpirationTime: ").append(mExpirationTimeInMs != Long.MIN_VALUE - ? new Date(mExpirationTimeInMs) : "Not specified").append("\n"); + builder.append("CreationTime: ").append(mCreationTimeInMillis != Long.MIN_VALUE + ? new Date(mCreationTimeInMillis) : "Not specified").append("\n"); + builder.append("ExpirationTime: ").append(mExpirationTimeInMillis != Long.MIN_VALUE + ? new Date(mExpirationTimeInMillis) : "Not specified").append("\n"); builder.append("CheckAAAServerStatus: ").append(mCheckAaaServerCertStatus).append("\n"); if (mUserCredential != null) { builder.append("UserCredential Begin ---\n"); @@ -863,8 +863,8 @@ public final class Credential implements Parcelable { @Override public Credential createFromParcel(Parcel in) { Credential credential = new Credential(); - credential.setCreationTimeInMs(in.readLong()); - credential.setExpirationTimeInMs(in.readLong()); + credential.setCreationTimeInMillis(in.readLong()); + credential.setExpirationTimeInMillis(in.readLong()); credential.setRealm(in.readString()); credential.setCheckAaaServerCertStatus(in.readInt() != 0); credential.setUserCredential(in.readParcelable(null)); diff --git a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java b/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java index 7df4fcf56e8a..afcf3e344c27 100644 --- a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java +++ b/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java @@ -158,11 +158,11 @@ public class PasspointConfigurationTest { config.setTrustRootCertList(trustRootCertList); config.setUpdateIdentifier(1); config.setCredentialPriority(120); - config.setSubscriptionCreationTimeInMs(231200); - config.setSubscriptionExpirationTimeInMs(2134232); + config.setSubscriptionCreationTimeInMillis(231200); + config.setSubscriptionExpirationTimeInMillis(2134232); config.setSubscriptionType("Gold"); config.setUsageLimitUsageTimePeriodInMinutes(3600); - config.setUsageLimitStartTimeInMs(124214213); + config.setUsageLimitStartTimeInMillis(124214213); config.setUsageLimitDataLimit(14121); config.setUsageLimitTimeLimitInMinutes(78912); return config; diff --git a/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java b/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java index 7cd72f03dd1b..afa9fd6a9e8b 100644 --- a/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java +++ b/wifi/tests/src/android/net/wifi/hotspot2/omadm/PpsMoParserTest.java @@ -113,11 +113,11 @@ public class PpsMoParserTest { config.setSubscriptionUpdate(subscriptionUpdate); // Subscription parameters. - config.setSubscriptionCreationTimeInMs(format.parse("2016-02-01T10:00:00Z").getTime()); - config.setSubscriptionExpirationTimeInMs(format.parse("2016-03-01T10:00:00Z").getTime()); + config.setSubscriptionCreationTimeInMillis(format.parse("2016-02-01T10:00:00Z").getTime()); + config.setSubscriptionExpirationTimeInMillis(format.parse("2016-03-01T10:00:00Z").getTime()); config.setSubscriptionType("Gold"); config.setUsageLimitDataLimit(921890); - config.setUsageLimitStartTimeInMs(format.parse("2016-12-01T10:00:00Z").getTime()); + config.setUsageLimitStartTimeInMillis(format.parse("2016-12-01T10:00:00Z").getTime()); config.setUsageLimitTimeLimitInMinutes(120); config.setUsageLimitUsageTimePeriodInMinutes(99910); @@ -138,8 +138,8 @@ public class PpsMoParserTest { // Credential configuration. Credential credential = new Credential(); - credential.setCreationTimeInMs(format.parse("2016-01-01T10:00:00Z").getTime()); - credential.setExpirationTimeInMs(format.parse("2016-02-01T10:00:00Z").getTime()); + credential.setCreationTimeInMillis(format.parse("2016-01-01T10:00:00Z").getTime()); + credential.setExpirationTimeInMillis(format.parse("2016-02-01T10:00:00Z").getTime()); credential.setRealm("shaken.stirred.com"); credential.setCheckAaaServerCertStatus(true); Credential.UserCredential userCredential = new Credential.UserCredential(); diff --git a/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java b/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java index c7ade002c826..9bfc0105fcc9 100644 --- a/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java +++ b/wifi/tests/src/android/net/wifi/hotspot2/pps/CredentialTest.java @@ -56,8 +56,8 @@ public class CredentialTest { X509Certificate[] clientCertificateChain, PrivateKey clientPrivateKey) { Credential cred = new Credential(); - cred.setCreationTimeInMs(123455L); - cred.setExpirationTimeInMs(2310093L); + cred.setCreationTimeInMillis(123455L); + cred.setExpirationTimeInMillis(2310093L); cred.setRealm("realm"); cred.setCheckAaaServerCertStatus(true); cred.setUserCredential(userCred); @@ -440,4 +440,4 @@ public class CredentialTest { Credential copyCred = new Credential(sourceCred); assertTrue(copyCred.equals(sourceCred)); } -} \ No newline at end of file +} -- GitLab From 01ce92b8ac98da3887515e4aa85353ac6cbcbd01 Mon Sep 17 00:00:00 2001 From: Makoto Onuki Date: Fri, 28 Apr 2017 12:24:16 -0700 Subject: [PATCH 33/66] Move the last user save from onCleanupUser to onStopUser Bug: 37780857 Test: manual test with work profile Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest1 -w com.android.frameworks.servicestests Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest2 -w com.android.frameworks.servicestests Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest3 -w com.android.frameworks.servicestests Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest4 -w com.android.frameworks.servicestests Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest5 -w com.android.frameworks.servicestests Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest6 -w com.android.frameworks.servicestests Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest7 -w com.android.frameworks.servicestests Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest8 -w com.android.frameworks.servicestests Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest9 -w com.android.frameworks.servicestests Test: adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest10 -w com.android.frameworks.servicestests Change-Id: I8b053c6a55df374a89ab85d76b9d36abf639f649 --- .../core/java/com/android/server/SystemService.java | 7 +++++++ .../java/com/android/server/pm/ShortcutService.java | 10 +++++----- .../com/android/server/pm/ShortcutManagerTest1.java | 4 ++-- .../com/android/server/pm/ShortcutManagerTest2.java | 2 +- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/SystemService.java b/services/core/java/com/android/server/SystemService.java index c105b1244e74..94397d07e1a2 100644 --- a/services/core/java/com/android/server/SystemService.java +++ b/services/core/java/com/android/server/SystemService.java @@ -173,6 +173,9 @@ public abstract class SystemService { * state they maintain for running users. This is called prior to sending the SHUTDOWN * broadcast to the user; it is a good place to stop making use of any resources of that * user (such as binding to a service running in the user). + * + *

NOTE: This is the last callback where the callee may access the target user's CE storage. + * * @param userHandle The identifier of the user. */ public void onStopUser(int userHandle) {} @@ -181,6 +184,10 @@ public abstract class SystemService { * Called when an existing user is stopping, for system services to finalize any per-user * state they maintain for running users. This is called after all application process * teardown of the user is complete. + * + *

NOTE: When this callback is called, the CE storage for the target user may not be + * accessible already. Use {@link #onStopUser} instead if you need to access the CE storage. + * * @param userHandle The identifier of the user. */ public void onCleanupUser(int userHandle) {} diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java index 7c89e1ccb7c8..bed8f1a78649 100644 --- a/services/core/java/com/android/server/pm/ShortcutService.java +++ b/services/core/java/com/android/server/pm/ShortcutService.java @@ -555,8 +555,8 @@ public class ShortcutService extends IShortcutService.Stub { } @Override - public void onCleanupUser(int userHandle) { - mService.handleCleanupUser(userHandle); + public void onStopUser(int userHandle) { + mService.handleStopUser(userHandle); } @Override @@ -606,9 +606,9 @@ public class ShortcutService extends IShortcutService.Stub { } /** lifecycle event */ - void handleCleanupUser(int userId) { + void handleStopUser(int userId) { if (DEBUG) { - Slog.d(TAG, "handleCleanupUser: user=" + userId); + Slog.d(TAG, "handleStopUser: user=" + userId); } synchronized (mLock) { unloadUserLocked(userId); @@ -3777,7 +3777,7 @@ public class ShortcutService extends IShortcutService.Stub { Slog.i(TAG, "cmd: handleUnloadUser: user=" + mUserId); - ShortcutService.this.handleCleanupUser(mUserId); + ShortcutService.this.handleStopUser(mUserId); } } diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java index cd39d8875692..4c7bf4df0143 100644 --- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java +++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest1.java @@ -3241,7 +3241,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { assertNull(mService.getShortcutsForTest().get(USER_10).getLastKnownLauncher()); // Try stopping the user - mService.handleCleanupUser(USER_10); + mService.handleStopUser(USER_10); // Now it's unloaded. assertEquals(1, mService.getShortcutsForTest().size()); @@ -6106,7 +6106,7 @@ public class ShortcutManagerTest1 extends BaseShortcutManagerTest { assertEmpty(mManager.getPinnedShortcuts()); }); // Send add broadcast, but the user is not running, so should be ignored. - mService.handleCleanupUser(USER_10); + mService.handleStopUser(USER_10); mRunningUsers.put(USER_10, false); mUnlockedUsers.put(USER_10, false); diff --git a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java index 9880caa11f85..2b40c511ef14 100644 --- a/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java +++ b/services/tests/servicestests/src/com/android/server/pm/ShortcutManagerTest2.java @@ -2091,7 +2091,7 @@ public class ShortcutManagerTest2 extends BaseShortcutManagerTest { assertFalse(mService.isUserUnlockedL(USER_10)); // Directly call the stop lifecycle event. Goes back to the initial state. - mService.handleCleanupUser(USER_0); + mService.handleStopUser(USER_0); assertFalse(mService.isUserUnlockedL(USER_0)); assertFalse(mService.isUserUnlockedL(USER_10)); } -- GitLab From 405ce17abb7ec9d3f20abf8333314aa2c64d0b8b Mon Sep 17 00:00:00 2001 From: Badhri Jagan Sridharan Date: Tue, 18 Apr 2017 18:13:39 -0700 Subject: [PATCH 34/66] Notify the user when an unsupported accessory is attached This CL pops up a notification to the user when the device does not support Analog Type-C headphones but the user connects one. i.e when the Usb port status reports currentMode=audio_acc, but audio_acc is not present in the supportedModes list. Bug: 36604276 Test: Manually test inserting an Audio accessory Change-Id: If514b9f238da196a7157e1aacb6d7690fde66f21 --- core/res/res/values/strings.xml | 5 + core/res/res/values/symbols.xml | 2 + proto/src/system_messages.proto | 3 + .../android/server/usb/UsbDeviceManager.java | 96 ++++++++++++------- 4 files changed, 74 insertions(+), 32 deletions(-) diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index e633d66514cc..9848485d15c2 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -3155,6 +3155,11 @@ Connected to a USB accessory Tap for more options. + + Audio accessory not supported + + Tap for more info + USB debugging connected diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index bd70ca8c2191..ca78efd04083 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -1958,6 +1958,8 @@ + + diff --git a/proto/src/system_messages.proto b/proto/src/system_messages.proto index 53b3fe9c1a0d..ac544e8abd74 100644 --- a/proto/src/system_messages.proto +++ b/proto/src/system_messages.proto @@ -180,6 +180,9 @@ message SystemMessage { // Package: android NOTE_FOREGROUND_SERVICES = 40; + // Inform the user that the connected audio accessory is not supported + NOTE_USB_AUDIO_ACCESSORY_NOT_SUPPORTED = 41; + // ADD_NEW_IDS_ABOVE_THIS_LINE // Legacy IDs with arbitrary values appear below // Legacy IDs existed as stable non-conflicting constants prior to the O release diff --git a/services/usb/java/com/android/server/usb/UsbDeviceManager.java b/services/usb/java/com/android/server/usb/UsbDeviceManager.java index 3b4fd04f2442..84a2e8b5d266 100644 --- a/services/usb/java/com/android/server/usb/UsbDeviceManager.java +++ b/services/usb/java/com/android/server/usb/UsbDeviceManager.java @@ -424,6 +424,8 @@ public class UsbDeviceManager { private boolean mSinkPower; private boolean mConfigured; private boolean mUsbDataUnlocked; + private boolean mAudioAccessoryConnected; + private boolean mAudioAccessorySupported; private String mCurrentFunctions; private boolean mCurrentFunctionsApplied; private UsbAccessory mCurrentAccessory; @@ -534,30 +536,13 @@ public class UsbDeviceManager { } public void updateHostState(UsbPort port, UsbPortStatus status) { - boolean hostConnected = status.getCurrentDataRole() == UsbPort.DATA_ROLE_HOST; - boolean sourcePower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SOURCE; - boolean sinkPower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SINK; - // Ideally we want to see if PR_SWAP and DR_SWAP is supported. - // But, this should be suffice, since, all four combinations are only supported - // when PR_SWAP and DR_SWAP are supported. - boolean supportsAllCombinations = status.isRoleCombinationSupported( - UsbPort.POWER_ROLE_SOURCE, UsbPort.DATA_ROLE_HOST) - && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK, - UsbPort.DATA_ROLE_HOST) - && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SOURCE, - UsbPort.DATA_ROLE_DEVICE) - && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK, - UsbPort.DATA_ROLE_HOST); - if (DEBUG) { Slog.i(TAG, "updateHostState " + port + " status=" + status); } SomeArgs args = SomeArgs.obtain(); - args.argi1 = hostConnected ? 1 : 0; - args.argi2 = sourcePower ? 1 : 0; - args.argi3 = sinkPower ? 1 : 0; - args.argi4 = supportsAllCombinations ? 1 : 0; + args.arg1 = port; + args.arg2 = status; removeMessages(MSG_UPDATE_PORT_STATE); Message msg = obtainMessage(MSG_UPDATE_PORT_STATE, args); @@ -931,10 +916,26 @@ public class UsbDeviceManager { case MSG_UPDATE_PORT_STATE: SomeArgs args = (SomeArgs) msg.obj; boolean prevHostConnected = mHostConnected; - mHostConnected = (args.argi1 == 1); - mSourcePower = (args.argi2 == 1); - mSinkPower = (args.argi3 == 1); - mSupportsAllCombinations = (args.argi4 == 1); + UsbPort port = (UsbPort) args.arg1; + UsbPortStatus status = (UsbPortStatus) args.arg2; + mHostConnected = status.getCurrentDataRole() == UsbPort.DATA_ROLE_HOST; + mSourcePower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SOURCE; + mSinkPower = status.getCurrentPowerRole() == UsbPort.POWER_ROLE_SINK; + mAudioAccessoryConnected = + (status.getCurrentMode() == UsbPort.MODE_AUDIO_ACCESSORY); + mAudioAccessorySupported = port.isModeSupported(UsbPort.MODE_AUDIO_ACCESSORY); + // Ideally we want to see if PR_SWAP and DR_SWAP is supported. + // But, this should be suffice, since, all four combinations are only supported + // when PR_SWAP and DR_SWAP are supported. + mSupportsAllCombinations = status.isRoleCombinationSupported( + UsbPort.POWER_ROLE_SOURCE, UsbPort.DATA_ROLE_HOST) + && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK, + UsbPort.DATA_ROLE_HOST) + && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SOURCE, + UsbPort.DATA_ROLE_DEVICE) + && status.isRoleCombinationSupported(UsbPort.POWER_ROLE_SINK, + UsbPort.DATA_ROLE_HOST); + args.recycle(); updateUsbNotification(false); if (mBootCompleted) { @@ -1076,7 +1077,10 @@ public class UsbDeviceManager { int id = 0; int titleRes = 0; Resources r = mContext.getResources(); - if (mConnected) { + if (mAudioAccessoryConnected && !mAudioAccessorySupported) { + titleRes = com.android.internal.R.string.usb_unsupported_audio_accessory_title; + id = SystemMessage.NOTE_USB_AUDIO_ACCESSORY_NOT_SUPPORTED; + } else if (mConnected) { if (!mUsbDataUnlocked) { if (mSourcePower) { titleRes = com.android.internal.R.string.usb_supplying_notification_title; @@ -1123,18 +1127,43 @@ public class UsbDeviceManager { mUsbNotificationId = 0; } if (id != 0) { - CharSequence message = r.getText( - com.android.internal.R.string.usb_notification_message); + CharSequence message; CharSequence title = r.getText(titleRes); + PendingIntent pi; + String channel; + + if (titleRes + != com.android.internal.R.string + .usb_unsupported_audio_accessory_title) { + Intent intent = Intent.makeRestartActivityTask( + new ComponentName("com.android.settings", + "com.android.settings.deviceinfo.UsbModeChooserActivity")); + pi = PendingIntent.getActivityAsUser(mContext, 0, + intent, 0, null, UserHandle.CURRENT); + channel = SystemNotificationChannels.USB; + message = r.getText( + com.android.internal.R.string.usb_notification_message); + } else { + final Intent intent = new Intent(); + intent.setClassName("com.android.settings", + "com.android.settings.HelpTrampoline"); + intent.putExtra(Intent.EXTRA_TEXT, + "help_url_audio_accessory_not_supported"); + + if (mContext.getPackageManager().resolveActivity(intent, 0) != null) { + pi = PendingIntent.getActivity(mContext, 0, intent, 0); + } else { + pi = null; + } - Intent intent = Intent.makeRestartActivityTask( - new ComponentName("com.android.settings", - "com.android.settings.deviceinfo.UsbModeChooserActivity")); - PendingIntent pi = PendingIntent.getActivityAsUser(mContext, 0, - intent, 0, null, UserHandle.CURRENT); + channel = SystemNotificationChannels.ALERTS; + message = r.getText( + com.android.internal.R.string + .usb_unsupported_audio_accessory_message); + } Notification notification = - new Notification.Builder(mContext, SystemNotificationChannels.USB) + new Notification.Builder(mContext, channel) .setSmallIcon(com.android.internal.R.drawable.stat_sys_adb) .setWhen(0) .setOngoing(true) @@ -1148,6 +1177,7 @@ public class UsbDeviceManager { .setContentIntent(pi) .setVisibility(Notification.VISIBILITY_PUBLIC) .build(); + mNotificationManager.notifyAsUser(null, id, notification, UserHandle.ALL); mUsbNotificationId = id; @@ -1230,6 +1260,8 @@ public class UsbDeviceManager { pw.println(" mSinkPower: " + mSinkPower); pw.println(" mUsbCharging: " + mUsbCharging); pw.println(" mHideUsbNotification: " + mHideUsbNotification); + pw.println(" mAudioAccessoryConnected: " + mAudioAccessoryConnected); + try { pw.println(" Kernel state: " + FileUtils.readTextFile(new File(STATE_PATH), 0, null).trim()); -- GitLab From 2caddc5ef42d67bf8037b707c1cd5a8f9bb93f9c Mon Sep 17 00:00:00 2001 From: Jeremy Joslin Date: Mon, 1 May 2017 10:02:25 -0700 Subject: [PATCH 35/66] Marking deprecated recommendation request code as @removed. Test: adb shell am instrument -e class android.net.NetworkRecommendationProviderTest -w com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner Test: Built & ran Bug: 37357264 Change-Id: I6d55fbad87b11c99e7ddac07cfaa82efeee33187 --- api/removed.txt | 43 +++++++++++++++++++ api/system-current.txt | 43 ------------------- api/system-removed.txt | 43 +++++++++++++++++++ api/test-removed.txt | 43 +++++++++++++++++++ .../net/NetworkRecommendationProvider.java | 5 +++ .../android/net/RecommendationRequest.java | 5 +-- .../android/net/RecommendationResult.java | 4 +- 7 files changed, 137 insertions(+), 49 deletions(-) diff --git a/api/removed.txt b/api/removed.txt index 779ff7cce923..a15846541497 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -188,6 +188,18 @@ package android.net { method public deprecated int stopUsingNetworkFeature(int, java.lang.String); } + public abstract class NetworkRecommendationProvider { + ctor public deprecated NetworkRecommendationProvider(android.os.Handler); + method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback); + field public static final deprecated java.lang.String EXTRA_RECOMMENDATION_RESULT = "android.net.extra.RECOMMENDATION_RESULT"; + field public static final deprecated java.lang.String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE"; + } + + public static deprecated class NetworkRecommendationProvider.ResultCallback { + ctor public NetworkRecommendationProvider.ResultCallback(android.os.IRemoteCallback, int); + method public void onResult(android.net.RecommendationResult); + } + public abstract class PskKeyManager { ctor public PskKeyManager(); field public static final int MAX_IDENTITY_HINT_LENGTH_BYTES = 128; // 0x80 @@ -195,6 +207,37 @@ package android.net { field public static final int MAX_KEY_LENGTH_BYTES = 256; // 0x100 } + public final deprecated class RecommendationRequest implements android.os.Parcelable { + ctor protected RecommendationRequest(android.os.Parcel); + method public android.net.wifi.WifiConfiguration[] getConnectableConfigs(); + method public android.net.wifi.WifiConfiguration getConnectedConfig(); + method public android.net.wifi.WifiConfiguration getDefaultWifiConfig(); + method public int getLastSelectedNetworkId(); + method public long getLastSelectedNetworkTimestamp(); + method public android.net.wifi.ScanResult[] getScanResults(); + method public void setConnectableConfigs(android.net.wifi.WifiConfiguration[]); + method public void setConnectedConfig(android.net.wifi.WifiConfiguration); + field public static final android.os.Parcelable.Creator CREATOR; + } + + public static final deprecated class RecommendationRequest.Builder { + ctor public RecommendationRequest.Builder(); + method public android.net.RecommendationRequest build(); + method public android.net.RecommendationRequest.Builder setConnectableConfigs(android.net.wifi.WifiConfiguration[]); + method public android.net.RecommendationRequest.Builder setConnectedWifiConfig(android.net.wifi.WifiConfiguration); + method public android.net.RecommendationRequest.Builder setDefaultWifiConfig(android.net.wifi.WifiConfiguration); + method public android.net.RecommendationRequest.Builder setLastSelectedNetwork(int, long); + method public android.net.RecommendationRequest.Builder setScanResults(android.net.wifi.ScanResult[]); + } + + public final deprecated class RecommendationResult implements android.os.Parcelable { + method public static android.net.RecommendationResult createConnectRecommendation(android.net.wifi.WifiConfiguration); + method public static android.net.RecommendationResult createDoNotConnectRecommendation(); + method public android.net.wifi.WifiConfiguration getWifiConfiguration(); + method public boolean hasRecommendation(); + field public static final android.os.Parcelable.Creator CREATOR; + } + public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory { method public static deprecated org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache); } diff --git a/api/system-current.txt b/api/system-current.txt index aff5b1d0b56f..f3e946df70b2 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -27886,17 +27886,9 @@ package android.net { } public abstract class NetworkRecommendationProvider { - ctor public deprecated NetworkRecommendationProvider(android.os.Handler); ctor public NetworkRecommendationProvider(android.content.Context, java.util.concurrent.Executor); method public final android.os.IBinder getBinder(); - method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback); method public abstract void onRequestScores(android.net.NetworkKey[]); - field public static final deprecated java.lang.String EXTRA_RECOMMENDATION_RESULT = "android.net.extra.RECOMMENDATION_RESULT"; - field public static final deprecated java.lang.String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE"; - } - - public static deprecated class NetworkRecommendationProvider.ResultCallback { - method public void onResult(android.net.RecommendationResult); } public class NetworkRequest implements android.os.Parcelable { @@ -27962,41 +27954,6 @@ package android.net { field public static final android.os.Parcelable.Creator CREATOR; } - public final deprecated class RecommendationRequest implements android.os.Parcelable { - ctor protected RecommendationRequest(android.os.Parcel); - method public int describeContents(); - method public android.net.wifi.WifiConfiguration[] getConnectableConfigs(); - method public android.net.wifi.WifiConfiguration getConnectedConfig(); - method public android.net.wifi.WifiConfiguration getDefaultWifiConfig(); - method public int getLastSelectedNetworkId(); - method public long getLastSelectedNetworkTimestamp(); - method public android.net.wifi.ScanResult[] getScanResults(); - method public void setConnectableConfigs(android.net.wifi.WifiConfiguration[]); - method public void setConnectedConfig(android.net.wifi.WifiConfiguration); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - - public static final deprecated class RecommendationRequest.Builder { - ctor public RecommendationRequest.Builder(); - method public android.net.RecommendationRequest build(); - method public android.net.RecommendationRequest.Builder setConnectableConfigs(android.net.wifi.WifiConfiguration[]); - method public android.net.RecommendationRequest.Builder setConnectedWifiConfig(android.net.wifi.WifiConfiguration); - method public android.net.RecommendationRequest.Builder setDefaultWifiConfig(android.net.wifi.WifiConfiguration); - method public android.net.RecommendationRequest.Builder setLastSelectedNetwork(int, long); - method public android.net.RecommendationRequest.Builder setScanResults(android.net.wifi.ScanResult[]); - } - - public final deprecated class RecommendationResult implements android.os.Parcelable { - method public static android.net.RecommendationResult createConnectRecommendation(android.net.wifi.WifiConfiguration); - method public static android.net.RecommendationResult createDoNotConnectRecommendation(); - method public int describeContents(); - method public android.net.wifi.WifiConfiguration getWifiConfiguration(); - method public boolean hasRecommendation(); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - public final class RouteInfo implements android.os.Parcelable { method public int describeContents(); method public android.net.IpPrefix getDestination(); diff --git a/api/system-removed.txt b/api/system-removed.txt index fe512481b1ad..f34ab6410882 100644 --- a/api/system-removed.txt +++ b/api/system-removed.txt @@ -186,6 +186,18 @@ package android.net { method public deprecated int stopUsingNetworkFeature(int, java.lang.String); } + public abstract class NetworkRecommendationProvider { + ctor public deprecated NetworkRecommendationProvider(android.os.Handler); + method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback); + field public static final deprecated java.lang.String EXTRA_RECOMMENDATION_RESULT = "android.net.extra.RECOMMENDATION_RESULT"; + field public static final deprecated java.lang.String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE"; + } + + public static deprecated class NetworkRecommendationProvider.ResultCallback { + ctor public NetworkRecommendationProvider.ResultCallback(android.os.IRemoteCallback, int); + method public void onResult(android.net.RecommendationResult); + } + public abstract class PskKeyManager { ctor public PskKeyManager(); field public static final int MAX_IDENTITY_HINT_LENGTH_BYTES = 128; // 0x80 @@ -193,6 +205,37 @@ package android.net { field public static final int MAX_KEY_LENGTH_BYTES = 256; // 0x100 } + public final deprecated class RecommendationRequest implements android.os.Parcelable { + ctor protected RecommendationRequest(android.os.Parcel); + method public android.net.wifi.WifiConfiguration[] getConnectableConfigs(); + method public android.net.wifi.WifiConfiguration getConnectedConfig(); + method public android.net.wifi.WifiConfiguration getDefaultWifiConfig(); + method public int getLastSelectedNetworkId(); + method public long getLastSelectedNetworkTimestamp(); + method public android.net.wifi.ScanResult[] getScanResults(); + method public void setConnectableConfigs(android.net.wifi.WifiConfiguration[]); + method public void setConnectedConfig(android.net.wifi.WifiConfiguration); + field public static final android.os.Parcelable.Creator CREATOR; + } + + public static final deprecated class RecommendationRequest.Builder { + ctor public RecommendationRequest.Builder(); + method public android.net.RecommendationRequest build(); + method public android.net.RecommendationRequest.Builder setConnectableConfigs(android.net.wifi.WifiConfiguration[]); + method public android.net.RecommendationRequest.Builder setConnectedWifiConfig(android.net.wifi.WifiConfiguration); + method public android.net.RecommendationRequest.Builder setDefaultWifiConfig(android.net.wifi.WifiConfiguration); + method public android.net.RecommendationRequest.Builder setLastSelectedNetwork(int, long); + method public android.net.RecommendationRequest.Builder setScanResults(android.net.wifi.ScanResult[]); + } + + public final deprecated class RecommendationResult implements android.os.Parcelable { + method public static android.net.RecommendationResult createConnectRecommendation(android.net.wifi.WifiConfiguration); + method public static android.net.RecommendationResult createDoNotConnectRecommendation(); + method public android.net.wifi.WifiConfiguration getWifiConfiguration(); + method public boolean hasRecommendation(); + field public static final android.os.Parcelable.Creator CREATOR; + } + public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory { method public static deprecated org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache); } diff --git a/api/test-removed.txt b/api/test-removed.txt index 779ff7cce923..a15846541497 100644 --- a/api/test-removed.txt +++ b/api/test-removed.txt @@ -188,6 +188,18 @@ package android.net { method public deprecated int stopUsingNetworkFeature(int, java.lang.String); } + public abstract class NetworkRecommendationProvider { + ctor public deprecated NetworkRecommendationProvider(android.os.Handler); + method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback); + field public static final deprecated java.lang.String EXTRA_RECOMMENDATION_RESULT = "android.net.extra.RECOMMENDATION_RESULT"; + field public static final deprecated java.lang.String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE"; + } + + public static deprecated class NetworkRecommendationProvider.ResultCallback { + ctor public NetworkRecommendationProvider.ResultCallback(android.os.IRemoteCallback, int); + method public void onResult(android.net.RecommendationResult); + } + public abstract class PskKeyManager { ctor public PskKeyManager(); field public static final int MAX_IDENTITY_HINT_LENGTH_BYTES = 128; // 0x80 @@ -195,6 +207,37 @@ package android.net { field public static final int MAX_KEY_LENGTH_BYTES = 256; // 0x100 } + public final deprecated class RecommendationRequest implements android.os.Parcelable { + ctor protected RecommendationRequest(android.os.Parcel); + method public android.net.wifi.WifiConfiguration[] getConnectableConfigs(); + method public android.net.wifi.WifiConfiguration getConnectedConfig(); + method public android.net.wifi.WifiConfiguration getDefaultWifiConfig(); + method public int getLastSelectedNetworkId(); + method public long getLastSelectedNetworkTimestamp(); + method public android.net.wifi.ScanResult[] getScanResults(); + method public void setConnectableConfigs(android.net.wifi.WifiConfiguration[]); + method public void setConnectedConfig(android.net.wifi.WifiConfiguration); + field public static final android.os.Parcelable.Creator CREATOR; + } + + public static final deprecated class RecommendationRequest.Builder { + ctor public RecommendationRequest.Builder(); + method public android.net.RecommendationRequest build(); + method public android.net.RecommendationRequest.Builder setConnectableConfigs(android.net.wifi.WifiConfiguration[]); + method public android.net.RecommendationRequest.Builder setConnectedWifiConfig(android.net.wifi.WifiConfiguration); + method public android.net.RecommendationRequest.Builder setDefaultWifiConfig(android.net.wifi.WifiConfiguration); + method public android.net.RecommendationRequest.Builder setLastSelectedNetwork(int, long); + method public android.net.RecommendationRequest.Builder setScanResults(android.net.wifi.ScanResult[]); + } + + public final deprecated class RecommendationResult implements android.os.Parcelable { + method public static android.net.RecommendationResult createConnectRecommendation(android.net.wifi.WifiConfiguration); + method public static android.net.RecommendationResult createDoNotConnectRecommendation(); + method public android.net.wifi.WifiConfiguration getWifiConfiguration(); + method public boolean hasRecommendation(); + field public static final android.os.Parcelable.Creator CREATOR; + } + public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory { method public static deprecated org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache); } diff --git a/core/java/android/net/NetworkRecommendationProvider.java b/core/java/android/net/NetworkRecommendationProvider.java index 1eaa1f90d64c..a6d132e5f28d 100644 --- a/core/java/android/net/NetworkRecommendationProvider.java +++ b/core/java/android/net/NetworkRecommendationProvider.java @@ -41,11 +41,13 @@ public abstract class NetworkRecommendationProvider { private static final boolean VERBOSE = Build.IS_DEBUGGABLE && Log.isLoggable(TAG, Log.VERBOSE); /** The key into the callback Bundle where the RecommendationResult will be found. * @deprecated to be removed. + * @removed */ public static final String EXTRA_RECOMMENDATION_RESULT = "android.net.extra.RECOMMENDATION_RESULT"; /** The key into the callback Bundle where the sequence will be found. * @deprecated to be removed. + * @removed */ public static final String EXTRA_SEQUENCE = "android.net.extra.SEQUENCE"; private final IBinder mService; @@ -54,6 +56,7 @@ public abstract class NetworkRecommendationProvider { * Constructs a new instance. * @param handler indicates which thread to use when handling requests. Cannot be {@code null}. * @deprecated use {@link #NetworkRecommendationProvider(Context, Executor)} + * @removed */ public NetworkRecommendationProvider(Handler handler) { if (handler == null) { @@ -82,6 +85,7 @@ public abstract class NetworkRecommendationProvider { * available it must be passed into * {@link ResultCallback#onResult(RecommendationResult)}. * @deprecated to be removed. + * @removed */ public void onRequestRecommendation(RecommendationRequest request, ResultCallback callback) {} @@ -107,6 +111,7 @@ public abstract class NetworkRecommendationProvider { * is available. * * @deprecated to be removed. + * @removed */ public static class ResultCallback { private final IRemoteCallback mCallback; diff --git a/core/java/android/net/RecommendationRequest.java b/core/java/android/net/RecommendationRequest.java index 45ee3a5283dd..21641d9e7fe3 100644 --- a/core/java/android/net/RecommendationRequest.java +++ b/core/java/android/net/RecommendationRequest.java @@ -17,7 +17,6 @@ package android.net; -import android.annotation.SystemApi; import android.net.wifi.ScanResult; import android.net.wifi.WifiConfiguration; import android.os.Parcel; @@ -31,8 +30,8 @@ import com.android.internal.annotations.VisibleForTesting; * @see {@link NetworkScoreManager#requestRecommendation(RecommendationRequest)}. * @hide * @deprecated to be removed. + * @removed */ -@SystemApi public final class RecommendationRequest implements Parcelable { private final ScanResult[] mScanResults; private final WifiConfiguration mDefaultConfig; @@ -45,8 +44,8 @@ public final class RecommendationRequest implements Parcelable { * Builder class for constructing {@link RecommendationRequest} instances. * @hide * @deprecated to be removed. + * @removed */ - @SystemApi public static final class Builder { private ScanResult[] mScanResults; private WifiConfiguration mDefaultConfig; diff --git a/core/java/android/net/RecommendationResult.java b/core/java/android/net/RecommendationResult.java index ce4d83af3f01..d66dd22de40a 100644 --- a/core/java/android/net/RecommendationResult.java +++ b/core/java/android/net/RecommendationResult.java @@ -18,12 +18,10 @@ package android.net; import android.annotation.NonNull; import android.annotation.Nullable; -import android.annotation.SystemApi; import android.net.wifi.WifiConfiguration; import android.os.Parcel; import android.os.Parcelable; -import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.Preconditions; /** @@ -32,8 +30,8 @@ import com.android.internal.util.Preconditions; * @see {@link NetworkScoreManager#requestRecommendation(RecommendationRequest)}. * @hide * @deprecated to be removed. + * @removed */ -@SystemApi public final class RecommendationResult implements Parcelable { private final WifiConfiguration mWifiConfiguration; -- GitLab From af597682abc3e20d58670b15292f54620e6b33e3 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 1 May 2017 10:54:07 -0700 Subject: [PATCH 36/66] Fix stupid bug. Test: manual Change-Id: I1e3bd86eb3e000111721bad82bebdfb491c2e5de --- services/core/java/com/android/server/am/ActiveServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java index 5edf19a9d012..e0fc531eb326 100644 --- a/services/core/java/com/android/server/am/ActiveServices.java +++ b/services/core/java/com/android/server/am/ActiveServices.java @@ -2808,7 +2808,7 @@ public final class ActiveServices { void removeUninstalledPackageLocked(String packageName, int userId) { ServiceMap smap = mServiceMap.get(userId); if (smap != null && smap.mActiveForegroundApps.size() > 0) { - for (int i = smap.mActiveForegroundApps.size(); i >= 0; i--) { + for (int i = smap.mActiveForegroundApps.size()-1; i >= 0; i--) { ActiveForegroundApp aa = smap.mActiveForegroundApps.valueAt(i); if (aa.mPackageName.equals(packageName)) { smap.mActiveForegroundApps.removeAt(i); -- GitLab From c2430f3c4d6e3b996917f57c8afb0b00b5bef45b Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Mon, 1 May 2017 09:35:33 -0700 Subject: [PATCH 37/66] Removed deprecated setAuthentication() method that didn't take ids. Such method would cause the AutofillUi to show on all fields, now it only shows in the fields the service is interested on. This doesn't solve FillResponse auth on multiple partition, but that will come soon... Bug: 37424539 Test: removed hack from testFillResponseAuthJustOneField() Test: CtsAutoFillServiceTestCases pass Change-Id: Id97dddfb9fc1630cd6bac96b9bae9d4a2986dd6d --- .../service/autofill/FillResponse.java | 38 +++++++------- .../autofill/AutofillManagerService.java | 6 +-- .../com/android/server/autofill/Session.java | 51 ++++++++++++++----- .../android/server/autofill/ViewState.java | 16 ++++-- 4 files changed, 71 insertions(+), 40 deletions(-) diff --git a/core/java/android/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java index 42c0151298b0..1914db9eb438 100644 --- a/core/java/android/service/autofill/FillResponse.java +++ b/core/java/android/service/autofill/FillResponse.java @@ -30,6 +30,7 @@ import android.view.autofill.AutofillManager; import android.widget.RemoteViews; import java.util.ArrayList; +import java.util.Arrays; /** * Response for a {@link @@ -258,12 +259,17 @@ public final class FillResponse implements Parcelable { * @param ids id of Views that when focused will display the authentication UI affordance. * * @return This builder. + * @throw {@link IllegalArgumentException} if {@code ids} is {@code null} or empty, or if + * neither {@code authentication} nor {@code presentation} is non-{@code null}. + * * @see android.app.PendingIntent#getIntentSender() */ public @NonNull Builder setAuthentication(@NonNull AutofillId[] ids, @Nullable IntentSender authentication, @Nullable RemoteViews presentation) { throwIfDestroyed(); - // TODO(b/37424539): assert ids is not null nor empty once old version is removed + if (ids == null || ids.length == 0) { + throw new IllegalArgumentException("ids cannot be null or empry"); + } if (authentication == null ^ presentation == null) { throw new IllegalArgumentException("authentication and presentation" + " must be both non-null or null"); @@ -274,17 +280,6 @@ public final class FillResponse implements Parcelable { return this; } - /** - * TODO(b/37424539): will be removed once clients use the version that takes ids - * @hide - * @deprecated - */ - @Deprecated - public @NonNull Builder setAuthentication(@Nullable IntentSender authentication, - @Nullable RemoteViews presentation) { - return setAuthentication(null, authentication, presentation); - } - /** * Specifies views that should not trigger new * {@link AutofillService#onFillRequest(FillRequest, android.os.CancellationSignal, @@ -396,6 +391,7 @@ public final class FillResponse implements Parcelable { public String toString() { if (!sDebug) return super.toString(); + // TODO: create a dump() method instead return new StringBuilder( "FillResponse : [mRequestId=" + mRequestId) .append(", datasets=").append(mDatasets) @@ -403,10 +399,8 @@ public final class FillResponse implements Parcelable { .append(", clientState=").append(mClientState != null) .append(", hasPresentation=").append(mPresentation != null) .append(", hasAuthentication=").append(mAuthentication != null) - .append(", authenticationSize=").append(mAuthenticationIds != null - ? mAuthenticationIds.length : "N/A") - .append(", ignoredIdsSize=").append(mIgnoredIds != null - ? mIgnoredIds.length : "N/A") + .append(", authenticationIds=").append(Arrays.toString(mAuthenticationIds)) + .append(", ignoredIds=").append(Arrays.toString(mIgnoredIds)) .append("]") .toString(); } @@ -447,8 +441,16 @@ public final class FillResponse implements Parcelable { } builder.setSaveInfo(parcel.readParcelable(null)); builder.setClientState(parcel.readParcelable(null)); - builder.setAuthentication(parcel.readParcelableArray(null, AutofillId.class), - parcel.readParcelable(null), parcel.readParcelable(null)); + + // Sets authentication state. + final AutofillId[] authenticationIds = parcel.readParcelableArray(null, + AutofillId.class); + final IntentSender authentication = parcel.readParcelable(null); + final RemoteViews presentation = parcel.readParcelable(null); + if (authenticationIds != null) { + builder.setAuthentication(authenticationIds, authentication, presentation); + } + builder.setIgnoredIds(parcel.readParcelableArray(null, AutofillId.class)); final FillResponse response = builder.build(); diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java index 2358ec55f686..b536ad969c95 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java @@ -603,15 +603,12 @@ public final class AutofillManagerService extends SystemService { if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return; boolean oldDebug = sDebug; - boolean oldVerbose = sVerbose; try { synchronized (mLock) { oldDebug = sDebug; - oldVerbose = sVerbose; setDebugLocked(true); - setVerboseLocked(true); pw.print("Debug mode: "); pw.println(oldDebug); - pw.print("Verbose mode: "); pw.println(oldVerbose); + pw.print("Verbose mode: "); pw.println(sVerbose); pw.print("Disabled users: "); pw.println(mDisabledUsers); final int size = mServicesCache.size(); pw.print("Cached services: "); @@ -631,7 +628,6 @@ public final class AutofillManagerService extends SystemService { mRequestsHistory.reverseDump(fd, pw, args); } finally { setDebugLocked(oldDebug); - setVerboseLocked(oldVerbose); } } diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index c85ce436375e..018fb6886cd9 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -922,6 +922,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } } + + if (ArrayUtils.contains(response.getAuthenticationIds(), id)) { + return false; + } } return true; @@ -943,8 +947,14 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState Slog.v(TAG, "Creating viewState for " + id + " on " + getActionAsString(action)); } - viewState = new ViewState(this, id, value, this, ViewState.STATE_INITIAL); + boolean isIgnored = isIgnoredLocked(id); + viewState = new ViewState(this, id, value, this, + isIgnored ? ViewState.STATE_IGNORED : ViewState.STATE_INITIAL); mViewStates.put(id, viewState); + if (isIgnored) { + if (sDebug) Slog.d(TAG, "updateLocked(): ignoring view " + id); + return; + } } else { if (sVerbose) Slog.v(TAG, "Ignored " + getActionAsString(action) + " for " + id); return; @@ -983,16 +993,11 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState break; case ACTION_VIEW_ENTERED: if (shouldStartNewPartitionLocked(id)) { - // TODO(b/37424539): proper implementation - if (mResponseWaitingAuth != null) { - viewState.setState(ViewState.STATE_WAITING_RESPONSE_AUTH); - } else { - if (sDebug) { - Slog.d(TAG, "Starting partition for view id " + viewState.id); - } - viewState.setState(ViewState.STATE_STARTED_PARTITION); - requestNewFillResponseLocked(flags); + if (sDebug) { + Slog.d(TAG, "Starting partition for view id " + viewState.id); } + viewState.setState(ViewState.STATE_STARTED_PARTITION); + requestNewFillResponseLocked(flags); } // Remove the UI if the ViewState has changed. @@ -1015,6 +1020,18 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } + /** + * Checks whether a view should be ignored. + */ + private boolean isIgnoredLocked(AutofillId id) { + if (mResponses == null || mResponses.size() == 0) { + return false; + } + // Always check the latest response only + final FillResponse response = mResponses.valueAt(mResponses.size() - 1); + return ArrayUtils.contains(response.getIgnoredIds(), id); + } + @Override public void onFillReady(FillResponse response, AutofillId filledId, @Nullable AutofillValue value) { @@ -1149,18 +1166,24 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState final SaveInfo saveInfo = response.getSaveInfo(); if (saveInfo != null) { final AutofillId[] requiredIds = saveInfo.getRequiredIds(); - for (int i = 0; i < requiredIds.length; i++) { - final AutofillId id = requiredIds[i]; + for (AutofillId id : requiredIds) { createOrUpdateViewStateLocked(id, state, null); } final AutofillId[] optionalIds = saveInfo.getOptionalIds(); if (optionalIds != null) { - for (int i = 0; i < optionalIds.length; i++) { - final AutofillId id = optionalIds[i]; + for (AutofillId id : optionalIds) { createOrUpdateViewStateLocked(id, state, null); } } } + + final AutofillId[] authIds = response.getAuthenticationIds(); + if (authIds != null) { + for (AutofillId id : authIds) { + createOrUpdateViewStateLocked(id, state, null); + } + } + } /** diff --git a/services/autofill/java/com/android/server/autofill/ViewState.java b/services/autofill/java/com/android/server/autofill/ViewState.java index 7ca943511dc0..d114e1452373 100644 --- a/services/autofill/java/com/android/server/autofill/ViewState.java +++ b/services/autofill/java/com/android/server/autofill/ViewState.java @@ -17,6 +17,7 @@ package com.android.server.autofill; import static com.android.server.autofill.Helper.sDebug; +import static com.android.server.autofill.Helper.sVerbose; import android.annotation.Nullable; import android.graphics.Rect; @@ -61,8 +62,8 @@ final class ViewState { public static final int STATE_STARTED_PARTITION = 0x20; /** User select a dataset in this view, but service must authenticate first. */ public static final int STATE_WAITING_DATASET_AUTH = 0x40; - // TODO(b/37424539): temporary workaround until partitioning supports auth - public static final int STATE_WAITING_RESPONSE_AUTH = 0x80; + /** Service does not care about this view. */ + public static final int STATE_IGNORED = 0x80; public final AutofillId id; @@ -199,7 +200,16 @@ final class ViewState { void dump(String prefix, PrintWriter pw) { pw.print(prefix); pw.print("id:" ); pw.println(this.id); pw.print(prefix); pw.print("state:" ); pw.println(getStateAsString()); - pw.print(prefix); pw.print("has response:" ); pw.println(mResponse != null); + pw.print(prefix); pw.print("response:"); + if (mResponse == null) { + pw.println("N/A"); + } else { + if (sVerbose) { + pw.println(mResponse); + } else { + pw.println(mResponse.getRequestId()); + } + } pw.print(prefix); pw.print("initialValue:" ); pw.println(mInitialValue); pw.print(prefix); pw.print("currentValue:" ); pw.println(mCurrentValue); pw.print(prefix); pw.print("autofilledValue:" ); pw.println(mAutofilledValue); -- GitLab From 6d7b130e23b8ca411b05eff39653a34929107e4d Mon Sep 17 00:00:00 2001 From: Rebecca Silberstein Date: Sun, 30 Apr 2017 14:05:00 -0700 Subject: [PATCH 38/66] WifiManager: update API for LOHS Add a return code for disallowed tethering for the user. Also updated call to startLocalOnlyHotspot in WifiServiceImpl to return a code instead of a config. This allows us to return different failure modes to the application instead of assuming an incompatible mode error. Also updated method name to retrieve the wifi config. Bug: 37073685 Test: frameworks/base/wifi/tests/runtests.sh Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Iaa442f7062145dbfbdc8e26ae5479d14307addf8 --- wifi/java/android/net/wifi/IWifiManager.aidl | 2 +- wifi/java/android/net/wifi/WifiManager.java | 23 +++++++------ .../src/android/net/wifi/WifiManagerTest.java | 33 ++++++++++--------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl index faae90bec86f..d942d056a316 100644 --- a/wifi/java/android/net/wifi/IWifiManager.aidl +++ b/wifi/java/android/net/wifi/IWifiManager.aidl @@ -131,7 +131,7 @@ interface IWifiManager boolean stopSoftAp(); - WifiConfiguration startLocalOnlyHotspot(in Messenger messenger, in IBinder binder); + int startLocalOnlyHotspot(in Messenger messenger, in IBinder binder); void stopLocalOnlyHotspot(); diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 8fbf4721a20e..5101118b77f2 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -478,7 +478,6 @@ public class WifiManager { */ public static final int IFACE_IP_MODE_LOCAL_ONLY = 2; - /** * Broadcast intent action indicating that a connection to the supplicant has * been established (and it is now possible @@ -1850,8 +1849,9 @@ public class WifiManager { * Tethering to provide an upstream to another device, LocalOnlyHotspot will not start due to * an incompatible mode. The possible error codes include: * {@link LocalOnlyHotspotCallback#ERROR_NO_CHANNEL}, - * {@link LocalOnlyHotspotCallback#ERROR_GENERIC} and - * {@link LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE}. + * {@link LocalOnlyHotspotCallback#ERROR_GENERIC}, + * {@link LocalOnlyHotspotCallback#ERROR_INCOMPATIBLE_MODE} and + * {@link LocalOnlyHotspotCallback#ERROR_TETHERING_DISALLOWED}. *

* Internally, requests will be tracked to prevent the hotspot from being torn down while apps * are still using it. The {@link LocalOnlyHotspotReservation} object passed in the {@link @@ -1892,12 +1892,10 @@ public class WifiManager { LocalOnlyHotspotCallbackProxy proxy = new LocalOnlyHotspotCallbackProxy(this, looper, callback); try { - WifiConfiguration config = mService.startLocalOnlyHotspot( - proxy.getMessenger(), new Binder()); - if (config == null) { + int returnCode = mService.startLocalOnlyHotspot(proxy.getMessenger(), new Binder()); + if (returnCode != LocalOnlyHotspotCallback.REQUEST_REGISTERED) { // Send message to the proxy to make sure we call back on the correct thread - proxy.notifyFailed( - LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE); + proxy.notifyFailed(returnCode); return; } mLOHSCallbackProxy = proxy; @@ -2289,7 +2287,7 @@ public class WifiManager { mCloseGuard.open("close"); } - public WifiConfiguration getConfig() { + public WifiConfiguration getWifiConfiguration() { return mConfig; } @@ -2322,9 +2320,13 @@ public class WifiManager { * @hide */ public static class LocalOnlyHotspotCallback { + /** @hide */ + public static final int REQUEST_REGISTERED = 0; + public static final int ERROR_NO_CHANNEL = 1; public static final int ERROR_GENERIC = 2; public static final int ERROR_INCOMPATIBLE_MODE = 3; + public static final int ERROR_TETHERING_DISALLOWED = 4; /** LocalOnlyHotspot start succeeded. */ public void onStarted(LocalOnlyHotspotReservation reservation) {}; @@ -2345,7 +2347,8 @@ public class WifiManager { * {@link WifiManager#startLocalOnlyHotspot(LocalOnlyHotspotCallback, Handler)} again at * a later time. *

- * @param reason The reason for failure could be one of: {@link #ERROR_INCOMPATIBLE_MODE}, + * @param reason The reason for failure could be one of: {@link + * #ERROR_TETHERING_DISALLOWED}, {@link #ERROR_INCOMPATIBLE_MODE}, * {@link #ERROR_NO_CHANNEL}, or {@link #ERROR_GENERIC}. */ public void onFailed(int reason) { }; diff --git a/wifi/tests/src/android/net/wifi/WifiManagerTest.java b/wifi/tests/src/android/net/wifi/WifiManagerTest.java index 3c0fc6ef0aa8..03ef319fa1e0 100644 --- a/wifi/tests/src/android/net/wifi/WifiManagerTest.java +++ b/wifi/tests/src/android/net/wifi/WifiManagerTest.java @@ -22,6 +22,7 @@ import static android.net.wifi.WifiManager.HOTSPOT_STOPPED; import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_GENERIC; import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE; import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.ERROR_NO_CHANNEL; +import static android.net.wifi.WifiManager.LocalOnlyHotspotCallback.REQUEST_REGISTERED; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -125,12 +126,12 @@ public class WifiManagerTest { public void testCreationAndCloseOfLocalOnlyHotspotReservation() throws Exception { TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback(); when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class))) - .thenReturn(mApConfig); + .thenReturn(REQUEST_REGISTERED); mWifiManager.startLocalOnlyHotspot(callback, mHandler); callback.onStarted(mWifiManager.new LocalOnlyHotspotReservation(mApConfig)); - assertEquals(mApConfig, callback.mRes.getConfig()); + assertEquals(mApConfig, callback.mRes.getWifiConfiguration()); callback.mRes.close(); verify(mWifiService).stopLocalOnlyHotspot(); } @@ -143,13 +144,13 @@ public class WifiManagerTest { throws Exception { TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback(); when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class))) - .thenReturn(mApConfig); + .thenReturn(REQUEST_REGISTERED); mWifiManager.startLocalOnlyHotspot(callback, mHandler); callback.onStarted(mWifiManager.new LocalOnlyHotspotReservation(mApConfig)); try (WifiManager.LocalOnlyHotspotReservation res = callback.mRes) { - assertEquals(mApConfig, res.getConfig()); + assertEquals(mApConfig, res.getWifiConfiguration()); } verify(mWifiService).stopLocalOnlyHotspot(); @@ -337,7 +338,7 @@ public class WifiManagerTest { // record thread from looper.getThread and check ids. TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback(); when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class))) - .thenReturn(null); + .thenReturn(ERROR_INCOMPATIBLE_MODE); mWifiManager.startLocalOnlyHotspot(callback, mHandler); mLooper.dispatchAll(); assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason); @@ -355,7 +356,7 @@ public class WifiManagerTest { when(mContext.getMainLooper()).thenReturn(altLooper.getLooper()); TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback(); when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class))) - .thenReturn(null); + .thenReturn(ERROR_INCOMPATIBLE_MODE); mWifiManager.startLocalOnlyHotspot(callback, null); altLooper.dispatchAll(); assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason); @@ -372,7 +373,7 @@ public class WifiManagerTest { TestLooper callbackLooper = new TestLooper(); Handler callbackHandler = new Handler(callbackLooper.getLooper()); when(mWifiService.startLocalOnlyHotspot(mMessengerCaptor.capture(), - any(IBinder.class))).thenReturn(mApConfig); + any(IBinder.class))).thenReturn(REQUEST_REGISTERED); mWifiManager.startLocalOnlyHotspot(callback, callbackHandler); callbackLooper.dispatchAll(); mLooper.dispatchAll(); @@ -386,7 +387,7 @@ public class WifiManagerTest { mLooper.dispatchAll(); callbackLooper.dispatchAll(); assertTrue(callback.mOnStartedCalled); - assertEquals(mApConfig, callback.mRes.getConfig()); + assertEquals(mApConfig, callback.mRes.getWifiConfiguration()); } /** @@ -399,7 +400,7 @@ public class WifiManagerTest { TestLooper callbackLooper = new TestLooper(); Handler callbackHandler = new Handler(callbackLooper.getLooper()); when(mWifiService.startLocalOnlyHotspot(mMessengerCaptor.capture(), - any(IBinder.class))).thenReturn(mApConfig); + any(IBinder.class))).thenReturn(REQUEST_REGISTERED); mWifiManager.startLocalOnlyHotspot(callback, callbackHandler); callbackLooper.dispatchAll(); mLooper.dispatchAll(); @@ -424,7 +425,7 @@ public class WifiManagerTest { TestLooper callbackLooper = new TestLooper(); Handler callbackHandler = new Handler(callbackLooper.getLooper()); when(mWifiService.startLocalOnlyHotspot(mMessengerCaptor.capture(), - any(IBinder.class))).thenReturn(mApConfig); + any(IBinder.class))).thenReturn(REQUEST_REGISTERED); mWifiManager.startLocalOnlyHotspot(callback, callbackHandler); callbackLooper.dispatchAll(); mLooper.dispatchAll(); @@ -447,7 +448,7 @@ public class WifiManagerTest { TestLooper callbackLooper = new TestLooper(); Handler callbackHandler = new Handler(callbackLooper.getLooper()); when(mWifiService.startLocalOnlyHotspot(mMessengerCaptor.capture(), - any(IBinder.class))).thenReturn(mApConfig); + any(IBinder.class))).thenReturn(REQUEST_REGISTERED); mWifiManager.startLocalOnlyHotspot(callback, callbackHandler); callbackLooper.dispatchAll(); mLooper.dispatchAll(); @@ -470,7 +471,7 @@ public class WifiManagerTest { public void testLocalOnlyHotspotCallbackFullOnNullConfig() throws Exception { TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback(); when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class))) - .thenReturn(null); + .thenReturn(ERROR_INCOMPATIBLE_MODE); mWifiManager.startLocalOnlyHotspot(callback, mHandler); mLooper.dispatchAll(); assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason); @@ -508,7 +509,7 @@ public class WifiManagerTest { public void testLocalOnlyHotspotCallbackFullOnNoChannelError() throws Exception { TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback(); when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class))) - .thenReturn(mApConfig); + .thenReturn(REQUEST_REGISTERED); mWifiManager.startLocalOnlyHotspot(callback, mHandler); mLooper.dispatchAll(); //assertEquals(ERROR_NO_CHANNEL, callback.mFailureReason); @@ -524,7 +525,7 @@ public class WifiManagerTest { public void testCancelLocalOnlyHotspotRequestCallsStopOnWifiService() throws Exception { TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback(); when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class))) - .thenReturn(mApConfig); + .thenReturn(REQUEST_REGISTERED); mWifiManager.startLocalOnlyHotspot(callback, mHandler); mWifiManager.cancelLocalOnlyHotspotRequest(); verify(mWifiService).stopLocalOnlyHotspot(); @@ -546,7 +547,7 @@ public class WifiManagerTest { public void testCallbackAfterLocalOnlyHotspotWasCancelled() throws Exception { TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback(); when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class))) - .thenReturn(mApConfig); + .thenReturn(REQUEST_REGISTERED); mWifiManager.startLocalOnlyHotspot(callback, mHandler); mWifiManager.cancelLocalOnlyHotspotRequest(); verify(mWifiService).stopLocalOnlyHotspot(); @@ -565,7 +566,7 @@ public class WifiManagerTest { public void testCancelAfterLocalOnlyHotspotCallbackTriggered() throws Exception { TestLocalOnlyHotspotCallback callback = new TestLocalOnlyHotspotCallback(); when(mWifiService.startLocalOnlyHotspot(any(Messenger.class), any(IBinder.class))) - .thenReturn(null); + .thenReturn(ERROR_INCOMPATIBLE_MODE); mWifiManager.startLocalOnlyHotspot(callback, mHandler); mLooper.dispatchAll(); assertEquals(ERROR_INCOMPATIBLE_MODE, callback.mFailureReason); -- GitLab From 36728ce14f97a76defe90a05968db0bd2833c878 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Mon, 1 May 2017 12:33:40 -0700 Subject: [PATCH 39/66] Audio focus: fix mapping of old requestAudioFocus to AudioFocusRequest When translating a focus request from the N- API to AudioFocusRequest, do not do null checks for listener or handler, those are only for the AudioFocusRequest.Builder. Test: use app built for N- and request focus, no crash Bug 37855238 Change-Id: I675b3144e913ab674fe27f9f65ee7a7bea24a72c --- media/java/android/media/AudioFocusRequest.java | 14 ++++++++++++++ media/java/android/media/AudioManager.java | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/media/java/android/media/AudioFocusRequest.java b/media/java/android/media/AudioFocusRequest.java index 29d19860eba3..b1dc3ad13f12 100644 --- a/media/java/android/media/AudioFocusRequest.java +++ b/media/java/android/media/AudioFocusRequest.java @@ -356,6 +356,20 @@ public final class AudioFocusRequest { return this; } + /** + * @hide + * Internal listener setter, no null checks on listener nor handler + * @param listener + * @param handler + * @return this {@code Builder} instance. + */ + @NonNull Builder setOnAudioFocusChangeListenerInt( + OnAudioFocusChangeListener listener, Handler handler) { + mFocusListener = listener; + mListenerHandler = handler; + return this; + } + /** * Sets the listener called when audio focus changes after being requested with * {@link AudioManager#requestAudioFocus(AudioFocusRequest)}, and until being abandoned diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index ce07c9982623..0b5dff227d23 100644 --- a/media/java/android/media/AudioManager.java +++ b/media/java/android/media/AudioManager.java @@ -2445,7 +2445,7 @@ public class AudioManager { } final AudioFocusRequest afr = new AudioFocusRequest.Builder(durationHint) - .setOnAudioFocusChangeListener(l, null /* no Handler for this legacy API */) + .setOnAudioFocusChangeListenerInt(l, null /* no Handler for this legacy API */) .setAudioAttributes(requestAttributes) .setAcceptsDelayedFocusGain((flags & AUDIOFOCUS_FLAG_DELAY_OK) == AUDIOFOCUS_FLAG_DELAY_OK) -- GitLab From 1668d9732ab61ab7aa6a5d406cf057f74430ad81 Mon Sep 17 00:00:00 2001 From: Rebecca Silberstein Date: Mon, 1 May 2017 12:45:45 -0700 Subject: [PATCH 40/66] WifiManager: expose base LOHS apis This CL exposes a minimal set of APIs to start LocalOnlyHotspot. This includes the call to start the hotspot along with the objects necessary to get updates and unregister the hotspot request. Bug: 31466854 Bug: 37073685 Test: make update-api Test: make Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: frameworks/base/wifi/tests/runtests.sh Change-Id: I5e9a6a842c0b9233ebf99317f61e0b36192d5be7 --- api/current.txt | 17 +++++++++++++++++ api/system-current.txt | 17 +++++++++++++++++ api/test-current.txt | 17 +++++++++++++++++ wifi/java/android/net/wifi/WifiManager.java | 6 ------ 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/api/current.txt b/api/current.txt index 122f9b0452a2..1848681e3eb1 100644 --- a/api/current.txt +++ b/api/current.txt @@ -26549,6 +26549,7 @@ package android.net.wifi { method public void setTdlsEnabled(java.net.InetAddress, boolean); method public void setTdlsEnabledWithMacAddress(java.lang.String, boolean); method public boolean setWifiEnabled(boolean); + method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler); method public boolean startScan(); method public void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback); method public int updateNetwork(android.net.wifi.WifiConfiguration); @@ -26599,6 +26600,22 @@ package android.net.wifi { field public static final int WPS_WEP_PROHIBITED = 4; // 0x4 } + public static class WifiManager.LocalOnlyHotspotCallback { + ctor public WifiManager.LocalOnlyHotspotCallback(); + method public void onFailed(int); + method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation); + method public void onStopped(); + field public static final int ERROR_GENERIC = 2; // 0x2 + field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3 + field public static final int ERROR_NO_CHANNEL = 1; // 0x1 + field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4 + } + + public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable { + method public void close(); + method public android.net.wifi.WifiConfiguration getWifiConfiguration(); + } + public class WifiManager.MulticastLock { method public void acquire(); method public boolean isHeld(); diff --git a/api/system-current.txt b/api/system-current.txt index 8ce5ee819b67..b73d6744d692 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -29130,6 +29130,7 @@ package android.net.wifi { method public boolean setWifiApConfiguration(android.net.wifi.WifiConfiguration); method public boolean setWifiApEnabled(android.net.wifi.WifiConfiguration, boolean); method public boolean setWifiEnabled(boolean); + method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler); method public deprecated boolean startLocationRestrictedScan(android.os.WorkSource); method public boolean startScan(); method public boolean startScan(android.os.WorkSource); @@ -29207,6 +29208,22 @@ package android.net.wifi { method public abstract void onSuccess(); } + public static class WifiManager.LocalOnlyHotspotCallback { + ctor public WifiManager.LocalOnlyHotspotCallback(); + method public void onFailed(int); + method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation); + method public void onStopped(); + field public static final int ERROR_GENERIC = 2; // 0x2 + field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3 + field public static final int ERROR_NO_CHANNEL = 1; // 0x1 + field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4 + } + + public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable { + method public void close(); + method public android.net.wifi.WifiConfiguration getWifiConfiguration(); + } + public class WifiManager.MulticastLock { method public void acquire(); method public boolean isHeld(); diff --git a/api/test-current.txt b/api/test-current.txt index 4e13e8802829..693ec8583bd9 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -26657,6 +26657,7 @@ package android.net.wifi { method public void setTdlsEnabled(java.net.InetAddress, boolean); method public void setTdlsEnabledWithMacAddress(java.lang.String, boolean); method public boolean setWifiEnabled(boolean); + method public void startLocalOnlyHotspot(android.net.wifi.WifiManager.LocalOnlyHotspotCallback, android.os.Handler); method public boolean startScan(); method public void startWps(android.net.wifi.WpsInfo, android.net.wifi.WifiManager.WpsCallback); method public int updateNetwork(android.net.wifi.WifiConfiguration); @@ -26707,6 +26708,22 @@ package android.net.wifi { field public static final int WPS_WEP_PROHIBITED = 4; // 0x4 } + public static class WifiManager.LocalOnlyHotspotCallback { + ctor public WifiManager.LocalOnlyHotspotCallback(); + method public void onFailed(int); + method public void onStarted(android.net.wifi.WifiManager.LocalOnlyHotspotReservation); + method public void onStopped(); + field public static final int ERROR_GENERIC = 2; // 0x2 + field public static final int ERROR_INCOMPATIBLE_MODE = 3; // 0x3 + field public static final int ERROR_NO_CHANNEL = 1; // 0x1 + field public static final int ERROR_TETHERING_DISALLOWED = 4; // 0x4 + } + + public class WifiManager.LocalOnlyHotspotReservation implements java.lang.AutoCloseable { + method public void close(); + method public android.net.wifi.WifiConfiguration getWifiConfiguration(); + } + public class WifiManager.MulticastLock { method public void acquire(); method public boolean isHeld(); diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 5101118b77f2..e59b74f0bf60 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -1882,8 +1882,6 @@ public class WifiManager { * operating status. * @param handler Handler to be used for callbacks. If the caller passes a null Handler, the * main thread will be used. - * - * @hide */ public void startLocalOnlyHotspot(LocalOnlyHotspotCallback callback, @Nullable Handler handler) { @@ -2272,8 +2270,6 @@ public class WifiManager { * any further callbacks. If the LocalOnlyHotspot is stopped due to a * user triggered mode change, applications will be notified via the {@link * LocalOnlyHotspotCallback#onStopped()} callback. - * - * @hide */ public class LocalOnlyHotspotReservation implements AutoCloseable { @@ -2316,8 +2312,6 @@ public class WifiManager { /** * Callback class for applications to receive updates about the LocalOnlyHotspot status. - * - * @hide */ public static class LocalOnlyHotspotCallback { /** @hide */ -- GitLab From cdae476f7330375e2f6a653a84082b9fc49280f8 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 28 Apr 2017 18:00:04 -0700 Subject: [PATCH 41/66] AudioService: more AUDIO_BECOMING_NOISY intent fixes Fix more race conditions Ignore condition on removed device being actually used for music when in call. Bug: 37687852 Test: Verify AUDIO_BECOMING_NOISY intent is sent in more corner cases Change-Id: I024aa3a4a68d84ac620289720caf3a32fb2985b1 --- .../android/server/audio/AudioService.java | 47 ++++++++++++++----- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index e2b838f74699..623a6b6d9f8c 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -3251,9 +3251,10 @@ public class AudioService extends IAudioService.Stub if (deviceList.size() > 0) { btDevice = deviceList.get(0); int state = mA2dp.getConnectionState(btDevice); + int intState = (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0; int delay = checkSendBecomingNoisyIntent( - AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, - (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0); + AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, intState, + AudioSystem.DEVICE_NONE); queueMsgUnderWakeLock(mAudioHandler, MSG_SET_A2DP_SINK_CONNECTION_STATE, state, @@ -3381,9 +3382,8 @@ public class AudioService extends IAudioService.Stub } } if (toRemove != null) { - int delay = checkSendBecomingNoisyIntent( - AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, - 0); + int delay = checkSendBecomingNoisyIntent(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, + 0, AudioSystem.DEVICE_NONE); for (int i = 0; i < toRemove.size(); i++) { makeA2dpDeviceUnavailableLater(toRemove.valueAt(i), delay); } @@ -3919,7 +3919,7 @@ public class AudioService extends IAudioService.Stub Slog.i(TAG, "setWiredDeviceConnectionState(" + state + " nm: " + name + " addr:" + address + ")"); } - int delay = checkSendBecomingNoisyIntent(type, state); + int delay = checkSendBecomingNoisyIntent(type, state, AudioSystem.DEVICE_NONE); queueMsgUnderWakeLock(mAudioHandler, MSG_SET_WIRED_DEVICE_CONNECTION_STATE, 0 /* arg1 unused */, @@ -3930,6 +3930,16 @@ public class AudioService extends IAudioService.Stub } public int setBluetoothA2dpDeviceConnectionState(BluetoothDevice device, int state, int profile) + { + if (mAudioHandler.hasMessages(MSG_SET_A2DP_SINK_CONNECTION_STATE)) { + return 0; + } + return setBluetoothA2dpDeviceConnectionStateInt( + device, state, profile, AudioSystem.DEVICE_NONE); + } + + public int setBluetoothA2dpDeviceConnectionStateInt( + BluetoothDevice device, int state, int profile, int musicDevice) { int delay; if (profile != BluetoothProfile.A2DP && profile != BluetoothProfile.A2DP_SINK) { @@ -3937,8 +3947,9 @@ public class AudioService extends IAudioService.Stub } synchronized (mConnectedDevices) { if (profile == BluetoothProfile.A2DP) { + int intState = (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0; delay = checkSendBecomingNoisyIntent(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP, - (state == BluetoothA2dp.STATE_CONNECTED) ? 1 : 0); + intState, musicDevice); } else { delay = 0; } @@ -5162,16 +5173,21 @@ public class AudioService extends IAudioService.Stub int device = AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP; synchronized (mConnectedDevices) { + if (mAudioHandler.hasMessages(MSG_SET_A2DP_SINK_CONNECTION_STATE)) { + return; + } final String key = makeDeviceListKey(device, address); final DeviceListSpec deviceSpec = mConnectedDevices.get(key); if (deviceSpec != null) { // Device is connected + int musicDevice = getDeviceForStream(AudioSystem.STREAM_MUSIC); if (AudioSystem.handleDeviceConfigChange(device, address, btDevice.getName()) != AudioSystem.AUDIO_STATUS_OK) { // force A2DP device disconnection in case of error so that AudioService state is // consistent with audio policy manager state - setBluetoothA2dpDeviceConnectionState( - btDevice, BluetoothA2dp.STATE_DISCONNECTED, BluetoothProfile.A2DP_SINK); + setBluetoothA2dpDeviceConnectionStateInt( + btDevice, BluetoothA2dp.STATE_DISCONNECTED, BluetoothProfile.A2DP, + musicDevice); } } } @@ -5242,7 +5258,9 @@ public class AudioService extends IAudioService.Stub // must be called before removing the device from mConnectedDevices // Called synchronized on mConnectedDevices - private int checkSendBecomingNoisyIntent(int device, int state) { + // musicDevice argument is used when not AudioSystem.DEVICE_NONE instead of querying + // from AudioSystem + private int checkSendBecomingNoisyIntent(int device, int state, int musicDevice) { int delay = 0; if ((state == 0) && ((device & mBecomingNoisyIntentDevices) != 0)) { int devices = 0; @@ -5253,8 +5271,13 @@ public class AudioService extends IAudioService.Stub devices |= dev; } } - int musicDevice = getDeviceForStream(AudioSystem.STREAM_MUSIC); - if ((device == musicDevice) && (device == devices)) { + if (musicDevice == AudioSystem.DEVICE_NONE) { + musicDevice = getDeviceForStream(AudioSystem.STREAM_MUSIC); + } + // ignore condition on device being actually used for music when in communication + // because music routing is altered in this case. + if (((device == musicDevice) || isInCommunication()) && (device == devices)) { + mAudioHandler.removeMessages(MSG_BROADCAST_AUDIO_BECOMING_NOISY); sendMsg(mAudioHandler, MSG_BROADCAST_AUDIO_BECOMING_NOISY, SENDMSG_REPLACE, -- GitLab From bbe3e74457e7abeef4156380178ad1793ffe8c0e Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Fri, 28 Apr 2017 18:11:50 -0700 Subject: [PATCH 42/66] AudioService: send AUDIO_BECOMING_NOISY intent when disconnecting USB Bug: 37752052 Test: Verify music stops when removing USB headset Change-Id: I6efd9e0532ea0569cfcab941a93e32395845201f --- .../java/com/android/server/audio/AudioService.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java index 623a6b6d9f8c..e9555f7870d7 100644 --- a/services/core/java/com/android/server/audio/AudioService.java +++ b/services/core/java/com/android/server/audio/AudioService.java @@ -5361,6 +5361,11 @@ public class AudioService extends IAudioService.Stub } } + private static final int DEVICE_OVERRIDE_A2DP_ROUTE_ON_PLUG = + AudioSystem.DEVICE_OUT_WIRED_HEADSET | AudioSystem.DEVICE_OUT_WIRED_HEADPHONE | + AudioSystem.DEVICE_OUT_LINE | + AudioSystem.DEVICE_OUT_ALL_USB; + private void onSetWiredDeviceConnectionState(int device, int state, String address, String deviceName, String caller) { if (DEBUG_DEVICES) { @@ -5372,9 +5377,7 @@ public class AudioService extends IAudioService.Stub } synchronized (mConnectedDevices) { - if ((state == 0) && ((device == AudioSystem.DEVICE_OUT_WIRED_HEADSET) || - (device == AudioSystem.DEVICE_OUT_WIRED_HEADPHONE) || - (device == AudioSystem.DEVICE_OUT_LINE))) { + if ((state == 0) && ((device & DEVICE_OVERRIDE_A2DP_ROUTE_ON_PLUG) != 0)) { setBluetoothA2dpOnInt(true); } boolean isUsb = ((device & ~AudioSystem.DEVICE_OUT_ALL_USB) == 0) || @@ -5385,9 +5388,7 @@ public class AudioService extends IAudioService.Stub return; } if (state != 0) { - if ((device == AudioSystem.DEVICE_OUT_WIRED_HEADSET) || - (device == AudioSystem.DEVICE_OUT_WIRED_HEADPHONE) || - (device == AudioSystem.DEVICE_OUT_LINE)) { + if ((device & DEVICE_OVERRIDE_A2DP_ROUTE_ON_PLUG) != 0) { setBluetoothA2dpOnInt(false); } if ((device & mSafeMediaVolumeDevices) != 0) { -- GitLab From dc01e938c2550390a540311b22e3e6c7603ed975 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Mon, 1 May 2017 12:56:08 -0700 Subject: [PATCH 43/66] RenderScript: IWYU Renderscript was depending on macros from android-base that were transitively included from MQDescriptor.h Test: links Bug: 37791060 Change-Id: Ie34ddef67328c5fcc6b0122a32725b980615ff43 --- rs/jni/Android.mk | 3 ++- rs/jni/android_renderscript_RenderScript.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rs/jni/Android.mk b/rs/jni/Android.mk index 4040db36c4fb..21438e04f38c 100644 --- a/rs/jni/Android.mk +++ b/rs/jni/Android.mk @@ -18,7 +18,8 @@ LOCAL_SHARED_LIBRARIES := \ libgui \ libjnigraphics -LOCAL_STATIC_LIBRARIES := +LOCAL_HEADER_LIBRARIES := \ + libbase_headers LOCAL_C_INCLUDES += \ $(JNI_H_INCLUDE) \ diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp index f6d3f4835381..ee48289731a8 100644 --- a/rs/jni/android_renderscript_RenderScript.cpp +++ b/rs/jni/android_renderscript_RenderScript.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "jni.h" #include "JNIHelp.h" -- GitLab From 9f95b592f868cf3ae207ee9daa8fe4f6db854049 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 26 Apr 2017 11:38:01 -0700 Subject: [PATCH 44/66] Add android.os.VintfRuntimeInfo This is the Java API for ::android::vintf::RuntimeInfo. This will be used by CTS for device info report purposes. Bug: 28656227 Test: cts-tradefed run cts -m CtsEdiHostTestCases --skip-preconditions Change-Id: Id87c95a17e77d7ec1794a6f850de97edf9ae892d --- core/java/android/os/VintfRuntimeInfo.java | 70 +++++++++++++++++++ core/jni/Android.mk | 1 + core/jni/AndroidRuntime.cpp | 2 + core/jni/android_os_VintfRuntimeInfo.cpp | 80 ++++++++++++++++++++++ 4 files changed, 153 insertions(+) create mode 100644 core/java/android/os/VintfRuntimeInfo.java create mode 100644 core/jni/android_os_VintfRuntimeInfo.cpp diff --git a/core/java/android/os/VintfRuntimeInfo.java b/core/java/android/os/VintfRuntimeInfo.java new file mode 100644 index 000000000000..29698b9fa684 --- /dev/null +++ b/core/java/android/os/VintfRuntimeInfo.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * 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; + +/** + * Java API for ::android::vintf::RuntimeInfo. Methods return null / 0 on any error. + * + * @hide + */ +public class VintfRuntimeInfo { + + private VintfRuntimeInfo() {} + + /** + * @return /sys/fs/selinux/policyvers, via security_policyvers() native call + */ + public static native long getKernelSepolicyVersion(); + /** + * @return content of /proc/cpuinfo + */ + public static native String getCpuInfo(); + /** + * @return os name extracted from uname() native call + */ + public static native String getOsName(); + /** + * @return node name extracted from uname() native call + */ + public static native String getNodeName(); + /** + * @return os release extracted from uname() native call + */ + public static native String getOsRelease(); + /** + * @return os version extracted from uname() native call + */ + public static native String getOsVersion(); + /** + * @return hardware id extracted from uname() native call + */ + public static native String getHardwareId(); + /** + * @return kernel version extracted from uname() native call. Format is + * {@code x.y.z}. + */ + public static native String getKernelVersion(); + /** + * @return libavb version in OS. Format is {@code x.y}. + */ + public static native String getBootAvbVersion(); + /** + * @return libavb version in bootloader. Format is {@code x.y}. + */ + public static native String getBootVbmetaAvbVersion(); + +} diff --git a/core/jni/Android.mk b/core/jni/Android.mk index ceb3cc8b4ef5..77c72eb0e3d1 100644 --- a/core/jni/Android.mk +++ b/core/jni/Android.mk @@ -97,6 +97,7 @@ LOCAL_SRC_FILES:= \ android_os_Trace.cpp \ android_os_UEventObserver.cpp \ android_os_VintfObject.cpp \ + android_os_VintfRuntimeInfo.cpp \ android_net_LocalSocketImpl.cpp \ android_net_NetUtils.cpp \ android_net_TrafficStats.cpp \ diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index 8ca479478930..372607d86965 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -160,6 +160,7 @@ extern int register_android_os_MessageQueue(JNIEnv* env); extern int register_android_os_Parcel(JNIEnv* env); extern int register_android_os_SELinux(JNIEnv* env); extern int register_android_os_VintfObject(JNIEnv *env); +extern int register_android_os_VintfRuntimeInfo(JNIEnv *env); extern int register_android_os_seccomp(JNIEnv* env); extern int register_android_os_SystemProperties(JNIEnv *env); extern int register_android_os_SystemClock(JNIEnv* env); @@ -1304,6 +1305,7 @@ static const RegJNIRec gRegJNI[] = { REG_JNI(register_android_os_HwParcel), REG_JNI(register_android_os_HwRemoteBinder), REG_JNI(register_android_os_VintfObject), + REG_JNI(register_android_os_VintfRuntimeInfo), REG_JNI(register_android_nio_utils), REG_JNI(register_android_graphics_Canvas), REG_JNI(register_android_graphics_Graphics), diff --git a/core/jni/android_os_VintfRuntimeInfo.cpp b/core/jni/android_os_VintfRuntimeInfo.cpp new file mode 100644 index 000000000000..ecb685435a97 --- /dev/null +++ b/core/jni/android_os_VintfRuntimeInfo.cpp @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * 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. + */ + +#define LOG_TAG "VintfRuntimeInfo" +//#define LOG_NDEBUG 0 + +#include +#include +#include +#include + +#include "core_jni_helpers.h" + +namespace android { + +using vintf::RuntimeInfo; +using vintf::VintfObject; + +#define MAP_STRING_METHOD(javaMethod, cppString) \ + static jstring android_os_VintfRuntimeInfo_##javaMethod(JNIEnv* env, jclass clazz) \ + { \ + const RuntimeInfo *info = VintfObject::GetRuntimeInfo(); \ + if (info == nullptr) return nullptr; \ + return env->NewStringUTF((cppString).c_str()); \ + } \ + +MAP_STRING_METHOD(getCpuInfo, info->cpuInfo()); +MAP_STRING_METHOD(getOsName, info->osName()); +MAP_STRING_METHOD(getNodeName, info->nodeName()); +MAP_STRING_METHOD(getOsRelease, info->osRelease()); +MAP_STRING_METHOD(getOsVersion, info->osVersion()); +MAP_STRING_METHOD(getHardwareId, info->hardwareId()); +MAP_STRING_METHOD(getKernelVersion, vintf::to_string(info->kernelVersion())); +MAP_STRING_METHOD(getBootAvbVersion, vintf::to_string(info->bootAvbVersion())); +MAP_STRING_METHOD(getBootVbmetaAvbVersion, vintf::to_string(info->bootVbmetaAvbVersion())); + + +static jlong android_os_VintfRuntimeInfo_getKernelSepolicyVersion(JNIEnv *env, jclass clazz) +{ + const RuntimeInfo *info = VintfObject::GetRuntimeInfo(); + if (info == nullptr) return 0; + return static_cast(info->kernelSepolicyVersion()); +} + +// ---------------------------------------------------------------------------- + +static const JNINativeMethod gVintfRuntimeInfoMethods[] = { + {"getKernelSepolicyVersion", "()J", (void*)android_os_VintfRuntimeInfo_getKernelSepolicyVersion}, + {"getCpuInfo", "()Ljava/lang/String;", (void*)android_os_VintfRuntimeInfo_getCpuInfo}, + {"getOsName", "()Ljava/lang/String;", (void*)android_os_VintfRuntimeInfo_getOsName}, + {"getNodeName", "()Ljava/lang/String;", (void*)android_os_VintfRuntimeInfo_getNodeName}, + {"getOsRelease", "()Ljava/lang/String;", (void*)android_os_VintfRuntimeInfo_getOsRelease}, + {"getOsVersion", "()Ljava/lang/String;", (void*)android_os_VintfRuntimeInfo_getOsVersion}, + {"getHardwareId", "()Ljava/lang/String;", (void*)android_os_VintfRuntimeInfo_getHardwareId}, + {"getKernelVersion", "()Ljava/lang/String;", (void*)android_os_VintfRuntimeInfo_getKernelVersion}, + {"getBootAvbVersion", "()Ljava/lang/String;", (void*)android_os_VintfRuntimeInfo_getBootAvbVersion}, + {"getBootVbmetaAvbVersion", "()Ljava/lang/String;", (void*)android_os_VintfRuntimeInfo_getBootVbmetaAvbVersion}, +}; + +const char* const kVintfRuntimeInfoPathName = "android/os/VintfRuntimeInfo"; + +int register_android_os_VintfRuntimeInfo(JNIEnv* env) +{ + return RegisterMethodsOrDie(env, kVintfRuntimeInfoPathName, gVintfRuntimeInfoMethods, NELEM(gVintfRuntimeInfoMethods)); +} + +}; -- GitLab From 7f2539cc9dcbee0ccfde77bf1d20cb279582262b Mon Sep 17 00:00:00 2001 From: Evan Laird Date: Wed, 26 Apr 2017 14:12:34 -0400 Subject: [PATCH 45/66] Add "When to start" definitions to DreamBackend Eases the logic of talking to DreamBackend from settings in that you can now ask it for a constant describing when the screen saver will turn on. Test: none Bug: 35031991 Change-Id: I4a35620b9baf1830998fd4b3e6ebcfe663d5c8ad --- .../settingslib/dream/DreamBackend.java | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java b/packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java index e5cdc85a48d9..988060eac64d 100644 --- a/packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java +++ b/packages/SettingsLib/src/com/android/settingslib/dream/DreamBackend.java @@ -16,6 +16,7 @@ package com.android.settingslib.dream; +import android.annotation.IntDef; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -35,6 +36,8 @@ import android.util.AttributeSet; import android.util.Log; import android.util.Xml; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; @@ -68,6 +71,15 @@ public class DreamBackend { } } + @Retention(RetentionPolicy.SOURCE) + @IntDef({WHILE_CHARGING, WHILE_DOCKED, EITHER, NEVER}) + public @interface WhenToDream{} + + public static final int WHILE_CHARGING = 0; + public static final int WHILE_DOCKED = 1; + public static final int EITHER = 2; + public static final int NEVER = 3; + private final Context mContext; private final IDreamManager mDreamManager; private final DreamInfoComparator mComparator; @@ -75,6 +87,15 @@ public class DreamBackend { private final boolean mDreamsActivatedOnSleepByDefault; private final boolean mDreamsActivatedOnDockByDefault; + private static DreamBackend sInstance; + + public static DreamBackend getInstance(Context context) { + if (sInstance == null) { + sInstance = new DreamBackend(context); + } + return sInstance; + } + public DreamBackend(Context context) { mContext = context; mDreamManager = IDreamManager.Stub.asInterface( @@ -138,6 +159,42 @@ public class DreamBackend { return null; } + public @WhenToDream int getWhenToDreamSetting() { + if (!isEnabled()) { + return NEVER; + } + return isActivatedOnDock() && isActivatedOnSleep() ? EITHER + : isActivatedOnDock() ? WHILE_DOCKED + : isActivatedOnSleep() ? WHILE_CHARGING + : NEVER; + } + + public void setWhenToDream(@WhenToDream int whenToDream) { + setEnabled(whenToDream != NEVER); + + switch (whenToDream) { + case WHILE_CHARGING: + setActivatedOnDock(false); + setActivatedOnSleep(true); + break; + + case WHILE_DOCKED: + setActivatedOnDock(true); + setActivatedOnSleep(false); + break; + + case EITHER: + setActivatedOnDock(true); + setActivatedOnSleep(true); + break; + + case NEVER: + default: + break; + } + + } + public boolean isEnabled() { return getBoolean(Settings.Secure.SCREENSAVER_ENABLED, mDreamsEnabledByDefault); } -- GitLab From a9b6289faaf0ad3768fb8530b199fe7a44a241ab Mon Sep 17 00:00:00 2001 From: Conrad Chen Date: Mon, 1 May 2017 13:14:35 -0700 Subject: [PATCH 46/66] TIF: change documentation wording for onSetSurface() Test: documentaion fix Bug: 31494507 Change-Id: Ib25d45fb3c7e973aa09a5f91ced11abefea4c5ba --- media/java/android/media/tv/TvInputService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java index e51025f43ea5..7b5f778e2853 100644 --- a/media/java/android/media/tv/TvInputService.java +++ b/media/java/android/media/tv/TvInputService.java @@ -745,7 +745,7 @@ public abstract class TvInputService extends Service { * Called when the application sets the surface. * *

The TV input service should render video onto the given surface. When called with - * {@code null}, the input service should immediately release any references to the + * {@code null}, the input service should immediately free any references to the * currently set surface and stop using it. * * @param surface The surface to be used for video rendering. Can be {@code null}. -- GitLab From ea3d3fdefd7a89f2e93ec692298660ce63aff4b2 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Mon, 1 May 2017 07:41:08 -0700 Subject: [PATCH 47/66] Don't relaunch activity in TaskRecord.size if caller deferResume If the caller of TaskRecord.resize() requested resume to be deferred, then we also don't want to ensure configuration on the top activity in the task as that can lead to a re-launch. In this case the caller will handle things. Test: manual Change-Id: I247c4409d4bd19c8ae801e1720aa415d55395201 Fixes: 37767027 --- .../java/com/android/server/am/ActivityRecord.java | 3 +++ .../core/java/com/android/server/am/TaskRecord.java | 12 ++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java index 158175f4b0d9..7bd8b0b3209a 100644 --- a/services/core/java/com/android/server/am/ActivityRecord.java +++ b/services/core/java/com/android/server/am/ActivityRecord.java @@ -2328,6 +2328,9 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo return true; } + // TODO: We should add ActivityRecord.shouldBeVisible() that checks if the activity should + // be visible based on the stack, task, and lockscreen state and use that here instead. The + // method should be based on the logic in ActivityStack.ensureActivitiesVisibleLocked(). // Skip updating configuration for activity is a stack that shouldn't be visible. if (stack.shouldBeVisible(null /* starting */) == STACK_INVISIBLE) { if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.v(TAG_CONFIGURATION, diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java index 056fec526502..2b4cb8dbefd8 100644 --- a/services/core/java/com/android/server/am/TaskRecord.java +++ b/services/core/java/com/android/server/am/TaskRecord.java @@ -550,15 +550,11 @@ final class TaskRecord extends ConfigurationContainer implements TaskWindowConta boolean kept = true; if (updatedConfig) { final ActivityRecord r = topRunningActivityLocked(); - if (r != null) { + if (r != null && !deferResume) { kept = r.ensureActivityConfigurationLocked(0 /* globalChanges */, preserveWindow); - - if (!deferResume) { - // All other activities must be made visible with their correct configuration. - mService.mStackSupervisor.ensureActivitiesVisibleLocked(r, 0, !PRESERVE_WINDOWS); - if (!kept) { - mService.mStackSupervisor.resumeFocusedStackTopActivityLocked(); - } + mService.mStackSupervisor.ensureActivitiesVisibleLocked(r, 0, !PRESERVE_WINDOWS); + if (!kept) { + mService.mStackSupervisor.resumeFocusedStackTopActivityLocked(); } } } -- GitLab From da3dd7c0cf1fcd7e352c8f9e30519e85776c5662 Mon Sep 17 00:00:00 2001 From: Matthew Ng Date: Fri, 28 Apr 2017 17:33:22 -0700 Subject: [PATCH 48/66] All taps under max double tap timeout are quick taps When tapping rapidly on the overview button on a recents grid device (like tablets), users might tap very quickly that would have triggered a elasped time under the min double tap time (40ms) which would cause the button to not be a quick tap. Removing the check allows all taps under the max double tap timeout to be a quick tap. Then quickly tapping the overview button would not confuse alt-tab with resume same task functionality. Test: manual Change-Id: I9161fd5b68c299dc794e538a4fd9021ae98c7e94 Fixes: 36886408 --- .../SystemUI/src/com/android/systemui/recents/RecentsImpl.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java index 53a9eae17f41..2b812a5f7ac3 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java @@ -331,8 +331,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener RecentsActivityLaunchState launchState = config.getLaunchState(); if (!launchState.launchedWithAltTab) { // Has the user tapped quickly? - boolean isQuickTap = ViewConfiguration.getDoubleTapMinTime() < elapsedTime && - elapsedTime < ViewConfiguration.getDoubleTapTimeout(); + boolean isQuickTap = elapsedTime < ViewConfiguration.getDoubleTapTimeout(); if (Recents.getConfiguration().isGridEnabled) { if (isQuickTap) { EventBus.getDefault().post(new LaunchNextTaskRequestEvent()); -- GitLab From e6b4614d88c04a3b3fb0497b5e8f6b4c359f6f2d Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Mon, 1 May 2017 13:41:56 -0700 Subject: [PATCH 49/66] Addess API council comments Test: manual bug:37322491 Change-Id: I2017e667c5452c7ef7c56ec19c594e685700b33a --- api/current.txt | 2 +- api/system-current.txt | 2 +- api/test-current.txt | 2 +- core/java/android/content/pm/SharedLibraryInfo.java | 2 +- .../java/com/android/server/pm/PackageManagerService.java | 6 ++---- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/api/current.txt b/api/current.txt index 887287da8f80..40d0b764baf1 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10927,7 +10927,7 @@ package android.content.pm { method public java.util.List getDependentPackages(); method public java.lang.String getName(); method public int getType(); - method public long getVersion(); + method public int getVersion(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; field public static final int TYPE_BUILTIN = 0; // 0x0 diff --git a/api/system-current.txt b/api/system-current.txt index cdbb6fa20654..c0c54244530e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -11693,7 +11693,7 @@ package android.content.pm { method public java.util.List getDependentPackages(); method public java.lang.String getName(); method public int getType(); - method public long getVersion(); + method public int getVersion(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; field public static final int TYPE_BUILTIN = 0; // 0x0 diff --git a/api/test-current.txt b/api/test-current.txt index 37aa323d371c..75eee778c242 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -10968,7 +10968,7 @@ package android.content.pm { method public java.util.List getDependentPackages(); method public java.lang.String getName(); method public int getType(); - method public long getVersion(); + method public int getVersion(); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; field public static final int TYPE_BUILTIN = 0; // 0x0 diff --git a/core/java/android/content/pm/SharedLibraryInfo.java b/core/java/android/content/pm/SharedLibraryInfo.java index 0ad4874d41fe..5032e6a59a8b 100644 --- a/core/java/android/content/pm/SharedLibraryInfo.java +++ b/core/java/android/content/pm/SharedLibraryInfo.java @@ -131,7 +131,7 @@ public final class SharedLibraryInfo implements Parcelable { * * @return The version. */ - public @IntRange(from = -1) long getVersion() { + public @IntRange(from = -1) int getVersion() { return mVersion; } diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index a56590e3f00b..efb53bfeb2ec 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -4360,8 +4360,7 @@ public class PackageManagerService extends IPackageManager.Stub } SharedLibraryInfo resLibInfo = new SharedLibraryInfo(libInfo.getName(), - // TODO: Remove cast for lib version once internally we support longs. - (int) libInfo.getVersion(), libInfo.getType(), + libInfo.getVersion(), libInfo.getType(), libInfo.getDeclaringPackage(), getPackagesUsingSharedLibraryLPr(libInfo, flags, userId)); @@ -17750,8 +17749,7 @@ public class PackageManagerService extends IPackageManager.Stub for (int i = 0; i < versionCount; i++) { SharedLibraryEntry libEntry = versionedLib.valueAt(i); if (versionsCallerCanSee != null && versionsCallerCanSee.indexOfKey( - // TODO: Remove cast for lib version once internally we support longs. - (int) libEntry.info.getVersion()) < 0) { + libEntry.info.getVersion()) < 0) { continue; } // TODO: We will change version code to long, so in the new API it is long -- GitLab From f29d19610d7fe7c3b757dd6348a2bffc7e7b9435 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 1 May 2017 15:09:11 -0600 Subject: [PATCH 50/66] Rename to follow API council guidance. Test: builds, boots Bug: 37422404 Change-Id: Idcec897e775f2613805a86209615e389b63bd78d --- api/current.txt | 2 +- api/removed.txt | 4 ++++ api/system-current.txt | 2 +- api/system-removed.txt | 4 ++++ api/test-current.txt | 2 +- api/test-removed.txt | 4 ++++ core/java/android/content/pm/ResolveInfo.java | 11 ++++++++--- .../com/android/server/pm/PackageManagerService.java | 4 ++-- 8 files changed, 25 insertions(+), 8 deletions(-) diff --git a/api/current.txt b/api/current.txt index 887287da8f80..46a9aa6833a7 100644 --- a/api/current.txt +++ b/api/current.txt @@ -10889,8 +10889,8 @@ package android.content.pm { field public android.content.pm.ActivityInfo activityInfo; field public android.content.IntentFilter filter; field public int icon; - field public boolean instantAppAvailable; field public boolean isDefault; + field public boolean isInstantAppAvailable; field public int labelRes; field public int match; field public java.lang.CharSequence nonLocalizedLabel; diff --git a/api/removed.txt b/api/removed.txt index b0dad451611f..de56394b7062 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -126,6 +126,10 @@ package android.content.pm { method public abstract boolean setInstantAppCookie(byte[]); } + public class ResolveInfo implements android.os.Parcelable { + field public deprecated boolean instantAppAvailable; + } + public final class SharedLibraryInfo implements android.os.Parcelable { method public boolean isBuiltin(); method public boolean isDynamic(); diff --git a/api/system-current.txt b/api/system-current.txt index cdbb6fa20654..dfa0da725673 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -11655,8 +11655,8 @@ package android.content.pm { field public android.content.pm.ActivityInfo activityInfo; field public android.content.IntentFilter filter; field public int icon; - field public boolean instantAppAvailable; field public boolean isDefault; + field public boolean isInstantAppAvailable; field public int labelRes; field public int match; field public java.lang.CharSequence nonLocalizedLabel; diff --git a/api/system-removed.txt b/api/system-removed.txt index 2fd30391779c..0ccfd516aa18 100644 --- a/api/system-removed.txt +++ b/api/system-removed.txt @@ -124,6 +124,10 @@ package android.content.pm { method public abstract boolean setInstantAppCookie(byte[]); } + public class ResolveInfo implements android.os.Parcelable { + field public deprecated boolean instantAppAvailable; + } + public final class SharedLibraryInfo implements android.os.Parcelable { method public boolean isBuiltin(); method public boolean isDynamic(); diff --git a/api/test-current.txt b/api/test-current.txt index 37aa323d371c..8753712722a5 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -10930,8 +10930,8 @@ package android.content.pm { field public android.content.pm.ActivityInfo activityInfo; field public android.content.IntentFilter filter; field public int icon; - field public boolean instantAppAvailable; field public boolean isDefault; + field public boolean isInstantAppAvailable; field public int labelRes; field public int match; field public java.lang.CharSequence nonLocalizedLabel; diff --git a/api/test-removed.txt b/api/test-removed.txt index b0dad451611f..de56394b7062 100644 --- a/api/test-removed.txt +++ b/api/test-removed.txt @@ -126,6 +126,10 @@ package android.content.pm { method public abstract boolean setInstantAppCookie(byte[]); } + public class ResolveInfo implements android.os.Parcelable { + field public deprecated boolean instantAppAvailable; + } + public final class SharedLibraryInfo implements android.os.Parcelable { method public boolean isBuiltin(); method public boolean isDynamic(); diff --git a/core/java/android/content/pm/ResolveInfo.java b/core/java/android/content/pm/ResolveInfo.java index 650b4c008dcc..f312204e9467 100644 --- a/core/java/android/content/pm/ResolveInfo.java +++ b/core/java/android/content/pm/ResolveInfo.java @@ -71,6 +71,10 @@ public class ResolveInfo implements Parcelable { /** * Whether or not an instant app is available for the resolved intent. */ + public boolean isInstantAppAvailable; + + /** @removed */ + @Deprecated public boolean instantAppAvailable; /** @@ -330,7 +334,8 @@ public class ResolveInfo implements Parcelable { system = orig.system; targetUserId = orig.targetUserId; handleAllWebDataURI = orig.handleAllWebDataURI; - instantAppAvailable = orig.instantAppAvailable; + isInstantAppAvailable = orig.isInstantAppAvailable; + instantAppAvailable = isInstantAppAvailable; } public String toString() { @@ -394,7 +399,7 @@ public class ResolveInfo implements Parcelable { dest.writeInt(noResourceId ? 1 : 0); dest.writeInt(iconResourceId); dest.writeInt(handleAllWebDataURI ? 1 : 0); - dest.writeInt(instantAppAvailable ? 1 : 0); + dest.writeInt(isInstantAppAvailable ? 1 : 0); } public static final Creator CREATOR @@ -442,7 +447,7 @@ public class ResolveInfo implements Parcelable { noResourceId = source.readInt() != 0; iconResourceId = source.readInt(); handleAllWebDataURI = source.readInt() != 0; - instantAppAvailable = source.readInt() != 0; + instantAppAvailable = isInstantAppAvailable = source.readInt() != 0; } public static class DisplayNameComparator diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index a56590e3f00b..1e627b133111 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -6509,7 +6509,7 @@ public class PackageManagerService extends IPackageManager.Stub ephemeralInstaller.filter = new IntentFilter(intent.getAction()); ephemeralInstaller.filter.addDataPath( intent.getData().getPath(), PatternMatcher.PATTERN_LITERAL); - ephemeralInstaller.instantAppAvailable = true; + ephemeralInstaller.isInstantAppAvailable = true; result.add(ephemeralInstaller); } } @@ -12611,7 +12611,7 @@ public class PackageManagerService extends IPackageManager.Stub } res.iconResourceId = info.icon; res.system = res.activityInfo.applicationInfo.isSystemApp(); - res.instantAppAvailable = userState.instantApp; + res.isInstantAppAvailable = userState.instantApp; return res; } -- GitLab From 75ffc5f309cd7a31c4bf096bea21293dfa44b60e Mon Sep 17 00:00:00 2001 From: Chulwoo Lee Date: Mon, 1 May 2017 14:10:25 -0700 Subject: [PATCH 51/66] Allow null setup activity for TV input Test: cts-tradefed run cts -m CtsTvTestCases -t android.media.tv.cts.TvInputInfoTest Bug: 37863603 Change-Id: I62f9927f94534c0564a3c52f8c7b266a347399e1 --- media/java/android/media/tv/TvInputInfo.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/media/java/android/media/tv/TvInputInfo.java b/media/java/android/media/tv/TvInputInfo.java index a292b8e4f81e..74085d39162c 100644 --- a/media/java/android/media/tv/TvInputInfo.java +++ b/media/java/android/media/tv/TvInputInfo.java @@ -949,9 +949,6 @@ public final class TvInputInfo implements Parcelable { com.android.internal.R.styleable.TvInputService); mSetupActivity = sa.getString( com.android.internal.R.styleable.TvInputService_setupActivity); - if (inputType == TYPE_TUNER && TextUtils.isEmpty(mSetupActivity)) { - throw new IllegalStateException("Setup activity not found for " + si.name); - } if (mCanRecord == null) { mCanRecord = sa.getBoolean( com.android.internal.R.styleable.TvInputService_canRecord, false); -- GitLab From fa09f7a1b9baefb38c2e9bffb7f26e36099d62c1 Mon Sep 17 00:00:00 2001 From: Eugene Susla Date: Mon, 1 May 2017 14:25:52 -0700 Subject: [PATCH 52/66] Change protection level of companion permissions Fixes: 37721270 Test: Ensure co build errors Change-Id: Ide6ce7c83f466ef6886b2aad0228176ae84314b2 --- core/res/AndroidManifest.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index ea9bd22d0b1a..f418435996d4 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -1879,20 +1879,20 @@ android:protectionLevel="signature" /> + android:protectionLevel="normal" /> + android:protectionLevel="normal" /> -- GitLab From f05458cf7ee9b1e2ec482126a8c2de1bf1315c8a Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Mon, 1 May 2017 14:23:03 -0700 Subject: [PATCH 53/66] Hide FragmentContainer#instantiate for API 26 Bug 37638617 Change-Id: I065cd31d6ce987155669f72eff0e0d6d8a9430ab Test: none; hiding API only --- api/current.txt | 1 - api/system-current.txt | 1 - api/test-current.txt | 1 - core/java/android/app/FragmentContainer.java | 2 ++ 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index 070634e2272d..4cea0f048f94 100644 --- a/api/current.txt +++ b/api/current.txt @@ -4698,7 +4698,6 @@ package android.app { public abstract class FragmentContainer { ctor public FragmentContainer(); - method public android.app.Fragment instantiate(android.content.Context, java.lang.String, android.os.Bundle); method public abstract T onFindViewById(int); method public abstract boolean onHasView(); } diff --git a/api/system-current.txt b/api/system-current.txt index cd72cd082708..c25fb313edc9 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4868,7 +4868,6 @@ package android.app { public abstract class FragmentContainer { ctor public FragmentContainer(); - method public android.app.Fragment instantiate(android.content.Context, java.lang.String, android.os.Bundle); method public abstract T onFindViewById(int); method public abstract boolean onHasView(); } diff --git a/api/test-current.txt b/api/test-current.txt index 7aa3a97ab48d..fb4a05dcdcc6 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -4711,7 +4711,6 @@ package android.app { public abstract class FragmentContainer { ctor public FragmentContainer(); - method public android.app.Fragment instantiate(android.content.Context, java.lang.String, android.os.Bundle); method public abstract T onFindViewById(int); method public abstract boolean onHasView(); } diff --git a/core/java/android/app/FragmentContainer.java b/core/java/android/app/FragmentContainer.java index 77c9c312ce24..f8836bc829a0 100644 --- a/core/java/android/app/FragmentContainer.java +++ b/core/java/android/app/FragmentContainer.java @@ -42,6 +42,8 @@ public abstract class FragmentContainer { * Creates an instance of the specified fragment, can be overridden to construct fragments * with dependencies, or change the fragment being constructed. By default just calls * {@link Fragment#instantiate(Context, String, Bundle)}. + * + * @hide */ public Fragment instantiate(Context context, String className, Bundle arguments) { return Fragment.instantiate(context, className, arguments); -- GitLab From c0149bf0f67a7d090d120cd243f191527a97d91d Mon Sep 17 00:00:00 2001 From: Robert Carr Date: Mon, 1 May 2017 15:22:22 -0700 Subject: [PATCH 54/66] Fix rotation animation selection. The default activity specified value for rotation animation should be unset, not ROTATE, so that it will not override window specified versions. Bug: 37671120 Test: Rotate camera 180 degrees...expect crossfade or jumpcut depending on APK version but never rotate animation. Change-Id: I6acbf32b3de0e2848565cc6cb6fb62f625053634 --- core/java/android/content/pm/ActivityInfo.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index 0be0885c5bdc..cf7f017daf60 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -883,9 +883,12 @@ public class ActivityInfo extends ComponentInfo /** * Screen rotation animation desired by the activity, with values as defined * for {@link android.view.WindowManager.LayoutParams#rotationAnimation}. + * + * -1 means to use the system default. + * * @hide */ - public int rotationAnimation = ROTATION_ANIMATION_ROTATE; + public int rotationAnimation = -1; /** @hide */ public static final int LOCK_TASK_LAUNCH_MODE_DEFAULT = 0; -- GitLab From 2c60ef0fae235cd980512f53a8f1de52735b0087 Mon Sep 17 00:00:00 2001 From: Joe LaPenna Date: Mon, 1 May 2017 09:46:01 -0700 Subject: [PATCH 55/66] Video badging levels: @Deprecate and @remove Video based badging is not going out in O. Hide video-terminology constants. Bug: 37687077 Test: make update-api; Change-Id: Ibd3a732be11bcd0f6b1077943a34b77f7c971ee3 --- api/removed.txt | 8 ++++++++ api/system-current.txt | 11 ----------- api/system-removed.txt | 8 ++++++++ api/test-removed.txt | 8 ++++++++ core/java/android/net/NetworkBadging.java | 5 +++-- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/api/removed.txt b/api/removed.txt index 756dc6970494..69bb3da6beca 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -238,6 +238,14 @@ package android.net { method public deprecated int stopUsingNetworkFeature(int, java.lang.String); } + public deprecated class NetworkBadging { + method public static android.graphics.drawable.Drawable getWifiIcon(int, int, android.content.res.Resources.Theme); + field public static final int BADGING_4K = 30; // 0x1e + field public static final int BADGING_HD = 20; // 0x14 + field public static final int BADGING_NONE = 0; // 0x0 + field public static final int BADGING_SD = 10; // 0xa + } + public abstract class NetworkRecommendationProvider { ctor public deprecated NetworkRecommendationProvider(android.os.Handler); method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback); diff --git a/api/system-current.txt b/api/system-current.txt index f94ea7e1ce36..b355847c56eb 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -27756,17 +27756,6 @@ package android.net { field public static final android.os.Parcelable.Creator CREATOR; } - public class NetworkBadging { - method public static android.graphics.drawable.Drawable getWifiIcon(int, int, android.content.res.Resources.Theme); - field public static final int BADGING_4K = 30; // 0x1e - field public static final int BADGING_HD = 20; // 0x14 - field public static final int BADGING_NONE = 0; // 0x0 - field public static final int BADGING_SD = 10; // 0xa - } - - public static abstract class NetworkBadging.Badging implements java.lang.annotation.Annotation { - } - public final class NetworkCapabilities implements android.os.Parcelable { ctor public NetworkCapabilities(android.net.NetworkCapabilities); method public int describeContents(); diff --git a/api/system-removed.txt b/api/system-removed.txt index 1df6a37bf170..a782bfc19830 100644 --- a/api/system-removed.txt +++ b/api/system-removed.txt @@ -236,6 +236,14 @@ package android.net { method public deprecated int stopUsingNetworkFeature(int, java.lang.String); } + public deprecated class NetworkBadging { + method public static android.graphics.drawable.Drawable getWifiIcon(int, int, android.content.res.Resources.Theme); + field public static final int BADGING_4K = 30; // 0x1e + field public static final int BADGING_HD = 20; // 0x14 + field public static final int BADGING_NONE = 0; // 0x0 + field public static final int BADGING_SD = 10; // 0xa + } + public abstract class NetworkRecommendationProvider { ctor public deprecated NetworkRecommendationProvider(android.os.Handler); method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback); diff --git a/api/test-removed.txt b/api/test-removed.txt index 756dc6970494..69bb3da6beca 100644 --- a/api/test-removed.txt +++ b/api/test-removed.txt @@ -238,6 +238,14 @@ package android.net { method public deprecated int stopUsingNetworkFeature(int, java.lang.String); } + public deprecated class NetworkBadging { + method public static android.graphics.drawable.Drawable getWifiIcon(int, int, android.content.res.Resources.Theme); + field public static final int BADGING_4K = 30; // 0x1e + field public static final int BADGING_HD = 20; // 0x14 + field public static final int BADGING_NONE = 0; // 0x0 + field public static final int BADGING_SD = 10; // 0xa + } + public abstract class NetworkRecommendationProvider { ctor public deprecated NetworkRecommendationProvider(android.os.Handler); method public deprecated void onRequestRecommendation(android.net.RecommendationRequest, android.net.NetworkRecommendationProvider.ResultCallback); diff --git a/core/java/android/net/NetworkBadging.java b/core/java/android/net/NetworkBadging.java index b4ef69542bd1..6de28b7146e8 100644 --- a/core/java/android/net/NetworkBadging.java +++ b/core/java/android/net/NetworkBadging.java @@ -35,9 +35,10 @@ import java.lang.annotation.RetentionPolicy; /** * Utility methods for working with network badging. * - * @hide + * @removed + * */ -@SystemApi +@Deprecated public class NetworkBadging { @IntDef({BADGING_NONE, BADGING_SD, BADGING_HD, BADGING_4K}) -- GitLab From 2233fb13e00796ec8c4268e1d7211fc807dfcf90 Mon Sep 17 00:00:00 2001 From: Casey Burkhardt Date: Mon, 1 May 2017 15:33:14 -0700 Subject: [PATCH 56/66] Manually merge CL 2175149 to master for green build Refactor accessibility button support detection - Moves logic to detect devices capable of supporting the accessibility button into AccessibilityManager from SettingsLib to avoid issues with resource shifting in the SUW binary Bug: 37650567 Test: Existing SUW Robolectric Change-Id: Ibb2aaa3c2f79570df768cfa796fa890988ef82cc --- api/system-current.txt | 1 + .../view/accessibility/AccessibilityManager.java | 15 +++++++++++++++ .../accessibility/AccessibilityButtonHelper.java | 5 ----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index a7fb5bb63954..2a667905854e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -50675,6 +50675,7 @@ package android.view.accessibility { method public java.util.List getEnabledAccessibilityServiceList(int); method public java.util.List getInstalledAccessibilityServiceList(); method public void interrupt(); + method public static boolean isAccessibilityButtonSupported(); method public boolean isEnabled(); method public boolean isTouchExplorationEnabled(); method public void removeAccessibilityRequestPreparer(android.view.accessibility.AccessibilityRequestPreparer); diff --git a/core/java/android/view/accessibility/AccessibilityManager.java b/core/java/android/view/accessibility/AccessibilityManager.java index 4c266a66a7af..c8f297ae9c1f 100644 --- a/core/java/android/view/accessibility/AccessibilityManager.java +++ b/core/java/android/view/accessibility/AccessibilityManager.java @@ -23,10 +23,12 @@ import android.accessibilityservice.AccessibilityServiceInfo; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SdkConstant; +import android.annotation.SystemApi; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; import android.content.pm.ServiceInfo; +import android.content.res.Resources; import android.os.Binder; import android.os.Handler; import android.os.IBinder; @@ -1113,6 +1115,19 @@ public final class AccessibilityManager { } } + /** + * Determines if the accessibility button within the system navigation area is supported. + * + * @return {@code true} if the accessibility button is supported on this device, + * {@code false} otherwise + * @hide + */ + @SystemApi + public static boolean isAccessibilityButtonSupported() { + final Resources res = Resources.getSystem(); + return res.getBoolean(com.android.internal.R.bool.config_showNavigationBar); + } + private final class MyCallback implements Handler.Callback { public static final int MSG_SET_STATE = 1; diff --git a/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityButtonHelper.java b/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityButtonHelper.java index 972ea347e6dd..d5725e6aefed 100644 --- a/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityButtonHelper.java +++ b/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityButtonHelper.java @@ -18,7 +18,6 @@ package com.android.settingslib.accessibility; import android.accessibilityservice.AccessibilityServiceInfo; import android.content.Context; -import android.content.res.Resources; import android.provider.Settings; import android.view.accessibility.AccessibilityManager; @@ -55,8 +54,4 @@ public class AccessibilityButtonHelper { public static boolean isRequested(Context ctx) { return isRequestedByMagnification(ctx) || isRequestedByAccessibilityService(ctx); } - - public static boolean isDeviceSupported(Resources res) { - return res.getBoolean(com.android.internal.R.bool.config_showNavigationBar); - } } -- GitLab From 52bfc8ea43cd19d136420cf530cb2cb3f8d5bdd4 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Mon, 1 May 2017 15:48:22 -0700 Subject: [PATCH 57/66] Import translations. DO NOT MERGE Change-Id: Ia2cafaf8645ff63169a927926e443db76542e355 Auto-generated-cl: translation import --- core/res/res/values-af/strings.xml | 10 +++++++ core/res/res/values-am/strings.xml | 10 +++++++ core/res/res/values-ar/strings.xml | 10 +++++++ core/res/res/values-az/strings.xml | 10 +++++++ core/res/res/values-b+sr+Latn/strings.xml | 12 +++++++- core/res/res/values-be/strings.xml | 20 +++++++++---- core/res/res/values-bg/strings.xml | 10 +++++++ core/res/res/values-bn/strings.xml | 10 +++++++ core/res/res/values-bs/strings.xml | 18 +++++++++--- core/res/res/values-ca/strings.xml | 10 +++++++ core/res/res/values-cs/strings.xml | 10 +++++++ core/res/res/values-da/strings.xml | 28 ++++++++++++------ core/res/res/values-de/strings.xml | 10 +++++++ core/res/res/values-el/strings.xml | 10 +++++++ core/res/res/values-en-rAU/strings.xml | 10 +++++++ core/res/res/values-en-rGB/strings.xml | 10 +++++++ core/res/res/values-en-rIN/strings.xml | 10 +++++++ core/res/res/values-es-rUS/strings.xml | 10 +++++++ core/res/res/values-es/strings.xml | 10 +++++++ core/res/res/values-et/strings.xml | 10 +++++++ core/res/res/values-eu/strings.xml | 14 +++++++-- core/res/res/values-fa/strings.xml | 10 +++++++ core/res/res/values-fi/strings.xml | 10 +++++++ core/res/res/values-fr-rCA/strings.xml | 10 +++++++ core/res/res/values-fr/strings.xml | 10 +++++++ core/res/res/values-gl/strings.xml | 22 ++++++++++---- core/res/res/values-gu/strings.xml | 10 +++++++ core/res/res/values-hi/strings.xml | 10 +++++++ core/res/res/values-hr/strings.xml | 10 +++++++ core/res/res/values-hu/strings.xml | 10 +++++++ core/res/res/values-hy/strings.xml | 10 +++++++ core/res/res/values-in/strings.xml | 10 +++++++ core/res/res/values-is/strings.xml | 10 +++++++ core/res/res/values-it/strings.xml | 10 +++++++ core/res/res/values-iw/strings.xml | 36 +++++++++++++++-------- core/res/res/values-ja/strings.xml | 10 +++++++ core/res/res/values-ka/strings.xml | 10 +++++++ core/res/res/values-kk/strings.xml | 10 +++++++ core/res/res/values-km/strings.xml | 10 +++++++ core/res/res/values-kn/strings.xml | 10 +++++++ core/res/res/values-ko/strings.xml | 10 +++++++ core/res/res/values-ky/strings.xml | 14 +++++++-- core/res/res/values-lo/strings.xml | 12 +++++++- core/res/res/values-lt/strings.xml | 10 +++++++ core/res/res/values-lv/strings.xml | 10 +++++++ core/res/res/values-mk/strings.xml | 10 +++++++ core/res/res/values-ml/strings.xml | 10 +++++++ core/res/res/values-mn/strings.xml | 10 +++++++ core/res/res/values-mr/strings.xml | 10 +++++++ core/res/res/values-ms/strings.xml | 10 +++++++ core/res/res/values-my/strings.xml | 10 +++++++ core/res/res/values-nb/strings.xml | 10 +++++++ core/res/res/values-ne/strings.xml | 12 +++++++- core/res/res/values-nl/strings.xml | 10 +++++++ core/res/res/values-pa/strings.xml | 10 +++++++ core/res/res/values-pl/strings.xml | 10 +++++++ core/res/res/values-pt-rBR/strings.xml | 10 +++++++ core/res/res/values-pt-rPT/strings.xml | 10 +++++++ core/res/res/values-pt/strings.xml | 10 +++++++ core/res/res/values-ro/strings.xml | 10 +++++++ core/res/res/values-ru/strings.xml | 10 +++++++ core/res/res/values-si/strings.xml | 12 +++++++- core/res/res/values-sk/strings.xml | 10 +++++++ core/res/res/values-sl/strings.xml | 10 +++++++ core/res/res/values-sq/strings.xml | 10 +++++++ core/res/res/values-sr/strings.xml | 12 +++++++- core/res/res/values-sv/strings.xml | 10 +++++++ core/res/res/values-sw/strings.xml | 12 +++++++- core/res/res/values-ta/strings.xml | 10 +++++++ core/res/res/values-te/strings.xml | 10 +++++++ core/res/res/values-th/strings.xml | 10 +++++++ core/res/res/values-tl/strings.xml | 14 +++++++-- core/res/res/values-tr/strings.xml | 10 +++++++ core/res/res/values-uk/strings.xml | 10 +++++++ core/res/res/values-ur/strings.xml | 10 +++++++ core/res/res/values-uz/strings.xml | 14 +++++++-- core/res/res/values-vi/strings.xml | 10 +++++++ core/res/res/values-zh-rCN/strings.xml | 10 +++++++ core/res/res/values-zh-rHK/strings.xml | 18 +++++++++--- core/res/res/values-zh-rTW/strings.xml | 10 +++++++ core/res/res/values-zu/strings.xml | 10 +++++++ 81 files changed, 865 insertions(+), 55 deletions(-) diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml index b6cc0355cd78..4524b6e6c181 100644 --- a/core/res/res/values-af/strings.xml +++ b/core/res/res/values-af/strings.xml @@ -265,6 +265,16 @@ "Opletberigte" "Kleinhandeldemonstrasie" "USB-verbinding" + + + + + + + + + + "Veiligmodus" "Android-stelsel" "Skakel oor na persoonlik" diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml index 03432cb78500..a3ebecbd2ebc 100644 --- a/core/res/res/values-am/strings.xml +++ b/core/res/res/values-am/strings.xml @@ -265,6 +265,16 @@ "ማንቂያዎች" "የችርቻሮ ማሳያ" "የዩኤስቢ ግንኙነት" + + + + + + + + + + "የሚያስተማምን ሁነታ" "Android ስርዓት" "ወደ የግል ቀይር" diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml index 49aeb0ad3037..d1b9dcb5af2b 100644 --- a/core/res/res/values-ar/strings.xml +++ b/core/res/res/values-ar/strings.xml @@ -277,6 +277,16 @@ "التنبيهات" "عرض توضيحي لبائع التجزئة" "‏اتصال USB" + + + + + + + + + + "الوضع الآمن" "‏نظام Android" "التبديل إلى الشخصي" diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml index 4d4d157f31be..552c4e30c7cf 100644 --- a/core/res/res/values-az/strings.xml +++ b/core/res/res/values-az/strings.xml @@ -265,6 +265,16 @@ "Siqnallar" "Pərakəndə demo" "USB əlaqə" + + + + + + + + + + "Təhlükəsiz rejim" "Android sistemi" "Şəxsi profilə keçirin" diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml index 81ef9088997d..9fc3a28c507b 100644 --- a/core/res/res/values-b+sr+Latn/strings.xml +++ b/core/res/res/values-b+sr+Latn/strings.xml @@ -268,6 +268,16 @@ "Obaveštenja" "Režim demonstracije za maloprodajne objekte" "USB veza" + + + + + + + + + + "Bezbedni režim" "Android sistem" "Pređi na Lični profil" @@ -1630,7 +1640,7 @@ "Instalirao je administrator" "Ažurirao je administrator" "Izbrisao je administrator" - "Da bi produžila vreme trajanja baterije, ušteda baterije smanjuje performanse uređaja i ograničava vibraciju, usluge lokacije i većinu pozadinskih podataka. Imejl, razmena poruka i druge aplikacije koje se oslanjaju na sinhronizaciju možda neće da se ažuriraju ako ih ne otvorite.\n\nUšteda baterije se automatski isključuje kada se uređaj puni." + "Da bi produžila vreme trajanja baterije, ušteda baterije smanjuje performanse uređaja i ograničava vibraciju, usluge lokacije i većinu pozadinskih podataka. Imejl, razmena poruka i druge aplikacije koje se oslanjaju na sinhronizaciju neće se ažurirati dok ih ne otvorite.\n\nUšteda baterije se automatski isključuje kada se uređaj puni." "Da bi se smanjila potrošnja podataka, Ušteda podataka sprečava neke aplikacije da šalju ili primaju podatke u pozadini. Aplikacija koju trenutno koristite može da pristupa podacima, ali će to činiti ređe. Na primer, slike se neće prikazivati dok ih ne dodirnete." "Uključiti Uštedu podataka?" "Uključi" diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml index 3836385b14e9..fdd15d3cf95c 100644 --- a/core/res/res/values-be/strings.xml +++ b/core/res/res/values-be/strings.xml @@ -271,6 +271,16 @@ "Абвесткi" "Дэманстрацыйны рэжым для пунктаў продажу" "Падключэнне USB" + + + + + + + + + + "Бяспечны рэжым" "Сістэма Android" "Пераключыцца на асабісты" @@ -293,12 +303,12 @@ "рабіць тэлефонныя выклікі і кіраваць імі" "Датчыкі цела" "атрымліваць з датчыка даныя асноўных фізіялагічных паказчыкаў" - "Атрымайце змесцiва акна" - "Вывучыце змесцiва акна, з якiм вы працуеце." - "Уключыце Explore by Touch" + "Атрымліваць змесціва вакна" + "Аналізаваць змесціва актыўнага вакна." + "Уключаць Азнаямленне дотыкам" "Элементы, да якіх дакрануліся, будуць агучаны, а экранам можна даследаваць пры дапамозе жэстаў." - "Глядзiце, што набiраеце" - "Уключае ў сябе асабістыя дадзеныя, такія як нумары крэдытных карт і паролі." + "Праглядаць тэкст, які вы набіраеце" + "У тым ліку асабістыя даныя, такія як нумары крэдытных карт і паролі." "Кіраваць павелічэннем дысплэя" "Кіраваць маштабам дысплэя і пазіцыянаваннем." "Выконваць жэсты" diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml index c799ca9e48f2..b03e09e73daf 100644 --- a/core/res/res/values-bg/strings.xml +++ b/core/res/res/values-bg/strings.xml @@ -265,6 +265,16 @@ "Сигнали" "Демонстрационен режим за магазини" "USB връзка" + + + + + + + + + + "Безопасен режим" "Система Android" "Превключване към личния потребителски профил" diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml index c8bc6d7b19f4..b574890b5cc9 100644 --- a/core/res/res/values-bn/strings.xml +++ b/core/res/res/values-bn/strings.xml @@ -265,6 +265,16 @@ "সতর্কতাগুলি" "খুচরা বিক্রয়ের ডেমো" "USB সংযোগ" + + + + + + + + + + "নিরাপদ মোড" "Android সিস্টেম" "ব্যক্তিগততে পাল্টান" diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml index f93c655b02a4..37fa55fc3b70 100644 --- a/core/res/res/values-bs/strings.xml +++ b/core/res/res/values-bs/strings.xml @@ -268,6 +268,16 @@ "Upozorenja" "Promotivna demonstracija u maloprodaji" "USB veza" + + + + + + + + + + "Siguran način rada" "Android sistem" "Prebacite se na lični" @@ -998,7 +1008,7 @@ "Način unosa" "Akcije za tekst" "E-pošta" - "Telefon" + "Pozovi" "Mapa" "Pretraži" "Ponestaje prostora za pohranu" @@ -1184,7 +1194,7 @@ "Postavljanje vremena" "Postavljanje datuma" "Postaviti" - "Završeno" + "Gotovo" "NOVO: " "Aplikacija %1$s omogućava." "Nisu potrebne dozvole" @@ -1436,7 +1446,7 @@ "Bežični prikaz" "Prebacuj" "Poveži na uređaj" - "Prebaci ekran na uređaj" + "Emitiranje ekrana na uređaj" "Traženje uređajā…" "Postavke" "Prekini vezu" @@ -1615,7 +1625,7 @@ "Prikazuje se cijeli ekran" "Da izađete, prevucite nadolje odozgo." "Razumijem" - "Završeno" + "Gotovo" "Kružni klizač za odabir sata" "Kružni klizač za minute" "Odaberite sat" diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml index 512f1673831b..0b77c82fae42 100644 --- a/core/res/res/values-ca/strings.xml +++ b/core/res/res/values-ca/strings.xml @@ -265,6 +265,16 @@ "Alertes" "Demostració comercial" "Connexió USB" + + + + + + + + + + "Mode segur" "Sistema Android" "Canvia al perfil personal" diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml index 0dabc80913ab..31f08268ed68 100644 --- a/core/res/res/values-cs/strings.xml +++ b/core/res/res/values-cs/strings.xml @@ -271,6 +271,16 @@ "Upozornění" "Prodejní ukázka" "Připojení USB" + + + + + + + + + + "Nouzový režim" "Systém Android" "Přepnout na osobní profil" diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml index d5b40fbeb938..a258f082fdfa 100644 --- a/core/res/res/values-da/strings.xml +++ b/core/res/res/values-da/strings.xml @@ -265,6 +265,16 @@ "Underretninger" "Demo til udstilling i butik" "USB-forbindelse" + + + + + + + + + + "Sikker tilstand" "Android-system" "Skift til Tilpasset" @@ -317,8 +327,8 @@ "Tillader, at appen kan modtage og behandle sms-beskeder. Det betyder, at appen kan overvåge eller slette de beskeder, der sendes til din enhed, uden at vise dem til dig." "modtage tekstbeskeder (mms)" "Tillader, at appen kan modtage og behandle mms-beskeder. Det betyder, at appen kan overvåge eller slette de beskeder, der sendes til din enhed, uden at vise dem til dig." - "læse Cell Broadcast-beskeder" - "Tillader, at appen læser Cell Broadcast-beskeder, der modtages af din enhed. I nogle områder sendes der Cell Broadcast-beskeder for at advare om nødsituationer. Ondsindede apps kan forstyrre ydelsen eller driften af ​din ​enhed, når der modtages en Cell Broadcast-besked om en nødsituation." + "læse Cell Broadcast-meddelelser" + "Tillader, at appen læser Cell Broadcast-meddelelser, der modtages af din enhed. I nogle områder sendes der Cell Broadcast-meddelelser for at advare om nødsituationer. Ondsindede apps kan forstyrre ydelsen eller driften af ​din ​enhed, når der modtages en Cell Broadcast-meddelelse om en nødsituation." "læse feeds, jeg abonnerer på" "Tillader, at appen kan hente oplysninger om de feeds, der synkroniseres." "Send og se sms-beskeder" @@ -1074,19 +1084,19 @@ "Processen %1$s har overskredet sin proceshukommelsesgrænse på %2$s. En heap dump er tilgængelig og kan deles med udvikleren. Vær forsigtig: Denne heap dump kan indeholde dine personlige oplysninger, som appen har adgang til." "Vælg en handling for teksten" "Lydstyrke for opkald" - "Medielydstyrke" + "Lydstyrke for medier" "Afspilning via Bluetooth" "Lydløs ringetone er angivet" "Lydstyrke for opkald" "Lydstyrke for Bluetooth under opkald" "Lydstyrke for alarm" - "Lydstyrke for meddelelser" + "Lydstyrke for underretninger" "Lydstyrke" "Lydstyrke for bluetooth" "Lydstyrke for ringetone" "Lydstyrke for opkald" - "Medielydstyrke" - "Lydstyrke for meddelelser" + "Lydstyrke for medier" + "Lydstyrke for underretninger" "Standardringetone" "Standard (%1$s)" "Ingen" @@ -1609,7 +1619,7 @@ "Opdateret af din administrator" "Slettet af din administrator" "Batterisparefunktionen hjælper med at forlænge batteriets levetid ved at reducere enhedens ydeevne og begrænse vibration, placeringstjenester og det meste baggrundsdata. E-mail, beskedfunktioner og andre apps, der benytter synkronisering, opdateres muligvis ikke, medmindre du åbner dem.\n\nBatterisparefunktionen slukker automatisk, når enheden oplader." - "Datasparefunktion forhindrer nogle apps i at sende eller modtage data i baggrunden for at reducere dataforbruget. En app, der er i brug, kan få adgang til data, men gør det måske ikke så ofte. Dette kan f.eks. betyde, at billeder ikke vises, før du trykker på dem." + "Datasparefunktionen forhindrer nogle apps i at sende eller modtage data i baggrunden for at reducere dataforbruget. En app, der er i brug, kan få adgang til data, men gør det måske ikke så ofte. Dette kan f.eks. betyde, at billeder ikke vises, før du trykker på dem." "Vil du slå Datasparefunktion til?" "Slå til" @@ -1731,13 +1741,13 @@ "USB-fejlretning" "time" "minut" - "Indstil klokkeslæt" + "Angiv klokkeslæt" "Angiv et gyldigt klokkeslæt" "Angiv klokkeslæt" "Skift til teksttilstand for at angive klokkeslæt." "Skift til urtilstand for at angive klokkeslæt." "Valgmuligheder for AutoFyld" - "Gem til AutoFyld" + "Gem i AutoFyld" "Indhold kan ikke udfyldes automatisk" "Vil du gemme i <b>%1$s</b>?" "Vil du gemme %1$s i <b>%2$s</b>?" diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml index 347ebca534ab..5a70d9b1ab2a 100644 --- a/core/res/res/values-de/strings.xml +++ b/core/res/res/values-de/strings.xml @@ -265,6 +265,16 @@ "Warnmeldungen" "Demo für Einzelhandel" "USB-Verbindung" + + + + + + + + + + "Abgesicherter Modus" "Android-System" "Zu \"Privat\" wechseln" diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml index 4d93e5fc9e52..0cc6dc602546 100644 --- a/core/res/res/values-el/strings.xml +++ b/core/res/res/values-el/strings.xml @@ -265,6 +265,16 @@ "Ειδοποιήσεις" "Επίδειξη λιανικής" "Σύνδεση USB" + + + + + + + + + + "Ασφαλής λειτουργία" "Σύστημα Android" "Μετάβαση σε προσωπικό προφίλ" diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml index aa08377297bd..4976b037e7cd 100644 --- a/core/res/res/values-en-rAU/strings.xml +++ b/core/res/res/values-en-rAU/strings.xml @@ -265,6 +265,16 @@ "Alerts" "Retail demo" "USB connection" + + + + + + + + + + "Safe mode" "Android system" "Switch to Personal" diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml index aa08377297bd..4976b037e7cd 100644 --- a/core/res/res/values-en-rGB/strings.xml +++ b/core/res/res/values-en-rGB/strings.xml @@ -265,6 +265,16 @@ "Alerts" "Retail demo" "USB connection" + + + + + + + + + + "Safe mode" "Android system" "Switch to Personal" diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml index aa08377297bd..4976b037e7cd 100644 --- a/core/res/res/values-en-rIN/strings.xml +++ b/core/res/res/values-en-rIN/strings.xml @@ -265,6 +265,16 @@ "Alerts" "Retail demo" "USB connection" + + + + + + + + + + "Safe mode" "Android system" "Switch to Personal" diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml index 29a0adc4d825..5515ae19a996 100644 --- a/core/res/res/values-es-rUS/strings.xml +++ b/core/res/res/values-es-rUS/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demo para punto de venta" "Conexión USB" + + + + + + + + + + "Modo seguro" "Sistema Android" "Cambiar al perfil personal" diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml index 02c91dbcb0b9..33c0e5ca2aee 100644 --- a/core/res/res/values-es/strings.xml +++ b/core/res/res/values-es/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demo para tiendas" "Conexión USB" + + + + + + + + + + "Modo seguro" "Sistema Android" "Cambiar a perfil personal" diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml index cb6365935855..1c76b3f748d6 100644 --- a/core/res/res/values-et/strings.xml +++ b/core/res/res/values-et/strings.xml @@ -265,6 +265,16 @@ "Teatised" "Poedemo" "USB-ühendus" + + + + + + + + + + "Turvarežiim" "Android-süsteem" "Lülita isiklikule profiilile" diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml index 3c79b784010a..78aed2310781 100644 --- a/core/res/res/values-eu/strings.xml +++ b/core/res/res/values-eu/strings.xml @@ -265,6 +265,16 @@ "Abisuak" "Saltzaileentzako demoa" "USB konexioa" + + + + + + + + + + "Modu segurua" "Android sistema" "Aldatu profil pertsonalera" @@ -289,7 +299,7 @@ "atzitu bizi-konstanteei buruzko sentsore-datuak" "Eskuratu leihoko edukia" "Arakatu irekita daukazun leihoko edukia." - "Aktibatu ukipen bidez arakatzeko eginbidea" + "Aktibatu \"Arakatu ukituta\"" "Sakatutako elementuak ozen esango dira eta pantaila keinu bidez arakatu ahal izango da." "Behatu idazten duzun testua" "Ez da salbuespenik egiten datu pertsonalekin, hala nola, kreditu-txartelen zenbakiekin eta pasahitzekin." @@ -1477,7 +1487,7 @@ "Uneko erabiltzailea: %1$s." "%1$s erabiltzailera aldatzen…" "%1$s erabiltzailearen saioa amaitzen…" - "jabea" + "Jabea" "Errorea" "Administratzaileak ez du eman aldaketa egiteko baimena" "Ez da ekintza gauza dezakeen aplikaziorik aurkitu" diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml index beef14c59527..cd8e7502d7e8 100644 --- a/core/res/res/values-fa/strings.xml +++ b/core/res/res/values-fa/strings.xml @@ -265,6 +265,16 @@ "هشدارها" "نمونه برای خرده‌فروشان" "‏اتصال USB" + + + + + + + + + + "حالت ایمن" "‏سیستم Android" "رفتن به نمایه شخصی" diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml index 44614d761f09..56906696654b 100644 --- a/core/res/res/values-fi/strings.xml +++ b/core/res/res/values-fi/strings.xml @@ -265,6 +265,16 @@ "Ilmoitukset" "Esittelytila" "USB-yhteys" + + + + + + + + + + "Suojattu tila" "Android-järjestelmä" "Siirry henkilökohtaiseen profiiliin" diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml index 20780fd2b80a..77972741e960 100644 --- a/core/res/res/values-fr-rCA/strings.xml +++ b/core/res/res/values-fr-rCA/strings.xml @@ -265,6 +265,16 @@ "Alertes" "Démo en magasin" "Connexion USB" + + + + + + + + + + "Mode sécurisé" "Système Android" "Passer au profil personnel" diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml index 65f8d78e76f7..761947e3e0c7 100644 --- a/core/res/res/values-fr/strings.xml +++ b/core/res/res/values-fr/strings.xml @@ -265,6 +265,16 @@ "Alertes" "Démonstration en magasin" "Connexion USB" + + + + + + + + + + "Mode sécurisé" "Système Android" "Passer au profil personnel" diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml index cb2ad8f4c417..2c58acbad584 100644 --- a/core/res/res/values-gl/strings.xml +++ b/core/res/res/values-gl/strings.xml @@ -29,10 +29,10 @@ "%1$s %2$s" "%1$d días" "%1$d día %2$d hrs" - "%1$d día %2$d hr" + "%1$d día %2$d h" "%1$d hrs" - "%1$d hr %2$d min" - "%1$d hr %2$d min" + "%1$d h %2$d min" + "%1$d h %2$d min" "%1$d min" "%1$d minuto" "%1$d min %2$d seg" @@ -265,6 +265,16 @@ "Alertas" "Demostración comercial" "conexión USB" + + + + + + + + + + "Modo seguro" "Sistema Android" "Cambiar ao perfil persoal" @@ -293,8 +303,8 @@ "Os elementos que toques pronunciaranse en voz alta e a pantalla poderá explorarse mediante xestos." "Observar o texto que escribes" "Inclúe datos persoais como números e contrasinais de tarxetas de crédito." - "Controlar ampliación da pantalla" - "Controla o nivel do zoom e o posicionamento da pantalla" + "Controlar a ampliación da pantalla" + "Controla o nivel do zoom e o posicionamento da pantalla." "Realizar xestos" "Podes tocar, pasar o dedo, beliscar e realizar outros xestos." "Xestos de impresión dixital" @@ -1609,7 +1619,7 @@ "Instalado polo teu administrador" "Actualizado polo teu administrador" "Eliminado polo teu administrador" - "Para axudar a mellorar a duración da batería, a función aforro de batería reduce o rendemento do teu dispositivo e limita a vibración, os servizos de localización e a maioría dos datos en segundo plano. É posible que o correo electrónico, as mensaxes e outras aplicacións que dependen da sincronización non se actualicen a menos que os abras. \n\nA función aforro de batería desactívase automaticamente cando pos a cargar o teu dispositivo." + "Para axudar a mellorar a duración da batería, a función de aforro da batería reduce o rendemento do teu dispositivo e limita a vibración, os servizos de localización e a maioría dos datos en segundo plano. É posible que o correo electrónico, as mensaxes e outras aplicacións que dependen da sincronización non se actualicen a menos que os abras. \n\nA función de aforro da batería desactívase automaticamente cando pos a cargar o teu dispositivo." "Para contribuír a reducir o uso de datos, o Economizador de datos impide que algunhas aplicacións envíen ou reciban datos en segundo plano. Cando esteas utilizando unha aplicación, esta poderá acceder aos datos, pero é posible que o faga con menos frecuencia. Por exemplo, é posible que as imaxes non se mostren ata que as toques." "Queres activar o economizador de datos?" "Activar" diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml index f70639f22bd7..77f7212e15d1 100644 --- a/core/res/res/values-gu/strings.xml +++ b/core/res/res/values-gu/strings.xml @@ -265,6 +265,16 @@ "ચેતવણીઓ" "રિટેલ ડેમો" "USB કનેક્શન" + + + + + + + + + + "સુરક્ષિત મોડ" "Android સિસ્ટમ" "વ્યક્તિગત પર સ્વિચ કરો" diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml index 556ba9e62ccc..0a672ca7bd9f 100644 --- a/core/res/res/values-hi/strings.xml +++ b/core/res/res/values-hi/strings.xml @@ -265,6 +265,16 @@ "सूचनाएं" "खुदरा डेमो" "USB कनेक्शन" + + + + + + + + + + "सुरक्षित मोड" "Android सिस्‍टम" "व्यक्तिगत प्रोफ़ाइल में स्विच करें" diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml index c8083e76c3d7..48f4cf7b221d 100644 --- a/core/res/res/values-hr/strings.xml +++ b/core/res/res/values-hr/strings.xml @@ -268,6 +268,16 @@ "Upozorenja" "Prodajni demo-način" "USB veza" + + + + + + + + + + "Siguran način rada" "Sustav Android" "Prijeđite na osobni" diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml index d528e9437158..8af3ff5575f2 100644 --- a/core/res/res/values-hu/strings.xml +++ b/core/res/res/values-hu/strings.xml @@ -265,6 +265,16 @@ "Értesítések" "Kiskereskedelmi bemutató" "USB-kapcsolat" + + + + + + + + + + "Biztonsági üzemmód" "Android rendszer" "Átváltás személyes profilra" diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml index f33e7778a068..2ca708d6653c 100644 --- a/core/res/res/values-hy/strings.xml +++ b/core/res/res/values-hy/strings.xml @@ -265,6 +265,16 @@ "Ծանուցումներ" "Խանութի ցուցադրական ռեժիմ" "USB կապակցում" + + + + + + + + + + "Անվտանգ ռեժիմ" "Android համակարգ" "Անցնել անհատական պրոֆիլին" diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml index 9ba2120be671..aa325acce3ba 100644 --- a/core/res/res/values-in/strings.xml +++ b/core/res/res/values-in/strings.xml @@ -265,6 +265,16 @@ "Notifikasi" "Demo promo" "Sambungan USB" + + + + + + + + + + "Mode aman" "Sistem Android" "Beralih ke Pribadi" diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml index 30d83e1481ef..e37862bd2679 100644 --- a/core/res/res/values-is/strings.xml +++ b/core/res/res/values-is/strings.xml @@ -265,6 +265,16 @@ "Tilkynningar" "Kynningarútgáfa fyrir verslanir" "USB-tenging" + + + + + + + + + + "Örugg stilling" "Android kerfið" "Skipta yfir í persónulegt snið" diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml index 61be91cf63c4..8057a06445ab 100644 --- a/core/res/res/values-it/strings.xml +++ b/core/res/res/values-it/strings.xml @@ -265,6 +265,16 @@ "Avvisi" "Demo retail" "Connessione USB" + + + + + + + + + + "Modalità provvisoria" "Sistema Android" "Passa al profilo personale" diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml index 18518f8eaafd..504d3ad8d05c 100644 --- a/core/res/res/values-iw/strings.xml +++ b/core/res/res/values-iw/strings.xml @@ -271,6 +271,16 @@ "התראות" "הדגמה לקמעונאים" "‏חיבור USB" + + + + + + + + + + "מצב בטוח" "‏מערכת Android" "עבור ל\'אישי\'" @@ -1009,7 +1019,7 @@ "מחק" "העתק כתובת אתר" "בחר טקסט" - "בטל" + "ביטול" "בצע מחדש" "מילוי אוטומטי" "בחירת טקסט" @@ -1066,7 +1076,7 @@ "האפליקציה %1$s נעצרת שוב ושוב" "האפליקציה %1$s נעצרת שוב ושוב" "פתח שוב את האפליקציה" - "שלח משוב" + "משוב" "סגור" "השתק עד הפעלה מחדש של המכשיר" "המתן" @@ -1181,7 +1191,7 @@ "הדבר ""עלול לגרום לחיובים"" בחשבון המכשיר הנייד שלך." "הדבר יגרום לחיובים בחשבון המכשיר הנייד שלך." "שלח" - "בטל" + "ביטול" "זכור את הבחירה שלי" "‏ניתן לשנות זאת מאוחר יותר ב\'הגדרות\' > \'אפליקציות\'" "אפשר תמיד" @@ -1198,7 +1208,7 @@ "‏ה-SIM החדש הוכנס" "הקש כדי להגדיר" "הגדרת שעה" - "הגדר תאריך" + "הגדרת תאריך" "הגדר" "בוצע" "חדש: " @@ -1223,7 +1233,7 @@ "שתף" "לא, אין מצב" "שינוי מקלדת" - "השאר אותו במסך בזמן שהמקלדת הפיזית פעילה" + "תישאר במסך בזמן שהמקלדת הפיזית פעילה" "הצג מקלדת וירטואלית" "הגדרת מקלדת פיזית" "הקש כדי לבחור שפה ופריסה" @@ -1358,13 +1368,13 @@ "בטל את פעולות המחיקה" "אל תעשה דבר כרגע" "בחר חשבון" - "הוסף חשבון" - "הוסף חשבון" + "הוספת חשבון" + "הוספת חשבון" "הוסף" "הפחת" "%s גע והחזק." "הסט למעלה כדי להוסיף ולמטה כדי להפחית." - "הוסף דקה" + "הוספת דקה" "הפחת דקה" "הוסף שעה" "הפחת שעה" @@ -1403,7 +1413,7 @@ "‏כונן USB של %s" "‏אחסון USB" "ערוך" - "התראה לשימוש בנתונים" + "התראה על שימוש בנתונים" "הקש כדי להציג נתוני שימוש והגדרות." "‏הגעת למגבלת הנתונים של 2G-3G" "‏הגעת למגבלת הנתונים של 4G" @@ -1487,7 +1497,7 @@ "‏כדי לבטל את הנעילה, היכנס באמצעות חשבון Google שלך." "שם משתמש (אימייל)" "סיסמה" - "היכנס" + "כניסה" "שם משתמש או סיסמה לא חוקיים." "‏שכחת את שם המשתמש או הסיסמה?\nהיכנס לכתובת ""google.com/accounts/recovery" "בודק חשבון…" @@ -1776,7 +1786,7 @@ "מאפס את המכשיר…" "האם לאפס את המכשיר?" "תאבד את כל השינויים וההדגמה תתחיל שוב בעוד %1$s שניות…" - "בטל" + "ביטול" "אפס עכשיו" "%1$s הושבת" "שיחת ועידה" @@ -1793,9 +1803,9 @@ "‏ניקוי באגים ב-USB" "שעה" "דקה" - "הגדר שעה" + "הגדרת שעה" "הזן שעה חוקית" - "הקלד את השעה" + "מהי השעה הנכונה" "העבר למצב קלט טקסט לצורך הזנת השעה" "העבר למצב שעון לצורך הזנת השעה" "אפשרויות מילוי אוטומטי" diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml index f5da17ecc995..4f18bcb7b08d 100644 --- a/core/res/res/values-ja/strings.xml +++ b/core/res/res/values-ja/strings.xml @@ -265,6 +265,16 @@ "通知" "販売店デモ" "USB 接続" + + + + + + + + + + "セーフモード" "Androidシステム" "個人用に切り替える" diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml index bf0f5da4528d..31cd59b2130b 100644 --- a/core/res/res/values-ka/strings.xml +++ b/core/res/res/values-ka/strings.xml @@ -265,6 +265,16 @@ "გაფრთხილებები" "დემო-რეჟიმი საცალო მოვაჭრეებისთვის" "USB კავშირი" + + + + + + + + + + "უსაფრთხო რეჟიმი" "Android-ის სისტემა" "პირად პროფილზე გადართვა" diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml index 7b30f282863f..c512e4311485 100644 --- a/core/res/res/values-kk/strings.xml +++ b/core/res/res/values-kk/strings.xml @@ -265,6 +265,16 @@ "Дабылдар" "Бөлшек саудаға арналған демо нұсқасы" "USB байланысы" + + + + + + + + + + "Қауіпсіз режим" "Android жүйесі" "Жекеге ауысу" diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml index 59c8c2066463..64306fd3e809 100644 --- a/core/res/res/values-km/strings.xml +++ b/core/res/res/values-km/strings.xml @@ -265,6 +265,16 @@ "ការ​ជូនដំណឹង" "របៀបដាក់បង្ហាញក្នុងហាង" "ការ​តភ្ជាប់ USB" + + + + + + + + + + "របៀប​​​សុវត្ថិភាព" "ប្រព័ន្ធ​​ Android" "ប្តូរទៅផ្ទាល់ខ្លួន" diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml index 906c88cd4437..aaabd919e6ea 100644 --- a/core/res/res/values-kn/strings.xml +++ b/core/res/res/values-kn/strings.xml @@ -265,6 +265,16 @@ "ಎಚ್ಚರಿಕೆಗಳು" "ರಿಟೇಲ್ ಡೆಮೋ" "USB ಸಂಪರ್ಕ" + + + + + + + + + + "ಸುರಕ್ಷಿತ ಮೋಡ್" "Android ಸಿಸ್ಟಂ" "ವೈಯಕ್ತಿಕಗೆ ಬದಲಿಸಿ" diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml index db2e038418b3..ab61857150d8 100644 --- a/core/res/res/values-ko/strings.xml +++ b/core/res/res/values-ko/strings.xml @@ -265,6 +265,16 @@ "알림" "소매 데모" "USB 연결" + + + + + + + + + + "안전 모드" "Android 시스템" "개인으로 전환" diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml index 05ca65ee9f5d..a24bd7fb21ad 100644 --- a/core/res/res/values-ky/strings.xml +++ b/core/res/res/values-ky/strings.xml @@ -265,6 +265,16 @@ "Эскертүүлөр" "Чекене соода дүкөнү үчүн демо режим" "USB аркылуу туташуу" + + + + + + + + + + "Коопсуз режим" "Android тутуму" "Жеке профилге которулуу" @@ -1412,7 +1422,7 @@ "Түзмөккө туташуу" "Сырткы экранга чыгаруу" "Түзмөктөр изделүүдө..." - "Тууралоолор" + "Жөндөөлөр" "Ажыратуу" "Скандоодо..." "Туташууда..." @@ -1466,7 +1476,7 @@ "Алып салуу" "Сунушталган деңгээлден да катуулатып уккуңуз келеби?\n\nМузыканы узакка чейин катуу уксаңыз, угууңуз начарлап кетиши мүмкүн." "Атайын мүмкүнчүлүктөр функциясынын кыска жолу колдонулсунбу?" - "Кыска жол функциясы күйгүзүлгөн учурда үн көзөмөлдөөчү баскычтарды басып, 3 секунд кармап турсаңыз, атайын мүмкүнчүлүктөр функциясы иштетилет.\n\n Учурдагы атайын мүмкүнчүлүктөр функциясы:\n %1$s\n\n Функцияны Жөндөөлөр > атайын мүмкүнчүлүктөр бөлүмүнөн өзгөртө аласыз." + "Атайын мүмкүнчүлүктөр функциясын пайдалануу үчүн, анын кыска жолу күйгүзүлгөндө, үндү катуулатуу/акырындатуу баскычын үч секунддай кое бербей басып туруңуз.\n\n Учурдагы атайын мүмкүнчүлүктөрдүн жөндөөлөрү:\n %1$s\n\nЖөндөөлөр > Атайын мүмкүнчүлүктөр бөлүмүнөн өзгөртө аласыз." "Кыска жолду өчүрүү" "Кыска жолду колдонуу" "Атайын мүмкүнчүлүктөр кыска жолу %1$s кызматын күйгүздү" diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml index 4f2eb19d3a11..d162fe027238 100644 --- a/core/res/res/values-lo/strings.xml +++ b/core/res/res/values-lo/strings.xml @@ -265,6 +265,16 @@ "ການເຕືອນ" "ເດໂມສຳລັບຮ້ານຂາຍ" "ການເຊື່ອມຕໍ່ USB" + + + + + + + + + + "Safe mode" "ລະບົບ Android" "ສະລັບໄປໂປຣໄຟລ໌ສ່ວນຕົວ" @@ -1608,7 +1618,7 @@ "ຖືກຕິດຕັ້ງໂດຍຜູ້ເບິ່ງແຍງລະບົບຂອງທ່ານ" "ຖືກອັບໂຫລດໂດຍຜູ້ເບິ່ງແຍງລະບົບຂອງທ່ານ" "ຖືກລຶບອອກໂດຍຜູ້ເບິ່ງແຍງລະບົບຂອງທ່ານ" - "ເພື່ອ​ຊ່ວຍ​ເພີ່ມ​ອາ​ຍຸ​ແບັດ​ເຕີ​ຣີ, ຕົວ​ປະ​ຢັດ​ໄຟ​ແບັດ​ເຕີ​ຣີ​ຫຼຸດ​ປະ​ສິດ​ທິ​ພາບ​ການ​ເຮັດ​ວຽກ​ຂອງ​ອຸ​ປະ​ກອນ​ຂອງ​ທ່ານ​ລົງ ແລະ​ຈຳ​ກັດ​ການ​ສັ່ນ, ການ​ບໍ​ລິ​ການ​ຫາທີ່ຕັ້ງ, ແລະ​ຂໍ້​ມູນ​ພື້ນ​ຫຼັງ​ເກືອບ​ທັງ​ໝົດ. ອີ​ເມວ, ການ​ສົ່ງ​ຂໍ້​ຄວາມ, ແລະ​ແອັບອື່ນໆ​ທີ່ອາ​ໄສການ​ຊິງ​ຄ໌​ອາດ​ຈະ​ບໍ່​ອັບ​ເດດ ນອກ​ຈາກວ່າ​ທ່ານ​ເປີດ​ມັນ.\n\nຕົວ​ປະ​ຢັດ​ໄຟ​ແບັດ​ເຕີ​ຣີຈະ​ປິດ​ອັດ​ຕະ​ໂນ​ມັດ ເມື່ອ​ອຸ​ປະ​ກອນ​ຂອງ​ທ່ານ​ກຳ​ລັງ​ສາກຢູ່." + "ເພື່ອ​ຊ່ວຍ​ເພີ່ມ​ອາ​ຍຸ​ແບັດ​ເຕີ​ຣີ, ຕົວ​ປະ​ຢັດ​ໄຟ​ແບັດ​ເຕີ​ຣີ​ຫຼຸດ​ປະ​ສິດ​ທິ​ພາບ​ການ​ເຮັດ​ວຽກ​ຂອງ​ອຸ​ປະ​ກອນ​ຂອງ​ທ່ານ​ລົງ ແລະ​ຈຳ​ກັດ​ການ​ສັ່ນ, ການ​ບໍ​ລິ​ການ​ຫາທີ່ຕັ້ງ ແລະ ຂໍ້​ມູນ​ພື້ນ​ຫຼັງ​ເກືອບ​ທັງ​ໝົດ. ອີ​ເມວ, ການ​ສົ່ງ​ຂໍ້​ຄວາມ, ແລະ ແອັບອື່ນໆ​ທີ່ອາ​ໄສການ​ຊິ້ງຂໍ້ມູນ​ອາດ​ຈະ​ບໍ່​ອັບ​ເດດ ນອກ​ຈາກວ່າ​ທ່ານ​ເປີດ​ມັນ.\n\nຕົວ​ປະ​ຢັດ​ໄຟ​ແບັດ​ເຕີ​ຣີຈະ​ປິດ​ອັດ​ຕະ​ໂນ​ມັດເມື່ອ​ທ່ານສາກໄຟອຸ​ປະ​ກອນ​." "ເພື່ອຊ່ວຍຫຼຸດຜ່ອນການນຳໃຊ້ຂໍ້ມູນ, ຕົວປະຢັດຂໍ້ມູນຈະປ້ອງກັນບໍ່ໃຫ້ບາງແອັບສົ່ງ ຫຼື ຮັບຂໍ້ມູນໃນພື້ນຫຼັງ. ແອັບໃດໜຶ່ງທີ່ທ່ານກຳລັງໃຊ້ຢູ່ຈະສາມາດເຂົ້າເຖິງຂໍ້ມູນໄດ້ ແຕ່ອາດເຂົ້າເຖິງໄດ້ຖີ່ໜ້ອຍລົງ. ນີ້ອາດໝາຍຄວາມວ່າ ຮູບພາບຕ່າງໆອາດບໍ່ສະແດງຈົນກວ່າທ່ານຈະແຕະໃສ່ກ່ອນ." "ເປີດໃຊ້ຕົວປະຢັດຂໍ້ມູນບໍ?" "ເປີດໃຊ້" diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml index 99ef41ca0b70..0a62d62f6d22 100644 --- a/core/res/res/values-lt/strings.xml +++ b/core/res/res/values-lt/strings.xml @@ -271,6 +271,16 @@ "Įspėjimai" "Demonstracinė versija mažmenininkams" "USB jungtis" + + + + + + + + + + "Saugos režimas" "„Android“ sistema" "Perjungti į asmeninį režimą" diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml index c01ab61be1e9..3bcce6f5319c 100644 --- a/core/res/res/values-lv/strings.xml +++ b/core/res/res/values-lv/strings.xml @@ -268,6 +268,16 @@ "Brīdinājumi" "Demonstrācijas versija veikaliem" "USB savienojums" + + + + + + + + + + "Drošais režīms" "Android sistēma" "Pārslēgt personīgo profilu" diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml index bb2527c0dc08..b5e8c90b3bd5 100644 --- a/core/res/res/values-mk/strings.xml +++ b/core/res/res/values-mk/strings.xml @@ -265,6 +265,16 @@ "Предупредувања" "Демонстрација за малопродажба" "USB-врска" + + + + + + + + + + "Безбеден режим" "Систем Android" "Префрлете на личен профил" diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml index 178bc3d1e685..5dbb33452635 100644 --- a/core/res/res/values-ml/strings.xml +++ b/core/res/res/values-ml/strings.xml @@ -265,6 +265,16 @@ "അലേർട്ടുകൾ" "റീട്ടെയിൽ ഡെമോ" "USB കണക്ഷൻ" + + + + + + + + + + "സുരക്ഷിത മോഡ്" "Android സിസ്റ്റം" "വ്യക്തിഗത പ്രൊഫൈലിലേക്ക് മാറുക" diff --git a/core/res/res/values-mn/strings.xml b/core/res/res/values-mn/strings.xml index 5cf213a80157..765aa5d286fd 100644 --- a/core/res/res/values-mn/strings.xml +++ b/core/res/res/values-mn/strings.xml @@ -265,6 +265,16 @@ "Сануулга" "Жижиглэнгийн жишээ" "USB холболт" + + + + + + + + + + "Аюулгүй горим" "Андройд систем" "\"Хувийн\" руу шилжих" diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml index 7f414492adf2..41918282c6f5 100644 --- a/core/res/res/values-mr/strings.xml +++ b/core/res/res/values-mr/strings.xml @@ -265,6 +265,16 @@ "सूचना" "किरकोळ डेमो" "USB कनेक्‍शन" + + + + + + + + + + "सुरक्षित मोड" "Android सिस्‍टम" "वैयक्तिकवर स्विच करा" diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml index 5d5c4f3a5942..d4cc2d339862 100644 --- a/core/res/res/values-ms/strings.xml +++ b/core/res/res/values-ms/strings.xml @@ -265,6 +265,16 @@ "Makluman" "Tunjuk cara runcit" "Sambungan USB" + + + + + + + + + + "Mod selamat" "Sistem Android" "Beralih kepada Peribadi" diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml index d88065843a68..1d89730ba0aa 100644 --- a/core/res/res/values-my/strings.xml +++ b/core/res/res/values-my/strings.xml @@ -265,6 +265,16 @@ "သတိပေးချက်များ" "လက်လီအရောင်းဆိုင် သရုပ်ပြမှု" "USB ချိတ်ဆက်မှု" + + + + + + + + + + "အန္တရာယ်ကင်းမှု စနစ်(Safe mode)" "Android စနစ်" "ကိုယ်ပိုင်သီးသန့်အဖြစ် ပြောင်းပါ" diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml index c6594354372f..ab32ff8f8ea2 100644 --- a/core/res/res/values-nb/strings.xml +++ b/core/res/res/values-nb/strings.xml @@ -265,6 +265,16 @@ "Varsler" "Butikkdemo" "USB-tilkobling" + + + + + + + + + + "Sikkermodus" "Android-system" "Bytt til den personlige profilen" diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml index 19e425aa2874..33466bcaa2f2 100644 --- a/core/res/res/values-ne/strings.xml +++ b/core/res/res/values-ne/strings.xml @@ -265,6 +265,16 @@ "अलर्टहरू" "खुद्रा बिक्री सम्बन्धी डेमो" "USB जडान" + + + + + + + + + + "सुरक्षित मोड" "एन्ड्रोइड प्रणाली" "व्यक्तिगत प्रोफाइलमा स्विच गर्नुहोस्" @@ -1288,7 +1298,7 @@ "सेट अप गर्न ट्याप गर्नुहोस्" "फाइल छान्नुहोस्" "कुनै फाइल छानिएको छैन" - "पुनःसेट गर्नु" + "रिसेट गर्नुहोस्" "पेस गर्नुहोस्" "कार मोड सक्षम पारियो।" "कार मोडबाट बाहिर निस्कन ट्याप गर्नुहोस्।" diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml index 4875b9feea33..c82219c01cee 100644 --- a/core/res/res/values-nl/strings.xml +++ b/core/res/res/values-nl/strings.xml @@ -265,6 +265,16 @@ "Meldingen" "Demo voor de detailhandel" "USB-verbinding" + + + + + + + + + + "Veilige modus" "Android-systeem" "Overschakelen naar persoonlijk profiel" diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml index 78a5517ac30a..5c606ae2b961 100644 --- a/core/res/res/values-pa/strings.xml +++ b/core/res/res/values-pa/strings.xml @@ -265,6 +265,16 @@ "ਸੁਚੇਤਨਾਵਾਂ" "ਪ੍ਰਚੂਨ ਸਟੋਰਾਂ ਲਈ ਡੈਮੋ" "USB ਕਨੈਕਸ਼ਨ" + + + + + + + + + + "ਸੁਰੱਖਿਅਤ ਮੋਡ" "Android System" "ਨਿੱਜੀ \'ਤੇ ਸਵਿੱਚ ਕਰੋ" diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml index 5f01dd46c4e3..7386f2d62cf0 100644 --- a/core/res/res/values-pl/strings.xml +++ b/core/res/res/values-pl/strings.xml @@ -271,6 +271,16 @@ "Alerty" "Tryb demo dla sklepów" "Połączenie USB" + + + + + + + + + + "Tryb awaryjny" "System Android" "Włącz profil osobisty" diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml index 05ac675b2c02..d5dc39502b48 100644 --- a/core/res/res/values-pt-rBR/strings.xml +++ b/core/res/res/values-pt-rBR/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demonstração na loja" "Conexão USB" + + + + + + + + + + "Modo de segurança" "Sistema Android" "Alternar para \"Pessoal\"" diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml index e78386e08a1e..1f297c2f01fe 100644 --- a/core/res/res/values-pt-rPT/strings.xml +++ b/core/res/res/values-pt-rPT/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demonstração para retalho" "Ligação USB" + + + + + + + + + + "Modo seguro" "Sistema Android" "Mudar para pessoal" diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml index 05ac675b2c02..d5dc39502b48 100644 --- a/core/res/res/values-pt/strings.xml +++ b/core/res/res/values-pt/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demonstração na loja" "Conexão USB" + + + + + + + + + + "Modo de segurança" "Sistema Android" "Alternar para \"Pessoal\"" diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml index 7785e72ba21d..3a2c38d2905e 100644 --- a/core/res/res/values-ro/strings.xml +++ b/core/res/res/values-ro/strings.xml @@ -268,6 +268,16 @@ "Alerte" "Demonstrație comercială" "Conexiune USB" + + + + + + + + + + "Mod sigur" "Sistemul Android" "Comutați la Personal" diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml index b84b808bd6b6..0bc71eb4c700 100644 --- a/core/res/res/values-ru/strings.xml +++ b/core/res/res/values-ru/strings.xml @@ -271,6 +271,16 @@ "Уведомления" "Деморежим для магазина" "USB-подключение" + + + + + + + + + + "Безопасный режим" "Система Android" "Перейти в личный профиль" diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml index 7b0478b33642..b7e695a863e2 100644 --- a/core/res/res/values-si/strings.xml +++ b/core/res/res/values-si/strings.xml @@ -265,6 +265,16 @@ "ඇඟවීම්" "සිල්ලර ආදර්ශනය" "USB සම්බන්ධතාවය" + + + + + + + + + + "ආරක්‍ෂිත ආකාරය" "Android පද්ධතිය" "පුද්ගලික වෙත මාරු වන්න" @@ -1610,7 +1620,7 @@ "ඔබගේ පරිපාලක මඟින් ස්ථාපනය කර ඇත" "ඔබගේ පරිපාලක මඟින් යාවත්කාලීන කර ඇත" "ඔබගේ පරිපාලක මඟින් මකා දමා ඇත" - "බැටරි ආයු කාලය වැඩිදියුණු කිරීමට උදවු කිරීමට, බැටරි සුරැකුම ඔබේ උපාංගයේ ක්‍රියාකාරීත්වය අඩුකරන අතර කම්පනය, පිහිටීම් සේවා, සහ බොහෝමයක් පසුබිම් දත්ත සීමා කරයි. ඔබ ඒවා විවෘත නොකරන්නේ නම් මිස ඊමේල්, පණිවිඩකරණය, සහ සමමුහුර්ත කිරීම මත රඳා පවතින වෙනත් යෙදුම් යාවත්කාලීන නොවිය හැකිය.\n\nඔබේ උපාංගය ආරෝපණය වන විට බැටරි සුරැකුම ස්වයංක්‍රියව අක්‍රිය වේ." + "බැටරි ආයු කාලය වැඩිදියුණු කිරීමට උදවු කිරීමට, බැටරි සුරැකුම ඔබේ උපාංගයේ ක්‍රියාකාරීත්වය අඩුකරන අතර කම්පනය, පිහිටීම් සේවා, සහ බොහෝමයක් පසුබිම් දත්ත සීමා කරයි. ඔබ ඒවා විවෘත නොකරන්නේ නම් මිස ඊ-තැපැල්, පණිවිඩකරණය, සහ සමමුහුර්ත කිරීම මත රඳා පවතින වෙනත් යෙදුම් යාවත්කාලීන නොවිය හැකිය.\n\nඔබේ උපාංගය ආරෝපණය වන විට බැටරි සුරැකුම ස්වයංක්‍රියව ක්‍රියාත්මක වේ." "දත්ත භාවිතය අඩු කිරීමට උදවු වීමට, දත්ත සුරැකුම සමහර යෙදුම් පසුබිමින් දත්ත යැවීම සහ ලබා ගැනීම වළක්වයි. ඔබ දැනට භාවිත කරන යෙදුමකට දත්ත වෙත පිවිසීමට හැකිය, නමුත් එසේ කරන්නේ කලාතුරකින් විය හැකිය. මෙයින් අදහස් වන්නේ, උදාහරණයක් ලෙස, එම රූප ඔබ ඒවාට තට්ටු කරන තෙක් සංදර්ශනය නොවන බවය." "දත්ත සුරැකුම ක්‍රියාත්මක කරන්නද?" "ක්‍රියාත්මක කරන්න" diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml index 8782dc9dcab4..018ea4e6eafe 100644 --- a/core/res/res/values-sk/strings.xml +++ b/core/res/res/values-sk/strings.xml @@ -271,6 +271,16 @@ "Upozornenia" "Predajná ukážka" "Pripojenie USB" + + + + + + + + + + "Núdzový režim" "Systém Android" "Prepnúť na osobný" diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml index d6643d740bb4..729612fb1571 100644 --- a/core/res/res/values-sl/strings.xml +++ b/core/res/res/values-sl/strings.xml @@ -271,6 +271,16 @@ "Opozorila" "Predstavitev za maloprodajo" "Povezava USB" + + + + + + + + + + "Varni način" "Sistem Android" "Preklop na osebni profil" diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml index 1bd2b7420cd6..563f4bd0d415 100644 --- a/core/res/res/values-sq/strings.xml +++ b/core/res/res/values-sq/strings.xml @@ -265,6 +265,16 @@ "Sinjalizimet" "Demonstrimi i shitjes me pakicë" "Lidhja USB" + + + + + + + + + + "Modaliteti i sigurisë" "Sistemi \"android\"" "Ndryshoje te \"Personale\"" diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml index 44abfb96329e..2d2cc708be23 100644 --- a/core/res/res/values-sr/strings.xml +++ b/core/res/res/values-sr/strings.xml @@ -268,6 +268,16 @@ "Обавештења" "Режим демонстрације за малопродајне објекте" "USB веза" + + + + + + + + + + "Безбедни режим" "Android систем" "Пређи на Лични профил" @@ -1630,7 +1640,7 @@ "Инсталирао је администратор" "Ажурирао је администратор" "Избрисао је администратор" - "Да би продужила време трајања батерије, уштеда батерије смањује перформансе уређаја и ограничава вибрацију, услуге локације и већину позадинских података. Имејл, размена порука и друге апликације које се ослањају на синхронизацију можда неће да се ажурирају ако их не отворите.\n\nУштеда батерије се аутоматски искључује када се уређај пуни." + "Да би продужила време трајања батерије, уштеда батерије смањује перформансе уређаја и ограничава вибрацију, услуге локације и већину позадинских података. Имејл, размена порука и друге апликације које се ослањају на синхронизацију неће се ажурирати док их не отворите.\n\nУштеда батерије се аутоматски искључује када се уређај пуни." "Да би се смањила потрошња података, Уштеда података спречава неке апликације да шаљу или примају податке у позадини. Апликација коју тренутно користите може да приступа подацима, али ће то чинити ређе. На пример, слике се неће приказивати док их не додирнете." "Укључити Уштеду података?" "Укључи" diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml index 7f3d212b6a47..c480df43cc96 100644 --- a/core/res/res/values-sv/strings.xml +++ b/core/res/res/values-sv/strings.xml @@ -265,6 +265,16 @@ "Varningar" "Demo för återförsäljare" "USB-anslutning" + + + + + + + + + + "Säkert läge" "Android-system" "Byt till din personliga profil" diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml index 52fa3a2ff576..cec75bca468a 100644 --- a/core/res/res/values-sw/strings.xml +++ b/core/res/res/values-sw/strings.xml @@ -263,6 +263,16 @@ "Arifa" "Onyesho la duka la rejareja" "Muunganisho wa USB" + + + + + + + + + + "Mtindo salama" "Mfumo wa Android" "Badili uweke wasifu wa Binafsi" @@ -1735,7 +1745,7 @@ "Badilisha iwe katika hali ya maandishi wakati wa kuweka muda." "Badilisha umbo liwe la saa ya mishale wakati wa kuweka muda." "Chaguo za kujaza otomatiki" - "Hifadhi kwa ajili ya Kujaza kiotomatiki" + "Hifadhi kwa ajili ya Kujaza Kiotomatiki" "Maudhui hayawezi kujazwa kiotomatiki" "Ungependa kuhifadhi kwenye <b>%1$s</b>?" "Ungependa kuhifadhi %1$s kwenye <b>%2$s</b>?" diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml index 18b097e2de84..7062e9834f89 100644 --- a/core/res/res/values-ta/strings.xml +++ b/core/res/res/values-ta/strings.xml @@ -265,6 +265,16 @@ "விழிப்பூட்டல்கள்" "விற்பனையாளர் டெமோ" "USB இணைப்பு" + + + + + + + + + + "பாதுகாப்பு பயன்முறை" "Android அமைப்பு" "தனிப்பட்ட சுயவிவரத்திற்கு மாறு" diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml index d79e52f32ab5..31e272153377 100644 --- a/core/res/res/values-te/strings.xml +++ b/core/res/res/values-te/strings.xml @@ -265,6 +265,16 @@ "హెచ్చరికలు" "రిటైల్ డెమో" "USB కనెక్షన్" + + + + + + + + + + "సురక్షిత మోడ్" "Android సిస్టమ్" "వ్యక్తిగతానికి మార్చు" diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml index 2179f70e56e5..fd7158ffa554 100644 --- a/core/res/res/values-th/strings.xml +++ b/core/res/res/values-th/strings.xml @@ -265,6 +265,16 @@ "การแจ้งเตือน" "การสาธิตสำหรับผู้ค้าปลีก" "การเชื่อมต่อ USB" + + + + + + + + + + "โหมดปลอดภัย" "ระบบ Android" "เปลี่ยนไปใช้โปรไฟล์ส่วนตัว" diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml index 90e57c1e982c..e58f62ff0d10 100644 --- a/core/res/res/values-tl/strings.xml +++ b/core/res/res/values-tl/strings.xml @@ -265,6 +265,16 @@ "Mga Alerto" "Retail demo" "Koneksyon ng USB" + + + + + + + + + + "Safe mode" "Android System" "Lumipat sa Personal" @@ -277,7 +287,7 @@ "i-access ang iyong kalendaryo" "SMS" "magpadala at tumingin ng mga mensaheng SMS" - "Imbakan" + "Storage" "i-access ang mga larawan, media at file sa iyong device" "Mikropono" "mag-record ng audio" @@ -575,7 +585,7 @@ "Itakda ang pandaigdigang proxy ng device na gagamitin habang naka-enable ang patakaran. Ang may-ari ng device lang ang makakapagtakda sa pandaigdigang proxy." "Itakda screen lock password expiration" "Baguhin kung gaano kadalas dapat palitan ang password, PIN o pattern sa screen lock." - "Itakda pag-encrypt ng imbakan" + "Itakda pag-encrypt ng storage" "Hilinging naka-encrypt ang nakaimbak na data ng app." "Huwag paganahin mga camera" "Pigilan ang paggamit sa lahat ng camera ng device." diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml index 5cc96b6f386e..e39543596c96 100644 --- a/core/res/res/values-tr/strings.xml +++ b/core/res/res/values-tr/strings.xml @@ -265,6 +265,16 @@ "Uyarılar" "Mağaza demo" "USB bağlantısı" + + + + + + + + + + "Güvenli mod" "Android Sistemi" "Kişisel Profile Geç" diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml index 0fb047adb2af..09cec2a54af2 100644 --- a/core/res/res/values-uk/strings.xml +++ b/core/res/res/values-uk/strings.xml @@ -271,6 +271,16 @@ "Сповіщення" "Демо-режим для роздрібної торгівлі" "З’єднання USB" + + + + + + + + + + "Безп. режим" "Система Android" "Перейти в особистий профіль" diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml index 5c73b69ed71b..225faa65cfc2 100644 --- a/core/res/res/values-ur/strings.xml +++ b/core/res/res/values-ur/strings.xml @@ -265,6 +265,16 @@ "الرٹس" "ریٹیل ڈیمو" "‏USB کنکشن" + + + + + + + + + + "حفاظتی وضع" "‏Android سسٹم" "ذاتی پر سوئچ کریں" diff --git a/core/res/res/values-uz/strings.xml b/core/res/res/values-uz/strings.xml index 1f231496837f..0e7d4ffa370a 100644 --- a/core/res/res/values-uz/strings.xml +++ b/core/res/res/values-uz/strings.xml @@ -265,6 +265,16 @@ "Ogohlantirishlar" "Demo rejim" "USB orqali ulanish" + + + + + + + + + + "Xavfsiz usul" "Android tizimi" "Shaxsiy profilga o‘tish" @@ -722,7 +732,7 @@ "Televizorda SIM karta yo‘q." "Telefoningizda SIM karta yo‘q." "SIM kartani soling." - "SIM karta solinmagan yoki uni o‘qib bo‘lmaydi. SIM kartani soling." + "SIM karta solinmagan yoki u yaroqsiz. SIM kartani soling." "Foydalanib bo‘lmaydigan SIM karta." "SIM kartangiz butunlay bloklab qo‘yilgan.\n Yangi SIM karta olish uchun aloqa operatoringiz bilan bog‘laning." "Avvalgi musiqa" @@ -1174,7 +1184,7 @@ "USB jihozga ulangan" "Boshqa parametrlarini ko‘rish uchun bosing." "USB orqali nosozliklarni tuzatish" - "O‘chirib qo‘yish uchun bu yerga bosing." + "Faolsizlantirish uchun bu yerga bosing." "Xatoliklar hisoboti olinmoqda…" diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml index fa103cccd9c4..f2ba67166230 100644 --- a/core/res/res/values-vi/strings.xml +++ b/core/res/res/values-vi/strings.xml @@ -265,6 +265,16 @@ "Cảnh báo" "Giới thiệu bán lẻ" "Kết nối USB" + + + + + + + + + + "Chế độ an toàn" "Hệ thống Android" "Chuyển sang Cá nhân" diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml index dc66d6fec2fe..6e35e3f9cbce 100644 --- a/core/res/res/values-zh-rCN/strings.xml +++ b/core/res/res/values-zh-rCN/strings.xml @@ -265,6 +265,16 @@ "提醒" "零售演示模式" "USB 连接" + + + + + + + + + + "安全模式" "Android 系统" "切换到“个人”" diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml index 63cf0b1ae639..74f498725b47 100644 --- a/core/res/res/values-zh-rHK/strings.xml +++ b/core/res/res/values-zh-rHK/strings.xml @@ -72,8 +72,8 @@ "本機號碼" "連接線識別功能" "連接線識別限制" - "來電轉接" - "來電待接" + "來電轉駁" + "來電等候" "通話限制" "密碼更改" "更改 PIN" @@ -100,13 +100,13 @@ "無法連接網絡" "如要改善接收品質,請前往 [系統] > [網絡與互聯網] > [流動網絡] > [偏好的網絡類型],然後變更所選的網絡類型。" "通知" - "來電轉接" + "來電轉駁" "緊急回撥模式" "流動數據通知" "短訊" "留言訊息" "Wi-Fi 通話" - "對方曾要求 TTY 模式 (FULL)" + "對方曾要求 TTY 完整模式" "對方曾要求 TTY 模式 (HCO)" "對方曾要求 TTY 模式 (VCO)" "對方曾要求 TTY 模式 (OFF)" @@ -265,6 +265,16 @@ "通知" "零售示範" "USB 連線" + + + + + + + + + + "安全模式" "Android 系統" "切換至個人設定檔" diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml index 97962cf657ad..87e98dd381f2 100644 --- a/core/res/res/values-zh-rTW/strings.xml +++ b/core/res/res/values-zh-rTW/strings.xml @@ -265,6 +265,16 @@ "快訊" "零售商示範模式" "USB 連線" + + + + + + + + + + "安全模式" "Android 系統" "切換至個人設定檔" diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml index bcad869edfa1..a656e6ce1aee 100644 --- a/core/res/res/values-zu/strings.xml +++ b/core/res/res/values-zu/strings.xml @@ -265,6 +265,16 @@ "Izexwayiso" "Idemo yokuthenga" "Ukuxhumeka kwe-USB" + + + + + + + + + + "Imodi ephephile" "Uhlelo lwe-Android" "Shintshela komuntu siqu" -- GitLab From ad217d1f86c2cfd0490ff6f9cb51eeced699617b Mon Sep 17 00:00:00 2001 From: Casey Burkhardt Date: Thu, 27 Apr 2017 19:30:15 -0700 Subject: [PATCH 58/66] Refactor accessibility button support detection - Moves logic to detect devices capable of supporting the accessibility button into AccessibilityManager from SettingsLib to avoid issues with resource shifting in the SUW binary Bug: 37650567 Test: Existing Robolectric / Manual Merged-In: Ibb2aaa3c2f79570df768cfa796fa890988ef82cc Change-Id: I83bbecdf7836ae0de32ce7d39155ac0c111a8f15 --- api/system-current.txt | 1 + .../view/accessibility/AccessibilityManager.java | 15 +++++++++++++++ .../accessibility/AccessibilityButtonHelper.java | 5 ----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 260780eaf7e5..608acac84cfc 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -50676,6 +50676,7 @@ package android.view.accessibility { method public java.util.List getEnabledAccessibilityServiceList(int); method public java.util.List getInstalledAccessibilityServiceList(); method public void interrupt(); + method public static boolean isAccessibilityButtonSupported(); method public boolean isEnabled(); method public boolean isTouchExplorationEnabled(); method public boolean removeAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener); diff --git a/core/java/android/view/accessibility/AccessibilityManager.java b/core/java/android/view/accessibility/AccessibilityManager.java index dfb0095cc0fe..7eb7bd9ecc48 100644 --- a/core/java/android/view/accessibility/AccessibilityManager.java +++ b/core/java/android/view/accessibility/AccessibilityManager.java @@ -23,10 +23,12 @@ import android.accessibilityservice.AccessibilityServiceInfo; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SdkConstant; +import android.annotation.SystemApi; import android.content.ComponentName; import android.content.Context; import android.content.pm.PackageManager; import android.content.pm.ServiceInfo; +import android.content.res.Resources; import android.os.Binder; import android.os.Handler; import android.os.IBinder; @@ -1059,6 +1061,19 @@ public final class AccessibilityManager { } } + /** + * Determines if the accessibility button within the system navigation area is supported. + * + * @return {@code true} if the accessibility button is supported on this device, + * {@code false} otherwise + * @hide + */ + @SystemApi + public static boolean isAccessibilityButtonSupported() { + final Resources res = Resources.getSystem(); + return res.getBoolean(com.android.internal.R.bool.config_showNavigationBar); + } + private final class MyCallback implements Handler.Callback { public static final int MSG_SET_STATE = 1; diff --git a/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityButtonHelper.java b/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityButtonHelper.java index 972ea347e6dd..d5725e6aefed 100644 --- a/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityButtonHelper.java +++ b/packages/SettingsLib/src/com/android/settingslib/accessibility/AccessibilityButtonHelper.java @@ -18,7 +18,6 @@ package com.android.settingslib.accessibility; import android.accessibilityservice.AccessibilityServiceInfo; import android.content.Context; -import android.content.res.Resources; import android.provider.Settings; import android.view.accessibility.AccessibilityManager; @@ -55,8 +54,4 @@ public class AccessibilityButtonHelper { public static boolean isRequested(Context ctx) { return isRequestedByMagnification(ctx) || isRequestedByAccessibilityService(ctx); } - - public static boolean isDeviceSupported(Resources res) { - return res.getBoolean(com.android.internal.R.bool.config_showNavigationBar); - } } -- GitLab From 042ed7e0e2c6ea85aee9aef906c8fc74016c57cc Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Mon, 1 May 2017 16:07:16 -0700 Subject: [PATCH 59/66] Import translations. DO NOT MERGE Change-Id: I4eebfaa9c9983fcff35af8c1c0f98b945ded2631 Auto-generated-cl: translation import --- core/res/res/values-af/strings.xml | 10 +++++++ core/res/res/values-am/strings.xml | 10 +++++++ core/res/res/values-ar/strings.xml | 10 +++++++ core/res/res/values-az/strings.xml | 10 +++++++ core/res/res/values-b+sr+Latn/strings.xml | 12 +++++++- core/res/res/values-be/strings.xml | 20 +++++++++---- core/res/res/values-bg/strings.xml | 10 +++++++ core/res/res/values-bn/strings.xml | 10 +++++++ core/res/res/values-bs/strings.xml | 18 +++++++++--- core/res/res/values-ca/strings.xml | 10 +++++++ core/res/res/values-cs/strings.xml | 10 +++++++ core/res/res/values-da/strings.xml | 28 ++++++++++++------ core/res/res/values-de/strings.xml | 10 +++++++ core/res/res/values-el/strings.xml | 10 +++++++ core/res/res/values-en-rAU/strings.xml | 10 +++++++ core/res/res/values-en-rGB/strings.xml | 10 +++++++ core/res/res/values-en-rIN/strings.xml | 10 +++++++ core/res/res/values-es-rUS/strings.xml | 10 +++++++ core/res/res/values-es/strings.xml | 10 +++++++ core/res/res/values-et/strings.xml | 10 +++++++ core/res/res/values-eu/strings.xml | 14 +++++++-- core/res/res/values-fa/strings.xml | 10 +++++++ core/res/res/values-fi/strings.xml | 10 +++++++ core/res/res/values-fr-rCA/strings.xml | 10 +++++++ core/res/res/values-fr/strings.xml | 10 +++++++ core/res/res/values-gl/strings.xml | 30 ++++++++++++------- core/res/res/values-gu/strings.xml | 10 +++++++ core/res/res/values-hi/strings.xml | 10 +++++++ core/res/res/values-hr/strings.xml | 10 +++++++ core/res/res/values-hu/strings.xml | 10 +++++++ core/res/res/values-hy/strings.xml | 10 +++++++ core/res/res/values-in/strings.xml | 10 +++++++ core/res/res/values-is/strings.xml | 10 +++++++ core/res/res/values-it/strings.xml | 10 +++++++ core/res/res/values-iw/strings.xml | 36 +++++++++++++++-------- core/res/res/values-ja/strings.xml | 10 +++++++ core/res/res/values-ka/strings.xml | 10 +++++++ core/res/res/values-kk/strings.xml | 10 +++++++ core/res/res/values-km/strings.xml | 10 +++++++ core/res/res/values-kn/strings.xml | 10 +++++++ core/res/res/values-ko/strings.xml | 10 +++++++ core/res/res/values-ky/strings.xml | 14 +++++++-- core/res/res/values-lo/strings.xml | 12 +++++++- core/res/res/values-lt/strings.xml | 10 +++++++ core/res/res/values-lv/strings.xml | 10 +++++++ core/res/res/values-mk/strings.xml | 10 +++++++ core/res/res/values-ml/strings.xml | 10 +++++++ core/res/res/values-mn/strings.xml | 10 +++++++ core/res/res/values-mr/strings.xml | 10 +++++++ core/res/res/values-ms/strings.xml | 10 +++++++ core/res/res/values-my/strings.xml | 10 +++++++ core/res/res/values-nb/strings.xml | 10 +++++++ core/res/res/values-ne/strings.xml | 12 +++++++- core/res/res/values-nl/strings.xml | 10 +++++++ core/res/res/values-pa/strings.xml | 10 +++++++ core/res/res/values-pl/strings.xml | 10 +++++++ core/res/res/values-pt-rBR/strings.xml | 10 +++++++ core/res/res/values-pt-rPT/strings.xml | 10 +++++++ core/res/res/values-pt/strings.xml | 10 +++++++ core/res/res/values-ro/strings.xml | 10 +++++++ core/res/res/values-ru/strings.xml | 10 +++++++ core/res/res/values-si/strings.xml | 12 +++++++- core/res/res/values-sk/strings.xml | 10 +++++++ core/res/res/values-sl/strings.xml | 10 +++++++ core/res/res/values-sq/strings.xml | 10 +++++++ core/res/res/values-sr/strings.xml | 12 +++++++- core/res/res/values-sv/strings.xml | 10 +++++++ core/res/res/values-sw/strings.xml | 12 +++++++- core/res/res/values-ta/strings.xml | 10 +++++++ core/res/res/values-te/strings.xml | 10 +++++++ core/res/res/values-th/strings.xml | 10 +++++++ core/res/res/values-tl/strings.xml | 14 +++++++-- core/res/res/values-tr/strings.xml | 10 +++++++ core/res/res/values-uk/strings.xml | 10 +++++++ core/res/res/values-ur/strings.xml | 10 +++++++ core/res/res/values-uz/strings.xml | 14 +++++++-- core/res/res/values-vi/strings.xml | 10 +++++++ core/res/res/values-zh-rCN/strings.xml | 10 +++++++ core/res/res/values-zh-rHK/strings.xml | 18 +++++++++--- core/res/res/values-zh-rTW/strings.xml | 10 +++++++ core/res/res/values-zu/strings.xml | 10 +++++++ 81 files changed, 869 insertions(+), 59 deletions(-) diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml index b6cc0355cd78..4524b6e6c181 100644 --- a/core/res/res/values-af/strings.xml +++ b/core/res/res/values-af/strings.xml @@ -265,6 +265,16 @@ "Opletberigte" "Kleinhandeldemonstrasie" "USB-verbinding" + + + + + + + + + + "Veiligmodus" "Android-stelsel" "Skakel oor na persoonlik" diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml index 03432cb78500..a3ebecbd2ebc 100644 --- a/core/res/res/values-am/strings.xml +++ b/core/res/res/values-am/strings.xml @@ -265,6 +265,16 @@ "ማንቂያዎች" "የችርቻሮ ማሳያ" "የዩኤስቢ ግንኙነት" + + + + + + + + + + "የሚያስተማምን ሁነታ" "Android ስርዓት" "ወደ የግል ቀይር" diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml index 49aeb0ad3037..d1b9dcb5af2b 100644 --- a/core/res/res/values-ar/strings.xml +++ b/core/res/res/values-ar/strings.xml @@ -277,6 +277,16 @@ "التنبيهات" "عرض توضيحي لبائع التجزئة" "‏اتصال USB" + + + + + + + + + + "الوضع الآمن" "‏نظام Android" "التبديل إلى الشخصي" diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml index 4d4d157f31be..552c4e30c7cf 100644 --- a/core/res/res/values-az/strings.xml +++ b/core/res/res/values-az/strings.xml @@ -265,6 +265,16 @@ "Siqnallar" "Pərakəndə demo" "USB əlaqə" + + + + + + + + + + "Təhlükəsiz rejim" "Android sistemi" "Şəxsi profilə keçirin" diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml index 81ef9088997d..9fc3a28c507b 100644 --- a/core/res/res/values-b+sr+Latn/strings.xml +++ b/core/res/res/values-b+sr+Latn/strings.xml @@ -268,6 +268,16 @@ "Obaveštenja" "Režim demonstracije za maloprodajne objekte" "USB veza" + + + + + + + + + + "Bezbedni režim" "Android sistem" "Pređi na Lični profil" @@ -1630,7 +1640,7 @@ "Instalirao je administrator" "Ažurirao je administrator" "Izbrisao je administrator" - "Da bi produžila vreme trajanja baterije, ušteda baterije smanjuje performanse uređaja i ograničava vibraciju, usluge lokacije i većinu pozadinskih podataka. Imejl, razmena poruka i druge aplikacije koje se oslanjaju na sinhronizaciju možda neće da se ažuriraju ako ih ne otvorite.\n\nUšteda baterije se automatski isključuje kada se uređaj puni." + "Da bi produžila vreme trajanja baterije, ušteda baterije smanjuje performanse uređaja i ograničava vibraciju, usluge lokacije i većinu pozadinskih podataka. Imejl, razmena poruka i druge aplikacije koje se oslanjaju na sinhronizaciju neće se ažurirati dok ih ne otvorite.\n\nUšteda baterije se automatski isključuje kada se uređaj puni." "Da bi se smanjila potrošnja podataka, Ušteda podataka sprečava neke aplikacije da šalju ili primaju podatke u pozadini. Aplikacija koju trenutno koristite može da pristupa podacima, ali će to činiti ređe. Na primer, slike se neće prikazivati dok ih ne dodirnete." "Uključiti Uštedu podataka?" "Uključi" diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml index 3836385b14e9..fdd15d3cf95c 100644 --- a/core/res/res/values-be/strings.xml +++ b/core/res/res/values-be/strings.xml @@ -271,6 +271,16 @@ "Абвесткi" "Дэманстрацыйны рэжым для пунктаў продажу" "Падключэнне USB" + + + + + + + + + + "Бяспечны рэжым" "Сістэма Android" "Пераключыцца на асабісты" @@ -293,12 +303,12 @@ "рабіць тэлефонныя выклікі і кіраваць імі" "Датчыкі цела" "атрымліваць з датчыка даныя асноўных фізіялагічных паказчыкаў" - "Атрымайце змесцiва акна" - "Вывучыце змесцiва акна, з якiм вы працуеце." - "Уключыце Explore by Touch" + "Атрымліваць змесціва вакна" + "Аналізаваць змесціва актыўнага вакна." + "Уключаць Азнаямленне дотыкам" "Элементы, да якіх дакрануліся, будуць агучаны, а экранам можна даследаваць пры дапамозе жэстаў." - "Глядзiце, што набiраеце" - "Уключае ў сябе асабістыя дадзеныя, такія як нумары крэдытных карт і паролі." + "Праглядаць тэкст, які вы набіраеце" + "У тым ліку асабістыя даныя, такія як нумары крэдытных карт і паролі." "Кіраваць павелічэннем дысплэя" "Кіраваць маштабам дысплэя і пазіцыянаваннем." "Выконваць жэсты" diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml index c799ca9e48f2..b03e09e73daf 100644 --- a/core/res/res/values-bg/strings.xml +++ b/core/res/res/values-bg/strings.xml @@ -265,6 +265,16 @@ "Сигнали" "Демонстрационен режим за магазини" "USB връзка" + + + + + + + + + + "Безопасен режим" "Система Android" "Превключване към личния потребителски профил" diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml index c8bc6d7b19f4..b574890b5cc9 100644 --- a/core/res/res/values-bn/strings.xml +++ b/core/res/res/values-bn/strings.xml @@ -265,6 +265,16 @@ "সতর্কতাগুলি" "খুচরা বিক্রয়ের ডেমো" "USB সংযোগ" + + + + + + + + + + "নিরাপদ মোড" "Android সিস্টেম" "ব্যক্তিগততে পাল্টান" diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml index f93c655b02a4..37fa55fc3b70 100644 --- a/core/res/res/values-bs/strings.xml +++ b/core/res/res/values-bs/strings.xml @@ -268,6 +268,16 @@ "Upozorenja" "Promotivna demonstracija u maloprodaji" "USB veza" + + + + + + + + + + "Siguran način rada" "Android sistem" "Prebacite se na lični" @@ -998,7 +1008,7 @@ "Način unosa" "Akcije za tekst" "E-pošta" - "Telefon" + "Pozovi" "Mapa" "Pretraži" "Ponestaje prostora za pohranu" @@ -1184,7 +1194,7 @@ "Postavljanje vremena" "Postavljanje datuma" "Postaviti" - "Završeno" + "Gotovo" "NOVO: " "Aplikacija %1$s omogućava." "Nisu potrebne dozvole" @@ -1436,7 +1446,7 @@ "Bežični prikaz" "Prebacuj" "Poveži na uređaj" - "Prebaci ekran na uređaj" + "Emitiranje ekrana na uređaj" "Traženje uređajā…" "Postavke" "Prekini vezu" @@ -1615,7 +1625,7 @@ "Prikazuje se cijeli ekran" "Da izađete, prevucite nadolje odozgo." "Razumijem" - "Završeno" + "Gotovo" "Kružni klizač za odabir sata" "Kružni klizač za minute" "Odaberite sat" diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml index 512f1673831b..0b77c82fae42 100644 --- a/core/res/res/values-ca/strings.xml +++ b/core/res/res/values-ca/strings.xml @@ -265,6 +265,16 @@ "Alertes" "Demostració comercial" "Connexió USB" + + + + + + + + + + "Mode segur" "Sistema Android" "Canvia al perfil personal" diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml index 0dabc80913ab..31f08268ed68 100644 --- a/core/res/res/values-cs/strings.xml +++ b/core/res/res/values-cs/strings.xml @@ -271,6 +271,16 @@ "Upozornění" "Prodejní ukázka" "Připojení USB" + + + + + + + + + + "Nouzový režim" "Systém Android" "Přepnout na osobní profil" diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml index d5b40fbeb938..a258f082fdfa 100644 --- a/core/res/res/values-da/strings.xml +++ b/core/res/res/values-da/strings.xml @@ -265,6 +265,16 @@ "Underretninger" "Demo til udstilling i butik" "USB-forbindelse" + + + + + + + + + + "Sikker tilstand" "Android-system" "Skift til Tilpasset" @@ -317,8 +327,8 @@ "Tillader, at appen kan modtage og behandle sms-beskeder. Det betyder, at appen kan overvåge eller slette de beskeder, der sendes til din enhed, uden at vise dem til dig." "modtage tekstbeskeder (mms)" "Tillader, at appen kan modtage og behandle mms-beskeder. Det betyder, at appen kan overvåge eller slette de beskeder, der sendes til din enhed, uden at vise dem til dig." - "læse Cell Broadcast-beskeder" - "Tillader, at appen læser Cell Broadcast-beskeder, der modtages af din enhed. I nogle områder sendes der Cell Broadcast-beskeder for at advare om nødsituationer. Ondsindede apps kan forstyrre ydelsen eller driften af ​din ​enhed, når der modtages en Cell Broadcast-besked om en nødsituation." + "læse Cell Broadcast-meddelelser" + "Tillader, at appen læser Cell Broadcast-meddelelser, der modtages af din enhed. I nogle områder sendes der Cell Broadcast-meddelelser for at advare om nødsituationer. Ondsindede apps kan forstyrre ydelsen eller driften af ​din ​enhed, når der modtages en Cell Broadcast-meddelelse om en nødsituation." "læse feeds, jeg abonnerer på" "Tillader, at appen kan hente oplysninger om de feeds, der synkroniseres." "Send og se sms-beskeder" @@ -1074,19 +1084,19 @@ "Processen %1$s har overskredet sin proceshukommelsesgrænse på %2$s. En heap dump er tilgængelig og kan deles med udvikleren. Vær forsigtig: Denne heap dump kan indeholde dine personlige oplysninger, som appen har adgang til." "Vælg en handling for teksten" "Lydstyrke for opkald" - "Medielydstyrke" + "Lydstyrke for medier" "Afspilning via Bluetooth" "Lydløs ringetone er angivet" "Lydstyrke for opkald" "Lydstyrke for Bluetooth under opkald" "Lydstyrke for alarm" - "Lydstyrke for meddelelser" + "Lydstyrke for underretninger" "Lydstyrke" "Lydstyrke for bluetooth" "Lydstyrke for ringetone" "Lydstyrke for opkald" - "Medielydstyrke" - "Lydstyrke for meddelelser" + "Lydstyrke for medier" + "Lydstyrke for underretninger" "Standardringetone" "Standard (%1$s)" "Ingen" @@ -1609,7 +1619,7 @@ "Opdateret af din administrator" "Slettet af din administrator" "Batterisparefunktionen hjælper med at forlænge batteriets levetid ved at reducere enhedens ydeevne og begrænse vibration, placeringstjenester og det meste baggrundsdata. E-mail, beskedfunktioner og andre apps, der benytter synkronisering, opdateres muligvis ikke, medmindre du åbner dem.\n\nBatterisparefunktionen slukker automatisk, når enheden oplader." - "Datasparefunktion forhindrer nogle apps i at sende eller modtage data i baggrunden for at reducere dataforbruget. En app, der er i brug, kan få adgang til data, men gør det måske ikke så ofte. Dette kan f.eks. betyde, at billeder ikke vises, før du trykker på dem." + "Datasparefunktionen forhindrer nogle apps i at sende eller modtage data i baggrunden for at reducere dataforbruget. En app, der er i brug, kan få adgang til data, men gør det måske ikke så ofte. Dette kan f.eks. betyde, at billeder ikke vises, før du trykker på dem." "Vil du slå Datasparefunktion til?" "Slå til" @@ -1731,13 +1741,13 @@ "USB-fejlretning" "time" "minut" - "Indstil klokkeslæt" + "Angiv klokkeslæt" "Angiv et gyldigt klokkeslæt" "Angiv klokkeslæt" "Skift til teksttilstand for at angive klokkeslæt." "Skift til urtilstand for at angive klokkeslæt." "Valgmuligheder for AutoFyld" - "Gem til AutoFyld" + "Gem i AutoFyld" "Indhold kan ikke udfyldes automatisk" "Vil du gemme i <b>%1$s</b>?" "Vil du gemme %1$s i <b>%2$s</b>?" diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml index 347ebca534ab..5a70d9b1ab2a 100644 --- a/core/res/res/values-de/strings.xml +++ b/core/res/res/values-de/strings.xml @@ -265,6 +265,16 @@ "Warnmeldungen" "Demo für Einzelhandel" "USB-Verbindung" + + + + + + + + + + "Abgesicherter Modus" "Android-System" "Zu \"Privat\" wechseln" diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml index 4d93e5fc9e52..0cc6dc602546 100644 --- a/core/res/res/values-el/strings.xml +++ b/core/res/res/values-el/strings.xml @@ -265,6 +265,16 @@ "Ειδοποιήσεις" "Επίδειξη λιανικής" "Σύνδεση USB" + + + + + + + + + + "Ασφαλής λειτουργία" "Σύστημα Android" "Μετάβαση σε προσωπικό προφίλ" diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml index aa08377297bd..4976b037e7cd 100644 --- a/core/res/res/values-en-rAU/strings.xml +++ b/core/res/res/values-en-rAU/strings.xml @@ -265,6 +265,16 @@ "Alerts" "Retail demo" "USB connection" + + + + + + + + + + "Safe mode" "Android system" "Switch to Personal" diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml index aa08377297bd..4976b037e7cd 100644 --- a/core/res/res/values-en-rGB/strings.xml +++ b/core/res/res/values-en-rGB/strings.xml @@ -265,6 +265,16 @@ "Alerts" "Retail demo" "USB connection" + + + + + + + + + + "Safe mode" "Android system" "Switch to Personal" diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml index aa08377297bd..4976b037e7cd 100644 --- a/core/res/res/values-en-rIN/strings.xml +++ b/core/res/res/values-en-rIN/strings.xml @@ -265,6 +265,16 @@ "Alerts" "Retail demo" "USB connection" + + + + + + + + + + "Safe mode" "Android system" "Switch to Personal" diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml index 29a0adc4d825..5515ae19a996 100644 --- a/core/res/res/values-es-rUS/strings.xml +++ b/core/res/res/values-es-rUS/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demo para punto de venta" "Conexión USB" + + + + + + + + + + "Modo seguro" "Sistema Android" "Cambiar al perfil personal" diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml index 02c91dbcb0b9..33c0e5ca2aee 100644 --- a/core/res/res/values-es/strings.xml +++ b/core/res/res/values-es/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demo para tiendas" "Conexión USB" + + + + + + + + + + "Modo seguro" "Sistema Android" "Cambiar a perfil personal" diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml index cb6365935855..1c76b3f748d6 100644 --- a/core/res/res/values-et/strings.xml +++ b/core/res/res/values-et/strings.xml @@ -265,6 +265,16 @@ "Teatised" "Poedemo" "USB-ühendus" + + + + + + + + + + "Turvarežiim" "Android-süsteem" "Lülita isiklikule profiilile" diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml index 3c79b784010a..78aed2310781 100644 --- a/core/res/res/values-eu/strings.xml +++ b/core/res/res/values-eu/strings.xml @@ -265,6 +265,16 @@ "Abisuak" "Saltzaileentzako demoa" "USB konexioa" + + + + + + + + + + "Modu segurua" "Android sistema" "Aldatu profil pertsonalera" @@ -289,7 +299,7 @@ "atzitu bizi-konstanteei buruzko sentsore-datuak" "Eskuratu leihoko edukia" "Arakatu irekita daukazun leihoko edukia." - "Aktibatu ukipen bidez arakatzeko eginbidea" + "Aktibatu \"Arakatu ukituta\"" "Sakatutako elementuak ozen esango dira eta pantaila keinu bidez arakatu ahal izango da." "Behatu idazten duzun testua" "Ez da salbuespenik egiten datu pertsonalekin, hala nola, kreditu-txartelen zenbakiekin eta pasahitzekin." @@ -1477,7 +1487,7 @@ "Uneko erabiltzailea: %1$s." "%1$s erabiltzailera aldatzen…" "%1$s erabiltzailearen saioa amaitzen…" - "jabea" + "Jabea" "Errorea" "Administratzaileak ez du eman aldaketa egiteko baimena" "Ez da ekintza gauza dezakeen aplikaziorik aurkitu" diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml index beef14c59527..cd8e7502d7e8 100644 --- a/core/res/res/values-fa/strings.xml +++ b/core/res/res/values-fa/strings.xml @@ -265,6 +265,16 @@ "هشدارها" "نمونه برای خرده‌فروشان" "‏اتصال USB" + + + + + + + + + + "حالت ایمن" "‏سیستم Android" "رفتن به نمایه شخصی" diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml index 44614d761f09..56906696654b 100644 --- a/core/res/res/values-fi/strings.xml +++ b/core/res/res/values-fi/strings.xml @@ -265,6 +265,16 @@ "Ilmoitukset" "Esittelytila" "USB-yhteys" + + + + + + + + + + "Suojattu tila" "Android-järjestelmä" "Siirry henkilökohtaiseen profiiliin" diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml index 20780fd2b80a..77972741e960 100644 --- a/core/res/res/values-fr-rCA/strings.xml +++ b/core/res/res/values-fr-rCA/strings.xml @@ -265,6 +265,16 @@ "Alertes" "Démo en magasin" "Connexion USB" + + + + + + + + + + "Mode sécurisé" "Système Android" "Passer au profil personnel" diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml index 65f8d78e76f7..761947e3e0c7 100644 --- a/core/res/res/values-fr/strings.xml +++ b/core/res/res/values-fr/strings.xml @@ -265,6 +265,16 @@ "Alertes" "Démonstration en magasin" "Connexion USB" + + + + + + + + + + "Mode sécurisé" "Système Android" "Passer au profil personnel" diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml index bc2dda1cb4fc..2c58acbad584 100644 --- a/core/res/res/values-gl/strings.xml +++ b/core/res/res/values-gl/strings.xml @@ -29,10 +29,10 @@ "%1$s %2$s" "%1$d días" "%1$d día %2$d hrs" - "%1$d día %2$d hr" + "%1$d día %2$d h" "%1$d hrs" - "%1$d hr %2$d min" - "%1$d hr %2$d min" + "%1$d h %2$d min" + "%1$d h %2$d min" "%1$d min" "%1$d minuto" "%1$d min %2$d seg" @@ -265,6 +265,16 @@ "Alertas" "Demostración comercial" "conexión USB" + + + + + + + + + + "Modo seguro" "Sistema Android" "Cambiar ao perfil persoal" @@ -293,8 +303,8 @@ "Os elementos que toques pronunciaranse en voz alta e a pantalla poderá explorarse mediante xestos." "Observar o texto que escribes" "Inclúe datos persoais como números e contrasinais de tarxetas de crédito." - "Controlar ampliación da pantalla" - "Controlar o nivel do zoom e o posicionamento da pantalla" + "Controlar a ampliación da pantalla" + "Controla o nivel do zoom e o posicionamento da pantalla." "Realizar xestos" "Podes tocar, pasar o dedo, beliscar e realizar outros xestos." "Xestos de impresión dixital" @@ -441,8 +451,8 @@ "Permite á aplicación crear sockets de rede e utilizar protocolos de rede personalizados. O navegador e outras aplicacións ofrecen medios para enviar datos a Internet, polo que non se require este permiso para enviar datos a Internet." "cambiar a conectividade de rede" "Permite á aplicación cambiar o estado da conectividade de rede." - "cambiar conectividade de ancoraxe á rede" - "Permite á aplicación cambiar o estado da conectividade de rede ancorada." + "cambiar conectividade de conexión compartida" + "Permite á aplicación cambiar o estado da conectividade da conexión compartida." "ver conexións wifi" "Permite á aplicación ver información acerca das redes wifi, como se a wifi está activada e o nome dos dispositivos wifi conectados." "conectar e desconectar da wifi" @@ -1117,7 +1127,7 @@ "A aplicación %1$s quere conectarse á rede wifi %2$s" "Unha aplicación" "Wi-Fi Direct" - "Inicia Wi-Fi Direct. Esta acción desactivará o cliente e a zona interactiva da wifi." + "Inicia Wi-Fi Direct. Esta acción desactivará a zona ou o cliente wifi." "Non se puido iniciar Wi-Fi Direct." "Wi-Fi Direct está activado" "Toca para acceder á configuración" @@ -1287,7 +1297,7 @@ "Enviar" "Modo de coche activado" "Toca para saír do modo de coche." - "Ancoraxe á rede ou zona Wi-Fi activada" + "Conexión compartida ou zona wifi activada" "Tocar para configurar." "Volver" "Seguinte" @@ -1609,7 +1619,7 @@ "Instalado polo teu administrador" "Actualizado polo teu administrador" "Eliminado polo teu administrador" - "Para axudar a mellorar a duración da batería, a función aforro de batería reduce o rendemento do teu dispositivo e limita a vibración, os servizos de localización e a maioría dos datos en segundo plano. É posible que o correo electrónico, as mensaxes e outras aplicacións que dependen da sincronización non se actualicen a menos que os abras. \n\nA función aforro de batería desactívase automaticamente cando pos a cargar o teu dispositivo." + "Para axudar a mellorar a duración da batería, a función de aforro da batería reduce o rendemento do teu dispositivo e limita a vibración, os servizos de localización e a maioría dos datos en segundo plano. É posible que o correo electrónico, as mensaxes e outras aplicacións que dependen da sincronización non se actualicen a menos que os abras. \n\nA función de aforro da batería desactívase automaticamente cando pos a cargar o teu dispositivo." "Para contribuír a reducir o uso de datos, o Economizador de datos impide que algunhas aplicacións envíen ou reciban datos en segundo plano. Cando esteas utilizando unha aplicación, esta poderá acceder aos datos, pero é posible que o faga con menos frecuencia. Por exemplo, é posible que as imaxes non se mostren ata que as toques." "Queres activar o economizador de datos?" "Activar" diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml index f70639f22bd7..77f7212e15d1 100644 --- a/core/res/res/values-gu/strings.xml +++ b/core/res/res/values-gu/strings.xml @@ -265,6 +265,16 @@ "ચેતવણીઓ" "રિટેલ ડેમો" "USB કનેક્શન" + + + + + + + + + + "સુરક્ષિત મોડ" "Android સિસ્ટમ" "વ્યક્તિગત પર સ્વિચ કરો" diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml index 556ba9e62ccc..0a672ca7bd9f 100644 --- a/core/res/res/values-hi/strings.xml +++ b/core/res/res/values-hi/strings.xml @@ -265,6 +265,16 @@ "सूचनाएं" "खुदरा डेमो" "USB कनेक्शन" + + + + + + + + + + "सुरक्षित मोड" "Android सिस्‍टम" "व्यक्तिगत प्रोफ़ाइल में स्विच करें" diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml index c8083e76c3d7..48f4cf7b221d 100644 --- a/core/res/res/values-hr/strings.xml +++ b/core/res/res/values-hr/strings.xml @@ -268,6 +268,16 @@ "Upozorenja" "Prodajni demo-način" "USB veza" + + + + + + + + + + "Siguran način rada" "Sustav Android" "Prijeđite na osobni" diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml index d528e9437158..8af3ff5575f2 100644 --- a/core/res/res/values-hu/strings.xml +++ b/core/res/res/values-hu/strings.xml @@ -265,6 +265,16 @@ "Értesítések" "Kiskereskedelmi bemutató" "USB-kapcsolat" + + + + + + + + + + "Biztonsági üzemmód" "Android rendszer" "Átváltás személyes profilra" diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml index f33e7778a068..2ca708d6653c 100644 --- a/core/res/res/values-hy/strings.xml +++ b/core/res/res/values-hy/strings.xml @@ -265,6 +265,16 @@ "Ծանուցումներ" "Խանութի ցուցադրական ռեժիմ" "USB կապակցում" + + + + + + + + + + "Անվտանգ ռեժիմ" "Android համակարգ" "Անցնել անհատական պրոֆիլին" diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml index 9ba2120be671..aa325acce3ba 100644 --- a/core/res/res/values-in/strings.xml +++ b/core/res/res/values-in/strings.xml @@ -265,6 +265,16 @@ "Notifikasi" "Demo promo" "Sambungan USB" + + + + + + + + + + "Mode aman" "Sistem Android" "Beralih ke Pribadi" diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml index 30d83e1481ef..e37862bd2679 100644 --- a/core/res/res/values-is/strings.xml +++ b/core/res/res/values-is/strings.xml @@ -265,6 +265,16 @@ "Tilkynningar" "Kynningarútgáfa fyrir verslanir" "USB-tenging" + + + + + + + + + + "Örugg stilling" "Android kerfið" "Skipta yfir í persónulegt snið" diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml index 61be91cf63c4..8057a06445ab 100644 --- a/core/res/res/values-it/strings.xml +++ b/core/res/res/values-it/strings.xml @@ -265,6 +265,16 @@ "Avvisi" "Demo retail" "Connessione USB" + + + + + + + + + + "Modalità provvisoria" "Sistema Android" "Passa al profilo personale" diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml index 18518f8eaafd..504d3ad8d05c 100644 --- a/core/res/res/values-iw/strings.xml +++ b/core/res/res/values-iw/strings.xml @@ -271,6 +271,16 @@ "התראות" "הדגמה לקמעונאים" "‏חיבור USB" + + + + + + + + + + "מצב בטוח" "‏מערכת Android" "עבור ל\'אישי\'" @@ -1009,7 +1019,7 @@ "מחק" "העתק כתובת אתר" "בחר טקסט" - "בטל" + "ביטול" "בצע מחדש" "מילוי אוטומטי" "בחירת טקסט" @@ -1066,7 +1076,7 @@ "האפליקציה %1$s נעצרת שוב ושוב" "האפליקציה %1$s נעצרת שוב ושוב" "פתח שוב את האפליקציה" - "שלח משוב" + "משוב" "סגור" "השתק עד הפעלה מחדש של המכשיר" "המתן" @@ -1181,7 +1191,7 @@ "הדבר ""עלול לגרום לחיובים"" בחשבון המכשיר הנייד שלך." "הדבר יגרום לחיובים בחשבון המכשיר הנייד שלך." "שלח" - "בטל" + "ביטול" "זכור את הבחירה שלי" "‏ניתן לשנות זאת מאוחר יותר ב\'הגדרות\' > \'אפליקציות\'" "אפשר תמיד" @@ -1198,7 +1208,7 @@ "‏ה-SIM החדש הוכנס" "הקש כדי להגדיר" "הגדרת שעה" - "הגדר תאריך" + "הגדרת תאריך" "הגדר" "בוצע" "חדש: " @@ -1223,7 +1233,7 @@ "שתף" "לא, אין מצב" "שינוי מקלדת" - "השאר אותו במסך בזמן שהמקלדת הפיזית פעילה" + "תישאר במסך בזמן שהמקלדת הפיזית פעילה" "הצג מקלדת וירטואלית" "הגדרת מקלדת פיזית" "הקש כדי לבחור שפה ופריסה" @@ -1358,13 +1368,13 @@ "בטל את פעולות המחיקה" "אל תעשה דבר כרגע" "בחר חשבון" - "הוסף חשבון" - "הוסף חשבון" + "הוספת חשבון" + "הוספת חשבון" "הוסף" "הפחת" "%s גע והחזק." "הסט למעלה כדי להוסיף ולמטה כדי להפחית." - "הוסף דקה" + "הוספת דקה" "הפחת דקה" "הוסף שעה" "הפחת שעה" @@ -1403,7 +1413,7 @@ "‏כונן USB של %s" "‏אחסון USB" "ערוך" - "התראה לשימוש בנתונים" + "התראה על שימוש בנתונים" "הקש כדי להציג נתוני שימוש והגדרות." "‏הגעת למגבלת הנתונים של 2G-3G" "‏הגעת למגבלת הנתונים של 4G" @@ -1487,7 +1497,7 @@ "‏כדי לבטל את הנעילה, היכנס באמצעות חשבון Google שלך." "שם משתמש (אימייל)" "סיסמה" - "היכנס" + "כניסה" "שם משתמש או סיסמה לא חוקיים." "‏שכחת את שם המשתמש או הסיסמה?\nהיכנס לכתובת ""google.com/accounts/recovery" "בודק חשבון…" @@ -1776,7 +1786,7 @@ "מאפס את המכשיר…" "האם לאפס את המכשיר?" "תאבד את כל השינויים וההדגמה תתחיל שוב בעוד %1$s שניות…" - "בטל" + "ביטול" "אפס עכשיו" "%1$s הושבת" "שיחת ועידה" @@ -1793,9 +1803,9 @@ "‏ניקוי באגים ב-USB" "שעה" "דקה" - "הגדר שעה" + "הגדרת שעה" "הזן שעה חוקית" - "הקלד את השעה" + "מהי השעה הנכונה" "העבר למצב קלט טקסט לצורך הזנת השעה" "העבר למצב שעון לצורך הזנת השעה" "אפשרויות מילוי אוטומטי" diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml index f5da17ecc995..4f18bcb7b08d 100644 --- a/core/res/res/values-ja/strings.xml +++ b/core/res/res/values-ja/strings.xml @@ -265,6 +265,16 @@ "通知" "販売店デモ" "USB 接続" + + + + + + + + + + "セーフモード" "Androidシステム" "個人用に切り替える" diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml index bf0f5da4528d..31cd59b2130b 100644 --- a/core/res/res/values-ka/strings.xml +++ b/core/res/res/values-ka/strings.xml @@ -265,6 +265,16 @@ "გაფრთხილებები" "დემო-რეჟიმი საცალო მოვაჭრეებისთვის" "USB კავშირი" + + + + + + + + + + "უსაფრთხო რეჟიმი" "Android-ის სისტემა" "პირად პროფილზე გადართვა" diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml index 7b30f282863f..c512e4311485 100644 --- a/core/res/res/values-kk/strings.xml +++ b/core/res/res/values-kk/strings.xml @@ -265,6 +265,16 @@ "Дабылдар" "Бөлшек саудаға арналған демо нұсқасы" "USB байланысы" + + + + + + + + + + "Қауіпсіз режим" "Android жүйесі" "Жекеге ауысу" diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml index 59c8c2066463..64306fd3e809 100644 --- a/core/res/res/values-km/strings.xml +++ b/core/res/res/values-km/strings.xml @@ -265,6 +265,16 @@ "ការ​ជូនដំណឹង" "របៀបដាក់បង្ហាញក្នុងហាង" "ការ​តភ្ជាប់ USB" + + + + + + + + + + "របៀប​​​សុវត្ថិភាព" "ប្រព័ន្ធ​​ Android" "ប្តូរទៅផ្ទាល់ខ្លួន" diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml index 906c88cd4437..aaabd919e6ea 100644 --- a/core/res/res/values-kn/strings.xml +++ b/core/res/res/values-kn/strings.xml @@ -265,6 +265,16 @@ "ಎಚ್ಚರಿಕೆಗಳು" "ರಿಟೇಲ್ ಡೆಮೋ" "USB ಸಂಪರ್ಕ" + + + + + + + + + + "ಸುರಕ್ಷಿತ ಮೋಡ್" "Android ಸಿಸ್ಟಂ" "ವೈಯಕ್ತಿಕಗೆ ಬದಲಿಸಿ" diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml index db2e038418b3..ab61857150d8 100644 --- a/core/res/res/values-ko/strings.xml +++ b/core/res/res/values-ko/strings.xml @@ -265,6 +265,16 @@ "알림" "소매 데모" "USB 연결" + + + + + + + + + + "안전 모드" "Android 시스템" "개인으로 전환" diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml index 05ca65ee9f5d..a24bd7fb21ad 100644 --- a/core/res/res/values-ky/strings.xml +++ b/core/res/res/values-ky/strings.xml @@ -265,6 +265,16 @@ "Эскертүүлөр" "Чекене соода дүкөнү үчүн демо режим" "USB аркылуу туташуу" + + + + + + + + + + "Коопсуз режим" "Android тутуму" "Жеке профилге которулуу" @@ -1412,7 +1422,7 @@ "Түзмөккө туташуу" "Сырткы экранга чыгаруу" "Түзмөктөр изделүүдө..." - "Тууралоолор" + "Жөндөөлөр" "Ажыратуу" "Скандоодо..." "Туташууда..." @@ -1466,7 +1476,7 @@ "Алып салуу" "Сунушталган деңгээлден да катуулатып уккуңуз келеби?\n\nМузыканы узакка чейин катуу уксаңыз, угууңуз начарлап кетиши мүмкүн." "Атайын мүмкүнчүлүктөр функциясынын кыска жолу колдонулсунбу?" - "Кыска жол функциясы күйгүзүлгөн учурда үн көзөмөлдөөчү баскычтарды басып, 3 секунд кармап турсаңыз, атайын мүмкүнчүлүктөр функциясы иштетилет.\n\n Учурдагы атайын мүмкүнчүлүктөр функциясы:\n %1$s\n\n Функцияны Жөндөөлөр > атайын мүмкүнчүлүктөр бөлүмүнөн өзгөртө аласыз." + "Атайын мүмкүнчүлүктөр функциясын пайдалануу үчүн, анын кыска жолу күйгүзүлгөндө, үндү катуулатуу/акырындатуу баскычын үч секунддай кое бербей басып туруңуз.\n\n Учурдагы атайын мүмкүнчүлүктөрдүн жөндөөлөрү:\n %1$s\n\nЖөндөөлөр > Атайын мүмкүнчүлүктөр бөлүмүнөн өзгөртө аласыз." "Кыска жолду өчүрүү" "Кыска жолду колдонуу" "Атайын мүмкүнчүлүктөр кыска жолу %1$s кызматын күйгүздү" diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml index 4f2eb19d3a11..d162fe027238 100644 --- a/core/res/res/values-lo/strings.xml +++ b/core/res/res/values-lo/strings.xml @@ -265,6 +265,16 @@ "ການເຕືອນ" "ເດໂມສຳລັບຮ້ານຂາຍ" "ການເຊື່ອມຕໍ່ USB" + + + + + + + + + + "Safe mode" "ລະບົບ Android" "ສະລັບໄປໂປຣໄຟລ໌ສ່ວນຕົວ" @@ -1608,7 +1618,7 @@ "ຖືກຕິດຕັ້ງໂດຍຜູ້ເບິ່ງແຍງລະບົບຂອງທ່ານ" "ຖືກອັບໂຫລດໂດຍຜູ້ເບິ່ງແຍງລະບົບຂອງທ່ານ" "ຖືກລຶບອອກໂດຍຜູ້ເບິ່ງແຍງລະບົບຂອງທ່ານ" - "ເພື່ອ​ຊ່ວຍ​ເພີ່ມ​ອາ​ຍຸ​ແບັດ​ເຕີ​ຣີ, ຕົວ​ປະ​ຢັດ​ໄຟ​ແບັດ​ເຕີ​ຣີ​ຫຼຸດ​ປະ​ສິດ​ທິ​ພາບ​ການ​ເຮັດ​ວຽກ​ຂອງ​ອຸ​ປະ​ກອນ​ຂອງ​ທ່ານ​ລົງ ແລະ​ຈຳ​ກັດ​ການ​ສັ່ນ, ການ​ບໍ​ລິ​ການ​ຫາທີ່ຕັ້ງ, ແລະ​ຂໍ້​ມູນ​ພື້ນ​ຫຼັງ​ເກືອບ​ທັງ​ໝົດ. ອີ​ເມວ, ການ​ສົ່ງ​ຂໍ້​ຄວາມ, ແລະ​ແອັບອື່ນໆ​ທີ່ອາ​ໄສການ​ຊິງ​ຄ໌​ອາດ​ຈະ​ບໍ່​ອັບ​ເດດ ນອກ​ຈາກວ່າ​ທ່ານ​ເປີດ​ມັນ.\n\nຕົວ​ປະ​ຢັດ​ໄຟ​ແບັດ​ເຕີ​ຣີຈະ​ປິດ​ອັດ​ຕະ​ໂນ​ມັດ ເມື່ອ​ອຸ​ປະ​ກອນ​ຂອງ​ທ່ານ​ກຳ​ລັງ​ສາກຢູ່." + "ເພື່ອ​ຊ່ວຍ​ເພີ່ມ​ອາ​ຍຸ​ແບັດ​ເຕີ​ຣີ, ຕົວ​ປະ​ຢັດ​ໄຟ​ແບັດ​ເຕີ​ຣີ​ຫຼຸດ​ປະ​ສິດ​ທິ​ພາບ​ການ​ເຮັດ​ວຽກ​ຂອງ​ອຸ​ປະ​ກອນ​ຂອງ​ທ່ານ​ລົງ ແລະ​ຈຳ​ກັດ​ການ​ສັ່ນ, ການ​ບໍ​ລິ​ການ​ຫາທີ່ຕັ້ງ ແລະ ຂໍ້​ມູນ​ພື້ນ​ຫຼັງ​ເກືອບ​ທັງ​ໝົດ. ອີ​ເມວ, ການ​ສົ່ງ​ຂໍ້​ຄວາມ, ແລະ ແອັບອື່ນໆ​ທີ່ອາ​ໄສການ​ຊິ້ງຂໍ້ມູນ​ອາດ​ຈະ​ບໍ່​ອັບ​ເດດ ນອກ​ຈາກວ່າ​ທ່ານ​ເປີດ​ມັນ.\n\nຕົວ​ປະ​ຢັດ​ໄຟ​ແບັດ​ເຕີ​ຣີຈະ​ປິດ​ອັດ​ຕະ​ໂນ​ມັດເມື່ອ​ທ່ານສາກໄຟອຸ​ປະ​ກອນ​." "ເພື່ອຊ່ວຍຫຼຸດຜ່ອນການນຳໃຊ້ຂໍ້ມູນ, ຕົວປະຢັດຂໍ້ມູນຈະປ້ອງກັນບໍ່ໃຫ້ບາງແອັບສົ່ງ ຫຼື ຮັບຂໍ້ມູນໃນພື້ນຫຼັງ. ແອັບໃດໜຶ່ງທີ່ທ່ານກຳລັງໃຊ້ຢູ່ຈະສາມາດເຂົ້າເຖິງຂໍ້ມູນໄດ້ ແຕ່ອາດເຂົ້າເຖິງໄດ້ຖີ່ໜ້ອຍລົງ. ນີ້ອາດໝາຍຄວາມວ່າ ຮູບພາບຕ່າງໆອາດບໍ່ສະແດງຈົນກວ່າທ່ານຈະແຕະໃສ່ກ່ອນ." "ເປີດໃຊ້ຕົວປະຢັດຂໍ້ມູນບໍ?" "ເປີດໃຊ້" diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml index 99ef41ca0b70..0a62d62f6d22 100644 --- a/core/res/res/values-lt/strings.xml +++ b/core/res/res/values-lt/strings.xml @@ -271,6 +271,16 @@ "Įspėjimai" "Demonstracinė versija mažmenininkams" "USB jungtis" + + + + + + + + + + "Saugos režimas" "„Android“ sistema" "Perjungti į asmeninį režimą" diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml index c01ab61be1e9..3bcce6f5319c 100644 --- a/core/res/res/values-lv/strings.xml +++ b/core/res/res/values-lv/strings.xml @@ -268,6 +268,16 @@ "Brīdinājumi" "Demonstrācijas versija veikaliem" "USB savienojums" + + + + + + + + + + "Drošais režīms" "Android sistēma" "Pārslēgt personīgo profilu" diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml index bb2527c0dc08..b5e8c90b3bd5 100644 --- a/core/res/res/values-mk/strings.xml +++ b/core/res/res/values-mk/strings.xml @@ -265,6 +265,16 @@ "Предупредувања" "Демонстрација за малопродажба" "USB-врска" + + + + + + + + + + "Безбеден режим" "Систем Android" "Префрлете на личен профил" diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml index 178bc3d1e685..5dbb33452635 100644 --- a/core/res/res/values-ml/strings.xml +++ b/core/res/res/values-ml/strings.xml @@ -265,6 +265,16 @@ "അലേർട്ടുകൾ" "റീട്ടെയിൽ ഡെമോ" "USB കണക്ഷൻ" + + + + + + + + + + "സുരക്ഷിത മോഡ്" "Android സിസ്റ്റം" "വ്യക്തിഗത പ്രൊഫൈലിലേക്ക് മാറുക" diff --git a/core/res/res/values-mn/strings.xml b/core/res/res/values-mn/strings.xml index 5cf213a80157..765aa5d286fd 100644 --- a/core/res/res/values-mn/strings.xml +++ b/core/res/res/values-mn/strings.xml @@ -265,6 +265,16 @@ "Сануулга" "Жижиглэнгийн жишээ" "USB холболт" + + + + + + + + + + "Аюулгүй горим" "Андройд систем" "\"Хувийн\" руу шилжих" diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml index 7f414492adf2..41918282c6f5 100644 --- a/core/res/res/values-mr/strings.xml +++ b/core/res/res/values-mr/strings.xml @@ -265,6 +265,16 @@ "सूचना" "किरकोळ डेमो" "USB कनेक्‍शन" + + + + + + + + + + "सुरक्षित मोड" "Android सिस्‍टम" "वैयक्तिकवर स्विच करा" diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml index 5d5c4f3a5942..d4cc2d339862 100644 --- a/core/res/res/values-ms/strings.xml +++ b/core/res/res/values-ms/strings.xml @@ -265,6 +265,16 @@ "Makluman" "Tunjuk cara runcit" "Sambungan USB" + + + + + + + + + + "Mod selamat" "Sistem Android" "Beralih kepada Peribadi" diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml index d88065843a68..1d89730ba0aa 100644 --- a/core/res/res/values-my/strings.xml +++ b/core/res/res/values-my/strings.xml @@ -265,6 +265,16 @@ "သတိပေးချက်များ" "လက်လီအရောင်းဆိုင် သရုပ်ပြမှု" "USB ချိတ်ဆက်မှု" + + + + + + + + + + "အန္တရာယ်ကင်းမှု စနစ်(Safe mode)" "Android စနစ်" "ကိုယ်ပိုင်သီးသန့်အဖြစ် ပြောင်းပါ" diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml index c6594354372f..ab32ff8f8ea2 100644 --- a/core/res/res/values-nb/strings.xml +++ b/core/res/res/values-nb/strings.xml @@ -265,6 +265,16 @@ "Varsler" "Butikkdemo" "USB-tilkobling" + + + + + + + + + + "Sikkermodus" "Android-system" "Bytt til den personlige profilen" diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml index 19e425aa2874..33466bcaa2f2 100644 --- a/core/res/res/values-ne/strings.xml +++ b/core/res/res/values-ne/strings.xml @@ -265,6 +265,16 @@ "अलर्टहरू" "खुद्रा बिक्री सम्बन्धी डेमो" "USB जडान" + + + + + + + + + + "सुरक्षित मोड" "एन्ड्रोइड प्रणाली" "व्यक्तिगत प्रोफाइलमा स्विच गर्नुहोस्" @@ -1288,7 +1298,7 @@ "सेट अप गर्न ट्याप गर्नुहोस्" "फाइल छान्नुहोस्" "कुनै फाइल छानिएको छैन" - "पुनःसेट गर्नु" + "रिसेट गर्नुहोस्" "पेस गर्नुहोस्" "कार मोड सक्षम पारियो।" "कार मोडबाट बाहिर निस्कन ट्याप गर्नुहोस्।" diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml index 4875b9feea33..c82219c01cee 100644 --- a/core/res/res/values-nl/strings.xml +++ b/core/res/res/values-nl/strings.xml @@ -265,6 +265,16 @@ "Meldingen" "Demo voor de detailhandel" "USB-verbinding" + + + + + + + + + + "Veilige modus" "Android-systeem" "Overschakelen naar persoonlijk profiel" diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml index 78a5517ac30a..5c606ae2b961 100644 --- a/core/res/res/values-pa/strings.xml +++ b/core/res/res/values-pa/strings.xml @@ -265,6 +265,16 @@ "ਸੁਚੇਤਨਾਵਾਂ" "ਪ੍ਰਚੂਨ ਸਟੋਰਾਂ ਲਈ ਡੈਮੋ" "USB ਕਨੈਕਸ਼ਨ" + + + + + + + + + + "ਸੁਰੱਖਿਅਤ ਮੋਡ" "Android System" "ਨਿੱਜੀ \'ਤੇ ਸਵਿੱਚ ਕਰੋ" diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml index 5f01dd46c4e3..7386f2d62cf0 100644 --- a/core/res/res/values-pl/strings.xml +++ b/core/res/res/values-pl/strings.xml @@ -271,6 +271,16 @@ "Alerty" "Tryb demo dla sklepów" "Połączenie USB" + + + + + + + + + + "Tryb awaryjny" "System Android" "Włącz profil osobisty" diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml index 05ac675b2c02..d5dc39502b48 100644 --- a/core/res/res/values-pt-rBR/strings.xml +++ b/core/res/res/values-pt-rBR/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demonstração na loja" "Conexão USB" + + + + + + + + + + "Modo de segurança" "Sistema Android" "Alternar para \"Pessoal\"" diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml index e78386e08a1e..1f297c2f01fe 100644 --- a/core/res/res/values-pt-rPT/strings.xml +++ b/core/res/res/values-pt-rPT/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demonstração para retalho" "Ligação USB" + + + + + + + + + + "Modo seguro" "Sistema Android" "Mudar para pessoal" diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml index 05ac675b2c02..d5dc39502b48 100644 --- a/core/res/res/values-pt/strings.xml +++ b/core/res/res/values-pt/strings.xml @@ -265,6 +265,16 @@ "Alertas" "Demonstração na loja" "Conexão USB" + + + + + + + + + + "Modo de segurança" "Sistema Android" "Alternar para \"Pessoal\"" diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml index 7785e72ba21d..3a2c38d2905e 100644 --- a/core/res/res/values-ro/strings.xml +++ b/core/res/res/values-ro/strings.xml @@ -268,6 +268,16 @@ "Alerte" "Demonstrație comercială" "Conexiune USB" + + + + + + + + + + "Mod sigur" "Sistemul Android" "Comutați la Personal" diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml index b84b808bd6b6..0bc71eb4c700 100644 --- a/core/res/res/values-ru/strings.xml +++ b/core/res/res/values-ru/strings.xml @@ -271,6 +271,16 @@ "Уведомления" "Деморежим для магазина" "USB-подключение" + + + + + + + + + + "Безопасный режим" "Система Android" "Перейти в личный профиль" diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml index 7b0478b33642..b7e695a863e2 100644 --- a/core/res/res/values-si/strings.xml +++ b/core/res/res/values-si/strings.xml @@ -265,6 +265,16 @@ "ඇඟවීම්" "සිල්ලර ආදර්ශනය" "USB සම්බන්ධතාවය" + + + + + + + + + + "ආරක්‍ෂිත ආකාරය" "Android පද්ධතිය" "පුද්ගලික වෙත මාරු වන්න" @@ -1610,7 +1620,7 @@ "ඔබගේ පරිපාලක මඟින් ස්ථාපනය කර ඇත" "ඔබගේ පරිපාලක මඟින් යාවත්කාලීන කර ඇත" "ඔබගේ පරිපාලක මඟින් මකා දමා ඇත" - "බැටරි ආයු කාලය වැඩිදියුණු කිරීමට උදවු කිරීමට, බැටරි සුරැකුම ඔබේ උපාංගයේ ක්‍රියාකාරීත්වය අඩුකරන අතර කම්පනය, පිහිටීම් සේවා, සහ බොහෝමයක් පසුබිම් දත්ත සීමා කරයි. ඔබ ඒවා විවෘත නොකරන්නේ නම් මිස ඊමේල්, පණිවිඩකරණය, සහ සමමුහුර්ත කිරීම මත රඳා පවතින වෙනත් යෙදුම් යාවත්කාලීන නොවිය හැකිය.\n\nඔබේ උපාංගය ආරෝපණය වන විට බැටරි සුරැකුම ස්වයංක්‍රියව අක්‍රිය වේ." + "බැටරි ආයු කාලය වැඩිදියුණු කිරීමට උදවු කිරීමට, බැටරි සුරැකුම ඔබේ උපාංගයේ ක්‍රියාකාරීත්වය අඩුකරන අතර කම්පනය, පිහිටීම් සේවා, සහ බොහෝමයක් පසුබිම් දත්ත සීමා කරයි. ඔබ ඒවා විවෘත නොකරන්නේ නම් මිස ඊ-තැපැල්, පණිවිඩකරණය, සහ සමමුහුර්ත කිරීම මත රඳා පවතින වෙනත් යෙදුම් යාවත්කාලීන නොවිය හැකිය.\n\nඔබේ උපාංගය ආරෝපණය වන විට බැටරි සුරැකුම ස්වයංක්‍රියව ක්‍රියාත්මක වේ." "දත්ත භාවිතය අඩු කිරීමට උදවු වීමට, දත්ත සුරැකුම සමහර යෙදුම් පසුබිමින් දත්ත යැවීම සහ ලබා ගැනීම වළක්වයි. ඔබ දැනට භාවිත කරන යෙදුමකට දත්ත වෙත පිවිසීමට හැකිය, නමුත් එසේ කරන්නේ කලාතුරකින් විය හැකිය. මෙයින් අදහස් වන්නේ, උදාහරණයක් ලෙස, එම රූප ඔබ ඒවාට තට්ටු කරන තෙක් සංදර්ශනය නොවන බවය." "දත්ත සුරැකුම ක්‍රියාත්මක කරන්නද?" "ක්‍රියාත්මක කරන්න" diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml index 8782dc9dcab4..018ea4e6eafe 100644 --- a/core/res/res/values-sk/strings.xml +++ b/core/res/res/values-sk/strings.xml @@ -271,6 +271,16 @@ "Upozornenia" "Predajná ukážka" "Pripojenie USB" + + + + + + + + + + "Núdzový režim" "Systém Android" "Prepnúť na osobný" diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml index d6643d740bb4..729612fb1571 100644 --- a/core/res/res/values-sl/strings.xml +++ b/core/res/res/values-sl/strings.xml @@ -271,6 +271,16 @@ "Opozorila" "Predstavitev za maloprodajo" "Povezava USB" + + + + + + + + + + "Varni način" "Sistem Android" "Preklop na osebni profil" diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml index 1bd2b7420cd6..563f4bd0d415 100644 --- a/core/res/res/values-sq/strings.xml +++ b/core/res/res/values-sq/strings.xml @@ -265,6 +265,16 @@ "Sinjalizimet" "Demonstrimi i shitjes me pakicë" "Lidhja USB" + + + + + + + + + + "Modaliteti i sigurisë" "Sistemi \"android\"" "Ndryshoje te \"Personale\"" diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml index 44abfb96329e..2d2cc708be23 100644 --- a/core/res/res/values-sr/strings.xml +++ b/core/res/res/values-sr/strings.xml @@ -268,6 +268,16 @@ "Обавештења" "Режим демонстрације за малопродајне објекте" "USB веза" + + + + + + + + + + "Безбедни режим" "Android систем" "Пређи на Лични профил" @@ -1630,7 +1640,7 @@ "Инсталирао је администратор" "Ажурирао је администратор" "Избрисао је администратор" - "Да би продужила време трајања батерије, уштеда батерије смањује перформансе уређаја и ограничава вибрацију, услуге локације и већину позадинских података. Имејл, размена порука и друге апликације које се ослањају на синхронизацију можда неће да се ажурирају ако их не отворите.\n\nУштеда батерије се аутоматски искључује када се уређај пуни." + "Да би продужила време трајања батерије, уштеда батерије смањује перформансе уређаја и ограничава вибрацију, услуге локације и већину позадинских података. Имејл, размена порука и друге апликације које се ослањају на синхронизацију неће се ажурирати док их не отворите.\n\nУштеда батерије се аутоматски искључује када се уређај пуни." "Да би се смањила потрошња података, Уштеда података спречава неке апликације да шаљу или примају податке у позадини. Апликација коју тренутно користите може да приступа подацима, али ће то чинити ређе. На пример, слике се неће приказивати док их не додирнете." "Укључити Уштеду података?" "Укључи" diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml index 7f3d212b6a47..c480df43cc96 100644 --- a/core/res/res/values-sv/strings.xml +++ b/core/res/res/values-sv/strings.xml @@ -265,6 +265,16 @@ "Varningar" "Demo för återförsäljare" "USB-anslutning" + + + + + + + + + + "Säkert läge" "Android-system" "Byt till din personliga profil" diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml index 52fa3a2ff576..cec75bca468a 100644 --- a/core/res/res/values-sw/strings.xml +++ b/core/res/res/values-sw/strings.xml @@ -263,6 +263,16 @@ "Arifa" "Onyesho la duka la rejareja" "Muunganisho wa USB" + + + + + + + + + + "Mtindo salama" "Mfumo wa Android" "Badili uweke wasifu wa Binafsi" @@ -1735,7 +1745,7 @@ "Badilisha iwe katika hali ya maandishi wakati wa kuweka muda." "Badilisha umbo liwe la saa ya mishale wakati wa kuweka muda." "Chaguo za kujaza otomatiki" - "Hifadhi kwa ajili ya Kujaza kiotomatiki" + "Hifadhi kwa ajili ya Kujaza Kiotomatiki" "Maudhui hayawezi kujazwa kiotomatiki" "Ungependa kuhifadhi kwenye <b>%1$s</b>?" "Ungependa kuhifadhi %1$s kwenye <b>%2$s</b>?" diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml index 18b097e2de84..7062e9834f89 100644 --- a/core/res/res/values-ta/strings.xml +++ b/core/res/res/values-ta/strings.xml @@ -265,6 +265,16 @@ "விழிப்பூட்டல்கள்" "விற்பனையாளர் டெமோ" "USB இணைப்பு" + + + + + + + + + + "பாதுகாப்பு பயன்முறை" "Android அமைப்பு" "தனிப்பட்ட சுயவிவரத்திற்கு மாறு" diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml index d79e52f32ab5..31e272153377 100644 --- a/core/res/res/values-te/strings.xml +++ b/core/res/res/values-te/strings.xml @@ -265,6 +265,16 @@ "హెచ్చరికలు" "రిటైల్ డెమో" "USB కనెక్షన్" + + + + + + + + + + "సురక్షిత మోడ్" "Android సిస్టమ్" "వ్యక్తిగతానికి మార్చు" diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml index 2179f70e56e5..fd7158ffa554 100644 --- a/core/res/res/values-th/strings.xml +++ b/core/res/res/values-th/strings.xml @@ -265,6 +265,16 @@ "การแจ้งเตือน" "การสาธิตสำหรับผู้ค้าปลีก" "การเชื่อมต่อ USB" + + + + + + + + + + "โหมดปลอดภัย" "ระบบ Android" "เปลี่ยนไปใช้โปรไฟล์ส่วนตัว" diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml index 90e57c1e982c..e58f62ff0d10 100644 --- a/core/res/res/values-tl/strings.xml +++ b/core/res/res/values-tl/strings.xml @@ -265,6 +265,16 @@ "Mga Alerto" "Retail demo" "Koneksyon ng USB" + + + + + + + + + + "Safe mode" "Android System" "Lumipat sa Personal" @@ -277,7 +287,7 @@ "i-access ang iyong kalendaryo" "SMS" "magpadala at tumingin ng mga mensaheng SMS" - "Imbakan" + "Storage" "i-access ang mga larawan, media at file sa iyong device" "Mikropono" "mag-record ng audio" @@ -575,7 +585,7 @@ "Itakda ang pandaigdigang proxy ng device na gagamitin habang naka-enable ang patakaran. Ang may-ari ng device lang ang makakapagtakda sa pandaigdigang proxy." "Itakda screen lock password expiration" "Baguhin kung gaano kadalas dapat palitan ang password, PIN o pattern sa screen lock." - "Itakda pag-encrypt ng imbakan" + "Itakda pag-encrypt ng storage" "Hilinging naka-encrypt ang nakaimbak na data ng app." "Huwag paganahin mga camera" "Pigilan ang paggamit sa lahat ng camera ng device." diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml index 5cc96b6f386e..e39543596c96 100644 --- a/core/res/res/values-tr/strings.xml +++ b/core/res/res/values-tr/strings.xml @@ -265,6 +265,16 @@ "Uyarılar" "Mağaza demo" "USB bağlantısı" + + + + + + + + + + "Güvenli mod" "Android Sistemi" "Kişisel Profile Geç" diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml index 0fb047adb2af..09cec2a54af2 100644 --- a/core/res/res/values-uk/strings.xml +++ b/core/res/res/values-uk/strings.xml @@ -271,6 +271,16 @@ "Сповіщення" "Демо-режим для роздрібної торгівлі" "З’єднання USB" + + + + + + + + + + "Безп. режим" "Система Android" "Перейти в особистий профіль" diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml index 5c73b69ed71b..225faa65cfc2 100644 --- a/core/res/res/values-ur/strings.xml +++ b/core/res/res/values-ur/strings.xml @@ -265,6 +265,16 @@ "الرٹس" "ریٹیل ڈیمو" "‏USB کنکشن" + + + + + + + + + + "حفاظتی وضع" "‏Android سسٹم" "ذاتی پر سوئچ کریں" diff --git a/core/res/res/values-uz/strings.xml b/core/res/res/values-uz/strings.xml index 1f231496837f..0e7d4ffa370a 100644 --- a/core/res/res/values-uz/strings.xml +++ b/core/res/res/values-uz/strings.xml @@ -265,6 +265,16 @@ "Ogohlantirishlar" "Demo rejim" "USB orqali ulanish" + + + + + + + + + + "Xavfsiz usul" "Android tizimi" "Shaxsiy profilga o‘tish" @@ -722,7 +732,7 @@ "Televizorda SIM karta yo‘q." "Telefoningizda SIM karta yo‘q." "SIM kartani soling." - "SIM karta solinmagan yoki uni o‘qib bo‘lmaydi. SIM kartani soling." + "SIM karta solinmagan yoki u yaroqsiz. SIM kartani soling." "Foydalanib bo‘lmaydigan SIM karta." "SIM kartangiz butunlay bloklab qo‘yilgan.\n Yangi SIM karta olish uchun aloqa operatoringiz bilan bog‘laning." "Avvalgi musiqa" @@ -1174,7 +1184,7 @@ "USB jihozga ulangan" "Boshqa parametrlarini ko‘rish uchun bosing." "USB orqali nosozliklarni tuzatish" - "O‘chirib qo‘yish uchun bu yerga bosing." + "Faolsizlantirish uchun bu yerga bosing." "Xatoliklar hisoboti olinmoqda…" diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml index fa103cccd9c4..f2ba67166230 100644 --- a/core/res/res/values-vi/strings.xml +++ b/core/res/res/values-vi/strings.xml @@ -265,6 +265,16 @@ "Cảnh báo" "Giới thiệu bán lẻ" "Kết nối USB" + + + + + + + + + + "Chế độ an toàn" "Hệ thống Android" "Chuyển sang Cá nhân" diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml index dc66d6fec2fe..6e35e3f9cbce 100644 --- a/core/res/res/values-zh-rCN/strings.xml +++ b/core/res/res/values-zh-rCN/strings.xml @@ -265,6 +265,16 @@ "提醒" "零售演示模式" "USB 连接" + + + + + + + + + + "安全模式" "Android 系统" "切换到“个人”" diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml index 63cf0b1ae639..74f498725b47 100644 --- a/core/res/res/values-zh-rHK/strings.xml +++ b/core/res/res/values-zh-rHK/strings.xml @@ -72,8 +72,8 @@ "本機號碼" "連接線識別功能" "連接線識別限制" - "來電轉接" - "來電待接" + "來電轉駁" + "來電等候" "通話限制" "密碼更改" "更改 PIN" @@ -100,13 +100,13 @@ "無法連接網絡" "如要改善接收品質,請前往 [系統] > [網絡與互聯網] > [流動網絡] > [偏好的網絡類型],然後變更所選的網絡類型。" "通知" - "來電轉接" + "來電轉駁" "緊急回撥模式" "流動數據通知" "短訊" "留言訊息" "Wi-Fi 通話" - "對方曾要求 TTY 模式 (FULL)" + "對方曾要求 TTY 完整模式" "對方曾要求 TTY 模式 (HCO)" "對方曾要求 TTY 模式 (VCO)" "對方曾要求 TTY 模式 (OFF)" @@ -265,6 +265,16 @@ "通知" "零售示範" "USB 連線" + + + + + + + + + + "安全模式" "Android 系統" "切換至個人設定檔" diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml index 97962cf657ad..87e98dd381f2 100644 --- a/core/res/res/values-zh-rTW/strings.xml +++ b/core/res/res/values-zh-rTW/strings.xml @@ -265,6 +265,16 @@ "快訊" "零售商示範模式" "USB 連線" + + + + + + + + + + "安全模式" "Android 系統" "切換至個人設定檔" diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml index bcad869edfa1..a656e6ce1aee 100644 --- a/core/res/res/values-zu/strings.xml +++ b/core/res/res/values-zu/strings.xml @@ -265,6 +265,16 @@ "Izexwayiso" "Idemo yokuthenga" "Ukuxhumeka kwe-USB" + + + + + + + + + + "Imodi ephephile" "Uhlelo lwe-Android" "Shintshela komuntu siqu" -- GitLab From 55089e94b35f09d726ad231754410126f5864a8d Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Mon, 1 May 2017 16:11:18 -0700 Subject: [PATCH 60/66] Import translations. DO NOT MERGE Change-Id: I0f5bc7edee755c90d756e0fdbcda4f7093292bea Auto-generated-cl: translation import --- packages/BackupRestoreConfirmation/res/values-gl/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/BackupRestoreConfirmation/res/values-gl/strings.xml b/packages/BackupRestoreConfirmation/res/values-gl/strings.xml index c973a31fd71f..0a12aa7364ff 100644 --- a/packages/BackupRestoreConfirmation/res/values-gl/strings.xml +++ b/packages/BackupRestoreConfirmation/res/values-gl/strings.xml @@ -24,10 +24,10 @@ "Solicitouse unha restauración de todos os datos desde un ordenador de escritorio conectado. Queres permitir esta operación?\n\nSe non o solicitaches ti, non permitas que se realice. Substituiranse todos os datos que conteña o dispositivo." "Restaurar os meus datos" "Non restaurar" - "Insire o contrasinal de copia de seguranza actual a continuación:" + "Insire o contrasinal da copia de seguranza actual a continuación:" "Insire o contrasinal de encriptación do teu dispositivo a continuación." "Insire o contrasinal de encriptación do dispositivo a continuación. Tamén se usará para encriptar o arquivo de copia de seguranza." - "Insire un contrasinal para encriptar os datos da copia de seguranza completa. Se queda en branco este campo, usarase o contrasinal de copia de seguranza actual." + "Insire un contrasinal para encriptar os datos da copia de seguranza completa. Se queda en branco este campo, usarase o contrasinal da copia de seguranza actual." "Se queres encriptar os datos da copia de seguranza completa, insire un contrasinal a continuación:" "Como o teu dispositivo está cifrado, debes cifrar a túa copia de seguranza. Introduce un contrasinal a continuación:" "Se os datos de restauración están encriptados, insire o contrasinal a continuación:" -- GitLab From 640a135e8abdd49de3bf43f7c1c7d882406b0bc1 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Mon, 1 May 2017 16:11:14 -0700 Subject: [PATCH 61/66] Make auth fill UI size sane size Now the width and height are capped to 0.9 of the screen dimensions. The height is also adjusted as needed by the popup window positioning logic. Test: manual bug:36660292 Change-Id: I54d032f4e9b9b8fae6f98846c470a1455babcb68 --- core/res/res/values/attrs.xml | 6 +++ core/res/res/values/dimens.xml | 4 ++ core/res/res/values/symbols.xml | 5 +- core/res/res/values/themes.xml | 4 ++ .../android/server/autofill/ui/FillUi.java | 46 +++++++++++++++---- 5 files changed, 56 insertions(+), 9 deletions(-) diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index c4215141448d..cfe25b33a4c3 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -63,6 +63,12 @@ + + + + + + diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index ef6c21fd90c0..ece0e821060c 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -536,4 +536,8 @@ 20dp 120dp 800dp + + + 90% + diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 1d2bc1953fd2..1966f6a89412 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -239,7 +239,8 @@ - + + @@ -2906,6 +2907,7 @@ + @@ -3007,4 +3009,5 @@ + diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index e8fbf348c371..383ae5d577ce 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -449,6 +449,10 @@ please see themes_device_defaults.xml. @drawable/tooltip_frame @color/bright_foreground_light @color/tooltip_background_light + + + @dimen/autofill_dataset_picker_max_size + @dimen/autofill_dataset_picker_max_size diff --git a/services/autofill/java/com/android/server/autofill/ui/FillUi.java b/services/autofill/java/com/android/server/autofill/ui/FillUi.java index fa95e036eae5..dd297a645436 100644 --- a/services/autofill/java/com/android/server/autofill/ui/FillUi.java +++ b/services/autofill/java/com/android/server/autofill/ui/FillUi.java @@ -23,10 +23,12 @@ import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.IntentSender; +import android.graphics.Point; import android.graphics.Rect; import android.service.autofill.Dataset; import android.service.autofill.FillResponse; import android.util.Slog; +import android.util.TypedValue; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; @@ -52,6 +54,8 @@ final class FillUi { private static final int VISIBLE_OPTIONS_MAX_COUNT = 3; + private static final TypedValue sTempTypedValue = new TypedValue(); + interface Callback { void onResponsePicked(@NonNull FillResponse response); void onDatasetPicked(@NonNull Dataset dataset); @@ -63,9 +67,13 @@ final class FillUi { void startIntentSender(IntentSender intentSender); } + private final @NonNull Point mTempPoint = new Point(); + private final @NonNull AutofillWindowPresenter mWindowPresenter = new AutofillWindowPresenter(); + private final @NonNull Context mContext; + private final @NonNull AnchoredWindow mWindow; private final @NonNull Callback mCallback; @@ -84,6 +92,7 @@ final class FillUi { FillUi(@NonNull Context context, @NonNull FillResponse response, @NonNull AutofillId focusedViewId, @NonNull @Nullable String filterText, @NonNull Callback callback) { + mContext = context; mCallback = callback; final LayoutInflater inflater = LayoutInflater.from(context); @@ -115,13 +124,18 @@ final class FillUi { mWindow = null; return; } - final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); - final int heightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); - content.measure(widthMeasureSpec, heightMeasureSpec); + + Point maxSize = mTempPoint; + resolveMaxWindowSize(context, maxSize); + final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(maxSize.x, + MeasureSpec.AT_MOST); + final int heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxSize.y, + MeasureSpec.AT_MOST); + + decor.measure(widthMeasureSpec, heightMeasureSpec); decor.setOnClickListener(v -> mCallback.onResponsePicked(response)); - // TODO(b/37567439): temporary limiting maximum height and minimum width - mContentWidth = Math.max(content.getMeasuredWidth(), 1000); - mContentHeight = Math.min(content.getMeasuredHeight(), 500); + mContentWidth = content.getMeasuredWidth(); + mContentHeight = content.getMeasuredHeight(); mWindow = new AnchoredWindow(decor); mCallback.requestShowFillUi(mContentWidth, mContentHeight, mWindowPresenter); @@ -245,6 +259,9 @@ final class FillUi { return changed; } + Point maxSize = mTempPoint; + resolveMaxWindowSize(mContext, maxSize); + mContentWidth = 0; mContentHeight = 0; @@ -254,12 +271,14 @@ final class FillUi { for (int i = 0; i < itemCount; i++) { View view = mAdapter.getItem(i).getView(); view.measure(widthMeasureSpec, heightMeasureSpec); - final int newContentWidth = Math.max(mContentWidth, view.getMeasuredWidth()); + final int clampedMeasuredWidth = Math.min(view.getMeasuredWidth(), maxSize.x); + final int newContentWidth = Math.max(mContentWidth, clampedMeasuredWidth); if (newContentWidth != mContentWidth) { mContentWidth = newContentWidth; changed = true; } - final int newContentHeight = mContentHeight + view.getMeasuredHeight(); + final int clampedMeasuredHeight = Math.min(view.getMeasuredHeight(), maxSize.y); + final int newContentHeight = mContentHeight + clampedMeasuredHeight; if (newContentHeight != mContentHeight) { mContentHeight = newContentHeight; changed = true; @@ -274,6 +293,17 @@ final class FillUi { } } + private static void resolveMaxWindowSize(Context context, Point outPoint) { + context.getDisplay().getSize(outPoint); + TypedValue typedValue = sTempTypedValue; + context.getTheme().resolveAttribute(R.attr.autofillDatasetPickerMaxWidth, + typedValue, true); + outPoint.x = (int) typedValue.getFraction(outPoint.x, outPoint.x); + context.getTheme().resolveAttribute(R.attr.autofillDatasetPickerMaxHeight, + typedValue, true); + outPoint.y = (int) typedValue.getFraction(outPoint.y, outPoint.y); + } + private static class ViewItem { private final String mValue; private final Dataset mDataset; -- GitLab From a9f9889218ac972706830440990a59cbee685976 Mon Sep 17 00:00:00 2001 From: Peter Qiu Date: Mon, 1 May 2017 15:59:53 -0700 Subject: [PATCH 62/66] hotspot2: hide Release 2 APIs Bug: 37514629 Test: builds Change-Id: Idcd684cf9846791cb02ae0f74ec35ff4850666f1 --- api/current.txt | 118 ------------------ api/system-current.txt | 118 ------------------ api/test-current.txt | 118 ------------------ .../wifi/hotspot2/PasspointConfiguration.java | 72 +++++++++++ .../net/wifi/hotspot2/pps/Credential.java | 36 ++++++ .../android/net/wifi/hotspot2/pps/HomeSp.java | 30 +++++ .../android/net/wifi/hotspot2/pps/Policy.java | 2 + .../wifi/hotspot2/pps/UpdateParameter.java | 2 + 8 files changed, 142 insertions(+), 354 deletions(-) diff --git a/api/current.txt b/api/current.txt index 2b09a177d4a3..18756d6c427d 100644 --- a/api/current.txt +++ b/api/current.txt @@ -26754,33 +26754,9 @@ package android.net.wifi.hotspot2 { ctor public PasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration); method public int describeContents(); method public android.net.wifi.hotspot2.pps.Credential getCredential(); - method public int getCredentialPriority(); method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp(); - method public android.net.wifi.hotspot2.pps.Policy getPolicy(); - method public long getSubscriptionCreationTimeInMillis(); - method public long getSubscriptionExpirationTimeInMillis(); - method public java.lang.String getSubscriptionType(); - method public android.net.wifi.hotspot2.pps.UpdateParameter getSubscriptionUpdate(); - method public java.util.Map getTrustRootCertList(); - method public int getUpdateIdentifier(); - method public long getUsageLimitDataLimit(); - method public long getUsageLimitStartTimeInMillis(); - method public long getUsageLimitTimeLimitInMinutes(); - method public long getUsageLimitUsageTimePeriodInMinutes(); method public void setCredential(android.net.wifi.hotspot2.pps.Credential); - method public void setCredentialPriority(int); method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp); - method public void setPolicy(android.net.wifi.hotspot2.pps.Policy); - method public void setSubscriptionCreationTimeInMillis(long); - method public void setSubscriptionExpirationTimeInMillis(long); - method public void setSubscriptionType(java.lang.String); - method public void setSubscriptionUpdate(android.net.wifi.hotspot2.pps.UpdateParameter); - method public void setTrustRootCertList(java.util.Map); - method public void setUpdateIdentifier(int); - method public void setUsageLimitDataLimit(long); - method public void setUsageLimitStartTimeInMillis(long); - method public void setUsageLimitTimeLimitInMinutes(long); - method public void setUsageLimitUsageTimePeriodInMinutes(long); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } @@ -26803,21 +26779,15 @@ package android.net.wifi.hotspot2.pps { method public int describeContents(); method public java.security.cert.X509Certificate getCaCertificate(); method public android.net.wifi.hotspot2.pps.Credential.CertificateCredential getCertCredential(); - method public boolean getCheckAaaServerCertStatus(); method public java.security.cert.X509Certificate[] getClientCertificateChain(); method public java.security.PrivateKey getClientPrivateKey(); - method public long getCreationTimeInMillis(); - method public long getExpirationTimeInMillis(); method public java.lang.String getRealm(); method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential(); method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential(); method public void setCaCertificate(java.security.cert.X509Certificate); method public void setCertCredential(android.net.wifi.hotspot2.pps.Credential.CertificateCredential); - method public void setCheckAaaServerCertStatus(boolean); method public void setClientCertificateChain(java.security.cert.X509Certificate[]); method public void setClientPrivateKey(java.security.PrivateKey); - method public void setCreationTimeInMillis(long); - method public void setExpirationTimeInMillis(long); method public void setRealm(java.lang.String); method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential); method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential); @@ -26853,19 +26823,13 @@ package android.net.wifi.hotspot2.pps { ctor public Credential.UserCredential(); ctor public Credential.UserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential); method public int describeContents(); - method public boolean getAbleToShare(); method public int getEapType(); - method public boolean getMachineManaged(); method public java.lang.String getNonEapInnerMethod(); method public java.lang.String getPassword(); - method public java.lang.String getSoftTokenApp(); method public java.lang.String getUsername(); - method public void setAbleToShare(boolean); method public void setEapType(int); - method public void setMachineManaged(boolean); method public void setNonEapInnerMethod(java.lang.String); method public void setPassword(java.lang.String); - method public void setSoftTokenApp(java.lang.String); method public void setUsername(java.lang.String); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; @@ -26877,96 +26841,14 @@ package android.net.wifi.hotspot2.pps { method public int describeContents(); method public java.lang.String getFqdn(); method public java.lang.String getFriendlyName(); - method public java.util.Map getHomeNetworkIds(); - method public java.lang.String getIconUrl(); - method public long[] getMatchAllOis(); - method public long[] getMatchAnyOis(); - method public java.lang.String[] getOtherHomePartners(); method public long[] getRoamingConsortiumOis(); method public void setFqdn(java.lang.String); method public void setFriendlyName(java.lang.String); - method public void setHomeNetworkIds(java.util.Map); - method public void setIconUrl(java.lang.String); - method public void setMatchAllOis(long[]); - method public void setMatchAnyOis(long[]); - method public void setOtherHomePartners(java.lang.String[]); method public void setRoamingConsortiumOis(long[]); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } - public final class Policy implements android.os.Parcelable { - ctor public Policy(); - ctor public Policy(android.net.wifi.hotspot2.pps.Policy); - method public int describeContents(); - method public java.lang.String[] getExcludedSsidList(); - method public int getMaximumBssLoadValue(); - method public long getMinHomeDownlinkBandwidth(); - method public long getMinHomeUplinkBandwidth(); - method public long getMinRoamingDownlinkBandwidth(); - method public long getMinRoamingUplinkBandwidth(); - method public android.net.wifi.hotspot2.pps.UpdateParameter getPolicyUpdate(); - method public java.util.List getPreferredRoamingPartnerList(); - method public java.util.Map getRequiredProtoPortMap(); - method public void setExcludedSsidList(java.lang.String[]); - method public void setMaximumBssLoadValue(int); - method public void setMinHomeDownlinkBandwidth(long); - method public void setMinHomeUplinkBandwidth(long); - method public void setMinRoamingDownlinkBandwidth(long); - method public void setMinRoamingUplinkBandwidth(long); - method public void setPolicyUpdate(android.net.wifi.hotspot2.pps.UpdateParameter); - method public void setPreferredRoamingPartnerList(java.util.List); - method public void setRequiredProtoPortMap(java.util.Map); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - - public static final class Policy.RoamingPartner implements android.os.Parcelable { - ctor public Policy.RoamingPartner(); - ctor public Policy.RoamingPartner(android.net.wifi.hotspot2.pps.Policy.RoamingPartner); - method public int describeContents(); - method public java.lang.String getCountries(); - method public java.lang.String getFqdn(); - method public boolean getFqdnExactMatch(); - method public int getPriority(); - method public void setCountries(java.lang.String); - method public void setFqdn(java.lang.String); - method public void setFqdnExactMatch(boolean); - method public void setPriority(int); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - - public final class UpdateParameter implements android.os.Parcelable { - ctor public UpdateParameter(); - ctor public UpdateParameter(android.net.wifi.hotspot2.pps.UpdateParameter); - method public int describeContents(); - method public java.lang.String getBase64EncodedPassword(); - method public java.lang.String getRestriction(); - method public java.lang.String getServerUri(); - method public byte[] getTrustRootCertSha256Fingerprint(); - method public java.lang.String getTrustRootCertUrl(); - method public long getUpdateIntervalInMinutes(); - method public java.lang.String getUpdateMethod(); - method public java.lang.String getUsername(); - method public void setBase64EncodedPassword(java.lang.String); - method public void setRestriction(java.lang.String); - method public void setServerUri(java.lang.String); - method public void setTrustRootCertSha256Fingerprint(byte[]); - method public void setTrustRootCertUrl(java.lang.String); - method public void setUpdateIntervalInMinutes(long); - method public void setUpdateMethod(java.lang.String); - method public void setUsername(java.lang.String); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - field public static final long UPDATE_CHECK_INTERVAL_NEVER = 4294967295L; // 0xffffffffL - field public static final java.lang.String UPDATE_METHOD_OMADM = "OMA-DM-ClientInitiated"; - field public static final java.lang.String UPDATE_METHOD_SSP = "SSP-ClientInitiated"; - field public static final java.lang.String UPDATE_RESTRICTION_HOMESP = "HomeSP"; - field public static final java.lang.String UPDATE_RESTRICTION_ROAMING_PARTNER = "RoamingPartner"; - field public static final java.lang.String UPDATE_RESTRICTION_UNRESTRICTED = "Unrestricted"; - } - } package android.net.wifi.p2p { diff --git a/api/system-current.txt b/api/system-current.txt index da9425c1cb69..a6d32913404c 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -29461,33 +29461,9 @@ package android.net.wifi.hotspot2 { ctor public PasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration); method public int describeContents(); method public android.net.wifi.hotspot2.pps.Credential getCredential(); - method public int getCredentialPriority(); method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp(); - method public android.net.wifi.hotspot2.pps.Policy getPolicy(); - method public long getSubscriptionCreationTimeInMillis(); - method public long getSubscriptionExpirationTimeInMillis(); - method public java.lang.String getSubscriptionType(); - method public android.net.wifi.hotspot2.pps.UpdateParameter getSubscriptionUpdate(); - method public java.util.Map getTrustRootCertList(); - method public int getUpdateIdentifier(); - method public long getUsageLimitDataLimit(); - method public long getUsageLimitStartTimeInMillis(); - method public long getUsageLimitTimeLimitInMinutes(); - method public long getUsageLimitUsageTimePeriodInMinutes(); method public void setCredential(android.net.wifi.hotspot2.pps.Credential); - method public void setCredentialPriority(int); method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp); - method public void setPolicy(android.net.wifi.hotspot2.pps.Policy); - method public void setSubscriptionCreationTimeInMillis(long); - method public void setSubscriptionExpirationTimeInMillis(long); - method public void setSubscriptionType(java.lang.String); - method public void setSubscriptionUpdate(android.net.wifi.hotspot2.pps.UpdateParameter); - method public void setTrustRootCertList(java.util.Map); - method public void setUpdateIdentifier(int); - method public void setUsageLimitDataLimit(long); - method public void setUsageLimitStartTimeInMillis(long); - method public void setUsageLimitTimeLimitInMinutes(long); - method public void setUsageLimitUsageTimePeriodInMinutes(long); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } @@ -29510,21 +29486,15 @@ package android.net.wifi.hotspot2.pps { method public int describeContents(); method public java.security.cert.X509Certificate getCaCertificate(); method public android.net.wifi.hotspot2.pps.Credential.CertificateCredential getCertCredential(); - method public boolean getCheckAaaServerCertStatus(); method public java.security.cert.X509Certificate[] getClientCertificateChain(); method public java.security.PrivateKey getClientPrivateKey(); - method public long getCreationTimeInMillis(); - method public long getExpirationTimeInMillis(); method public java.lang.String getRealm(); method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential(); method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential(); method public void setCaCertificate(java.security.cert.X509Certificate); method public void setCertCredential(android.net.wifi.hotspot2.pps.Credential.CertificateCredential); - method public void setCheckAaaServerCertStatus(boolean); method public void setClientCertificateChain(java.security.cert.X509Certificate[]); method public void setClientPrivateKey(java.security.PrivateKey); - method public void setCreationTimeInMillis(long); - method public void setExpirationTimeInMillis(long); method public void setRealm(java.lang.String); method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential); method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential); @@ -29560,19 +29530,13 @@ package android.net.wifi.hotspot2.pps { ctor public Credential.UserCredential(); ctor public Credential.UserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential); method public int describeContents(); - method public boolean getAbleToShare(); method public int getEapType(); - method public boolean getMachineManaged(); method public java.lang.String getNonEapInnerMethod(); method public java.lang.String getPassword(); - method public java.lang.String getSoftTokenApp(); method public java.lang.String getUsername(); - method public void setAbleToShare(boolean); method public void setEapType(int); - method public void setMachineManaged(boolean); method public void setNonEapInnerMethod(java.lang.String); method public void setPassword(java.lang.String); - method public void setSoftTokenApp(java.lang.String); method public void setUsername(java.lang.String); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; @@ -29584,96 +29548,14 @@ package android.net.wifi.hotspot2.pps { method public int describeContents(); method public java.lang.String getFqdn(); method public java.lang.String getFriendlyName(); - method public java.util.Map getHomeNetworkIds(); - method public java.lang.String getIconUrl(); - method public long[] getMatchAllOis(); - method public long[] getMatchAnyOis(); - method public java.lang.String[] getOtherHomePartners(); method public long[] getRoamingConsortiumOis(); method public void setFqdn(java.lang.String); method public void setFriendlyName(java.lang.String); - method public void setHomeNetworkIds(java.util.Map); - method public void setIconUrl(java.lang.String); - method public void setMatchAllOis(long[]); - method public void setMatchAnyOis(long[]); - method public void setOtherHomePartners(java.lang.String[]); method public void setRoamingConsortiumOis(long[]); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } - public final class Policy implements android.os.Parcelable { - ctor public Policy(); - ctor public Policy(android.net.wifi.hotspot2.pps.Policy); - method public int describeContents(); - method public java.lang.String[] getExcludedSsidList(); - method public int getMaximumBssLoadValue(); - method public long getMinHomeDownlinkBandwidth(); - method public long getMinHomeUplinkBandwidth(); - method public long getMinRoamingDownlinkBandwidth(); - method public long getMinRoamingUplinkBandwidth(); - method public android.net.wifi.hotspot2.pps.UpdateParameter getPolicyUpdate(); - method public java.util.List getPreferredRoamingPartnerList(); - method public java.util.Map getRequiredProtoPortMap(); - method public void setExcludedSsidList(java.lang.String[]); - method public void setMaximumBssLoadValue(int); - method public void setMinHomeDownlinkBandwidth(long); - method public void setMinHomeUplinkBandwidth(long); - method public void setMinRoamingDownlinkBandwidth(long); - method public void setMinRoamingUplinkBandwidth(long); - method public void setPolicyUpdate(android.net.wifi.hotspot2.pps.UpdateParameter); - method public void setPreferredRoamingPartnerList(java.util.List); - method public void setRequiredProtoPortMap(java.util.Map); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - - public static final class Policy.RoamingPartner implements android.os.Parcelable { - ctor public Policy.RoamingPartner(); - ctor public Policy.RoamingPartner(android.net.wifi.hotspot2.pps.Policy.RoamingPartner); - method public int describeContents(); - method public java.lang.String getCountries(); - method public java.lang.String getFqdn(); - method public boolean getFqdnExactMatch(); - method public int getPriority(); - method public void setCountries(java.lang.String); - method public void setFqdn(java.lang.String); - method public void setFqdnExactMatch(boolean); - method public void setPriority(int); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - - public final class UpdateParameter implements android.os.Parcelable { - ctor public UpdateParameter(); - ctor public UpdateParameter(android.net.wifi.hotspot2.pps.UpdateParameter); - method public int describeContents(); - method public java.lang.String getBase64EncodedPassword(); - method public java.lang.String getRestriction(); - method public java.lang.String getServerUri(); - method public byte[] getTrustRootCertSha256Fingerprint(); - method public java.lang.String getTrustRootCertUrl(); - method public long getUpdateIntervalInMinutes(); - method public java.lang.String getUpdateMethod(); - method public java.lang.String getUsername(); - method public void setBase64EncodedPassword(java.lang.String); - method public void setRestriction(java.lang.String); - method public void setServerUri(java.lang.String); - method public void setTrustRootCertSha256Fingerprint(byte[]); - method public void setTrustRootCertUrl(java.lang.String); - method public void setUpdateIntervalInMinutes(long); - method public void setUpdateMethod(java.lang.String); - method public void setUsername(java.lang.String); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - field public static final long UPDATE_CHECK_INTERVAL_NEVER = 4294967295L; // 0xffffffffL - field public static final java.lang.String UPDATE_METHOD_OMADM = "OMA-DM-ClientInitiated"; - field public static final java.lang.String UPDATE_METHOD_SSP = "SSP-ClientInitiated"; - field public static final java.lang.String UPDATE_RESTRICTION_HOMESP = "HomeSP"; - field public static final java.lang.String UPDATE_RESTRICTION_ROAMING_PARTNER = "RoamingPartner"; - field public static final java.lang.String UPDATE_RESTRICTION_UNRESTRICTED = "Unrestricted"; - } - } package android.net.wifi.p2p { diff --git a/api/test-current.txt b/api/test-current.txt index ed9acc09f1b8..3133b8412628 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -26862,33 +26862,9 @@ package android.net.wifi.hotspot2 { ctor public PasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration); method public int describeContents(); method public android.net.wifi.hotspot2.pps.Credential getCredential(); - method public int getCredentialPriority(); method public android.net.wifi.hotspot2.pps.HomeSp getHomeSp(); - method public android.net.wifi.hotspot2.pps.Policy getPolicy(); - method public long getSubscriptionCreationTimeInMillis(); - method public long getSubscriptionExpirationTimeInMillis(); - method public java.lang.String getSubscriptionType(); - method public android.net.wifi.hotspot2.pps.UpdateParameter getSubscriptionUpdate(); - method public java.util.Map getTrustRootCertList(); - method public int getUpdateIdentifier(); - method public long getUsageLimitDataLimit(); - method public long getUsageLimitStartTimeInMillis(); - method public long getUsageLimitTimeLimitInMinutes(); - method public long getUsageLimitUsageTimePeriodInMinutes(); method public void setCredential(android.net.wifi.hotspot2.pps.Credential); - method public void setCredentialPriority(int); method public void setHomeSp(android.net.wifi.hotspot2.pps.HomeSp); - method public void setPolicy(android.net.wifi.hotspot2.pps.Policy); - method public void setSubscriptionCreationTimeInMillis(long); - method public void setSubscriptionExpirationTimeInMillis(long); - method public void setSubscriptionType(java.lang.String); - method public void setSubscriptionUpdate(android.net.wifi.hotspot2.pps.UpdateParameter); - method public void setTrustRootCertList(java.util.Map); - method public void setUpdateIdentifier(int); - method public void setUsageLimitDataLimit(long); - method public void setUsageLimitStartTimeInMillis(long); - method public void setUsageLimitTimeLimitInMinutes(long); - method public void setUsageLimitUsageTimePeriodInMinutes(long); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } @@ -26911,21 +26887,15 @@ package android.net.wifi.hotspot2.pps { method public int describeContents(); method public java.security.cert.X509Certificate getCaCertificate(); method public android.net.wifi.hotspot2.pps.Credential.CertificateCredential getCertCredential(); - method public boolean getCheckAaaServerCertStatus(); method public java.security.cert.X509Certificate[] getClientCertificateChain(); method public java.security.PrivateKey getClientPrivateKey(); - method public long getCreationTimeInMillis(); - method public long getExpirationTimeInMillis(); method public java.lang.String getRealm(); method public android.net.wifi.hotspot2.pps.Credential.SimCredential getSimCredential(); method public android.net.wifi.hotspot2.pps.Credential.UserCredential getUserCredential(); method public void setCaCertificate(java.security.cert.X509Certificate); method public void setCertCredential(android.net.wifi.hotspot2.pps.Credential.CertificateCredential); - method public void setCheckAaaServerCertStatus(boolean); method public void setClientCertificateChain(java.security.cert.X509Certificate[]); method public void setClientPrivateKey(java.security.PrivateKey); - method public void setCreationTimeInMillis(long); - method public void setExpirationTimeInMillis(long); method public void setRealm(java.lang.String); method public void setSimCredential(android.net.wifi.hotspot2.pps.Credential.SimCredential); method public void setUserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential); @@ -26961,19 +26931,13 @@ package android.net.wifi.hotspot2.pps { ctor public Credential.UserCredential(); ctor public Credential.UserCredential(android.net.wifi.hotspot2.pps.Credential.UserCredential); method public int describeContents(); - method public boolean getAbleToShare(); method public int getEapType(); - method public boolean getMachineManaged(); method public java.lang.String getNonEapInnerMethod(); method public java.lang.String getPassword(); - method public java.lang.String getSoftTokenApp(); method public java.lang.String getUsername(); - method public void setAbleToShare(boolean); method public void setEapType(int); - method public void setMachineManaged(boolean); method public void setNonEapInnerMethod(java.lang.String); method public void setPassword(java.lang.String); - method public void setSoftTokenApp(java.lang.String); method public void setUsername(java.lang.String); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; @@ -26985,96 +26949,14 @@ package android.net.wifi.hotspot2.pps { method public int describeContents(); method public java.lang.String getFqdn(); method public java.lang.String getFriendlyName(); - method public java.util.Map getHomeNetworkIds(); - method public java.lang.String getIconUrl(); - method public long[] getMatchAllOis(); - method public long[] getMatchAnyOis(); - method public java.lang.String[] getOtherHomePartners(); method public long[] getRoamingConsortiumOis(); method public void setFqdn(java.lang.String); method public void setFriendlyName(java.lang.String); - method public void setHomeNetworkIds(java.util.Map); - method public void setIconUrl(java.lang.String); - method public void setMatchAllOis(long[]); - method public void setMatchAnyOis(long[]); - method public void setOtherHomePartners(java.lang.String[]); method public void setRoamingConsortiumOis(long[]); method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator CREATOR; } - public final class Policy implements android.os.Parcelable { - ctor public Policy(); - ctor public Policy(android.net.wifi.hotspot2.pps.Policy); - method public int describeContents(); - method public java.lang.String[] getExcludedSsidList(); - method public int getMaximumBssLoadValue(); - method public long getMinHomeDownlinkBandwidth(); - method public long getMinHomeUplinkBandwidth(); - method public long getMinRoamingDownlinkBandwidth(); - method public long getMinRoamingUplinkBandwidth(); - method public android.net.wifi.hotspot2.pps.UpdateParameter getPolicyUpdate(); - method public java.util.List getPreferredRoamingPartnerList(); - method public java.util.Map getRequiredProtoPortMap(); - method public void setExcludedSsidList(java.lang.String[]); - method public void setMaximumBssLoadValue(int); - method public void setMinHomeDownlinkBandwidth(long); - method public void setMinHomeUplinkBandwidth(long); - method public void setMinRoamingDownlinkBandwidth(long); - method public void setMinRoamingUplinkBandwidth(long); - method public void setPolicyUpdate(android.net.wifi.hotspot2.pps.UpdateParameter); - method public void setPreferredRoamingPartnerList(java.util.List); - method public void setRequiredProtoPortMap(java.util.Map); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - - public static final class Policy.RoamingPartner implements android.os.Parcelable { - ctor public Policy.RoamingPartner(); - ctor public Policy.RoamingPartner(android.net.wifi.hotspot2.pps.Policy.RoamingPartner); - method public int describeContents(); - method public java.lang.String getCountries(); - method public java.lang.String getFqdn(); - method public boolean getFqdnExactMatch(); - method public int getPriority(); - method public void setCountries(java.lang.String); - method public void setFqdn(java.lang.String); - method public void setFqdnExactMatch(boolean); - method public void setPriority(int); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - } - - public final class UpdateParameter implements android.os.Parcelable { - ctor public UpdateParameter(); - ctor public UpdateParameter(android.net.wifi.hotspot2.pps.UpdateParameter); - method public int describeContents(); - method public java.lang.String getBase64EncodedPassword(); - method public java.lang.String getRestriction(); - method public java.lang.String getServerUri(); - method public byte[] getTrustRootCertSha256Fingerprint(); - method public java.lang.String getTrustRootCertUrl(); - method public long getUpdateIntervalInMinutes(); - method public java.lang.String getUpdateMethod(); - method public java.lang.String getUsername(); - method public void setBase64EncodedPassword(java.lang.String); - method public void setRestriction(java.lang.String); - method public void setServerUri(java.lang.String); - method public void setTrustRootCertSha256Fingerprint(byte[]); - method public void setTrustRootCertUrl(java.lang.String); - method public void setUpdateIntervalInMinutes(long); - method public void setUpdateMethod(java.lang.String); - method public void setUsername(java.lang.String); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator CREATOR; - field public static final long UPDATE_CHECK_INTERVAL_NEVER = 4294967295L; // 0xffffffffL - field public static final java.lang.String UPDATE_METHOD_OMADM = "OMA-DM-ClientInitiated"; - field public static final java.lang.String UPDATE_METHOD_SSP = "SSP-ClientInitiated"; - field public static final java.lang.String UPDATE_RESTRICTION_HOMESP = "HomeSP"; - field public static final java.lang.String UPDATE_RESTRICTION_ROAMING_PARTNER = "RoamingPartner"; - field public static final java.lang.String UPDATE_RESTRICTION_UNRESTRICTED = "Unrestricted"; - } - } package android.net.wifi.p2p { diff --git a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java b/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java index 1dbaa80ade72..f892bb0a3884 100644 --- a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java +++ b/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java @@ -80,9 +80,15 @@ public final class PasspointConfiguration implements Parcelable { * Configurations under Policy subtree. */ private Policy mPolicy = null; + /** + * @hide + */ public void setPolicy(Policy policy) { mPolicy = policy; } + /** + * @hide + */ public Policy getPolicy() { return mPolicy; } @@ -91,9 +97,15 @@ public final class PasspointConfiguration implements Parcelable { * Meta data for performing subscription update. */ private UpdateParameter mSubscriptionUpdate = null; + /** + * @hide + */ public void setSubscriptionUpdate(UpdateParameter subscriptionUpdate) { mSubscriptionUpdate = subscriptionUpdate; } + /** + * @hide + */ public UpdateParameter getSubscriptionUpdate() { return mSubscriptionUpdate; } @@ -104,9 +116,15 @@ public final class PasspointConfiguration implements Parcelable { * identity during EAP authentication. */ private Map mTrustRootCertList = null; + /** + * @hide + */ public void setTrustRootCertList(Map trustRootCertList) { mTrustRootCertList = trustRootCertList; } + /** + * @hide + */ public Map getTrustRootCertList() { return mTrustRootCertList; } @@ -118,9 +136,15 @@ public final class PasspointConfiguration implements Parcelable { * Use Integer.MIN_VALUE to indicate unset value. */ private int mUpdateIdentifier = Integer.MIN_VALUE; + /** + * @hide + */ public void setUpdateIdentifier(int updateIdentifier) { mUpdateIdentifier = updateIdentifier; } + /** + * @hide + */ public int getUpdateIdentifier() { return mUpdateIdentifier; } @@ -131,9 +155,15 @@ public final class PasspointConfiguration implements Parcelable { * Use Integer.MIN_VALUE to indicate unset value. */ private int mCredentialPriority = Integer.MIN_VALUE; + /** + * @hide + */ public void setCredentialPriority(int credentialPriority) { mCredentialPriority = credentialPriority; } + /** + * @hide + */ public int getCredentialPriority() { return mCredentialPriority; } @@ -145,9 +175,15 @@ public final class PasspointConfiguration implements Parcelable { * Use Long.MIN_VALUE to indicate unset value. */ private long mSubscriptionCreationTimeInMillis = Long.MIN_VALUE; + /** + * @hide + */ public void setSubscriptionCreationTimeInMillis(long subscriptionCreationTimeInMillis) { mSubscriptionCreationTimeInMillis = subscriptionCreationTimeInMillis; } + /** + * @hide + */ public long getSubscriptionCreationTimeInMillis() { return mSubscriptionCreationTimeInMillis; } @@ -159,9 +195,15 @@ public final class PasspointConfiguration implements Parcelable { * Use Long.MIN_VALUE to indicate unset value. */ private long mSubscriptionExpirationTimeInMillis = Long.MIN_VALUE; + /** + * @hide + */ public void setSubscriptionExpirationTimeInMillis(long subscriptionExpirationTimeInMillis) { mSubscriptionExpirationTimeInMillis = subscriptionExpirationTimeInMillis; } + /** + * @hide + */ public long getSubscriptionExpirationTimeInMillis() { return mSubscriptionExpirationTimeInMillis; } @@ -171,9 +213,15 @@ public final class PasspointConfiguration implements Parcelable { * specific. */ private String mSubscriptionType = null; + /** + * @hide + */ public void setSubscriptionType(String subscriptionType) { mSubscriptionType = subscriptionType; } + /** + * @hide + */ public String getSubscriptionType() { return mSubscriptionType; } @@ -184,9 +232,15 @@ public final class PasspointConfiguration implements Parcelable { * “pay as you go” - PAYG service). A non-zero value specifies the usage interval in minutes. */ private long mUsageLimitUsageTimePeriodInMinutes = Long.MIN_VALUE; + /** + * @hide + */ public void setUsageLimitUsageTimePeriodInMinutes(long usageLimitUsageTimePeriodInMinutes) { mUsageLimitUsageTimePeriodInMinutes = usageLimitUsageTimePeriodInMinutes; } + /** + * @hide + */ public long getUsageLimitUsageTimePeriodInMinutes() { return mUsageLimitUsageTimePeriodInMinutes; } @@ -198,9 +252,15 @@ public final class PasspointConfiguration implements Parcelable { * Use Long.MIN_VALUE to indicate unset value. */ private long mUsageLimitStartTimeInMillis = Long.MIN_VALUE; + /** + * @hide + */ public void setUsageLimitStartTimeInMillis(long usageLimitStartTimeInMillis) { mUsageLimitStartTimeInMillis = usageLimitStartTimeInMillis; } + /** + * @hide + */ public long getUsageLimitStartTimeInMillis() { return mUsageLimitStartTimeInMillis; } @@ -212,9 +272,15 @@ public final class PasspointConfiguration implements Parcelable { * Use Long.MIN_VALUE to indicate unset value. */ private long mUsageLimitDataLimit = Long.MIN_VALUE; + /** + * @hide + */ public void setUsageLimitDataLimit(long usageLimitDataLimit) { mUsageLimitDataLimit = usageLimitDataLimit; } + /** + * @hide + */ public long getUsageLimitDataLimit() { return mUsageLimitDataLimit; } @@ -224,9 +290,15 @@ public final class PasspointConfiguration implements Parcelable { * A value of zero indicate unlimited time usage. */ private long mUsageLimitTimeLimitInMinutes = Long.MIN_VALUE; + /** + * @hide + */ public void setUsageLimitTimeLimitInMinutes(long usageLimitTimeLimitInMinutes) { mUsageLimitTimeLimitInMinutes = usageLimitTimeLimitInMinutes; } + /** + * @hide + */ public long getUsageLimitTimeLimitInMinutes() { return mUsageLimitTimeLimitInMinutes; } diff --git a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java index f89efa6265a8..d712feb7c6d2 100644 --- a/wifi/java/android/net/wifi/hotspot2/pps/Credential.java +++ b/wifi/java/android/net/wifi/hotspot2/pps/Credential.java @@ -59,9 +59,15 @@ public final class Credential implements Parcelable { * Using Long.MIN_VALUE to indicate unset value. */ private long mCreationTimeInMillis = Long.MIN_VALUE; + /** + * @hide + */ public void setCreationTimeInMillis(long creationTimeInMillis) { mCreationTimeInMillis = creationTimeInMillis; } + /** + * @hide + */ public long getCreationTimeInMillis() { return mCreationTimeInMillis; } @@ -72,9 +78,15 @@ public final class Credential implements Parcelable { * Using Long.MIN_VALUE to indicate unset value. */ private long mExpirationTimeInMillis = Long.MIN_VALUE; + /** + * @hide + */ public void setExpirationTimeInMillis(long expirationTimeInMillis) { mExpirationTimeInMillis = expirationTimeInMillis; } + /** + * @hide + */ public long getExpirationTimeInMillis() { return mExpirationTimeInMillis; } @@ -98,9 +110,15 @@ public final class Credential implements Parcelable { * Protocol) authentication. */ private boolean mCheckAaaServerCertStatus = false; + /** + * @hide + */ public void setCheckAaaServerCertStatus(boolean checkAaaServerCertStatus) { mCheckAaaServerCertStatus = checkAaaServerCertStatus; } + /** + * @hide + */ public boolean getCheckAaaServerCertStatus() { return mCheckAaaServerCertStatus; } @@ -166,9 +184,15 @@ public final class Credential implements Parcelable { * Flag indicating if the password is machine managed. */ private boolean mMachineManaged = false; + /** + * @hide + */ public void setMachineManaged(boolean machineManaged) { mMachineManaged = machineManaged; } + /** + * @hide + */ public boolean getMachineManaged() { return mMachineManaged; } @@ -177,9 +201,15 @@ public final class Credential implements Parcelable { * The name of the application used to generate the password. */ private String mSoftTokenApp = null; + /** + * @hide + */ public void setSoftTokenApp(String softTokenApp) { mSoftTokenApp = softTokenApp; } + /** + * @hide + */ public String getSoftTokenApp() { return mSoftTokenApp; } @@ -188,9 +218,15 @@ public final class Credential implements Parcelable { * Flag indicating if this credential is usable on other mobile devices as well. */ private boolean mAbleToShare = false; + /** + * @hide + */ public void setAbleToShare(boolean ableToShare) { mAbleToShare = ableToShare; } + /** + * @hide + */ public boolean getAbleToShare() { return mAbleToShare; } diff --git a/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java b/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java index 9192ab015e20..2247860d23a5 100644 --- a/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java +++ b/wifi/java/android/net/wifi/hotspot2/pps/HomeSp.java @@ -74,9 +74,15 @@ public final class HomeSp implements Parcelable { * Icon URL of this home service provider. */ private String mIconUrl = null; + /** + * @hide + */ public void setIconUrl(String iconUrl) { mIconUrl = iconUrl; } + /** + * @hide + */ public String getIconUrl() { return mIconUrl; } @@ -89,9 +95,15 @@ public final class HomeSp implements Parcelable { * string is assumed to be encoded using UTF-8. */ private Map mHomeNetworkIds = null; + /** + * @hide + */ public void setHomeNetworkIds(Map homeNetworkIds) { mHomeNetworkIds = homeNetworkIds; } + /** + * @hide + */ public Map getHomeNetworkIds() { return mHomeNetworkIds; } @@ -107,9 +119,15 @@ public final class HomeSp implements Parcelable { * (MO) tree for more detail. */ private long[] mMatchAllOis = null; + /** + * @hide + */ public void setMatchAllOis(long[] matchAllOis) { mMatchAllOis = matchAllOis; } + /** + * @hide + */ public long[] getMatchAllOis() { return mMatchAllOis; } @@ -128,9 +146,15 @@ public final class HomeSp implements Parcelable { * (MO) tree for more detail. */ private long[] mMatchAnyOis = null; + /** + * @hide + */ public void setMatchAnyOis(long[] matchAnyOis) { mMatchAnyOis = matchAnyOis; } + /** + * @hide + */ public long[] getMatchAnyOis() { return mMatchAnyOis; } @@ -142,9 +166,15 @@ public final class HomeSp implements Parcelable { * operator merges between the providers. */ private String[] mOtherHomePartners = null; + /** + * @hide + */ public void setOtherHomePartners(String[] otherHomePartners) { mOtherHomePartners = otherHomePartners; } + /** + * @hide + */ public String[] getOtherHomePartners() { return mOtherHomePartners; } diff --git a/wifi/java/android/net/wifi/hotspot2/pps/Policy.java b/wifi/java/android/net/wifi/hotspot2/pps/Policy.java index 1df70f8d45d0..ee0894bd0212 100644 --- a/wifi/java/android/net/wifi/hotspot2/pps/Policy.java +++ b/wifi/java/android/net/wifi/hotspot2/pps/Policy.java @@ -40,6 +40,8 @@ import java.util.Objects; * * For more info, refer to Hotspot 2.0 PPS MO defined in section 9.1 of the Hotspot 2.0 * Release 2 Technical Specification. + * + * @hide */ public final class Policy implements Parcelable { private static final String TAG = "Policy"; diff --git a/wifi/java/android/net/wifi/hotspot2/pps/UpdateParameter.java b/wifi/java/android/net/wifi/hotspot2/pps/UpdateParameter.java index a7adfeb9ec0f..9eb6314b1fa0 100644 --- a/wifi/java/android/net/wifi/hotspot2/pps/UpdateParameter.java +++ b/wifi/java/android/net/wifi/hotspot2/pps/UpdateParameter.java @@ -34,6 +34,8 @@ import java.util.Objects; * * For more info, refer to Hotspot 2.0 PPS MO defined in section 9.1 of the Hotspot 2.0 * Release 2 Technical Specification. + * + * @hide */ public final class UpdateParameter implements Parcelable { private static final String TAG = "UpdateParameter"; -- GitLab From 0b80c4e518110ba385a1b83d1e29325f164dc90d Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Mon, 1 May 2017 15:38:34 -0400 Subject: [PATCH 63/66] Revert "Revert "Extend extension support"" This reverts commit e9f2d284ef044c6df15165092036b9ef80ebb790. Test: runtest systemui Change-Id: I6d1ca9af8ee2fb4b242ccd2f9772f7d23cc35866 --- .../src/com/android/systemui/Dependency.java | 2 +- .../fragments/ExtensionFragmentListener.java | 64 ++++++ .../fragments/FragmentHostManager.java | 35 ++-- .../fragments/PluginFragmentListener.java | 74 ------- .../systemui/statusbar/phone/StatusBar.java | 101 ++++----- .../statusbar/policy/ExtensionController.java | 6 +- .../policy/ExtensionControllerImpl.java | 132 +++++++++--- .../policy/ExtensionControllerImplTest.java | 197 ++++++++++++++++++ .../policy/ExtensionControllerTest.java | 105 ---------- .../utils/leaks/FakeExtensionController.java | 16 ++ 10 files changed, 454 insertions(+), 278 deletions(-) create mode 100644 packages/SystemUI/src/com/android/systemui/fragments/ExtensionFragmentListener.java delete mode 100644 packages/SystemUI/src/com/android/systemui/fragments/PluginFragmentListener.java create mode 100644 packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerTest.java diff --git a/packages/SystemUI/src/com/android/systemui/Dependency.java b/packages/SystemUI/src/com/android/systemui/Dependency.java index f4d4a9ff327d..cfac2b70c992 100644 --- a/packages/SystemUI/src/com/android/systemui/Dependency.java +++ b/packages/SystemUI/src/com/android/systemui/Dependency.java @@ -248,7 +248,7 @@ public class Dependency extends SystemUI { new FragmentService(mContext)); mProviders.put(ExtensionController.class, () -> - new ExtensionControllerImpl()); + new ExtensionControllerImpl(mContext)); mProviders.put(PluginDependencyProvider.class, () -> new PluginDependencyProvider(get(PluginManager.class))); diff --git a/packages/SystemUI/src/com/android/systemui/fragments/ExtensionFragmentListener.java b/packages/SystemUI/src/com/android/systemui/fragments/ExtensionFragmentListener.java new file mode 100644 index 000000000000..880951036661 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/fragments/ExtensionFragmentListener.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * 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 com.android.systemui.fragments; + +import android.app.Fragment; +import android.util.Log; +import android.view.View; + +import com.android.systemui.plugins.FragmentBase; +import com.android.systemui.statusbar.policy.ExtensionController.Extension; + +import java.util.function.Consumer; + +/** + * Wires up an Extension to a Fragment tag/id so that it always contains the class + * selected by the extension. + */ +public class ExtensionFragmentListener implements Consumer { + + private static final String TAG = "ExtensionFragmentListener"; + + private final FragmentHostManager mFragmentHostManager; + private final String mTag; + private final Extension mExtension; + private String mOldClass; + + private ExtensionFragmentListener(View view, String tag, int id, Extension extension) { + mTag = tag; + mFragmentHostManager = FragmentHostManager.get(view); + mExtension = extension; + mFragmentHostManager.getFragmentManager().beginTransaction() + .replace(id, (Fragment) mExtension.get(), mTag) + .commit(); + } + + @Override + public void accept(T extension) { + try { + Fragment.class.cast(extension); + mFragmentHostManager.getExtensionManager().setCurrentExtension(mTag, + mOldClass, extension.getClass().getName(), mExtension.getContext()); + mOldClass = extension.getClass().getName(); + } catch (ClassCastException e) { + Log.e(TAG, extension.getClass().getName() + " must be a Fragment", e); + } + } + + public static void attachExtensonToFragment(View view, String tag, int id, + Extension extension) { + extension.addCallback(new ExtensionFragmentListener(view, tag, id, extension)); + } +} diff --git a/packages/SystemUI/src/com/android/systemui/fragments/FragmentHostManager.java b/packages/SystemUI/src/com/android/systemui/fragments/FragmentHostManager.java index 8ac97f3306be..4dbf6f98e3e6 100644 --- a/packages/SystemUI/src/com/android/systemui/fragments/FragmentHostManager.java +++ b/packages/SystemUI/src/com/android/systemui/fragments/FragmentHostManager.java @@ -28,6 +28,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Parcelable; +import android.support.annotation.NonNull; import android.util.ArrayMap; import android.view.LayoutInflater; import android.view.View; @@ -51,7 +52,7 @@ public class FragmentHostManager { private final InterestingConfigChanges mConfigChanges = new InterestingConfigChanges( ActivityInfo.CONFIG_FONT_SCALE); private final FragmentService mManager; - private final PluginFragmentManager mPlugins = new PluginFragmentManager(); + private final ExtensionFragmentManager mPlugins = new ExtensionFragmentManager(); private FragmentController mFragments; private FragmentLifecycleCallbacks mLifecycleCallbacks; @@ -174,7 +175,7 @@ public class FragmentHostManager { return mFragments.getFragmentManager(); } - PluginFragmentManager getPluginManager() { + ExtensionFragmentManager getExtensionManager() { return mPlugins; } @@ -261,22 +262,16 @@ public class FragmentHostManager { } } - class PluginFragmentManager { - private final ArrayMap mPluginLookup = new ArrayMap<>(); + class ExtensionFragmentManager { + private final ArrayMap mExtensionLookup = new ArrayMap<>(); - public void removePlugin(String tag, String currentClass, String defaultClass) { + public void setCurrentExtension(@NonNull String tag, @Nullable String oldClass, + @NonNull String currentClass, @Nullable Context context) { Fragment fragment = getFragmentManager().findFragmentByTag(tag); - mPluginLookup.remove(currentClass); - getFragmentManager().beginTransaction() - .replace(((View) fragment.getView().getParent()).getId(), - instantiate(mContext, defaultClass, null), tag) - .commit(); - reloadFragments(); - } - - public void setCurrentPlugin(String tag, String currentClass, Context context) { - Fragment fragment = getFragmentManager().findFragmentByTag(tag); - mPluginLookup.put(currentClass, context); + if (oldClass != null) { + mExtensionLookup.remove(oldClass); + } + mExtensionLookup.put(currentClass, context); getFragmentManager().beginTransaction() .replace(((View) fragment.getView().getParent()).getId(), instantiate(context, currentClass, null), tag) @@ -292,11 +287,11 @@ public class FragmentHostManager { } Fragment instantiate(Context context, String className, Bundle arguments) { - Context pluginContext = mPluginLookup.get(className); - if (pluginContext != null) { - Fragment f = Fragment.instantiate(pluginContext, className, arguments); + Context extensionContext = mExtensionLookup.get(className); + if (extensionContext != null) { + Fragment f = Fragment.instantiate(extensionContext, className, arguments); if (f instanceof Plugin) { - ((Plugin) f).onCreate(mContext, pluginContext); + ((Plugin) f).onCreate(mContext, extensionContext); } return f; } diff --git a/packages/SystemUI/src/com/android/systemui/fragments/PluginFragmentListener.java b/packages/SystemUI/src/com/android/systemui/fragments/PluginFragmentListener.java deleted file mode 100644 index 03bb73da3902..000000000000 --- a/packages/SystemUI/src/com/android/systemui/fragments/PluginFragmentListener.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2016 The Android Open Source Project - * - * 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 com.android.systemui.fragments; - -import android.app.Fragment; -import android.content.Context; -import android.util.Log; -import android.view.View; - -import com.android.systemui.Dependency; -import com.android.systemui.plugins.FragmentBase; -import com.android.systemui.plugins.Plugin; -import com.android.systemui.plugins.PluginListener; -import com.android.systemui.plugins.PluginManager; - -public class PluginFragmentListener implements PluginListener { - - private static final String TAG = "PluginFragmentListener"; - - private final FragmentHostManager mFragmentHostManager; - private final PluginManager mPluginManager; - private final Class mDefaultClass; - private final Class mExpectedInterface; - private final String mTag; - - public PluginFragmentListener(View view, String tag, Class defaultFragment, - Class expectedInterface) { - mTag = tag; - mFragmentHostManager = FragmentHostManager.get(view); - mPluginManager = Dependency.get(PluginManager.class); - mExpectedInterface = expectedInterface; - mDefaultClass = defaultFragment; - } - - public void startListening() { - mPluginManager.addPluginListener(this, mExpectedInterface, - false /* Only allow one */); - } - - public void stopListening() { - mPluginManager.removePluginListener(this); - } - - @Override - public void onPluginConnected(Plugin plugin, Context pluginContext) { - try { - mExpectedInterface.cast(plugin); - Fragment.class.cast(plugin); - mFragmentHostManager.getPluginManager().setCurrentPlugin(mTag, - plugin.getClass().getName(), pluginContext); - } catch (ClassCastException e) { - Log.e(TAG, plugin.getClass().getName() + " must be a Fragment and implement " - + mExpectedInterface.getName(), e); - } - } - - @Override - public void onPluginDisconnected(Plugin plugin) { - mFragmentHostManager.getPluginManager().removePlugin(mTag, - plugin.getClass().getName(), mDefaultClass.getName()); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index e146e93e11c7..b89b062c6d0d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -21,6 +21,7 @@ package com.android.systemui.statusbar.phone; import static android.app.StatusBarManager.WINDOW_STATE_HIDDEN; import static android.app.StatusBarManager.WINDOW_STATE_SHOWING; import static android.app.StatusBarManager.windowStateToString; +import static android.content.res.Configuration.UI_MODE_TYPE_CAR; import static com.android.systemui.statusbar.notification.NotificationInflater.InflationCallback; import static com.android.systemui.statusbar.phone.BarTransitions.MODE_LIGHTS_OUT; @@ -36,11 +37,17 @@ import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.annotation.NonNull; import android.app.ActivityManager; +import android.app.ActivityManager.StackId; import android.app.ActivityOptions; +import android.app.INotificationManager; +import android.app.KeyguardManager; import android.app.Notification; +import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; +import android.app.RemoteInput; import android.app.StatusBarManager; +import android.app.TaskStackBuilder; import android.app.admin.DevicePolicyManager; import android.content.BroadcastReceiver; import android.content.ComponentCallbacks2; @@ -49,8 +56,11 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.IntentSender; +import android.content.pm.ApplicationInfo; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; +import android.content.pm.PackageManager.NameNotFoundException; +import android.content.pm.UserInfo; import android.content.res.Configuration; import android.content.res.Resources; import android.database.ContentObserver; @@ -75,7 +85,9 @@ import android.media.session.PlaybackState; import android.metrics.LogMaker; import android.net.Uri; import android.os.AsyncTask; +import android.os.Build; import android.os.Bundle; +import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.os.PowerManager; @@ -88,63 +100,86 @@ import android.os.UserHandle; import android.os.UserManager; import android.os.Vibrator; import android.provider.Settings; +import android.service.dreams.DreamService; +import android.service.dreams.IDreamManager; +import android.service.notification.NotificationListenerService; import android.service.notification.NotificationListenerService.RankingMap; import android.service.notification.StatusBarNotification; +import android.service.vr.IVrManager; +import android.service.vr.IVrStateCallbacks; +import android.text.TextUtils; import android.util.ArraySet; import android.util.DisplayMetrics; import android.util.EventLog; import android.util.Log; +import android.util.Slog; +import android.util.SparseArray; +import android.util.SparseBooleanArray; import android.view.ContextThemeWrapper; import android.view.Display; +import android.view.IWindowManager; import android.view.KeyEvent; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.ThreadedRenderer; import android.view.View; +import android.view.ViewAnimationUtils; import android.view.ViewGroup; import android.view.ViewParent; import android.view.ViewStub; import android.view.ViewTreeObserver; import android.view.WindowManager; import android.view.WindowManagerGlobal; +import android.view.accessibility.AccessibilityManager; import android.view.animation.AccelerateInterpolator; import android.view.animation.Interpolator; import android.widget.DateTimeView; import android.widget.ImageView; +import android.widget.RemoteViews; import android.widget.TextView; +import android.widget.Toast; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; +import com.android.internal.messages.nano.SystemMessageProto.SystemMessage; +import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.NotificationVisibility; import com.android.internal.statusbar.StatusBarIcon; import com.android.internal.util.NotificationMessagingUtil; +import com.android.internal.widget.LockPatternUtils; import com.android.keyguard.KeyguardHostView.OnDismissAction; import com.android.keyguard.KeyguardStatusView; import com.android.keyguard.KeyguardUpdateMonitor; import com.android.keyguard.KeyguardUpdateMonitorCallback; import com.android.keyguard.ViewMediatorCallback; import com.android.systemui.ActivityStarterDelegate; +import com.android.systemui.DejankUtils; import com.android.systemui.DemoMode; import com.android.systemui.Dependency; import com.android.systemui.EventLogTags; import com.android.systemui.Interpolators; import com.android.systemui.Prefs; import com.android.systemui.R; +import com.android.systemui.RecentsComponent; +import com.android.systemui.SwipeHelper; +import com.android.systemui.SystemUI; import com.android.systemui.SystemUIFactory; import com.android.systemui.assist.AssistManager; import com.android.systemui.classifier.FalsingLog; import com.android.systemui.classifier.FalsingManager; import com.android.systemui.doze.DozeHost; import com.android.systemui.doze.DozeLog; +import com.android.systemui.fragments.ExtensionFragmentListener; import com.android.systemui.fragments.FragmentHostManager; -import com.android.systemui.fragments.PluginFragmentListener; import com.android.systemui.keyguard.KeyguardViewMediator; -import com.android.systemui.plugins.qs.QS; import com.android.systemui.plugins.ActivityStarter; +import com.android.systemui.plugins.qs.QS; +import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem; import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption; import com.android.systemui.qs.QSFragment; import com.android.systemui.qs.QSPanel; import com.android.systemui.qs.QSTileHost; +import com.android.systemui.recents.Recents; import com.android.systemui.recents.ScreenPinningRequest; import com.android.systemui.recents.events.EventBus; import com.android.systemui.recents.events.activity.AppTransitionFinishedEvent; @@ -183,6 +218,7 @@ import com.android.systemui.statusbar.policy.ConfigurationController.Configurati import com.android.systemui.statusbar.policy.DarkIconDispatcher; import com.android.systemui.statusbar.policy.DeviceProvisionedController; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; +import com.android.systemui.statusbar.policy.ExtensionController; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.KeyguardMonitor; import com.android.systemui.statusbar.policy.KeyguardMonitorImpl; @@ -190,11 +226,15 @@ import com.android.systemui.statusbar.policy.KeyguardUserSwitcher; import com.android.systemui.statusbar.policy.NetworkController; import com.android.systemui.statusbar.policy.OnHeadsUpChangedListener; import com.android.systemui.statusbar.policy.PreviewInflater; +import com.android.systemui.statusbar.policy.RemoteInputView; import com.android.systemui.statusbar.policy.UserInfoController; import com.android.systemui.statusbar.policy.UserInfoControllerImpl; import com.android.systemui.statusbar.policy.UserSwitcherController; import com.android.systemui.statusbar.stack.NotificationStackScrollLayout; -import com.android.systemui.statusbar.stack.NotificationStackScrollLayout.OnChildLocationsChangedListener; +import com.android.systemui.statusbar.stack.NotificationStackScrollLayout + .OnChildLocationsChangedListener; +import com.android.systemui.statusbar.stack.StackStateAnimator; +import com.android.systemui.util.NotificationChannels; import com.android.systemui.util.leak.LeakDetector; import com.android.systemui.volume.VolumeComponent; @@ -205,50 +245,10 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import android.app.ActivityManager.StackId; -import android.app.INotificationManager; -import android.app.KeyguardManager; -import android.app.NotificationChannel; -import android.app.RemoteInput; -import android.app.TaskStackBuilder; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager.NameNotFoundException; -import android.content.pm.UserInfo; -import android.os.Build; -import android.os.Handler; -import android.service.dreams.DreamService; -import android.service.dreams.IDreamManager; -import android.service.notification.NotificationListenerService; -import android.service.vr.IVrManager; -import android.service.vr.IVrStateCallbacks; -import android.text.TextUtils; -import android.util.Slog; -import android.util.SparseArray; -import android.util.SparseBooleanArray; -import android.view.IWindowManager; -import android.view.ViewAnimationUtils; -import android.view.accessibility.AccessibilityManager; -import android.widget.RemoteViews; -import android.widget.Toast; - -import com.android.internal.messages.nano.SystemMessageProto.SystemMessage; -import com.android.internal.statusbar.IStatusBarService; -import com.android.internal.widget.LockPatternUtils; -import com.android.systemui.DejankUtils; -import com.android.systemui.RecentsComponent; -import com.android.systemui.SwipeHelper; -import com.android.systemui.SystemUI; -import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin.MenuItem; -import com.android.systemui.recents.Recents; -import com.android.systemui.statusbar.policy.RemoteInputView; -import com.android.systemui.statusbar.stack.StackStateAnimator; -import com.android.systemui.util.NotificationChannels; - import java.util.HashSet; +import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.Set; import java.util.Stack; @@ -1133,11 +1133,12 @@ public class StatusBar extends SystemUI implements DemoMode, View container = mStatusBarWindow.findViewById(R.id.qs_frame); if (container != null) { FragmentHostManager fragmentHostManager = FragmentHostManager.get(container); - fragmentHostManager.getFragmentManager().beginTransaction() - .replace(R.id.qs_frame, new QSFragment(), QS.TAG) - .commit(); - new PluginFragmentListener(container, QS.TAG, QSFragment.class, QS.class) - .startListening(); + ExtensionFragmentListener.attachExtensonToFragment(container, QS.TAG, R.id.qs_frame, + Dependency.get(ExtensionController.class).newExtension(QS.class) + .withPlugin(QS.class) + .withUiMode(UI_MODE_TYPE_CAR, () -> new QSFragment()) + .withDefault(() -> new QSFragment()) + .build()); final QSTileHost qsh = SystemUIFactory.getInstance().createQSTileHost(mContext, this, mIconController); mBrightnessMirrorController = new BrightnessMirrorController(mStatusBarWindow); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionController.java index eaf89259ed59..61287491766b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionController.java @@ -14,8 +14,7 @@ package com.android.systemui.statusbar.policy; -import com.android.systemui.Dependency; -import com.android.systemui.plugins.Plugin; +import android.content.Context; import java.util.Map; import java.util.function.Consumer; @@ -31,7 +30,9 @@ public interface ExtensionController { interface Extension { T get(); + Context getContext(); void destroy(); + void addCallback(Consumer callback); } interface ExtensionBuilder { @@ -42,6 +43,7 @@ public interface ExtensionController { PluginConverter converter); ExtensionBuilder withDefault(Supplier def); ExtensionBuilder withCallback(Consumer callback); + ExtensionBuilder withUiMode(int mode, Supplier def); Extension build(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionControllerImpl.java index fefbaa31af2a..91b61607d04d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ExtensionControllerImpl.java @@ -14,23 +14,38 @@ package com.android.systemui.statusbar.policy; +import android.content.Context; +import android.content.res.Configuration; +import android.os.Handler; +import android.util.ArrayMap; + import com.android.systemui.Dependency; import com.android.systemui.plugins.Plugin; import com.android.systemui.plugins.PluginListener; import com.android.systemui.plugins.PluginManager; +import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; import com.android.systemui.tuner.TunerService; import com.android.systemui.tuner.TunerService.Tunable; -import android.content.Context; -import android.util.ArrayMap; - import java.util.ArrayList; import java.util.Collections; +import java.util.Comparator; import java.util.function.Consumer; import java.util.function.Supplier; public class ExtensionControllerImpl implements ExtensionController { + public static final int SORT_ORDER_PLUGIN = 0; + public static final int SORT_ORDER_TUNER = 1; + public static final int SORT_ORDER_UI_MODE = 2; + public static final int SORT_ORDER_DEFAULT = 3; + + private final Context mDefaultContext; + + public ExtensionControllerImpl(Context context) { + mDefaultContext = context; + } + @Override public ExtensionBuilder newExtension(Class cls) { return new ExtensionBuilder<>(); @@ -38,6 +53,7 @@ public class ExtensionControllerImpl implements ExtensionController { private interface Producer { T get(); + void destroy(); } @@ -75,6 +91,12 @@ public class ExtensionControllerImpl implements ExtensionController { return this; } + public ExtensionController.ExtensionBuilder withUiMode(int uiMode, + Supplier supplier) { + mExtension.addUiMode(uiMode, supplier); + return this; + } + @Override public ExtensionController.ExtensionBuilder withCallback( Consumer callback) { @@ -85,40 +107,32 @@ public class ExtensionControllerImpl implements ExtensionController { @Override public ExtensionController.Extension build() { // Manually sort, plugins first, tuners second, defaults last. - Collections.sort(mExtension.mProducers, (o1, o2) -> { - if (o1 instanceof ExtensionImpl.PluginItem) { - if (o2 instanceof ExtensionImpl.PluginItem) { - return 0; - } else { - return -1; - } - } - if (o1 instanceof ExtensionImpl.TunerItem) { - if (o2 instanceof ExtensionImpl.PluginItem) { - return 1; - } else if (o2 instanceof ExtensionImpl.TunerItem) { - return 0; - } else { - return -1; - } - } - return 0; - }); + Collections.sort(mExtension.mProducers, Comparator.comparingInt(Item::sortOrder)); mExtension.notifyChanged(); return mExtension; } } private class ExtensionImpl implements ExtensionController.Extension { - private final ArrayList> mProducers = new ArrayList<>(); + private final ArrayList> mProducers = new ArrayList<>(); private final ArrayList> mCallbacks = new ArrayList<>(); private T mItem; + private Context mPluginContext; + + public void addCallback(Consumer callback) { + mCallbacks.add(callback); + } @Override public T get() { return mItem; } + @Override + public Context getContext() { + return mPluginContext != null ? mPluginContext : mDefaultContext; + } + @Override public void destroy() { for (int i = 0; i < mProducers.size(); i++) { @@ -127,6 +141,7 @@ public class ExtensionControllerImpl implements ExtensionController { } private void notifyChanged() { + mItem = null; for (int i = 0; i < mProducers.size(); i++) { final T item = mProducers.get(i).get(); if (item != null) { @@ -151,7 +166,11 @@ public class ExtensionControllerImpl implements ExtensionController { mProducers.add(new TunerItem(factory, factory.keys())); } - private class PluginItem

implements Producer, PluginListener

{ + public void addUiMode(int uiMode, Supplier mode) { + mProducers.add(new UiModeItem(uiMode, mode)); + } + + private class PluginItem

implements Item, PluginListener

{ private final PluginConverter mConverter; private T mItem; @@ -162,6 +181,7 @@ public class ExtensionControllerImpl implements ExtensionController { @Override public void onPluginConnected(P plugin, Context pluginContext) { + mPluginContext = pluginContext; if (mConverter != null) { mItem = mConverter.getInterfaceFromPlugin(plugin); } else { @@ -172,6 +192,7 @@ public class ExtensionControllerImpl implements ExtensionController { @Override public void onPluginDisconnected(P plugin) { + mPluginContext = null; mItem = null; notifyChanged(); } @@ -185,9 +206,14 @@ public class ExtensionControllerImpl implements ExtensionController { public void destroy() { Dependency.get(PluginManager.class).removePluginListener(this); } + + @Override + public int sortOrder() { + return SORT_ORDER_PLUGIN; + } } - private class TunerItem implements Producer, Tunable { + private class TunerItem implements Item, Tunable { private final TunerFactory mFactory; private final ArrayMap mSettings = new ArrayMap<>(); private T mItem; @@ -213,9 +239,54 @@ public class ExtensionControllerImpl implements ExtensionController { mItem = mFactory.create(mSettings); notifyChanged(); } + + @Override + public int sortOrder() { + return SORT_ORDER_TUNER; + } + } + + private class UiModeItem implements Item, ConfigurationListener { + + private final int mDesiredUiMode; + private final Supplier mSupplier; + private int mUiMode; + private Handler mHandler = new Handler(); + + public UiModeItem(int uiMode, Supplier supplier) { + mDesiredUiMode = uiMode; + mSupplier = supplier; + mUiMode = mDefaultContext.getResources().getConfiguration().uiMode; + Dependency.get(ConfigurationController.class).addCallback(this); + } + + @Override + public void onConfigChanged(Configuration newConfig) { + int newMode = newConfig.uiMode & Configuration.UI_MODE_TYPE_MASK; + if (newMode != mUiMode) { + mUiMode = newMode; + // Post to make sure we don't have concurrent modifications. + mHandler.post(ExtensionImpl.this::notifyChanged); + } + } + + @Override + public T get() { + return (mUiMode == mDesiredUiMode) ? mSupplier.get() : null; + } + + @Override + public void destroy() { + Dependency.get(ConfigurationController.class).removeCallback(this); + } + + @Override + public int sortOrder() { + return SORT_ORDER_UI_MODE; + } } - private class Default implements Producer { + private class Default implements Item { private final Supplier mSupplier; public Default(Supplier supplier) { @@ -231,6 +302,15 @@ public class ExtensionControllerImpl implements ExtensionController { public void destroy() { } + + @Override + public int sortOrder() { + return SORT_ORDER_DEFAULT; + } } } + + private interface Item extends Producer { + int sortOrder(); + } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java new file mode 100644 index 000000000000..564019c2bdc5 --- /dev/null +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerImplTest.java @@ -0,0 +1,197 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * 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 com.android.systemui.statusbar.policy; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import android.content.res.Configuration; +import android.testing.AndroidTestingRunner; +import android.testing.TestableLooper; +import android.testing.TestableLooper.RunWithLooper; +import android.util.Log; + +import com.android.systemui.Dependency; +import com.android.systemui.SysuiTestCase; +import com.android.systemui.plugins.OverlayPlugin; +import com.android.systemui.plugins.Plugin; +import com.android.systemui.plugins.PluginListener; +import com.android.systemui.plugins.PluginManager; +import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; +import com.android.systemui.statusbar.policy.ExtensionController.Extension; +import com.android.systemui.statusbar.policy.ExtensionController.TunerFactory; +import com.android.systemui.tuner.TunerService; +import com.android.systemui.tuner.TunerService.Tunable; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; + +import java.util.Map; +import java.util.function.Consumer; + +@RunWith(AndroidTestingRunner.class) +public class ExtensionControllerImplTest extends SysuiTestCase { + + private PluginManager mPluginManager; + private TunerService mTunerService; + private ExtensionController mExtensionController; + private ConfigurationController mConfigurationController; + + @Before + public void setup() { + mPluginManager = mDependency.injectMockDependency(PluginManager.class); + mTunerService = mDependency.injectMockDependency(TunerService.class); + mConfigurationController = mDependency.injectMockDependency(ConfigurationController.class); + mExtensionController = Dependency.get(ExtensionController.class); + } + + @Test + public void testPlugin() { + OverlayPlugin plugin = mock(OverlayPlugin.class); + + Extension ext = mExtensionController.newExtension(OverlayPlugin.class) + .withPlugin(OverlayPlugin.class) + .build(); + ArgumentCaptor listener = ArgumentCaptor.forClass(PluginListener.class); + verify(mPluginManager).addPluginListener(eq(OverlayPlugin.ACTION), listener.capture(), + eq(OverlayPlugin.class)); + + listener.getValue().onPluginConnected(plugin, null); + assertEquals(plugin, ext.get()); + + ext.destroy(); + verify(mPluginManager).removePluginListener(any()); + } + + @Test + public void testTuner() { + String[] keys = new String[] { "key1", "key2" }; + TunerFactory factory = new ExtensionController.TunerFactory() { + @Override + public String[] keys() { + return keys; + } + + @Override + public Object create(Map settings) { + return null; + } + }; + Extension ext = mExtensionController.newExtension(Object.class) + .withTunerFactory(factory) + .build(); + verify(mTunerService).addTunable(any(), eq(keys[0]), eq(keys[1])); + + ext.destroy(); + verify(mTunerService).removeTunable(any()); + } + + @Test + @RunWithLooper + public void testUiMode() { + Object o = new Object(); + Extension ext = mExtensionController.newExtension(Object.class) + .withUiMode(Configuration.UI_MODE_TYPE_CAR, () -> o) + .build(); + ArgumentCaptor captor = ArgumentCaptor.forClass( + ConfigurationListener.class); + verify(mConfigurationController).addCallback(captor.capture()); + + Configuration c = new Configuration(mContext.getResources().getConfiguration()); + c.uiMode = 0; + captor.getValue().onConfigChanged(c); + TestableLooper.get(this).processAllMessages(); + assertNull(ext.get()); + + c.uiMode = Configuration.UI_MODE_TYPE_CAR; + captor.getValue().onConfigChanged(c); + TestableLooper.get(this).processAllMessages(); + assertEquals(o, ext.get()); + + ext.destroy(); + verify(mConfigurationController).removeCallback(eq(captor.getValue())); + } + + @Test + public void testDefault() { + Object o = new Object(); + Extension ext = mExtensionController.newExtension(Object.class) + .withDefault(() -> o) + .build(); + assertEquals(o, ext.get()); + } + + @Test + @RunWithLooper + public void testSortOrder() { + Log.d("TestTest", "Config " + mContext.getResources().getConfiguration().uiMode); + Object def = new Object(); + Object uiMode = new Object(); + Object tuner = new Object(); + Plugin plugin = mock(Plugin.class); + TunerFactory factory = mock(TunerFactory.class); + Extension ext = mExtensionController.newExtension(Object.class) + .withDefault(() -> def) + .withUiMode(Configuration.UI_MODE_TYPE_CAR, () -> uiMode) + .withTunerFactory(factory) + .withPlugin(Object.class, "some_action") + .build(); + + // Test default first. + assertEquals(def, ext.get()); + + // Enable a UI mode and check that. + ArgumentCaptor captor = ArgumentCaptor.forClass( + ConfigurationListener.class); + verify(mConfigurationController).addCallback(captor.capture()); + Configuration c = new Configuration(mContext.getResources().getConfiguration()); + c.uiMode |= Configuration.UI_MODE_TYPE_CAR; + captor.getValue().onConfigChanged(c); + TestableLooper.get(this).processAllMessages(); + assertEquals(uiMode, ext.get()); + + // Turn on tuner item and check that. + when(factory.create(any())).thenReturn(tuner); + ArgumentCaptor tunable = ArgumentCaptor.forClass(Tunable.class); + verify(mTunerService).addTunable(tunable.capture(), any()); + tunable.getValue().onTuningChanged(null, null); + assertEquals(tuner, ext.get()); + + // Lastly, check a plugin. + ArgumentCaptor listener = ArgumentCaptor.forClass(PluginListener.class); + verify(mPluginManager).addPluginListener(any(), listener.capture(), any()); + listener.getValue().onPluginConnected(plugin, null); + assertEquals(plugin, ext.get()); + } + + @Test + public void testCallback() { + Consumer callback = mock(Consumer.class); + final Object o = new Object(); + mExtensionController.newExtension(Object.class) + .withDefault(() -> o) + .withCallback(callback) + .build(); + verify(callback).accept(eq(o)); + } + +} diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerTest.java deleted file mode 100644 index 3e79a0404026..000000000000 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/ExtensionControllerTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2017 The Android Open Source Project - * - * 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 com.android.systemui.statusbar.policy; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - -import com.android.systemui.Dependency; -import com.android.systemui.SysuiTestCase; -import com.android.systemui.plugins.OverlayPlugin; -import com.android.systemui.plugins.PluginManager; -import com.android.systemui.statusbar.policy.ExtensionController.Extension; -import com.android.systemui.statusbar.policy.ExtensionController.TunerFactory; -import com.android.systemui.tuner.TunerService; - -import org.junit.Before; -import org.junit.Test; - -import java.util.Map; -import java.util.function.Consumer; - -public class ExtensionControllerTest extends SysuiTestCase { - - private PluginManager mPluginManager; - private TunerService mTunerService; - private ExtensionController mExtensionController; - - @Before - public void setup() { - mPluginManager = mDependency.injectMockDependency(PluginManager.class); - mTunerService = mDependency.injectMockDependency(TunerService.class); - mExtensionController = Dependency.get(ExtensionController.class); - } - - @Test - public void testPlugin() { - Extension ext = mExtensionController.newExtension(OverlayPlugin.class) - .withPlugin(OverlayPlugin.class) - .build(); - verify(mPluginManager).addPluginListener(eq(OverlayPlugin.ACTION), any(), - eq(OverlayPlugin.class)); - - ext.destroy(); - verify(mPluginManager).removePluginListener(any()); - } - - @Test - public void testTuner() { - String[] keys = new String[] { "key1", "key2" }; - TunerFactory factory = new ExtensionController.TunerFactory() { - @Override - public String[] keys() { - return keys; - } - - @Override - public Object create(Map settings) { - return null; - } - }; - Extension ext = mExtensionController.newExtension(Object.class) - .withTunerFactory(factory) - .build(); - verify(mTunerService).addTunable(any(), eq(keys[0]), eq(keys[1])); - - ext.destroy(); - verify(mTunerService).removeTunable(any()); - } - - @Test - public void testDefault() { - Object o = new Object(); - Extension ext = mExtensionController.newExtension(Object.class) - .withDefault(() -> o) - .build(); - assertEquals(o, ext.get()); - } - - @Test - public void testCallback() { - Consumer callback = mock(Consumer.class); - final Object o = new Object(); - mExtensionController.newExtension(Object.class) - .withDefault(() -> o) - .withCallback(callback) - .build(); - verify(callback).accept(eq(o)); - } - -} diff --git a/packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeExtensionController.java b/packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeExtensionController.java index b9d188a3871a..3a0f907b8697 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeExtensionController.java +++ b/packages/SystemUI/tests/src/com/android/systemui/utils/leaks/FakeExtensionController.java @@ -14,6 +14,7 @@ package com.android.systemui.utils.leaks; +import android.content.Context; import android.testing.LeakCheck; import android.testing.LeakCheck.Tracker; @@ -74,6 +75,11 @@ public class FakeExtensionController implements ExtensionController { return this; } + @Override + public ExtensionBuilder withUiMode(int mode, Supplier def) { + return null; + } + @Override public Extension build() { return new FakeExtension(mAllocation); @@ -93,9 +99,19 @@ public class FakeExtensionController implements ExtensionController { return null; } + @Override + public Context getContext() { + return null; + } + @Override public void destroy() { mTracker.getLeakInfo(mAllocation).clearAllocations(); } + + @Override + public void addCallback(Consumer callback) { + + } } } -- GitLab From c7d06612799f8f9a6dbd184cda7b10f81c7b82e0 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Mon, 1 May 2017 16:47:11 -0700 Subject: [PATCH 64/66] Import translations. DO NOT MERGE Change-Id: Iae5f3f4f17f19f75e5cbf73133e88105fab69622 Auto-generated-cl: translation import --- packages/PrintSpooler/res/values-iw/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/PrintSpooler/res/values-iw/strings.xml b/packages/PrintSpooler/res/values-iw/strings.xml index 74480791c949..60005003e451 100644 --- a/packages/PrintSpooler/res/values-iw/strings.xml +++ b/packages/PrintSpooler/res/values-iw/strings.xml @@ -87,7 +87,7 @@ "מבטל את %1$s" "שגיאת מדפסת ב-%1$s" "המדפסת חסמה את %1$s" - "בטל" + "ביטול" "הפעל מחדש" "אין חיבור למדפסת" "לא ידוע" -- GitLab From 546a45c804c823b90f2418b71938e3bf73d6a861 Mon Sep 17 00:00:00 2001 From: Jeremy Joslin Date: Tue, 25 Apr 2017 15:43:13 -0700 Subject: [PATCH 65/66] Adding the AOSP header. Test: make Bug: 37683421 Change-Id: I0c656b91f3533b87a80c34e7461000e75ee1da8e --- .../net/NetworkRecommendationProvider.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/java/android/net/NetworkRecommendationProvider.java b/core/java/android/net/NetworkRecommendationProvider.java index a6d132e5f28d..d7b58f779625 100644 --- a/core/java/android/net/NetworkRecommendationProvider.java +++ b/core/java/android/net/NetworkRecommendationProvider.java @@ -1,3 +1,19 @@ +/* + * Copyright (C) 2017 The Android Open Source Project + * + * 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.net; import android.Manifest.permission; -- GitLab From 8c5eeb0afc5dad35ee8ce11b9e82f7219a1a609d Mon Sep 17 00:00:00 2001 From: Hugo Benichi Date: Fri, 28 Apr 2017 11:01:22 +0900 Subject: [PATCH 66/66] NsdManager: unit test coverage for servive registration This patch adds test coverage for NsdManager#registerService() and NsdManager#unregisterService(). This test shows a potential defect in the api: if unregisterService() fails, the associated listener is always unregistered from NsdManager. If the service initially registered is still registered, this potentially make it impossible to unregister. Test: added new unit test Bug: 37013369, 33298084 Change-Id: Ia089b6d2f2a349907a8b29d9a3acd7f59e177887 --- core/java/android/net/nsd/NsdManager.java | 2 + .../java/android/net/nsd/NsdManagerTest.java | 85 ++++++++++++++++--- 2 files changed, 74 insertions(+), 13 deletions(-) diff --git a/core/java/android/net/nsd/NsdManager.java b/core/java/android/net/nsd/NsdManager.java index 83c469103f55..4c33c36dc16b 100644 --- a/core/java/android/net/nsd/NsdManager.java +++ b/core/java/android/net/nsd/NsdManager.java @@ -393,6 +393,8 @@ public final class NsdManager { ((RegistrationListener) listener).onUnregistrationFailed(ns, message.arg1); break; case UNREGISTER_SERVICE_SUCCEEDED: + // TODO: do not unregister listener until service is unregistered, or provide + // alternative way for unregistering ? removeListener(message.arg2); ((RegistrationListener) listener).onServiceUnregistered(ns); break; diff --git a/tests/net/java/android/net/nsd/NsdManagerTest.java b/tests/net/java/android/net/nsd/NsdManagerTest.java index b8ed766e3fcb..235556ee8e4f 100644 --- a/tests/net/java/android/net/nsd/NsdManagerTest.java +++ b/tests/net/java/android/net/nsd/NsdManagerTest.java @@ -49,6 +49,8 @@ import java.util.function.Consumer; @SmallTest public class NsdManagerTest { + static final int PROTOCOL = NsdManager.PROTOCOL_DNS_SD; + @Mock Context mContext; @Mock INsdManager mService; MockServiceHandler mServiceHandler; @@ -106,6 +108,65 @@ public class NsdManagerTest { verify(listener2, timeout(mTimeoutMs).times(1)).onServiceResolved(reply); } + @Test + public void testRegisterService() { + NsdManager manager = makeManager(); + + NsdServiceInfo request1 = new NsdServiceInfo("a_name", "a_type"); + NsdServiceInfo request2 = new NsdServiceInfo("another_name", "another_type"); + request1.setPort(2201); + request2.setPort(2202); + NsdManager.RegistrationListener listener1 = mock(NsdManager.RegistrationListener.class); + NsdManager.RegistrationListener listener2 = mock(NsdManager.RegistrationListener.class); + + // Register two services + manager.registerService(request1, PROTOCOL, listener1); + int key1 = verifyRequest(NsdManager.REGISTER_SERVICE); + + manager.registerService(request2, PROTOCOL, listener2); + int key2 = verifyRequest(NsdManager.REGISTER_SERVICE); + + // First reques fails, second request succeeds + sendResponse(NsdManager.REGISTER_SERVICE_SUCCEEDED, 0, key2, request2); + verify(listener2, timeout(mTimeoutMs).times(1)).onServiceRegistered(request2); + + int err = 1; + sendResponse(NsdManager.REGISTER_SERVICE_FAILED, err, key1, request1); + verify(listener1, timeout(mTimeoutMs).times(1)).onRegistrationFailed(request1, err); + + // Client retries first request, it succeeds + manager.registerService(request1, PROTOCOL, listener1); + int key3 = verifyRequest(NsdManager.REGISTER_SERVICE); + + sendResponse(NsdManager.REGISTER_SERVICE_SUCCEEDED, 0, key3, request1); + verify(listener1, timeout(mTimeoutMs).times(1)).onServiceRegistered(request1); + + // First request is unregistered, it succeeds + manager.unregisterService(listener1); + int key3again = verifyRequest(NsdManager.UNREGISTER_SERVICE); + assertEquals(key3, key3again); + + sendResponse(NsdManager.UNREGISTER_SERVICE_SUCCEEDED, 0, key3again, null); + verify(listener1, timeout(mTimeoutMs).times(1)).onServiceUnregistered(request1); + + // Second request is unregistered, it fails + manager.unregisterService(listener2); + int key2again = verifyRequest(NsdManager.UNREGISTER_SERVICE); + assertEquals(key2, key2again); + + sendResponse(NsdManager.UNREGISTER_SERVICE_FAILED, err, key2again, null); + verify(listener2, timeout(mTimeoutMs).times(1)).onUnregistrationFailed(request2, err); + + // TODO: do not unregister listener until service is unregistered + // Client retries unregistration of second request, it succeeds + //manager.unregisterService(listener2); + //int key2yetAgain = verifyRequest(NsdManager.UNREGISTER_SERVICE); + //assertEquals(key2, key2yetAgain); + + //sendResponse(NsdManager.UNREGISTER_SERVICE_SUCCEEDED, 0, key2yetAgain, null); + //verify(listener2, timeout(mTimeoutMs).times(1)).onServiceUnregistered(request2); + } + @Test public void testInvalidCalls() { NsdManager manager = new NsdManager(mContext, mService); @@ -118,38 +179,36 @@ public class NsdManagerTest { NsdServiceInfo validService = new NsdServiceInfo("a_name", "a_type"); validService.setPort(2222); - int protocol = NsdManager.PROTOCOL_DNS_SD; - // Service registration // - invalid arguments mustFail(() -> { manager.unregisterService(null); }); mustFail(() -> { manager.registerService(null, -1, null); }); - mustFail(() -> { manager.registerService(null, protocol, listener1); }); - mustFail(() -> { manager.registerService(invalidService, protocol, listener1); }); + mustFail(() -> { manager.registerService(null, PROTOCOL, listener1); }); + mustFail(() -> { manager.registerService(invalidService, PROTOCOL, listener1); }); mustFail(() -> { manager.registerService(validService, -1, listener1); }); - mustFail(() -> { manager.registerService(validService, protocol, null); }); - manager.registerService(validService, protocol, listener1); + mustFail(() -> { manager.registerService(validService, PROTOCOL, null); }); + manager.registerService(validService, PROTOCOL, listener1); // - listener already registered - mustFail(() -> { manager.registerService(validService, protocol, listener1); }); + mustFail(() -> { manager.registerService(validService, PROTOCOL, listener1); }); manager.unregisterService(listener1); // TODO: make listener immediately reusable //mustFail(() -> { manager.unregisterService(listener1); }); - //manager.registerService(validService, protocol, listener1); + //manager.registerService(validService, PROTOCOL, listener1); // Discover service // - invalid arguments mustFail(() -> { manager.stopServiceDiscovery(null); }); mustFail(() -> { manager.discoverServices(null, -1, null); }); - mustFail(() -> { manager.discoverServices(null, protocol, listener2); }); + mustFail(() -> { manager.discoverServices(null, PROTOCOL, listener2); }); mustFail(() -> { manager.discoverServices("a_service", -1, listener2); }); - mustFail(() -> { manager.discoverServices("a_service", protocol, null); }); - manager.discoverServices("a_service", protocol, listener2); + mustFail(() -> { manager.discoverServices("a_service", PROTOCOL, null); }); + manager.discoverServices("a_service", PROTOCOL, listener2); // - listener already registered - mustFail(() -> { manager.discoverServices("another_service", protocol, listener2); }); + mustFail(() -> { manager.discoverServices("another_service", PROTOCOL, listener2); }); manager.stopServiceDiscovery(listener2); // TODO: make listener immediately reusable //mustFail(() -> { manager.stopServiceDiscovery(listener2); }); - //manager.discoverServices("another_service", protocol, listener2); + //manager.discoverServices("another_service", PROTOCOL, listener2); // Resolver service // - invalid arguments -- GitLab