Merge "AAPT: Move private attrs to new type for framework" into lmp-mr1-dev
diff --git a/Android.mk b/Android.mk
index ce72a85..ba45e6f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -69,6 +69,7 @@
core/java/android/app/IActivityPendingResult.aidl \
core/java/android/app/IAlarmManager.aidl \
core/java/android/app/IAppTask.aidl \
+ core/java/android/app/ITaskStackListener.aidl \
core/java/android/app/IBackupAgent.aidl \
core/java/android/app/IInstrumentationWatcher.aidl \
core/java/android/app/INotificationManager.aidl \
@@ -203,8 +204,8 @@
core/java/android/os/IUpdateLock.aidl \
core/java/android/os/IUserManager.aidl \
core/java/android/os/IVibratorService.aidl \
- core/java/android/service/carriermessaging/ICarrierMessagingCallback.aidl \
- core/java/android/service/carriermessaging/ICarrierMessagingService.aidl \
+ core/java/android/service/carrier/ICarrierMessagingCallback.aidl \
+ core/java/android/service/carrier/ICarrierMessagingService.aidl \
core/java/android/service/notification/INotificationListener.aidl \
core/java/android/service/notification/IStatusBarNotificationHolder.aidl \
core/java/android/service/notification/IConditionListener.aidl \
@@ -523,8 +524,7 @@
frameworks/base/core/java/android/view/textservice/SpellCheckerInfo.aidl \
frameworks/base/core/java/android/view/textservice/SentenceSuggestionsInfo.aidl \
frameworks/base/core/java/android/view/textservice/SuggestionsInfo.aidl \
- frameworks/base/core/java/android/service/carriermessaging/MessagePdu.aidl \
- frameworks/base/core/java/android/service/carriermessaging/CarrierMessagingService.aidl \
+ frameworks/base/core/java/android/service/carrier/MessagePdu.aidl \
frameworks/base/core/java/android/service/notification/StatusBarNotification.aidl \
frameworks/base/core/java/android/speech/tts/Voice.aidl \
frameworks/base/core/java/android/app/usage/UsageEvents.aidl \
@@ -731,7 +731,8 @@
# Whitelist of valid groups, used for default TOC grouping. Each sample must
# belong to one (and only one) group. Assign samples to groups by setting
# a sample.group var to one of these groups in the sample's _index.jd.
-sample_groups := -samplegroup Background \
+sample_groups := -samplegroup Admin \
+ -samplegroup Background \
-samplegroup Connectivity \
-samplegroup Content \
-samplegroup Input \
diff --git a/api/current.txt b/api/current.txt
index bbfbafd..5a17f6f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -8782,11 +8782,9 @@
field public static final java.lang.String FEATURE_CAMERA = "android.hardware.camera";
field public static final java.lang.String FEATURE_CAMERA_ANY = "android.hardware.camera.any";
field public static final java.lang.String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus";
- field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_BURST_CAPTURE = "android.hardware.camera.capability.burst_capture";
field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING = "android.hardware.camera.capability.manual_post_processing";
field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR = "android.hardware.camera.capability.manual_sensor";
field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_RAW = "android.hardware.camera.capability.raw";
- field public static final java.lang.String FEATURE_CAMERA_CAPABILITY_READ_SENSOR_SETTINGS = "android.hardware.camera.capability.read_sensor_settings";
field public static final java.lang.String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external";
field public static final java.lang.String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash";
field public static final java.lang.String FEATURE_CAMERA_FRONT = "android.hardware.camera.front";
@@ -9214,9 +9212,9 @@
method public int getDimensionPixelOffset(int) throws android.content.res.Resources.NotFoundException;
method public int getDimensionPixelSize(int) throws android.content.res.Resources.NotFoundException;
method public android.util.DisplayMetrics getDisplayMetrics();
- method public android.graphics.drawable.Drawable getDrawable(int) throws android.content.res.Resources.NotFoundException;
+ method public deprecated android.graphics.drawable.Drawable getDrawable(int) throws android.content.res.Resources.NotFoundException;
method public android.graphics.drawable.Drawable getDrawable(int, android.content.res.Resources.Theme) throws android.content.res.Resources.NotFoundException;
- method public android.graphics.drawable.Drawable getDrawableForDensity(int, int) throws android.content.res.Resources.NotFoundException;
+ method public deprecated android.graphics.drawable.Drawable getDrawableForDensity(int, int) throws android.content.res.Resources.NotFoundException;
method public android.graphics.drawable.Drawable getDrawableForDensity(int, int, android.content.res.Resources.Theme);
method public float getFraction(int, int, int);
method public int getIdentifier(java.lang.String, java.lang.String, java.lang.String);
@@ -26914,71 +26912,46 @@
}
-package android.service.carriermessaging {
+package android.service.carrier {
public abstract class CarrierMessagingService extends android.app.Service {
ctor public CarrierMessagingService();
method public android.os.IBinder onBind(android.content.Intent);
- method public int onDownloadMms(android.net.Uri, java.lang.String);
- method public boolean onFilterSms(android.service.carriermessaging.MessagePdu, java.lang.String, int);
- method public android.service.carriermessaging.CarrierMessagingService.SendSmsResponse onSendDataSms(byte[], java.lang.String, java.lang.String, int);
- method public android.service.carriermessaging.CarrierMessagingService.SendMmsResult onSendMms(android.net.Uri, java.lang.String);
- method public java.util.List<android.service.carriermessaging.CarrierMessagingService.SendSmsResponse> onSendMultipartTextSms(java.util.List<java.lang.String>, java.lang.String, java.lang.String);
- method public android.service.carriermessaging.CarrierMessagingService.SendSmsResponse onSendTextSms(java.lang.String, java.lang.String, java.lang.String);
+ method public void onDownloadMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Integer>);
+ method public void onFilterSms(android.service.carrier.MessagePdu, java.lang.String, int, int, android.service.carrier.CarrierMessagingService.ResultCallback<java.lang.Boolean>);
+ method public void onSendDataSms(byte[], int, java.lang.String, int, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
+ method public void onSendMms(android.net.Uri, int, android.net.Uri, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMmsResult>);
+ method public void onSendMultipartTextSms(java.util.List<java.lang.String>, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendMultipartSmsResult>);
+ method public void onSendTextSms(java.lang.String, int, java.lang.String, android.service.carrier.CarrierMessagingService.ResultCallback<android.service.carrier.CarrierMessagingService.SendSmsResult>);
field public static final int DOWNLOAD_STATUS_ERROR = 2; // 0x2
field public static final int DOWNLOAD_STATUS_OK = 0; // 0x0
field public static final int DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1
field public static final int SEND_STATUS_ERROR = 2; // 0x2
field public static final int SEND_STATUS_OK = 0; // 0x0
field public static final int SEND_STATUS_RETRY_ON_CARRIER_NETWORK = 1; // 0x1
- field public static final java.lang.String SERVICE_INTERFACE = "android.service.carriermessaging.CarrierMessagingService";
+ field public static final java.lang.String SERVICE_INTERFACE = "android.service.carrier.CarrierMessagingService";
+ }
+
+ public static abstract interface CarrierMessagingService.ResultCallback {
+ method public abstract void onReceiveResult(T) throws android.os.RemoteException;
}
public static final class CarrierMessagingService.SendMmsResult {
ctor public CarrierMessagingService.SendMmsResult(int, byte[]);
- method public int getResult();
method public byte[] getSendConfPdu();
+ method public int getSendStatus();
}
- public static final class CarrierMessagingService.SendSmsResponse implements android.os.Parcelable {
- ctor public CarrierMessagingService.SendSmsResponse(int, byte[], int);
- method public int describeContents();
- method public byte[] getAckPdu();
- method public int getErrorCode();
+ public static final class CarrierMessagingService.SendMultipartSmsResult {
+ ctor public CarrierMessagingService.SendMultipartSmsResult(int, int[]);
+ method public int[] getMessageRefs();
+ method public int getSendStatus();
+ }
+
+ public static final class CarrierMessagingService.SendSmsResult {
+ ctor public CarrierMessagingService.SendSmsResult(int, int);
method public int getMessageRef();
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.service.carriermessaging.CarrierMessagingService.SendSmsResponse> CREATOR;
- }
-
- public abstract interface ICarrierMessagingCallback implements android.os.IInterface {
- method public abstract void onDownloadMmsComplete(int) throws android.os.RemoteException;
- method public abstract void onFilterComplete(boolean) throws android.os.RemoteException;
- method public abstract void onSendMmsComplete(int, byte[]) throws android.os.RemoteException;
- method public abstract void onSendMultipartSmsComplete(int, java.util.List<android.service.carriermessaging.CarrierMessagingService.SendSmsResponse>) throws android.os.RemoteException;
- method public abstract void onSendSmsComplete(int, android.service.carriermessaging.CarrierMessagingService.SendSmsResponse) throws android.os.RemoteException;
- }
-
- public static abstract class ICarrierMessagingCallback.Stub extends android.os.Binder implements android.service.carriermessaging.ICarrierMessagingCallback {
- ctor public ICarrierMessagingCallback.Stub();
- method public android.os.IBinder asBinder();
- method public static android.service.carriermessaging.ICarrierMessagingCallback asInterface(android.os.IBinder);
- method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
- }
-
- public abstract interface ICarrierMessagingService implements android.os.IInterface {
- method public abstract void downloadMms(android.net.Uri, java.lang.String, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
- method public abstract void filterSms(android.service.carriermessaging.MessagePdu, java.lang.String, int, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
- method public abstract void sendDataSms(byte[], java.lang.String, java.lang.String, int, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
- method public abstract void sendMms(android.net.Uri, java.lang.String, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
- method public abstract void sendMultipartTextSms(java.util.List<java.lang.String>, java.lang.String, java.lang.String, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
- method public abstract void sendTextSms(java.lang.String, java.lang.String, java.lang.String, android.service.carriermessaging.ICarrierMessagingCallback) throws android.os.RemoteException;
- }
-
- public static abstract class ICarrierMessagingService.Stub extends android.os.Binder implements android.service.carriermessaging.ICarrierMessagingService {
- ctor public ICarrierMessagingService.Stub();
- method public android.os.IBinder asBinder();
- method public static android.service.carriermessaging.ICarrierMessagingService asInterface(android.os.IBinder);
- method public boolean onTransact(int, android.os.Parcel, android.os.Parcel, int) throws android.os.RemoteException;
+ method public int getSendStatus();
}
public final class MessagePdu implements android.os.Parcelable {
@@ -26986,7 +26959,7 @@
method public int describeContents();
method public java.util.List<byte[]> getPdus();
method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.service.carriermessaging.MessagePdu> CREATOR;
+ field public static final android.os.Parcelable.Creator<android.service.carrier.MessagePdu> CREATOR;
}
}
diff --git a/cmds/appops/src/com/android/commands/appops/AppOpsCommand.java b/cmds/appops/src/com/android/commands/appops/AppOpsCommand.java
index c414f58..3ec63b4 100644
--- a/cmds/appops/src/com/android/commands/appops/AppOpsCommand.java
+++ b/cmds/appops/src/com/android/commands/appops/AppOpsCommand.java
@@ -24,10 +24,12 @@
import android.os.ServiceManager;
import android.os.UserHandle;
+import android.util.TimeUtils;
import com.android.internal.app.IAppOpsService;
import com.android.internal.os.BaseCommand;
import java.io.PrintStream;
+import java.util.List;
/**
* This class is a command line utility for manipulating AppOps permissions.
@@ -40,15 +42,19 @@
@Override
public void onShowUsage(PrintStream out) {
- out.println("usage: adb shell appops set <PACKAGE> <OP> "
- + "<allow|ignore|deny|default> [--user <USER_ID>]\n"
+ out.println("usage: appops set [--user <USER_ID>] <PACKAGE> <OP> <MODE>\n"
+ + " appops get [--user <USER_ID>] <PACKAGE> [<OP>]\n"
+ + " appops reset [--user <USER_ID>] [<PACKAGE>]\n"
+ " <PACKAGE> an Android package name.\n"
+ " <OP> an AppOps operation.\n"
+ + " <MODE> one of allow, ignore, deny, or default\n"
+ " <USER_ID> the user id under which the package is installed. If --user is not\n"
+ " specified, the current user is assumed.\n");
}
private static final String COMMAND_SET = "set";
+ private static final String COMMAND_GET = "get";
+ private static final String COMMAND_RESET = "reset";
@Override
public void onRun() throws Exception {
@@ -58,8 +64,17 @@
runSet();
break;
+ case COMMAND_GET:
+ runGet();
+ break;
+
+ case COMMAND_RESET:
+ runReset();
+ break;
+
default:
- throw new IllegalArgumentException("Unknown command '" + command + "'.");
+ System.err.println("Error: Unknown command: '" + command + "'.");
+ break;
}
}
@@ -71,6 +86,23 @@
private static final String MODE_IGNORE = "ignore";
private static final String MODE_DEFAULT = "default";
+ private int strOpToOp(String op) {
+ try {
+ return AppOpsManager.strOpToOp(op);
+ } catch (IllegalArgumentException e) {
+ }
+ try {
+ return Integer.parseInt(op);
+ } catch (NumberFormatException e) {
+ }
+ try {
+ return AppOpsManager.strDebugOpToOp(op);
+ } catch (IllegalArgumentException e) {
+ System.err.println("Error: " + e.getMessage());
+ return -1;
+ }
+ }
+
private void runSet() throws Exception {
String packageName = null;
String op = null;
@@ -87,20 +119,27 @@
} else if (mode == null) {
mode = argument;
} else {
- throw new IllegalArgumentException("Unsupported argument: " + argument);
+ System.err.println("Error: Unsupported argument: " + argument);
+ return;
}
}
}
if (packageName == null) {
- throw new IllegalArgumentException("Package name not specified.");
+ System.err.println("Error: Package name not specified.");
+ return;
} else if (op == null) {
- throw new IllegalArgumentException("Operation not specified.");
+ System.err.println("Error: Operation not specified.");
+ return;
} else if (mode == null) {
- throw new IllegalArgumentException("Mode not specified.");
+ System.err.println("Error: Mode not specified.");
+ return;
}
- final int opInt = AppOpsManager.strOpToOp(op);
+ final int opInt = strOpToOp(op);
+ if (opInt < 0) {
+ return;
+ }
final int modeInt;
switch (mode) {
case MODE_ALLOW:
@@ -116,7 +155,8 @@
modeInt = AppOpsManager.MODE_DEFAULT;
break;
default:
- throw new IllegalArgumentException("Mode is invalid.");
+ System.err.println("Error: Mode " + mode + " is not valid,");
+ return;
}
// Parsing complete, let's execute the command.
@@ -130,8 +170,155 @@
ServiceManager.getService(Context.APP_OPS_SERVICE));
final int uid = pm.getPackageUid(packageName, userId);
if (uid < 0) {
- throw new Exception("No UID for " + packageName + " for user " + userId);
+ System.err.println("Error: No UID for " + packageName + " in user " + userId);
+ return;
}
appOpsService.setMode(opInt, uid, packageName, modeInt);
}
+
+ private void runGet() throws Exception {
+ String packageName = null;
+ String op = null;
+ int userId = UserHandle.USER_CURRENT;
+ for (String argument; (argument = nextArg()) != null;) {
+ if (ARGUMENT_USER.equals(argument)) {
+ userId = Integer.parseInt(nextArgRequired());
+ } else {
+ if (packageName == null) {
+ packageName = argument;
+ } else if (op == null) {
+ op = argument;
+ } else {
+ System.err.println("Error: Unsupported argument: " + argument);
+ return;
+ }
+ }
+ }
+
+ if (packageName == null) {
+ System.err.println("Error: Package name not specified.");
+ return;
+ }
+
+ final int opInt = op != null ? strOpToOp(op) : 0;
+
+ // Parsing complete, let's execute the command.
+
+ if (userId == UserHandle.USER_CURRENT) {
+ userId = ActivityManager.getCurrentUser();
+ }
+
+ final IPackageManager pm = ActivityThread.getPackageManager();
+ final IAppOpsService appOpsService = IAppOpsService.Stub.asInterface(
+ ServiceManager.getService(Context.APP_OPS_SERVICE));
+ final int uid = pm.getPackageUid(packageName, userId);
+ if (uid < 0) {
+ System.err.println("Error: No UID for " + packageName + " in user " + userId);
+ return;
+ }
+ List<AppOpsManager.PackageOps> ops = appOpsService.getOpsForPackage(uid, packageName,
+ op != null ? new int[] {opInt} : null);
+ if (ops == null || ops.size() <= 0) {
+ System.out.println("No operations.");
+ return;
+ }
+ final long now = System.currentTimeMillis();
+ for (int i=0; i<ops.size(); i++) {
+ List<AppOpsManager.OpEntry> entries = ops.get(i).getOps();
+ for (int j=0; j<entries.size(); j++) {
+ AppOpsManager.OpEntry ent = entries.get(j);
+ System.out.print(AppOpsManager.opToName(ent.getOp()));
+ System.out.print(": ");
+ switch (ent.getMode()) {
+ case AppOpsManager.MODE_ALLOWED:
+ System.out.print("allow");
+ break;
+ case AppOpsManager.MODE_IGNORED:
+ System.out.print("ignore");
+ break;
+ case AppOpsManager.MODE_ERRORED:
+ System.out.print("deny");
+ break;
+ case AppOpsManager.MODE_DEFAULT:
+ System.out.print("default");
+ break;
+ default:
+ System.out.print("mode=");
+ System.out.print(ent.getMode());
+ break;
+ }
+ if (ent.getTime() != 0) {
+ System.out.print("; time=");
+ StringBuilder sb = new StringBuilder();
+ TimeUtils.formatDuration(now - ent.getTime(), sb);
+ System.out.print(sb);
+ System.out.print(" ago");
+ }
+ if (ent.getRejectTime() != 0) {
+ System.out.print("; rejectTime=");
+ StringBuilder sb = new StringBuilder();
+ TimeUtils.formatDuration(now - ent.getRejectTime(), sb);
+ System.out.print(sb);
+ System.out.print(" ago");
+ }
+ if (ent.getDuration() == -1) {
+ System.out.print(" (running)");
+ } else if (ent.getDuration() != 0) {
+ System.out.print("; duration=");
+ StringBuilder sb = new StringBuilder();
+ TimeUtils.formatDuration(ent.getDuration(), sb);
+ System.out.print(sb);
+ }
+ System.out.println();
+ }
+ }
+ }
+
+ private void runReset() throws Exception {
+ String packageName = null;
+ int userId = UserHandle.USER_CURRENT;
+ for (String argument; (argument = nextArg()) != null;) {
+ if (ARGUMENT_USER.equals(argument)) {
+ String userStr = nextArgRequired();
+ if ("all".equals(userStr)) {
+ userId = UserHandle.USER_ALL;
+ } else if ("current".equals(userStr)) {
+ userId = UserHandle.USER_CURRENT;
+ } else if ("owner".equals(userStr)) {
+ userId = UserHandle.USER_OWNER;
+ } else {
+ userId = Integer.parseInt(nextArgRequired());
+ }
+ } else {
+ if (packageName == null) {
+ packageName = argument;
+ } else {
+ System.err.println("Error: Unsupported argument: " + argument);
+ return;
+ }
+ }
+ }
+
+ // Parsing complete, let's execute the command.
+
+ if (userId == UserHandle.USER_CURRENT) {
+ userId = ActivityManager.getCurrentUser();
+ }
+
+ final IAppOpsService appOpsService = IAppOpsService.Stub.asInterface(
+ ServiceManager.getService(Context.APP_OPS_SERVICE));
+ appOpsService.resetAllModes(userId, packageName);
+ System.out.print("Reset all modes for: ");
+ if (userId == UserHandle.USER_ALL) {
+ System.out.print("all users");
+ } else {
+ System.out.print("user "); System.out.print(userId);
+ }
+ System.out.print(", ");
+ if (packageName == null) {
+ System.out.println("all packages");
+ } else {
+ System.out.print("package "); System.out.println(packageName);
+ }
+ }
}
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 6ec48e5..06a26ec 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -774,6 +774,14 @@
return true;
}
+ case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
+ data.enforceInterface(IActivityManager.descriptor);
+ IBinder token = data.readStrongBinder();
+ registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
+ reply.writeNoException();
+ return true;
+ }
+
case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
IBinder token = data.readStrongBinder();
@@ -3266,6 +3274,18 @@
data.recycle();
reply.recycle();
}
+ @Override
+ public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
+ {
+ Parcel data = Parcel.obtain();
+ Parcel reply = Parcel.obtain();
+ data.writeInterfaceToken(IActivityManager.descriptor);
+ data.writeStrongBinder(listener.asBinder());
+ mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
+ reply.readException();
+ data.recycle();
+ reply.recycle();
+ }
public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
{
Parcel data = Parcel.obtain();
diff --git a/core/java/android/app/ActivityTransitionCoordinator.java b/core/java/android/app/ActivityTransitionCoordinator.java
index 9062892..d0d9d71 100644
--- a/core/java/android/app/ActivityTransitionCoordinator.java
+++ b/core/java/android/app/ActivityTransitionCoordinator.java
@@ -641,17 +641,18 @@
Matrix tempMatrix = new Matrix();
for (String name: names) {
Bundle sharedElementBundle = state.getBundle(name);
+ View snapshot = null;
if (sharedElementBundle != null) {
Parcelable parcelable = sharedElementBundle.getParcelable(KEY_SNAPSHOT);
- View snapshot = null;
if (parcelable != null && mListener != null) {
snapshot = mListener.onCreateSnapshotView(context, parcelable);
}
if (snapshot != null) {
setSharedElementState(snapshot, name, state, tempMatrix, null, decorLoc);
}
- snapshots.add(snapshot);
}
+ // Even null snapshots are added so they remain in the same order as shared elements.
+ snapshots.add(snapshot);
}
return snapshots;
}
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index ba9c9d6..95870cf 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -26,6 +26,7 @@
import android.os.Parcelable;
import android.os.Process;
import android.os.RemoteException;
+import android.os.UserHandle;
import android.os.UserManager;
import android.util.ArrayMap;
@@ -734,6 +735,18 @@
}
/**
+ * @hide
+ */
+ public static int strDebugOpToOp(String op) {
+ for (int i=0; i<sOpNames.length; i++) {
+ if (sOpNames[i].equals(op)) {
+ return i;
+ }
+ }
+ throw new IllegalArgumentException("Unknown operation string: " + op);
+ }
+
+ /**
* Retrieve the permission associated with an operation, or null if there is not one.
* @hide
*/
@@ -996,7 +1009,7 @@
/** @hide */
public void resetAllModes() {
try {
- mService.resetAllModes();
+ mService.resetAllModes(UserHandle.myUserId(), null);
} catch (RemoteException e) {
}
}
diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java
index 5362303..1ccbd27 100644
--- a/core/java/android/app/IActivityManager.java
+++ b/core/java/android/app/IActivityManager.java
@@ -139,6 +139,7 @@
public StackInfo getStackInfo(int stackId) throws RemoteException;
public boolean isInHomeStack(int taskId) throws RemoteException;
public void setFocusedStack(int stackId) throws RemoteException;
+ public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException;
public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException;
public ContentProviderHolder getContentProvider(IApplicationThread caller,
String name, int userId, boolean stable) throws RemoteException;
@@ -788,4 +789,5 @@
int LAUNCH_ASSIST_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+239;
int START_IN_PLACE_ANIMATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+240;
int CHECK_PERMISSION_WITH_TOKEN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+241;
+ int REGISTER_TASK_STACK_LISTENER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+242;
}
diff --git a/core/java/android/service/carriermessaging/MessagePdu.aidl b/core/java/android/app/ITaskStackListener.aidl
similarity index 84%
copy from core/java/android/service/carriermessaging/MessagePdu.aidl
copy to core/java/android/app/ITaskStackListener.aidl
index 82b3fb3..4b0935c 100644
--- a/core/java/android/service/carriermessaging/MessagePdu.aidl
+++ b/core/java/android/app/ITaskStackListener.aidl
@@ -14,6 +14,9 @@
* limitations under the License.
*/
-package android.service.carriermessaging;
+package android.app;
-parcelable MessagePdu;
\ No newline at end of file
+/** @hide */
+oneway interface ITaskStackListener {
+ void onTaskStackChanged();
+}
diff --git a/core/java/android/app/backup/WallpaperBackupHelper.java b/core/java/android/app/backup/WallpaperBackupHelper.java
index a55cc2b..7a80936 100644
--- a/core/java/android/app/backup/WallpaperBackupHelper.java
+++ b/core/java/android/app/backup/WallpaperBackupHelper.java
@@ -102,9 +102,8 @@
final Display d = wm.getDefaultDisplay();
final Point size = new Point();
d.getSize(size);
- mDesiredMinWidth = size.x;
+ mDesiredMinWidth = Math.min(size.x, size.y);
mDesiredMinHeight = (double) wpm.getDesiredMinimumHeight();
-
if (mDesiredMinHeight <= 0) {
mDesiredMinHeight = size.y;
}
@@ -149,9 +148,13 @@
// We accept any wallpaper that is at least as wide as our preference
// (i.e. wide enough to fill the screen), and is within a comfortable
// factor of the target height, to avoid significant clipping/scaling/
- // letterboxing.
+ // letterboxing. At this point we know that mDesiredMinWidth is the
+ // smallest dimension, regardless of current orientation, so we can
+ // safely require that the candidate's width and height both exceed
+ // that hard minimum.
final double heightRatio = mDesiredMinHeight / options.outHeight;
if (options.outWidth < mDesiredMinWidth
+ || options.outHeight < mDesiredMinWidth
|| heightRatio >= MAX_HEIGHT_RATIO
|| heightRatio <= MIN_HEIGHT_RATIO) {
// Not wide enough for the screen, or too short/tall to be a good fit
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index 5c705e6..e9f7c50 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -1078,26 +1078,6 @@
"android.hardware.camera.capability.raw";
/**
- * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one
- * of the cameras on the device supports the
- * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_BURST_CAPTURE BURST_CAPTURE}
- * capability level.
- */
- @SdkConstant(SdkConstantType.FEATURE)
- public static final String FEATURE_CAMERA_CAPABILITY_BURST_CAPTURE =
- "android.hardware.camera.capability.burst_capture";
-
- /**
- * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one
- * of the cameras on the device supports the
- * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_READ_SENSOR_SETTINGS READ_SENSOR_SETTINGS}
- * capability level.
- */
- @SdkConstant(SdkConstantType.FEATURE)
- public static final String FEATURE_CAMERA_CAPABILITY_READ_SENSOR_SETTINGS =
- "android.hardware.camera.capability.read_sensor_settings";
-
- /**
* Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device is capable of communicating with
* consumer IR devices.
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 82da7c5..d7d9e8b 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -3528,6 +3528,10 @@
outError[0] = "<provider> does not include authorities attribute";
return null;
}
+ if (cpname.length() <= 0) {
+ outError[0] = "<provider> has empty authorities attribute";
+ return null;
+ }
p.info.authority = cpname.intern();
if (!parseProviderTags(res, parser, attrs, p, outError)) {
diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java
index 78d3e9c..73913b6 100644
--- a/core/java/android/content/res/Resources.java
+++ b/core/java/android/content/res/Resources.java
@@ -744,7 +744,10 @@
* @throws NotFoundException Throws NotFoundException if the given ID does
* not exist.
* @see #getDrawable(int, Theme)
+ * @deprecated Use {@link #getDrawable(int, Theme)} instead.
*/
+ @Deprecated
+ @Nullable
public Drawable getDrawable(int id) throws NotFoundException {
final Drawable d = getDrawable(id, null);
if (d != null && d.canApplyTheme()) {
@@ -769,6 +772,7 @@
* @throws NotFoundException Throws NotFoundException if the given ID does
* not exist.
*/
+ @Nullable
public Drawable getDrawable(int id, @Nullable Theme theme) throws NotFoundException {
TypedValue value;
synchronized (mAccessLock) {
@@ -813,7 +817,10 @@
* @throws NotFoundException Throws NotFoundException if the given ID does
* not exist.
* @see #getDrawableForDensity(int, int, Theme)
+ * @deprecated Use {@link #getDrawableForDensity(int, int, Theme)} instead.
*/
+ @Deprecated
+ @Nullable
public Drawable getDrawableForDensity(int id, int density) throws NotFoundException {
return getDrawableForDensity(id, density, null);
}
@@ -832,6 +839,7 @@
* @throws NotFoundException Throws NotFoundException if the given ID does
* not exist.
*/
+ @Nullable
public Drawable getDrawableForDensity(int id, int density, @Nullable Theme theme) {
TypedValue value;
synchronized (mAccessLock) {
diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java
index 98096dc..f487f01 100644
--- a/core/java/android/hardware/camera2/CameraCharacteristics.java
+++ b/core/java/android/hardware/camera2/CameraCharacteristics.java
@@ -337,8 +337,7 @@
* supported by a given camera device. This field lists the
* valid anti-banding modes that the application may request
* for this camera device with the
- * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control. This list
- * always includes AUTO.</p>
+ * {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode} control.</p>
* <p><b>Range of valid values:</b><br>
* Any value listed in {@link CaptureRequest#CONTROL_AE_ANTIBANDING_MODE android.control.aeAntibandingMode}</p>
* <p>This key is available on all devices.</p>
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index 895ae04..999de8a 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -493,9 +493,11 @@
* {@link CameraCharacteristics#SCALER_STREAM_CONFIGURATION_MAP android.scaler.streamConfigurationMap}, the minimum frame
* duration for that format and size is <= 1/20 s, and
* the {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES android.control.aeAvailableTargetFpsRanges} entry
- * lists at least one FPS range where the minimum FPS
- * is >= 1 / minimumFrameDuration for the maximum-size
+ * lists at least one FPS range where the minimum FPS is</p>
+ * <blockquote>
+ * <p>= 1 / minimumFrameDuration for the maximum-size
* YUV_420_888 format.</p>
+ * </blockquote>
* <p>In addition, the {@link CameraCharacteristics#SYNC_MAX_LATENCY android.sync.maxLatency} field is
* guaranted to have a value between 0 and 4, inclusive.</p>
*
@@ -847,7 +849,8 @@
/**
* <p>The camera device will automatically adapt its
* antibanding routine to the current illumination
- * conditions. This is the default.</p>
+ * condition. This is the default mode if AUTO is
+ * available on given camera device.</p>
* @see CaptureRequest#CONTROL_AE_ANTIBANDING_MODE
*/
public static final int CONTROL_AE_ANTIBANDING_MODE_AUTO = 3;
diff --git a/core/java/android/hardware/camera2/CaptureRequest.java b/core/java/android/hardware/camera2/CaptureRequest.java
index 48af67c..e89a402 100644
--- a/core/java/android/hardware/camera2/CaptureRequest.java
+++ b/core/java/android/hardware/camera2/CaptureRequest.java
@@ -642,8 +642,10 @@
* options for the antibanding mode. The
* {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
* the available modes for a given camera device.</p>
- * <p>The default mode is AUTO, which is supported by all
- * camera devices.</p>
+ * <p>AUTO mode is the default if it is available on given
+ * camera device. When AUTO mode is not available, the
+ * default will be either 50HZ or 60HZ, and both 50HZ
+ * and 60HZ will be available.</p>
* <p>If manual exposure control is enabled (by setting
* {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
* then this setting has no effect, and the application must
diff --git a/core/java/android/hardware/camera2/CaptureResult.java b/core/java/android/hardware/camera2/CaptureResult.java
index c5c843d..2c3b85f 100644
--- a/core/java/android/hardware/camera2/CaptureResult.java
+++ b/core/java/android/hardware/camera2/CaptureResult.java
@@ -493,8 +493,10 @@
* options for the antibanding mode. The
* {@link CameraCharacteristics#CONTROL_AE_AVAILABLE_ANTIBANDING_MODES android.control.aeAvailableAntibandingModes} key contains
* the available modes for a given camera device.</p>
- * <p>The default mode is AUTO, which is supported by all
- * camera devices.</p>
+ * <p>AUTO mode is the default if it is available on given
+ * camera device. When AUTO mode is not available, the
+ * default will be either 50HZ or 60HZ, and both 50HZ
+ * and 60HZ will be available.</p>
* <p>If manual exposure control is enabled (by setting
* {@link CaptureRequest#CONTROL_AE_MODE android.control.aeMode} or {@link CaptureRequest#CONTROL_MODE android.control.mode} to OFF),
* then this setting has no effect, and the application must
diff --git a/core/java/android/inputmethodservice/KeyboardView.java b/core/java/android/inputmethodservice/KeyboardView.java
index 3175345..b777e8c 100644
--- a/core/java/android/inputmethodservice/KeyboardView.java
+++ b/core/java/android/inputmethodservice/KeyboardView.java
@@ -983,7 +983,7 @@
// This is very efficient since the properties are cached.
final boolean speakPassword = Settings.Secure.getIntForUser(
mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0,
- UserHandle.USER_CURRENT) != 0;
+ UserHandle.USER_CURRENT_OR_SELF) != 0;
// Add text only if password announcement is enabled or if headset is
// used to avoid leaking passwords.
if (speakPassword || mAudioManager.isBluetoothA2dpOn()
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index ff1a441..4fe418a 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -100,7 +100,7 @@
/**
* Identical to {@link #CONNECTIVITY_ACTION} broadcast, but sent without any
- * applicable {@link Settings.Global#CONNECTIVITY_CHANGE_DELAY}.
+ * historic {@link Settings.Global#CONNECTIVITY_CHANGE_DELAY}.
*
* @hide
*/
@@ -428,18 +428,6 @@
public static final int DEFAULT_NETWORK_PREFERENCE = TYPE_WIFI;
/**
- * Default value for {@link Settings.Global#CONNECTIVITY_CHANGE_DELAY} in
- * milliseconds. This was introduced because IPv6 routes seem to take a
- * moment to settle - trying network activity before the routes are adjusted
- * can lead to packets using the wrong interface or having the wrong IP address.
- * This delay is a bit crude, but in the future hopefully we will have kernel
- * notifications letting us know when it's safe to use the new network.
- *
- * @hide
- */
- public static final int CONNECTIVITY_CHANGE_DELAY_DEFAULT = 3000;
-
- /**
* @hide
*/
public final static int REQUEST_ID_UNSET = 0;
@@ -721,6 +709,19 @@
}
/**
+ * Returns an array of of {@link NetworkCapabilities} objects, representing
+ * the Networks that applications run by the given user will use by default.
+ * @hide
+ */
+ public NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId) {
+ try {
+ return mService.getDefaultNetworkCapabilitiesForUser(userId);
+ } catch (RemoteException e) {
+ return null;
+ }
+ }
+
+ /**
* Returns details about the Provisioning or currently active default data network. When
* connected, this network is the default route for outgoing connections.
* You should always check {@link NetworkInfo#isConnected()} before initiating
diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl
index 79f920e..8021210 100644
--- a/core/java/android/net/IConnectivityManager.aidl
+++ b/core/java/android/net/IConnectivityManager.aidl
@@ -49,6 +49,7 @@
NetworkInfo[] getAllNetworkInfo();
Network getNetworkForType(int networkType);
Network[] getAllNetworks();
+ NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId);
NetworkInfo getProvisioningOrActiveNetworkInfo();
diff --git a/core/java/android/net/NetworkCapabilities.java b/core/java/android/net/NetworkCapabilities.java
index ce7ad65..a7f9c5b 100644
--- a/core/java/android/net/NetworkCapabilities.java
+++ b/core/java/android/net/NetworkCapabilities.java
@@ -154,9 +154,16 @@
*/
public static final int NET_CAPABILITY_NOT_VPN = 15;
+ /**
+ * Indicates that connectivity on this network was successfully validated. For example, for a
+ * network with NET_CAPABILITY_INTERNET, it means that Internet connectivity was successfully
+ * detected.
+ * @hide
+ */
+ public static final int NET_CAPABILITY_VALIDATED = 16;
private static final int MIN_NET_CAPABILITY = NET_CAPABILITY_MMS;
- private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_NOT_VPN;
+ private static final int MAX_NET_CAPABILITY = NET_CAPABILITY_VALIDATED;
/**
* Adds the given capability to this {@code NetworkCapability} instance.
diff --git a/core/java/android/net/VpnService.java b/core/java/android/net/VpnService.java
index 78b9c18..f6b6978 100644
--- a/core/java/android/net/VpnService.java
+++ b/core/java/android/net/VpnService.java
@@ -291,16 +291,16 @@
/**
* Sets the underlying networks used by the VPN for its upstream connections.
*
- * Used by the system to know the actual networks that carry traffic for apps affected by this
- * VPN in order to present this information to the user (e.g., via status bar icons).
+ * <p>Used by the system to know the actual networks that carry traffic for apps affected by
+ * this VPN in order to present this information to the user (e.g., via status bar icons).
*
- * This method only needs to be called if the VPN has explicitly bound its underlying
+ * <p>This method only needs to be called if the VPN has explicitly bound its underlying
* communications channels — such as the socket(s) passed to {@link #protect(int)} —
* to a {@code Network} using APIs such as {@link Network#bindSocket(Socket)} or
* {@link Network#bindSocket(DatagramSocket)}. The VPN should call this method every time
* the set of {@code Network}s it is using changes.
*
- * {@code networks} is one of the following:
+ * <p>{@code networks} is one of the following:
* <ul>
* <li><strong>a non-empty array</strong>: an array of one or more {@link Network}s, in
* decreasing preference order. For example, if this VPN uses both wifi and mobile (cellular)
@@ -310,11 +310,11 @@
* underlying network connection, and thus, app traffic will not be sent or received.</li>
* <li><strong>null</strong>: (default) signifies that the VPN uses whatever is the system's
* default network. I.e., it doesn't use the {@code bindSocket} or {@code bindDatagramSocket}
- * APIs mentioned above to send traffic over specific channels.
+ * APIs mentioned above to send traffic over specific channels.</li>
* </ul>
*
- * This call will succeed only if the VPN is currently established. For setting this value when
- * the VPN has not yet been established, see {@link Builder#setUnderlyingNetworks}.
+ * <p>This call will succeed only if the VPN is currently established. For setting this value
+ * when the VPN has not yet been established, see {@link Builder#setUnderlyingNetworks}.
*
* @param networks An array of networks the VPN uses to tunnel traffic to/from its servers.
*
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 5e5fbc7..3bc74ae 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -6118,7 +6118,7 @@
/**
* The number of milliseconds to delay before sending out
- * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts.
+ * {@link ConnectivityManager#CONNECTIVITY_ACTION} broadcasts. Ignored.
*
* @hide
*/
@@ -6608,6 +6608,14 @@
public static final String ENHANCED_4G_MODE_ENABLED = "volte_vt_enabled";
/**
+ * Global override to disable VoLTE (independent of user setting)
+ * <p>
+ * Type: int (1 for disable VoLTE, 0 to use user configuration)
+ * @hide
+ */
+ public static final String VOLTE_FEATURE_DISABLED = "volte_feature_disabled";
+
+ /**
* Whether user can enable/disable LTE as a preferred network. A carrier might control
* this via gservices, OMA-DM, carrier app, etc.
* <p>
diff --git a/core/java/android/service/carrier/CarrierMessagingService.java b/core/java/android/service/carrier/CarrierMessagingService.java
new file mode 100644
index 0000000..3d6ebca
--- /dev/null
+++ b/core/java/android/service/carrier/CarrierMessagingService.java
@@ -0,0 +1,417 @@
+/*
+ * Copyright (C) 2014 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.service.carrier;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.SdkConstant;
+import android.app.Service;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.IBinder;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.os.RemoteException;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A service that receives calls from the system when new SMS and MMS are
+ * sent or received.
+ * <p>To extend this class, you must declare the service in your manifest file with
+ * the {@link android.Manifest.permission#BIND_CARRIER_MESSAGING_SERVICE} permission
+ * and include an intent filter with the {@link #SERVICE_INTERFACE} action. For example:</p>
+ * <pre>
+ * <service android:name=".MyMessagingService"
+ * android:label="@string/service_name"
+ * android:permission="android.permission.BIND_CARRIER_MESSAGING_SERVICE">
+ * <intent-filter>
+ * <action android:name="android.service.carrier.CarrierMessagingService" />
+ * </intent-filter>
+ * </service></pre>
+ */
+public abstract class CarrierMessagingService extends Service {
+ /**
+ * The {@link android.content.Intent} that must be declared as handled by the service.
+ */
+ @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION)
+ public static final String SERVICE_INTERFACE
+ = "android.service.carrier.CarrierMessagingService";
+
+ /**
+ * Indicates that an SMS or MMS message was successfully sent.
+ */
+ public static final int SEND_STATUS_OK = 0;
+
+ /**
+ * SMS/MMS sending failed. We should retry via the carrier network.
+ */
+ public static final int SEND_STATUS_RETRY_ON_CARRIER_NETWORK = 1;
+
+ /**
+ * SMS/MMS sending failed. We should not retry via the carrier network.
+ */
+ public static final int SEND_STATUS_ERROR = 2;
+
+ /**
+ * Successfully downloaded an MMS message.
+ */
+ public static final int DOWNLOAD_STATUS_OK = 0;
+
+ /**
+ * MMS downloading failed. We should retry via the carrier network.
+ */
+ public static final int DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK = 1;
+
+ /**
+ * MMS downloading failed. We should not retry via the carrier network.
+ */
+ public static final int DOWNLOAD_STATUS_ERROR = 2;
+
+ private final ICarrierMessagingWrapper mWrapper = new ICarrierMessagingWrapper();
+
+ /**
+ * Override this method to filter inbound SMS messages.
+ *
+ * @param pdu the PDUs of the message
+ * @param format the format of the PDUs, typically "3gpp" or "3gpp2"
+ * @param destPort the destination port of a binary SMS, this will be -1 for text SMS
+ * @param subId SMS subscription ID of the SIM
+ * @param callback result callback. Call with {@code true} to keep an inbound SMS message and
+ * deliver to SMS apps, and {@code false} to drop the message.
+ */
+ public void onFilterSms(@NonNull MessagePdu pdu, @NonNull String format, int destPort,
+ int subId, @NonNull ResultCallback<Boolean> callback) {
+ // optional
+ try {
+ callback.onReceiveResult(true);
+ } catch (RemoteException ex) {
+ }
+ }
+
+ /**
+ * Override this method to intercept text SMSs sent from the device.
+ *
+ * @param text the text to send
+ * @param subId SMS subscription ID of the SIM
+ * @param destAddress phone number of the recipient of the message
+ * @param callback result callback. Call with a {@link SendSmsResult}.
+ */
+ public void onSendTextSms(
+ @NonNull String text, int subId, @NonNull String destAddress,
+ @NonNull ResultCallback<SendSmsResult> callback) {
+ // optional
+ try {
+ callback.onReceiveResult(new SendSmsResult(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, 0));
+ } catch (RemoteException ex) {
+ }
+ }
+
+ /**
+ * Override this method to intercept binary SMSs sent from the device.
+ *
+ * @param data the binary content
+ * @param subId SMS subscription ID of the SIM
+ * @param destAddress phone number of the recipient of the message
+ * @param destPort the destination port
+ * @param callback result callback. Call with a {@link SendSmsResult}.
+ */
+ public void onSendDataSms(@NonNull byte[] data, int subId,
+ @NonNull String destAddress, int destPort,
+ @NonNull ResultCallback<SendSmsResult> callback) {
+ // optional
+ try {
+ callback.onReceiveResult(new SendSmsResult(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, 0));
+ } catch (RemoteException ex) {
+ }
+ }
+
+ /**
+ * Override this method to intercept long SMSs sent from the device.
+ *
+ * @param parts a {@link List} of the message parts
+ * @param subId SMS subscription ID of the SIM
+ * @param destAddress phone number of the recipient of the message
+ * @param callback result callback. Call with a {@link SendMultipartSmsResult}.
+ */
+ public void onSendMultipartTextSms(@NonNull List<String> parts,
+ int subId, @NonNull String destAddress,
+ @NonNull ResultCallback<SendMultipartSmsResult> callback) {
+ // optional
+ try {
+ callback.onReceiveResult(
+ new SendMultipartSmsResult(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, null));
+ } catch (RemoteException ex) {
+ }
+ }
+
+ /**
+ * Override this method to intercept MMSs sent from the device.
+ *
+ * @param pduUri the content provider URI of the PDU to send
+ * @param subId SMS subscription ID of the SIM
+ * @param location the optional URI to send this MMS PDU. If this is {code null},
+ * the PDU should be sent to the default MMSC URL.
+ * @param callback result callback. Call with a {@link SendMmsResult}.
+ */
+ public void onSendMms(@NonNull Uri pduUri, int subId,
+ @Nullable Uri location, @NonNull ResultCallback<SendMmsResult> callback) {
+ // optional
+ try {
+ callback.onReceiveResult(new SendMmsResult(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, null));
+ } catch (RemoteException ex) {
+ }
+ }
+
+ /**
+ * Override this method to download MMSs received.
+ *
+ * @param contentUri the content provider URI of the PDU to be downloaded.
+ * @param subId SMS subscription ID of the SIM
+ * @param location the URI of the message to be downloaded.
+ * @param callback result callback. Call with a status code which is one of
+ * {@link #DOWNLOAD_STATUS_OK},
+ * {@link #DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK}, or {@link #DOWNLOAD_STATUS_ERROR}.
+ */
+ public void onDownloadMms(@NonNull Uri contentUri, int subId, @NonNull Uri location,
+ @NonNull ResultCallback<Integer> callback) {
+ // optional
+ try {
+ callback.onReceiveResult(DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK);
+ } catch (RemoteException ex) {
+ }
+ }
+
+ @Override
+ public @Nullable IBinder onBind(@NonNull Intent intent) {
+ if (!SERVICE_INTERFACE.equals(intent.getAction())) {
+ return null;
+ }
+ return mWrapper;
+ }
+
+ /**
+ * The result of sending an MMS.
+ */
+ public static final class SendMmsResult {
+ private int mSendStatus;
+ private byte[] mSendConfPdu;
+
+ /**
+ * Constructs a SendMmsResult with the MMS send result, and the SendConf PDU.
+ *
+ * @param sendStatus send status, one of {@link #SEND_STATUS_OK},
+ * {@link #SEND_STATUS_RETRY_ON_CARRIER_NETWORK}, and
+ * {@link #SEND_STATUS_ERROR}
+ * @param sendConfPdu a possibly {code null} SendConf PDU, which confirms that the message
+ * was sent. sendConfPdu is ignored if the {@code result} is not
+ * {@link #SEND_STATUS_OK}.
+ */
+ public SendMmsResult(int sendStatus, @Nullable byte[] sendConfPdu) {
+ mSendStatus = sendStatus;
+ mSendConfPdu = sendConfPdu;
+ }
+
+ /**
+ * Returns the send status of the just-sent MMS.
+ *
+ * @return the send status which is one of {@link #SEND_STATUS_OK},
+ * {@link #SEND_STATUS_RETRY_ON_CARRIER_NETWORK}, and {@link #SEND_STATUS_ERROR}
+ */
+ public int getSendStatus() {
+ return mSendStatus;
+ }
+
+ /**
+ * Returns the SendConf PDU, which confirms that the message was sent.
+ *
+ * @return the SendConf PDU
+ */
+ public @Nullable byte[] getSendConfPdu() {
+ return mSendConfPdu;
+ }
+ }
+
+ /**
+ * The result of sending an SMS.
+ */
+ public static final class SendSmsResult {
+ private final int mSendStatus;
+ private final int mMessageRef;
+
+ /**
+ * Constructs a SendSmsResult with the send status and message reference for the
+ * just-sent SMS.
+ *
+ * @param sendStatus send status, one of {@link #SEND_STATUS_OK},
+ * {@link #SEND_STATUS_RETRY_ON_CARRIER_NETWORK}, and {@link #SEND_STATUS_ERROR}.
+ * @param messageRef message reference of the just-sent SMS. This field is applicable only
+ * if send status is {@link #SEND_STATUS_OK}.
+ */
+ public SendSmsResult(int sendStatus, int messageRef) {
+ mSendStatus = sendStatus;
+ mMessageRef = messageRef;
+ }
+
+ /**
+ * Returns the message reference of the just-sent SMS.
+ *
+ * @return the message reference
+ */
+ public int getMessageRef() {
+ return mMessageRef;
+ }
+
+ /**
+ * Returns the send status of the just-sent SMS.
+ *
+ * @return the send status
+ */
+ public int getSendStatus() {
+ return mSendStatus;
+ }
+ }
+
+ /**
+ * The result of sending a multipart SMS.
+ */
+ public static final class SendMultipartSmsResult {
+ private final int mSendStatus;
+ private final int[] mMessageRefs;
+
+ /**
+ * Constructs a SendMultipartSmsResult with the send status and message references for the
+ * just-sent multipart SMS.
+ *
+ * @param sendStatus send status, one of {@link #SEND_STATUS_OK},
+ * {@link #SEND_STATUS_RETRY_ON_CARRIER_NETWORK}, and {@link #SEND_STATUS_ERROR}.
+ * @param messageRefs an array of message references, one for each part of the
+ * multipart SMS. This field is applicable only if send status is
+ * {@link #SEND_STATUS_OK}.
+ */
+ public SendMultipartSmsResult(int sendStatus, @Nullable int[] messageRefs) {
+ mSendStatus = sendStatus;
+ mMessageRefs = messageRefs;
+ }
+
+ /**
+ * Returns the message references of the just-sent multipart SMS.
+ *
+ * @return the message references, one for each part of the multipart SMS
+ */
+ public @Nullable int[] getMessageRefs() {
+ return mMessageRefs;
+ }
+
+ /**
+ * Returns the send status of the just-sent SMS.
+ *
+ * @return the send status
+ */
+ public int getSendStatus() {
+ return mSendStatus;
+ }
+ }
+
+ /**
+ * A callback interface used to provide results asynchronously.
+ */
+ public interface ResultCallback<T> {
+ /**
+ * Invoked when the result is available.
+ *
+ * @param result the result
+ */
+ public void onReceiveResult(@NonNull T result) throws RemoteException;
+ };
+
+ /**
+ * A wrapper around ICarrierMessagingService to enable the carrier messaging app to implement
+ * methods it cares about in the {@link ICarrierMessagingService} interface.
+ */
+ private class ICarrierMessagingWrapper extends ICarrierMessagingService.Stub {
+ @Override
+ public void filterSms(MessagePdu pdu, String format, int destPort,
+ int subId, final ICarrierMessagingCallback callback) {
+ onFilterSms(pdu, format, destPort, subId, new ResultCallback<Boolean>() {
+ @Override
+ public void onReceiveResult(final Boolean result) throws RemoteException {
+ callback.onFilterComplete(result);
+ }
+ });
+ }
+
+ @Override
+ public void sendTextSms(String text, int subId, String destAddress,
+ final ICarrierMessagingCallback callback) {
+ onSendTextSms(text, subId, destAddress, new ResultCallback<SendSmsResult>() {
+ @Override
+ public void onReceiveResult(final SendSmsResult result) throws RemoteException {
+ callback.onSendSmsComplete(result.getSendStatus(), result.getMessageRef());
+ }
+ });
+ }
+
+ @Override
+ public void sendDataSms(byte[] data, int subId, String destAddress, int destPort,
+ final ICarrierMessagingCallback callback) {
+ onSendDataSms(data, subId, destAddress, destPort, new ResultCallback<SendSmsResult>() {
+ @Override
+ public void onReceiveResult(final SendSmsResult result) throws RemoteException {
+ callback.onSendSmsComplete(result.getSendStatus(), result.getMessageRef());
+ }
+ });
+ }
+
+ @Override
+ public void sendMultipartTextSms(List<String> parts, int subId, String destAddress,
+ final ICarrierMessagingCallback callback) {
+ onSendMultipartTextSms(parts, subId, destAddress,
+ new ResultCallback<SendMultipartSmsResult>() {
+ @Override
+ public void onReceiveResult(final SendMultipartSmsResult result)
+ throws RemoteException {
+ callback.onSendMultipartSmsComplete(
+ result.getSendStatus(), result.getMessageRefs());
+ }
+ });
+ }
+
+ @Override
+ public void sendMms(Uri pduUri, int subId, Uri location,
+ final ICarrierMessagingCallback callback) {
+ onSendMms(pduUri, subId, location, new ResultCallback<SendMmsResult>() {
+ @Override
+ public void onReceiveResult(final SendMmsResult result) throws RemoteException {
+ callback.onSendMmsComplete(result.getSendStatus(), result.getSendConfPdu());
+ }
+ });
+ }
+
+ @Override
+ public void downloadMms(Uri pduUri, int subId, Uri location,
+ final ICarrierMessagingCallback callback) {
+ onDownloadMms(pduUri, subId, location, new ResultCallback<Integer>() {
+ @Override
+ public void onReceiveResult(Integer result) throws RemoteException {
+ callback.onDownloadMmsComplete(result);
+ }
+ });
+ }
+ }
+}
diff --git a/core/java/android/service/carriermessaging/ICarrierMessagingCallback.aidl b/core/java/android/service/carrier/ICarrierMessagingCallback.aidl
similarity index 73%
rename from core/java/android/service/carriermessaging/ICarrierMessagingCallback.aidl
rename to core/java/android/service/carrier/ICarrierMessagingCallback.aidl
index da56ad1..6118a20 100644
--- a/core/java/android/service/carriermessaging/ICarrierMessagingCallback.aidl
+++ b/core/java/android/service/carrier/ICarrierMessagingCallback.aidl
@@ -14,20 +14,17 @@
* limitations under the License.
*/
-package android.service.carriermessaging;
-
-import android.service.carriermessaging.CarrierMessagingService;
+package android.service.carrier;
/**
* Callback interface definition for the Carrier Messaging Service client to get informed of the
* result of various API invocations.
+ * @hide
*/
oneway interface ICarrierMessagingCallback {
void onFilterComplete(boolean keepMessage);
- void onSendSmsComplete(
- int result, in CarrierMessagingService.SendSmsResponse sendSmsResponse);
- void onSendMultipartSmsComplete(
- int result, in List<CarrierMessagingService.SendSmsResponse> sendSmsResponses);
+ void onSendSmsComplete(int result, int messageRef);
+ void onSendMultipartSmsComplete(int result, in int[] messageRefs);
void onSendMmsComplete(int result, in byte[] sendConfPdu);
void onDownloadMmsComplete(int result);
}
diff --git a/core/java/android/service/carriermessaging/ICarrierMessagingService.aidl b/core/java/android/service/carrier/ICarrierMessagingService.aidl
similarity index 72%
rename from core/java/android/service/carriermessaging/ICarrierMessagingService.aidl
rename to core/java/android/service/carrier/ICarrierMessagingService.aidl
index 6e9e3fa..40a9047 100644
--- a/core/java/android/service/carriermessaging/ICarrierMessagingService.aidl
+++ b/core/java/android/service/carrier/ICarrierMessagingService.aidl
@@ -14,15 +14,16 @@
* limitations under the License.
*/
-package android.service.carriermessaging;
+package android.service.carrier;
import android.net.Uri;
-import android.service.carriermessaging.ICarrierMessagingCallback;
-import android.service.carriermessaging.MessagePdu;
+import android.service.carrier.ICarrierMessagingCallback;
+import android.service.carrier.MessagePdu;
/**
* <p class="note"><strong>Note:</strong>
* This service can only be implemented by a carrier privileged app.
+ * @hide
*/
oneway interface ICarrierMessagingService {
/**
@@ -32,10 +33,12 @@
* @param pdu the PDUs of the message
* @param format the format of the PDUs, typically "3gpp" or "3gpp2"
* @param destPort the destination port of a data SMS. It will be -1 for text SMS
+ * @param subId SMS subscription ID of the SIM
* @param callback the callback to notify upon completion
*/
void filterSms(
- in MessagePdu pdu, String format, int destPort, in ICarrierMessagingCallback callback);
+ in MessagePdu pdu, String format, int destPort, int subId,
+ in ICarrierMessagingCallback callback);
/**
* Request sending a new text SMS from the device.
@@ -43,11 +46,11 @@
* status.
*
* @param text the text to send
- * @param format the format of the response PDU, typically "3gpp" or "3gpp2"
+ * @param subId SMS subscription ID of the SIM
* @param destAddress phone number of the recipient of the message
* @param callback the callback to notify upon completion
*/
- void sendTextSms(String text, String format, String destAddress,
+ void sendTextSms(String text, int subId, String destAddress,
in ICarrierMessagingCallback callback);
/**
@@ -56,12 +59,12 @@
* status.
*
* @param data the data to send
- * @param format the format of the response PDU, typically "3gpp" or "3gpp2"
+ * @param subId SMS subscription ID of the SIM
* @param destAddress phone number of the recipient of the message
* @param destPort port number of the recipient of the message
* @param callback the callback to notify upon completion
*/
- void sendDataSms(in byte[] data, String format, String destAddress, int destPort,
+ void sendDataSms(in byte[] data, int subId, String destAddress, int destPort,
in ICarrierMessagingCallback callback);
/**
@@ -70,11 +73,11 @@
* with the send status.
*
* @param parts the parts of the multi-part text SMS to send
- * @param format the format of the response PDU, typically "3gpp" or "3gpp2"
+ * @param subId SMS subscription ID of the SIM
* @param destAddress phone number of the recipient of the message
* @param callback the callback to notify upon completion
*/
- void sendMultipartTextSms(in List<String> parts, String format, String destAddress,
+ void sendMultipartTextSms(in List<String> parts, int subId, String destAddress,
in ICarrierMessagingCallback callback);
/**
@@ -83,11 +86,13 @@
* status.
*
* @param pduUri the content provider URI of the PDU to send
- * @param locationUrl the optional url to send this MMS PDU.
- * If this is not specified, PDU should be sent to the default MMSC url.
+ * @param subId SMS subscription ID of the SIM
+ * @param location the optional URI to send this MMS PDU. If this is {code null},
+ * the PDU should be sent to the default MMSC URL.
* @param callback the callback to notify upon completion
*/
- void sendMms(in Uri pduUri, String locationUrl, in ICarrierMessagingCallback callback);
+ void sendMms(in Uri pduUri, int subId, in Uri location,
+ in ICarrierMessagingCallback callback);
/**
* Request downloading a new MMS.
@@ -95,9 +100,11 @@
* download status.
*
* @param pduUri the content provider URI of the PDU to be downloaded.
- * @param locationUrl the URL of the message to be downloaded.
+ * @param subId SMS subscription ID of the SIM
+ * @param location the URI of the message to be downloaded.
* @param callback the callback to notify upon completion
*/
- void downloadMms(in Uri pduUri, String locationUrl, in ICarrierMessagingCallback callback);
+ void downloadMms(in Uri pduUri, int subId, in Uri location,
+ in ICarrierMessagingCallback callback);
}
diff --git a/core/java/android/service/carriermessaging/MessagePdu.aidl b/core/java/android/service/carrier/MessagePdu.aidl
similarity index 93%
rename from core/java/android/service/carriermessaging/MessagePdu.aidl
rename to core/java/android/service/carrier/MessagePdu.aidl
index 82b3fb3..f0528a5 100644
--- a/core/java/android/service/carriermessaging/MessagePdu.aidl
+++ b/core/java/android/service/carrier/MessagePdu.aidl
@@ -14,6 +14,6 @@
* limitations under the License.
*/
-package android.service.carriermessaging;
+package android.service.carrier;
-parcelable MessagePdu;
\ No newline at end of file
+parcelable MessagePdu;
diff --git a/core/java/android/service/carriermessaging/MessagePdu.java b/core/java/android/service/carrier/MessagePdu.java
similarity index 98%
rename from core/java/android/service/carriermessaging/MessagePdu.java
rename to core/java/android/service/carrier/MessagePdu.java
index 3c78568..ca18e53 100644
--- a/core/java/android/service/carriermessaging/MessagePdu.java
+++ b/core/java/android/service/carrier/MessagePdu.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package android.service.carriermessaging;
+package android.service.carrier;
import android.annotation.NonNull;
import android.os.Parcel;
diff --git a/core/java/android/service/carriermessaging/CarrierMessagingService.aidl b/core/java/android/service/carriermessaging/CarrierMessagingService.aidl
deleted file mode 100644
index 50c438a..0000000
--- a/core/java/android/service/carriermessaging/CarrierMessagingService.aidl
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Copyright (c) 2014, 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.service.carriermessaging;
-
-parcelable CarrierMessagingService.SendSmsResponse;
\ No newline at end of file
diff --git a/core/java/android/service/carriermessaging/CarrierMessagingService.java b/core/java/android/service/carriermessaging/CarrierMessagingService.java
deleted file mode 100644
index 7aea590..0000000
--- a/core/java/android/service/carriermessaging/CarrierMessagingService.java
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * Copyright (C) 2014 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.service.carriermessaging;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.SdkConstant;
-import android.app.Service;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.IBinder;
-import android.os.Parcel;
-import android.os.Parcelable;
-import android.os.RemoteException;
-
-import java.util.List;
-
-/**
- * A service that receives calls from the system when new SMS and MMS are
- * sent or received.
- * <p>To extend this class, you must declare the service in your manifest file with
- * the {@link android.Manifest.permission#BIND_CARRIER_MESSAGING_SERVICE} permission
- * and include an intent filter with the {@link #SERVICE_INTERFACE} action. For example:</p>
- * <pre>
- * <service android:name=".MyMessagingService"
- * android:label="@string/service_name"
- * android:permission="android.permission.BIND_CARRIER_MESSAGING_SERVICE">
- * <intent-filter>
- * <action android:name="android.service.carriermessaging.CarrierMessagingService" />
- * </intent-filter>
- * </service></pre>
- */
-public abstract class CarrierMessagingService extends Service {
- /**
- * The {@link android.content.Intent} that must be declared as handled by the service.
- */
- @SdkConstant(SdkConstant.SdkConstantType.SERVICE_ACTION)
- public static final String SERVICE_INTERFACE
- = "android.service.carriermessaging.CarrierMessagingService";
-
- /**
- * Indicates that an SMS or MMS message was successfully sent.
- */
- public static final int SEND_STATUS_OK = 0;
-
- /**
- * SMS/MMS sending failed. We should retry via the carrier network.
- */
- public static final int SEND_STATUS_RETRY_ON_CARRIER_NETWORK = 1;
-
- /**
- * SMS/MMS sending failed. We should not retry via the carrier network.
- */
- public static final int SEND_STATUS_ERROR = 2;
-
- /**
- * Successfully downloaded an MMS message.
- */
- public static final int DOWNLOAD_STATUS_OK = 0;
-
- /**
- * MMS downloading failed. We should retry via the carrier network.
- */
- public static final int DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK = 1;
-
- /**
- * MMS downloading failed. We should not retry via the carrier network.
- */
- public static final int DOWNLOAD_STATUS_ERROR = 2;
-
- private final ICarrierMessagingWrapper mWrapper = new ICarrierMessagingWrapper();
-
- /**
- * Implement this method to filter SMS messages.
- *
- * @param pdu the PDUs of the message
- * @param format the format of the PDUs, typically "3gpp" or "3gpp2"
- * @param destPort the destination port of a binary SMS, this will be -1 for text SMS
- *
- * @return True to keep an inbound SMS message and delivered to SMS apps. False to
- * drop the message.
- */
- public boolean onFilterSms(@NonNull MessagePdu pdu, @NonNull String format, int destPort) {
- // optional
- return true;
- }
-
- /**
- * Implement this method to intercept text SMSs sent from the devcie.
- *
- * @param text the text to send
- * @param format the format of the response PDU, typically "3gpp" or "3gpp2"
- * @param destAddress phone number of the recipient of the message
- *
- * @return a possibly {code null} {@link SendSmsResponse}. Upon returning {@code null}, the SMS
- * is sent using the carrier network.
- */
- public @Nullable SendSmsResponse onSendTextSms(
- @NonNull String text, @NonNull String format, @NonNull String destAddress) {
- // optional
- return null;
- }
-
- /**
- * Implement this method to intercept binary SMSs sent from the device.
- *
- * @param data the binary content
- * @param format format the format of the response PDU, typically "3gpp" or "3gpp2"
- * @param destAddress phone number of the recipient of the message
- * @param destPort the destination port
- *
- * @return a possibly {code null} {@link SendSmsResponse}. Upon returning {@code null}, the SMS
- * is sent using the carrier network.
- */
- public @Nullable SendSmsResponse onSendDataSms(@NonNull byte[] data, @NonNull String format,
- @NonNull String destAddress, int destPort) {
- // optional
- return null;
- }
-
- /**
- * Implement this method to intercept long SMSs sent from the device.
- *
- * @param parts a {@link List} of the message parts
- * @param format format the format of the response PDU, typically "3gpp" or "3gpp2"
- * @param destAddress phone number of the recipient of the message
- *
- * @return a possibly {code null} {@link List} of {@link SendSmsResponse}, one for each message
- * part. Upon returning {@code null}, the SMS is sent using the carrier network.
- */
- public @Nullable List<SendSmsResponse> onSendMultipartTextSms(@NonNull List<String> parts,
- @NonNull String format, @NonNull String destAddress) {
- // optional
- return null;
- }
-
- /**
- * Implement this method to intercept MMSs sent from the device.
- *
- * @param pduUri the content provider URI of the PDU to send
- * @param locationUrl the optional URL to send this MMS PDU. If this is not specified,
- * the PDU should be sent to the default MMSC URL.
- *
- * @return a possibly {@code null} {@link SendMmsResult}. Upon returning {@code null}, the
- * MMS is sent using the carrier network.
- */
- public @Nullable SendMmsResult onSendMms(@NonNull Uri pduUri, @Nullable String locationUrl) {
- // optional
- return null;
- }
-
- /**
- * Implement this method to download MMSs received.
- *
- * @param contentUri the content provider URI of the PDU to be downloaded.
- * @param locationUrl the URL of the message to be downloaded.
- *
- * @return a {@link SendMmsResult}.
- */
- public int onDownloadMms(@NonNull Uri contentUri, @NonNull String locationUrl) {
- // optional
- return DOWNLOAD_STATUS_RETRY_ON_CARRIER_NETWORK;
- }
-
- @Override
- public @Nullable IBinder onBind(@NonNull Intent intent) {
- if (!SERVICE_INTERFACE.equals(intent.getAction())) {
- return null;
- }
- return mWrapper;
- }
-
- /**
- * The result of sending an MMS.
- */
- public static final class SendMmsResult {
- private int mResult;
- private byte[] mSendConfPdu;
-
- /**
- * Constructs a SendMmsResult with the MMS send result, and the SenConf PDU.
- *
- * @param result the result which is one of {@link #SEND_STATUS_OK},
- * {@link #SEND_STATUS_RETRY_ON_CARRIER_NETWORK}, and
- * {@link #SEND_STATUS_ERROR}
- * @param sendConfPdu a possibly {code null} SendConf PDU, which confirms that the message
- * was sent. sendConfPdu is ignored if the {@code result} is not
- * {@link #SEND_STATUS_OK}
- */
- public SendMmsResult(int result, @Nullable byte[] sendConfPdu) {
- mResult = result;
- mSendConfPdu = sendConfPdu;
- }
-
- /**
- * Returns the result of sending the MMS.
- *
- * @return the result which is one of {@link #SEND_STATUS_OK},
- * {@link #SEND_STATUS_RETRY_ON_CARRIER_NETWORK}, and {@link #SEND_STATUS_ERROR}
- */
- public int getResult() {
- return mResult;
- }
-
- /**
- * Returns the SendConf PDU, which confirms that the message was sent.
- *
- * @return the SendConf PDU
- */
- public @Nullable byte[] getSendConfPdu() {
- return mSendConfPdu;
- }
- }
-
- /**
- * Object passed in callbacks upon successful completion of
- * {@link ICarrierMessagingService#sendTextSms},
- * {@link ICarrierMessagingService#sendDataSms}, and
- * {@link ICarrierMessagingService#sendMultipartTextSms}.
- * Contains message reference and ackPdu.
- */
- public static final class SendSmsResponse implements Parcelable {
- private int mMessageRef;
- private byte[] mAckPdu;
- private int mErrorCode;
-
- /**
- * Constructs a SendSmsResponse for the message reference, the ack PDU, and error code for
- * the just-sent SMS.
- *
- * @param messageRef message reference of the just-sent SMS
- * @param ackPdu ackPdu for the just-sent SMS
- * @param errorCode error code. See 3GPP 27.005, 3.2.5 for GSM/UMTS,
- * 3GPP2 N.S0005 (IS-41C) Table 171 for CDMA, -1 if unknown or not applicable.
- */
- public SendSmsResponse(int messageRef, @NonNull byte[] ackPdu, int errorCode) {
- mMessageRef = messageRef;
- mAckPdu = ackPdu;
- mErrorCode = errorCode;
- }
-
- /**
- * Returns the message reference of the just-sent SMS.
- *
- * @return the message reference
- */
- public int getMessageRef() {
- return mMessageRef;
- }
-
- /**
- * Returns the ackPdu for the just-sent SMS.
- *
- * @return the ackPdu
- */
- public @NonNull byte[] getAckPdu() {
- return mAckPdu;
- }
-
- /**
- * Returns the error code upon encountering an error while sending the SMS, -1 if unknown or
- * not applicable.
- *
- * @return errorCode the errorCode as defined in 3GPP 27.005, 3.2.5 for GSM/UMTS, and 3GPP2
- * N.S0005 (IS-41C) Table 171 for CDMA, -1 if unknown or not applicable.
- */
- public int getErrorCode() {
- return mErrorCode;
- }
-
- @Override
- public int describeContents() {
- return 0;
- }
-
- @Override
- public void writeToParcel(Parcel dest, int flags) {
- dest.writeInt(mMessageRef);
- dest.writeByteArray(mAckPdu);
- dest.writeInt(mErrorCode);
- }
-
- public static final Parcelable.Creator<SendSmsResponse> CREATOR
- = new Parcelable.Creator<SendSmsResponse>() {
- @Override
- public SendSmsResponse createFromParcel(Parcel source) {
- return new SendSmsResponse(source.readInt(),
- source.createByteArray(),
- source.readInt());
- }
-
- @Override
- public SendSmsResponse[] newArray(int size) {
- return new SendSmsResponse[size];
- }
- };
- }
-
- /**
- * A wrapper around ICarrierMessagingService to enable the carrier messaging APP to implement
- * methods it cares about in the {@link ICarrierMessagingService} interface.
- */
- private class ICarrierMessagingWrapper extends ICarrierMessagingService.Stub {
- @Override
- public void filterSms(MessagePdu pdu, String format, int destPort,
- ICarrierMessagingCallback callback) {
- try {
- callback.onFilterComplete(onFilterSms(pdu, format, destPort));
- } catch (RemoteException ex) {
- }
- }
-
- @Override
- public void sendTextSms(String text, String format, String destAddress,
- ICarrierMessagingCallback callback) {
- try {
- SendSmsResponse sendSmsResponse = onSendTextSms(text, format, destAddress);
- if (sendSmsResponse == null) {
- callback.onSendSmsComplete(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, null);
- } else {
- callback.onSendSmsComplete(SEND_STATUS_OK, sendSmsResponse);
- }
- } catch (RemoteException ex) {
- }
- }
-
- @Override
- public void sendDataSms(byte[] data, String format, String destAddress, int destPort,
- ICarrierMessagingCallback callback) {
- try {
- SendSmsResponse sendSmsResponse = onSendDataSms(data, format, destAddress,
- destPort);
- if (sendSmsResponse == null) {
- callback.onSendSmsComplete(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, null);
- } else {
- callback.onSendSmsComplete(SEND_STATUS_OK, sendSmsResponse);
- }
- } catch (RemoteException ex) {
- }
- }
-
- @Override
- public void sendMultipartTextSms(List<String> parts, String format, String destAddress,
- ICarrierMessagingCallback callback) {
- try {
- List<SendSmsResponse> sendSmsResponses =
- onSendMultipartTextSms(parts, format, destAddress);
- if (sendSmsResponses == null) {
- callback.onSendMultipartSmsComplete(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, null);
- } else {
- callback.onSendMultipartSmsComplete(SEND_STATUS_OK, sendSmsResponses);
- }
- } catch (RemoteException ex) {
- }
- }
-
- @Override
- public void sendMms(Uri pduUri, String locationUrl, ICarrierMessagingCallback callback) {
- try {
- SendMmsResult result = onSendMms(pduUri, locationUrl);
- if (result == null) {
- callback.onSendMmsComplete(SEND_STATUS_RETRY_ON_CARRIER_NETWORK, null);
- } else {
- callback.onSendMmsComplete(SEND_STATUS_OK, result.getSendConfPdu());
- }
- } catch (RemoteException ex) {
- }
- }
-
- @Override
- public void downloadMms(Uri contentUri, String locationUrl,
- ICarrierMessagingCallback callback) {
- try {
- callback.onDownloadMmsComplete(onDownloadMms(contentUri, locationUrl));
- } catch (RemoteException ex) {
- }
- }
- }
-}
diff --git a/core/java/android/service/carriermessaging/CarrierMessagingServiceManager.java b/core/java/android/service/carriermessaging/CarrierMessagingServiceManager.java
deleted file mode 100644
index 56ee2c1..0000000
--- a/core/java/android/service/carriermessaging/CarrierMessagingServiceManager.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014 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.service.carriermessaging;
-
-import android.content.ComponentName;
-import android.content.Context;
-import android.content.Intent;
-import android.content.ServiceConnection;
-import android.os.IBinder;
-
-import com.android.internal.util.Preconditions;
-
-/**
- * Provides basic structure for platform to connect to the carrier messaging service.
- * <p>
- * <code>
- * CarrierMessagingServiceManager carrierMessagingServiceManager =
- * new CarrierMessagingServiceManagerImpl();
- * if (carrierMessagingServiceManager.bindToCarrierMessagingService(context, carrierPackageName)) {
- * // wait for onServiceReady callback
- * } else {
- * // Unable to bind: handle error.
- * }
- * </code>
- * <p> Upon completion {@link #disposeConnection} should be called to unbind the
- * CarrierMessagingService.
- * @hide
- */
-public abstract class CarrierMessagingServiceManager {
- // Populated by bindToCarrierMessagingService. bindToCarrierMessagingService must complete
- // prior to calling disposeConnection so that mCarrierMessagingServiceConnection is initialized.
- private volatile CarrierMessagingServiceConnection mCarrierMessagingServiceConnection;
-
- /**
- * Binds to the carrier messaging service under package {@code carrierPackageName}. This method
- * should be called exactly once.
- *
- * @param context the context
- * @param carrierPackageName the carrier package name
- * @return true upon successfully binding to a carrier messaging service, false otherwise
- */
- public boolean bindToCarrierMessagingService(Context context, String carrierPackageName) {
- Preconditions.checkState(mCarrierMessagingServiceConnection == null);
-
- Intent intent = new Intent(CarrierMessagingService.SERVICE_INTERFACE);
- intent.setPackage(carrierPackageName);
- mCarrierMessagingServiceConnection = new CarrierMessagingServiceConnection();
- return context.bindService(intent, mCarrierMessagingServiceConnection,
- Context.BIND_AUTO_CREATE);
- }
-
- /**
- * Unbinds the carrier messaging service. This method should be called exactly once.
- *
- * @param context the context
- */
- public void disposeConnection(Context context) {
- Preconditions.checkNotNull(mCarrierMessagingServiceConnection);
- context.unbindService(mCarrierMessagingServiceConnection);
- mCarrierMessagingServiceConnection = null;
- }
-
- /**
- * Implemented by subclasses to use the carrier messaging service once it is ready.
- *
- * @param carrierMessagingService the carirer messaing service interface
- */
- protected abstract void onServiceReady(ICarrierMessagingService carrierMessagingService);
-
- /**
- * A basic {@link ServiceConnection}.
- */
- private final class CarrierMessagingServiceConnection implements ServiceConnection {
- @Override
- public void onServiceConnected(ComponentName name, IBinder service) {
- onServiceReady(ICarrierMessagingService.Stub.asInterface(service));
- }
-
- @Override
- public void onServiceDisconnected(ComponentName name) {
- }
- }
-}
diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java
index 9496b53..67f632f 100644
--- a/core/java/android/service/wallpaper/WallpaperService.java
+++ b/core/java/android/service/wallpaper/WallpaperService.java
@@ -691,8 +691,8 @@
if (DEBUG) Log.v(TAG, "New surface: " + mSurfaceHolder.mSurface
+ ", frame=" + mWinFrame);
- int w = mWinFrame.width();
- int h = mWinFrame.height();
+ int w = mWinFrame.width() + mOverscanInsets.left + mOverscanInsets.right;
+ int h = mWinFrame.height() + mOverscanInsets.top + mOverscanInsets.bottom;
if (!fixedSize) {
final Rect padding = mIWallpaperEngine.mDisplayPadding;
diff --git a/core/java/android/view/GLES20Canvas.java b/core/java/android/view/GLES20Canvas.java
index 9061679..60a489b 100644
--- a/core/java/android/view/GLES20Canvas.java
+++ b/core/java/android/view/GLES20Canvas.java
@@ -558,7 +558,7 @@
Bitmap bitmap = patch.getBitmap();
throwIfCannotDraw(bitmap);
final long nativePaint = paint == null ? 0 : paint.mNativePaint;
- nDrawPatch(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, patch.mNativeChunk,
+ nDrawPatch(mRenderer, bitmap.mNativeBitmap, patch.mNativeChunk,
dst.left, dst.top, dst.right, dst.bottom, nativePaint);
}
@@ -567,32 +567,31 @@
Bitmap bitmap = patch.getBitmap();
throwIfCannotDraw(bitmap);
final long nativePaint = paint == null ? 0 : paint.mNativePaint;
- nDrawPatch(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, patch.mNativeChunk,
+ nDrawPatch(mRenderer, bitmap.mNativeBitmap, patch.mNativeChunk,
dst.left, dst.top, dst.right, dst.bottom, nativePaint);
}
- private static native void nDrawPatch(long renderer, long bitmap, byte[] buffer, long chunk,
+ private static native void nDrawPatch(long renderer, long bitmap, long chunk,
float left, float top, float right, float bottom, long paint);
@Override
public void drawBitmap(Bitmap bitmap, float left, float top, Paint paint) {
throwIfCannotDraw(bitmap);
final long nativePaint = paint == null ? 0 : paint.mNativePaint;
- nDrawBitmap(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, left, top, nativePaint);
+ nDrawBitmap(mRenderer, bitmap.mNativeBitmap, left, top, nativePaint);
}
- private static native void nDrawBitmap(long renderer, long bitmap, byte[] buffer,
- float left, float top, long paint);
+ private static native void nDrawBitmap(long renderer, long bitmap, float left,
+ float top, long paint);
@Override
public void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) {
throwIfCannotDraw(bitmap);
final long nativePaint = paint == null ? 0 : paint.mNativePaint;
- nDrawBitmap(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer,
- matrix.native_instance, nativePaint);
+ nDrawBitmap(mRenderer, bitmap.mNativeBitmap, matrix.native_instance, nativePaint);
}
- private static native void nDrawBitmap(long renderer, long bitmap, byte[] buffer,
+ private static native void nDrawBitmap(long renderer, long bitmap,
long matrix, long paint);
@Override
@@ -612,7 +611,7 @@
bottom = src.bottom;
}
- nDrawBitmap(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, left, top, right, bottom,
+ nDrawBitmap(mRenderer, bitmap.mNativeBitmap, left, top, right, bottom,
dst.left, dst.top, dst.right, dst.bottom, nativePaint);
}
@@ -633,11 +632,11 @@
bottom = src.bottom;
}
- nDrawBitmap(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, left, top, right, bottom,
+ nDrawBitmap(mRenderer, bitmap.mNativeBitmap, left, top, right, bottom,
dst.left, dst.top, dst.right, dst.bottom, nativePaint);
}
- private static native void nDrawBitmap(long renderer, long bitmap, byte[] buffer,
+ private static native void nDrawBitmap(long renderer, long bitmap,
float srcLeft, float srcTop, float srcRight, float srcBottom,
float left, float top, float right, float bottom, long paint);
@@ -698,11 +697,11 @@
}
final long nativePaint = paint == null ? 0 : paint.mNativePaint;
- nDrawBitmapMesh(mRenderer, bitmap.mNativeBitmap, bitmap.mBuffer, meshWidth, meshHeight,
+ nDrawBitmapMesh(mRenderer, bitmap.mNativeBitmap, meshWidth, meshHeight,
verts, vertOffset, colors, colorOffset, nativePaint);
}
- private static native void nDrawBitmapMesh(long renderer, long bitmap, byte[] buffer,
+ private static native void nDrawBitmapMesh(long renderer, long bitmap,
int meshWidth, int meshHeight, float[] verts, int vertOffset,
int[] colors, int colorOffset, long paint);
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 904e33f..c5c3f83 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -235,7 +235,7 @@
* or not the surface used by the HardwareRenderer will be changing. It
* Suspends any rendering into the surface, but will not do any destruction
*/
- abstract void pauseSurface(Surface surface);
+ abstract boolean pauseSurface(Surface surface);
/**
* Destroys all hardware rendering resources associated with the specified
diff --git a/core/java/android/view/ThreadedRenderer.java b/core/java/android/view/ThreadedRenderer.java
index 131c039..14b950f 100644
--- a/core/java/android/view/ThreadedRenderer.java
+++ b/core/java/android/view/ThreadedRenderer.java
@@ -155,8 +155,8 @@
}
@Override
- void pauseSurface(Surface surface) {
- nPauseSurface(mNativeProxy, surface);
+ boolean pauseSurface(Surface surface) {
+ return nPauseSurface(mNativeProxy, surface);
}
@Override
@@ -494,7 +494,7 @@
private static native boolean nInitialize(long nativeProxy, Surface window);
private static native void nUpdateSurface(long nativeProxy, Surface window);
- private static native void nPauseSurface(long nativeProxy, Surface window);
+ private static native boolean nPauseSurface(long nativeProxy, Surface window);
private static native void nSetup(long nativeProxy, int width, int height,
float lightX, float lightY, float lightZ, float lightRadius,
int ambientShadowAlpha, int spotShadowAlpha);
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index b12c747..34c27d7 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -1493,7 +1493,11 @@
// relayoutWindow may decide to destroy mSurface. As that decision
// happens in WindowManager service, we need to be defensive here
// and stop using the surface in case it gets destroyed.
- mAttachInfo.mHardwareRenderer.pauseSurface(mSurface);
+ if (mAttachInfo.mHardwareRenderer.pauseSurface(mSurface)) {
+ // Animations were running so we need to push a frame
+ // to resume them
+ mDirty.set(0, 0, mWidth, mHeight);
+ }
}
final int surfaceGenerationId = mSurface.getGenerationId();
relayoutResult = relayoutWindow(params, viewVisibility, insetsPending);
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java
index 139354a..34b3a72 100644
--- a/core/java/android/widget/TextView.java
+++ b/core/java/android/widget/TextView.java
@@ -8392,7 +8392,8 @@
*/
private boolean shouldSpeakPasswordsForAccessibility() {
return (Settings.Secure.getIntForUser(mContext.getContentResolver(),
- Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0, UserHandle.USER_CURRENT) == 1);
+ Settings.Secure.ACCESSIBILITY_SPEAK_PASSWORD, 0,
+ UserHandle.USER_CURRENT_OR_SELF) == 1);
}
@Override
diff --git a/core/java/com/android/internal/app/IAppOpsService.aidl b/core/java/com/android/internal/app/IAppOpsService.aidl
index a52dd48..99bf9f3 100644
--- a/core/java/com/android/internal/app/IAppOpsService.aidl
+++ b/core/java/com/android/internal/app/IAppOpsService.aidl
@@ -36,7 +36,7 @@
List<AppOpsManager.PackageOps> getPackagesForOps(in int[] ops);
List<AppOpsManager.PackageOps> getOpsForPackage(int uid, String packageName, in int[] ops);
void setMode(int code, int uid, String packageName, int mode);
- void resetAllModes();
+ void resetAllModes(int reqUserId, String reqPackageName);
int checkAudioOperation(int code, int usage, int uid, String packageName);
void setAudioRestriction(int code, int usage, int uid, int mode, in String[] exceptionPackages);
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp
index 2eccfbd..a51af40 100644
--- a/core/jni/android/graphics/Graphics.cpp
+++ b/core/jni/android/graphics/Graphics.cpp
@@ -492,19 +492,15 @@
SkMallocPixelRef(info, storage, rowBytes, ctable, (storageObj == NULL)),
fWrappedPixelRef(NULL) {
SkASSERT(storage);
+ SkASSERT(storageObj);
SkASSERT(env);
if (env->GetJavaVM(&fVM) != JNI_OK) {
SkDebugf("------ [%p] env->GetJavaVM failed\n", env);
sk_throw();
}
- fStorageObj = storageObj;
- fHasGlobalRef = false;
- fGlobalRefCnt = 0;
- // If storageObj is NULL, the memory was NOT allocated on the Java heap
- fOnJavaHeap = (storageObj != NULL);
-
+ fStorageObj = (jbyteArray) env->NewGlobalRef(storageObj);
}
AndroidPixelRef::AndroidPixelRef(AndroidPixelRef& wrappedPixelRef, const SkImageInfo& info,
@@ -516,91 +512,18 @@
SkASSERT(fWrappedPixelRef);
SkSafeRef(fWrappedPixelRef);
- // don't need to initialize these, as all the relevant logic delegates to the wrapped ref
+ // don't need to initialize this, as all the relevant logic delegates to the wrapped ref
fStorageObj = NULL;
- fHasGlobalRef = false;
- fGlobalRefCnt = 0;
- fOnJavaHeap = false;
}
AndroidPixelRef::~AndroidPixelRef() {
if (fWrappedPixelRef) {
SkSafeUnref(fWrappedPixelRef);
- } else if (fOnJavaHeap) {
+ } else {
+ SkASSERT(fStorageObj);
JNIEnv* env = vm2env(fVM);
-
- if (fStorageObj && fHasGlobalRef) {
- env->DeleteGlobalRef(fStorageObj);
- }
- fStorageObj = NULL;
- }
-}
-jbyteArray AndroidPixelRef::getStorageObj() {
- if (fWrappedPixelRef) {
- return fWrappedPixelRef->fStorageObj;
- }
- return fStorageObj;
-}
-
-void AndroidPixelRef::setLocalJNIRef(jbyteArray arr) {
- if (fWrappedPixelRef) {
- // delegate java obj management to the wrapped ref
- fWrappedPixelRef->setLocalJNIRef(arr);
- } else if (!fHasGlobalRef) {
- fStorageObj = arr;
- }
-}
-
-void AndroidPixelRef::globalRef(void* localref) {
- if (fWrappedPixelRef) {
- // delegate java obj management to the wrapped ref
- fWrappedPixelRef->globalRef(localref);
-
- // Note: we only ref and unref the wrapped AndroidPixelRef so that
- // bitmap->pixelRef()->globalRef() and globalUnref() can be used in a pair, even if
- // the bitmap has its underlying AndroidPixelRef swapped out/wrapped
- return;
- }
- if (fOnJavaHeap && sk_atomic_inc(&fGlobalRefCnt) == 0) {
- JNIEnv *env = vm2env(fVM);
-
- // If JNI ref was passed, it is always used
- if (localref) fStorageObj = (jbyteArray) localref;
-
- if (fStorageObj == NULL) {
- SkDebugf("No valid local ref to create a JNI global ref\n");
- sk_throw();
- }
- if (fHasGlobalRef) {
- // This should never happen
- SkDebugf("Already holding a JNI global ref");
- sk_throw();
- }
-
- fStorageObj = (jbyteArray) env->NewGlobalRef(fStorageObj);
- // TODO: Check for failure here
- fHasGlobalRef = true;
- }
- ref();
-}
-
-void AndroidPixelRef::globalUnref() {
- if (fWrappedPixelRef) {
- // delegate java obj management to the wrapped ref
- fWrappedPixelRef->globalUnref();
- return;
- }
- if (fOnJavaHeap && sk_atomic_dec(&fGlobalRefCnt) == 1) {
- JNIEnv *env = vm2env(fVM);
- if (!fHasGlobalRef) {
- SkDebugf("We don't have a global ref!");
- sk_throw();
- }
env->DeleteGlobalRef(fStorageObj);
- fStorageObj = NULL;
- fHasGlobalRef = false;
}
- unref();
}
///////////////////////////////////////////////////////////////////////////////
@@ -657,25 +580,6 @@
////////////////////////////////////////////////////////////////////////////////
-JavaHeapBitmapRef::JavaHeapBitmapRef(JNIEnv* env, SkBitmap* nativeBitmap, jbyteArray buffer) {
- fEnv = env;
- fNativeBitmap = nativeBitmap;
- fBuffer = buffer;
-
- // If the buffer is NULL, the backing memory wasn't allocated on the Java heap
- if (fBuffer) {
- ((AndroidPixelRef*) fNativeBitmap->pixelRef())->setLocalJNIRef(fBuffer);
- }
-}
-
-JavaHeapBitmapRef::~JavaHeapBitmapRef() {
- if (fBuffer) {
- ((AndroidPixelRef*) fNativeBitmap->pixelRef())->setLocalJNIRef(NULL);
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
static jclass make_globalref(JNIEnv* env, const char classname[])
{
jclass c = env->FindClass(classname);
diff --git a/core/jni/android/graphics/GraphicsJNI.h b/core/jni/android/graphics/GraphicsJNI.h
index dcc97e5..42973ba 100644
--- a/core/jni/android/graphics/GraphicsJNI.h
+++ b/core/jni/android/graphics/GraphicsJNI.h
@@ -123,52 +123,11 @@
virtual ~AndroidPixelRef();
- jbyteArray getStorageObj();
-
- void setLocalJNIRef(jbyteArray arr);
-
- /** Used to hold a ref to the pixels when the Java bitmap may be collected.
- * If specified, 'localref' is a valid JNI local reference to the byte array
- * containing the pixel data.
- *
- * 'localref' may only be NULL if setLocalJNIRef() was already called with
- * a JNI local ref that is still valid.
- */
- virtual void globalRef(void* localref=NULL);
-
- /** Release a ref that was acquired using globalRef(). */
- virtual void globalUnref();
-
private:
AndroidPixelRef* const fWrappedPixelRef; // if set, delegate memory management calls to this
JavaVM* fVM;
- bool fOnJavaHeap; // If true, the memory was allocated on the Java heap
-
jbyteArray fStorageObj; // The Java byte[] object used as the bitmap backing store
- bool fHasGlobalRef; // If true, fStorageObj holds a JNI global ref
-
- mutable int32_t fGlobalRefCnt;
-};
-
-/** A helper class for accessing Java-heap-allocated bitmaps.
- * This should be used when calling into a JNI method that retains a
- * reference to the bitmap longer than the lifetime of the Java Bitmap.
- *
- * After creating an instance of this class, a call to
- * AndroidPixelRef::globalRef() will allocate a JNI global reference
- * to the backing buffer object.
- */
-class JavaHeapBitmapRef {
-public:
-
- JavaHeapBitmapRef(JNIEnv *env, SkBitmap* nativeBitmap, jbyteArray buffer);
- ~JavaHeapBitmapRef();
-
-private:
- JNIEnv* fEnv;
- SkBitmap* fNativeBitmap;
- jbyteArray fBuffer;
};
/** Allocator which allocates the backing buffer in the Java heap.
diff --git a/core/jni/android_view_GLES20Canvas.cpp b/core/jni/android_view_GLES20Canvas.cpp
index b023ebd..9bbd4fc 100644
--- a/core/jni/android_view_GLES20Canvas.cpp
+++ b/core/jni/android_view_GLES20Canvas.cpp
@@ -347,11 +347,8 @@
// ----------------------------------------------------------------------------
static void android_view_GLES20Canvas_drawBitmap(JNIEnv* env, jobject clazz,
- jlong rendererPtr, jlong bitmapPtr, jbyteArray buffer,
- jfloat left, jfloat top, jlong paintPtr) {
+ jlong rendererPtr, jlong bitmapPtr, jfloat left, jfloat top, jlong paintPtr) {
SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapPtr);
- // This object allows the renderer to allocate a global JNI ref to the buffer object.
- JavaHeapBitmapRef bitmapRef(env, bitmap, buffer);
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
Paint* paint = reinterpret_cast<Paint*>(paintPtr);
@@ -364,12 +361,10 @@
}
static void android_view_GLES20Canvas_drawBitmapRect(JNIEnv* env, jobject clazz,
- jlong rendererPtr, jlong bitmapPtr, jbyteArray buffer,
+ jlong rendererPtr, jlong bitmapPtr,
float srcLeft, float srcTop, float srcRight, float srcBottom,
float dstLeft, float dstTop, float dstRight, float dstBottom, jlong paintPtr) {
SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapPtr);
- // This object allows the renderer to allocate a global JNI ref to the buffer object.
- JavaHeapBitmapRef bitmapRef(env, bitmap, buffer);
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
Paint* paint = reinterpret_cast<Paint*>(paintPtr);
@@ -378,11 +373,8 @@
}
static void android_view_GLES20Canvas_drawBitmapMatrix(JNIEnv* env, jobject clazz,
- jlong rendererPtr, jlong bitmapPtr, jbyteArray buffer,
- jlong matrixPtr, jlong paintPtr) {
+ jlong rendererPtr, jlong bitmapPtr, jlong matrixPtr, jlong paintPtr) {
SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapPtr);
- // This object allows the renderer to allocate a global JNI ref to the buffer object.
- JavaHeapBitmapRef bitmapRef(env, bitmap, buffer);
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
SkMatrix* matrix = reinterpret_cast<SkMatrix*>(matrixPtr);
@@ -427,12 +419,9 @@
}
static void android_view_GLES20Canvas_drawBitmapMesh(JNIEnv* env, jobject clazz,
- jlong rendererPtr, jlong bitmapPtr, jbyteArray buffer,
- jint meshWidth, jint meshHeight, jfloatArray vertices, jint offset, jintArray colors,
- jint colorOffset, jlong paintPtr) {
+ jlong rendererPtr, jlong bitmapPtr, jint meshWidth, jint meshHeight,
+ jfloatArray vertices, jint offset, jintArray colors, jint colorOffset, jlong paintPtr) {
SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapPtr);
- // This object allows the renderer to allocate a global JNI ref to the buffer object.
- JavaHeapBitmapRef bitmapRef(env, bitmap, buffer);
jfloat* verticesArray = vertices ? env->GetFloatArrayElements(vertices, NULL) + offset : NULL;
jint* colorsArray = colors ? env->GetIntArrayElements(colors, NULL) + colorOffset : NULL;
@@ -446,11 +435,9 @@
}
static void android_view_GLES20Canvas_drawPatch(JNIEnv* env, jobject clazz,
- jlong rendererPtr, jlong bitmapPtr, jbyteArray buffer, jlong patchPtr,
+ jlong rendererPtr, jlong bitmapPtr, jlong patchPtr,
float left, float top, float right, float bottom, jlong paintPtr) {
SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapPtr);
- // This object allows the renderer to allocate a global JNI ref to the buffer object.
- JavaHeapBitmapRef bitmapRef(env, bitmap, buffer);
DisplayListRenderer* renderer = reinterpret_cast<DisplayListRenderer*>(rendererPtr);
Res_png_9patch* patch = reinterpret_cast<Res_png_9patch*>(patchPtr);
@@ -914,14 +901,14 @@
{ "nGetMatrix", "(JJ)V", (void*) android_view_GLES20Canvas_getMatrix },
{ "nConcatMatrix", "(JJ)V", (void*) android_view_GLES20Canvas_concatMatrix },
- { "nDrawBitmap", "(JJ[BFFJ)V", (void*) android_view_GLES20Canvas_drawBitmap },
- { "nDrawBitmap", "(JJ[BFFFFFFFFJ)V",(void*) android_view_GLES20Canvas_drawBitmapRect },
- { "nDrawBitmap", "(JJ[BJJ)V", (void*) android_view_GLES20Canvas_drawBitmapMatrix },
+ { "nDrawBitmap", "(JJFFJ)V", (void*) android_view_GLES20Canvas_drawBitmap },
+ { "nDrawBitmap", "(JJFFFFFFFFJ)V",(void*) android_view_GLES20Canvas_drawBitmapRect },
+ { "nDrawBitmap", "(JJJJ)V", (void*) android_view_GLES20Canvas_drawBitmapMatrix },
{ "nDrawBitmap", "(J[IIIFFIIZJ)V", (void*) android_view_GLES20Canvas_drawBitmapData },
- { "nDrawBitmapMesh", "(JJ[BII[FI[IIJ)V",(void*) android_view_GLES20Canvas_drawBitmapMesh },
+ { "nDrawBitmapMesh", "(JJII[FI[IIJ)V",(void*) android_view_GLES20Canvas_drawBitmapMesh },
- { "nDrawPatch", "(JJ[BJFFFFJ)V", (void*) android_view_GLES20Canvas_drawPatch },
+ { "nDrawPatch", "(JJJFFFFJ)V", (void*) android_view_GLES20Canvas_drawPatch },
{ "nDrawColor", "(JII)V", (void*) android_view_GLES20Canvas_drawColor },
{ "nDrawRect", "(JFFFFJ)V", (void*) android_view_GLES20Canvas_drawRect },
diff --git a/core/jni/android_view_ThreadedRenderer.cpp b/core/jni/android_view_ThreadedRenderer.cpp
index 6219956..b9d849c 100644
--- a/core/jni/android_view_ThreadedRenderer.cpp
+++ b/core/jni/android_view_ThreadedRenderer.cpp
@@ -270,14 +270,14 @@
proxy->updateSurface(window);
}
-static void android_view_ThreadedRenderer_pauseSurface(JNIEnv* env, jobject clazz,
+static jboolean android_view_ThreadedRenderer_pauseSurface(JNIEnv* env, jobject clazz,
jlong proxyPtr, jobject jsurface) {
RenderProxy* proxy = reinterpret_cast<RenderProxy*>(proxyPtr);
sp<ANativeWindow> window;
if (jsurface) {
window = android_view_Surface_getNativeWindow(env, jsurface);
}
- proxy->pauseSurface(window);
+ return proxy->pauseSurface(window);
}
static void android_view_ThreadedRenderer_setup(JNIEnv* env, jobject clazz, jlong proxyPtr,
@@ -429,7 +429,7 @@
{ "nLoadSystemProperties", "(J)Z", (void*) android_view_ThreadedRenderer_loadSystemProperties },
{ "nInitialize", "(JLandroid/view/Surface;)Z", (void*) android_view_ThreadedRenderer_initialize },
{ "nUpdateSurface", "(JLandroid/view/Surface;)V", (void*) android_view_ThreadedRenderer_updateSurface },
- { "nPauseSurface", "(JLandroid/view/Surface;)V", (void*) android_view_ThreadedRenderer_pauseSurface },
+ { "nPauseSurface", "(JLandroid/view/Surface;)Z", (void*) android_view_ThreadedRenderer_pauseSurface },
{ "nSetup", "(JIIFFFFII)V", (void*) android_view_ThreadedRenderer_setup },
{ "nSetOpaque", "(JZ)V", (void*) android_view_ThreadedRenderer_setOpaque },
{ "nSyncAndDrawFrame", "(JJJF)I", (void*) android_view_ThreadedRenderer_syncAndDrawFrame },
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index dec7f07..3dd9770 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2910,7 +2910,7 @@
android:description="@string/permdesc_removeDrmCertificates"
android:protectionLevel="signature|system" />
- <!-- Must be required by a {@link android.service.carriermessaging.CarrierMessagingService}.
+ <!-- Must be required by a {@link android.service.carrier.CarrierMessagingService}.
Any service that filters for this intent must be a carrier privileged app. -->
<permission android:name="android.permission.BIND_CARRIER_MESSAGING_SERVICE"
android:label="@string/permlab_bindCarrierMessagingService"
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 8f46e6e..1dab04c 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -520,8 +520,8 @@
<string name="permdesc_readProfile" product="default" msgid="5462475151849888848">"Ermöglicht der App, auf Ihrem Gerät gespeicherte personenbezogene Profildaten zu lesen, einschließlich Ihres Namens und Ihrer Kontaktdaten. Die App kann Sie somit identifizieren und Ihre Profildaten an andere senden."</string>
<string name="permlab_writeProfile" msgid="907793628777397643">"Ihre Kontaktkarten ändern"</string>
<string name="permdesc_writeProfile" product="default" msgid="5552084294598465899">"Ermöglicht der App, auf Ihrem Gerät gespeicherte personenbezogene Profildaten zu ändern, einschließlich Ihres Namens und Ihrer Kontaktdaten, sowie Daten hinzuzufügen. Die App kann Sie so identifizieren und Ihre Profildaten an andere senden."</string>
- <string name="permlab_bodySensors" msgid="4871091374767171066">"Körpersensoren (wie Herzfrequenzmesser)"</string>
- <string name="permdesc_bodySensors" product="default" msgid="4380015021754180431">"Ermöglicht der App, auf Daten von Sensoren zuzugreifen, die Ihre körperliche Verfassung überwachen, beispielsweise Ihre Herzfrequenz"</string>
+ <string name="permlab_bodySensors" msgid="4871091374767171066">"Körpersensoren (wie Pulsmonitore)"</string>
+ <string name="permdesc_bodySensors" product="default" msgid="4380015021754180431">"Ermöglicht der App, auf Daten von Sensoren zuzugreifen, die Ihre körperliche Verfassung überwachen, beispielsweise Ihren Puls"</string>
<string name="permlab_readSocialStream" product="default" msgid="1268920956152419170">"In sozialem Stream lesen"</string>
<string name="permdesc_readSocialStream" product="default" msgid="4255706027172050872">"Ermöglicht der App, auf Updates aus sozialen Netzwerken von Ihnen und Ihren Freunden zuzugreifen und diese zu synchronisieren. Seien Sie vorsichtig, wenn Sie Informationen teilen: Der App wird erlaubt, die Kommunikation zwischen Ihnen und Ihren Freunden in sozialen Netzwerken zu lesen, unabhängig von der Vertraulichkeit der kommunizierten Informationen. Hinweis: Diese Berechtigung kann möglicherweise nicht in allen sozialen Netzwerken erzwungen werden."</string>
<string name="permlab_writeSocialStream" product="default" msgid="3504179222493235645">"In sozialem Stream schreiben"</string>
diff --git a/core/res/res/values-gl-rES/strings.xml b/core/res/res/values-gl-rES/strings.xml
index 9010721..9386ead 100644
--- a/core/res/res/values-gl-rES/strings.xml
+++ b/core/res/res/values-gl-rES/strings.xml
@@ -276,7 +276,7 @@
<string name="capability_desc_canRequestTouchExploration" msgid="5800552516779249356">"Os elementos que toques pronunciaranse en voz alta e a pantalla poderá explorarse mediante xestos."</string>
<string name="capability_title_canRequestEnhancedWebAccessibility" msgid="1739881766522594073">"Activar a accesibilidade web mellorada"</string>
<string name="capability_desc_canRequestEnhancedWebAccessibility" msgid="7881063961507511765">"É posible que se instalen scripts para que o contido da aplicación resulte máis accesible."</string>
- <string name="capability_title_canRequestFilterKeyEvents" msgid="2103440391902412174">"Observa o texto que escribes"</string>
+ <string name="capability_title_canRequestFilterKeyEvents" msgid="2103440391902412174">"Observar o texto que escribes"</string>
<string name="capability_desc_canRequestFilterKeyEvents" msgid="7463135292204152818">"Inclúe datos persoais como números e contrasinais de tarxetas de crédito."</string>
<string name="permlab_statusBar" msgid="7417192629601890791">"desactivar ou modificar a barra de estado"</string>
<string name="permdesc_statusBar" msgid="8434669549504290975">"Permite á aplicación desactivar a barra de estado ou engadir e eliminar as iconas do sistema."</string>
@@ -296,8 +296,8 @@
<string name="permdesc_receiveMms" msgid="533019437263212260">"Permite á aplicación recibir e procesar mensaxes MMS. Isto significa que a aplicación pode supervisar ou eliminar mensaxes enviadas ao teu dispositivo sen mostrarchas."</string>
<string name="permlab_receiveEmergencyBroadcast" msgid="1803477660846288089">"recibir difusións de emerxencia"</string>
<string name="permdesc_receiveEmergencyBroadcast" msgid="848524070262431974">"Permite á aplicación recibir e procesar mensaxes de emisión de emerxencia. Este permiso só está dispoñible para as aplicacións do sistema."</string>
- <string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"ler mensaxes de difusión de cela"</string>
- <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Permite á aplicación ler mensaxes de difusión de cela recibidas polo teu dispositivo. As alertas de difusión de cela entréganse nalgunhas situacións para avisar de situacións de emerxencia. É posible que aplicacións maliciosas afecten ao rendemento ou funcionamento do teu dispositivo cando se recibe unha difusión de cela de emerxencia."</string>
+ <string name="permlab_readCellBroadcasts" msgid="1598328843619646166">"ler mensaxes de difusión móbil"</string>
+ <string name="permdesc_readCellBroadcasts" msgid="6361972776080458979">"Permite á aplicación ler mensaxes de difusión móbil recibidas polo teu dispositivo. As alertas de difusión móbil entréganse nalgunhas situacións para avisar de situacións de emerxencia. É posible que aplicacións maliciosas afecten ao rendemento ou funcionamento do teu dispositivo cando se recibe unha difusión móbil de emerxencia."</string>
<string name="permlab_sendSms" msgid="5600830612147671529">"enviar mensaxes SMS"</string>
<string name="permdesc_sendSms" msgid="7094729298204937667">"Permite á aplicación enviar mensaxes SMS. É posible que esta acción implique custos inesperados. É posible que as aplicacións maliciosas che custen diñeiro debido ao envío de mensaxes sen a túa confirmación."</string>
<string name="permlab_sendRespondViaMessageRequest" msgid="8713889105305943200">"enviar eventos de resposta mediante mensaxe"</string>
diff --git a/core/res/res/values-mcc310-mnc120/config.xml b/core/res/res/values-mcc310-mnc120/config.xml
index 774732d..4b61688 100644
--- a/core/res/res/values-mcc310-mnc120/config.xml
+++ b/core/res/res/values-mcc310-mnc120/config.xml
@@ -31,4 +31,31 @@
<!-- If this value is true, The mms content-disposition field is supported correctly.
If false, Content-disposition fragments are ignored -->
<bool name="config_mms_content_disposition_support">false</bool>
+
+ <!-- An array of CDMA roaming indicators which means international roaming -->
+ <integer-array translatable="false" name="config_cdma_international_roaming_indicators" >
+ <item>2</item>
+ <item>74</item>
+ <item>124</item>
+ <item>125</item>
+ <item>126</item>
+ <item>157</item>
+ <item>158</item>
+ <item>159</item>
+ <item>193</item>
+ <item>194</item>
+ <item>195</item>
+ <item>196</item>
+ <item>197</item>
+ <item>198</item>
+ <item>228</item>
+ <item>229</item>
+ <item>230</item>
+ <item>231</item>
+ <item>232</item>
+ <item>233</item>
+ <item>234</item>
+ <item>235</item>
+ </integer-array>
+
</resources>
diff --git a/core/res/res/values-mcc311-mnc490/config.xml b/core/res/res/values-mcc311-mnc490/config.xml
index defe78d..d481c97 100644
--- a/core/res/res/values-mcc311-mnc490/config.xml
+++ b/core/res/res/values-mcc311-mnc490/config.xml
@@ -23,4 +23,31 @@
<!-- Sprint need a 70 ms delay for 3way call -->
<integer name="config_cdma_3waycall_flash_delay">70</integer>
+
+ <!-- An array of CDMA roaming indicators which means international roaming -->
+ <integer-array translatable="false" name="config_cdma_international_roaming_indicators" >
+ <item>2</item>
+ <item>74</item>
+ <item>124</item>
+ <item>125</item>
+ <item>126</item>
+ <item>157</item>
+ <item>158</item>
+ <item>159</item>
+ <item>193</item>
+ <item>194</item>
+ <item>195</item>
+ <item>196</item>
+ <item>197</item>
+ <item>198</item>
+ <item>228</item>
+ <item>229</item>
+ <item>230</item>
+ <item>231</item>
+ <item>232</item>
+ <item>233</item>
+ <item>234</item>
+ <item>235</item>
+ </integer-array>
+
</resources>
diff --git a/core/res/res/values-mcc311-mnc870/config.xml b/core/res/res/values-mcc311-mnc870/config.xml
index 24e55b1..98cb72e 100644
--- a/core/res/res/values-mcc311-mnc870/config.xml
+++ b/core/res/res/values-mcc311-mnc870/config.xml
@@ -27,4 +27,31 @@
<!-- Sprint need a 70 ms delay for 3way call -->
<integer name="config_cdma_3waycall_flash_delay">70</integer>
+
+ <!-- An array of CDMA roaming indicators which means international roaming -->
+ <integer-array translatable="false" name="config_cdma_international_roaming_indicators" >
+ <item>2</item>
+ <item>74</item>
+ <item>124</item>
+ <item>125</item>
+ <item>126</item>
+ <item>157</item>
+ <item>158</item>
+ <item>159</item>
+ <item>193</item>
+ <item>194</item>
+ <item>195</item>
+ <item>196</item>
+ <item>197</item>
+ <item>198</item>
+ <item>228</item>
+ <item>229</item>
+ <item>230</item>
+ <item>231</item>
+ <item>232</item>
+ <item>233</item>
+ <item>234</item>
+ <item>235</item>
+ </integer-array>
+
</resources>
diff --git a/core/res/res/values-mcc312-mnc530/config.xml b/core/res/res/values-mcc312-mnc530/config.xml
index 24e55b1..98cb72e 100644
--- a/core/res/res/values-mcc312-mnc530/config.xml
+++ b/core/res/res/values-mcc312-mnc530/config.xml
@@ -27,4 +27,31 @@
<!-- Sprint need a 70 ms delay for 3way call -->
<integer name="config_cdma_3waycall_flash_delay">70</integer>
+
+ <!-- An array of CDMA roaming indicators which means international roaming -->
+ <integer-array translatable="false" name="config_cdma_international_roaming_indicators" >
+ <item>2</item>
+ <item>74</item>
+ <item>124</item>
+ <item>125</item>
+ <item>126</item>
+ <item>157</item>
+ <item>158</item>
+ <item>159</item>
+ <item>193</item>
+ <item>194</item>
+ <item>195</item>
+ <item>196</item>
+ <item>197</item>
+ <item>198</item>
+ <item>228</item>
+ <item>229</item>
+ <item>230</item>
+ <item>231</item>
+ <item>232</item>
+ <item>233</item>
+ <item>234</item>
+ <item>235</item>
+ </integer-array>
+
</resources>
diff --git a/core/res/res/values-mcc415-mnc01/config.xml b/core/res/res/values-mcc415-mnc01/config.xml
new file mode 100644
index 0000000..95d30a4
--- /dev/null
+++ b/core/res/res/values-mcc415-mnc01/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2014, 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.
+*/
+-->
+<resources>
+ <bool name="config_use_sim_language_file">false</bool>
+</resources>
diff --git a/core/res/res/values-mcc416-mnc77/config.xml b/core/res/res/values-mcc416-mnc77/config.xml
new file mode 100644
index 0000000..95d30a4
--- /dev/null
+++ b/core/res/res/values-mcc416-mnc77/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2014, 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.
+*/
+-->
+<resources>
+ <bool name="config_use_sim_language_file">false</bool>
+</resources>
diff --git a/core/res/res/values-mcc432-mnc20/config.xml b/core/res/res/values-mcc432-mnc20/config.xml
new file mode 100644
index 0000000..95d30a4
--- /dev/null
+++ b/core/res/res/values-mcc432-mnc20/config.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2014, 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.
+*/
+-->
+<resources>
+ <bool name="config_use_sim_language_file">false</bool>
+</resources>
diff --git a/core/res/res/values-si-rLK/strings.xml b/core/res/res/values-si-rLK/strings.xml
index 437e14c..9883135 100644
--- a/core/res/res/values-si-rLK/strings.xml
+++ b/core/res/res/values-si-rLK/strings.xml
@@ -1834,8 +1834,8 @@
<string name="item_is_selected" msgid="949687401682476608">"<xliff:g id="ITEM">%1$s</xliff:g> තෝරාගෙන ඇත"</string>
<string name="deleted_key" msgid="7659477886625566590">"<xliff:g id="KEY">%1$s</xliff:g> මකා දමන ලදි"</string>
<string name="managed_profile_label_badge" msgid="2355652472854327647">"වැඩ <xliff:g id="LABEL">%1$s</xliff:g>"</string>
- <string name="lock_to_app_toast" msgid="7570091317001980053">"මෙම තීරයේ ඇමුණුම ඉවත් කිරීමට, Back සහ Overview එකම වේලාවේ ස්පර්ශ කර අල්ලා සිටින්න."</string>
- <string name="lock_to_app_toast_accessible" msgid="8239120109365070664">"මෙම තීරයේ ඇමුණුම ඉවත් කිරීමට, Overview ස්පර්ශ කර අල්ලා සිටින්න."</string>
+ <string name="lock_to_app_toast" msgid="7570091317001980053">"මෙම තීරයේ ඇමුණුම ඉවත් කිරීමට, ආපසු සහ දළ විශ්ලේෂණය එකම වේලාවේ ස්පර්ශ කර අල්ලා සිටින්න."</string>
+ <string name="lock_to_app_toast_accessible" msgid="8239120109365070664">"මෙම තීරයේ ඇමුණුම ඉවත් කිරීමට, දළ විශ්ලේෂණය ස්පර්ශ කර අල්ලා සිටින්න."</string>
<string name="lock_to_app_toast_locked" msgid="8739004135132606329">"තිරය අගුළු දමා ඇත. ඔබගේ සංවිධානය විසින් අගුළු ඇරීමට ඉඩ නොදෙයි."</string>
<string name="lock_to_app_start" msgid="6643342070839862795">"තිරය අගුළු දමා ඇත"</string>
<string name="lock_to_app_exit" msgid="8598219838213787430">"තිරයේ අගුළු ඇර ඇත"</string>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index cdbee61..926b53e 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1952,4 +1952,11 @@
<dimen name="config_mediaMetadataBitmapMaxSize">320dp</dimen>
<string translatable="false" name="prohibit_manual_network_selection_in_gobal_mode">false</string>
+
+ <!-- An array of CDMA roaming indicators which means international roaming -->
+ <integer-array translatable="false" name="config_cdma_international_roaming_indicators" />
+
+
+ <!-- set the system language as value of EF LI/EF PL -->
+ <bool name="config_use_sim_language_file">true</bool>
</resources>
diff --git a/core/res/res/values/dimens_material.xml b/core/res/res/values/dimens_material.xml
index f7ebbe4..dd1f815 100644
--- a/core/res/res/values/dimens_material.xml
+++ b/core/res/res/values/dimens_material.xml
@@ -87,9 +87,9 @@
<dimen name="floating_window_margin_bottom">32dp</dimen>
<!-- Elevation when button is pressed -->
- <dimen name="button_elevation_material">1dp</dimen>
+ <dimen name="button_elevation_material">4dp</dimen>
<!-- Z translation to apply when button is pressed -->
- <dimen name="button_pressed_z_material">2dp</dimen>
+ <dimen name="button_pressed_z_material">6dp</dimen>
<!-- Default insets (outer padding) around buttons -->
<dimen name="button_inset_vertical_material">6dp</dimen>
<dimen name="button_inset_horizontal_material">@dimen/control_inset_material</dimen>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index a9123d1..e861ab2 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2138,5 +2138,7 @@
<java-symbol type="string" name="system_error_wipe_data" />
<java-symbol type="string" name="system_error_manufacturer" />
<java-symbol type="dimen" name="fast_scroller_minimum_touch_target" />
+ <java-symbol type="array" name="config_cdma_international_roaming_indicators" />
+ <java-symbol type="bool" name="config_use_sim_language_file" />
</resources>
diff --git a/data/keyboards/Vendor_046d_Product_b501.kl b/data/keyboards/Vendor_046d_Product_b501.kl
new file mode 100644
index 0000000..496ddc3
--- /dev/null
+++ b/data/keyboards/Vendor_046d_Product_b501.kl
@@ -0,0 +1,65 @@
+# Copyright (C) 2014 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.
+
+# Logitech Bluetooth wireless gamepad (RedHawk)
+
+key 304 BUTTON_A
+key 305 BUTTON_B
+key 307 BUTTON_X
+key 308 BUTTON_Y
+key 310 BUTTON_L1
+key 311 BUTTON_R1
+key 312 BUTTON_L2
+key 313 BUTTON_R2
+
+key 314 BUTTON_SELECT
+key 315 BUTTON_START
+key 316 BUTTON_MODE
+key 317 BUTTON_THUMBL
+key 318 BUTTON_THUMBR
+
+key 103 DPAD_UP
+key 105 DPAD_LEFT
+key 106 DPAD_RIGHT
+key 108 DPAD_DOWN
+key 353 DPAD_CENTER
+
+key 113 VOLUME_MUTE
+key 114 VOLUME_DOWN
+key 115 VOLUME_UP
+key 152 POWER
+key 163 MEDIA_NEXT
+key 164 MEDIA_PLAY_PAUSE
+key 165 MEDIA_PREVIOUS
+
+key 158 BACK
+key 172 HOME
+
+key 217 SEARCH
+key 580 APP_SWITCH
+key 582 ASSIST
+
+axis 0x00 X
+axis 0x01 Y
+axis 0x02 Z
+axis 0x05 RZ
+axis 0x09 RTRIGGER
+axis 0x0a LTRIGGER
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
+
+led 0x00 CONTROLLER_1
+led 0x01 CONTROLLER_2
+led 0x02 CONTROLLER_3
+led 0x03 CONTROLLER_4
diff --git a/data/keyboards/Vendor_1532_Product_0900.kl b/data/keyboards/Vendor_1532_Product_0900.kl
new file mode 100644
index 0000000..c2fc1b4
--- /dev/null
+++ b/data/keyboards/Vendor_1532_Product_0900.kl
@@ -0,0 +1,42 @@
+# Copyright (C) 2014 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.
+
+# Razer Serval
+
+key 304 BUTTON_A
+key 305 BUTTON_B
+key 307 BUTTON_X
+key 308 BUTTON_Y
+key 310 BUTTON_L1
+key 311 BUTTON_R1
+key 316 BUTTON_MODE
+key 317 BUTTON_THUMBL
+key 318 BUTTON_THUMBR
+
+key 158 BACK
+key 172 HOME
+
+axis 0x00 X
+axis 0x01 Y
+axis 0x02 Z
+axis 0x05 RZ
+axis 0x09 RTRIGGER
+axis 0x0a LTRIGGER
+axis 0x10 HAT_X
+axis 0x11 HAT_Y
+
+led 0x00 CONTROLLER_1
+led 0x01 CONTROLLER_2
+led 0x02 CONTROLLER_3
+led 0x03 CONTROLLER_4
diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd
index 775c424..59bf71c 100644
--- a/docs/html/guide/topics/manifest/uses-feature-element.jd
+++ b/docs/html/guide/topics/manifest/uses-feature-element.jd
@@ -560,7 +560,7 @@
<td></td>
</tr>
<tr>
- <td rowspan="12">Camera</td>
+ <td rowspan="10">Camera</td>
<td><code>android.hardware.camera</code></td>
<td>The application uses the device's camera. If the device supports
multiple cameras, the application uses the camera that facing
@@ -609,14 +609,6 @@
<td><code>android.hardware.camera.capability.raw</code></td>
<td>The application uses a a camera device with the <code>RAW</code> capability.</td>
</tr>
-<tr>
- <td><code>android.hardware.camera.capability.burst_capture</code></td>
- <td>The application uses a a camera device with the <code>BURST_CAPTURE</code> capability.</td>
-</tr>
-<tr>
- <td><code>android.hardware.camera.capability.read_sensor_settings</code></td>
- <td>The application uses a a camera device with the <code>READ_SENSOR_SETTINGS</code> capability.</td>
-</tr>
<tr>
<td>Infrared</td>
diff --git a/docs/html/samples/admin.jd b/docs/html/samples/admin.jd
new file mode 100644
index 0000000..c6637d8
--- /dev/null
+++ b/docs/html/samples/admin.jd
@@ -0,0 +1,11 @@
+page.title=Admin
+@jd:body
+
+
+<div id="samples" class="admin">
+</div>
+
+
+<script>
+ $(document).ready(showSamples);
+</script>
diff --git a/docs/html/samples/new/index.jd b/docs/html/samples/new/index.jd
index ba75072..279b910 100644
--- a/docs/html/samples/new/index.jd
+++ b/docs/html/samples/new/index.jd
@@ -2,19 +2,18 @@
@jd:body
-<p>The following code samples were recently published for the L Developer Preview. You can
+<p>The following code samples were recently published. You can
download them in the Android SDK Manager under the <b>SDK Samples</b> component
-for the L Developer Preview.</p>
+for API 21.</p>
<p class="note">
- <strong>Note:</strong> At this time, the downloadable projects are designed
+ <strong>Note:</strong> The downloadable projects are designed
for use with Gradle and Android Studio.
</p>
-
<!-- NOTE TO EDITORS: add most recent samples first -->
-<h3 id="MediaBrowserService">Media Browser Service</h3>
+<h3 id="MediaBrowserService"><a href="/samples/MediaBrowserService/index.html">Media Browser Service</a></h3>
<p>
This sample is a simple audio media app that exposes its media
@@ -29,10 +28,8 @@
href="http://android.com/auto">Android Auto</a>.
</p>
-<p><a href="http://github.com/googlesamples/android-MediaBrowserService">Get it on GitHub</a></p>
-
-<h3 id="MessagingService">Messaging Service</h3>
+<h3 id="MessagingService"><a href="/samples/MessagingService/index.html">Messaging Service</a></h3>
<p>
This sample shows a simple service that sends notifications using
@@ -46,10 +43,8 @@
href="http://android.com/auto">Android Auto</a>.
</p>
-<p><a href="http://github.com/googlesamples/android-MessagingService">Get it on GitHub</a></p>
-
-<h3 id="SpeedTracker">Speed Tracker (Wear)</h3>
+<h3 id="SpeedTracker"><a href="/samples/SpeedTracker/index.html">Speed Tracker (Wear)</a></h3>
<p>
This sample uses the FusedLocation APIs of Google Play Services on Android Wear
@@ -62,10 +57,8 @@
made of those coordinates on a map on the phone.
</p>
-<p><a href="http://github.com/googlesamples/android-SpeedTracker">Get it on GitHub</a></p>
-
-<h3 id="AppRestrictionSchema">AppRestrictionSchema</h3>
+<h3 id="AppRestrictionSchema"><a href="/samples/AppRestrictionSchema/index.html">AppRestrictionSchema</a></h3>
<p>
This sample shows how to use app restrictions. This application has one boolean
@@ -74,29 +67,23 @@
AppRestrictionEnforcer sample to toggle the restriction.
</p>
-<p><a href="http://github.com/googlesamples/android-AppRestrictionSchema">Get it on GitHub</a></p>
-
-<h3 id="AppRestrictionEnforcer">AppRestrictionEnforcer</h3>
+<h3 id="AppRestrictionEnforcer"><a href="/samples/AppRestrictionEnforcer/index.html">AppRestrictionEnforcer</a></h3>
<p>
This sample demonstrates how to set restrictions to other apps as a profile owner.
Use AppRestrictionSchema sample as a app with available restrictions.
</p>
-<p><a href="http://github.com/googlesamples/android-AppRestrictionEnforcer">Get it on GitHub</a></p>
-
-<h3 id="DocumentCentricRelinquishIdentity">DocumentCentricRelinquishIdentity</h3>
+<h3 id="DocumentCentricRelinquishIdentity"><a href="/samples/DocumentCentricRelinquishIdentity/index.html">DocumentCentricRelinquishIdentity</a></h3>
<p>
This sample shows how to relinquish identity to activities above it in the task stack.
</p>
-<p><a href="http://github.com/googlesamples/android-DocumentCentricRelinquishIdentity">Get it on GitHub</a></p>
-
-<h3 id="DocumentCentricApps">DocumentCentricApps</h3>
+<h3 id="DocumentCentricApps"><a href="/samples/DocumentCentricApps/index.html">DocumentCentricApps</a></h3>
<p>
This sample shows the basic usage of the new "Document Centric Apps" API.
@@ -105,10 +92,8 @@
created for every new document in the overview menu.
</p>
-<p><a href="http://github.com/googlesamples/android-DocumentCentricApps">Get it on GitHub</a></p>
-
-<h3 id="HdrViewfinder">HdrViewfinder</h3>
+<h3 id="HdrViewfinder"><a href="/samples/HdrViewfinder/index.html">HdrViewfinder</a></h3>
<p>
This demo implements a real-time high-dynamic-range camera viewfinder, by alternating
@@ -116,10 +101,8 @@
compositing together the latest two frames whenever a new frame is captured.
</p>
-<p><a href="http://github.com/googlesamples/android-HdrViewfinder">Get it on GitHub</a></p>
-
-<h3 id="Interpolator">Interpolator</h3>
+<h3 id="Interpolator"><a href="/samples/Interpolator/index.html">Interpolator</a></h3>
<p>
This sample demonstrates the use of animation interpolators and path animations for
@@ -127,10 +110,8 @@
view (scale X and Y) along a path.
</p>
-<p><a href="http://github.com/googlesamples/android-Interpolator">Get it on GitHub</a></p>
-
-<h3 id="DrawableTinting">DrawableTinting</h3>
+<h3 id="DrawableTinting"><a href="/samples/DrawableTinting/index.html">DrawableTinting</a></h3>
<p>Sample that shows applying tinting and color filters to Drawables both programmatically
and as Drawable resources in XML.</p>
@@ -141,54 +122,43 @@
with a reference to a color and a PorterDuff blend mode. The color and blend mode can be
changed from the UI to see the effect of different options.</p>
-<p><a href="http://github.com/googlesamples/android-DrawableTinting">Get it on GitHub</a></p>
-
-<h3 id="LNotifications">LNotifications</h3>
+<h3 id="LNotifications"><a href="/samples/LNotifications/index.html">LNotifications</a></h3>
<p>
This sample demonstrates how new features for notifications introduced in Android 5.0
are used such as Heads-Up notifications, visibility, people, category and priority
metadata. </p>
-<p><a href="http://github.com/googlesamples/android-LNotifications">Get it on GitHub</a></p>
-<h3 id="CardView">CardView</h3>
+<h3 id="CardView"><a href="/samples/CardView/index.html">CardView</a></h3>
<p>
This sample demonstrates how to use the CardView UI widget introduced in Android 5.0, using the support library for backward compatibility.
</p>
-<p><a href="http://github.com/googlesamples/android-CardView">Get it on GitHub</a></p>
-
-<h3 id="RecyclerView">RecyclerView</h3>
+<h3 id="RecyclerView"><a href="/samples/RecyclerView/index.html">RecyclerView</a></h3>
<p>
Demonstration of using RecyclerView with a LayoutManager to create a vertical ListView.
</p>
-<p><a href="http://github.com/googlesamples/android-RecyclerView">Get it on GitHub</a></p>
-
-<h3 id="RevealEffectBasic">RevealEffectBasic</h3>
+<h3 id="RevealEffectBasic"><a href="/samples/RevealEffectBasic/index.html">RevealEffectBasic</a></h3>
<p>
A sample demonstrating how to perform a reveal effect for UI elements within the Material Design framework.
</p>
-<p><a href="http://github.com/googlesamples/android-RevealEffectBasic">Get it on GitHub</a></p>
-
-<h3 id="FloatingActionButtonBasic">FloatingActionButtonBasic</h3>
+<h3 id="FloatingActionButtonBasic"><a href="/samples/FloatingActionButtonBasic/index.html">FloatingActionButtonBasic</a></h3>
<p>
This sample shows the two sizes of Floating Action Buttons and how to interact with
them.
</p>
-<p><a href="http://github.com/googlesamples/android-FloatingActionButtonBasic">Get it on GitHub</a></p>
-
<!--
<h3 id="">SampleName</h3>
@@ -205,36 +175,15 @@
</p>
-->
-
-<h3 id="NavigationDrawerSample">NavigationDrawerSample</h3>
-<!--
-<div class="figure" style="width:220px">
- <img src="" srcset="@2x.png 2x" alt="" height="375" />
- <p class="img-caption">
- <strong>Figure n.</strong> Single sentence summarizing the figure.
- </p>
-</div>
--->
-
-<p>
-This sample illustrates a common usage of the Android support library's
-{@link android.support.v4.widget.DrawerLayout} widget.
-</p>
-
-<p><a href="http://github.com/googlesamples/android-NavigationDrawer">Get it on GitHub</a></p>
-
-
-<h3 id="JobSchedulerSample">JobSchedulerSample</h3>
+<h3 id="JobSchedulerSample"><a href="/samples/JobScheduler/index.html">JobScheduler</a></h3>
<p>
This sample app allows the user to schedule jobs through the UI, and shows
visual cues when the jobs are executed.
</p>
-<p><a href="http://github.com/googlesamples/android-JobScheduler">Get it on GitHub</a></p>
-
-<h3 id="AndroidTVLeanbackSample">AndroidTVLeanbackSample</h3>
+<h3 id="AndroidTVLeanbackSample"><a href="https://github.com/googlesamples/androidtv-leanback">AndroidTVLeanbackSample</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -248,10 +197,7 @@
This sample demonstrates use of the Android TV Leanback Support Library.
</p>
-<p><a href="http://github.com/googlesamples/androidtv-Leanback">Get it on GitHub</a></p>
-
-
-<h3 id="Visual-Game-Controller">Visual-Game-Controller</h3>
+<h3 id="Visual-Game-Controller"><a href="https://github.com/googlesamples/androidtv-VisualGameController">Visual-Game-Controller</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -265,10 +211,8 @@
This sample displays events received from a game controller shown on the screen.
</p>
-<p><a href="http://github.com/googlesamples/androidtv-VisualGameController">Get it on GitHub</a></p>
-
-<h3 id="GameControllerSample">GameControllerSample</h3>
+<h3 id="GameControllerSample"><a href="https://github.com/googlesamples/androidtv-GameController/">GameControllerSample</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -283,10 +227,8 @@
handling.
</p>
-<p><a href="http://github.com/googlesamples/androidtv-GameController">Get it on GitHub</a></p>
-
-<h3 id="ClippingBasic">ClippingBasic</h3>
+<h3 id="ClippingBasic"><a href="/samples/ClippingBasic/index.html">ClippingBasic</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -300,19 +242,17 @@
This sample demonstrates clipping on a {@link android.view.View}.
</p>
-<p><a href="http://github.com/googlesamples/android-ClippingBasic">Get it on GitHub</a></p>
-
<div class="figure" style="width:220px">
<img src="{@docRoot}samples/images/JobSchedulerSample.png"
srcset="{@docRoot}samples/images/JobSchedulerSample@2x.png 2x"
alt="" height="375" />
<p class="img-caption">
- <strong>Figure 3.</strong> The JobSchedulerSample sample app.
+ <strong>Figure 1.</strong> The JobSchedulerSample sample app.
</p>
</div>
-<h3 id="ElevationDrag">ElevationDrag</h3>
+<h3 id="ElevationDrag"><a href="/samples/ElevationDrag/index.html">ElevationDrag</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -326,10 +266,8 @@
Elevation and z-translation are used to render the shadows. The views are
clipped using different outlines.</p>
-<p><a href="http://github.com/googlesamples/android-ElevationDrag">Get it on GitHub</a></p>
-
-<h3 id="ElevationBasic">ElevationBasic</h3>
+<h3 id="ElevationBasic"><a href="/samples/ElevationBasic/index.html">ElevationBasic</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -348,10 +286,8 @@
<code>setTranslationZ()</code>.</li>
</ul>
-<p><a href="http://github.com/googlesamples/android-ElevationBasic">Get it on GitHub</a></p>
-
-<h3 id="ActivitySceneTransitionBasic">ActivitySceneTransitionBasic</h3>
+<h3 id="ActivitySceneTransitionBasic"><a href="/samples/ActivitySceneTransitionBasic/index.html">ActivitySceneTransitionBasic</a></h3>
<div class="figure" style="width:220px">
<img src="{@docRoot}samples/images/ActivitySceneTransitionBasic.png"
srcset="{@docRoot}samples/images/ActivitySceneTransitionBasic@2x.png 2x"
@@ -366,10 +302,8 @@
of <code>moveImage</code> and <code>changeBounds</code> to nicely transition
from a grid of images to an activity with a large image and detail text. </p>
-<p><a href="http://github.com/googlesamples/android-ActivitySceneTransition">Get it on GitHub</a></p>
-
-<h3 id="Camera2Video">Camera2Video</h3>
+<h3 id="Camera2Video"><a href="/samples/Camera2Video/index.html">Camera2Video</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -381,10 +315,8 @@
<p>This sample demonstrates how to record video using the Camera2 API.</p>
-<p><a href="http://github.com/googlesamples/android-Camera2Video">Get it on GitHub</a></p>
-
-<h3 id="Camera2Basic">Camera2Basic</h3>
+<h3 id="Camera2Basic"><a href="/samples/Camera2Basic/index.html">Camera2Basic</a></h3>
<!--
<div class="figure" style="width:220px">
@@ -398,16 +330,14 @@
<p>This sample demonstrates the basic use of the Camera2 API. The sample code
demonstrates how you can display camera preview and take pictures.</p>
-<p><a href="http://github.com/googlesamples/android-Camera2Basic">Get it on GitHub</a></p>
-
-<h3 id="BasicManagedProfile">BasicManagedProfile</h3>
+<h3 id="BasicManagedProfile"><a href="/samples/BasicManagedProfile/index.html">BasicManagedProfile</a></h3>
<div class="figure" style="width:220px">
<img src="{@docRoot}samples/images/BasicManagedProfile.png"
srcset="{@docRoot}samples/images/BasicManagedProfile@2x.png 2x"
alt="" height="375" />
<p class="img-caption">
- <strong>Figure 1.</strong> The BasicManagedProfile sample app.
+ <strong>Figure 3.</strong> The BasicManagedProfile sample app.
</p>
</div>
@@ -422,5 +352,3 @@
<p class="note"><strong>Note:</strong> There can be only one managed profile on
a device at a time.</p>
-<p><a href="http://github.com/googlesamples/android-BasicManagedProfile">Get it on GitHub</a></p>
-
diff --git a/docs/html/training/wearables/ui/exit.jd b/docs/html/training/wearables/ui/exit.jd
index 84e1e45..6b205a57 100644
--- a/docs/html/training/wearables/ui/exit.jd
+++ b/docs/html/training/wearables/ui/exit.jd
@@ -67,7 +67,7 @@
android:id="@+id/dismiss_overlay"
android:layout_height="match_parent"
android:layout_width="match_parent"/>
-<FrameLayout>
+</FrameLayout>
</pre>
<p>In your activity, obtain the <code>DismissOverlayView</code> element and set some introductory
@@ -100,8 +100,8 @@
// Capture long presses
@Override
- public boolean onTouchEvent(MotionEvent ev) {
- return mDetector.onTouchEvent(ev) || super.onTouchEvent(ev);
+ public boolean dispatchTouchEvent(MotionEvent e) {
+ return mDetector.onTouchEvent(e) || super.dispatchTouchEvent(e);
}
}
</pre>
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 3090ffd..3f79c2d 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -48,13 +48,8 @@
/**
* Backing buffer for the Bitmap.
- * Made public for quick access from drawing methods -- do NOT modify
- * from outside this class
- *
- * @hide
*/
- @SuppressWarnings("UnusedDeclaration") // native code only
- public byte[] mBuffer;
+ private byte[] mBuffer;
@SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"}) // Keep to finalize native resources
private final BitmapFinalizer mFinalizer;
diff --git a/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java b/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java
index 5fc40f2..4af5946 100644
--- a/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java
@@ -651,6 +651,7 @@
}
}
+ @Override
protected void setConstantState(@NonNull DrawableContainerState state) {
super.setConstantState(state);
diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java
index 28ada82..9eb0251 100644
--- a/graphics/java/android/graphics/drawable/AnimationDrawable.java
+++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java
@@ -23,6 +23,7 @@
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
+import android.annotation.NonNull;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.Resources.Theme;
@@ -81,7 +82,7 @@
* @attr ref android.R.styleable#AnimationDrawableItem_drawable
*/
public class AnimationDrawable extends DrawableContainer implements Runnable, Animatable {
- private final AnimationState mAnimationState;
+ private AnimationState mAnimationState;
/** The current frame, may be -1 when not animating. */
private int mCurFrame = -1;
@@ -408,9 +409,17 @@
}
}
+ @Override
+ protected void setConstantState(@NonNull DrawableContainerState state) {
+ super.setConstantState(state);
+
+ if (state instanceof AnimationState) {
+ mAnimationState = (AnimationState) state;
+ }
+ }
+
private AnimationDrawable(AnimationState state, Resources res) {
- AnimationState as = new AnimationState(state, this, res);
- mAnimationState = as;
+ final AnimationState as = new AnimationState(state, this, res);
setConstantState(as);
if (state != null) {
setFrame(0, true, false);
diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java
index 6d43a0c..68fd296 100644
--- a/graphics/java/android/graphics/drawable/DrawableContainer.java
+++ b/graphics/java/android/graphics/drawable/DrawableContainer.java
@@ -567,8 +567,9 @@
@Override
public Drawable mutate() {
if (!mMutated && super.mutate() == this) {
- mDrawableContainerState = cloneConstantState();
- mDrawableContainerState.mutate();
+ final DrawableContainerState clone = cloneConstantState();
+ clone.mutate();
+ setConstantState(clone);
mMutated = true;
}
return this;
diff --git a/graphics/java/android/graphics/drawable/LevelListDrawable.java b/graphics/java/android/graphics/drawable/LevelListDrawable.java
index dc41216..b01c643 100644
--- a/graphics/java/android/graphics/drawable/LevelListDrawable.java
+++ b/graphics/java/android/graphics/drawable/LevelListDrawable.java
@@ -21,6 +21,7 @@
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
+import android.annotation.NonNull;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.Resources.Theme;
@@ -57,7 +58,7 @@
* @attr ref android.R.styleable#LevelListDrawableItem_drawable
*/
public class LevelListDrawable extends DrawableContainer {
- private final LevelListState mLevelListState;
+ private LevelListState mLevelListState;
private boolean mMutated;
public LevelListDrawable() {
@@ -227,9 +228,17 @@
}
}
+ @Override
+ protected void setConstantState(@NonNull DrawableContainerState state) {
+ super.setConstantState(state);
+
+ if (state instanceof LevelListState) {
+ mLevelListState = (LevelListState) state;
+ }
+ }
+
private LevelListDrawable(LevelListState state, Resources res) {
- LevelListState as = new LevelListState(state, this, res);
- mLevelListState = as;
+ final LevelListState as = new LevelListState(state, this, res);
setConstantState(as);
onLevelChange(getLevel());
}
diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp
index aa32541..75bd067 100644
--- a/libs/hwui/renderthread/CanvasContext.cpp
+++ b/libs/hwui/renderthread/CanvasContext.cpp
@@ -123,8 +123,8 @@
setSurface(window);
}
-void CanvasContext::pauseSurface(ANativeWindow* window) {
- stopDrawing();
+bool CanvasContext::pauseSurface(ANativeWindow* window) {
+ return mRenderThread.removeFrameCallback(this);
}
// TODO: don't pass viewport size, it's automatic via EGL
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index 435244e..0cc2c7c 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -67,7 +67,7 @@
bool initialize(ANativeWindow* window);
void updateSurface(ANativeWindow* window);
- void pauseSurface(ANativeWindow* window);
+ bool pauseSurface(ANativeWindow* window);
bool hasSurface() { return mNativeWindow.get(); }
void setup(int width, int height, const Vector3& lightCenter, float lightRadius,
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 5d55ea6..6d063a4 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -156,15 +156,14 @@
}
CREATE_BRIDGE2(pauseSurface, CanvasContext* context, ANativeWindow* window) {
- args->context->pauseSurface(args->window);
- return NULL;
+ return (void*) args->context->pauseSurface(args->window);
}
-void RenderProxy::pauseSurface(const sp<ANativeWindow>& window) {
+bool RenderProxy::pauseSurface(const sp<ANativeWindow>& window) {
SETUP_TASK(pauseSurface);
args->context = mContext;
args->window = window.get();
- postAndWait(task);
+ return (bool) postAndWait(task);
}
CREATE_BRIDGE7(setup, CanvasContext* context, int width, int height,
diff --git a/libs/hwui/renderthread/RenderProxy.h b/libs/hwui/renderthread/RenderProxy.h
index 4989b14..fd1fe05 100644
--- a/libs/hwui/renderthread/RenderProxy.h
+++ b/libs/hwui/renderthread/RenderProxy.h
@@ -69,7 +69,7 @@
ANDROID_API bool initialize(const sp<ANativeWindow>& window);
ANDROID_API void updateSurface(const sp<ANativeWindow>& window);
- ANDROID_API void pauseSurface(const sp<ANativeWindow>& window);
+ ANDROID_API bool pauseSurface(const sp<ANativeWindow>& window);
ANDROID_API void setup(int width, int height, const Vector3& lightCenter, float lightRadius,
uint8_t ambientShadowAlpha, uint8_t spotShadowAlpha);
ANDROID_API void setOpaque(bool opaque);
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index f887103..38cb4cd 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -314,9 +314,11 @@
mPendingRegistrationFrameCallbacks.insert(callback);
}
-void RenderThread::removeFrameCallback(IFrameCallback* callback) {
- mFrameCallbacks.erase(callback);
- mPendingRegistrationFrameCallbacks.erase(callback);
+bool RenderThread::removeFrameCallback(IFrameCallback* callback) {
+ size_t erased;
+ erased = mFrameCallbacks.erase(callback);
+ erased |= mPendingRegistrationFrameCallbacks.erase(callback);
+ return erased;
}
void RenderThread::pushBackFrameCallback(IFrameCallback* callback) {
diff --git a/libs/hwui/renderthread/RenderThread.h b/libs/hwui/renderthread/RenderThread.h
index c461f3a..4126d02 100644
--- a/libs/hwui/renderthread/RenderThread.h
+++ b/libs/hwui/renderthread/RenderThread.h
@@ -80,7 +80,7 @@
// Mimics android.view.Choreographer
void postFrameCallback(IFrameCallback* callback);
- void removeFrameCallback(IFrameCallback* callback);
+ bool removeFrameCallback(IFrameCallback* callback);
// If the callback is currently registered, it will be pushed back until
// the next vsync. If it is not currently registered this does nothing.
void pushBackFrameCallback(IFrameCallback* callback);
diff --git a/media/java/android/media/projection/MediaProjection.java b/media/java/android/media/projection/MediaProjection.java
index 2ca9b9a..a6bde1d 100644
--- a/media/java/android/media/projection/MediaProjection.java
+++ b/media/java/android/media/projection/MediaProjection.java
@@ -76,6 +76,9 @@
if (callback == null) {
throw new IllegalArgumentException("callback should not be null");
}
+ if (handler == null) {
+ handler = new Handler();
+ }
mCallbacks.put(callback, new CallbackRecord(callback, handler));
}
@@ -182,16 +185,15 @@
private final class MediaProjectionCallback extends IMediaProjectionCallback.Stub {
@Override
public void onStop() {
- final int N = mCallbacks.size();
- for (int i = 0; i < N; i++) {
- mCallbacks.get(i).onStop();
+ for (CallbackRecord cbr : mCallbacks.values()) {
+ cbr.onStop();
}
}
}
private final static class CallbackRecord {
- private Callback mCallback;
- private Handler mHandler;
+ private final Callback mCallback;
+ private final Handler mHandler;
public CallbackRecord(Callback callback, Handler handler) {
mCallback = callback;
diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java
index 93cca2f..b19a1fb 100644
--- a/media/java/android/media/tv/TvInputService.java
+++ b/media/java/android/media/tv/TvInputService.java
@@ -1210,6 +1210,7 @@
}
mServiceHandler.obtainMessage(ServiceHandler.DO_NOTIFY_SESSION_CREATED, args)
.sendToTarget();
+ session.tune(TvContract.buildChannelUriForPassthroughInput(getHardwareInputId()));
}
@Override
diff --git a/packages/BackupRestoreConfirmation/res/values-es/strings.xml b/packages/BackupRestoreConfirmation/res/values-es/strings.xml
index 01f7cf7..ac0836d 100644
--- a/packages/BackupRestoreConfirmation/res/values-es/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-es/strings.xml
@@ -25,11 +25,11 @@
<string name="allow_restore_button_label" msgid="3081286752277127827">"Restaurar mis datos"</string>
<string name="deny_restore_button_label" msgid="1724367334453104378">"No restaurar"</string>
<string name="current_password_text" msgid="8268189555578298067">"Introduce a continuación la contraseña actual de copia de seguridad:"</string>
- <string name="device_encryption_restore_text" msgid="1570864916855208992">"Introduce a continuación la contraseña de encriptación del dispositivo."</string>
- <string name="device_encryption_backup_text" msgid="5866590762672844664">"Introduce a continuación la contraseña de encriptación del dispositivo. Esta contraseña se usará también para encriptar el archivo de copia de seguridad."</string>
+ <string name="device_encryption_restore_text" msgid="1570864916855208992">"Introduce a continuación la contraseña de cifrado del dispositivo."</string>
+ <string name="device_encryption_backup_text" msgid="5866590762672844664">"Introduce a continuación la contraseña de cifrado del dispositivo. Esta contraseña se usará también para cifrar el archivo de copia de seguridad."</string>
<string name="backup_enc_password_text" msgid="4981585714795233099">"Introduce la contraseña que quieras usar para cifrar los datos de la copia de seguridad completa. Si dejas este campo en blanco, se usará tu contraseña de copia de seguridad actual:"</string>
<string name="backup_enc_password_optional" msgid="1350137345907579306">"Si quieres cifrar los datos de la copia de seguridad completa, introduce la contraseña a continuación:"</string>
- <string name="backup_enc_password_required" msgid="7889652203371654149">"Tu dispositivo está encriptado, por lo que debes encriptar tu copia de seguridad. Introduce una contraseña a continuación:"</string>
+ <string name="backup_enc_password_required" msgid="7889652203371654149">"Tu dispositivo está cifrado, por lo que debes cifrar tu copia de seguridad. Introduce una contraseña a continuación:"</string>
<string name="restore_enc_password_text" msgid="6140898525580710823">"Si los datos de restauración están cifrados, introduce la contraseña a continuación:"</string>
<string name="toast_backup_started" msgid="550354281452756121">"Iniciando copia de seguridad..."</string>
<string name="toast_backup_ended" msgid="3818080769548726424">"Copia de seguridad finalizada"</string>
diff --git a/packages/BackupRestoreConfirmation/res/values-hi/strings.xml b/packages/BackupRestoreConfirmation/res/values-hi/strings.xml
index 71a319f..2578e8f 100644
--- a/packages/BackupRestoreConfirmation/res/values-hi/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-hi/strings.xml
@@ -21,15 +21,15 @@
<string name="backup_confirm_text" msgid="1878021282758896593">"कनेक्ट किए गए डेस्कटॉप कंप्यूटर से सभी डेटा के संपूर्ण सुरक्षा का अनुरोध किया गया है. क्या आप इसकी अनुमति देना चाहते हैं?\n\nयदि आपने स्वयं बैकअप का अनुरोध नहीं किया है, तो प्रक्रिया जारी रखने की अनुमति न दें."</string>
<string name="allow_backup_button_label" msgid="4217228747769644068">"मेरे डेटा का बैकअप लें"</string>
<string name="deny_backup_button_label" msgid="6009119115581097708">"बैकअप न लें"</string>
- <string name="restore_confirm_text" msgid="7499866728030461776">"कनेक्ट किए गए डेस्कटॉप कंप्यूटर से सभी डेटा की पूर्ण पुनर्स्थापना का अनुरोध किया गया है. क्या आप इसकी अनुमति देना चाहते हैं?\n\nयदि आपने स्वयं पुनर्प्राप्ति का अनुरोध नहीं किया है, तो प्रक्रिया जारी रखने की अनुमति न दें. इससे वर्तमान में आपके उपकरण पर मौजूद डेटा बदल जाएगा!"</string>
+ <string name="restore_confirm_text" msgid="7499866728030461776">"कनेक्ट किए गए डेस्कटॉप कंप्यूटर से सभी डेटा की पूर्ण पुनर्स्थापना का अनुरोध किया गया है. क्या आप इसकी अनुमति देना चाहते हैं?\n\nयदि आपने स्वयं पुनर्प्राप्ति का अनुरोध नहीं किया है, तो प्रक्रिया जारी रखने की अनुमति न दें. इससे वर्तमान में आपके डिवाइस पर मौजूद डेटा बदल जाएगा!"</string>
<string name="allow_restore_button_label" msgid="3081286752277127827">"मेरा डेटा पुनर्स्थापित करें"</string>
<string name="deny_restore_button_label" msgid="1724367334453104378">"पुनर्स्थापित न करें"</string>
<string name="current_password_text" msgid="8268189555578298067">"कृपया नीचे अपना वर्तमान सुरक्षित करने का पासवर्ड डालें:"</string>
- <string name="device_encryption_restore_text" msgid="1570864916855208992">"कृपया नीचे अपना उपकरण एन्क्रिप्शन पासवर्ड डालें."</string>
- <string name="device_encryption_backup_text" msgid="5866590762672844664">"कृपया अपना उपकरण सुरक्षित तरीका पासवर्ड नीचे दर्ज करें. बैकअप संग्रहण को एन्क्रिप्ट करने के लिए भी इसका उपयोग किया जाएगा."</string>
+ <string name="device_encryption_restore_text" msgid="1570864916855208992">"कृपया नीचे अपना डिवाइस एन्क्रिप्शन पासवर्ड डालें."</string>
+ <string name="device_encryption_backup_text" msgid="5866590762672844664">"कृपया अपना डिवाइस सुरक्षित तरीका पासवर्ड नीचे दर्ज करें. बैकअप मेमोरी को एन्क्रिप्ट करने के लिए भी इसका उपयोग किया जाएगा."</string>
<string name="backup_enc_password_text" msgid="4981585714795233099">"कृपया संपूर्ण सुरक्षित डेटा को एन्क्रिप्ट करने में उपयोग के लिए पासवर्ड डालें. यदि यह खाली छोड़ दिया जाता है, तो आपके वर्तमान बैकअप पासवर्ड का उपयोग किया जाएगा:"</string>
<string name="backup_enc_password_optional" msgid="1350137345907579306">"यदि आप संपूर्ण सुरक्षित डेटा को एन्क्रिप्ट करना चाहते हैं, तो नीचे पासवर्ड डालें:"</string>
- <string name="backup_enc_password_required" msgid="7889652203371654149">"चूंकि आपका उपकरण एन्क्रिप्ट किया हुआ है, इसलिए आपको अपने बैकअप को एन्क्रिप्ट करना आवश्यक है. कृपया नीचे पासवर्ड डालें:"</string>
+ <string name="backup_enc_password_required" msgid="7889652203371654149">"चूंकि आपका डिवाइस एन्क्रिप्ट किया हुआ है, इसलिए आपको अपने बैकअप को एन्क्रिप्ट करना आवश्यक है. कृपया नीचे पासवर्ड डालें:"</string>
<string name="restore_enc_password_text" msgid="6140898525580710823">"यदि पुनर्स्थापित डेटा को एन्क्रिप्ट किया गया है, तो कृपया नीचे पासवर्ड डालें:"</string>
<string name="toast_backup_started" msgid="550354281452756121">"सुरक्षित करना शुरु हो रहा है..."</string>
<string name="toast_backup_ended" msgid="3818080769548726424">"सुरक्षित करना पूर्ण"</string>
diff --git a/packages/BackupRestoreConfirmation/res/values-kk-rKZ/strings.xml b/packages/BackupRestoreConfirmation/res/values-kk-rKZ/strings.xml
index 6a36b9e..38d7172 100644
--- a/packages/BackupRestoreConfirmation/res/values-kk-rKZ/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-kk-rKZ/strings.xml
@@ -29,8 +29,7 @@
<string name="device_encryption_backup_text" msgid="5866590762672844664">"Құрылғыңыздың кодтық кілтсөзін енгізіңіз. Ол сақтық көшірме мұрағатын кодтау үшін де қолданылады."</string>
<string name="backup_enc_password_text" msgid="4981585714795233099">"Деректердің сақтық көшірмесін толығымен шифрлау үшін кілтсөзді енгізіңіз. Егер бұл бос қалдырылса, сіздің қазіргі сақтық көшірме кілтсөзіңіз қолданылады:"</string>
<string name="backup_enc_password_optional" msgid="1350137345907579306">"Деректердің сақтық көшірмесін толығымен шифрлауды қаласаңыз, кілтсөзді енгізіңіз:"</string>
- <!-- no translation found for backup_enc_password_required (7889652203371654149) -->
- <skip />
+ <string name="backup_enc_password_required" msgid="7889652203371654149">"Құрылғыңыз шифрланғандықтан, сақтық көшірмені шифрлау қажет. Төменде құпия сөзді енгізіңіз:"</string>
<string name="restore_enc_password_text" msgid="6140898525580710823">"Қалпына келтіру деректері кодталса, кілтсөзді енгізіңіз:"</string>
<string name="toast_backup_started" msgid="550354281452756121">"Сақтық көшірме басталуда..."</string>
<string name="toast_backup_ended" msgid="3818080769548726424">"Қалпына келтіру аяқталды"</string>
diff --git a/packages/BackupRestoreConfirmation/res/values-ky-rKG/strings.xml b/packages/BackupRestoreConfirmation/res/values-ky-rKG/strings.xml
index 3c7b6e7..6333b18 100644
--- a/packages/BackupRestoreConfirmation/res/values-ky-rKG/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-ky-rKG/strings.xml
@@ -29,8 +29,7 @@
<string name="device_encryption_backup_text" msgid="5866590762672844664">"Түзмөгүңүздүн шифрлөө сырсөзүн төмөндө киргизиңиз. Ал бэкап архивин шифрлегенге дагы колдонулат."</string>
<string name="backup_enc_password_text" msgid="4981585714795233099">"Эгер сиз толук бэкапты шифрлегиңиз келсе, төмөндө сырсөз киргизиңиз. Эгер ал бош калтырылса, анда учурдагы сырсөз колдонулат:"</string>
<string name="backup_enc_password_optional" msgid="1350137345907579306">"Эгер сиз толук бэкапты шифрлегиңиз келсе, төмөндө сырсөз киргизиңиз:"</string>
- <!-- no translation found for backup_enc_password_required (7889652203371654149) -->
- <skip />
+ <string name="backup_enc_password_required" msgid="7889652203371654149">"Түзмөгүңүз шифрленген болгондуктан, камдооңузду шифрлешиңиз керек. Төмөнгө сырсөз киргизиңиз:"</string>
<string name="restore_enc_password_text" msgid="6140898525580710823">"Эгер калыбына келтирүү берилиштери шифрленген болсо, төмөндө сырсөздү киргизиңиз:"</string>
<string name="toast_backup_started" msgid="550354281452756121">"Бэкап башталды..."</string>
<string name="toast_backup_ended" msgid="3818080769548726424">"Бэкап аяктады"</string>
diff --git a/packages/BackupRestoreConfirmation/res/values-ne-rNP/strings.xml b/packages/BackupRestoreConfirmation/res/values-ne-rNP/strings.xml
index 993311d..473802e 100644
--- a/packages/BackupRestoreConfirmation/res/values-ne-rNP/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-ne-rNP/strings.xml
@@ -29,8 +29,7 @@
<string name="device_encryption_backup_text" msgid="5866590762672844664">"कृपया तल तपाईंको उपकरण एन्क्रिप्सन पासवर्ड प्रविष्टि गर्नुहोस्: यो ब्याकप सँग्रह एन्क्रिप्ट गर्न पनि प्रयोग हुने छ।"</string>
<string name="backup_enc_password_text" msgid="4981585714795233099">"ब्याकप डेटालाई encrypt गर्न पासवर्ड प्रविष्टि गर्नुहोस्, यदि यो खालि छोडिएको खण्डमा तपाईको पुरानै पासवर्ड प्रयोग हुने छ।"</string>
<string name="backup_enc_password_optional" msgid="1350137345907579306">"यदि तपाईं पूर्ण ब्याकअप डेटा इन्क्रिप्ट गर्न चाहनु हुन्छ भने तल पासवर्ड प्रविष्टि गर्नुहोस्।"</string>
- <!-- no translation found for backup_enc_password_required (7889652203371654149) -->
- <skip />
+ <string name="backup_enc_password_required" msgid="7889652203371654149">"तपाईँको उपकरण गुप्तिकरण गरिए देखि, तपाईंले आफ्नो जगेडा गुप्तिकरण गर्न आवश्यक छ। कृपया तल पासवर्ड प्रविष्ट गर्नुहोस्:"</string>
<string name="restore_enc_password_text" msgid="6140898525580710823">"यदि पुनःबहाली डेटा इन्क्रिप्ट छ भने कृपया तल पासवर्ड प्रविष्टि गर्नुहोस्:"</string>
<string name="toast_backup_started" msgid="550354281452756121">"जगेडा राख्न सुरु हुँदै..."</string>
<string name="toast_backup_ended" msgid="3818080769548726424">"ब्याकअप सकियो"</string>
diff --git a/packages/BackupRestoreConfirmation/res/values-si-rLK/strings.xml b/packages/BackupRestoreConfirmation/res/values-si-rLK/strings.xml
index 8d1ede4..aaeaf04 100644
--- a/packages/BackupRestoreConfirmation/res/values-si-rLK/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-si-rLK/strings.xml
@@ -29,8 +29,7 @@
<string name="device_encryption_backup_text" msgid="5866590762672844664">"කරුණාකර ඔබගේ උපාංගයේ සංකේතන මුරපදය පහත ඇතුලත් කරන්න. සංරක්ෂිත උපස්ථ සංකේතනය කිරීමට මෙය භාවිත කළ හැක."</string>
<string name="backup_enc_password_text" msgid="4981585714795233099">"කරුණාකර සියලු උපස්ථ දත්ත සංකේතනය කිරීම සඳහා භාවිතයට මුරපදයක් ඇතුළත් කරන්න. මෙය හිස්ව තැබුවොත්, ඔබගේ වර්තමාන උපස්ථ මුරපදය භාවිත වෙයි:"</string>
<string name="backup_enc_password_optional" msgid="1350137345907579306">"සියලු උපස්ථ දත්ත සංකේතනය කිරීමට ඔබ අදහස් කරන්නේ නම්, මුරපදය පහලින් ඇතුලත් කරන්න:"</string>
- <!-- no translation found for backup_enc_password_required (7889652203371654149) -->
- <skip />
+ <string name="backup_enc_password_required" msgid="7889652203371654149">"ඔබගේ උපාංගය සංකේතනය කර තිබෙන නිසා, ඔබගේ උපස්ථය සංකේතනය ඔබට අවශ්ය වී තිබේ. කරුණාකර මුරපදය පහළින් එකතු කරන්න:"</string>
<string name="restore_enc_password_text" msgid="6140898525580710823">"යළි පිහිටුවන දත්ත සංකේතනය කරන ලද ඒවානම්, කරුණාකර මුරපදය පහලින් ඇතුල් කරන්න:"</string>
<string name="toast_backup_started" msgid="550354281452756121">"උපස්ථ කිරීම ආරම්භ කරමින්..."</string>
<string name="toast_backup_ended" msgid="3818080769548726424">"උපස්ථය අවසන්"</string>
diff --git a/packages/BackupRestoreConfirmation/res/values-ur-rPK/strings.xml b/packages/BackupRestoreConfirmation/res/values-ur-rPK/strings.xml
index 416b693..6f1c9b5 100644
--- a/packages/BackupRestoreConfirmation/res/values-ur-rPK/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-ur-rPK/strings.xml
@@ -29,8 +29,7 @@
<string name="device_encryption_backup_text" msgid="5866590762672844664">"براہ کرم ذیل میں اپنے آلہ کی مرموز کاری کا پاس ورڈ درج کریں۔ یہ بیک اپ آرکائیو کی مرموز کاری کرنے کیلئے بھی استعمال کیا جائے گا۔"</string>
<string name="backup_enc_password_text" msgid="4981585714795233099">"مکمل بیک اپ ڈیٹا کی مرموز کاری کرنے کیلئے استعمال کیلئے براہ کرم ایک پاس ورڈ درج کریں۔ اگر یہ خالی رہتا ہے تو آپ کا موجودہ بیک اپ پاس ورڈ استعمال کیا جائے گا:"</string>
<string name="backup_enc_password_optional" msgid="1350137345907579306">"اگر آپ مکمل بیک اپ ڈیٹا کی مرموز کاری کرنا چاہتے ہیں تو ذیل میں ایک پاس ورڈ درج کریں:"</string>
- <!-- no translation found for backup_enc_password_required (7889652203371654149) -->
- <skip />
+ <string name="backup_enc_password_required" msgid="7889652203371654149">"چونکہ آپ کا آلہ مرموز کردہ ہے، آپ کو اپنے بیک اپ کی مرموز کاری کرنے کی ضرورت ہے۔ براہ کرم ذیل میں ایک پاس ورڈ درج کریں:"</string>
<string name="restore_enc_password_text" msgid="6140898525580710823">"اگر بحال ہونے والا ڈیٹا مرموز کردہ ہے تو براہ کرم ذیل میں پاس ورڈ درج کریں:"</string>
<string name="toast_backup_started" msgid="550354281452756121">"بیک اپ شروع ہو رہا ہے…"</string>
<string name="toast_backup_ended" msgid="3818080769548726424">"بیک اپ مکمل ہو گیا"</string>
diff --git a/packages/BackupRestoreConfirmation/res/values-uz-rUZ/strings.xml b/packages/BackupRestoreConfirmation/res/values-uz-rUZ/strings.xml
index 032f884..1b5741f 100644
--- a/packages/BackupRestoreConfirmation/res/values-uz-rUZ/strings.xml
+++ b/packages/BackupRestoreConfirmation/res/values-uz-rUZ/strings.xml
@@ -29,8 +29,7 @@
<string name="device_encryption_backup_text" msgid="5866590762672844664">"Qurilmangizning shifr parolini kiriting. U zahira arxivni shifrlash uchun ham ishlatiladi."</string>
<string name="backup_enc_password_text" msgid="4981585714795233099">"To‘liq zahira fayllarini shifrlash uchun parol kiriting. Agar bo‘sh qoldirsangiz, joriy zahiralash parolingizdan foydalaniladi:"</string>
<string name="backup_enc_password_optional" msgid="1350137345907579306">"To‘liq zahira ma’lumotlarini shifrlashni xohlasangiz, quyidagi parolni kiriting:"</string>
- <!-- no translation found for backup_enc_password_required (7889652203371654149) -->
- <skip />
+ <string name="backup_enc_password_required" msgid="7889652203371654149">"Qurilmangiz shifrlangani bois ma’lumotlaringizning zaxira nusxasini ham shifrlash zarur. Shifrlash uchun parolni kiriting:"</string>
<string name="restore_enc_password_text" msgid="6140898525580710823">"Agar tiklash ma’lumoti shifrlangan bo‘lsa, pastga parolni kiriting:"</string>
<string name="toast_backup_started" msgid="550354281452756121">"Zahiralash jarayoni boshlandi..."</string>
<string name="toast_backup_ended" msgid="3818080769548726424">"Zahiralash jarayoni bajarildi"</string>
diff --git a/packages/DocumentsUI/res/values-hi/strings.xml b/packages/DocumentsUI/res/values-hi/strings.xml
index c4dc652..88f26ed 100644
--- a/packages/DocumentsUI/res/values-hi/strings.xml
+++ b/packages/DocumentsUI/res/values-hi/strings.xml
@@ -18,7 +18,7 @@
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="2783841764617238354">"दस्तावेज़"</string>
<string name="title_open" msgid="4353228937663917801">"यहां से खोलें"</string>
- <string name="title_save" msgid="2433679664882857999">"यहां सहेजें"</string>
+ <string name="title_save" msgid="2433679664882857999">"यहां जोड़ें"</string>
<string name="menu_create_dir" msgid="5947289605844398389">"फ़ोल्डर बनाएं"</string>
<string name="menu_grid" msgid="6878021334497835259">"ग्रिड दृश्य"</string>
<string name="menu_list" msgid="7279285939892417279">"सूची दृश्य"</string>
@@ -26,13 +26,13 @@
<string name="menu_search" msgid="3816712084502856974">"खोजें"</string>
<string name="menu_settings" msgid="6008033148948428823">"सेटिंग"</string>
<string name="menu_open" msgid="432922957274920903">"खोलें"</string>
- <string name="menu_save" msgid="2394743337684426338">"सहेजें"</string>
+ <string name="menu_save" msgid="2394743337684426338">"जोड़ें"</string>
<string name="menu_share" msgid="3075149983979628146">"साझा करें"</string>
<string name="menu_delete" msgid="8138799623850614177">"हटाएं"</string>
<string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" चुनें"</string>
- <string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"आंतरिक संग्रहण दिखाएं"</string>
+ <string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"आंतरिक मेमोरी दिखाएं"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD कार्ड दिखाएं"</string>
- <string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"आंतरिक संग्रहण छिपाएं"</string>
+ <string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"आंतरिक मेमोरी छिपाएं"</string>
<string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD कार्ड छिपाएं"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"फ़ाइल आकार दिखाएं"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"फ़ाइल आकार छिपाएं"</string>
@@ -46,10 +46,10 @@
<string name="create_error" msgid="3735649141335444215">"फ़ोल्डर बनाने में विफल"</string>
<string name="query_error" msgid="1222448261663503501">"दस्तावेजों के लिए क्वेरी करने में विफल रहा"</string>
<string name="root_recent" msgid="4470053704320518133">"हाल ही के"</string>
- <string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> रिक्त"</string>
- <string name="root_type_service" msgid="2178854894416775409">"संग्रहण सेवाएं"</string>
+ <string name="root_available_bytes" msgid="8568452858617033281">"<xliff:g id="SIZE">%1$s</xliff:g> खाली"</string>
+ <string name="root_type_service" msgid="2178854894416775409">"मेमोरी सेवाएं"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"शॉर्टकट"</string>
- <string name="root_type_device" msgid="7121342474653483538">"उपकरण"</string>
+ <string name="root_type_device" msgid="7121342474653483538">"डिवाइस"</string>
<string name="root_type_apps" msgid="8838065367985945189">"अधिक ऐप्स"</string>
<string name="empty" msgid="7858882803708117596">"कोई आइटम नहीं"</string>
<string name="toast_no_application" msgid="1339885974067891667">"फ़ाइल नहीं खोली जा सकती"</string>
diff --git a/packages/DocumentsUI/res/values-ky-rKG/strings.xml b/packages/DocumentsUI/res/values-ky-rKG/strings.xml
index 5513746e..a4f718b 100644
--- a/packages/DocumentsUI/res/values-ky-rKG/strings.xml
+++ b/packages/DocumentsUI/res/values-ky-rKG/strings.xml
@@ -30,10 +30,10 @@
<string name="menu_share" msgid="3075149983979628146">"Бөлүшүү"</string>
<string name="menu_delete" msgid="8138799623850614177">"Өчүрүү"</string>
<string name="menu_select" msgid="8711270657353563424">"\"<xliff:g id="DIRECTORY">^1</xliff:g>\" тандоо"</string>
- <string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Ички эстутумду көрсөтүү"</string>
+ <string name="menu_advanced_show" product="nosdcard" msgid="4693652895715631401">"Ички сактагычты көрсөтүү"</string>
<string name="menu_advanced_show" product="default" msgid="5792182900084144261">"SD картаны көрсөтүү"</string>
<string name="menu_advanced_hide" product="nosdcard" msgid="4218809952721972589">"Ички эстутумду жашыруу"</string>
- <string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD катраны жашыруу"</string>
+ <string name="menu_advanced_hide" product="default" msgid="4845869969015718848">"SD картаны жашыруу"</string>
<string name="menu_file_size_show" msgid="3240323619260823076">"Файл өлчөмүн көрсөтүү"</string>
<string name="menu_file_size_hide" msgid="8881975928502581042">"Файл өлчөмүн жашыруу"</string>
<string name="mode_selected_count" msgid="459111894725594625">"<xliff:g id="COUNT">%1$d</xliff:g> тандалды"</string>
diff --git a/packages/DocumentsUI/res/values-my-rMM/strings.xml b/packages/DocumentsUI/res/values-my-rMM/strings.xml
index 98b3a90..50f8363 100644
--- a/packages/DocumentsUI/res/values-my-rMM/strings.xml
+++ b/packages/DocumentsUI/res/values-my-rMM/strings.xml
@@ -26,7 +26,7 @@
<string name="menu_search" msgid="3816712084502856974">"ရှာဖွေရန်"</string>
<string name="menu_settings" msgid="6008033148948428823">"ဆက်တင်များ"</string>
<string name="menu_open" msgid="432922957274920903">"ဖွင့်ရန်"</string>
- <string name="menu_save" msgid="2394743337684426338">"သိမ်းဆည်းရန်"</string>
+ <string name="menu_save" msgid="2394743337684426338">"သိမ်းပါ"</string>
<string name="menu_share" msgid="3075149983979628146">"မျှဝေခြင်း"</string>
<string name="menu_delete" msgid="8138799623850614177">"ဖျက်ပစ်ရန်"</string>
<string name="menu_select" msgid="8711270657353563424">"ရွေးရန်\"<xliff:g id="DIRECTORY">^1</xliff:g>\""</string>
diff --git a/packages/DocumentsUI/res/values-pt/strings.xml b/packages/DocumentsUI/res/values-pt/strings.xml
index 184fb53..2aaa4d2 100644
--- a/packages/DocumentsUI/res/values-pt/strings.xml
+++ b/packages/DocumentsUI/res/values-pt/strings.xml
@@ -50,7 +50,7 @@
<string name="root_type_service" msgid="2178854894416775409">"Serviços de armazenamento"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"Atalhos"</string>
<string name="root_type_device" msgid="7121342474653483538">"Dispositivos"</string>
- <string name="root_type_apps" msgid="8838065367985945189">"Mais aplicativos"</string>
+ <string name="root_type_apps" msgid="8838065367985945189">"Mais apps"</string>
<string name="empty" msgid="7858882803708117596">"Nenhum item"</string>
<string name="toast_no_application" msgid="1339885974067891667">"Não é possível abrir o arquivo"</string>
<string name="toast_failed_delete" msgid="2180678019407244069">"Não foi possível excluir alguns documentos"</string>
diff --git a/packages/DocumentsUI/res/values-zh-rTW/strings.xml b/packages/DocumentsUI/res/values-zh-rTW/strings.xml
index a37dbe8..464a13e 100644
--- a/packages/DocumentsUI/res/values-zh-rTW/strings.xml
+++ b/packages/DocumentsUI/res/values-zh-rTW/strings.xml
@@ -45,7 +45,7 @@
<string name="save_error" msgid="6167009778003223664">"無法儲存文件"</string>
<string name="create_error" msgid="3735649141335444215">"無法建立資料夾"</string>
<string name="query_error" msgid="1222448261663503501">"無法查詢文件"</string>
- <string name="root_recent" msgid="4470053704320518133">"最近存取過"</string>
+ <string name="root_recent" msgid="4470053704320518133">"最近"</string>
<string name="root_available_bytes" msgid="8568452858617033281">"可用空間:<xliff:g id="SIZE">%1$s</xliff:g>"</string>
<string name="root_type_service" msgid="2178854894416775409">"儲存空間服務"</string>
<string name="root_type_shortcut" msgid="3318760609471618093">"捷徑"</string>
diff --git a/packages/ExternalStorageProvider/res/values-hi/strings.xml b/packages/ExternalStorageProvider/res/values-hi/strings.xml
index 1227bd4..8538081 100644
--- a/packages/ExternalStorageProvider/res/values-hi/strings.xml
+++ b/packages/ExternalStorageProvider/res/values-hi/strings.xml
@@ -16,7 +16,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_label" msgid="7123375275748530234">"बाहरी संग्रहण"</string>
- <string name="root_internal_storage" msgid="827844243068584127">"मोबाइल संग्रहण"</string>
+ <string name="app_label" msgid="7123375275748530234">"बाहरी मेमोरी"</string>
+ <string name="root_internal_storage" msgid="827844243068584127">"मोबाइल मेमोरी"</string>
<string name="root_documents" msgid="4051252304075469250">"दस्तावेज़"</string>
</resources>
diff --git a/packages/ExternalStorageProvider/res/values-my-rMM/strings.xml b/packages/ExternalStorageProvider/res/values-my-rMM/strings.xml
index 643fb92..dc9d684 100644
--- a/packages/ExternalStorageProvider/res/values-my-rMM/strings.xml
+++ b/packages/ExternalStorageProvider/res/values-my-rMM/strings.xml
@@ -17,6 +17,6 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="app_label" msgid="7123375275748530234">"ပြင်ပသိုလှောင်ရာပစ္စည်း"</string>
- <string name="root_internal_storage" msgid="827844243068584127">"စက်အတွင်းသိမ်းဆည်းရန်နေရာ"</string>
+ <string name="root_internal_storage" msgid="827844243068584127">"စက်တွင်း သိုလှောင်ထားမှု"</string>
<string name="root_documents" msgid="4051252304075469250">"စာရွက်စာတန်းများ"</string>
</resources>
diff --git a/packages/Keyguard/res/values-km-rKH/strings.xml b/packages/Keyguard/res/values-km-rKH/strings.xml
index 114877a..858c001 100644
--- a/packages/Keyguard/res/values-km-rKH/strings.xml
+++ b/packages/Keyguard/res/values-km-rKH/strings.xml
@@ -83,7 +83,7 @@
<string name="password_keyboard_label_alpha_key" msgid="8001096175167485649">"ABC"</string>
<string name="password_keyboard_label_alt_key" msgid="1284820942620288678">"ALT"</string>
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Alt"</string>
- <string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"បោះបង់"</string>
+ <string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"បោះបង់"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"លុប"</string>
<string name="keyboardview_keycode_done" msgid="1992571118466679775">"រួចរាល់"</string>
<string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"ប្ដូររបៀប"</string>
@@ -122,7 +122,7 @@
<string name="kg_login_too_many_attempts" msgid="6486842094005698475">"ព្យាយាមលំនាំច្រើនពេក"</string>
<string name="kg_login_instructions" msgid="1100551261265506448">"ដើម្បីដោះសោ ចូលក្នុងគណនី Google ។"</string>
<string name="kg_login_username_hint" msgid="5718534272070920364">"ឈ្មោះអ្នកប្រើ (អ៊ីមែល)"</string>
- <string name="kg_login_password_hint" msgid="9057289103827298549">"ពាក្យសម្ងាត់"</string>
+ <string name="kg_login_password_hint" msgid="9057289103827298549">"ពាក្យសម្ងាត់"</string>
<string name="kg_login_submit_button" msgid="5355904582674054702">"ចូល"</string>
<string name="kg_login_invalid_input" msgid="5754664119319872197">"ឈ្មោះអ្នកប្រើ ឬពាក្យសម្ងាត់មិនត្រឹមត្រូវ។"</string>
<string name="kg_login_account_recovery_hint" msgid="5690709132841752974">"ភ្លេចឈ្មោះអ្នកប្រើ ឬពាក្យសម្ងាត់របស់អ្នក?\nមើល "<b>"google.com/accounts/recovery"</b>" ។"</string>
@@ -164,5 +164,5 @@
<string name="keyguard_transport_pause_description" msgid="5093073338238310224">"ប៊ូតុងផ្អាក"</string>
<string name="keyguard_transport_play_description" msgid="2924628863741150956">"ប៊ូតុងចាក់"</string>
<string name="keyguard_transport_stop_description" msgid="3084179324810575787">"ប៊ូតុងបញ្ឈប់"</string>
- <string name="keyguard_carrier_default" msgid="8700650403054042153">"គ្មានសេវា"</string>
+ <string name="keyguard_carrier_default" msgid="8700650403054042153">"គ្មានសេវា"</string>
</resources>
diff --git a/packages/Keyguard/res/values-my-rMM/strings.xml b/packages/Keyguard/res/values-my-rMM/strings.xml
index 9eae880..dd15517 100644
--- a/packages/Keyguard/res/values-my-rMM/strings.xml
+++ b/packages/Keyguard/res/values-my-rMM/strings.xml
@@ -20,16 +20,16 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_name" msgid="719438068451601849">"သော့ချက် စောင့်ပေးသူ"</string>
- <string name="keyguard_password_enter_pin_code" msgid="3037685796058495017">"PIN ကုဒ် ရိုက်ထည့်ပါ"</string>
+ <string name="app_name" msgid="719438068451601849">"သော့ချက် စောင့်ပေးသူ"</string>
+ <string name="keyguard_password_enter_pin_code" msgid="3037685796058495017">"PIN ကုဒ် ရိုက်ထည့်ပါ"</string>
<string name="keyguard_password_enter_puk_code" msgid="3035856550289724338">"ဆင်းမ်ကဒ် ပင်နံပါတ် ပြန်ဖွင့်သည့် ကုဒ် နှင့် လျို့ဝှက်နံပါတ်သစ် ရိုက်ထည့်ပါ"</string>
<string name="keyguard_password_enter_puk_prompt" msgid="1801941051094974609">"ဆင်းမ်ကဒ် ပင်နံပါတ် ပြန်ဖွင့်သည့် ကုဒ် နံပါတ်"</string>
<string name="keyguard_password_enter_pin_prompt" msgid="3201151840570492538">"ဆင်းမ်ကဒ် လျို့ဝှက်ပင်နံပါတ် အသစ်သွင်းရန်"</string>
<string name="keyguard_password_entry_touch_hint" msgid="7858547464982981384"><font size="17">"စကားဝှက် ရိုက်ရန် ထိပါ"</font></string>
- <string name="keyguard_password_enter_password_code" msgid="1054721668279049780">"သော့ဖွင့်ရန် စကားဝှက်ကို ရိုက်ထည့်ပါ"</string>
- <string name="keyguard_password_enter_pin_password_code" msgid="6391755146112503443">"သော့ဖွင့်ရန် PIN ကို ရိုက်ထည့်ပါ"</string>
+ <string name="keyguard_password_enter_password_code" msgid="1054721668279049780">"သော့ဖွင့်ရန် စကားဝှက်ကို ရိုက်ထည့်ပါ"</string>
+ <string name="keyguard_password_enter_pin_password_code" msgid="6391755146112503443">"သော့ဖွင့်ရန် PIN ကို ရိုက်ထည့်ပါ"</string>
<string name="keyguard_password_wrong_pin_code" msgid="2422225591006134936">"ပင်နံပါတ်မှားနေပါသည်"</string>
- <string name="keyguard_label_text" msgid="861796461028298424">"သော့ဖွင့်ရန် Menu ထိုနောက်0ကိုနှိပ်ပါ"</string>
+ <string name="keyguard_label_text" msgid="861796461028298424">"သော့ဖွင့်ရန် Menu ထိုနောက်0ကိုနှိပ်ပါ"</string>
<string name="faceunlock_multiple_failures" msgid="754137583022792429">"မျက်မှာမှတ် သော့ဖွင့်ခြင်း ခွင့်ပြုသော အကြိမ်ရေထက် ကျော်လွန်သွားပါပြီ"</string>
<string name="keyguard_charged" msgid="3272223906073492454">"အားသွင်းနေပါသည်"</string>
<string name="keyguard_plugged_in" msgid="9087497435553252863">"အားသွင်းနေ"</string>
@@ -85,14 +85,14 @@
<string name="keyboardview_keycode_alt" msgid="4856868820040051939">"Altခလုတ်"</string>
<string name="keyboardview_keycode_cancel" msgid="1203984017245783244">"ပယ်ဖျက်ရန်ခလုတ်"</string>
<string name="keyboardview_keycode_delete" msgid="3337914833206635744">"ဖျက်ရန်ခလုတ်"</string>
- <string name="keyboardview_keycode_done" msgid="1992571118466679775">"ပြီးဆုံးသည့်ခလုတ်"</string>
+ <string name="keyboardview_keycode_done" msgid="1992571118466679775">"ပြီးဆုံးသည့်ခလုတ်"</string>
<string name="keyboardview_keycode_mode_change" msgid="4547387741906537519">"စနစ်ပြောင်းခြင်းခလုတ်"</string>
<string name="keyboardview_keycode_shift" msgid="2270748814315147690">"Shiftခလုတ်"</string>
<string name="keyboardview_keycode_enter" msgid="2985864015076059467">"Enterခလုတ်"</string>
- <string name="description_target_unlock" msgid="2228524900439801453">"ဖွင့်ရန်"</string>
+ <string name="description_target_unlock" msgid="2228524900439801453">"ဖွင့်ရန်"</string>
<string name="description_target_camera" msgid="969071997552486814">"ကင်မရာ"</string>
<string name="description_target_silent" msgid="893551287746522182">"အသံတိတ်ရန်"</string>
- <string name="description_target_soundon" msgid="30052466675500172">"အသံဖွင့်သည်"</string>
+ <string name="description_target_soundon" msgid="30052466675500172">"အသံဖွင့်သည်"</string>
<string name="description_target_search" msgid="3091587249776033139">"ရှာဖွေရန်"</string>
<string name="description_direction_up" msgid="7169032478259485180">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> အတွက် အပေါ်ကို ပွတ်ဆွဲပါ"</string>
<string name="description_direction_down" msgid="5087739728639014595">"<xliff:g id="TARGET_DESCRIPTION">%s</xliff:g> အတွက် အောက်ကို ပွတ်ဆွဲပါ"</string>
@@ -107,11 +107,11 @@
<string name="kg_too_many_failed_attempts_countdown" msgid="6358110221603297548">"<xliff:g id="NUMBER">%d</xliff:g> စက္ကန့်အကြာတွင် ပြန်ကြိုးစားပါ"</string>
<string name="kg_pattern_instructions" msgid="398978611683075868">"သင့်ရဲ့ သော့ဖွင့်သော ပုံစံကို ဆွဲပါ"</string>
<string name="kg_sim_pin_instructions" msgid="2319508550934557331">"ဆင်းမ်ကဒ် ပင် နံပါတ် ရိုက်ထည့်ပါ"</string>
- <string name="kg_sim_pin_instructions_multi" msgid="7818515973197201434">"\"<xliff:g id="CARRIER">%1$s</xliff:g>\" အတွက် ဆင်းမ် ပင်နံပါတ် ရိုက်ထည့်ပါ။"</string>
+ <string name="kg_sim_pin_instructions_multi" msgid="7818515973197201434">"\"<xliff:g id="CARRIER">%1$s</xliff:g>\" အတွက် ဆင်းမ် ပင်နံပါတ် ရိုက်ထည့်ပါ။"</string>
<string name="kg_pin_instructions" msgid="2377242233495111557">"ပင်နံပါတ် ရိုက်ထည့်ပါ"</string>
<string name="kg_password_instructions" msgid="5753646556186936819">"လျို့ဝှက်နံပါတ် ရိုက်ထည့်ပါ"</string>
<string name="kg_puk_enter_puk_hint" msgid="453227143861735537">"ဆင်းမ်ကဒ်သည် ယခု ပိတ်သွားပါပြီ ဆက်လက် လုပ်ဆောင်ရန် ပင်နံပါတ် ပြန်ဖွင့်သည့် ကုဒ်ကို ရိုက်ထည့်ပါ။ ပိုမိုသိချင်လျင် ဖုန်းဝန်ဆောင်မှု ပေးသောဌာန အားဆက်သွယ်နိုင်ပါသည်။"</string>
- <string name="kg_puk_enter_puk_hint_multi" msgid="363822494559783025">"ဆင်းမ် \"<xliff:g id="CARRIER">%1$s</xliff:g>\" သည် ယခု အလုပ်မလုပ်တော့ပါ။ ဆက်လက်သွားရန် PUK ကုဒ် ရိုက်ထည့်ပါ၊။အသေးစိတ်သိရရန် ဖုန်းဝန်ဆောင်မှုလုပ်ငန်းအား ဆက်သွယ်ပါ။"</string>
+ <string name="kg_puk_enter_puk_hint_multi" msgid="363822494559783025">"ဆင်းမ် \"<xliff:g id="CARRIER">%1$s</xliff:g>\" သည် ယခု အလုပ်မလုပ်တော့ပါ။ ဆက်လက်သွားရန် PUK ကုဒ် ရိုက်ထည့်ပါ၊။အသေးစိတ်သိရရန် ဖုန်းဝန်ဆောင်မှုလုပ်ငန်းအား ဆက်သွယ်ပါ။"</string>
<string name="kg_puk_enter_pin_hint" msgid="7871604527429602024">"လိုချင်သော ပင်နံပါတ်ကို ရိုက်ထည့်ပါ"</string>
<string name="kg_enter_confirm_pin_hint" msgid="325676184762529976">"လိုချင်သော ပင်နံပါတ်ကို အတည်ပြုရန်"</string>
<string name="kg_sim_unlock_progress_dialog_message" msgid="8950398016976865762">"ဆင်းမ်ကဒ် ကို သော့ဖွင့်နေပါသည်"</string>
@@ -130,18 +130,18 @@
<string name="kg_too_many_failed_pin_attempts_dialog_message" msgid="8276745642049502550">"သင် ပင် နံပါတ်ကို အမှားကို <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ရိုက်ထည့်ပြီးပါပြီ။ \n\n<xliff:g id="NUMBER_1">%d</xliff:g> စက္ကန့် အကြာတွင် ပြန်လည်ကြိုးစားပါ"</string>
<string name="kg_too_many_failed_password_attempts_dialog_message" msgid="7813713389422226531">"သင်သည် စကားဝှက်ကို <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် မှားရိုက်ပြီးပါပြီ။ \n\n <xliff:g id="NUMBER_1">%d</xliff:g> စက္ကန့်အကြာ ပြန်လည်ကြိုးစားပါ"</string>
<string name="kg_too_many_failed_pattern_attempts_dialog_message" msgid="74089475965050805">"သင် ပုံစံဆွဲ သော့ဖွင့်ခြင်းကို <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ်မြောက် မအောင်မြင်ပါ။ \n\n<xliff:g id="NUMBER_1">%d</xliff:g> စက္ကန့်အကြာတွင် ပြန်လည် ကြိုးစားပါ"</string>
- <string name="kg_failed_attempts_almost_at_wipe" product="tablet" msgid="8774056606869646621">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤတက်ဘလက်အား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
- <string name="kg_failed_attempts_almost_at_wipe" product="default" msgid="1843331751334128428">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
- <string name="kg_failed_attempts_now_wiping" product="tablet" msgid="258925501999698032">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
- <string name="kg_failed_attempts_now_wiping" product="default" msgid="7154028908459817066">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
- <string name="kg_failed_attempts_almost_at_erase_user" product="tablet" msgid="6159955099372112688">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤအသုံးပြုသူအား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
- <string name="kg_failed_attempts_almost_at_erase_user" product="default" msgid="6945823186629369880">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤအသုံးပြုသူအား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
- <string name="kg_failed_attempts_now_erasing_user" product="tablet" msgid="3963486905355778734">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤအသုံးပြုသူအား ဖယ်ထုတ်မည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
- <string name="kg_failed_attempts_now_erasing_user" product="default" msgid="7729009752252111673">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤအသုံးပြုသူအား ဖယ်ထုတ်မည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
- <string name="kg_failed_attempts_almost_at_erase_profile" product="tablet" msgid="4621778507387853694">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ သင့် အလုပ်ပရိုဖိုင်အား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
- <string name="kg_failed_attempts_almost_at_erase_profile" product="default" msgid="6853071165802933545">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ သင့် အလုပ်ပရိုဖိုင်အား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
- <string name="kg_failed_attempts_now_erasing_profile" product="tablet" msgid="4686386497449912146">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ အလုပ်ပရိုဖိုင် ဖယ်ထုတ်ခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
- <string name="kg_failed_attempts_now_erasing_profile" product="default" msgid="4951507352869831265">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ အလုပ်ပရိုဖိုင် ဖယ်ထုတ်ခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+ <string name="kg_failed_attempts_almost_at_wipe" product="tablet" msgid="8774056606869646621">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤတက်ဘလက်အား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+ <string name="kg_failed_attempts_almost_at_wipe" product="default" msgid="1843331751334128428">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+ <string name="kg_failed_attempts_now_wiping" product="tablet" msgid="258925501999698032">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+ <string name="kg_failed_attempts_now_wiping" product="default" msgid="7154028908459817066">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤဖုန်းအား အစမှပြန်စဖွင့်မည်ဖြစ်ပြီး၊ ၎င်း၏ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+ <string name="kg_failed_attempts_almost_at_erase_user" product="tablet" msgid="6159955099372112688">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤအသုံးပြုသူအား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
+ <string name="kg_failed_attempts_almost_at_erase_user" product="default" msgid="6945823186629369880">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ ဤအသုံးပြုသူအား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
+ <string name="kg_failed_attempts_now_erasing_user" product="tablet" msgid="3963486905355778734">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤအသုံးပြုသူအား ဖယ်ထုတ်မည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+ <string name="kg_failed_attempts_now_erasing_user" product="default" msgid="7729009752252111673">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ ဤအသုံးပြုသူအား ဖယ်ထုတ်မည်ဖြစ်ပြီး၊ အသုံးပြုသူဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+ <string name="kg_failed_attempts_almost_at_erase_profile" product="tablet" msgid="4621778507387853694">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ သင့် အလုပ်ပရိုဖိုင်အား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
+ <string name="kg_failed_attempts_almost_at_erase_profile" product="default" msgid="6853071165802933545">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER_0">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ <xliff:g id="NUMBER_1">%d</xliff:g> ကြိမ် ကြိုးစားပြီးနောက် မအောင်မြင်ပါက၊ သင့် အလုပ်ပရိုဖိုင်အား ဖယ်ထုတ်ခြင်းခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားပါမည်။"</string>
+ <string name="kg_failed_attempts_now_erasing_profile" product="tablet" msgid="4686386497449912146">"တက်ဘလက်အား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ အလုပ်ပရိုဖိုင် ဖယ်ထုတ်ခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
+ <string name="kg_failed_attempts_now_erasing_profile" product="default" msgid="4951507352869831265">"ဖုန်းအား သော့ဖွင့်ရန် သင် <xliff:g id="NUMBER">%d</xliff:g> ကြိမ် ကြိုးစားရာ မမှန်ကန်ခဲ့ပါ။ အလုပ်ပရိုဖိုင် ဖယ်ထုတ်ခံရမည်ဖြစ်ပြီး၊ ပရိုဖိုင်ဒေတာအားလုံး ပျက်သွားမည်ဖြစ်သည်။"</string>
<string name="kg_failed_attempts_almost_at_login" product="tablet" msgid="3253575572118914370">"သင် ပုံဖော်၍သော့ဖွင့်ခြင်းကို <xliff:g id="NUMBER_0">%d</xliff:g> အကြိမ် မှန်ကန်စွာ မပြုလုပ်နိုင်ပါ။ နောက်ထပ် <xliff:g id="NUMBER_1">%d</xliff:g> အကြိမ် မမှန်ကန်ပါက သင့်တက်ဘလက်အား အီးမေးလ်အသုံးပြု၍ သော့ဖွင့်ရန် တောင်းဆိုပါလိမ့်မည်။ \n\n <xliff:g id="NUMBER_2">%d</xliff:g> စက္ကန့်အကြာတွင် ပြန်လည် ကြိုးစားပါ"</string>
<string name="kg_failed_attempts_almost_at_login" product="default" msgid="1437638152015574839">"သင် ပုံဖော်၍သော့ဖွင့်ခြင်းကို <xliff:g id="NUMBER_0">%d</xliff:g> အကြိမ် မှန်ကန်စွာ မပြုလုပ်နိုင်ပါ။ နောက်ထပ် <xliff:g id="NUMBER_1">%d</xliff:g> အကြိမ် မမှန်ကန်ပါက သင့်ဖုန်းအား အီးမေးလ်အသုံးပြု၍ သော့ဖွင့်ရန် တောင်းဆိုပါလိမ့်မည်။ \n\n <xliff:g id="NUMBER_2">%d</xliff:g> စက္ကန့်အကြာတွင် ပြန်လည် ကြိုးစားပါ"</string>
<string name="kg_text_message_separator" product="default" msgid="4160700433287233771">" — "</string>
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardConstants.java b/packages/Keyguard/src/com/android/keyguard/KeyguardConstants.java
index 10baf23..05a5f66 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardConstants.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardConstants.java
@@ -25,6 +25,6 @@
* Turns on debugging information for the whole Keyguard. This is very verbose and should only
* be used temporarily for debugging.
*/
- public static final boolean DEBUG = true;
+ public static final boolean DEBUG = false;
public static final boolean DEBUG_SIM_STATES = true;
}
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
index 7f1314d..ff07dd7 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -1303,16 +1303,15 @@
// that don't return the complete set of values and have different types. In Keyguard we
// need IccCardConstants, but TelephonyManager would only give us
// TelephonyManager.SIM_STATE*, so we retrieve it manually.
- final int phoneId = SubscriptionManager.getPhoneId(subId);
- final String stateString = TelephonyManager.getTelephonyProperty(phoneId,
- TelephonyProperties.PROPERTY_SIM_STATE, "");
+ final TelephonyManager tele = TelephonyManager.from(mContext);
+ int simState = tele.getSimState(slotId);
State state;
try {
- state = State.valueOf(stateString);
+ state = State.intToState(simState);
} catch(IllegalArgumentException ex) {
- Log.w(TAG, "Unknown sim state: " + stateString);
+ Log.w(TAG, "Unknown sim state: " + simState);
state = State.UNKNOWN;
- }
+ }
mSimDatas.put(subId, new SimData(state, slotId, subId));
}
diff --git a/packages/PrintSpooler/res/values-es-rUS/arrays.xml b/packages/PrintSpooler/res/values-es-rUS/arrays.xml
new file mode 100644
index 0000000..c1b149c
--- /dev/null
+++ b/packages/PrintSpooler/res/values-es-rUS/arrays.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+<resources>
+
+ <string-array name="pdf_printer_media_sizes" translatable="false">
+ <item>NA_LETTER</item>
+ <item>NA_GOVT_LETTER</item>
+ <item>NA_LEGAL</item>
+ <item>NA_JUNIOR_LEGAL</item>
+ <item>NA_LEDGER</item>
+ <item>NA_TABLOID</item>
+ <item>NA_INDEX_3X5</item>
+ <item>NA_INDEX_4X6</item>
+ <item>NA_INDEX_5X8</item>
+ <item>NA_MONARCH</item>
+ <item>NA_QUARTO</item>
+ <item>NA_FOOLSCAP</item>
+ </string-array>
+
+</resources>
diff --git a/packages/PrintSpooler/res/values-sw600dp-land/constants.xml b/packages/PrintSpooler/res/values-sw600dp-land/constants.xml
index f7f8a18..ea8da8e 100644
--- a/packages/PrintSpooler/res/values-sw600dp-land/constants.xml
+++ b/packages/PrintSpooler/res/values-sw600dp-land/constants.xml
@@ -20,6 +20,4 @@
<integer name="preview_page_per_row_count">4</integer>
- <dimen name="preview_destination_spinner_width">256dip</dimen>
-
</resources>
diff --git a/packages/PrintSpooler/res/values/constants.xml b/packages/PrintSpooler/res/values/constants.xml
index 357d3e1..f6c52d3 100644
--- a/packages/PrintSpooler/res/values/constants.xml
+++ b/packages/PrintSpooler/res/values/constants.xml
@@ -45,6 +45,6 @@
<dimen name="preview_page_footer_height">32dip</dimen>
<dimen name="preview_page_min_width">128dip</dimen>
- <dimen name="preview_destination_spinner_width">192dip</dimen>
+ <dimen name="preview_destination_spinner_width">256dip</dimen>
</resources>
diff --git a/packages/SettingsProvider/res/values-hi/strings.xml b/packages/SettingsProvider/res/values-hi/strings.xml
index 0b0bd8a..da8193f 100644
--- a/packages/SettingsProvider/res/values-hi/strings.xml
+++ b/packages/SettingsProvider/res/values-hi/strings.xml
@@ -19,5 +19,5 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_label" msgid="4567566098528588863">"सेटिंग संग्रहण"</string>
+ <string name="app_label" msgid="4567566098528588863">"सेटिंग मेमोरी"</string>
</resources>
diff --git a/packages/SystemUI/res/drawable/pop_ball.xml b/packages/SystemUI/res/drawable/pop_ball.xml
new file mode 100644
index 0000000..ee1220f
--- /dev/null
+++ b/packages/SystemUI/res/drawable/pop_ball.xml
@@ -0,0 +1,29 @@
+<!--
+Copyright (C) 2014 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="100.0dp"
+ android:height="100.0dp"
+ android:viewportWidth="100.0"
+ android:viewportHeight="100.0">
+ <path
+ android:pathData="M0,50 a50,50 0 1 1 100,0
+ a50,50 0 1 1 -100,0"
+ android:fillColor="#FFFF1744"/>
+ <path
+ android:pathData="M16,36 A24,24 0 1 1 64,36
+ M64,36 A24,24 0 1 1 16,36"
+ android:fillColor="#20FFFFFF"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/pop_belt.xml b/packages/SystemUI/res/drawable/pop_belt.xml
index 5c0c3d7..e0ea575 100644
--- a/packages/SystemUI/res/drawable/pop_belt.xml
+++ b/packages/SystemUI/res/drawable/pop_belt.xml
@@ -20,14 +20,14 @@
android:viewportHeight="100.0">
<path
android:pathData="M50.000000,50.000000m-47.599998,0.000000a47.599998,47.599998 0.000000,1.000000 1.000000,95.199997 0.000000a47.599998,47.599998 0.000000,1.000000 1.000000,-95.199997 0.000000"
- android:fillColor="#D81B60"/>
+ android:fillColor="#9C27B0"/>
<path
android:pathData="M50.000000,2.429000c-26.337999,0.000000 -47.688999,21.351000 -47.688999,47.688999c0.000000,13.168000 5.337000,25.091000 13.968000,33.722000l67.444000,-67.443001C75.092003,7.766000 63.168999,2.429000 50.000000,2.429000z"
- android:fillColor="#F06292"/>
+ android:fillColor="#BA68C8"/>
<path
android:pathData="M0.000000,41.573002l100.000000,0.000000l0.000000,17.090000l-100.000000,0.000000z"
- android:fillColor="#D81B60"/>
+ android:fillColor="#9C27B0"/>
<path
android:pathData="M0.000000,58.662998l0.000000,-17.089996 100.000000,0.000000z"
- android:fillColor="#F06292"/>
+ android:fillColor="#BA68C8"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/pop_pizza.xml b/packages/SystemUI/res/drawable/pop_pizza.xml
index b6d2bb3..1806b5a 100644
--- a/packages/SystemUI/res/drawable/pop_pizza.xml
+++ b/packages/SystemUI/res/drawable/pop_pizza.xml
@@ -20,26 +20,26 @@
android:viewportHeight="100.0">
<path
android:pathData="M14.645000,14.645000C5.597000,23.693001 0.000000,36.193001 0.000000,50.000000l50.000000,0.000000L14.645000,14.645000z"
- android:fillColor="#7BAAF7"/>
+ android:fillColor="#2979FF"/>
<path
android:pathData="M100.000000,50.000000c0.000000,-13.807000 -5.597000,-26.306999 -14.645000,-35.355000L50.000000,50.000000L100.000000,50.000000z"
- android:fillColor="#D81B60"/>
+ android:fillColor="#FF1744"/>
<path
android:pathData="M85.355003,14.645000C76.306999,5.597000 63.806999,0.000000 50.000000,0.000000l0.000000,50.000000L85.355003,14.645000z"
- android:fillColor="#F06292"/>
+ android:fillColor="#0F9D58"/>
<path
android:pathData="M50.000000,0.000000C36.193001,0.000000 23.693001,5.597000 14.645000,14.645000L50.000000,50.000000L50.000000,0.000000z"
- android:fillColor="#FFF176"/>
+ android:fillColor="#FFBC00"/>
<path
android:pathData="M50.000000,50.000000l35.355000,35.355000C94.403000,76.307999 100.000000,63.807999 100.000000,50.000000L50.000000,50.000000z"
- android:fillColor="#7BAAF7"/>
+ android:fillColor="#2979FF"/>
<path
android:pathData="M50.000000,100.000000c13.807000,0.000000 26.306999,-5.596000 35.355000,-14.645000L50.000000,50.000000L50.000000,100.000000z"
- android:fillColor="#FFF176"/>
+ android:fillColor="#FFBC00"/>
<path
android:pathData="M14.645000,85.355003C23.693001,94.403999 36.193001,100.000000 50.000000,100.000000L50.000000,50.000000L14.645000,85.355003z"
- android:fillColor="#F06292"/>
+ android:fillColor="#0F9D58"/>
<path
android:pathData="M0.000000,50.000000c0.000000,13.808000 5.597000,26.308001 14.645000,35.355000L50.000000,50.000000L0.000000,50.000000z"
- android:fillColor="#D81B60"/>
+ android:fillColor="#FF1744"/>
</vector>
diff --git a/packages/SystemUI/res/drawable/pop_swirl.xml b/packages/SystemUI/res/drawable/pop_swirl.xml
index acd6d3d..f87569b 100644
--- a/packages/SystemUI/res/drawable/pop_swirl.xml
+++ b/packages/SystemUI/res/drawable/pop_swirl.xml
@@ -20,7 +20,7 @@
android:viewportHeight="100.0">
<path
android:pathData="M50.000000,50.000000C86.898003,27.834999 79.244003,11.688000 76.177002,7.399000c-7.240000,-4.459000 -15.703000,-7.112000 -24.770000,-7.363000C56.247002,2.253000 70.815002,12.456000 50.000000,50.000000z"
- android:fillColor="#82B1FF"/>
+ android:fillColor="#FFFFFA"/>
<path
android:pathData="M50.000000,50.000000c20.815001,-37.543999 6.247000,-47.747002 1.407000,-49.964001C50.938000,0.022000 50.472000,0.000000 50.000000,0.000000c-8.627000,0.000000 -16.743999,2.186000 -23.827000,6.032000C31.392000,5.514000 49.251999,6.903000 50.000000,50.000000z"
android:fillColor="#76FF03"/>
@@ -32,7 +32,7 @@
android:fillColor="#303F9F"/>
<path
android:pathData="M50.000000,50.000000C27.834000,13.103000 11.687000,20.757000 7.398000,23.823999C2.940000,31.063000 0.287000,39.527000 0.035000,48.592999C2.253000,43.752998 12.456000,29.184999 50.000000,50.000000z"
- android:fillColor="#FAFAFA"/>
+ android:fillColor="#FFFFFA"/>
<path
android:pathData="M50.000000,50.000000C49.251999,6.903000 31.392000,5.514000 26.173000,6.032000c-7.709000,4.187000 -14.188000,10.344000 -18.774000,17.792000C11.687000,20.757000 27.834000,13.103000 50.000000,50.000000z"
android:fillColor="#303F9F"/>
@@ -44,13 +44,13 @@
android:fillColor="#303F9F"/>
<path
android:pathData="M50.000000,50.000000c22.166000,36.897999 38.313000,29.243999 42.602001,26.177999c4.458000,-7.240000 7.111000,-15.703000 7.363000,-24.770000C97.747002,56.248001 87.543999,70.816002 50.000000,50.000000z"
- android:fillColor="#FAFAFA"/>
+ android:fillColor="#FFFFFA"/>
<path
android:pathData="M50.000000,50.000000c-20.815001,37.544998 -6.247000,47.748001 -1.407000,49.965000C49.062000,99.978996 49.528000,100.000000 50.000000,100.000000c8.627000,0.000000 16.743999,-2.185000 23.827000,-6.031000C68.608002,94.486000 50.748001,93.098000 50.000000,50.000000z"
android:fillColor="#76FF03"/>
<path
android:pathData="M50.000000,50.000000C13.103000,72.166000 20.757000,88.313004 23.823000,92.601997c7.240000,4.459000 15.703000,7.112000 24.770000,7.363000C43.752998,97.748001 29.184999,87.544998 50.000000,50.000000z"
- android:fillColor="#82B1FF"/>
+ android:fillColor="#FFFFFA"/>
<path
android:pathData="M50.000000,50.000000C6.902000,50.749001 5.514000,68.609001 6.032000,73.828003c4.186000,7.708000 10.344000,14.188000 17.791000,18.773001C20.757000,88.313004 13.103000,72.166000 50.000000,50.000000z"
android:fillColor="#303F9F"/>
diff --git a/packages/SystemUI/res/drawable/pop_vortex.xml b/packages/SystemUI/res/drawable/pop_vortex.xml
index faefcb1..2380e68 100644
--- a/packages/SystemUI/res/drawable/pop_vortex.xml
+++ b/packages/SystemUI/res/drawable/pop_vortex.xml
@@ -20,7 +20,7 @@
android:viewportHeight="100.0">
<path
android:pathData="M50.000000,50.000000m-50.000000,0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,100.000000 0.000000a50.000000,50.000000 0.000000,1.000000 1.000000,-100.000000 0.000000"
- android:fillColor="#FFF176"/>
+ android:fillColor="#F8F8FF"/>
<path
android:pathData="M58.658001,89.648003c-19.330000,0.000000 -35.000000,-15.670000 -35.000000,-35.000000c0.000000,-13.531000 10.969000,-24.500000 24.500000,-24.500000c9.472000,0.000000 17.150000,7.679000 17.150000,17.150000c0.000000,6.631000 -5.375000,12.006000 -12.006000,12.006000c-3.798000,0.000000 -7.004000,-2.522000 -8.045000,-5.982000c1.021000,1.136000 2.497000,1.854000 4.145000,1.854000c2.644000,0.000000 4.853000,-1.841000 5.428000,-4.310000c0.175000,-0.558000 0.271000,-1.150000 0.271000,-1.766000c0.000000,-4.642000 -3.763000,-8.404000 -8.403000,-8.404000c-6.631000,0.000000 -12.006000,5.375000 -12.006000,12.006000c0.000000,9.472000 7.679000,17.149000 17.150000,17.149000c13.531000,0.000000 24.500000,-10.969000 24.500000,-24.500000c0.000000,-19.330000 -15.670000,-35.000000 -35.000000,-35.000000c-12.963000,0.000000 -24.773001,4.935000 -33.657001,13.025000C2.824000,31.087000 0.000000,40.212002 0.000000,50.000000c0.000000,27.615000 22.386000,50.000000 50.000000,50.000000c17.825001,0.000000 33.462002,-9.335000 42.313999,-23.375999C83.431000,84.714996 71.621002,89.648003 58.658001,89.648003z"
android:fillColor="#7BAAF7"/>
diff --git a/packages/SystemUI/res/drawable/qs_background_primary.xml b/packages/SystemUI/res/drawable/qs_background_primary.xml
index e33ff1e..686df2c 100644
--- a/packages/SystemUI/res/drawable/qs_background_primary.xml
+++ b/packages/SystemUI/res/drawable/qs_background_primary.xml
@@ -13,8 +13,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:top="@dimen/notification_material_rounded_rect_radius_negative" >
- <solid android:color="@color/system_primary_color" />
- <corners android:radius="@dimen/notification_material_rounded_rect_radius"/>
-</shape>
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetTop="@dimen/notification_material_rounded_rect_radius_negative">
+ <shape>
+ <solid android:color="@color/system_primary_color"/>
+ <corners android:radius="@dimen/notification_material_rounded_rect_radius"/>
+ </shape>
+</inset>
diff --git a/packages/SystemUI/res/values-hy-rAM/strings.xml b/packages/SystemUI/res/values-hy-rAM/strings.xml
index 0c22321..ea00568 100644
--- a/packages/SystemUI/res/values-hy-rAM/strings.xml
+++ b/packages/SystemUI/res/values-hy-rAM/strings.xml
@@ -261,7 +261,7 @@
<string name="quick_settings_more_settings" msgid="326112621462813682">"Հավելյալ կարգավորումներ"</string>
<string name="quick_settings_done" msgid="3402999958839153376">"Պատրաստ է"</string>
<string name="quick_settings_connected" msgid="1722253542984847487">"Կապակցված է"</string>
- <string name="quick_settings_connected_via_wfa" msgid="1587051627194895715">"Կապակցված է Wi‑Fi օգնականի միջոցով"</string>
+ <string name="quick_settings_connected_via_wfa" msgid="1587051627194895715">"Կապակցված է Wi‑Fi Օգնականի միջոցով"</string>
<string name="quick_settings_connecting" msgid="47623027419264404">"Միանում է..."</string>
<string name="quick_settings_tethering_label" msgid="7153452060448575549">"Միացում"</string>
<string name="quick_settings_hotspot_label" msgid="6046917934974004879">"Թեժ կետ"</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 4c5d890..a68d076 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -289,7 +289,7 @@
<string name="description_direction_left" msgid="7207478719805562165">"Przesuń w lewo: <xliff:g id="TARGET_DESCRIPTION">%s</xliff:g>."</string>
<string name="zen_no_interruptions_with_warning" msgid="4396898053735625287">"Żadnych powiadomień. Nawet alarmów."</string>
<string name="zen_no_interruptions" msgid="7970973750143632592">"Bez przerw"</string>
- <string name="zen_important_interruptions" msgid="3477041776609757628">"Tylko przerwy priorytetowe"</string>
+ <string name="zen_important_interruptions" msgid="3477041776609757628">"Tylko dźwięki priorytetowe"</string>
<string name="zen_alarm_information_time" msgid="5235772206174372272">"Następny alarm o <xliff:g id="ALARM_TIME">%s</xliff:g>"</string>
<string name="zen_alarm_information_day_time" msgid="8422733576255047893">"Następny alarm: <xliff:g id="ALARM_DAY_AND_TIME">%s</xliff:g>"</string>
<string name="zen_alarm_warning" msgid="6873910860111498041">"Nie usłyszysz alarmu o <xliff:g id="ALARM_TIME">%s</xliff:g>"</string>
@@ -300,7 +300,7 @@
<string name="phone_hint" msgid="3101468054914424646">"Przesuń w prawo, by przełączyć się na telefon"</string>
<string name="camera_hint" msgid="5241441720959174226">"Przesuń w lewo, by włączyć aparat"</string>
<string name="interruption_level_none" msgid="3831278883136066646">"Żadne"</string>
- <string name="interruption_level_priority" msgid="6517366750688942030">"Priorytet"</string>
+ <string name="interruption_level_priority" msgid="6517366750688942030">"Priorytetowe"</string>
<string name="interruption_level_all" msgid="1330581184930945764">"Wszystkie"</string>
<string name="keyguard_indication_charging_time" msgid="1757251776872835768">"Ładuje się (pełne naładowanie za <xliff:g id="CHARGING_TIME_LEFT">%s</xliff:g>)"</string>
<string name="accessibility_multi_user_switch_switcher" msgid="7305948938141024937">"Przełącz użytkownika"</string>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index 48b4cb93..03ddc46 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -261,7 +261,7 @@
<string name="quick_settings_more_settings" msgid="326112621462813682">"Diğer ayarlar"</string>
<string name="quick_settings_done" msgid="3402999958839153376">"Bitti"</string>
<string name="quick_settings_connected" msgid="1722253542984847487">"Bağlı"</string>
- <string name="quick_settings_connected_via_wfa" msgid="1587051627194895715">"Kablosuz yardımcısıyla bağlandı"</string>
+ <string name="quick_settings_connected_via_wfa" msgid="1587051627194895715">"Kablosuz bağlantı yardımcısıyla bağlandı"</string>
<string name="quick_settings_connecting" msgid="47623027419264404">"Bağlanılıyor..."</string>
<string name="quick_settings_tethering_label" msgid="7153452060448575549">"Tethering"</string>
<string name="quick_settings_hotspot_label" msgid="6046917934974004879">"Hotspot"</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index aae1d69..c3811f8 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -263,7 +263,7 @@
<string name="quick_settings_more_settings" msgid="326112621462813682">"更多设置"</string>
<string name="quick_settings_done" msgid="3402999958839153376">"完成"</string>
<string name="quick_settings_connected" msgid="1722253542984847487">"已连接"</string>
- <string name="quick_settings_connected_via_wfa" msgid="1587051627194895715">"已通过 WLAN 助手连接"</string>
+ <string name="quick_settings_connected_via_wfa" msgid="1587051627194895715">"已连接(通过 WLAN 助手)"</string>
<string name="quick_settings_connecting" msgid="47623027419264404">"正在连接…"</string>
<string name="quick_settings_tethering_label" msgid="7153452060448575549">"网络共享"</string>
<string name="quick_settings_hotspot_label" msgid="6046917934974004879">"热点"</string>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 9a95b37..98f03b5 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -251,12 +251,21 @@
<!-- Doze: duration to avoid false pickup gestures triggered by notification vibrations -->
<integer name="doze_pickup_vibration_threshold">2000</integer>
+ <!-- Doze: can we assume the pickup sensor includes a proximity check? -->
+ <bool name="doze_pickup_performs_proximity_check">true</bool>
+
<!-- Doze: pulse parameter - how long does it take to fade in? -->
<integer name="doze_pulse_duration_in">900</integer>
- <!-- Doze: pulse parameter - delay for fading so the screen can wake up before -->
+ <!-- Doze: pulse parameter - how long does it take to fade in after a pickup? -->
+ <integer name="doze_pulse_duration_in_pickup">300</integer>
+
+ <!-- Doze: pulse parameter - delay to wait for the screen to wake up -->
<integer name="doze_pulse_delay_in">200</integer>
+ <!-- Doze: pulse parameter - delay to wait for the screen to wake up after a pickup -->
+ <integer name="doze_pulse_delay_in_pickup">200</integer>
+
<!-- Doze: pulse parameter - once faded in, how long does it stay visible? -->
<integer name="doze_pulse_duration_visible">3000</integer>
diff --git a/packages/SystemUI/res/values/lland_config.xml b/packages/SystemUI/res/values/lland_config.xml
index 5d74082..a9e732e 100644
--- a/packages/SystemUI/res/values/lland_config.xml
+++ b/packages/SystemUI/res/values/lland_config.xml
@@ -26,7 +26,7 @@
<dimen name="obstacle_width">90dp</dimen>
<dimen name="obstacle_stem_width">12dp</dimen>
<dimen name="obstacle_gap">170dp</dimen>
- <dimen name="obstacle_height_min">40dp</dimen>
+ <dimen name="obstacle_height_min">48dp</dimen>
<dimen name="building_width_min">20dp</dimen>
<dimen name="building_width_max">250dp</dimen>
<dimen name="building_height_min">20dp</dimen>
diff --git a/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags b/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags
index 6337956..191cba5 100644
--- a/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags
+++ b/packages/SystemUI/src/com/android/systemui/EventLogTags.logtags
@@ -9,6 +9,7 @@
36001 sysui_heads_up_status (key|3),(visible|1)
36002 sysui_fullscreen_notification (key|3)
36003 sysui_heads_up_escalation (key|3)
+36004 sysui_status_bar_state (state|1)
# ---------------------------
# PhoneStatusBarView.java
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
index 7eb9c6e..1f3a830 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeLog.java
@@ -153,7 +153,7 @@
sProxStats[pulseReason][near ? 0 : 1].append();
}
- private static String pulseReasonToString(int pulseReason) {
+ public static String pulseReasonToString(int pulseReason) {
switch (pulseReason) {
case PULSE_REASON_INTENT: return "intent";
case PULSE_REASON_NOTIFICATION: return "notification";
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
index 2341144..8d27450 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeService.java
@@ -222,15 +222,25 @@
continuePulsing(reason);
return;
}
- // perform a proximity check before pulsing
final long start = SystemClock.uptimeMillis();
+ final boolean nonBlocking = reason == DozeLog.PULSE_REASON_SENSOR_PICKUP
+ && mDozeParameters.getPickupPerformsProxCheck();
+ if (nonBlocking) {
+ // proximity check is only done to capture statistics, continue pulsing
+ continuePulsing(reason);
+ }
+ // perform a proximity check
new ProximityCheck() {
@Override
public void onProximityResult(int result) {
- // avoid pulsing in pockets
final boolean isNear = result == RESULT_NEAR;
final long end = SystemClock.uptimeMillis();
DozeLog.traceProximityResult(isNear, end - start, reason);
+ if (nonBlocking) {
+ // we already continued
+ return;
+ }
+ // avoid pulsing in pockets
if (isNear) {
mPulsing = false;
mWakeLock.release();
@@ -340,7 +350,8 @@
if (DEBUG) Log.d(mTag, "No more schedule resets remaining");
return;
}
- if ((notificationTimeMs - mNotificationPulseTime) < mDozeParameters.getPulseDuration()) {
+ final long pulseDuration = mDozeParameters.getPulseDuration(false /*pickup*/);
+ if ((notificationTimeMs - mNotificationPulseTime) < pulseDuration) {
if (DEBUG) Log.d(mTag, "Recently updated, not resetting schedule");
return;
}
diff --git a/packages/SystemUI/src/com/android/systemui/egg/LLand.java b/packages/SystemUI/src/com/android/systemui/egg/LLand.java
index cdfe6e5..5de09a3 100644
--- a/packages/SystemUI/src/com/android/systemui/egg/LLand.java
+++ b/packages/SystemUI/src/com/android/systemui/egg/LLand.java
@@ -29,11 +29,15 @@
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
+import android.media.AudioAttributes;
+import android.media.AudioManager;
+import android.os.Vibrator;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.MotionEvent;
+import android.util.Slog;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.view.animation.DecelerateInterpolator;
@@ -51,9 +55,9 @@
public static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
public static final boolean DEBUG_DRAW = false; // DEBUG
- public static final void L(String s, Object ... objects) {
+ public static void L(String s, Object ... objects) {
if (DEBUG) {
- Log.d(TAG, String.format(s, objects));
+ Slog.d(TAG, objects.length == 0 ? s : String.format(s, objects));
}
}
@@ -61,17 +65,18 @@
public static final boolean HAVE_STARS = true;
public static final float DEBUG_SPEED_MULTIPLIER = 1f; // 0.1f;
- public static final boolean DEBUG_IDDQD = false;
+ public static final boolean DEBUG_IDDQD = Log.isLoggable(TAG + ".iddqd", Log.DEBUG);
final static int[] POPS = {
- // resid // spinny!
- R.drawable.pop_belt, 0,
- R.drawable.pop_droid, 0,
- R.drawable.pop_pizza, 1,
- R.drawable.pop_stripes, 0,
- R.drawable.pop_swirl, 1,
- R.drawable.pop_vortex, 1,
- R.drawable.pop_vortex2, 1,
+ // resid // spinny! // alpha
+ R.drawable.pop_belt, 0, 255,
+ R.drawable.pop_droid, 0, 255,
+ R.drawable.pop_pizza, 1, 255,
+ R.drawable.pop_stripes, 0, 255,
+ R.drawable.pop_swirl, 1, 255,
+ R.drawable.pop_vortex, 1, 255,
+ R.drawable.pop_vortex2, 1, 255,
+ R.drawable.pop_ball, 0, 190,
};
private static class Params {
@@ -117,10 +122,20 @@
PLAYER_Z = res.getDimensionPixelSize(R.dimen.player_z);
PLAYER_Z_BOOST = res.getDimensionPixelSize(R.dimen.player_z_boost);
HUD_Z = res.getDimensionPixelSize(R.dimen.hud_z);
+
+ // Sanity checking
+ if (OBSTACLE_MIN <= OBSTACLE_WIDTH / 2) {
+ Slog.e(TAG, "error: obstacles might be too short, adjusting");
+ OBSTACLE_MIN = OBSTACLE_WIDTH / 2 + 1;
+ }
}
}
private TimeAnimator mAnim;
+ private Vibrator mVibrator;
+ private AudioManager mAudioManager;
+ private final AudioAttributes mAudioAttrs = new AudioAttributes.Builder()
+ .setUsage(AudioAttributes.USAGE_GAME).build();
private TextView mScoreField;
private View mSplash;
@@ -158,6 +173,8 @@
public LLand(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
+ mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
+ mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
setFocusable(true);
PARAMS = new Params(getResources());
mTimeOfDay = irand(0, SKIES.length);
@@ -198,7 +215,15 @@
final float hsv[] = {0, 0, 0};
- private void reset() {
+ private void thump() {
+ if (mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT) {
+ // No interruptions. Not even game haptics.
+ return;
+ }
+ mVibrator.vibrate(80, mAudioAttrs);
+ }
+
+ public void reset() {
L("reset");
final Drawable sky = new GradientDrawable(
GradientDrawable.Orientation.BOTTOM_TOP,
@@ -313,14 +338,16 @@
private void setScore(int score) {
mScore = score;
- if (mScoreField != null) mScoreField.setText(String.valueOf(score));
+ if (mScoreField != null) {
+ mScoreField.setText(DEBUG_IDDQD ? "??" : String.valueOf(score));
+ }
}
private void addScore(int incr) {
setScore(mScore + incr);
}
- private void start(boolean startPlaying) {
+ public void start(boolean startPlaying) {
L("start(startPlaying=%s)", startPlaying?"true":"false");
if (startPlaying) {
mPlaying = true;
@@ -352,7 +379,7 @@
}
}
- private void stop() {
+ public void stop() {
if (mAnimating) {
mAnim.cancel();
mAnim = null;
@@ -417,8 +444,10 @@
if (mPlaying && mDroid.below(mHeight)) {
if (DEBUG_IDDQD) {
poke();
+ unpoke();
} else {
L("player hit the floor");
+ thump();
stop();
}
}
@@ -429,6 +458,7 @@
final Obstacle ob = mObstaclesInPlay.get(j);
if (mPlaying && ob.intersects(mDroid) && !DEBUG_IDDQD) {
L("player hit an obstacle");
+ thump();
stop();
} else if (ob.cleared(mDroid)) {
if (ob instanceof Stem) passedBarrier = true;
@@ -459,8 +489,9 @@
// 3. Time for more obstacles!
if (mPlaying && (t - mLastPipeTime) > PARAMS.OBSTACLE_PERIOD) {
mLastPipeTime = t;
- final int obstacley = (int) (Math.random()
- * (mHeight - 2*PARAMS.OBSTACLE_MIN - PARAMS.OBSTACLE_GAP)) + PARAMS.OBSTACLE_MIN;
+ final int obstacley =
+ (int)(frand() * (mHeight - 2*PARAMS.OBSTACLE_MIN - PARAMS.OBSTACLE_GAP)) +
+ PARAMS.OBSTACLE_MIN;
final int inset = (PARAMS.OBSTACLE_WIDTH - PARAMS.OBSTACLE_STEM_WIDTH) / 2;
final int yinset = PARAMS.OBSTACLE_WIDTH/2;
@@ -539,7 +570,7 @@
@Override
public boolean onTouchEvent(MotionEvent ev) {
- if (DEBUG) L("touch: %s", ev);
+ L("touch: %s", ev);
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
poke();
@@ -553,7 +584,7 @@
@Override
public boolean onTrackballEvent(MotionEvent ev) {
- if (DEBUG) L("trackball: %s", ev);
+ L("trackball: %s", ev);
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
poke();
@@ -567,7 +598,7 @@
@Override
public boolean onKeyDown(int keyCode, KeyEvent ev) {
- if (DEBUG) L("keyDown: %d", keyCode);
+ L("keyDown: %d", keyCode);
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
@@ -582,7 +613,7 @@
@Override
public boolean onKeyUp(int keyCode, KeyEvent ev) {
- if (DEBUG) L("keyDown: %d", keyCode);
+ L("keyDown: %d", keyCode);
switch (keyCode) {
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_DPAD_UP:
@@ -597,7 +628,7 @@
@Override
public boolean onGenericMotionEvent (MotionEvent ev) {
- if (DEBUG) L("generic: %s", ev);
+ L("generic: %s", ev);
return false;
}
@@ -684,6 +715,10 @@
private boolean mBoosting;
+ private final int[] sColors = new int[] {
+ 0xFF78C557,
+ };
+
private final float[] sHull = new float[] {
0.3f, 0f, // left antenna
0.7f, 0f, // right antenna
@@ -692,7 +727,7 @@
0.6f, 1f, // right foot
0.4f, 1f, // left foot BLUE!
0.08f, 0.75f, // sinistram
- 0.08f, 0.33f, // cold shoulder
+ 0.08f, 0.33f, // cold shoulder
};
public final float[] corners = new float[sHull.length];
@@ -701,7 +736,7 @@
setBackgroundResource(R.drawable.android);
getBackground().setTintMode(PorterDuff.Mode.SRC_ATOP);
- getBackground().setTint(0xFF00FF00);
+ getBackground().setTint(sColors[0]);
setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
@@ -822,8 +857,9 @@
int cx, cy, r;
public Pop(Context context, float h) {
super(context, h);
- int idx = 2*irand(0, POPS.length/2);
+ int idx = 3*irand(0, POPS.length/3);
setBackgroundResource(POPS[idx]);
+ setAlpha((float)(POPS[idx+2])/255);
setScaleX(frand() < 0.5f ? -1 : 1);
mRotate = POPS[idx+1] == 0 ? 0 : (frand() < 0.5f ? -1 : 1);
setOutlineProvider(new ViewOutlineProvider() {
diff --git a/packages/SystemUI/src/com/android/systemui/egg/LLandActivity.java b/packages/SystemUI/src/com/android/systemui/egg/LLandActivity.java
index 88fd952..b9f8106 100644
--- a/packages/SystemUI/src/com/android/systemui/egg/LLandActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/egg/LLandActivity.java
@@ -24,13 +24,21 @@
import com.android.systemui.R;
public class LLandActivity extends Activity {
+ LLand mLand;
+
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.lland);
- LLand world = (LLand) findViewById(R.id.world);
- world.setScoreField((TextView) findViewById(R.id.score));
- world.setSplash(findViewById(R.id.welcome));
- Log.v(LLand.TAG, "focus: " + world.requestFocus());
+ mLand = (LLand) findViewById(R.id.world);
+ mLand.setScoreField((TextView) findViewById(R.id.score));
+ mLand.setSplash(findViewById(R.id.welcome));
+ //Log.v(LLand.TAG, "focus: " + mLand.requestFocus());
+ }
+
+ @Override
+ public void onPause() {
+ mLand.stop();
+ super.onPause();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
index bccc753..9744dca 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -85,8 +85,7 @@
@Override
protected void handleUpdateState(BooleanState state, Object arg) {
- state.visible = mController.isHotspotSupported() && mUsageTracker.isRecentlyUsed()
- && !mController.isProvisioningNeeded();
+ state.visible = mController.isHotspotSupported() && mUsageTracker.isRecentlyUsed();
state.label = mContext.getString(R.string.quick_settings_hotspot_label);
state.value = mController.isHotspotEnabled();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java
index c524edc..6bad652 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java
@@ -47,6 +47,10 @@
ViewGroupAdapterBridge.link(this, mAdapter);
}
+ public void refreshAdapter() {
+ mAdapter.refresh();
+ }
+
public static class Adapter extends UserSwitcherController.BaseUserAdapter
implements OnClickListener {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
index 29f291d..4f0700e 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.ActivityManager;
import android.app.ActivityOptions;
+import android.app.ITaskStackListener;
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetProviderInfo;
import android.content.ActivityNotFoundException;
@@ -56,6 +57,7 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
+
/** A proxy implementation for the recents component */
public class AlternateRecentsComponent implements ActivityOptions.OnAnimationStartedListener {
@@ -79,6 +81,28 @@
final static String sRecentsPackage = "com.android.systemui";
final static String sRecentsActivity = "com.android.systemui.recents.RecentsActivity";
+ /**
+ * An implementation of ITaskStackListener, that allows us to listen for changes to the system
+ * task stacks and update recents accordingly.
+ */
+ class TaskStackListenerImpl extends ITaskStackListener.Stub {
+ @Override
+ public void onTaskStackChanged() {
+ RecentsConfiguration config = RecentsConfiguration.getInstance();
+ if (config.svelteLevel == RecentsConfiguration.SVELTE_NONE) {
+ // Load the next task only if we aren't svelte
+ RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
+ RecentsTaskLoadPlan plan = loader.createLoadPlan(mContext);
+ loader.preloadTasks(plan, true /* isTopTaskHome */);
+ RecentsTaskLoadPlan.Options launchOpts = new RecentsTaskLoadPlan.Options();
+ launchOpts.numVisibleTasks = 1;
+ launchOpts.numVisibleTaskThumbnails = 1;
+ launchOpts.onlyLoadForCache = true;
+ loader.loadTasks(mContext, plan, launchOpts);
+ }
+ }
+ }
+
static RecentsComponent.Callbacks sRecentsComponentCallbacks;
static RecentsTaskLoadPlan sInstanceLoadPlan;
@@ -86,6 +110,7 @@
LayoutInflater mInflater;
SystemServicesProxy mSystemServicesProxy;
Handler mHandler;
+ TaskStackListenerImpl mTaskStackListener;
boolean mBootCompleted;
boolean mStartAnimationTriggered;
boolean mCanReuseTaskStackViews = true;
@@ -116,6 +141,10 @@
mSystemServicesProxy = new SystemServicesProxy(context);
mHandler = new Handler();
mTaskStackBounds = new Rect();
+
+ // Register the task stack listener
+ mTaskStackListener = new TaskStackListenerImpl();
+ mSystemServicesProxy.registerTaskStackListener(mTaskStackListener);
}
public void onStart() {
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
index 6dc2edb..a37bc54 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java
@@ -167,10 +167,6 @@
if (action.equals(Intent.ACTION_SCREEN_OFF)) {
// When the screen turns off, dismiss Recents to Home
dismissRecentsToHome(false);
- // Preload the metadata for all tasks in the background
- RecentsTaskLoader loader = RecentsTaskLoader.getInstance();
- RecentsTaskLoadPlan plan = loader.createLoadPlan(context);
- loader.preloadTasks(plan, true /* isTopTaskHome */);
} else if (action.equals(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED)) {
// When the search activity changes, update the Search widget
refreshSearchWidget();
@@ -437,22 +433,6 @@
onEnterAnimationTriggered();
}
- // Start listening for widget package changes if there is one bound, post it since we don't
- // want it stalling the startup
- if (mConfig.searchBarAppWidgetId >= 0) {
- final WeakReference<RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks> callback =
- new WeakReference<RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks>(this);
- mRecentsView.post(new Runnable() {
- @Override
- public void run() {
- RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks cb = callback.get();
- if (cb != null) {
- mAppWidgetHost.startListening(cb);
- }
- }
- });
- }
-
mStatusBar = ((SystemUIApplication) getApplication())
.getComponent(PhoneStatusBar.class);
}
@@ -539,15 +519,29 @@
unregisterReceiver(mSystemBroadcastReceiver);
// Stop listening for widget package changes if there was one bound
- if (mAppWidgetHost.isListening()) {
- mAppWidgetHost.stopListening();
- }
+ mAppWidgetHost.stopListening();
}
public void onEnterAnimationTriggered() {
// Try and start the enter animation (or restart it on configuration changed)
ReferenceCountedTrigger t = new ReferenceCountedTrigger(this, null, null, null);
- mRecentsView.startEnterRecentsAnimation(new ViewAnimation.TaskViewEnterContext(t));
+ ViewAnimation.TaskViewEnterContext ctx = new ViewAnimation.TaskViewEnterContext(t);
+ mRecentsView.startEnterRecentsAnimation(ctx);
+ if (mConfig.searchBarAppWidgetId >= 0) {
+ final WeakReference<RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks> cbRef =
+ new WeakReference<RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks>(
+ RecentsActivity.this);
+ ctx.postAnimationTrigger.addLastDecrementRunnable(new Runnable() {
+ @Override
+ public void run() {
+ // Start listening for widget package changes if there is one bound
+ RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks cb = cbRef.get();
+ if (cb != null) {
+ mAppWidgetHost.startListening(cb);
+ }
+ }
+ });
+ }
// Animate the SystemUI scrim views
mScrimViews.startEnterRecentsAnimation();
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsAppWidgetHost.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsAppWidgetHost.java
index a63e167..5bae37a 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/RecentsAppWidgetHost.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsAppWidgetHost.java
@@ -43,23 +43,23 @@
public void startListening(RecentsAppWidgetHostCallbacks cb) {
mCb = cb;
- mIsListening = true;
- super.startListening();
+ if (!mIsListening) {
+ mIsListening = true;
+ super.startListening();
+ }
}
@Override
public void stopListening() {
- super.stopListening();
+ if (mIsListening) {
+ super.stopListening();
+ }
// Ensure that we release any references to the callbacks
mCb = null;
mContext = null;
mIsListening = false;
}
- public boolean isListening() {
- return mIsListening;
- }
-
@Override
protected void onProviderChanged(int appWidgetId, AppWidgetProviderInfo appWidgetInfo) {
if (mCb == null) return;
diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
index 9a4bd08..3fbd5a6 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java
@@ -21,6 +21,7 @@
import android.app.ActivityOptions;
import android.app.AppGlobals;
import android.app.IActivityManager;
+import android.app.ITaskStackListener;
import android.app.SearchManager;
import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetManager;
@@ -536,4 +537,15 @@
e.printStackTrace();
}
}
+
+ /** Registers a task stack listener with the system. */
+ public void registerTaskStackListener(ITaskStackListener listener) {
+ if (mIam == null) return;
+
+ try {
+ mIam.registerTaskStackListener(listener);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
index 46a5d8d..746a7df 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/RecentsView.java
@@ -204,6 +204,10 @@
/** Requests all task stacks to start their enter-recents animation */
public void startEnterRecentsAnimation(ViewAnimation.TaskViewEnterContext ctx) {
+ // We have to increment/decrement the post animation trigger in case there are no children
+ // to ensure that it runs
+ ctx.postAnimationTrigger.increment();
+
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
@@ -212,6 +216,7 @@
stackView.startEnterRecentsAnimation(ctx);
}
}
+ ctx.postAnimationTrigger.decrement();
}
/** Requests all task stacks to start their exit-recents animation */
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
index 2623db3..33a36f6 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/TaskStackView.java
@@ -530,11 +530,12 @@
/** Resets the focused task. */
void resetFocusedTask() {
- if ((mStack != null) && (0 <= mFocusedTaskIndex) &&
- (mFocusedTaskIndex < mStack.getTaskCount())) {
+ if ((0 <= mFocusedTaskIndex) && (mFocusedTaskIndex < mStack.getTaskCount())) {
Task t = mStack.getTasks().get(mFocusedTaskIndex);
TaskView tv = getChildViewForTask(t);
- tv.unsetFocusedTask();
+ if (tv != null) {
+ tv.unsetFocusedTask();
+ }
}
mFocusedTaskIndex = -1;
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/views/ViewAnimation.java b/packages/SystemUI/src/com/android/systemui/recents/views/ViewAnimation.java
index 4586f12..e1d80fd 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/views/ViewAnimation.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/views/ViewAnimation.java
@@ -27,7 +27,7 @@
public static class TaskViewEnterContext {
// A trigger to run some logic when all the animations complete. This works around the fact
// that it is difficult to coordinate ViewPropertyAnimators
- ReferenceCountedTrigger postAnimationTrigger;
+ public ReferenceCountedTrigger postAnimationTrigger;
// An update listener to notify as the enter animation progresses (used for the home transition)
ValueAnimator.AnimatorUpdateListener updateListener;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java
index 3d4a1e0..6b167b4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java
@@ -46,9 +46,12 @@
public void dump(PrintWriter pw) {
pw.println(" DozeParameters:");
pw.print(" getDisplayStateSupported(): "); pw.println(getDisplayStateSupported());
- pw.print(" getPulseDuration(): "); pw.println(getPulseDuration());
- pw.print(" getPulseInDuration(): "); pw.println(getPulseInDuration());
- pw.print(" getPulseInDelay(): "); pw.println(getPulseInDelay());
+ pw.print(" getPulseDuration(pickup=false): "); pw.println(getPulseDuration(false));
+ pw.print(" getPulseDuration(pickup=true): "); pw.println(getPulseDuration(true));
+ pw.print(" getPulseInDuration(pickup=false): "); pw.println(getPulseInDuration(false));
+ pw.print(" getPulseInDuration(pickup=true): "); pw.println(getPulseInDuration(true));
+ pw.print(" getPulseInDelay(pickup=false): "); pw.println(getPulseInDelay(false));
+ pw.print(" getPulseInDelay(pickup=true): "); pw.println(getPulseInDelay(true));
pw.print(" getPulseInVisibleDuration(): "); pw.println(getPulseVisibleDuration());
pw.print(" getPulseOutDuration(): "); pw.println(getPulseOutDuration());
pw.print(" getPulseOnSigMotion(): "); pw.println(getPulseOnSigMotion());
@@ -60,22 +63,27 @@
pw.print(" getPulseSchedule(): "); pw.println(getPulseSchedule());
pw.print(" getPulseScheduleResets(): "); pw.println(getPulseScheduleResets());
pw.print(" getPickupVibrationThreshold(): "); pw.println(getPickupVibrationThreshold());
+ pw.print(" getPickupPerformsProxCheck(): "); pw.println(getPickupPerformsProxCheck());
}
public boolean getDisplayStateSupported() {
return getBoolean("doze.display.supported", R.bool.doze_display_state_supported);
}
- public int getPulseDuration() {
- return getPulseInDuration() + getPulseVisibleDuration() + getPulseOutDuration();
+ public int getPulseDuration(boolean pickup) {
+ return getPulseInDuration(pickup) + getPulseVisibleDuration() + getPulseOutDuration();
}
- public int getPulseInDuration() {
- return getInt("doze.pulse.duration.in", R.integer.doze_pulse_duration_in);
+ public int getPulseInDuration(boolean pickup) {
+ return pickup
+ ? getInt("doze.pulse.duration.in.pickup", R.integer.doze_pulse_duration_in_pickup)
+ : getInt("doze.pulse.duration.in", R.integer.doze_pulse_duration_in);
}
- public int getPulseInDelay() {
- return getInt("doze.pulse.delay.in", R.integer.doze_pulse_delay_in);
+ public int getPulseInDelay(boolean pickup) {
+ return pickup
+ ? getInt("doze.pulse.delay.in.pickup", R.integer.doze_pulse_delay_in_pickup)
+ : getInt("doze.pulse.delay.in", R.integer.doze_pulse_delay_in);
}
public int getPulseVisibleDuration() {
@@ -106,6 +114,10 @@
return getBoolean("doze.pulse.proxcheck", R.bool.doze_proximity_check_before_pulse);
}
+ public boolean getPickupPerformsProxCheck() {
+ return getBoolean("doze.pickup.proxcheck", R.bool.doze_pickup_performs_proximity_check);
+ }
+
public boolean getPulseOnNotifications() {
return getBoolean("doze.pulse.notifications", R.bool.doze_pulse_on_notifications);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java
index 022e64e..3e17328 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeScrimController.java
@@ -21,10 +21,8 @@
import android.animation.ValueAnimator;
import android.annotation.NonNull;
import android.content.Context;
-import android.graphics.Color;
import android.os.Handler;
import android.util.Log;
-import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
@@ -40,6 +38,7 @@
private final DozeParameters mDozeParameters;
private final Interpolator mPulseInInterpolator = PhoneStatusBar.ALPHA_OUT;
+ private final Interpolator mPulseInInterpolatorPickup;
private final Interpolator mPulseOutInterpolator = PhoneStatusBar.ALPHA_IN;
private final Interpolator mDozeAnimationInterpolator;
private final Handler mHandler = new Handler();
@@ -56,8 +55,8 @@
public DozeScrimController(ScrimController scrimController, Context context) {
mScrimController = scrimController;
mDozeParameters = new DozeParameters(context);
- mDozeAnimationInterpolator = AnimationUtils.loadInterpolator(context,
- android.R.interpolator.linear_out_slow_in);
+ mDozeAnimationInterpolator = mPulseInInterpolatorPickup =
+ AnimationUtils.loadInterpolator(context, android.R.interpolator.linear_out_slow_in);
}
public void setDozing(boolean dozing, boolean animate) {
@@ -219,11 +218,16 @@
private final Runnable mPulseIn = new Runnable() {
@Override
public void run() {
- if (DEBUG) Log.d(TAG, "Pulse in, mDozing=" + mDozing);
+ if (DEBUG) Log.d(TAG, "Pulse in, mDozing=" + mDozing + " mPulseReason="
+ + DozeLog.pulseReasonToString(mPulseReason));
if (!mDozing) return;
DozeLog.tracePulseStart(mPulseReason);
- startScrimAnimation(true /* inFront */, 0f, mDozeParameters.getPulseInDuration(),
- mPulseInInterpolator, mDozeParameters.getPulseInDelay(), mPulseInFinished);
+ final boolean pickup = mPulseReason == DozeLog.PULSE_REASON_SENSOR_PICKUP;
+ startScrimAnimation(true /* inFront */, 0f,
+ mDozeParameters.getPulseInDuration(pickup),
+ pickup ? mPulseInInterpolatorPickup : mPulseInInterpolator,
+ mDozeParameters.getPulseInDelay(pickup),
+ mPulseInFinished);
// Signal that the pulse is ready to turn the screen on and draw.
pulseStarted();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 7a3b5e4..ec2d30c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -3795,14 +3795,19 @@
* @param state The {@link StatusBarState} to set.
*/
public void setBarState(int state) {
- // If we're visible and switched to SHADE_LOCKED (the user dragged down
- // on the lockscreen), clear notification LED, vibration, ringing.
- // Other transitions are covered in handleVisibleToUserChanged().
- if (mVisible && mState != state && state == StatusBarState.SHADE_LOCKED) {
- try {
- mBarService.clearNotificationEffects();
- } catch (RemoteException e) {
- // Ignore.
+ if (state != mState) {
+ EventLogTags.writeSysuiStatusBarState(state);
+
+ // If we're visible and switched to SHADE_LOCKED (the user dragged
+ // down on the lockscreen), clear notification LED, vibration,
+ // ringing.
+ // Other transitions are covered in handleVisibleToUserChanged().
+ if (mVisible && state == StatusBarState.SHADE_LOCKED) {
+ try {
+ mBarService.clearNotificationEffects();
+ } catch (RemoteException e) {
+ // Ignore.
+ }
}
}
mState = state;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
index e4eae38..7cbf13f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java
@@ -30,7 +30,7 @@
public class PhoneStatusBarView extends PanelBar {
private static final String TAG = "PhoneStatusBarView";
private static final boolean DEBUG = PhoneStatusBar.DEBUG;
- private static final boolean DEBUG_GESTURES = true;
+ private static final boolean DEBUG_GESTURES = false;
PhoneStatusBar mBar;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
index 8ce608c..45a1386 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
@@ -122,7 +122,7 @@
tile.userSwitch(newUserId);
}
mSecurity.onUserSwitched(newUserId);
- mNetwork.getAccessPointController().onUserSwitched(newUserId);
+ mNetwork.onUserSwitched(newUserId);
mObserver.register();
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
index 63c1100..8f40011 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/HotspotControllerImpl.java
@@ -35,6 +35,8 @@
private static final String TAG = "HotspotController";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+ private static final String TETHER_ENABLE_PACKAGE = "com.android.settings";
+ private static final String TETHER_ENABLE_CLASS = "com.android.settings.EnableWifiTether";
private final ArrayList<Callback> mCallbacks = new ArrayList<Callback>();
private final Receiver mReceiver = new Receiver();
@@ -91,20 +93,14 @@
@Override
public void setHotspotEnabled(boolean enabled) {
final ContentResolver cr = mContext.getContentResolver();
- // This needs to be kept up to date with Settings (WifiApEnabler.setSoftapEnabled)
- // in case it is turned on in settings and off in qs (or vice versa).
- // Disable Wifi if enabling tethering.
- int wifiState = mWifiManager.getWifiState();
- if (enabled && ((wifiState == WifiManager.WIFI_STATE_ENABLING) ||
- (wifiState == WifiManager.WIFI_STATE_ENABLED))) {
- mWifiManager.setWifiEnabled(false);
- Settings.Global.putInt(cr, Settings.Global.WIFI_SAVED_STATE, 1);
- }
-
- mWifiManager.setWifiApEnabled(null, enabled);
-
- // If needed, restore Wifi on tether disable.
- if (!enabled) {
+ // Call provisioning app which is called when enabling Tethering from Settings
+ if (enabled) {
+ Intent intent = new Intent();
+ intent.setClassName(TETHER_ENABLE_PACKAGE, TETHER_ENABLE_CLASS);
+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ mContext.startActivity(intent);
+ } else {
+ mWifiManager.setWifiApEnabled(null, false);
if (Settings.Global.getInt(cr, Settings.Global.WIFI_SAVED_STATE, 0) == 1) {
mWifiManager.setWifiEnabled(true);
Settings.Global.putInt(cr, Settings.Global.WIFI_SAVED_STATE, 0);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java
index 7ee1fc5..1460e5f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcher.java
@@ -107,6 +107,7 @@
public void show(boolean animate) {
if (mUserSwitcher != null && mUserSwitcherContainer.getVisibility() != View.VISIBLE) {
cancelAnimations();
+ mAdapter.refresh();
mUserSwitcherContainer.setVisibility(View.VISIBLE);
mStatusBarView.setKeyguardUserSwitcherShowing(true, animate);
if (animate) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
index 58bf246..bcf08ff 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
@@ -22,6 +22,7 @@
void addNetworkSignalChangedCallback(NetworkSignalChangedCallback cb);
void removeNetworkSignalChangedCallback(NetworkSignalChangedCallback cb);
void setWifiEnabled(boolean enabled);
+ void onUserSwitched(int newUserId);
AccessPointController getAccessPointController();
MobileDataController getMobileDataController();
@@ -49,7 +50,6 @@
void scanForAccessPoints();
boolean connect(AccessPoint ap);
boolean canConfigWifi();
- void onUserSwitched(int newUserId);
public interface AccessPointCallback {
void onAccessPointsChanged(AccessPoint[] accessPoints);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 5e71047..6431ab5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -16,12 +16,19 @@
package com.android.systemui.statusbar.policy;
+import static android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED;
+import static android.net.NetworkCapabilities.TRANSPORT_BLUETOOTH;
+import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR;
+import static android.net.NetworkCapabilities.TRANSPORT_ETHERNET;
+import static android.net.NetworkCapabilities.TRANSPORT_WIFI;
+
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Resources;
import android.net.ConnectivityManager;
+import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
@@ -55,6 +62,7 @@
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
+import java.util.BitSet;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -98,16 +106,19 @@
private final AccessPointControllerImpl mAccessPoints;
private final MobileDataControllerImpl mMobileDataController;
- // bluetooth
+ // Network types that replace the carrier label if the device does not support mobile data.
private boolean mBluetoothTethered = false;
+ private boolean mEthernetConnected = false;
- // data connectivity (regardless of state, can we access the internet?)
- // state of inet connection - 0 not connected, 100 connected
+ // state of inet connection
private boolean mConnected = false;
- private int mConnectedNetworkType = ConnectivityManager.TYPE_NONE;
- private String mConnectedNetworkTypeName;
private boolean mInetCondition; // Used for Logging and demo.
+ // BitSets indicating which network transport types (e.g., TRANSPORT_WIFI, TRANSPORT_MOBILE) are
+ // connected and validated, respectively.
+ private final BitSet mConnectedTransports = new BitSet();
+ private final BitSet mValidatedTransports = new BitSet();
+
// States that don't belong to a subcontroller.
private boolean mAirplaneMode = false;
private boolean mHasNoSims;
@@ -125,6 +136,9 @@
new ArrayList<NetworkSignalChangedCallback>();
private boolean mListening;
+ // The current user ID.
+ private int mCurrentUserId;
+
/**
* Construct this controller object and register for updates.
*/
@@ -344,6 +358,14 @@
}
@Override
+ public void onUserSwitched(int newUserId) {
+ mCurrentUserId = newUserId;
+ mAccessPoints.onUserSwitched(newUserId);
+ updateConnectivity();
+ refreshCarrierLabel();
+ }
+
+ @Override
public void onReceive(Context context, Intent intent) {
if (CHATTY) {
Log.d(TAG, "onReceive: intent=" + intent);
@@ -351,7 +373,7 @@
final String action = intent.getAction();
if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION_IMMEDIATE) ||
action.equals(ConnectivityManager.INET_CONDITION_ACTION)) {
- updateConnectivity(intent);
+ updateConnectivity();
refreshCarrierLabel();
} else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) {
refreshLocale();
@@ -406,8 +428,9 @@
updateNoSims();
}
- private void updateNoSims() {
- boolean hasNoSims = mPhone.getPhoneCount() != 0 && mMobileSignalControllers.size() == 0;
+ @VisibleForTesting
+ protected void updateNoSims() {
+ boolean hasNoSims = mHasMobileDataFeature && mMobileSignalControllers.size() == 0;
if (hasNoSims != mHasNoSims) {
mHasNoSims = hasNoSims;
notifyListeners();
@@ -498,14 +521,6 @@
}
/**
- * Turns inet condition into a boolean indexing for a specific network.
- * @return 0 for bad connectivity on this network, 1 for good connectivity
- */
- private int inetConditionForNetwork(int networkType, boolean inetCondition) {
- return (inetCondition && mConnectedNetworkType == networkType) ? 1 : 0;
- }
-
- /**
* Forces update of all callbacks on both SignalClusters and
* NetworkSignalChangedCallbacks.
*/
@@ -539,41 +554,37 @@
/**
* Update the Inet conditions and what network we are connected to.
*/
- private void updateConnectivity(Intent intent) {
- final NetworkInfo info = mConnectivityManager.getActiveNetworkInfo();
-
- // Are we connected at all, by any interface?
- mConnected = info != null && info.isConnected();
- if (mConnected) {
- mConnectedNetworkType = info.getType();
- mConnectedNetworkTypeName = info.getTypeName();
- } else {
- mConnectedNetworkType = ConnectivityManager.TYPE_NONE;
- mConnectedNetworkTypeName = null;
+ private void updateConnectivity() {
+ mConnectedTransports.clear();
+ mValidatedTransports.clear();
+ for (NetworkCapabilities nc :
+ mConnectivityManager.getDefaultNetworkCapabilitiesForUser(mCurrentUserId)) {
+ for (int transportType : nc.getTransportTypes()) {
+ mConnectedTransports.set(transportType);
+ if (nc.hasCapability(NET_CAPABILITY_VALIDATED)) {
+ mValidatedTransports.set(transportType);
+ }
+ }
}
- int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0);
-
if (CHATTY) {
- Log.d(TAG, "updateConnectivity: networkInfo=" + info);
- Log.d(TAG, "updateConnectivity: connectionStatus=" + connectionStatus);
+ Log.d(TAG, "updateConnectivity: mConnectedTransports=" + mConnectedTransports);
+ Log.d(TAG, "updateConnectivity: mValidatedTransports=" + mValidatedTransports);
}
- mInetCondition = connectionStatus > INET_CONDITION_THRESHOLD;
-
- if (info != null && info.getType() == ConnectivityManager.TYPE_BLUETOOTH) {
- mBluetoothTethered = info.isConnected();
- } else {
- mBluetoothTethered = false;
- }
+ mConnected = !mConnectedTransports.isEmpty();
+ mInetCondition = !mValidatedTransports.isEmpty();
+ mBluetoothTethered = mConnectedTransports.get(TRANSPORT_BLUETOOTH);
+ mEthernetConnected = mConnectedTransports.get(TRANSPORT_ETHERNET);
// We want to update all the icons, all at once, for any condition change
for (MobileSignalController mobileSignalController : mMobileSignalControllers.values()) {
- mobileSignalController.setInetCondition(mInetCondition ? 1 : 0, inetConditionForNetwork(
- mobileSignalController.getNetworkType(), mInetCondition));
+ mobileSignalController.setInetCondition(
+ mInetCondition ? 1 : 0,
+ mValidatedTransports.get(mobileSignalController.getTransportType()) ? 1 : 0);
}
mWifiSignalController.setInetCondition(
- inetConditionForNetwork(mWifiSignalController.getNetworkType(), mInetCondition));
+ mValidatedTransports.get(mWifiSignalController.getTransportType()) ? 1 : 0);
}
/**
@@ -594,9 +605,7 @@
label = mContext.getString(R.string.bluetooth_tethered);
}
- final boolean ethernetConnected =
- (mConnectedNetworkType == ConnectivityManager.TYPE_ETHERNET);
- if (ethernetConnected && !mHasMobileDataFeature) {
+ if (mEthernetConnected && !mHasMobileDataFeature) {
label = context.getString(R.string.ethernet_label);
}
@@ -612,7 +621,7 @@
}
}
} else if (!isMobileDataConnected() && !wifiState.connected && !mBluetoothTethered &&
- !ethernetConnected && !mHasMobileDataFeature) {
+ !mEthernetConnected && !mHasMobileDataFeature) {
// Pretty much no connection.
label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
}
@@ -633,9 +642,7 @@
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
pw.println("NetworkController state:");
- pw.println(String.format(" %s network type %d (%s)",
- mConnected ? "CONNECTED" : "DISCONNECTED",
- mConnectedNetworkType, mConnectedNetworkTypeName));
+
pw.println(" - telephony ------");
pw.print(" hasVoiceCallingFeature()=");
pw.println(hasVoiceCallingFeature());
@@ -645,6 +652,10 @@
pw.println(mBluetoothTethered);
pw.println(" - connectivity ------");
+ pw.print(" mConnectedTransports=");
+ pw.println(mConnectedTransports);
+ pw.print(" mValidatedTransports=");
+ pw.println(mValidatedTransports);
pw.print(" mInetCondition=");
pw.println(mInetCondition);
pw.print(" mAirplaneMode=");
@@ -795,8 +806,8 @@
public WifiSignalController(Context context, boolean hasMobileData,
List<NetworkSignalChangedCallback> signalCallbacks,
List<SignalCluster> signalClusters, NetworkControllerImpl networkController) {
- super("WifiSignalController", context, ConnectivityManager.TYPE_WIFI, signalCallbacks,
- signalClusters, networkController);
+ super("WifiSignalController", context, NetworkCapabilities.TRANSPORT_WIFI,
+ signalCallbacks, signalClusters, networkController);
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
mHasMobileData = hasMobileData;
Handler handler = new WifiHandler();
@@ -989,7 +1000,7 @@
List<SignalCluster> signalClusters, NetworkControllerImpl networkController,
SubscriptionInfo info) {
super("MobileSignalController(" + info.getSubscriptionId() + ")", context,
- ConnectivityManager.TYPE_MOBILE, signalCallbacks, signalClusters,
+ NetworkCapabilities.TRANSPORT_CELLULAR, signalCallbacks, signalClusters,
networkController);
mConfig = config;
mPhone = phone;
@@ -1460,7 +1471,7 @@
protected final String mTag;
protected final T mCurrentState;
protected final T mLastState;
- protected final int mNetworkType;
+ protected final int mTransportType;
protected final Context mContext;
// The owner of the SignalController (i.e. NetworkController will maintain the following
// lists and call notifyListeners whenever the list has changed to ensure everyone
@@ -1479,7 +1490,7 @@
List<SignalCluster> signalClusters, NetworkControllerImpl networkController) {
mTag = TAG + "." + tag;
mNetworkController = networkController;
- mNetworkType = type;
+ mTransportType = type;
mContext = context;
mSignalsChangedCallbacks = signalCallbacks;
mSignalClusters = signalClusters;
@@ -1497,8 +1508,8 @@
return mCurrentState;
}
- public int getNetworkType() {
- return mNetworkType;
+ public int getTransportType() {
+ return mTransportType;
}
public void setInetCondition(int inetCondition) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
index e5b357a..4ac41a1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
@@ -417,18 +417,6 @@
}
}
- public int getSwitchableUsers() {
- int result = 0;
- ArrayList<UserRecord> users = mController.mUsers;
- int N = users.size();
- for (int i = 0; i < N; i++) {
- if (users.get(i).info != null) {
- result++;
- }
- }
- return result;
- }
-
public Drawable getDrawable(Context context, UserRecord item) {
if (item.isAddUser) {
return context.getDrawable(R.drawable.ic_add_circle_qs);
@@ -436,6 +424,10 @@
return UserIcons.getDefaultUserIcon(item.isGuest ? UserHandle.USER_NULL : item.info.id,
/* light= */ true);
}
+
+ public void refresh() {
+ mController.refreshUsers(UserHandle.USER_NULL);
+ }
}
public static final class UserRecord {
@@ -500,6 +492,7 @@
} else {
v = (UserDetailView) convertView;
}
+ v.refreshAdapter();
return v;
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
index eaf2f78..020bc00 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
@@ -195,6 +195,18 @@
mPhoneStateListener.onDataActivity(dataActivity);
}
+ protected void verifyHasNoSims(boolean hasNoSimsVisible) {
+ ArgumentCaptor<Boolean> hasNoSimsArg = ArgumentCaptor.forClass(Boolean.class);
+
+ Mockito.verify(mSignalCluster, Mockito.atLeastOnce()).setNoSims(hasNoSimsArg.capture());
+ assertEquals("No sims in status bar", hasNoSimsVisible, (boolean) hasNoSimsArg.getValue());
+
+ Mockito.verify(mNetworkSignalChangedCallback, Mockito.atLeastOnce())
+ .onNoSimVisibleChanged(hasNoSimsArg.capture());
+ assertEquals("No sims in quick settings", hasNoSimsVisible,
+ (boolean) hasNoSimsArg.getValue());
+ }
+
protected void verifyLastQsMobileDataIndicators(boolean visible, int icon, int typeIcon,
boolean dataIn, boolean dataOut) {
ArgumentCaptor<Integer> iconArg = ArgumentCaptor.forClass(Integer.class);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
index b5d97d9..33eb4d6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java
@@ -25,6 +25,30 @@
verifyLastMobileDataIndicators(false, 0, 0);
}
+ public void testNoSimsIconPresent() {
+ // No Subscriptions.
+ mNetworkController.mMobileSignalControllers.clear();
+ mNetworkController.updateNoSims();
+
+ verifyHasNoSims(true);
+ }
+
+ public void testNoSimlessIconWithoutMobile() {
+ // Turn off mobile network support.
+ Mockito.when(mMockCm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE)).thenReturn(false);
+ // Create a new NetworkController as this is currently handled in constructor.
+ mNetworkController = new NetworkControllerImpl(mContext, mMockCm, mMockTm, mMockWm, mMockSm,
+ mConfig, mock(AccessPointControllerImpl.class),
+ mock(MobileDataControllerImpl.class));
+ setupNetworkController();
+
+ // No Subscriptions.
+ mNetworkController.mMobileSignalControllers.clear();
+ mNetworkController.updateNoSims();
+
+ verifyHasNoSims(false);
+ }
+
public void testSignalStrength() {
for (int testStrength = SignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
testStrength <= SignalStrength.SIGNAL_STRENGTH_GREAT; testStrength++) {
diff --git a/packages/VpnDialogs/res/values-eu-rES/strings.xml b/packages/VpnDialogs/res/values-eu-rES/strings.xml
index 7467195..b716509 100644
--- a/packages/VpnDialogs/res/values-eu-rES/strings.xml
+++ b/packages/VpnDialogs/res/values-eu-rES/strings.xml
@@ -17,7 +17,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="prompt" msgid="3183836924226407828">"Konektatzeko eskaera"</string>
- <string name="warning" msgid="809658604548412033">"<xliff:g id="APP">%s</xliff:g> VPN bidez konektatu nahi da sareko trafikoa kontrolatzeko. Iturburua fidagarria bada bakarrik baimendu. <br /> <br /> VPN konexioa aktibo dagoenean, <img src=vpn_icon /> agertuko da pantailaren goialdean."</string>
+ <string name="warning" msgid="809658604548412033">"<xliff:g id="APP">%s</xliff:g> aplikazioak VPN bidezko konexioa ezarri nahi du sareko trafikoa kontrolatzeko. Iturburua fidagarria bada bakarrik baimendu. <br /> <br /> VPN konexioa aktibo dagoenean, <img src=vpn_icon /> agertuko da pantailaren goialdean."</string>
<string name="legacy_title" msgid="192936250066580964">"VPN sarera konektatuta dago"</string>
<string name="configure" msgid="4905518375574791375">"Konfiguratu"</string>
<string name="disconnect" msgid="971412338304200056">"Deskonektatu"</string>
diff --git a/packages/VpnDialogs/res/values-zh-rCN/strings.xml b/packages/VpnDialogs/res/values-zh-rCN/strings.xml
index a77ba3b..cdea95d6 100644
--- a/packages/VpnDialogs/res/values-zh-rCN/strings.xml
+++ b/packages/VpnDialogs/res/values-zh-rCN/strings.xml
@@ -16,8 +16,8 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="prompt" msgid="3183836924226407828">"连接请求"</string>
- <string name="warning" msgid="809658604548412033">"<xliff:g id="APP">%s</xliff:g>想要设置一个VPN连接(可被用于监控网络流量)。请只在您信任该来源的情况下才接受此请求。在VPN处于活动状态时,您的屏幕顶部会显示 <br /> <br /> <img src=vpn_icon /> 图标。"</string>
+ <string name="prompt" msgid="3183836924226407828">"网络连接请求"</string>
+ <string name="warning" msgid="809658604548412033">"<xliff:g id="APP">%s</xliff:g>想要设置一个VPN连接(可被用于监控网络流量)。请只在您信任该来源的情况下才接受此请求。在VPN处于活动状态时,您的屏幕顶部会显示 <img src=vpn_icon /> 图标。"</string>
<string name="legacy_title" msgid="192936250066580964">"已连接VPN"</string>
<string name="configure" msgid="4905518375574791375">"配置"</string>
<string name="disconnect" msgid="971412338304200056">"断开连接"</string>
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index ca0d481..8b53a62 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -4055,12 +4055,12 @@
mAppsToBeHidden.remove(appToken);
mAppsThatDismissKeyguard.remove(appToken);
if (mAppsToBeHidden.isEmpty()) {
- if (mKeyguardSecureIncludingHidden) {
+ if (dismissKeyguard && !mKeyguardSecure) {
+ mAppsThatDismissKeyguard.add(appToken);
+ } else {
mWinShowWhenLocked = win;
mHideLockScreen = true;
mForceStatusBarFromKeyguard = false;
- } else if (dismissKeyguard && !mKeyguardSecure) {
- mAppsThatDismissKeyguard.add(appToken);
}
}
} else if (dismissKeyguard) {
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index 13a649a..5f5b65e 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -240,10 +240,10 @@
}
static jlong
-nContextCreate(JNIEnv *_env, jobject _this, jlong dev, jint ver, jint sdkVer, jint ct)
+nContextCreate(JNIEnv *_env, jobject _this, jlong dev, jint flags, jint sdkVer, jint contextType)
{
LOG_API("nContextCreate");
- return (jlong)(uintptr_t)rsContextCreate((RsDevice)dev, ver, sdkVer, (RsContextType)ct, 0);
+ return (jlong)(uintptr_t)rsContextCreate((RsDevice)dev, 0, sdkVer, (RsContextType)contextType, flags);
}
static jlong
diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java
index 831af85..7b3e137 100644
--- a/services/core/java/com/android/server/AlarmManagerService.java
+++ b/services/core/java/com/android/server/AlarmManagerService.java
@@ -1445,12 +1445,9 @@
maxTriggerTime(nowELAPSED, nextElapsed, alarm.repeatInterval),
alarm.repeatInterval, alarm.operation, batch.standalone, true,
alarm.workSource, alarm.alarmClock, alarm.userId);
+ }
- // For now we count this as a wakeup alarm, meaning it needs to be
- // delivered immediately. In the future we should change this, but
- // that required delaying when we reschedule the repeat...!
- hasWakeup = false;
- } else if (alarm.wakeup) {
+ if (alarm.wakeup) {
hasWakeup = true;
}
diff --git a/services/core/java/com/android/server/AppOpsService.java b/services/core/java/com/android/server/AppOpsService.java
index c3465d1..42a5195 100644
--- a/services/core/java/com/android/server/AppOpsService.java
+++ b/services/core/java/com/android/server/AppOpsService.java
@@ -29,6 +29,7 @@
import java.util.List;
import java.util.Map;
+import android.app.ActivityManager;
import android.app.ActivityThread;
import android.app.AppOpsManager;
import android.content.Context;
@@ -53,7 +54,6 @@
import android.util.Pair;
import android.util.Slog;
import android.util.SparseArray;
-import android.util.SparseIntArray;
import android.util.TimeUtils;
import android.util.Xml;
@@ -78,10 +78,12 @@
final Handler mHandler;
boolean mWriteScheduled;
+ boolean mFastWriteScheduled;
final Runnable mWriteRunner = new Runnable() {
public void run() {
synchronized (AppOpsService.this) {
mWriteScheduled = false;
+ mFastWriteScheduled = false;
AsyncTask<Void, Void, Void> task = new AsyncTask<Void, Void, Void>() {
@Override protected Void doInBackground(Void... params) {
writeState();
@@ -237,7 +239,7 @@
}
}
if (changed) {
- scheduleWriteLocked();
+ scheduleFastWriteLocked();
}
}
}
@@ -250,7 +252,7 @@
if (pkgs.size() <= 0) {
mUidOps.remove(uid);
}
- scheduleWriteLocked();
+ scheduleFastWriteLocked();
}
}
}
@@ -260,7 +262,7 @@
synchronized (this) {
if (mUidOps.indexOfKey(uid) >= 0) {
mUidOps.remove(uid);
- scheduleWriteLocked();
+ scheduleFastWriteLocked();
}
}
}
@@ -400,7 +402,7 @@
// if there is nothing else interesting in it.
pruneOp(op, uid, packageName);
}
- scheduleWriteNowLocked();
+ scheduleFastWriteLocked();
}
}
}
@@ -436,16 +438,20 @@
}
@Override
- public void resetAllModes() {
- int callingUid = Binder.getCallingUid();
+ public void resetAllModes(int reqUserId, String reqPackageName) {
+ final int callingPid = Binder.getCallingPid();
+ final int callingUid = Binder.getCallingUid();
mContext.enforcePermission(android.Manifest.permission.UPDATE_APP_OPS_STATS,
- Binder.getCallingPid(), callingUid, null);
+ callingPid, callingUid, null);
+ reqUserId = ActivityManager.handleIncomingUser(callingPid, callingUid, reqUserId,
+ true, true, "resetAllModes", null);
HashMap<Callback, ArrayList<Pair<String, Integer>>> callbacks = null;
synchronized (this) {
boolean changed = false;
for (int i=mUidOps.size()-1; i>=0; i--) {
HashMap<String, Ops> packages = mUidOps.valueAt(i);
- if (UserHandle.getUserId(callingUid) != UserHandle.getUserId(mUidOps.keyAt(i))) {
+ if (reqUserId != UserHandle.USER_ALL
+ && reqUserId != UserHandle.getUserId(mUidOps.keyAt(i))) {
// Skip any ops for a different user
continue;
}
@@ -453,6 +459,10 @@
while (it.hasNext()) {
Map.Entry<String, Ops> ent = it.next();
String packageName = ent.getKey();
+ if (reqPackageName != null && !reqPackageName.equals(packageName)) {
+ // Skip any ops for a different package
+ continue;
+ }
Ops pkgOps = ent.getValue();
for (int j=pkgOps.size()-1; j>=0; j--) {
Op curOp = pkgOps.valueAt(j);
@@ -478,7 +488,7 @@
}
}
if (changed) {
- scheduleWriteNowLocked();
+ scheduleFastWriteLocked();
}
}
if (callbacks != null) {
@@ -837,12 +847,13 @@
}
}
- private void scheduleWriteNowLocked() {
- if (!mWriteScheduled) {
+ private void scheduleFastWriteLocked() {
+ if (!mFastWriteScheduled) {
mWriteScheduled = true;
+ mFastWriteScheduled = true;
+ mHandler.removeCallbacks(mWriteRunner);
+ mHandler.postDelayed(mWriteRunner, 10*1000);
}
- mHandler.removeCallbacks(mWriteRunner);
- mHandler.post(mWriteRunner);
}
private Op getOpLocked(int code, int uid, String packageName, boolean edit) {
@@ -1236,12 +1247,11 @@
pw.print(" ago");
}
if (op.duration == -1) {
- pw.println(" (running)");
- } else {
- pw.print("; duration=");
- TimeUtils.formatDuration(op.duration, pw);
- pw.println();
+ pw.print(" (running)");
+ } else if (op.duration != 0) {
+ pw.print("; duration="); TimeUtils.formatDuration(op.duration, pw);
}
+ pw.println();
}
}
}
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 5eec0b7..84fddd7 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -797,17 +797,6 @@
throw new IllegalStateException("No free netIds");
}
- private int getConnectivityChangeDelay() {
- final ContentResolver cr = mContext.getContentResolver();
-
- /** Check system properties for the default value then use secure settings value, if any. */
- int defaultDelay = SystemProperties.getInt(
- "conn." + Settings.Global.CONNECTIVITY_CHANGE_DELAY,
- ConnectivityManager.CONNECTIVITY_CHANGE_DELAY_DEFAULT);
- return Settings.Global.getInt(cr, Settings.Global.CONNECTIVITY_CHANGE_DELAY,
- defaultDelay);
- }
-
private boolean teardown(NetworkStateTracker netTracker) {
if (netTracker.teardown()) {
netTracker.setTeardownRequested(true);
@@ -1065,6 +1054,72 @@
return result.toArray(new Network[result.size()]);
}
+ private NetworkCapabilities getNetworkCapabilitiesAndValidation(NetworkAgentInfo nai) {
+ if (nai != null) {
+ synchronized (nai) {
+ if (nai.created) {
+ NetworkCapabilities nc = new NetworkCapabilities(nai.networkCapabilities);
+ if (nai.validated) {
+ nc.addCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
+ } else {
+ nc.removeCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
+ }
+ return nc;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public NetworkCapabilities[] getDefaultNetworkCapabilitiesForUser(int userId) {
+ // The basic principle is: if an app's traffic could possibly go over a
+ // network, without the app doing anything multinetwork-specific,
+ // (hence, by "default"), then include that network's capabilities in
+ // the array.
+ //
+ // In the normal case, app traffic only goes over the system's default
+ // network connection, so that's the only network returned.
+ //
+ // With a VPN in force, some app traffic may go into the VPN, and thus
+ // over whatever underlying networks the VPN specifies, while other app
+ // traffic may go over the system default network (e.g.: a split-tunnel
+ // VPN, or an app disallowed by the VPN), so the set of networks
+ // returned includes the VPN's underlying networks and the system
+ // default.
+ enforceAccessPermission();
+
+ HashMap<Network, NetworkCapabilities> result = new HashMap<Network, NetworkCapabilities>();
+
+ NetworkAgentInfo nai = getDefaultNetwork();
+ NetworkCapabilities nc = getNetworkCapabilitiesAndValidation(getDefaultNetwork());
+ if (nc != null) {
+ result.put(nai.network, nc);
+ }
+
+ if (!mLockdownEnabled) {
+ synchronized (mVpns) {
+ Vpn vpn = mVpns.get(userId);
+ if (vpn != null) {
+ Network[] networks = vpn.getUnderlyingNetworks();
+ if (networks != null) {
+ for (Network network : networks) {
+ nai = getNetworkAgentInfoForNetwork(network);
+ nc = getNetworkCapabilitiesAndValidation(nai);
+ if (nc != null) {
+ result.put(nai.network, nc);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ NetworkCapabilities[] out = new NetworkCapabilities[result.size()];
+ out = result.values().toArray(out);
+ return out;
+ }
+
@Override
public boolean isNetworkSupported(int networkType) {
enforceAccessPermission();
@@ -1413,11 +1468,6 @@
sendGeneralBroadcast(info, CONNECTIVITY_ACTION);
}
- private void sendConnectedBroadcastDelayed(NetworkInfo info, int delayMs) {
- sendGeneralBroadcast(info, CONNECTIVITY_ACTION_IMMEDIATE);
- sendGeneralBroadcastDelayed(info, CONNECTIVITY_ACTION, delayMs);
- }
-
private void sendInetConditionBroadcast(NetworkInfo info) {
sendGeneralBroadcast(info, ConnectivityManager.INET_CONDITION_ACTION);
}
@@ -1449,10 +1499,6 @@
sendStickyBroadcast(makeGeneralIntent(info, bcastType));
}
- private void sendGeneralBroadcastDelayed(NetworkInfo info, String bcastType, int delayMs) {
- sendStickyBroadcastDelayed(makeGeneralIntent(info, bcastType), delayMs);
- }
-
private void sendDataActivityBroadcast(int deviceType, boolean active, long tsNanos) {
Intent intent = new Intent(ConnectivityManager.ACTION_DATA_ACTIVITY_CHANGE);
intent.putExtra(ConnectivityManager.EXTRA_DEVICE_TYPE, deviceType);
@@ -1486,19 +1532,6 @@
}
}
- private void sendStickyBroadcastDelayed(Intent intent, int delayMs) {
- if (delayMs <= 0) {
- sendStickyBroadcast(intent);
- } else {
- if (VDBG) {
- log("sendStickyBroadcastDelayed: delayMs=" + delayMs + ", action="
- + intent.getAction());
- }
- mHandler.sendMessageDelayed(mHandler.obtainMessage(
- EVENT_SEND_STICKY_BROADCAST_INTENT, intent), delayMs);
- }
- }
-
void systemReady() {
// start network sampling ..
Intent intent = new Intent(ACTION_PKT_CNT_SAMPLE_INTERVAL_ELAPSED);
@@ -3544,8 +3577,12 @@
// Note: if mDefaultRequest is changed, NetworkMonitor needs to be updated.
private final NetworkRequest mDefaultRequest;
+ private NetworkAgentInfo getDefaultNetwork() {
+ return mNetworkForRequestId.get(mDefaultRequest.requestId);
+ }
+
private boolean isDefaultNetwork(NetworkAgentInfo nai) {
- return mNetworkForRequestId.get(mDefaultRequest.requestId) == nai;
+ return nai == getDefaultNetwork();
}
public void registerNetworkAgent(Messenger messenger, NetworkInfo networkInfo,
@@ -4237,7 +4274,7 @@
info.setType(type);
if (connected) {
info.setDetailedState(DetailedState.CONNECTED, null, info.getExtraInfo());
- sendConnectedBroadcastDelayed(info, getConnectivityChangeDelay());
+ sendConnectedBroadcast(info);
} else {
info.setDetailedState(DetailedState.DISCONNECTED, null, info.getExtraInfo());
Intent intent = new Intent(ConnectivityManager.CONNECTIVITY_ACTION);
@@ -4268,10 +4305,9 @@
final Intent immediateIntent = new Intent(intent);
immediateIntent.setAction(CONNECTIVITY_ACTION_IMMEDIATE);
sendStickyBroadcast(immediateIntent);
- sendStickyBroadcastDelayed(intent, getConnectivityChangeDelay());
+ sendStickyBroadcast(intent);
if (newDefaultAgent != null) {
- sendConnectedBroadcastDelayed(newDefaultAgent.networkInfo,
- getConnectivityChangeDelay());
+ sendConnectedBroadcast(newDefaultAgent.networkInfo);
}
}
}
diff --git a/services/core/java/com/android/server/MmsServiceBroker.java b/services/core/java/com/android/server/MmsServiceBroker.java
index b1c4955..83b1919 100644
--- a/services/core/java/com/android/server/MmsServiceBroker.java
+++ b/services/core/java/com/android/server/MmsServiceBroker.java
@@ -207,20 +207,6 @@
return mTelephonyManager;
}
- /*
- * Throws a security exception unless the caller has carrier privilege.
- */
- private void enforceCarrierPrivilege() {
- final String[] packages = getPackageManager().getPackagesForUid(Binder.getCallingUid());
- for (String pkg : packages) {
- if (getTelephonyManager().checkCarrierPrivilegesForPackage(pkg) ==
- TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
- return;
- }
- }
- throw new SecurityException("No carrier privilege");
- }
-
private String getCallingPackageName() {
final String[] packages = getPackageManager().getPackagesForUid(Binder.getCallingUid());
if (packages != null && packages.length > 0) {
@@ -270,19 +256,6 @@
}
@Override
- public void updateMmsSendStatus(int messageRef, byte[] pdu, int status)
- throws RemoteException {
- enforceCarrierPrivilege();
- getServiceGuarded().updateMmsSendStatus(messageRef, pdu, status);
- }
-
- @Override
- public void updateMmsDownloadStatus(int messageRef, int status) throws RemoteException {
- enforceCarrierPrivilege();
- getServiceGuarded().updateMmsDownloadStatus(messageRef, status);
- }
-
- @Override
public Bundle getCarrierConfigValues(int subId) throws RemoteException {
Slog.d(TAG, "getCarrierConfigValues() by " + getCallingPackageName());
return getServiceGuarded().getCarrierConfigValues(subId);
diff --git a/services/core/java/com/android/server/MountServiceIdler.java b/services/core/java/com/android/server/MountServiceIdler.java
index 215d92d..bc851a3 100644
--- a/services/core/java/com/android/server/MountServiceIdler.java
+++ b/services/core/java/com/android/server/MountServiceIdler.java
@@ -98,7 +98,7 @@
private static Calendar tomorrowMidnight() {
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(System.currentTimeMillis());
- calendar.set(Calendar.HOUR, 0);
+ calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 7e17043..6823119 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -37,6 +37,7 @@
import android.app.IActivityContainer;
import android.app.IActivityContainerCallback;
import android.app.IAppTask;
+import android.app.ITaskStackListener;
import android.app.ProfilerInfo;
import android.app.admin.DevicePolicyManager;
import android.app.usage.UsageEvents;
@@ -292,7 +293,7 @@
static final boolean IS_USER_BUILD = "user".equals(Build.TYPE);
// Maximum number recent bitmaps to keep in memory.
- static final int MAX_RECENT_BITMAPS = 5;
+ static final int MAX_RECENT_BITMAPS = 3;
// Amount of time after a call to stopAppSwitches() during which we will
// prevent further untrusted switches from happening.
@@ -370,6 +371,9 @@
static final int LAST_PREBOOT_DELIVERED_FILE_VERSION = 10000;
+ // Delay in notifying task stack change listeners (in millis)
+ static final int NOTIFY_TASK_STACK_CHANGE_LISTENERS_DELAY = 1000;
+
/** All system services */
SystemServiceManager mSystemServiceManager;
@@ -378,6 +382,10 @@
/** Run all ActivityStacks through this */
ActivityStackSupervisor mStackSupervisor;
+ /** Task stack change listeners. */
+ private RemoteCallbackList<ITaskStackListener> mTaskStackListeners =
+ new RemoteCallbackList<ITaskStackListener>();
+
public IntentFirewall mIntentFirewall;
// Whether we should show our dialogs (ANR, crash, etc) or just perform their
@@ -1219,6 +1227,7 @@
static final int START_USER_SWITCH_MSG = 46;
static final int SEND_LOCALE_TO_MOUNT_DAEMON_MSG = 47;
static final int DISMISS_DIALOG_MSG = 48;
+ static final int NOTIFY_TASK_STACK_CHANGE_LISTENERS_MSG = 49;
static final int FIRST_ACTIVITY_STACK_MSG = 100;
static final int FIRST_BROADCAST_QUEUE_MSG = 200;
@@ -1738,6 +1747,22 @@
d.dismiss();
break;
}
+ case NOTIFY_TASK_STACK_CHANGE_LISTENERS_MSG: {
+ synchronized (ActivityManagerService.this) {
+ int i = mTaskStackListeners.beginBroadcast();
+ while (i > 0) {
+ i--;
+ try {
+ // Make a one-way callback to the listener
+ mTaskStackListeners.getBroadcastItem(i).onTaskStackChanged();
+ } catch (RemoteException e){
+ // Handled by the RemoteCallbackList
+ }
+ }
+ mTaskStackListeners.finishBroadcast();
+ }
+ break;
+ }
}
}
};
@@ -2332,6 +2357,16 @@
}
}
+ /** Sets the task stack listener that gets callbacks when a task stack changes. */
+ @Override
+ public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException {
+ synchronized (ActivityManagerService.this) {
+ if (listener != null) {
+ mTaskStackListeners.register(listener);
+ }
+ }
+ }
+
@Override
public void notifyActivityDrawn(IBinder token) {
if (DEBUG_VISBILITY) Slog.d(TAG, "notifyActivityDrawn: token=" + token);
@@ -3643,12 +3678,12 @@
if(DEBUG_TASKS) Slog.i(TAG, "remove RecentTask " + tr
+ " when finishing user" + userId);
mRecentTasks.remove(i);
- tr.removedFromRecents(mTaskPersister);
+ tr.removedFromRecents();
}
}
// Remove tasks from persistent storage.
- mTaskPersister.wakeup(null, true);
+ notifyTaskPersisterLocked(null, true);
}
// Sort by taskId
@@ -3660,7 +3695,7 @@
};
// Extract the affiliates of the chain containing mRecentTasks[start].
- private int processNextAffiliateChain(int start) {
+ private int processNextAffiliateChainLocked(int start) {
final TaskRecord startTask = mRecentTasks.get(start);
final int affiliateId = startTask.mAffiliatedTaskId;
@@ -3695,7 +3730,7 @@
if (first.mNextAffiliate != null) {
Slog.w(TAG, "Link error 1 first.next=" + first.mNextAffiliate);
first.setNextAffiliate(null);
- mTaskPersister.wakeup(first, false);
+ notifyTaskPersisterLocked(first, false);
}
// Everything in the middle is doubly linked from next to prev.
final int tmpSize = mTmpRecents.size();
@@ -3706,13 +3741,13 @@
Slog.w(TAG, "Link error 2 next=" + next + " prev=" + next.mPrevAffiliate +
" setting prev=" + prev);
next.setPrevAffiliate(prev);
- mTaskPersister.wakeup(next, false);
+ notifyTaskPersisterLocked(next, false);
}
if (prev.mNextAffiliate != next) {
Slog.w(TAG, "Link error 3 prev=" + prev + " next=" + prev.mNextAffiliate +
" setting next=" + next);
prev.setNextAffiliate(next);
- mTaskPersister.wakeup(prev, false);
+ notifyTaskPersisterLocked(prev, false);
}
prev.inRecents = true;
}
@@ -3721,7 +3756,7 @@
if (last.mPrevAffiliate != null) {
Slog.w(TAG, "Link error 4 last.prev=" + last.mPrevAffiliate);
last.setPrevAffiliate(null);
- mTaskPersister.wakeup(last, false);
+ notifyTaskPersisterLocked(last, false);
}
// Insert the group back into mRecentTasks at start.
@@ -3762,7 +3797,7 @@
if (task.autoRemoveRecents && task.getTopActivity() == null) {
// This situation is broken, and we should just get rid of it now.
mRecentTasks.remove(i);
- task.removedFromRecents(mTaskPersister);
+ task.removedFromRecents();
i--;
N--;
Slog.w(TAG, "Removing auto-remove without activity: " + task);
@@ -3807,7 +3842,7 @@
if (app == dummyApp || (app.flags&ApplicationInfo.FLAG_INSTALLED) == 0) {
// Doesn't exist any more! Good-bye.
mRecentTasks.remove(i);
- task.removedFromRecents(mTaskPersister);
+ task.removedFromRecents();
i--;
N--;
Slog.w(TAG, "Removing no longer valid recent: " + task);
@@ -3843,7 +3878,7 @@
}
// Verify the affiliate chain for each task.
- for (int i = 0; i < N; i = processNextAffiliateChain(i)) {
+ for (int i = 0; i < N; i = processNextAffiliateChainLocked(i)) {
}
mTmpRecents.clear();
@@ -4009,12 +4044,12 @@
}
if (DEBUG_RECENTS) Slog.d(TAG, "addRecent: trimming tasks for " + task);
- trimRecentsForTask(task, true);
+ trimRecentsForTaskLocked(task, true);
N = mRecentTasks.size();
while (N >= ActivityManager.getMaxRecentTasksStatic()) {
final TaskRecord tr = mRecentTasks.remove(N - 1);
- tr.removedFromRecents(mTaskPersister);
+ tr.removedFromRecents();
N--;
}
task.inRecents = true;
@@ -4079,7 +4114,7 @@
* If needed, remove oldest existing entries in recents that are for the same kind
* of task as the given one.
*/
- int trimRecentsForTask(TaskRecord task, boolean doTrim) {
+ int trimRecentsForTaskLocked(TaskRecord task, boolean doTrim) {
int N = mRecentTasks.size();
final Intent intent = task.intent;
final boolean document = intent != null && intent.isDocument();
@@ -4126,7 +4161,7 @@
tr.disposeThumbnail();
mRecentTasks.remove(i);
if (task != tr) {
- tr.removedFromRecents(mTaskPersister);
+ tr.removedFromRecents();
}
i--;
N--;
@@ -7989,10 +8024,6 @@
return list;
}
- TaskRecord getMostRecentTask() {
- return mRecentTasks.get(0);
- }
-
/**
* Creates a new RecentTaskInfo from a TaskRecord.
*/
@@ -8221,7 +8252,7 @@
TaskRecord task = new TaskRecord(this, mStackSupervisor.getNextTaskId(), ainfo,
intent, description);
- int trimIdx = trimRecentsForTask(task, false);
+ int trimIdx = trimRecentsForTaskLocked(task, false);
if (trimIdx >= 0) {
// If this would have caused a trim, then we'll abort because that
// means it would be added at the end of the list but then just removed.
@@ -8231,7 +8262,7 @@
final int N = mRecentTasks.size();
if (N >= (ActivityManager.getMaxRecentTasksStatic()-1)) {
final TaskRecord tr = mRecentTasks.remove(N - 1);
- tr.removedFromRecents(mTaskPersister);
+ tr.removedFromRecents();
}
task.inRecents = true;
@@ -8291,7 +8322,7 @@
private void cleanUpRemovedTaskLocked(TaskRecord tr, boolean killProcess) {
mRecentTasks.remove(tr);
- tr.removedFromRecents(mTaskPersister);
+ tr.removedFromRecents();
ComponentName component = tr.getBaseIntent().getComponent();
if (component == null) {
Slog.w(TAG, "No component for base intent of task: " + tr);
@@ -9979,6 +10010,7 @@
}
}
+ /** Pokes the task persister. */
void notifyTaskPersisterLocked(TaskRecord task, boolean flush) {
if (task != null && task.stack != null && task.stack.isHomeStack()) {
// Never persist the home stack.
@@ -9987,6 +10019,13 @@
mTaskPersister.wakeup(task, flush);
}
+ /** Notifies all listeners when the task stack has changed. */
+ void notifyTaskStackChangedLocked() {
+ mHandler.removeMessages(NOTIFY_TASK_STACK_CHANGE_LISTENERS_MSG);
+ Message nmsg = mHandler.obtainMessage(NOTIFY_TASK_STACK_CHANGE_LISTENERS_MSG);
+ mHandler.sendMessageDelayed(nmsg, NOTIFY_TASK_STACK_CHANGE_LISTENERS_DELAY);
+ }
+
@Override
public boolean shutdown(int timeout) {
if (checkCallingPermission(android.Manifest.permission.SHUTDOWN)
@@ -10010,12 +10049,12 @@
mBatteryStatsService.shutdown();
synchronized (this) {
mProcessStats.shutdownLocked();
+ notifyTaskPersisterLocked(null, true);
}
- notifyTaskPersisterLocked(null, true);
return timedout;
}
-
+
public final void activitySlept(IBinder token) {
if (localLOGV) Slog.v(TAG, "Activity slept: token=" + token);
diff --git a/services/core/java/com/android/server/am/ActivityRecord.java b/services/core/java/com/android/server/am/ActivityRecord.java
index c12cadb..e37d5f3 100755
--- a/services/core/java/com/android/server/am/ActivityRecord.java
+++ b/services/core/java/com/android/server/am/ActivityRecord.java
@@ -69,7 +69,7 @@
final class ActivityRecord {
static final String TAG = ActivityManagerService.TAG;
static final boolean DEBUG_SAVED_STATE = ActivityStackSupervisor.DEBUG_SAVED_STATE;
- final public static String RECENTS_PACKAGE_NAME = "com.android.systemui.recent";
+ final public static String RECENTS_PACKAGE_NAME = "com.android.systemui.recents";
private static final String TAG_ACTIVITY = "activity";
private static final String ATTR_ID = "id";
@@ -792,7 +792,7 @@
}
}
- void updateThumbnail(Bitmap newThumbnail, CharSequence description) {
+ void updateThumbnailLocked(Bitmap newThumbnail, CharSequence description) {
if (newThumbnail != null) {
if (ActivityManagerService.DEBUG_THUMBNAILS) Slog.i(ActivityManagerService.TAG,
"Setting thumbnail of " + this + " to " + newThumbnail);
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index ea694ada..ad86aea 100755
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -65,7 +65,6 @@
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
-import android.content.res.Resources;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Binder;
@@ -838,7 +837,7 @@
clearLaunchTime(prev);
final ActivityRecord next = mStackSupervisor.topRunningActivityLocked();
if (mService.mHasRecents && (next == null || next.noDisplay || next.task != prev.task || uiSleeping)) {
- prev.updateThumbnail(screenshotActivities(prev), null);
+ prev.updateThumbnailLocked(screenshotActivities(prev), null);
}
stopFullyDrawnTraceIfNeeded();
@@ -950,7 +949,7 @@
r.icicle = icicle;
r.haveState = true;
r.launchCount = 0;
- r.updateThumbnail(null, description);
+ r.updateThumbnailLocked(null, description);
}
if (!r.stopped) {
if (DEBUG_STATES) Slog.v(TAG, "Moving to STOPPED: " + r + " (stop complete)");
@@ -1060,6 +1059,9 @@
}
prev.cpuTimeAtResume = 0; // reset it
}
+
+ // Notfiy when the task stack has changed
+ mService.notifyTaskStackChangedLocked();
}
/**
@@ -4105,7 +4107,7 @@
// Task creator asked to remove this when done, or this task was a voice
// interaction, so it should not remain on the recent tasks list.
mService.mRecentTasks.remove(task);
- task.removedFromRecents(mService.mTaskPersister);
+ task.removedFromRecents();
}
}
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 38809cb..d9396d8 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -2871,6 +2871,7 @@
final TaskRecord task = r.task;
task.setLastThumbnail(task.stack.screenshotActivities(r));
mService.addRecentTaskLocked(task);
+ mService.notifyTaskStackChangedLocked();
mWindowManager.setAppVisibility(r.appToken, false);
}
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index ee93233..d726685 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -383,12 +383,12 @@
setNextAffiliate(null);
}
- void removedFromRecents(TaskPersister persister) {
+ void removedFromRecents() {
disposeThumbnail();
closeRecentsChain();
if (inRecents) {
inRecents = false;
- persister.wakeup(this, false);
+ mService.notifyTaskPersisterLocked(this, false);
}
}
diff --git a/services/core/java/com/android/server/connectivity/NetworkMonitor.java b/services/core/java/com/android/server/connectivity/NetworkMonitor.java
index 225097f..39718ea 100644
--- a/services/core/java/com/android/server/connectivity/NetworkMonitor.java
+++ b/services/core/java/com/android/server/connectivity/NetworkMonitor.java
@@ -215,6 +215,8 @@
// Default to 5s reevaluation delay.
private static final int DEFAULT_REEVALUATE_DELAY_MS = 5000;
private static final int MAX_RETRIES = 10;
+ // Between groups of MAX_RETRIES evaluation attempts, pause 10 mins in hopes ISP outage passes.
+ private static final int REEVALUATE_PAUSE_MS = 10*60*1000;
private final int mReevaluateDelayMs;
private int mReevaluateToken = 0;
private static final int INVALID_UID = -1;
@@ -345,6 +347,7 @@
public void enter() {
mConnectivityServiceHandler.sendMessage(obtainMessage(EVENT_NETWORK_TESTED,
NETWORK_TEST_RESULT_INVALID, 0, mNetworkAgentInfo));
+ if (!mUserDoesNotWant) sendMessageDelayed(CMD_FORCE_REEVALUATION, REEVALUATE_PAUSE_MS);
}
@Override
@@ -360,6 +363,15 @@
return NOT_HANDLED;
}
}
+
+ @Override
+ public void exit() {
+ // NOTE: This removes the delayed message posted by enter() but will inadvertently
+ // remove any other CMD_FORCE_REEVALUATION in the message queue. At the moment this
+ // is harmless. If in the future this becomes problematic a different message could
+ // be used.
+ removeMessages(CMD_FORCE_REEVALUATION);
+ }
}
// Being in the ValidatedState State indicates a Network is:
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java
index 2c8e1dc..ef86c6c 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -429,7 +429,8 @@
if (bluetoothTethered) {
showTetheredNotification(com.android.internal.R.drawable.stat_sys_tether_general);
} else {
- showTetheredNotification(com.android.internal.R.drawable.stat_sys_tether_wifi);
+ /* We now have a status bar icon for WifiTethering, so drop the notification */
+ clearTetheredNotification();
}
} else if (bluetoothTethered) {
showTetheredNotification(com.android.internal.R.drawable.stat_sys_tether_bluetooth);
diff --git a/services/core/java/com/android/server/hdmi/HdmiControlService.java b/services/core/java/com/android/server/hdmi/HdmiControlService.java
index 5f8b389..5df36b4 100644
--- a/services/core/java/com/android/server/hdmi/HdmiControlService.java
+++ b/services/core/java/com/android/server/hdmi/HdmiControlService.java
@@ -993,6 +993,19 @@
mHotplugEventListenerRecords.remove(this);
}
}
+
+ @Override
+ public boolean equals(Object obj) {
+ if (!(obj instanceof HotplugEventListenerRecord)) return false;
+ if (obj == this) return true;
+ HotplugEventListenerRecord other = (HotplugEventListenerRecord) obj;
+ return other.mListener == this.mListener;
+ }
+
+ @Override
+ public int hashCode() {
+ return mListener.hashCode();
+ }
}
private final class DeviceEventListenerRecord implements IBinder.DeathRecipient {
@@ -1549,8 +1562,8 @@
source.queryDisplayStatus(callback);
}
- private void addHotplugEventListener(IHdmiHotplugEventListener listener) {
- HotplugEventListenerRecord record = new HotplugEventListenerRecord(listener);
+ private void addHotplugEventListener(final IHdmiHotplugEventListener listener) {
+ final HotplugEventListenerRecord record = new HotplugEventListenerRecord(listener);
try {
listener.asBinder().linkToDeath(record, 0);
} catch (RemoteException e) {
@@ -1560,6 +1573,24 @@
synchronized (mLock) {
mHotplugEventListenerRecords.add(record);
}
+
+ // Inform the listener of the initial state of each HDMI port by generating
+ // hotplug events.
+ runOnServiceThread(new Runnable() {
+ @Override
+ public void run() {
+ synchronized (mLock) {
+ if (!mHotplugEventListenerRecords.contains(record)) return;
+ }
+ for (HdmiPortInfo port : mPortInfo) {
+ HdmiHotplugEvent event = new HdmiHotplugEvent(port.getId(),
+ mCecController.isConnected(port.getId()));
+ synchronized (mLock) {
+ invokeHotplugEventListenerLocked(listener, event);
+ }
+ }
+ }
+ });
}
private void removeHotplugEventListener(IHdmiHotplugEventListener listener) {
diff --git a/services/core/java/com/android/server/hdmi/PowerStatusMonitorAction.java b/services/core/java/com/android/server/hdmi/PowerStatusMonitorAction.java
index 1e29fd6..fd7a7f9 100644
--- a/services/core/java/com/android/server/hdmi/PowerStatusMonitorAction.java
+++ b/services/core/java/com/android/server/hdmi/PowerStatusMonitorAction.java
@@ -64,10 +64,11 @@
@Override
boolean processCommand(HdmiCecMessage cmd) {
- if (mState != STATE_WAIT_FOR_REPORT_POWER_STATUS) {
- return false;
+ if (mState == STATE_WAIT_FOR_REPORT_POWER_STATUS
+ && cmd.getOpcode() == Constants.MESSAGE_REPORT_POWER_STATUS) {
+ return handleReportPowerStatus(cmd);
}
- return handleReportPowerStatus(cmd);
+ return false;
}
private boolean handleReportPowerStatus(HdmiCecMessage cmd) {
diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java
index 053c988..f11a3f9 100644
--- a/services/core/java/com/android/server/media/MediaSessionService.java
+++ b/services/core/java/com/android/server/media/MediaSessionService.java
@@ -443,7 +443,7 @@
synchronized (mLock) {
List<MediaSessionRecord> records = mPriorityStack.getActiveSessions(userId);
int size = records.size();
- if (size > 0) {
+ if (size > 0 && records.get(0).isPlaybackActive(false)) {
rememberMediaButtonReceiverLocked(records.get(0));
}
ArrayList<MediaSession.Token> tokens = new ArrayList<MediaSession.Token>();
@@ -702,8 +702,12 @@
try {
synchronized (mLock) {
+ // If we don't have a media button receiver to fall back on
+ // include non-playing sessions for dispatching
+ boolean useNotPlayingSessions = mUserRecords.get(
+ ActivityManager.getCurrentUser()).mLastMediaButtonReceiver == null;
MediaSessionRecord session = mPriorityStack
- .getDefaultMediaButtonSession(mCurrentUserId);
+ .getDefaultMediaButtonSession(mCurrentUserId, useNotPlayingSessions);
if (isVoiceKey(keyEvent.getKeyCode())) {
handleVoiceKeyEventLocked(keyEvent, needWakeLock, session);
} else {
diff --git a/services/core/java/com/android/server/media/MediaSessionStack.java b/services/core/java/com/android/server/media/MediaSessionStack.java
index c48a075..611718e 100644
--- a/services/core/java/com/android/server/media/MediaSessionStack.java
+++ b/services/core/java/com/android/server/media/MediaSessionStack.java
@@ -51,6 +51,9 @@
private MediaSessionRecord mGlobalPrioritySession;
+ // The last record that either entered one of the playing states or was
+ // added.
+ private MediaSessionRecord mLastInterestingRecord;
private MediaSessionRecord mCachedButtonReceiver;
private MediaSessionRecord mCachedDefault;
private MediaSessionRecord mCachedVolumeDefault;
@@ -65,6 +68,7 @@
public void addSession(MediaSessionRecord record) {
mSessions.add(record);
clearCache();
+ mLastInterestingRecord = record;
}
/**
@@ -93,6 +97,9 @@
mSessions.remove(record);
mSessions.add(0, record);
clearCache();
+ // This becomes the last interesting record since it entered a
+ // playing state
+ mLastInterestingRecord = record;
return true;
} else if (!MediaSession.isActiveState(newState)) {
// Just clear the volume cache when a state goes inactive
@@ -168,9 +175,11 @@
* Get the highest priority session that can handle media buttons.
*
* @param userId The user to check.
+ * @param includeNotPlaying Return a non-playing session if nothing else is
+ * available
* @return The default media button session or null.
*/
- public MediaSessionRecord getDefaultMediaButtonSession(int userId) {
+ public MediaSessionRecord getDefaultMediaButtonSession(int userId, boolean includeNotPlaying) {
if (mGlobalPrioritySession != null && mGlobalPrioritySession.isActive()) {
return mGlobalPrioritySession;
}
@@ -180,7 +189,25 @@
ArrayList<MediaSessionRecord> records = getPriorityListLocked(true,
MediaSession.FLAG_HANDLES_MEDIA_BUTTONS, userId);
if (records.size() > 0) {
- mCachedButtonReceiver = records.get(0);
+ MediaSessionRecord record = records.get(0);
+ if (record.isPlaybackActive(false)) {
+ // Since we're going to send a button event to this record make
+ // it the last interesting one.
+ mLastInterestingRecord = record;
+ mCachedButtonReceiver = record;
+ } else if (mLastInterestingRecord != null) {
+ if (records.contains(mLastInterestingRecord)) {
+ mCachedButtonReceiver = mLastInterestingRecord;
+ } else {
+ // That record is no longer used. Clear its reference.
+ mLastInterestingRecord = null;
+ }
+ }
+ if (includeNotPlaying && mCachedButtonReceiver == null) {
+ // If we really want a record and we didn't find one yet use the
+ // highest priority session even if it's not playing.
+ mCachedButtonReceiver = record;
+ }
}
return mCachedButtonReceiver;
}
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 323b34b..aec20bc 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -201,8 +201,8 @@
private boolean mDisableNotificationEffects;
private int mCallState;
- NotificationRecord mSoundNotification;
- NotificationRecord mVibrateNotification;
+ private String mSoundNotificationKey;
+ private String mVibrateNotificationKey;
private final ArraySet<ManagedServiceInfo> mListenersDisablingEffects = new ArraySet<>();
private ComponentName mEffectsSuppressor;
@@ -222,8 +222,8 @@
final ArrayList<ToastRecord> mToastQueue = new ArrayList<ToastRecord>();
final ArrayMap<String, NotificationRecord> mSummaryByGroupKey = new ArrayMap<>();
- ArrayList<String> mLights = new ArrayList<String>();
- NotificationRecord mLedNotification;
+ // The last key in this list owns the hardware.
+ ArrayList<String> mLights = new ArrayList<>();
private AppOpsManager mAppOps;
@@ -595,7 +595,7 @@
if (DBG) Slog.d(TAG, "clearEffects");
// sound
- mSoundNotification = null;
+ mSoundNotificationKey = null;
long identity = Binder.clearCallingIdentity();
try {
@@ -609,7 +609,7 @@
}
// vibrate
- mVibrateNotification = null;
+ mVibrateNotificationKey = null;
identity = Binder.clearCallingIdentity();
try {
mVibrator.cancel();
@@ -619,7 +619,6 @@
// light
mLights.clear();
- mLedNotification = null;
updateLightsLocked();
}
}
@@ -1624,14 +1623,19 @@
if (N > 0) {
pw.println(" Lights List:");
for (int i=0; i<N; i++) {
- pw.println(" " + mLights.get(i));
+ if (i == N - 1) {
+ pw.print(" > ");
+ } else {
+ pw.print(" ");
+ }
+ pw.println(mLights.get(i));
}
pw.println(" ");
}
pw.println(" mUseAttentionLight=" + mUseAttentionLight);
pw.println(" mNotificationPulseEnabled=" + mNotificationPulseEnabled);
- pw.println(" mSoundNotification=" + mSoundNotification);
- pw.println(" mVibrateNotification=" + mVibrateNotification);
+ pw.println(" mSoundNotificationKey=" + mSoundNotificationKey);
+ pw.println(" mVibrateNotificationKey=" + mVibrateNotificationKey);
pw.println(" mDisableNotificationEffects=" + mDisableNotificationEffects);
pw.println(" mCallState=" + callStateToString(mCallState));
pw.println(" mSystemReady=" + mSystemReady);
@@ -2058,7 +2062,7 @@
boolean looping =
(notification.flags & Notification.FLAG_INSISTENT) != 0;
AudioAttributes audioAttributes = audioAttributesForNotification(notification);
- mSoundNotification = record;
+ mSoundNotificationKey = record.getKey();
// do not play notifications if stream volume is 0 (typically because
// ringer mode is silent) or if there is a user of exclusive audio focus
if ((mAudioManager.getStreamVolume(
@@ -2101,7 +2105,7 @@
if ((useDefaultVibrate || convertSoundToVibration || hasCustomVibrate)
&& !(mAudioManager.getRingerModeInternal()
== AudioManager.RINGER_MODE_SILENT)) {
- mVibrateNotification = record;
+ mVibrateNotificationKey = record.getKey();
if (useDefaultVibrate || convertSoundToVibration) {
// Escalate privileges so we can use the vibrator even if the
@@ -2132,9 +2136,6 @@
// light
// release the light
boolean wasShowLights = mLights.remove(record.getKey());
- if (mLedNotification != null && record.getKey().equals(mLedNotification.getKey())) {
- mLedNotification = null;
- }
if ((notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0 && aboveThreshold) {
mLights.add(record.getKey());
updateLightsLocked();
@@ -2458,9 +2459,11 @@
mListeners.notifyRemovedLocked(r.sbn);
}
+ final String canceledKey = r.getKey();
+
// sound
- if (mSoundNotification == r) {
- mSoundNotification = null;
+ if (canceledKey.equals(mSoundNotificationKey)) {
+ mSoundNotificationKey = null;
final long identity = Binder.clearCallingIdentity();
try {
final IRingtonePlayer player = mAudioManager.getRingtonePlayer();
@@ -2474,8 +2477,8 @@
}
// vibrate
- if (mVibrateNotification == r) {
- mVibrateNotification = null;
+ if (canceledKey.equals(mVibrateNotificationKey)) {
+ mVibrateNotificationKey = null;
long identity = Binder.clearCallingIdentity();
try {
mVibrator.cancel();
@@ -2486,10 +2489,7 @@
}
// light
- mLights.remove(r.getKey());
- if (mLedNotification == r) {
- mLedNotification = null;
- }
+ mLights.remove(canceledKey);
// Record usage stats
switch (reason) {
@@ -2521,7 +2521,7 @@
// Save it for users of getHistoricalNotifications()
mArchive.record(r.sbn);
- EventLogTags.writeNotificationCanceled(r.getKey(), reason);
+ EventLogTags.writeNotificationCanceled(canceledKey, reason);
}
/**
@@ -2727,20 +2727,22 @@
void updateLightsLocked()
{
// handle notification lights
- if (mLedNotification == null) {
- // get next notification, if any
- int n = mLights.size();
- if (n > 0) {
- mLedNotification = mNotificationsByKey.get(mLights.get(n-1));
+ NotificationRecord ledNotification = null;
+ while (ledNotification == null && !mLights.isEmpty()) {
+ final String owner = mLights.get(mLights.size() - 1);
+ ledNotification = mNotificationsByKey.get(owner);
+ if (ledNotification == null) {
+ Slog.wtfStack(TAG, "LED Notification does not exist: " + owner);
+ mLights.remove(owner);
}
}
// Don't flash while we are in a call or screen is on
- if (mLedNotification == null || mInCall || mScreenOn) {
+ if (ledNotification == null || mInCall || mScreenOn) {
mNotificationLight.turnOff();
mStatusBar.notificationLightOff();
} else {
- final Notification ledno = mLedNotification.sbn.getNotification();
+ final Notification ledno = ledNotification.sbn.getNotification();
int ledARGB = ledno.ledARGB;
int ledOnMS = ledno.ledOnMS;
int ledOffMS = ledno.ledOffMS;
@@ -2956,6 +2958,7 @@
protected void onServiceRemovedLocked(ManagedServiceInfo removed) {
if (mListenersDisablingEffects.remove(removed)) {
updateListenerHintsLocked();
+ updateEffectsSuppressorLocked();
}
mLightTrimListeners.remove(removed);
updateNotificationGroupsDesiredLocked();
diff --git a/services/core/java/com/android/server/notification/RankingHelper.java b/services/core/java/com/android/server/notification/RankingHelper.java
index aeddecb..6a96f85 100644
--- a/services/core/java/com/android/server/notification/RankingHelper.java
+++ b/services/core/java/com/android/server/notification/RankingHelper.java
@@ -227,23 +227,8 @@
notificationList.get(i).setGlobalSortKey(null);
}
- try {
- // rank each record individually
- Collections.sort(notificationList, mPreliminaryComparator);
- } catch (RuntimeException ex) {
- // Don't crash the system server if something bad happened.
- Log.e(TAG, "Extreme badness during notification sort", ex);
- Log.e(TAG, "Current notification list: ");
- for (int i = 0; i < N; i++) {
- NotificationRecord nr = notificationList.get(i);
- Log.e(TAG, String.format(
- " [%d] %s (group %s, rank %d, sortkey %s)",
- i, nr, nr.getGroupKey(), nr.getAuthoritativeRank(),
- nr.getNotification().getSortKey()));
- }
- // STOPSHIP: remove once b/16626175 is found
- throw ex;
- }
+ // rank each record individually
+ Collections.sort(notificationList, mPreliminaryComparator);
synchronized (mProxyByGroupTmp) {
// record individual ranking result and nominate proxies for each group
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 57a89679..6f1e851 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -4539,26 +4539,35 @@
try {
IMountService ms = PackageHelper.getMountService();
if (ms != null) {
- final long interval = android.provider.Settings.Global.getLong(
- mContext.getContentResolver(),
- android.provider.Settings.Global.FSTRIM_MANDATORY_INTERVAL,
- DEFAULT_MANDATORY_FSTRIM_INTERVAL);
- if (interval > 0) {
- final long timeSinceLast = System.currentTimeMillis() - ms.lastMaintenance();
- if (timeSinceLast > interval) {
- Slog.w(TAG, "No disk maintenance in " + timeSinceLast
- + "; running immediately");
- if (!isFirstBoot()) {
- try {
- ActivityManagerNative.getDefault().showBootMessage(
- mContext.getResources().getString(
- R.string.android_upgrading_fstrim), true);
- } catch (RemoteException e) {
- }
+ final boolean isUpgrade = isUpgrade();
+ boolean doTrim = isUpgrade;
+ if (doTrim) {
+ Slog.w(TAG, "Running disk maintenance immediately due to system update");
+ } else {
+ final long interval = android.provider.Settings.Global.getLong(
+ mContext.getContentResolver(),
+ android.provider.Settings.Global.FSTRIM_MANDATORY_INTERVAL,
+ DEFAULT_MANDATORY_FSTRIM_INTERVAL);
+ if (interval > 0) {
+ final long timeSinceLast = System.currentTimeMillis() - ms.lastMaintenance();
+ if (timeSinceLast > interval) {
+ doTrim = true;
+ Slog.w(TAG, "No disk maintenance in " + timeSinceLast
+ + "; running immediately");
}
- ms.runMaintenance();
}
}
+ if (doTrim) {
+ if (!isFirstBoot()) {
+ try {
+ ActivityManagerNative.getDefault().showBootMessage(
+ mContext.getResources().getString(
+ R.string.android_upgrading_fstrim), true);
+ } catch (RemoteException e) {
+ }
+ }
+ ms.runMaintenance();
+ }
} else {
Slog.e(TAG, "Mount service unavailable!");
}
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index f6e8bcf..c0d54e1 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -118,7 +118,7 @@
private static final float RECENTS_THUMBNAIL_FADEOUT_FRACTION = 0.3f;
private static final int DEFAULT_APP_TRANSITION_DURATION = 250;
- private static final int THUMBNAIL_APP_TRANSITION_DURATION = 300;
+ private static final int THUMBNAIL_APP_TRANSITION_DURATION = 325;
private static final int THUMBNAIL_APP_TRANSITION_ALPHA_DURATION = 325;
private final Context mContext;
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 6a55ffc..b7857e1 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -9764,7 +9764,7 @@
w.mContentChanged = false;
// Moved from updateWindowsAndWallpaperLocked().
- if (w.mHasSurface) {
+ if (w.mHasSurface && !w.isHiddenFromUserLocked()) {
// Take care of the window being ready to display.
final boolean committed =
winAnimator.commitFinishDrawingLocked(currentTime);
diff --git a/telecomm/java/android/telecom/AudioState.java b/telecomm/java/android/telecom/AudioState.java
index bd63e00..3271ebf 100644
--- a/telecomm/java/android/telecom/AudioState.java
+++ b/telecomm/java/android/telecom/AudioState.java
@@ -91,7 +91,7 @@
@Override
public String toString() {
return String.format(Locale.US,
- "[AudioState isMuted: %b, route; %s, supportedRouteMask: %s]",
+ "[AudioState isMuted: %b, route: %s, supportedRouteMask: %s]",
isMuted,
audioRouteToString(route),
audioRouteToString(supportedRouteMask));
diff --git a/telecomm/java/android/telecom/Connection.java b/telecomm/java/android/telecom/Connection.java
index 04274c7..f3b0586 100644
--- a/telecomm/java/android/telecom/Connection.java
+++ b/telecomm/java/android/telecom/Connection.java
@@ -838,6 +838,11 @@
return mConnectionCapabilities;
}
+ /** @hide */
+ @SystemApi @Deprecated public final int getCallCapabilities() {
+ return getConnectionCapabilities();
+ }
+
/**
* Sets the value of the {@link #getAddress()} property.
*
diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java
index 8c2a4eb..559a58c 100644
--- a/telephony/java/android/telephony/ServiceState.java
+++ b/telephony/java/android/telephony/ServiceState.java
@@ -167,10 +167,40 @@
private int mVoiceRegState = STATE_OUT_OF_SERVICE;
private int mDataRegState = STATE_OUT_OF_SERVICE;
- private boolean mRoaming;
- private String mOperatorAlphaLong;
- private String mOperatorAlphaShort;
- private String mOperatorNumeric;
+
+ /**
+ * Roaming type
+ * HOME : in home network
+ * @hide
+ */
+ public static final int ROAMING_TYPE_NOT_ROAMING = 0;
+ /**
+ * Roaming type
+ * UNKNOWN : in a roaming network, but we can not tell if it's domestic or international
+ * @hide
+ */
+ public static final int ROAMING_TYPE_UNKNOWN = 1;
+ /**
+ * Roaming type
+ * DOMESTIC : in domestic roaming network
+ * @hide
+ */
+ public static final int ROAMING_TYPE_DOMESTIC = 2;
+ /**
+ * Roaming type
+ * INTERNATIONAL : in international roaming network
+ * @hide
+ */
+ public static final int ROAMING_TYPE_INTERNATIONAL = 3;
+
+ private int mVoiceRoamingType;
+ private int mDataRoamingType;
+ private String mVoiceOperatorAlphaLong;
+ private String mVoiceOperatorAlphaShort;
+ private String mVoiceOperatorNumeric;
+ private String mDataOperatorAlphaLong;
+ private String mDataOperatorAlphaShort;
+ private String mDataOperatorNumeric;
private boolean mIsManualNetworkSelection;
private boolean mIsEmergencyOnly;
@@ -187,6 +217,29 @@
private int mCdmaEriIconMode;
/**
+ * get String description of roaming type
+ * @hide
+ */
+ public static final String getRoamingLogString(int roamingType) {
+ switch (roamingType) {
+ case ROAMING_TYPE_NOT_ROAMING:
+ return "home";
+
+ case ROAMING_TYPE_UNKNOWN:
+ return "roaming";
+
+ case ROAMING_TYPE_DOMESTIC:
+ return "Domestic Roaming";
+
+ case ROAMING_TYPE_INTERNATIONAL:
+ return "International Roaming";
+
+ default:
+ return "UNKNOWN";
+ }
+ }
+
+ /**
* Create a new ServiceState from a intent notifier Bundle
*
* This method is used by PhoneStateIntentReceiver and maybe by
@@ -221,10 +274,14 @@
protected void copyFrom(ServiceState s) {
mVoiceRegState = s.mVoiceRegState;
mDataRegState = s.mDataRegState;
- mRoaming = s.mRoaming;
- mOperatorAlphaLong = s.mOperatorAlphaLong;
- mOperatorAlphaShort = s.mOperatorAlphaShort;
- mOperatorNumeric = s.mOperatorNumeric;
+ mVoiceRoamingType = s.mVoiceRoamingType;
+ mDataRoamingType = s.mDataRoamingType;
+ mVoiceOperatorAlphaLong = s.mVoiceOperatorAlphaLong;
+ mVoiceOperatorAlphaShort = s.mVoiceOperatorAlphaShort;
+ mVoiceOperatorNumeric = s.mVoiceOperatorNumeric;
+ mDataOperatorAlphaLong = s.mDataOperatorAlphaLong;
+ mDataOperatorAlphaShort = s.mDataOperatorAlphaShort;
+ mDataOperatorNumeric = s.mDataOperatorNumeric;
mIsManualNetworkSelection = s.mIsManualNetworkSelection;
mRilVoiceRadioTechnology = s.mRilVoiceRadioTechnology;
mRilDataRadioTechnology = s.mRilDataRadioTechnology;
@@ -244,10 +301,14 @@
public ServiceState(Parcel in) {
mVoiceRegState = in.readInt();
mDataRegState = in.readInt();
- mRoaming = in.readInt() != 0;
- mOperatorAlphaLong = in.readString();
- mOperatorAlphaShort = in.readString();
- mOperatorNumeric = in.readString();
+ mVoiceRoamingType = in.readInt();
+ mDataRoamingType = in.readInt();
+ mVoiceOperatorAlphaLong = in.readString();
+ mVoiceOperatorAlphaShort = in.readString();
+ mVoiceOperatorNumeric = in.readString();
+ mDataOperatorAlphaLong = in.readString();
+ mDataOperatorAlphaShort = in.readString();
+ mDataOperatorNumeric = in.readString();
mIsManualNetworkSelection = in.readInt() != 0;
mRilVoiceRadioTechnology = in.readInt();
mRilDataRadioTechnology = in.readInt();
@@ -264,10 +325,14 @@
public void writeToParcel(Parcel out, int flags) {
out.writeInt(mVoiceRegState);
out.writeInt(mDataRegState);
- out.writeInt(mRoaming ? 1 : 0);
- out.writeString(mOperatorAlphaLong);
- out.writeString(mOperatorAlphaShort);
- out.writeString(mOperatorNumeric);
+ out.writeInt(mVoiceRoamingType);
+ out.writeInt(mDataRoamingType);
+ out.writeString(mVoiceOperatorAlphaLong);
+ out.writeString(mVoiceOperatorAlphaShort);
+ out.writeString(mVoiceOperatorNumeric);
+ out.writeString(mDataOperatorAlphaLong);
+ out.writeString(mDataOperatorAlphaShort);
+ out.writeString(mDataOperatorNumeric);
out.writeInt(mIsManualNetworkSelection ? 1 : 0);
out.writeInt(mRilVoiceRadioTechnology);
out.writeInt(mRilDataRadioTechnology);
@@ -337,10 +402,45 @@
*
* @return true if TS 27.007 7.2 roaming is true
* and ONS is different from SPN
- *
*/
public boolean getRoaming() {
- return mRoaming;
+ return getVoiceRoaming() || getDataRoaming();
+ }
+
+ /**
+ * Get current voice network roaming status
+ * @return roaming status
+ * @hide
+ */
+ public boolean getVoiceRoaming() {
+ return mVoiceRoamingType != ROAMING_TYPE_NOT_ROAMING;
+ }
+
+ /**
+ * Get current voice network roaming type
+ * @return roaming type
+ * @hide
+ */
+ public int getVoiceRoamingType() {
+ return mVoiceRoamingType;
+ }
+
+ /**
+ * Get current data network roaming type
+ * @return roaming type
+ * @hide
+ */
+ public boolean getDataRoaming() {
+ return mDataRoamingType != ROAMING_TYPE_NOT_ROAMING;
+ }
+
+ /**
+ * Get current data network roaming type
+ * @return roaming type
+ * @hide
+ */
+ public int getDataRoamingType() {
+ return mDataRoamingType;
}
/**
@@ -387,7 +487,25 @@
* @return long name of operator, null if unregistered or unknown
*/
public String getOperatorAlphaLong() {
- return mOperatorAlphaLong;
+ return mVoiceOperatorAlphaLong;
+ }
+
+ /**
+ * Get current registered voice network operator name in long alphanumeric format.
+ * @return long name of operator
+ * @hide
+ */
+ public String getVoiceOperatorAlphaLong() {
+ return mVoiceOperatorAlphaLong;
+ }
+
+ /**
+ * Get current registered data network operator name in long alphanumeric format.
+ * @return long name of voice operator
+ * @hide
+ */
+ public String getDataOperatorAlphaLong() {
+ return mDataOperatorAlphaLong;
}
/**
@@ -398,7 +516,25 @@
* @return short name of operator, null if unregistered or unknown
*/
public String getOperatorAlphaShort() {
- return mOperatorAlphaShort;
+ return mVoiceOperatorAlphaShort;
+ }
+
+ /**
+ * Get current registered voice network operator name in short alphanumeric format.
+ * @return short name of operator, null if unregistered or unknown
+ * @hide
+ */
+ public String getVoiceOperatorAlphaShort() {
+ return mVoiceOperatorAlphaShort;
+ }
+
+ /**
+ * Get current registered data network operator name in short alphanumeric format.
+ * @return short name of operator, null if unregistered or unknown
+ * @hide
+ */
+ public String getDataOperatorAlphaShort() {
+ return mDataOperatorAlphaShort;
}
/**
@@ -414,7 +550,25 @@
* {@link com.android.internal.telephony.MccTable#countryCodeForMcc(int)}.
*/
public String getOperatorNumeric() {
- return mOperatorNumeric;
+ return mVoiceOperatorNumeric;
+ }
+
+ /**
+ * Get current registered voice network operator numeric id.
+ * @return numeric format of operator, null if unregistered or unknown
+ * @hide
+ */
+ public String getVoiceOperatorNumeric() {
+ return mVoiceOperatorNumeric;
+ }
+
+ /**
+ * Get current registered data network operator numeric id.
+ * @return numeric format of operator, null if unregistered or unknown
+ * @hide
+ */
+ public String getDataOperatorNumeric() {
+ return mDataOperatorNumeric;
}
/**
@@ -430,11 +584,15 @@
public int hashCode() {
return ((mVoiceRegState * 31)
+ (mDataRegState * 37)
- + (mRoaming ? 1 : 0)
+ + mVoiceRoamingType
+ + mDataRoamingType
+ (mIsManualNetworkSelection ? 1 : 0)
- + ((null == mOperatorAlphaLong) ? 0 : mOperatorAlphaLong.hashCode())
- + ((null == mOperatorAlphaShort) ? 0 : mOperatorAlphaShort.hashCode())
- + ((null == mOperatorNumeric) ? 0 : mOperatorNumeric.hashCode())
+ + ((null == mVoiceOperatorAlphaLong) ? 0 : mVoiceOperatorAlphaLong.hashCode())
+ + ((null == mVoiceOperatorAlphaShort) ? 0 : mVoiceOperatorAlphaShort.hashCode())
+ + ((null == mVoiceOperatorNumeric) ? 0 : mVoiceOperatorNumeric.hashCode())
+ + ((null == mDataOperatorAlphaLong) ? 0 : mDataOperatorAlphaLong.hashCode())
+ + ((null == mDataOperatorAlphaShort) ? 0 : mDataOperatorAlphaShort.hashCode())
+ + ((null == mDataOperatorNumeric) ? 0 : mDataOperatorNumeric.hashCode())
+ mCdmaRoamingIndicator
+ mCdmaDefaultRoamingIndicator
+ (mIsEmergencyOnly ? 1 : 0));
@@ -456,11 +614,15 @@
return (mVoiceRegState == s.mVoiceRegState
&& mDataRegState == s.mDataRegState
- && mRoaming == s.mRoaming
&& mIsManualNetworkSelection == s.mIsManualNetworkSelection
- && equalsHandlesNulls(mOperatorAlphaLong, s.mOperatorAlphaLong)
- && equalsHandlesNulls(mOperatorAlphaShort, s.mOperatorAlphaShort)
- && equalsHandlesNulls(mOperatorNumeric, s.mOperatorNumeric)
+ && mVoiceRoamingType == s.mVoiceRoamingType
+ && mDataRoamingType == s.mDataRoamingType
+ && equalsHandlesNulls(mVoiceOperatorAlphaLong, s.mVoiceOperatorAlphaLong)
+ && equalsHandlesNulls(mVoiceOperatorAlphaShort, s.mVoiceOperatorAlphaShort)
+ && equalsHandlesNulls(mVoiceOperatorNumeric, s.mVoiceOperatorNumeric)
+ && equalsHandlesNulls(mDataOperatorAlphaLong, s.mDataOperatorAlphaLong)
+ && equalsHandlesNulls(mDataOperatorAlphaShort, s.mDataOperatorAlphaShort)
+ && equalsHandlesNulls(mDataOperatorNumeric, s.mDataOperatorNumeric)
&& equalsHandlesNulls(mRilVoiceRadioTechnology, s.mRilVoiceRadioTechnology)
&& equalsHandlesNulls(mRilDataRadioTechnology, s.mRilDataRadioTechnology)
&& equalsHandlesNulls(mCssIndicator, s.mCssIndicator)
@@ -548,10 +710,17 @@
String radioTechnology = rilRadioTechnologyToString(mRilVoiceRadioTechnology);
String dataRadioTechnology = rilRadioTechnologyToString(mRilDataRadioTechnology);
- return (mVoiceRegState + " " + mDataRegState + " " + (mRoaming ? "roaming" : "home")
- + " " + mOperatorAlphaLong
- + " " + mOperatorAlphaShort
- + " " + mOperatorNumeric
+ return (mVoiceRegState + " " + mDataRegState
+ + " "
+ + "voice " + getRoamingLogString(mVoiceRoamingType)
+ + " "
+ + "data " + getRoamingLogString(mDataRoamingType)
+ + " " + mVoiceOperatorAlphaLong
+ + " " + mVoiceOperatorAlphaShort
+ + " " + mVoiceOperatorNumeric
+ + " " + mDataOperatorAlphaLong
+ + " " + mDataOperatorAlphaShort
+ + " " + mDataOperatorNumeric
+ " " + (mIsManualNetworkSelection ? "(manual)" : "")
+ " " + radioTechnology
+ " " + dataRadioTechnology
@@ -567,10 +736,14 @@
if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setNullState=" + state);
mVoiceRegState = state;
mDataRegState = state;
- mRoaming = false;
- mOperatorAlphaLong = null;
- mOperatorAlphaShort = null;
- mOperatorNumeric = null;
+ mVoiceRoamingType = ROAMING_TYPE_NOT_ROAMING;
+ mDataRoamingType = ROAMING_TYPE_NOT_ROAMING;
+ mVoiceOperatorAlphaLong = null;
+ mVoiceOperatorAlphaShort = null;
+ mVoiceOperatorNumeric = null;
+ mDataOperatorAlphaLong = null;
+ mDataOperatorAlphaShort = null;
+ mDataOperatorNumeric = null;
mIsManualNetworkSelection = false;
mRilVoiceRadioTechnology = 0;
mRilDataRadioTechnology = 0;
@@ -610,9 +783,29 @@
}
public void setRoaming(boolean roaming) {
- mRoaming = roaming;
+ mVoiceRoamingType = (roaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
+ mDataRoamingType = mVoiceRoamingType;
}
+ /** @hide */
+ public void setVoiceRoaming(boolean roaming) {
+ mVoiceRoamingType = (roaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
+ }
+
+ /** @hide */
+ public void setVoiceRoamingType(int type) {
+ mVoiceRoamingType = type;
+ }
+
+ /** @hide */
+ public void setDataRoaming(boolean dataRoaming) {
+ mDataRoamingType = (dataRoaming ? ROAMING_TYPE_UNKNOWN : ROAMING_TYPE_NOT_ROAMING);
+ }
+
+ /** @hide */
+ public void setDataRoamingType(int type) {
+ mDataRoamingType = type;
+ }
/**
* @hide
@@ -650,9 +843,26 @@
}
public void setOperatorName(String longName, String shortName, String numeric) {
- mOperatorAlphaLong = longName;
- mOperatorAlphaShort = shortName;
- mOperatorNumeric = numeric;
+ mVoiceOperatorAlphaLong = longName;
+ mVoiceOperatorAlphaShort = shortName;
+ mVoiceOperatorNumeric = numeric;
+ mDataOperatorAlphaLong = longName;
+ mDataOperatorAlphaShort = shortName;
+ mDataOperatorNumeric = numeric;
+ }
+
+ /** @hide */
+ public void setVoiceOperatorName(String longName, String shortName, String numeric) {
+ mVoiceOperatorAlphaLong = longName;
+ mVoiceOperatorAlphaShort = shortName;
+ mVoiceOperatorNumeric = numeric;
+ }
+
+ /** @hide */
+ public void setDataOperatorName(String longName, String shortName, String numeric) {
+ mDataOperatorAlphaLong = longName;
+ mDataOperatorAlphaShort = shortName;
+ mDataOperatorNumeric = numeric;
}
/**
@@ -662,7 +872,18 @@
* @hide
*/
public void setOperatorAlphaLong(String longName) {
- mOperatorAlphaLong = longName;
+ mVoiceOperatorAlphaLong = longName;
+ mDataOperatorAlphaLong = longName;
+ }
+
+ /** @hide */
+ public void setVoiceOperatorAlphaLong(String longName) {
+ mVoiceOperatorAlphaLong = longName;
+ }
+
+ /** @hide */
+ public void setDataOperatorAlphaLong(String longName) {
+ mDataOperatorAlphaLong = longName;
}
public void setIsManualSelection(boolean isManual) {
@@ -689,10 +910,14 @@
private void setFromNotifierBundle(Bundle m) {
mVoiceRegState = m.getInt("voiceRegState");
mDataRegState = m.getInt("dataRegState");
- mRoaming = m.getBoolean("roaming");
- mOperatorAlphaLong = m.getString("operator-alpha-long");
- mOperatorAlphaShort = m.getString("operator-alpha-short");
- mOperatorNumeric = m.getString("operator-numeric");
+ mVoiceRoamingType = m.getInt("voiceRoamingType");
+ mDataRoamingType = m.getInt("dataRoamingType");
+ mVoiceOperatorAlphaLong = m.getString("operator-alpha-long");
+ mVoiceOperatorAlphaShort = m.getString("operator-alpha-short");
+ mVoiceOperatorNumeric = m.getString("operator-numeric");
+ mDataOperatorAlphaLong = m.getString("data-operator-alpha-long");
+ mDataOperatorAlphaShort = m.getString("data-operator-alpha-short");
+ mDataOperatorNumeric = m.getString("data-operator-numeric");
mIsManualNetworkSelection = m.getBoolean("manual");
mRilVoiceRadioTechnology = m.getInt("radioTechnology");
mRilDataRadioTechnology = m.getInt("dataRadioTechnology");
@@ -713,10 +938,14 @@
public void fillInNotifierBundle(Bundle m) {
m.putInt("voiceRegState", mVoiceRegState);
m.putInt("dataRegState", mDataRegState);
- m.putBoolean("roaming", Boolean.valueOf(mRoaming));
- m.putString("operator-alpha-long", mOperatorAlphaLong);
- m.putString("operator-alpha-short", mOperatorAlphaShort);
- m.putString("operator-numeric", mOperatorNumeric);
+ m.putInt("voiceRoamingType", mVoiceRoamingType);
+ m.putInt("dataRoamingType", mDataRoamingType);
+ m.putString("operator-alpha-long", mVoiceOperatorAlphaLong);
+ m.putString("operator-alpha-short", mVoiceOperatorAlphaShort);
+ m.putString("operator-numeric", mVoiceOperatorNumeric);
+ m.putString("data-operator-alpha-long", mDataOperatorAlphaLong);
+ m.putString("data-operator-alpha-short", mDataOperatorAlphaShort);
+ m.putString("data-operator-numeric", mDataOperatorNumeric);
m.putBoolean("manual", Boolean.valueOf(mIsManualNetworkSelection));
m.putInt("radioTechnology", mRilVoiceRadioTechnology);
m.putInt("dataRadioTechnology", mRilDataRadioTechnology);
diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java
index 40d2e77..abf1ead 100644
--- a/telephony/java/android/telephony/SubscriptionManager.java
+++ b/telephony/java/android/telephony/SubscriptionManager.java
@@ -1103,5 +1103,35 @@
return Boolean.parseBoolean(TelephonyManager.getTelephonyProperty(phoneId,
TelephonyProperties.PROPERTY_OPERATOR_ISROAMING, null));
}
+
+ /**
+ * Returns a constant indicating the state of sim for the subscription.
+ *
+ * @param subId
+ *
+ * {@See TelephonyManager#SIM_STATE_UNKNOWN}
+ * {@See TelephonyManager#SIM_STATE_ABSENT}
+ * {@See TelephonyManager#SIM_STATE_PIN_REQUIRED}
+ * {@See TelephonyManager#SIM_STATE_PUK_REQUIRED}
+ * {@See TelephonyManager#SIM_STATE_NETWORK_LOCKED}
+ * {@See TelephonyManager#SIM_STATE_READY}
+ * {@See TelephonyManager#SIM_STATE_NOT_READY}
+ * {@See TelephonyManager#SIM_STATE_PERM_DISABLED}
+ * {@See TelephonyManager#SIM_STATE_CARD_IO_ERROR}
+ *
+ * {@hide}
+ */
+ public static int getSimStateForSubscriber(int subId) {
+ int simState;
+
+ try {
+ ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
+ simState = iSub.getSimStateForSubscriber(subId);
+ } catch (RemoteException ex) {
+ simState = TelephonyManager.SIM_STATE_UNKNOWN;
+ }
+ logd("getSimStateForSubscriber: simState=" + simState + " subId=" + subId);
+ return simState;
+ }
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index de2a6da..751e11b 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -1416,10 +1416,14 @@
//
//
- /** SIM card state: Unknown. Signifies that the SIM is in transition
- * between states. For example, when the user inputs the SIM pin
- * under PIN_REQUIRED state, a query for sim status returns
- * this state before turning to SIM_STATE_READY. */
+ /**
+ * SIM card state: Unknown. Signifies that the SIM is in transition
+ * between states. For example, when the user inputs the SIM pin
+ * under PIN_REQUIRED state, a query for sim status returns
+ * this state before turning to SIM_STATE_READY.
+ *
+ * These are the ordinal value of IccCardConstants.State.
+ */
public static final int SIM_STATE_UNKNOWN = 0;
/** SIM card state: no SIM card is available in the device */
public static final int SIM_STATE_ABSENT = 1;
@@ -1427,14 +1431,22 @@
public static final int SIM_STATE_PIN_REQUIRED = 2;
/** SIM card state: Locked: requires the user's SIM PUK to unlock */
public static final int SIM_STATE_PUK_REQUIRED = 3;
- /** SIM card state: Locked: requries a network PIN to unlock */
+ /** SIM card state: Locked: requires a network PIN to unlock */
public static final int SIM_STATE_NETWORK_LOCKED = 4;
/** SIM card state: Ready */
public static final int SIM_STATE_READY = 5;
- /** SIM card state: SIM Card Error, Sim Card is present but faulty
+ /** SIM card state: SIM Card is NOT READY
*@hide
*/
- public static final int SIM_STATE_CARD_IO_ERROR = 6;
+ public static final int SIM_STATE_NOT_READY = 6;
+ /** SIM card state: SIM Card Error, permanently disabled
+ *@hide
+ */
+ public static final int SIM_STATE_PERM_DISABLED = 7;
+ /** SIM card state: SIM Card Error, present but faulty
+ *@hide
+ */
+ public static final int SIM_STATE_CARD_IO_ERROR = 8;
/**
* @return true if a ICC card is present
@@ -1464,8 +1476,7 @@
}
/**
- * Returns a constant indicating the state of the
- * device SIM card.
+ * Returns a constant indicating the state of the default SIM card.
*
* @see #SIM_STATE_UNKNOWN
* @see #SIM_STATE_ABSENT
@@ -1473,6 +1484,8 @@
* @see #SIM_STATE_PUK_REQUIRED
* @see #SIM_STATE_NETWORK_LOCKED
* @see #SIM_STATE_READY
+ * @see #SIM_STATE_NOT_READY
+ * @see #SIM_STATE_PERM_DISABLED
* @see #SIM_STATE_CARD_IO_ERROR
*/
public int getSimState() {
@@ -1480,10 +1493,9 @@
}
/**
- * Returns a constant indicating the state of the
- * device SIM card in a slot.
+ * Returns a constant indicating the state of the device SIM card in a slot.
*
- * @param slotId
+ * @param slotIdx
*
* @see #SIM_STATE_UNKNOWN
* @see #SIM_STATE_ABSENT
@@ -1491,39 +1503,20 @@
* @see #SIM_STATE_PUK_REQUIRED
* @see #SIM_STATE_NETWORK_LOCKED
* @see #SIM_STATE_READY
+ * @see #SIM_STATE_NOT_READY
+ * @see #SIM_STATE_PERM_DISABLED
+ * @see #SIM_STATE_CARD_IO_ERROR
*/
/** {@hide} */
- // FIXME the argument to pass is subId ??
- public int getSimState(int slotId) {
- int[] subId = SubscriptionManager.getSubId(slotId);
+ public int getSimState(int slotIdx) {
+ int[] subId = SubscriptionManager.getSubId(slotIdx);
if (subId == null || subId.length == 0) {
- return SIM_STATE_ABSENT;
- }
- // FIXME Do not use a property to determine SIM_STATE, call
- // appropriate method on some object.
- int phoneId = SubscriptionManager.getPhoneId(subId[0]);
- String prop = getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_SIM_STATE, "");
- if ("ABSENT".equals(prop)) {
- return SIM_STATE_ABSENT;
- }
- else if ("PIN_REQUIRED".equals(prop)) {
- return SIM_STATE_PIN_REQUIRED;
- }
- else if ("PUK_REQUIRED".equals(prop)) {
- return SIM_STATE_PUK_REQUIRED;
- }
- else if ("NETWORK_LOCKED".equals(prop)) {
- return SIM_STATE_NETWORK_LOCKED;
- }
- else if ("READY".equals(prop)) {
- return SIM_STATE_READY;
- }
- else if ("CARD_IO_ERROR".equals(prop)) {
- return SIM_STATE_CARD_IO_ERROR;
- }
- else {
+ Rlog.d(TAG, "getSimState:- empty subId return SIM_STATE_ABSENT");
return SIM_STATE_UNKNOWN;
}
+ int simState = SubscriptionManager.getSimStateForSubscriber(subId[0]);
+ Rlog.d(TAG, "getSimState: simState=" + simState + " slotIdx=" + slotIdx);
+ return simState;
}
/**
@@ -1535,7 +1528,7 @@
* @see #getSimState
*/
public String getSimOperator() {
- int subId = mSubscriptionManager.getDefaultDataSubId();
+ int subId = SubscriptionManager.getDefaultDataSubId();
if (!SubscriptionManager.isUsableSubIdValue(subId)) {
subId = SubscriptionManager.getDefaultSmsSubId();
if (!SubscriptionManager.isUsableSubIdValue(subId)) {
@@ -2758,8 +2751,6 @@
* @hide
*/
public static void setTelephonyProperty(int phoneId, String property, String value) {
- Rlog.d(TAG, "setTelephonyProperty property: " + property + " phoneId: " + phoneId +
- " value: " + value);
String propVal = "";
String p[] = null;
String prop = SystemProperties.get(property);
@@ -2773,7 +2764,8 @@
}
if (!SubscriptionManager.isValidPhoneId(phoneId)) {
- Rlog.d(TAG, "setTelephonyProperty invalid phone id");
+ Rlog.d(TAG, "setTelephonyProperty: invalid phoneId=" + phoneId +
+ " property=" + property + " value: " + value + " prop=" + prop);
return;
}
@@ -2792,13 +2784,15 @@
}
}
- // TODO: workaround for QC
- if (property.length() > SystemProperties.PROP_NAME_MAX || propVal.length() > SystemProperties.PROP_VALUE_MAX) {
- Rlog.d(TAG, "setTelephonyProperty length too long:" + property + ", " + propVal);
+ if (property.length() > SystemProperties.PROP_NAME_MAX
+ || propVal.length() > SystemProperties.PROP_VALUE_MAX) {
+ Rlog.d(TAG, "setTelephonyProperty: property to long phoneId=" + phoneId +
+ " property=" + property + " value: " + value + " propVal=" + propVal);
return;
}
- Rlog.d(TAG, "setTelephonyProperty property=" + property + " propVal=" + propVal);
+ Rlog.d(TAG, "setTelephonyProperty: success phoneId=" + phoneId +
+ " property=" + property + " value: " + value + " propVal=" + propVal);
SystemProperties.set(property, propVal);
}
@@ -2904,13 +2898,16 @@
propVal = values[phoneId];
}
}
+ Rlog.d(TAG, "getTelephonyProperty: return propVal='" + propVal + "' phoneId=" + phoneId
+ + " property='" + property + "' defaultVal='" + defaultVal + "' prop=" + prop);
return propVal == null ? defaultVal : propVal;
}
/** @hide */
public int getSimCount() {
+ // FIXME Need to get it from Telephony Dev Controller when that gets implemented!
+ // and then this method shouldn't be used at all!
if(isMultiSimEnabled()) {
- //FIXME Need to get it from Telephony Devcontroller
return 2;
} else {
return 1;
diff --git a/telephony/java/com/android/ims/ImsReasonInfo.java b/telephony/java/com/android/ims/ImsReasonInfo.java
index 2ab9648..2482249 100644
--- a/telephony/java/com/android/ims/ImsReasonInfo.java
+++ b/telephony/java/com/android/ims/ImsReasonInfo.java
@@ -195,6 +195,10 @@
public static final int CODE_USER_IGNORE = 503;
// User declines an incoming call
public static final int CODE_USER_DECLINE = 504;
+ // Device declines/ends a call due to low battery
+ public static final int CODE_LOW_BATTERY = 505;
+ // Device declines call due to blacklisted call ID
+ public static final int CODE_BLACKLISTED_CALL_ID = 506;
// IMS -> Telephony
// The call is terminated by the network or remote user
public static final int CODE_USER_TERMINATED_BY_REMOTE = 510;
diff --git a/telephony/java/com/android/internal/telephony/IMms.aidl b/telephony/java/com/android/internal/telephony/IMms.aidl
index 0322499..49ac400 100644
--- a/telephony/java/com/android/internal/telephony/IMms.aidl
+++ b/telephony/java/com/android/internal/telephony/IMms.aidl
@@ -61,40 +61,6 @@
in PendingIntent downloadedIntent);
/**
- * Update the status of a pending (send-by-IP) MMS message handled by the carrier app.
- * If the carrier app fails to send this message, it may be resent via carrier network
- * depending on the status code.
- *
- * The caller should have carrier privileges.
- * @see android.telephony.TelephonyManager.hasCarrierPrivileges
- *
- * @param messageRef the reference number of the MMS message.
- * @param pdu non-empty (contains the SendConf PDU) if the message was sent successfully,
- * otherwise, this param should be null.
- * @param status send status. It can be Activity.RESULT_OK or one of the MMS error codes.
- * If status is Activity.RESULT_OK, the MMS was sent successfully.
- * If status is MMS_ERROR_RETRY, this message would be resent via carrier
- * network. The message will not be resent for other MMS error statuses.
- */
- void updateMmsSendStatus(int messageRef, in byte[] pdu, in int status);
-
- /**
- * Update the status of a pending (download-by-IP) MMS message handled by the carrier app.
- * If the carrier app fails to download this message, it may be re-downloaded via carrier
- * network depending on the status code.
- *
- * The caller should have carrier privileges.
- * @see android.telephony.TelephonyManager.hasCarrierPrivileges
- *
- * @param messageRef the reference number of the MMS message.
- * @param status download status. It can be Activity.RESULT_OK or one of the MMS error codes.
- * If status is Activity.RESULT_OK, the MMS was downloaded successfully.
- * If status is MMS_ERROR_RETRY, this message would be re-downloaded via carrier
- * network. The message will not be re-downloaded for other MMS error statuses.
- */
- void updateMmsDownloadStatus(int messageRef, in int status);
-
- /**
* Get carrier-dependent configuration values.
*
* @param subId the SIM id
diff --git a/telephony/java/com/android/internal/telephony/ISms.aidl b/telephony/java/com/android/internal/telephony/ISms.aidl
index 15fa340..6fdf121 100644
--- a/telephony/java/com/android/internal/telephony/ISms.aidl
+++ b/telephony/java/com/android/internal/telephony/ISms.aidl
@@ -224,17 +224,6 @@
void injectSmsPdu(in byte[] pdu, String format, in PendingIntent receivedIntent);
/**
- * Update the status of a pending (send-by-IP) SMS message and resend by PSTN if necessary.
- * This outbound message was handled by the carrier app. If the carrier app fails to send
- * this message, it would be resent by PSTN.
- *
- * @param messageRef the reference number of the SMS message.
- * @param success True if and only if the message was sent successfully. If its value is
- * false, this message should be resent via PSTN.
- */
- void updateSmsSendStatus(int messageRef, boolean success);
-
- /**
* Send a multi-part text based SMS.
*
* @param destinationAddress the address to send the message to
diff --git a/telephony/java/com/android/internal/telephony/ISub.aidl b/telephony/java/com/android/internal/telephony/ISub.aidl
index ca82083..acbc0aa 100755
--- a/telephony/java/com/android/internal/telephony/ISub.aidl
+++ b/telephony/java/com/android/internal/telephony/ISub.aidl
@@ -164,4 +164,11 @@
void clearDefaultsForInactiveSubIds();
int[] getActiveSubIdList();
+
+ /**
+ * Get the SIM state for the subscriber
+ * @return SIM state as the ordinal of IccCardConstants.State
+ */
+ int getSimStateForSubscriber(int subId);
+
}
diff --git a/telephony/java/com/android/internal/telephony/IccCardConstants.java b/telephony/java/com/android/internal/telephony/IccCardConstants.java
index 8029713..c1e2518 100644
--- a/telephony/java/com/android/internal/telephony/IccCardConstants.java
+++ b/telephony/java/com/android/internal/telephony/IccCardConstants.java
@@ -15,12 +15,14 @@
*/
package com.android.internal.telephony;
+import android.telephony.TelephonyManager;
+
/**
* {@hide}
*/
public class IccCardConstants {
- /* The extra data for broacasting intent INTENT_ICC_STATE_CHANGE */
+ /* The extra data for broadcasting intent INTENT_ICC_STATE_CHANGE */
public static final String INTENT_KEY_ICC_STATE = "ss";
/* UNKNOWN means the ICC state is unknown */
public static final String INTENT_VALUE_ICC_UNKNOWN = "UNKNOWN";
@@ -32,13 +34,17 @@
static public final String INTENT_VALUE_ICC_CARD_IO_ERROR = "CARD_IO_ERROR";
/* LOCKED means ICC is locked by pin or by network */
public static final String INTENT_VALUE_ICC_LOCKED = "LOCKED";
+ //TODO: we can remove this state in the future if Bug 18489776 analysis
+ //#42's first race condition is resolved
+ /* INTERNAL LOCKED means ICC is locked by pin or by network */
+ public static final String INTENT_VALUE_ICC_INTERNAL_LOCKED = "INTERNAL_LOCKED";
/* READY means ICC is ready to access */
public static final String INTENT_VALUE_ICC_READY = "READY";
/* IMSI means ICC IMSI is ready in property */
public static final String INTENT_VALUE_ICC_IMSI = "IMSI";
/* LOADED means all ICC records, including IMSI, are loaded */
public static final String INTENT_VALUE_ICC_LOADED = "LOADED";
- /* The extra data for broacasting intent INTENT_ICC_STATE_CHANGE */
+ /* The extra data for broadcasting intent INTENT_ICC_STATE_CHANGE */
public static final String INTENT_KEY_LOCKED_REASON = "reason";
/* PIN means ICC is locked on PIN1 */
public static final String INTENT_VALUE_LOCKED_ON_PIN = "PIN";
@@ -56,17 +62,19 @@
* UNKNOWN is a transient state, for example, after user inputs ICC pin under
* PIN_REQUIRED state, the query for ICC status returns UNKNOWN before it
* turns to READY
+ *
+ * The ordinal values much match {@link TelephonyManager#SIM_STATE_UNKNOWN} ...
*/
public enum State {
- UNKNOWN,
- ABSENT,
- PIN_REQUIRED,
- PUK_REQUIRED,
- NETWORK_LOCKED,
- READY,
- NOT_READY,
- PERM_DISABLED,
- CARD_IO_ERROR;
+ UNKNOWN, /** ordinal(0) == {@See TelephonyManager#SIM_STATE_UNKNOWN} */
+ ABSENT, /** ordinal(1) == {@See TelephonyManager#SIM_STATE_ABSENT} */
+ PIN_REQUIRED, /** ordinal(2) == {@See TelephonyManager#SIM_STATE_PIN_REQUIRED} */
+ PUK_REQUIRED, /** ordinal(3) == {@See TelephonyManager#SIM_STATE_PUK_REQUIRED} */
+ NETWORK_LOCKED, /** ordinal(4) == {@See TelephonyManager#SIM_STATE_NETWORK_LOCKED} */
+ READY, /** ordinal(5) == {@See TelephonyManager#SIM_STATE_READY} */
+ NOT_READY, /** ordinal(6) == {@See TelephonyManager#SIM_STATE_NOT_READY} */
+ PERM_DISABLED, /** ordinal(7) == {@See TelephonyManager#SIM_STATE_PERM_DISABLED} */
+ CARD_IO_ERROR; /** ordinal(8) == {@See TelephonyManager#SIM_STATE_CARD_IO_ERROR} */
public boolean isPinLocked() {
return ((this == PIN_REQUIRED) || (this == PUK_REQUIRED));
@@ -77,5 +85,21 @@
|| (this == NETWORK_LOCKED) || (this == READY)
|| (this == PERM_DISABLED) || (this == CARD_IO_ERROR));
}
+
+ public static State intToState(int state) throws IllegalArgumentException {
+ switch(state) {
+ case 0: return UNKNOWN;
+ case 1: return ABSENT;
+ case 2: return PIN_REQUIRED;
+ case 3: return PUK_REQUIRED;
+ case 4: return NETWORK_LOCKED;
+ case 5: return READY;
+ case 6: return NOT_READY;
+ case 7: return PERM_DISABLED;
+ case 8: return CARD_IO_ERROR;
+ default:
+ throw new IllegalArgumentException();
+ }
+ }
}
}
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp
index 0d8db13..e3a0200 100644
--- a/tools/aapt/Resource.cpp
+++ b/tools/aapt/Resource.cpp
@@ -2985,17 +2985,26 @@
writeProguardForLayouts(ProguardKeepSet* keep, const sp<AaptAssets>& assets)
{
status_t err;
+ const char* kClass = "class";
+ const char* kFragment = "fragment";
+ const String8 kTransition("transition");
+ const String8 kTransitionPrefix("transition-");
// tag:attribute pairs that should be checked in layout files.
KeyedVector<String8, Vector<NamespaceAttributePair> > kLayoutTagAttrPairs;
- addTagAttrPair(&kLayoutTagAttrPairs, "view", NULL, "class");
- addTagAttrPair(&kLayoutTagAttrPairs, "fragment", NULL, "class");
- addTagAttrPair(&kLayoutTagAttrPairs, "fragment", RESOURCES_ANDROID_NAMESPACE, "name");
+ addTagAttrPair(&kLayoutTagAttrPairs, "view", NULL, kClass);
+ addTagAttrPair(&kLayoutTagAttrPairs, kFragment, NULL, kClass);
+ addTagAttrPair(&kLayoutTagAttrPairs, kFragment, RESOURCES_ANDROID_NAMESPACE, "name");
// tag:attribute pairs that should be checked in xml files.
KeyedVector<String8, Vector<NamespaceAttributePair> > kXmlTagAttrPairs;
- addTagAttrPair(&kXmlTagAttrPairs, "PreferenceScreen", RESOURCES_ANDROID_NAMESPACE, "fragment");
- addTagAttrPair(&kXmlTagAttrPairs, "header", RESOURCES_ANDROID_NAMESPACE, "fragment");
+ addTagAttrPair(&kXmlTagAttrPairs, "PreferenceScreen", RESOURCES_ANDROID_NAMESPACE, kFragment);
+ addTagAttrPair(&kXmlTagAttrPairs, "header", RESOURCES_ANDROID_NAMESPACE, kFragment);
+
+ // tag:attribute pairs that should be checked in transition files.
+ KeyedVector<String8, Vector<NamespaceAttributePair> > kTransitionTagAttrPairs;
+ addTagAttrPair(&kTransitionTagAttrPairs, kTransition.string(), NULL, kClass);
+ addTagAttrPair(&kTransitionTagAttrPairs, "pathMotion", NULL, kClass);
const Vector<sp<AaptDir> >& dirs = assets->resDirs();
const size_t K = dirs.size();
@@ -3014,6 +3023,9 @@
} else if ((dirName == String8("menu")) || (strncmp(dirName.string(), "menu-", 5) == 0)) {
startTags.add(String8("menu"));
tagAttrPairs = NULL;
+ } else if (dirName == kTransition || (strncmp(dirName.string(), kTransitionPrefix.string(),
+ kTransitionPrefix.size()) == 0)) {
+ tagAttrPairs = &kTransitionTagAttrPairs;
} else {
continue;
}
diff --git a/tools/layoutlib/bridge/src/android/content/res/BridgeAssetManager.java b/tools/layoutlib/bridge/src/android/content/res/BridgeAssetManager.java
index 93814b2..c41a4ee 100644
--- a/tools/layoutlib/bridge/src/android/content/res/BridgeAssetManager.java
+++ b/tools/layoutlib/bridge/src/android/content/res/BridgeAssetManager.java
@@ -23,7 +23,7 @@
public class BridgeAssetManager extends AssetManager {
/**
- * This initializes the static field {@link AssetManager#mSystem} which is used
+ * This initializes the static field {@link AssetManager#sSystem} which is used
* by methods who get a global asset manager using {@link AssetManager#getSystem()}.
* <p/>
* They will end up using our bridge asset manager.
diff --git a/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java
index 4993262..ab79664 100644
--- a/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java
+++ b/tools/layoutlib/bridge/src/android/graphics/FontFamily_Delegate.java
@@ -282,7 +282,7 @@
@LayoutlibDelegate
/*package*/ static boolean nAddFontFromAsset(long nativeFamily, AssetManager mgr, String path) {
Bridge.getLog().fidelityWarning(LayoutLog.TAG_UNSUPPORTED,
- "FontFamily.addFontFromAsset is not supported.", null, null);
+ "Typeface.createFromAsset is not supported.", null, null);
return false;
}
diff --git a/tools/layoutlib/bridge/src/android/text/format/Time_Delegate.java b/tools/layoutlib/bridge/src/android/text/format/Time_Delegate.java
deleted file mode 100644
index ed8498f..0000000
--- a/tools/layoutlib/bridge/src/android/text/format/Time_Delegate.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright (C) 2013 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.text.format;
-
-import java.util.Calendar;
-import java.util.TimeZone;
-import java.util.UnknownFormatConversionException;
-import java.util.regex.Pattern;
-
-import com.android.ide.common.rendering.api.LayoutLog;
-import com.android.layoutlib.bridge.Bridge;
-import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
-
-/**
- * Delegate used to provide new implementation for native methods of {@link Time}
- *
- * Through the layoutlib_create tool, some native methods of Time have been replaced by calls to
- * methods of the same name in this delegate class.
- */
-public class Time_Delegate {
-
- // Regex to match odd number of '%'.
- private static final Pattern p = Pattern.compile("(?<!%)(%%)*%(?!%)");
-
- // Format used by toString()
- private static final String FORMAT = "%1$tY%1$tm%1$tdT%1$tH%1$tM%1$tS<%1$tZ>";
-
- // ---- private helper methods ----
-
- private static Calendar timeToCalendar(Time time) {
- Calendar calendar = getCalendarInstance(time);
- calendar.set(time.year, time.month, time.monthDay, time.hour, time.minute, time.second);
- return calendar;
- }
-
- private static void calendarToTime(Calendar c, Time time) {
- time.timezone = c.getTimeZone().getID();
- time.set(c.get(Calendar.SECOND), c.get(Calendar.MINUTE), c.get(Calendar.HOUR_OF_DAY),
- c.get(Calendar.DATE), c.get(Calendar.MONTH), c.get(Calendar.YEAR));
- time.weekDay = c.get(Calendar.DAY_OF_WEEK);
- time.yearDay = c.get(Calendar.DAY_OF_YEAR);
- time.isDst = c.getTimeZone().inDaylightTime(c.getTime()) ? 1 : 0;
- // gmtoff is in seconds and TimeZone.getOffset() returns milliseconds.
- time.gmtoff = c.getTimeZone().getOffset(c.getTimeInMillis()) / DateUtils.SECOND_IN_MILLIS;
- }
-
- /**
- * Return a calendar instance with the correct timezone.
- *
- * @param time Time to obtain the timezone from.
- */
- private static Calendar getCalendarInstance(Time time) {
- // TODO: Check platform code to make sure the behavior is same for null/invalid timezone.
- if (time == null || time.timezone == null) {
- // Default to local timezone.
- return Calendar.getInstance();
- }
- // If timezone is invalid, use GMT.
- return Calendar.getInstance(TimeZone.getTimeZone(time.timezone));
- }
-}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
index ec78712..0af04ec 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -36,6 +36,7 @@
import com.android.tools.layoutlib.create.OverrideMethod;
import com.android.util.Pair;
import com.ibm.icu.util.ULocale;
+import libcore.io.MemoryMappedFile_Delegate;
import android.content.res.BridgeAssetManager;
import android.graphics.Bitmap;
@@ -252,6 +253,7 @@
// load the fonts.
FontFamily_Delegate.setFontLocation(fontLocation.getAbsolutePath());
+ MemoryMappedFile_Delegate.setDataDir(fontLocation.getAbsoluteFile().getParentFile());
// now parse com.android.internal.R (and only this one as android.R is a subset of
// the internal version), and put the content in the maps.
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index e1f24ce..e74debb 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -483,7 +483,7 @@
// In some cases, style may not be a dynamic id, so we do a full search.
ResourceReference ref = resolveId(resid);
if (ref != null) {
- mRenderResources.getStyle(ref.getName(), ref.isFramework());
+ style = mRenderResources.getStyle(ref.getName(), ref.isFramework());
}
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/libcore/io/BridgeBufferIterator.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/libcore/io/BridgeBufferIterator.java
new file mode 100644
index 0000000..7e361a1
--- /dev/null
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/libcore/io/BridgeBufferIterator.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2014 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.layoutlib.bridge.libcore.io;
+
+import java.nio.ByteBuffer;
+
+import libcore.io.BufferIterator;
+
+/**
+ * Provides an implementation of {@link BufferIterator} over a {@link ByteBuffer}.
+ */
+public class BridgeBufferIterator extends BufferIterator {
+
+ private final long mSize;
+ private final ByteBuffer mByteBuffer;
+
+ public BridgeBufferIterator(long size, ByteBuffer buffer) {
+ mSize = size;
+ mByteBuffer = buffer;
+ }
+
+ @Override
+ public void seek(int offset) {
+ assert offset <= mSize;
+ mByteBuffer.position(offset);
+ }
+
+ @Override
+ public void skip(int byteCount) {
+ int newPosition = mByteBuffer.position() + byteCount;
+ assert newPosition <= mSize;
+ mByteBuffer.position(newPosition);
+ }
+
+ @Override
+ public void readByteArray(byte[] dst, int dstOffset, int byteCount) {
+ assert dst.length >= dstOffset + byteCount;
+ mByteBuffer.get(dst, dstOffset, byteCount);
+ }
+
+ @Override
+ public byte readByte() {
+ return mByteBuffer.get();
+ }
+
+ @Override
+ public int readInt() {
+ return mByteBuffer.getInt();
+ }
+
+ @Override
+ public void readIntArray(int[] dst, int dstOffset, int intCount) {
+ while (--intCount >= 0) {
+ dst[dstOffset++] = mByteBuffer.getInt();
+ }
+ }
+
+ @Override
+ public short readShort() {
+ return mByteBuffer.getShort();
+ }
+}
diff --git a/tools/layoutlib/bridge/src/libcore/io/MemoryMappedFile_Delegate.java b/tools/layoutlib/bridge/src/libcore/io/MemoryMappedFile_Delegate.java
new file mode 100644
index 0000000..723d5c4
--- /dev/null
+++ b/tools/layoutlib/bridge/src/libcore/io/MemoryMappedFile_Delegate.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2014 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 libcore.io;
+
+import com.android.layoutlib.bridge.impl.DelegateManager;
+import com.android.layoutlib.bridge.libcore.io.BridgeBufferIterator;
+import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
+
+import android.system.ErrnoException;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.ByteOrder;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel.MapMode;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Delegate used to provide alternate implementation of select methods of {@link MemoryMappedFile}.
+ */
+public class MemoryMappedFile_Delegate {
+
+ private static final DelegateManager<MemoryMappedFile_Delegate> sManager = new
+ DelegateManager<MemoryMappedFile_Delegate>(MemoryMappedFile_Delegate.class);
+
+ private static final Map<MemoryMappedFile, Long> sMemoryMappedFileMap =
+ new HashMap<MemoryMappedFile, Long>();
+
+ private final MappedByteBuffer mMappedByteBuffer;
+ private final long mSize;
+
+ /** Path on the target device where the data file is available. */
+ private static final String TARGET_PATH = System.getenv("ANDROID_ROOT") + "/usr/share/zoneinfo";
+ /** Path on the host (inside the SDK) where the data files are available. */
+ private static File sRootPath;
+
+ @LayoutlibDelegate
+ static MemoryMappedFile mmapRO(String path) throws ErrnoException {
+ if (!path.startsWith(TARGET_PATH)) {
+ throw new ErrnoException("Custom timezone data files are not supported.", 1);
+ }
+ if (sRootPath == null) {
+ throw new ErrnoException("Bridge has not been initialized properly.", 1);
+ }
+ path = path.substring(TARGET_PATH.length());
+ try {
+ File f = new File(sRootPath, path);
+ if (!f.exists()) {
+ throw new ErrnoException("File not found: " + f.getPath(), 1);
+ }
+ RandomAccessFile file = new RandomAccessFile(f, "r");
+ try {
+ long size = file.length();
+ MemoryMappedFile_Delegate newDelegate = new MemoryMappedFile_Delegate(file);
+ long filePointer = file.getFilePointer();
+ MemoryMappedFile mmFile = new MemoryMappedFile(filePointer, size);
+ long delegateIndex = sManager.addNewDelegate(newDelegate);
+ sMemoryMappedFileMap.put(mmFile, delegateIndex);
+ return mmFile;
+ } finally {
+ file.close();
+ }
+ } catch (IOException e) {
+ throw new ErrnoException("mmapRO", 1, e);
+ }
+ }
+
+ @LayoutlibDelegate
+ static void close(MemoryMappedFile thisFile) throws ErrnoException {
+ Long index = sMemoryMappedFileMap.get(thisFile);
+ if (index != null) {
+ sMemoryMappedFileMap.remove(thisFile);
+ sManager.removeJavaReferenceFor(index);
+ }
+ }
+
+ @LayoutlibDelegate
+ static BufferIterator bigEndianIterator(MemoryMappedFile file) {
+ MemoryMappedFile_Delegate delegate = getDelegate(file);
+ return new BridgeBufferIterator(delegate.mSize, delegate.mMappedByteBuffer.duplicate());
+ }
+
+ // TODO: implement littleEndianIterator()
+
+ public MemoryMappedFile_Delegate(RandomAccessFile file) throws IOException {
+ mSize = file.length();
+ // It's weird that map() takes size as long, but returns MappedByteBuffer which uses an int
+ // to store the marker to the position.
+ mMappedByteBuffer = file.getChannel().map(MapMode.READ_ONLY, 0, mSize);
+ assert mMappedByteBuffer.order() == ByteOrder.BIG_ENDIAN;
+ }
+
+ public static void setDataDir(File path) {
+ sRootPath = path;
+ }
+
+ private static MemoryMappedFile_Delegate getDelegate(MemoryMappedFile file) {
+ Long index = sMemoryMappedFileMap.get(file);
+ return index == null ? null : sManager.getDelegate(index);
+ }
+
+}
diff --git a/tools/layoutlib/bridge/src/libcore/util/ZoneInfo_WallTime_Delegate.java b/tools/layoutlib/bridge/src/libcore/util/ZoneInfo_WallTime_Delegate.java
new file mode 100644
index 0000000..f29c5c0
--- /dev/null
+++ b/tools/layoutlib/bridge/src/libcore/util/ZoneInfo_WallTime_Delegate.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2014 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 libcore.util;
+
+import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
+
+import java.util.GregorianCalendar;
+
+/**
+ * Delegate used to provide alternate implementation of select methods in {@link ZoneInfo.WallTime}
+ */
+public class ZoneInfo_WallTime_Delegate {
+
+ @LayoutlibDelegate
+ static GregorianCalendar createGregorianCalendar() {
+ return new GregorianCalendar();
+ }
+}
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
index 4e6f456..5a979e8 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/CreateInfo.java
@@ -21,6 +21,7 @@
import com.android.tools.layoutlib.java.Charsets;
import com.android.tools.layoutlib.java.IntegralToString;
import com.android.tools.layoutlib.java.Objects;
+import com.android.tools.layoutlib.java.System_Delegate;
import com.android.tools.layoutlib.java.UnsafeByteSequence;
import java.util.Arrays;
@@ -131,6 +132,7 @@
IntegralToString.class,
UnsafeByteSequence.class,
Charsets.class,
+ System_Delegate.class,
};
/**
@@ -170,7 +172,11 @@
"com.android.internal.view.menu.MenuBuilder#createNewMenuItem",
"com.android.internal.util.XmlUtils#convertValueToInt",
"com.android.internal.textservice.ITextServicesManager$Stub#asInterface",
- "dalvik.system.VMRuntime#newUnpaddedArray"
+ "dalvik.system.VMRuntime#newUnpaddedArray",
+ "libcore.io.MemoryMappedFile#mmapRO",
+ "libcore.io.MemoryMappedFile#close",
+ "libcore.io.MemoryMappedFile#bigEndianIterator",
+ "libcore.util.ZoneInfo$WallTime#createGregorianCalendar",
};
/**
@@ -261,6 +267,7 @@
"java.nio.charset.Charsets", "com.android.tools.layoutlib.java.Charsets",
"java.lang.IntegralToString", "com.android.tools.layoutlib.java.IntegralToString",
"java.lang.UnsafeByteSequence", "com.android.tools.layoutlib.java.UnsafeByteSequence",
+ "java.nio.charset.StandardCharsets", "com.android.tools.layoutlib.java.Charsets",
};
private final static String[] EXCLUDED_CLASSES =
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/ReplaceMethodCallsAdapter.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/ReplaceMethodCallsAdapter.java
index 9c6fbac..1e2623f 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/ReplaceMethodCallsAdapter.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/ReplaceMethodCallsAdapter.java
@@ -16,6 +16,8 @@
package com.android.tools.layoutlib.create;
+import com.android.tools.layoutlib.java.System_Delegate;
+
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
@@ -47,24 +49,25 @@
private static final String ANDROID_LOCALE_CLASS =
"com/android/layoutlib/bridge/android/AndroidLocale";
- private static final String JAVA_LOCALE_CLASS = "java/util/Locale";
+ private static final String JAVA_LOCALE_CLASS = Type.getInternalName(java.util.Locale.class);
private static final Type STRING = Type.getType(String.class);
+ private static final String JAVA_LANG_SYSTEM = Type.getInternalName(System.class);
+
// Static initialization block to initialize METHOD_REPLACERS.
static {
// Case 1: java.lang.System.arraycopy()
METHOD_REPLACERS.add(new MethodReplacer() {
@Override
public boolean isNeeded(String owner, String name, String desc) {
- return "java/lang/System".equals(owner) && "arraycopy".equals(name) &&
+ return JAVA_LANG_SYSTEM.equals(owner) && "arraycopy".equals(name) &&
ARRAYCOPY_DESCRIPTORS.contains(desc);
}
@Override
- public void replace(int[] opcode, String[] methodInformation) {
- assert methodInformation.length == 3 && isNeeded(methodInformation[0], methodInformation[1], methodInformation[2])
- && opcode.length == 1;
- methodInformation[2] = "(Ljava/lang/Object;ILjava/lang/Object;II)V";
+ public void replace(MethodInformation mi) {
+ assert isNeeded(mi.owner, mi.name, mi.desc);
+ mi.desc = "(Ljava/lang/Object;ILjava/lang/Object;II)V";
}
});
@@ -80,12 +83,11 @@
}
@Override
- public void replace(int[] opcode, String[] methodInformation) {
- assert methodInformation.length == 3 && isNeeded(methodInformation[0], methodInformation[1], methodInformation[2])
- && opcode.length == 1;
- opcode[0] = Opcodes.INVOKESTATIC;
- methodInformation[0] = ANDROID_LOCALE_CLASS;
- methodInformation[2] = LOCALE_TO_STRING;
+ public void replace(MethodInformation mi) {
+ assert isNeeded(mi.owner, mi.name, mi.desc);
+ mi.opcode = Opcodes.INVOKESTATIC;
+ mi.owner = ANDROID_LOCALE_CLASS;
+ mi.desc = LOCALE_TO_STRING;
}
});
@@ -104,10 +106,27 @@
}
@Override
- public void replace(int[] opcode, String[] methodInformation) {
- assert methodInformation.length == 3 && isNeeded(methodInformation[0], methodInformation[1], methodInformation[2])
- && opcode.length == 1;
- methodInformation[0] = ANDROID_LOCALE_CLASS;
+ public void replace(MethodInformation mi) {
+ assert isNeeded(mi.owner, mi.name, mi.desc);
+ mi.owner = ANDROID_LOCALE_CLASS;
+ }
+ });
+
+ // Case 4: java.lang.System.log?()
+ METHOD_REPLACERS.add(new MethodReplacer() {
+ @Override
+ public boolean isNeeded(String owner, String name, String desc) {
+ return JAVA_LANG_SYSTEM.equals(owner) && name.length() == 4
+ && name.startsWith("log");
+ }
+
+ @Override
+ public void replace(MethodInformation mi) {
+ assert isNeeded(mi.owner, mi.name, mi.desc);
+ assert mi.desc.equals("(Ljava/lang/String;Ljava/lang/Throwable;)V")
+ || mi.desc.equals("(Ljava/lang/String;)V");
+ mi.name = "log";
+ mi.owner = Type.getInternalName(System_Delegate.class);
}
});
}
@@ -141,13 +160,12 @@
public void visitMethodInsn(int opcode, String owner, String name, String desc) {
for (MethodReplacer replacer : METHOD_REPLACERS) {
if (replacer.isNeeded(owner, name, desc)) {
- String[] methodInformation = {owner, name, desc};
- int[] opcodeOut = {opcode};
- replacer.replace(opcodeOut, methodInformation);
- opcode = opcodeOut[0];
- owner = methodInformation[0];
- name = methodInformation[1];
- desc = methodInformation[2];
+ MethodInformation mi = new MethodInformation(opcode, owner, name, desc);
+ replacer.replace(mi);
+ opcode = mi.opcode;
+ owner = mi.owner;
+ name = mi.name;
+ desc = mi.desc;
break;
}
}
@@ -155,19 +173,28 @@
}
}
+ private static class MethodInformation {
+ public int opcode;
+ public String owner;
+ public String name;
+ public String desc;
+
+ public MethodInformation(int opcode, String owner, String name, String desc) {
+ this.opcode = opcode;
+ this.owner = owner;
+ this.name = name;
+ this.desc = desc;
+ }
+ }
+
private interface MethodReplacer {
public boolean isNeeded(String owner, String name, String desc);
/**
- * This method must update the arrays with the new values of the method attributes -
+ * Updates the MethodInformation with the new values of the method attributes -
* opcode, owner, name and desc.
- * @param opcode This array should contain the original value of the opcode. The value is
- * modified by the method if needed. The size of the array must be 1.
*
- * @param methodInformation This array should contain the original values of the method
- * attributes - owner, name and desc in that order. The values
- * may be modified as needed. The size of the array must be 3.
*/
- public void replace(int[] opcode, String[] methodInformation);
+ public void replace(MethodInformation mi);
}
}
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/java/System_Delegate.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/java/System_Delegate.java
new file mode 100644
index 0000000..613c8d9
--- /dev/null
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/java/System_Delegate.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2014 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.tools.layoutlib.java;
+
+import com.android.tools.layoutlib.create.ReplaceMethodCallsAdapter;
+
+/**
+ * Provides dummy implementation of methods that don't exist on the host VM.
+ *
+ * @see ReplaceMethodCallsAdapter
+ */
+public class System_Delegate {
+ public static void log(String message) {
+ // ignore.
+ }
+
+ public static void log(String message, Throwable th) {
+ // ignore.
+ }
+}