Merge "Disable Hearing Aid Profile for all platforms except Pixels" into pi-dev
diff --git a/api/removed.txt b/api/removed.txt
index 833d8ec..f35348e 100644
--- a/api/removed.txt
+++ b/api/removed.txt
@@ -321,14 +321,6 @@
public static abstract class NetworkBadging.Badging implements java.lang.annotation.Annotation {
}
- public class NetworkRequest implements android.os.Parcelable {
- method public boolean hasUnwantedCapability(int);
- }
-
- public static class NetworkRequest.Builder {
- method public android.net.NetworkRequest.Builder addUnwantedCapability(int);
- }
-
public class SSLCertificateSocketFactory extends javax.net.ssl.SSLSocketFactory {
method public static deprecated org.apache.http.conn.ssl.SSLSocketFactory getHttpSocketFactory(int, android.net.SSLSessionCache);
}
diff --git a/api/test-current.txt b/api/test-current.txt
index f7bfeae..5cffd0e 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -917,6 +917,7 @@
public class TelephonyManager {
method public int getCarrierIdListVersion();
+ method public void refreshUiccProfile();
method public void setCarrierTestOverride(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String);
field public static final int UNKNOWN_CARRIER_ID_LIST_VERSION = -1; // 0xffffffff
}
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt
index 23b4939..6228473 100644
--- a/config/hiddenapi-light-greylist.txt
+++ b/config/hiddenapi-light-greylist.txt
@@ -1,7 +1,27 @@
Landroid/accounts/AccountManager;->mContext:Landroid/content/Context;
+Landroid/accounts/IAccountAuthenticator$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/accounts/IAccountAuthenticator$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/accounts/IAccountAuthenticator$Stub;->asInterface(Landroid/os/IBinder;)Landroid/accounts/IAccountAuthenticator;
+Landroid/accounts/IAccountAuthenticator;->addAccount(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)V
+Landroid/accounts/IAccountAuthenticator;->confirmCredentials(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Landroid/os/Bundle;)V
+Landroid/accounts/IAccountAuthenticator;->editProperties(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;)V
+Landroid/accounts/IAccountAuthenticator;->getAccountRemovalAllowed(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;)V
+Landroid/accounts/IAccountAuthenticator;->getAuthToken(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;)V
+Landroid/accounts/IAccountAuthenticator;->getAuthTokenLabel(Landroid/accounts/IAccountAuthenticatorResponse;Ljava/lang/String;)V
+Landroid/accounts/IAccountAuthenticator;->hasFeatures(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;[Ljava/lang/String;)V
+Landroid/accounts/IAccountAuthenticator;->updateCredentials(Landroid/accounts/IAccountAuthenticatorResponse;Landroid/accounts/Account;Ljava/lang/String;Landroid/os/Bundle;)V
+Landroid/accounts/IAccountAuthenticatorResponse$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/accounts/IAccountAuthenticatorResponse$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/accounts/IAccountAuthenticatorResponse$Stub;-><init>()V
+Landroid/accounts/IAccountAuthenticatorResponse$Stub;->asInterface(Landroid/os/IBinder;)Landroid/accounts/IAccountAuthenticatorResponse;
Landroid/accounts/IAccountManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/accounts/IAccountManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/accounts/IAccountManager;
+Landroid/accounts/IAccountManagerResponse$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/accounts/IAccountManagerResponse$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/accounts/IAccountManagerResponse$Stub;-><init>()V
+Landroid/accounts/IAccountManagerResponse$Stub;->asInterface(Landroid/os/IBinder;)Landroid/accounts/IAccountManagerResponse;
+Landroid/accounts/IAccountManagerResponse;->onError(ILjava/lang/String;)V
+Landroid/accounts/IAccountManagerResponse;->onResult(Landroid/os/Bundle;)V
Landroid/animation/LayoutTransition;->cancel()V
Landroid/animation/LayoutTransition;->cancel(I)V
Landroid/animation/ValueAnimator;->animateValue(F)V
@@ -12,6 +32,7 @@
Landroid/app/Activity;->mActivityInfo:Landroid/content/pm/ActivityInfo;
Landroid/app/Activity;->mApplication:Landroid/app/Application;
Landroid/app/Activity;->mComponent:Landroid/content/ComponentName;
+Landroid/app/Activity;->mFinished:Z
Landroid/app/Activity;->mFragments:Landroid/app/FragmentController;
Landroid/app/Activity;->mHandler:Landroid/os/Handler;
Landroid/app/Activity;->mInstrumentation:Landroid/app/Instrumentation;
@@ -72,6 +93,7 @@
Landroid/app/ActivityThread$AppBindData;->restrictedBackupMode:Z
Landroid/app/ActivityThread$BindServiceData;->intent:Landroid/content/Intent;
Landroid/app/ActivityThread$BindServiceData;->token:Landroid/os/IBinder;
+Landroid/app/ActivityThread$CreateServiceData;-><init>()V
Landroid/app/ActivityThread$CreateServiceData;->compatInfo:Landroid/content/res/CompatibilityInfo;
Landroid/app/ActivityThread$CreateServiceData;->info:Landroid/content/pm/ServiceInfo;
Landroid/app/ActivityThread$CreateServiceData;->intent:Landroid/content/Intent;
@@ -118,6 +140,7 @@
Landroid/app/ActivityThread;->mAllApplications:Ljava/util/ArrayList;
Landroid/app/ActivityThread;->mBoundApplication:Landroid/app/ActivityThread$AppBindData;
Landroid/app/ActivityThread;->mConfiguration:Landroid/content/res/Configuration;
+Landroid/app/ActivityThread;->mCurDefaultDisplayDpi:I
Landroid/app/ActivityThread;->mDensityCompatMode:Z
Landroid/app/ActivityThread;->mH:Landroid/app/ActivityThread$H;
Landroid/app/ActivityThread;->mInitialApplication:Landroid/app/Application;
@@ -145,6 +168,7 @@
Landroid/app/admin/DevicePolicyManager;->setActiveAdmin(Landroid/content/ComponentName;ZI)V
Landroid/app/admin/DevicePolicyManager;->setDefaultSmsApplication(Landroid/content/ComponentName;Ljava/lang/String;)V
Landroid/app/admin/DevicePolicyManager;->throwIfParentInstance(Ljava/lang/String;)V
+Landroid/app/admin/IDevicePolicyManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/admin/IDevicePolicyManager;
Landroid/app/admin/IDevicePolicyManager$Stub;->TRANSACTION_packageHasActiveAdmins:I
Landroid/app/admin/IDevicePolicyManager$Stub;->TRANSACTION_removeActiveAdmin:I
Landroid/app/admin/SecurityLog$SecurityEvent;-><init>([B)V
@@ -205,6 +229,8 @@
Landroid/app/AppOpsManager;->OP_WRITE_CONTACTS:I
Landroid/app/AppOpsManager;->OP_WRITE_SMS:I
Landroid/app/AppOpsManager;->permissionToOpCode(Ljava/lang/String;)I
+Landroid/app/AppOpsManager;->setRestriction(III[Ljava/lang/String;)V
+Landroid/app/AppOpsManager;->sOpPerms:[Ljava/lang/String;
Landroid/app/AppOpsManager;->strOpToOp(Ljava/lang/String;)I
Landroid/app/backup/BackupDataInput$EntityHeader;->dataSize:I
Landroid/app/backup/BackupDataInput$EntityHeader;->key:Ljava/lang/String;
@@ -218,6 +244,7 @@
Landroid/app/backup/FullBackupDataOutput;-><init>(Landroid/os/ParcelFileDescriptor;)V
Landroid/app/backup/FullBackupDataOutput;->addSize(J)V
Landroid/app/backup/FullBackupDataOutput;->mData:Landroid/app/backup/BackupDataOutput;
+Landroid/app/backup/IBackupManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/backup/IBackupManager;
Landroid/app/ContentProviderHolder;-><init>(Landroid/content/pm/ProviderInfo;)V
Landroid/app/ContentProviderHolder;->info:Landroid/content/pm/ProviderInfo;
Landroid/app/ContentProviderHolder;->provider:Landroid/content/IContentProvider;
@@ -249,6 +276,7 @@
Landroid/app/Dialog;->mListenersHandler:Landroid/os/Handler;
Landroid/app/Dialog;->mOwnerActivity:Landroid/app/Activity;
Landroid/app/Dialog;->mShowMessage:Landroid/os/Message;
+Landroid/app/DialogFragment;->showAllowingStateLoss(Landroid/app/FragmentManager;Ljava/lang/String;)V
Landroid/app/DownloadManager$Request;->mUri:Landroid/net/Uri;
Landroid/app/DownloadManager;->setAccessFilename(Z)V
Landroid/app/Fragment;->mChildFragmentManager:Landroid/app/FragmentManagerImpl;
@@ -272,6 +300,7 @@
Landroid/app/IActivityManager;->getLaunchedFromPackage(Landroid/os/IBinder;)Ljava/lang/String;
Landroid/app/IActivityManager;->getProviderMimeType(Landroid/net/Uri;I)Ljava/lang/String;
Landroid/app/IActivityManager;->getTaskForActivity(Landroid/os/IBinder;Z)I
+Landroid/app/IActivityManager;->moveActivityTaskToBack(Landroid/os/IBinder;Z)Z
Landroid/app/IActivityManager;->moveTaskToFront(IILandroid/os/Bundle;)V
Landroid/app/IActivityManager;->publishContentProviders(Landroid/app/IApplicationThread;Ljava/util/List;)V
Landroid/app/IActivityManager;->requestBugReport(I)V
@@ -283,9 +312,11 @@
Landroid/app/IActivityManager;->unbindService(Landroid/app/IServiceConnection;)Z
Landroid/app/IActivityManager;->unstableProviderDied(Landroid/os/IBinder;)V
Landroid/app/IAlarmManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/app/IAlarmManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/IAlarmManager;
Landroid/app/IAlarmManager$Stub;->TRANSACTION_remove:I
Landroid/app/IAlarmManager$Stub;->TRANSACTION_set:I
Landroid/app/IApplicationThread;->scheduleTrimMemory(I)V
+Landroid/app/IAppTask;->getTaskInfo()Landroid/app/ActivityManager$RecentTaskInfo;
Landroid/app/INotificationManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/INotificationManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/INotificationManager;
Landroid/app/INotificationManager;->cancelAllNotifications(Ljava/lang/String;I)V
@@ -301,12 +332,45 @@
Landroid/app/ISearchManager$Stub$Proxy;->getGlobalSearchActivity()Landroid/content/ComponentName;
Landroid/app/ISearchManager$Stub$Proxy;->getWebSearchActivity()Landroid/content/ComponentName;
Landroid/app/ISearchManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/ISearchManager;
+Landroid/app/IServiceConnection$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/app/IServiceConnection$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/app/IServiceConnection$Stub;-><init>()V
Landroid/app/IServiceConnection$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/IServiceConnection;
+Landroid/app/IStopUserCallback$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/app/IStopUserCallback$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/app/IStopUserCallback$Stub;-><init>()V
Landroid/app/IStopUserCallback;->userStopped(I)V
Landroid/app/IUiModeManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/IWallpaperManager;->getWallpaper(Ljava/lang/String;Landroid/app/IWallpaperManagerCallback;ILandroid/os/Bundle;I)Landroid/os/ParcelFileDescriptor;
+Landroid/app/job/IJobCallback$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/app/job/IJobCallback$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/app/job/IJobCallback$Stub;-><init>()V
+Landroid/app/job/IJobCallback$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/job/IJobCallback;
+Landroid/app/job/IJobCallback;->acknowledgeStartMessage(IZ)V
+Landroid/app/job/IJobCallback;->acknowledgeStopMessage(IZ)V
+Landroid/app/job/IJobCallback;->jobFinished(IZ)V
Landroid/app/job/IJobScheduler$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/app/job/IJobScheduler$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/job/IJobScheduler;
+Landroid/app/job/IJobService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/app/job/IJobService$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/app/job/IJobService$Stub;-><init>()V
+Landroid/app/job/IJobService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/job/IJobService;
+Landroid/app/job/IJobService;->startJob(Landroid/app/job/JobParameters;)V
+Landroid/app/job/IJobService;->stopJob(Landroid/app/job/JobParameters;)V
+Landroid/app/job/JobInfo;->flags:I
+Landroid/app/job/JobInfo;->jobId:I
+Landroid/app/job/JobInfo;->service:Landroid/content/ComponentName;
+Landroid/app/job/JobParameters;->callback:Landroid/os/IBinder;
+Landroid/app/job/JobParameters;->jobId:I
+Landroid/app/LoadedApk$ReceiverDispatcher;->getIIntentReceiver()Landroid/content/IIntentReceiver;
+Landroid/app/LoadedApk$ReceiverDispatcher;->getIntentReceiver()Landroid/content/BroadcastReceiver;
+Landroid/app/LoadedApk$ReceiverDispatcher;->mContext:Landroid/content/Context;
+Landroid/app/LoadedApk$ReceiverDispatcher;->mReceiver:Landroid/content/BroadcastReceiver;
+Landroid/app/LoadedApk$ServiceDispatcher$InnerConnection;->mDispatcher:Ljava/lang/ref/WeakReference;
+Landroid/app/LoadedApk$ServiceDispatcher;-><init>(Landroid/content/ServiceConnection;Landroid/content/Context;Landroid/os/Handler;I)V
+Landroid/app/LoadedApk$ServiceDispatcher;->getIServiceConnection()Landroid/app/IServiceConnection;
+Landroid/app/LoadedApk$ServiceDispatcher;->mConnection:Landroid/content/ServiceConnection;
+Landroid/app/LoadedApk$ServiceDispatcher;->mContext:Landroid/content/Context;
Landroid/app/LoadedApk;->getAssets()Landroid/content/res/AssetManager;
Landroid/app/LoadedApk;->getClassLoader()Ljava/lang/ClassLoader;
Landroid/app/LoadedApk;->getCompatibilityInfo()Landroid/content/res/CompatibilityInfo;
@@ -327,6 +391,7 @@
Landroid/app/LoadedApk;->mReceivers:Landroid/util/ArrayMap;
Landroid/app/LoadedApk;->mResDir:Ljava/lang/String;
Landroid/app/LoadedApk;->mResources:Landroid/content/res/Resources;
+Landroid/app/LoadedApk;->mServices:Landroid/util/ArrayMap;
Landroid/app/LoadedApk;->mSplitResDirs:[Ljava/lang/String;
Landroid/app/LoadedApk;->rewriteRValues(Ljava/lang/ClassLoader;Ljava/lang/String;I)V
Landroid/app/LocalActivityManager;->mActivities:Ljava/util/Map;
@@ -338,6 +403,7 @@
Landroid/app/NativeActivity;->setWindowFlags(II)V
Landroid/app/NativeActivity;->setWindowFormat(I)V
Landroid/app/NativeActivity;->showIme(I)V
+Landroid/app/Notification$Action;->mIcon:Landroid/graphics/drawable/Icon;
Landroid/app/Notification$Builder;->mActions:Ljava/util/ArrayList;
Landroid/app/Notification$Builder;->makePublicContentView()Landroid/widget/RemoteViews;
Landroid/app/Notification$Builder;->setChannel(Ljava/lang/String;)Landroid/app/Notification$Builder;
@@ -355,6 +421,7 @@
Landroid/app/PendingIntent;->getActivityAsUser(Landroid/content/Context;ILandroid/content/Intent;ILandroid/os/Bundle;Landroid/os/UserHandle;)Landroid/app/PendingIntent;
Landroid/app/PendingIntent;->getIntent()Landroid/content/Intent;
Landroid/app/PendingIntent;->isActivity()Z
+Landroid/app/PictureInPictureParams;->getAspectRatio()F
Landroid/app/Presentation;->createPresentationContext(Landroid/content/Context;Landroid/view/Display;I)Landroid/content/Context;
Landroid/app/ProgressDialog;->mProgressNumber:Landroid/widget/TextView;
Landroid/app/QueuedWork;->addFinisher(Ljava/lang/Runnable;)V
@@ -363,8 +430,11 @@
Landroid/app/ResourcesManager;->appendLibAssetForMainAssetPath(Ljava/lang/String;Ljava/lang/String;)V
Landroid/app/ResourcesManager;->getInstance()Landroid/app/ResourcesManager;
Landroid/app/ResourcesManager;->mActivityResourceReferences:Ljava/util/WeakHashMap;
+Landroid/app/ResourcesManager;->mResConfiguration:Landroid/content/res/Configuration;
Landroid/app/ResourcesManager;->mResourceImpls:Landroid/util/ArrayMap;
Landroid/app/ResourcesManager;->mResourceReferences:Ljava/util/ArrayList;
+Landroid/app/ResultInfo;->mData:Landroid/content/Intent;
+Landroid/app/ResultInfo;->mResultWho:Ljava/lang/String;
Landroid/app/Service;->attach(Landroid/content/Context;Landroid/app/ActivityThread;Ljava/lang/String;Landroid/os/IBinder;Landroid/app/Application;Ljava/lang/Object;)V
Landroid/app/Service;->mActivityManager:Landroid/app/IActivityManager;
Landroid/app/Service;->mApplication:Landroid/app/Application;
@@ -410,6 +480,7 @@
Landroid/app/WallpaperManager;->openDefaultWallpaper(Landroid/content/Context;I)Ljava/io/InputStream;
Landroid/app/WallpaperManager;->setBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Rect;ZII)I
Landroid/app/WallpaperManager;->sGlobals:Landroid/app/WallpaperManager$Globals;
+Landroid/appwidget/AppWidgetHost;->sService:Lcom/android/internal/appwidget/IAppWidgetService;
Landroid/appwidget/AppWidgetManager;->bindAppWidgetId(ILandroid/content/ComponentName;)V
Landroid/appwidget/AppWidgetManager;->bindAppWidgetId(ILandroid/content/ComponentName;Landroid/os/Bundle;)V
Landroid/appwidget/AppWidgetManager;->bindAppWidgetIdIfAllowed(IILandroid/content/ComponentName;Landroid/os/Bundle;)Z
@@ -419,6 +490,7 @@
Landroid/bluetooth/BluetoothA2dp;->ACTION_CODEC_CONFIG_CHANGED:Ljava/lang/String;
Landroid/bluetooth/BluetoothA2dp;->connect(Landroid/bluetooth/BluetoothDevice;)Z
Landroid/bluetooth/BluetoothA2dp;->disableOptionalCodecs(Landroid/bluetooth/BluetoothDevice;)V
+Landroid/bluetooth/BluetoothA2dp;->disconnect(Landroid/bluetooth/BluetoothDevice;)Z
Landroid/bluetooth/BluetoothA2dp;->enableOptionalCodecs(Landroid/bluetooth/BluetoothDevice;)V
Landroid/bluetooth/BluetoothA2dp;->getActiveDevice()Landroid/bluetooth/BluetoothDevice;
Landroid/bluetooth/BluetoothA2dp;->getCodecStatus(Landroid/bluetooth/BluetoothDevice;)Landroid/bluetooth/BluetoothCodecStatus;
@@ -521,10 +593,24 @@
Landroid/bluetooth/IBluetooth$Stub;->asInterface(Landroid/os/IBinder;)Landroid/bluetooth/IBluetooth;
Landroid/bluetooth/IBluetooth;->getAddress()Ljava/lang/String;
Landroid/bluetooth/IBluetoothManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/bluetooth/IBluetoothManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/bluetooth/IBluetoothManager;
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/content/AsyncTaskLoader;->mExecutor:Ljava/util/concurrent/Executor;
Landroid/content/BroadcastReceiver$PendingResult;-><init>(ILjava/lang/String;Landroid/os/Bundle;IZZLandroid/os/IBinder;II)V
+Landroid/content/BroadcastReceiver$PendingResult;->mAbortBroadcast:Z
+Landroid/content/BroadcastReceiver$PendingResult;->mFinished:Z
+Landroid/content/BroadcastReceiver$PendingResult;->mFlags:I
+Landroid/content/BroadcastReceiver$PendingResult;->mInitialStickyHint:Z
+Landroid/content/BroadcastReceiver$PendingResult;->mOrderedHint:Z
+Landroid/content/BroadcastReceiver$PendingResult;->mResultCode:I
+Landroid/content/BroadcastReceiver$PendingResult;->mResultData:Ljava/lang/String;
+Landroid/content/BroadcastReceiver$PendingResult;->mResultExtras:Landroid/os/Bundle;
+Landroid/content/BroadcastReceiver$PendingResult;->mSendingUser:I
+Landroid/content/BroadcastReceiver$PendingResult;->mToken:Landroid/os/IBinder;
+Landroid/content/BroadcastReceiver$PendingResult;->mType:I
+Landroid/content/BroadcastReceiver;->getPendingResult()Landroid/content/BroadcastReceiver$PendingResult;
Landroid/content/BroadcastReceiver;->setPendingResult(Landroid/content/BroadcastReceiver$PendingResult;)V
+Landroid/content/ClipData$Item;->mUri:Landroid/net/Uri;
Landroid/content/ContentProvider;->coerceToLocalContentProvider(Landroid/content/IContentProvider;)Landroid/content/ContentProvider;
Landroid/content/ContentProvider;->mContext:Landroid/content/Context;
Landroid/content/ContentProvider;->mPathPermissions:[Landroid/content/pm/PathPermission;
@@ -535,6 +621,7 @@
Landroid/content/ContentProviderClient;->mPackageName:Ljava/lang/String;
Landroid/content/ContentProviderOperation;->mSelection:Ljava/lang/String;
Landroid/content/ContentProviderOperation;->mType:I
+Landroid/content/ContentProviderOperation;->mUri:Landroid/net/Uri;
Landroid/content/ContentProviderOperation;->TYPE_DELETE:I
Landroid/content/ContentProviderOperation;->TYPE_INSERT:I
Landroid/content/ContentProviderOperation;->TYPE_UPDATE:I
@@ -571,11 +658,28 @@
Landroid/content/IContentService;->cancelSync(Landroid/accounts/Account;Ljava/lang/String;Landroid/content/ComponentName;)V
Landroid/content/IContentService;->getMasterSyncAutomatically()Z
Landroid/content/IContentService;->setMasterSyncAutomatically(Z)V
+Landroid/content/IIntentReceiver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/IIntentReceiver$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/content/IIntentReceiver$Stub;-><init>()V
+Landroid/content/IIntentReceiver;->performReceive(Landroid/content/Intent;ILjava/lang/String;Landroid/os/Bundle;ZZI)V
Landroid/content/Intent;->ACTION_ALARM_CHANGED:Ljava/lang/String;
Landroid/content/Intent;->mExtras:Landroid/os/Bundle;
+Landroid/content/Intent;->prepareToLeaveProcess(Landroid/content/Context;)V
Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/IBinder;)Landroid/content/Intent;
+Landroid/content/Intent;->setAllowFds(Z)V
Landroid/content/Intent;->toInsecureString()Ljava/lang/String;
Landroid/content/IntentFilter;->mActions:Ljava/util/ArrayList;
+Landroid/content/IntentSender;-><init>(Landroid/content/IIntentSender;)V
+Landroid/content/IntentSender;->mTarget:Landroid/content/IIntentSender;
+Landroid/content/IRestrictionsManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/IRestrictionsManager;
+Landroid/content/ISyncAdapter$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/ISyncAdapter$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/content/ISyncContext$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/ISyncContext$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/content/ISyncContext$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/ISyncContext;
+Landroid/content/ISyncStatusObserver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/ISyncStatusObserver$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/content/pm/ActivityInfo;->isResizeableMode(I)Z
Landroid/content/pm/ActivityInfo;->resizeMode:I
Landroid/content/pm/ActivityInfo;->supportsPictureInPicture()Z
Landroid/content/pm/ApplicationInfo;->enabledSetting:I
@@ -590,7 +694,30 @@
Landroid/content/pm/ApplicationInfo;->secondaryNativeLibraryDir:Ljava/lang/String;
Landroid/content/pm/ApplicationInfo;->versionCode:I
Landroid/content/pm/ComponentInfo;->getComponentName()Landroid/content/ComponentName;
+Landroid/content/pm/IPackageDataObserver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/pm/IPackageDataObserver$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/pm/IPackageDataObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageDataObserver;
+Landroid/content/pm/IPackageDataObserver;->onRemoveCompleted(Ljava/lang/String;Z)V
+Landroid/content/pm/IPackageDeleteObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageDeleteObserver;
+Landroid/content/pm/IPackageDeleteObserver2$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/pm/IPackageDeleteObserver2$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/content/pm/IPackageDeleteObserver2;->onPackageDeleted(Ljava/lang/String;ILjava/lang/String;)V
+Landroid/content/pm/IPackageInstallerCallback$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/pm/IPackageInstallerCallback$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/content/pm/IPackageInstallerCallback$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageInstallerCallback;
+Landroid/content/pm/IPackageInstallerCallback;->onSessionActiveChanged(IZ)V
+Landroid/content/pm/IPackageInstallerCallback;->onSessionBadgingChanged(I)V
+Landroid/content/pm/IPackageInstallerCallback;->onSessionCreated(I)V
+Landroid/content/pm/IPackageInstallerCallback;->onSessionFinished(IZ)V
+Landroid/content/pm/IPackageInstallerCallback;->onSessionProgressChanged(IF)V
+Landroid/content/pm/IPackageInstallerSession$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/pm/IPackageInstallerSession$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/content/pm/IPackageInstallerSession$Stub;-><init>()V
+Landroid/content/pm/IPackageInstallerSession$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageInstallerSession;
+Landroid/content/pm/IPackageInstallObserver2$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/pm/IPackageInstallObserver2$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/content/pm/IPackageInstallObserver2$Stub;-><init>()V
+Landroid/content/pm/IPackageInstallObserver2;->onPackageInstalled(Ljava/lang/String;ILjava/lang/String;Landroid/os/Bundle;)V
Landroid/content/pm/IPackageManager$Stub$Proxy;->getInstalledPackages(II)Landroid/content/pm/ParceledListSlice;
Landroid/content/pm/IPackageManager$Stub$Proxy;->getPackageInfo(Ljava/lang/String;II)Landroid/content/pm/PackageInfo;
Landroid/content/pm/IPackageManager$Stub$Proxy;->getPackagesForUid(I)[Ljava/lang/String;
@@ -612,12 +739,34 @@
Landroid/content/pm/IPackageManager;->setLastChosenActivity(Landroid/content/Intent;Ljava/lang/String;ILandroid/content/IntentFilter;ILandroid/content/ComponentName;)V
Landroid/content/pm/IPackageMoveObserver$Stub;-><init>()V
Landroid/content/pm/IPackageMoveObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageMoveObserver;
+Landroid/content/pm/IPackageStatsObserver$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/pm/IPackageStatsObserver$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/content/pm/IPackageStatsObserver$Stub;-><init>()V
+Landroid/content/pm/IPackageStatsObserver$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IPackageStatsObserver;
Landroid/content/pm/IShortcutService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/content/pm/IShortcutService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/content/pm/IShortcutService;
Landroid/content/pm/LauncherActivityInfo;->mActivityInfo:Landroid/content/pm/ActivityInfo;
Landroid/content/pm/LauncherApps;->mPm:Landroid/content/pm/PackageManager;
Landroid/content/pm/LauncherApps;->startShortcut(Ljava/lang/String;Ljava/lang/String;Landroid/graphics/Rect;Landroid/os/Bundle;I)V
Landroid/content/pm/PackageInfo;->INSTALL_LOCATION_UNSPECIFIED:I
+Landroid/content/pm/PackageInstaller$SessionInfo;-><init>()V
+Landroid/content/pm/PackageInstaller$SessionInfo;->active:Z
+Landroid/content/pm/PackageInstaller$SessionInfo;->appIcon:Landroid/graphics/Bitmap;
+Landroid/content/pm/PackageInstaller$SessionInfo;->appLabel:Ljava/lang/CharSequence;
+Landroid/content/pm/PackageInstaller$SessionInfo;->appPackageName:Ljava/lang/String;
+Landroid/content/pm/PackageInstaller$SessionInfo;->installerPackageName:Ljava/lang/String;
+Landroid/content/pm/PackageInstaller$SessionInfo;->mode:I
+Landroid/content/pm/PackageInstaller$SessionInfo;->progress:F
+Landroid/content/pm/PackageInstaller$SessionInfo;->resolvedBaseCodePath:Ljava/lang/String;
+Landroid/content/pm/PackageInstaller$SessionInfo;->sealed:Z
+Landroid/content/pm/PackageInstaller$SessionInfo;->sessionId:I
+Landroid/content/pm/PackageInstaller$SessionInfo;->sizeBytes:J
+Landroid/content/pm/PackageInstaller$SessionParams;->appIcon:Landroid/graphics/Bitmap;
+Landroid/content/pm/PackageInstaller$SessionParams;->appLabel:Ljava/lang/String;
+Landroid/content/pm/PackageInstaller$SessionParams;->appPackageName:Ljava/lang/String;
+Landroid/content/pm/PackageInstaller$SessionParams;->installFlags:I
+Landroid/content/pm/PackageInstaller$SessionParams;->mode:I
+Landroid/content/pm/PackageInstaller$SessionParams;->sizeBytes:J
Landroid/content/pm/PackageItemInfo;->setForceSafeLabels(Z)V
Landroid/content/pm/PackageManager;->buildRequestPermissionsIntent([Ljava/lang/String;)Landroid/content/Intent;
Landroid/content/pm/PackageManager;->freeStorage(JLandroid/content/IntentSender;)V
@@ -625,6 +774,7 @@
Landroid/content/pm/PackageManager;->freeStorageAndNotify(JLandroid/content/pm/IPackageDataObserver;)V
Landroid/content/pm/PackageManager;->freeStorageAndNotify(Ljava/lang/String;JLandroid/content/pm/IPackageDataObserver;)V
Landroid/content/pm/PackageManager;->getApplicationInfoAsUser(Ljava/lang/String;II)Landroid/content/pm/ApplicationInfo;
+Landroid/content/pm/PackageManager;->getHomeActivities(Ljava/util/List;)Landroid/content/ComponentName;
Landroid/content/pm/PackageManager;->getPackageCandidateVolumes(Landroid/content/pm/ApplicationInfo;)Ljava/util/List;
Landroid/content/pm/PackageManager;->getPackageInfoAsUser(Ljava/lang/String;II)Landroid/content/pm/PackageInfo;
Landroid/content/pm/PackageManager;->getPackageSizeInfo(Ljava/lang/String;Landroid/content/pm/IPackageStatsObserver;)V
@@ -637,6 +787,7 @@
Landroid/content/pm/PackageParser$Component;->className:Ljava/lang/String;
Landroid/content/pm/PackageParser$Component;->getComponentName()Landroid/content/ComponentName;
Landroid/content/pm/PackageParser$Component;->intents:Ljava/util/ArrayList;
+Landroid/content/pm/PackageParser$Component;->metaData:Landroid/os/Bundle;
Landroid/content/pm/PackageParser$Instrumentation;->info:Landroid/content/pm/InstrumentationInfo;
Landroid/content/pm/PackageParser$IntentInfo;-><init>()V
Landroid/content/pm/PackageParser$IntentInfo;->banner:I
@@ -647,8 +798,13 @@
Landroid/content/pm/PackageParser$IntentInfo;->nonLocalizedLabel:Ljava/lang/CharSequence;
Landroid/content/pm/PackageParser$Package;->activities:Ljava/util/ArrayList;
Landroid/content/pm/PackageParser$Package;->applicationInfo:Landroid/content/pm/ApplicationInfo;
+Landroid/content/pm/PackageParser$Package;->configPreferences:Ljava/util/ArrayList;
Landroid/content/pm/PackageParser$Package;->instrumentation:Ljava/util/ArrayList;
Landroid/content/pm/PackageParser$Package;->mAppMetaData:Landroid/os/Bundle;
+Landroid/content/pm/PackageParser$Package;->mKeySetMapping:Landroid/util/ArrayMap;
+Landroid/content/pm/PackageParser$Package;->mPreferredOrder:I
+Landroid/content/pm/PackageParser$Package;->mSharedUserId:Ljava/lang/String;
+Landroid/content/pm/PackageParser$Package;->mSharedUserLabel:I
Landroid/content/pm/PackageParser$Package;->mVersionCode:I
Landroid/content/pm/PackageParser$Package;->mVersionName:Ljava/lang/String;
Landroid/content/pm/PackageParser$Package;->packageName:Ljava/lang/String;
@@ -656,8 +812,11 @@
Landroid/content/pm/PackageParser$Package;->permissions:Ljava/util/ArrayList;
Landroid/content/pm/PackageParser$Package;->providers:Ljava/util/ArrayList;
Landroid/content/pm/PackageParser$Package;->receivers:Ljava/util/ArrayList;
+Landroid/content/pm/PackageParser$Package;->reqFeatures:Ljava/util/ArrayList;
Landroid/content/pm/PackageParser$Package;->requestedPermissions:Ljava/util/ArrayList;
Landroid/content/pm/PackageParser$Package;->services:Ljava/util/ArrayList;
+Landroid/content/pm/PackageParser$Package;->usesLibraries:Ljava/util/ArrayList;
+Landroid/content/pm/PackageParser$Package;->usesOptionalLibraries:Ljava/util/ArrayList;
Landroid/content/pm/PackageParser$Provider;->info:Landroid/content/pm/ProviderInfo;
Landroid/content/pm/PackageParser$ProviderIntentInfo;->provider:Landroid/content/pm/PackageParser$Provider;
Landroid/content/pm/PackageParser$Service;->info:Landroid/content/pm/ServiceInfo;
@@ -666,8 +825,12 @@
Landroid/content/pm/PackageParser;->collectCertificates(Landroid/content/pm/PackageParser$Package;Ljava/io/File;Z)V
Landroid/content/pm/PackageParser;->collectCertificates(Landroid/content/pm/PackageParser$Package;Z)V
Landroid/content/pm/PackageParser;->generateActivityInfo(Landroid/content/pm/PackageParser$Activity;ILandroid/content/pm/PackageUserState;I)Landroid/content/pm/ActivityInfo;
+Landroid/content/pm/PackageParser;->generateApplicationInfo(Landroid/content/pm/PackageParser$Package;ILandroid/content/pm/PackageUserState;I)Landroid/content/pm/ApplicationInfo;
+Landroid/content/pm/PackageParser;->generateInstrumentationInfo(Landroid/content/pm/PackageParser$Instrumentation;I)Landroid/content/pm/InstrumentationInfo;
Landroid/content/pm/PackageParser;->generatePackageInfo(Landroid/content/pm/PackageParser$Package;[IIJJLjava/util/Set;Landroid/content/pm/PackageUserState;)Landroid/content/pm/PackageInfo;
Landroid/content/pm/PackageParser;->generatePackageInfo(Landroid/content/pm/PackageParser$Package;[IIJJLjava/util/Set;Landroid/content/pm/PackageUserState;I)Landroid/content/pm/PackageInfo;
+Landroid/content/pm/PackageParser;->generatePermissionGroupInfo(Landroid/content/pm/PackageParser$PermissionGroup;I)Landroid/content/pm/PermissionGroupInfo;
+Landroid/content/pm/PackageParser;->generatePermissionInfo(Landroid/content/pm/PackageParser$Permission;I)Landroid/content/pm/PermissionInfo;
Landroid/content/pm/PackageParser;->generateProviderInfo(Landroid/content/pm/PackageParser$Provider;ILandroid/content/pm/PackageUserState;I)Landroid/content/pm/ProviderInfo;
Landroid/content/pm/PackageParser;->generateServiceInfo(Landroid/content/pm/PackageParser$Service;ILandroid/content/pm/PackageUserState;I)Landroid/content/pm/ServiceInfo;
Landroid/content/pm/PackageParser;->parseBaseApk(Ljava/lang/String;Landroid/content/res/Resources;Landroid/content/res/XmlResourceParser;I[Ljava/lang/String;)Landroid/content/pm/PackageParser$Package;
@@ -679,6 +842,8 @@
Landroid/content/pm/ResolveInfo;->instantAppAvailable:Z
Landroid/content/pm/ShortcutManager;->mService:Landroid/content/pm/IShortcutService;
Landroid/content/pm/Signature;->getPublicKey()Ljava/security/PublicKey;
+Landroid/content/pm/UserInfo;-><init>(ILjava/lang/String;I)V
+Landroid/content/pm/UserInfo;->FLAG_PRIMARY:I
Landroid/content/pm/UserInfo;->id:I
Landroid/content/pm/UserInfo;->isPrimary()Z
Landroid/content/pm/UserInfo;->serialNumber:I
@@ -713,6 +878,7 @@
Landroid/content/res/ColorStateList;->mFactory:Landroid/content/res/ColorStateList$ColorStateListFactory;
Landroid/content/res/ColorStateList;->mStateSpecs:[[I
Landroid/content/res/ColorStateList;->onColorsChanged()V
+Landroid/content/res/CompatibilityInfo;-><init>(Landroid/content/pm/ApplicationInfo;IIZ)V
Landroid/content/res/CompatibilityInfo;->applicationScale:F
Landroid/content/res/CompatibilityInfo;->DEFAULT_COMPATIBILITY_INFO:Landroid/content/res/CompatibilityInfo;
Landroid/content/res/DrawableCache;-><init>()V
@@ -731,6 +897,7 @@
Landroid/content/res/Resources;->setCompatibilityInfo(Landroid/content/res/CompatibilityInfo;)V
Landroid/content/res/Resources;->updateSystemConfiguration(Landroid/content/res/Configuration;Landroid/util/DisplayMetrics;Landroid/content/res/CompatibilityInfo;)V
Landroid/content/res/ResourcesImpl;->getAssets()Landroid/content/res/AssetManager;
+Landroid/content/res/ResourcesImpl;->getValue(ILandroid/util/TypedValue;Z)V
Landroid/content/res/ResourcesImpl;->mAccessLock:Ljava/lang/Object;
Landroid/content/res/ResourcesImpl;->mAnimatorCache:Landroid/content/res/ConfigurationBoundResourceCache;
Landroid/content/res/ResourcesImpl;->mAssets:Landroid/content/res/AssetManager;
@@ -764,9 +931,31 @@
Landroid/content/res/XmlBlock$Parser;->mParseState:J
Landroid/content/res/XmlBlock;-><init>([B)V
Landroid/content/res/XmlBlock;->newParser()Landroid/content/res/XmlResourceParser;
+Landroid/content/RestrictionsManager;->mService:Landroid/content/IRestrictionsManager;
Landroid/content/SearchRecentSuggestionsProvider;->mSuggestionProjection:[Ljava/lang/String;
+Landroid/content/SyncAdapterType;->allowParallelSyncs:Z
+Landroid/content/SyncAdapterType;->isAlwaysSyncable:Z
+Landroid/content/SyncAdapterType;->settingsActivity:Ljava/lang/String;
Landroid/content/SyncContext;->setStatusText(Ljava/lang/String;)V
+Landroid/content/SyncInfo;-><init>(ILandroid/accounts/Account;Ljava/lang/String;J)V
+Landroid/content/SyncRequest;->mAccountToSync:Landroid/accounts/Account;
+Landroid/content/SyncRequest;->mAuthority:Ljava/lang/String;
+Landroid/content/SyncRequest;->mExtras:Landroid/os/Bundle;
+Landroid/content/SyncRequest;->mIsPeriodic:Z
+Landroid/content/SyncRequest;->mSyncRunTimeSecs:J
+Landroid/content/SyncStatusInfo;-><init>(Landroid/os/Parcel;)V
+Landroid/content/SyncStatusInfo;->authorityId:I
+Landroid/content/SyncStatusInfo;->CREATOR:Landroid/os/Parcelable$Creator;
+Landroid/content/SyncStatusInfo;->ensurePeriodicSyncTimeSize(I)V
+Landroid/content/SyncStatusInfo;->initialFailureTime:J
+Landroid/content/SyncStatusInfo;->initialize:Z
+Landroid/content/SyncStatusInfo;->lastFailureMesg:Ljava/lang/String;
+Landroid/content/SyncStatusInfo;->lastFailureSource:I
+Landroid/content/SyncStatusInfo;->lastFailureTime:J
+Landroid/content/SyncStatusInfo;->lastSuccessSource:I
Landroid/content/SyncStatusInfo;->lastSuccessTime:J
+Landroid/content/SyncStatusInfo;->pending:Z
+Landroid/content/SyncStatusInfo;->periodicSyncTimes:Ljava/util/ArrayList;
Landroid/content/UriMatcher;->mChildren:Ljava/util/ArrayList;
Landroid/content/UriMatcher;->mText:Ljava/lang/String;
Landroid/database/AbstractCursor;->mExtras:Landroid/os/Bundle;
@@ -791,6 +980,7 @@
Landroid/database/sqlite/SQLiteOpenHelper;->mName:Ljava/lang/String;
Landroid/database/sqlite/SQLiteStatement;-><init>(Landroid/database/sqlite/SQLiteDatabase;Ljava/lang/String;[Ljava/lang/Object;)V
Landroid/ddm/DdmHandleAppName;->getAppName()Ljava/lang/String;
+Landroid/ddm/DdmHandleAppName;->setAppName(Ljava/lang/String;I)V
Landroid/graphics/AvoidXfermode$Mode;->AVOID:Landroid/graphics/AvoidXfermode$Mode;
Landroid/graphics/AvoidXfermode$Mode;->TARGET:Landroid/graphics/AvoidXfermode$Mode;
Landroid/graphics/BaseCanvas;->mNativeCanvasWrapper:J
@@ -804,6 +994,7 @@
Landroid/graphics/Bitmap;->mNinePatchChunk:[B
Landroid/graphics/Bitmap;->mNinePatchInsets:Landroid/graphics/NinePatch$InsetStruct;
Landroid/graphics/Bitmap;->reinit(IIZ)V
+Landroid/graphics/Bitmap;->setDefaultDensity(I)V
Landroid/graphics/BitmapFactory;->nativeDecodeAsset(JLandroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
Landroid/graphics/BitmapFactory;->nativeDecodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
Landroid/graphics/BitmapFactory;->nativeDecodeFileDescriptor(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
@@ -863,6 +1054,7 @@
Landroid/graphics/drawable/Icon;->getDataOffset()I
Landroid/graphics/drawable/Icon;->getResources()Landroid/content/res/Resources;
Landroid/graphics/drawable/Icon;->hasTint()Z
+Landroid/graphics/drawable/Icon;->mString1:Ljava/lang/String;
Landroid/graphics/drawable/Icon;->mType:I
Landroid/graphics/drawable/InsetDrawable;->mState:Landroid/graphics/drawable/InsetDrawable$InsetState;
Landroid/graphics/drawable/LayerDrawable$ChildDrawable;->mDrawable:Landroid/graphics/drawable/Drawable;
@@ -896,7 +1088,9 @@
Landroid/graphics/GraphicBuffer;->mNativeObject:J
Landroid/graphics/ImageDecoder;->postProcessAndRelease(Landroid/graphics/Canvas;)I
Landroid/graphics/Insets;->left:I
+Landroid/graphics/Insets;->top:I
Landroid/graphics/Insets;->right:I
+Landroid/graphics/Insets;->bottom:I
Landroid/graphics/LinearGradient;->mColors:[I
Landroid/graphics/Matrix;->native_instance:J
Landroid/graphics/Movie;-><init>(J)V
@@ -991,8 +1185,12 @@
Landroid/hardware/camera2/utils/TypeReference;->createSpecializedTypeReference(Ljava/lang/reflect/Type;)Landroid/hardware/camera2/utils/TypeReference;
Landroid/hardware/Camera;->addCallbackBuffer([BI)V
Landroid/hardware/Camera;->mNativeContext:J
+Landroid/hardware/Camera;->native_setup(Ljava/lang/Object;IILjava/lang/String;)I
Landroid/hardware/Camera;->openLegacy(II)Landroid/hardware/Camera;
Landroid/hardware/Camera;->postEventFromNative(Ljava/lang/Object;IIILjava/lang/Object;)V
+Landroid/hardware/display/DisplayManagerGlobal;->mDm:Landroid/hardware/display/IDisplayManager;
+Landroid/hardware/display/DisplayManagerGlobal;->sInstance:Landroid/hardware/display/DisplayManagerGlobal;
+Landroid/hardware/display/IDisplayManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/display/IDisplayManager;
Landroid/hardware/display/WifiDisplayStatus;->mActiveDisplay:Landroid/hardware/display/WifiDisplay;
Landroid/hardware/display/WifiDisplayStatus;->mDisplays:[Landroid/hardware/display/WifiDisplay;
Landroid/hardware/fingerprint/Fingerprint;->getFingerId()I
@@ -1000,6 +1198,7 @@
Landroid/hardware/fingerprint/IFingerprintService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/hardware/HardwareBuffer;-><init>(J)V
Landroid/hardware/HardwareBuffer;->mNativeObject:J
+Landroid/hardware/ICameraService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/ICameraService;
Landroid/hardware/input/IInputManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/hardware/input/IInputManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/input/IInputManager;
Landroid/hardware/input/InputManager;->getInstance()Landroid/hardware/input/InputManager;
@@ -1007,6 +1206,7 @@
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I
Landroid/hardware/input/InputManager;->mIm:Landroid/hardware/input/IInputManager;
Landroid/hardware/location/IActivityRecognitionHardwareClient$Stub;-><init>()V
+Landroid/hardware/location/IContextHubService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/location/IContextHubService;
Landroid/hardware/SerialPort;->mNativeContext:I
Landroid/hardware/soundtrigger/SoundTrigger$ConfidenceLevel;-><init>(II)V
Landroid/hardware/soundtrigger/SoundTrigger$ConfidenceLevel;->confidenceLevel:I
@@ -1031,6 +1231,7 @@
Landroid/hardware/soundtrigger/SoundTrigger$RecognitionConfig;->data:[B
Landroid/hardware/soundtrigger/SoundTrigger$RecognitionConfig;->keyphrases:[Landroid/hardware/soundtrigger/SoundTrigger$KeyphraseRecognitionExtra;
Landroid/hardware/soundtrigger/SoundTrigger$RecognitionEvent;-><init>(IIZIIIZLandroid/media/AudioFormat;[B)V
+Landroid/hardware/soundtrigger/SoundTrigger$RecognitionEvent;->data:[B
Landroid/hardware/soundtrigger/SoundTrigger$SoundModel;->data:[B
Landroid/hardware/soundtrigger/SoundTrigger$SoundModel;->uuid:Ljava/util/UUID;
Landroid/hardware/soundtrigger/SoundTrigger$SoundModel;->vendorUuid:Ljava/util/UUID;
@@ -1072,6 +1273,7 @@
Landroid/icu/text/SpoofChecker$ScriptSet;->setAll()V
Landroid/icu/text/TimeZoneNames$DefaultTimeZoneNames$FactoryImpl;-><init>()V
Landroid/icu/text/Transliterator;->createFromRules(Ljava/lang/String;Ljava/lang/String;I)Landroid/icu/text/Transliterator;
+Landroid/icu/text/Transliterator;->getInstance(Ljava/lang/String;)Landroid/icu/text/Transliterator;
Landroid/icu/text/Transliterator;->transliterate(Ljava/lang/String;)Ljava/lang/String;
Landroid/icu/text/UFormat;->getLocale(Landroid/icu/util/ULocale$Type;)Landroid/icu/util/ULocale;
Landroid/icu/util/Calendar;->getLocale(Landroid/icu/util/ULocale$Type;)Landroid/icu/util/ULocale;
@@ -1086,9 +1288,17 @@
Landroid/location/GeocoderParams;->getLocale()Ljava/util/Locale;
Landroid/location/IGeocodeProvider$Stub;-><init>()V
Landroid/location/IGeofenceProvider$Stub;-><init>()V
+Landroid/location/ILocationListener$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/location/ILocationListener$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/location/ILocationListener;->onLocationChanged(Landroid/location/Location;)V
Landroid/location/ILocationManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/location/ILocationManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/location/ILocationManager;
+Landroid/location/Location;->mElapsedRealtimeNanos:J
Landroid/location/LocationManager;->mService:Landroid/location/ILocationManager;
+Landroid/location/LocationRequest;->mHideFromAppOps:Z
+Landroid/location/LocationRequest;->mInterval:J
+Landroid/location/LocationRequest;->mProvider:Ljava/lang/String;
+Landroid/location/LocationRequest;->mWorkSource:Landroid/os/WorkSource;
Landroid/media/AudioAttributes$Builder;->addTag(Ljava/lang/String;)Landroid/media/AudioAttributes$Builder;
Landroid/media/AudioAttributes;->mContentType:I
Landroid/media/AudioAttributes;->mFlags:I
@@ -1186,6 +1396,7 @@
Landroid/media/IAudioService;->getStreamVolume(I)I
Landroid/media/IAudioService;->setStreamVolume(IIILjava/lang/String;)V
Landroid/media/Image;-><init>()V
+Landroid/media/IMediaRouterService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/IMediaRouterService;
Landroid/media/IMediaScannerService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/IMediaScannerService;
Landroid/media/IMediaScannerService;->scanFile(Ljava/lang/String;Ljava/lang/String;)V
Landroid/media/IRemoteDisplayCallback;->onStateChanged(Landroid/media/RemoteDisplayState;)V
@@ -1248,6 +1459,8 @@
Landroid/media/RemoteDisplayState;-><init>()V
Landroid/media/RemoteDisplayState;->displays:Ljava/util/ArrayList;
Landroid/media/RingtoneManager;->getRingtone(Landroid/content/Context;Landroid/net/Uri;I)Landroid/media/Ringtone;
+Landroid/media/session/ISessionManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/session/ISessionManager;
+Landroid/media/session/MediaSession;->getCallingPackage()Ljava/lang/String;
Landroid/media/session/MediaSession;->mCallback:Landroid/media/session/MediaSession$CallbackMessageHandler;
Landroid/media/session/MediaSessionLegacyHelper;->getHelper(Landroid/content/Context;)Landroid/media/session/MediaSessionLegacyHelper;
Landroid/media/soundtrigger/SoundTriggerDetector$EventPayload;->getCaptureSession()Ljava/lang/Integer;
@@ -1312,11 +1525,14 @@
Landroid/net/IConnectivityManager$Stub$Proxy;->getTetherableIfaces()[Ljava/lang/String;
Landroid/net/IConnectivityManager$Stub$Proxy;->getTetherableUsbRegexs()[Ljava/lang/String;
Landroid/net/IConnectivityManager$Stub$Proxy;->getTetheredIfaces()[Ljava/lang/String;
+Landroid/net/IConnectivityManager$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/net/IConnectivityManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/IConnectivityManager;
Landroid/net/IConnectivityManager;->getActiveLinkProperties()Landroid/net/LinkProperties;
Landroid/net/IConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;
Landroid/net/IConnectivityManager;->getAllNetworkInfo()[Landroid/net/NetworkInfo;
Landroid/net/IConnectivityManager;->getTetheredIfaces()[Ljava/lang/String;
+Landroid/net/INetworkPolicyManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/INetworkPolicyManager;
+Landroid/net/INetworkScoreService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/INetworkScoreService;
Landroid/net/INetworkStatsService$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/net/INetworkStatsService$Stub$Proxy;->getMobileIfaces()[Ljava/lang/String;
Landroid/net/IpConfiguration;->httpProxy:Landroid/net/ProxyInfo;
@@ -1379,6 +1595,10 @@
Landroid/net/Uri;-><init>()V
Landroid/net/wifi/IWifiManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/net/wifi/IWifiManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/wifi/IWifiManager;
+Landroid/net/wifi/IWifiScanner$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/net/wifi/IWifiScanner$Stub$Proxy;->mRemote:Landroid/os/IBinder;
+Landroid/net/wifi/IWifiScanner$Stub;-><init>()V
+Landroid/net/wifi/IWifiScanner$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/wifi/IWifiScanner;
Landroid/net/wifi/p2p/WifiP2pGroup;->getNetworkId()I
Landroid/net/wifi/p2p/WifiP2pGroup;->TEMPORARY_NET_ID:I
Landroid/net/wifi/p2p/WifiP2pGroupList;->getGroupList()Ljava/util/Collection;
@@ -1466,6 +1686,7 @@
Landroid/os/BatteryStats$Uid$Proc;->countExcessivePowers()I
Landroid/os/BatteryStats$Uid$Proc;->getExcessivePower(I)Landroid/os/BatteryStats$Uid$Proc$ExcessivePower;
Landroid/os/BatteryStats$Uid$Proc;->getForegroundTime(I)J
+Landroid/os/BatteryStats$Uid$Proc;->getStarts(I)I
Landroid/os/BatteryStats$Uid$Proc;->getSystemTime(I)J
Landroid/os/BatteryStats$Uid$Proc;->getUserTime(I)J
Landroid/os/BatteryStats$Uid$Sensor;->getHandle()I
@@ -1521,6 +1742,7 @@
Landroid/os/Debug;-><init>()V
Landroid/os/Debug;->countInstancesOfClass(Ljava/lang/Class;)J
Landroid/os/Debug;->dumpReferenceTables()V
+Landroid/os/DropBoxManager;->mService:Lcom/android/internal/os/IDropBoxManagerService;
Landroid/os/Environment;->buildExternalStorageAppDataDirs(Ljava/lang/String;)[Ljava/io/File;
Landroid/os/Environment;->getStorageDirectory()Ljava/io/File;
Landroid/os/Environment;->getVendorDirectory()Ljava/io/File;
@@ -1563,10 +1785,14 @@
Landroid/os/IPowerManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/os/IPowerManager$Stub$Proxy;->isLightDeviceIdleMode()Z
Landroid/os/IPowerManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/os/IPowerManager;
+Landroid/os/IPowerManager;->releaseWakeLock(Landroid/os/IBinder;I)V
Landroid/os/IPowerManager;->userActivity(JII)V
+Landroid/os/IRecoverySystem$Stub;->asInterface(Landroid/os/IBinder;)Landroid/os/IRecoverySystem;
Landroid/os/IServiceManager;->checkService(Ljava/lang/String;)Landroid/os/IBinder;
Landroid/os/IServiceManager;->getService(Ljava/lang/String;)Landroid/os/IBinder;
Landroid/os/IUserManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/os/IUserManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/os/IUserManager;
+Landroid/os/IVibratorService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/os/IVibratorService;
Landroid/os/LocaleList;->setDefault(Landroid/os/LocaleList;I)V
Landroid/os/Looper;->mQueue:Landroid/os/MessageQueue;
Landroid/os/Looper;->setTraceTag(J)V
@@ -1605,6 +1831,7 @@
Landroid/os/PowerManager;->validateWakeLockParameters(ILjava/lang/String;)V
Landroid/os/PowerManager;->wakeUp(J)V
Landroid/os/PowerManager;->wakeUp(JLjava/lang/String;)V
+Landroid/os/Process;->getFreeMemory()J
Landroid/os/Process;->getParentPid(I)I
Landroid/os/Process;->getPids(Ljava/lang/String;[I)[I
Landroid/os/Process;->getTotalMemory()J
@@ -1613,7 +1840,9 @@
Landroid/os/Process;->readProcFile(Ljava/lang/String;[I[Ljava/lang/String;[J[F)Z
Landroid/os/Process;->readProcLines(Ljava/lang/String;[Ljava/lang/String;[J)V
Landroid/os/Process;->setArgV0(Ljava/lang/String;)V
+Landroid/os/SELinux;->checkSELinuxAccess(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
Landroid/os/SELinux;->getFileContext(Ljava/lang/String;)Ljava/lang/String;
+Landroid/os/SELinux;->getPidContext(I)Ljava/lang/String;
Landroid/os/SELinux;->isSELinuxEnabled()Z
Landroid/os/SELinux;->isSELinuxEnforced()Z
Landroid/os/ServiceManager;-><init>()V
@@ -1727,6 +1956,7 @@
Landroid/os/UserManager;->hasBaseUserRestriction(Ljava/lang/String;Landroid/os/UserHandle;)Z
Landroid/os/UserManager;->isLinkedUser()Z
Landroid/os/UserManager;->isUserUnlocked(I)Z
+Landroid/os/UserManager;->mService:Landroid/os/IUserManager;
Landroid/os/VintfObject;->getHalNamesAndVersions()[Ljava/lang/String;
Landroid/os/VintfObject;->getSepolicyVersion()Ljava/lang/String;
Landroid/os/VintfObject;->getTargetFrameworkCompatibilityMatrixVersion()Ljava/lang/Long;
@@ -1800,7 +2030,28 @@
Landroid/provider/Browser;->updateVisitedHistory(Landroid/content/ContentResolver;Ljava/lang/String;Z)V
Landroid/provider/CalendarContract$CalendarAlerts;->findNextAlarmTime(Landroid/content/ContentResolver;J)J
Landroid/provider/CalendarContract$CalendarAlerts;->rescheduleMissedAlarms(Landroid/content/ContentResolver;Landroid/content/Context;Landroid/app/AlarmManager;)V
+Landroid/provider/Downloads$Impl$RequestHeaders;->INSERT_KEY_PREFIX:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_ALLOWED_NETWORK_TYPES:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_ALLOW_ROAMING:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_COOKIE_DATA:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_DELETED:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_DESCRIPTION:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_DESTINATION:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_FILE_NAME_HINT:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_IS_PUBLIC_API:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_IS_VISIBLE_IN_DOWNLOADS_UI:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_MEDIA_SCANNED:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_MIME_TYPE:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_NOTIFICATION_CLASS:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_NOTIFICATION_EXTRAS:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_NOTIFICATION_PACKAGE:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_REFERER:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_TITLE:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_URI:Ljava/lang/String;
+Landroid/provider/Downloads$Impl;->COLUMN_VISIBILITY:Ljava/lang/String;
Landroid/provider/Downloads$Impl;->CONTENT_URI:Landroid/net/Uri;
+Landroid/provider/Downloads$Impl;->DESTINATION_CACHE_PARTITION_PURGEABLE:I
+Landroid/provider/Downloads$Impl;->DESTINATION_FILE_URI:I
Landroid/provider/Settings$ContentProviderHolder;->mContentProvider:Landroid/content/IContentProvider;
Landroid/provider/Settings$Global;->ENABLE_ACCESSIBILITY_GLOBAL_GESTURE_ENABLED:Ljava/lang/String;
Landroid/provider/Settings$Global;->PACKAGE_VERIFIER_ENABLE:Ljava/lang/String;
@@ -1855,6 +2106,7 @@
Landroid/R$styleable;->CheckedTextView_checkMark:I
Landroid/R$styleable;->CompoundButton:[I
Landroid/R$styleable;->CompoundButton_button:I
+Landroid/R$styleable;->DrawableStates:[I
Landroid/R$styleable;->ImageView:[I
Landroid/R$styleable;->ImageView_adjustViewBounds:I
Landroid/R$styleable;->ImageView_baselineAlignBottom:I
@@ -2028,6 +2280,7 @@
Landroid/renderscript/RenderScript;->create(Landroid/content/Context;ILandroid/renderscript/RenderScript$ContextType;I)Landroid/renderscript/RenderScript;
Landroid/renderscript/RenderScript;->getMinorID()J
Landroid/renderscript/RenderScriptCacheDir;->mCacheDir:Ljava/io/File;
+Landroid/renderscript/RenderScriptCacheDir;->setupDiskCache(Ljava/io/File;)V
Landroid/security/keystore/AndroidKeyStoreProvider;->getKeyStoreOperationHandle(Ljava/lang/Object;)J
Landroid/security/keystore/recovery/RecoveryController;->initRecoveryService(Ljava/lang/String;[B)V
Landroid/security/KeyStore;->getInstance()Landroid/security/KeyStore;
@@ -2039,9 +2292,13 @@
Landroid/service/media/IMediaBrowserServiceCallbacks;->onLoadChildrenWithOptions(Ljava/lang/String;Landroid/content/pm/ParceledListSlice;Landroid/os/Bundle;)V
Landroid/service/media/MediaBrowserService$Result;->mFlags:I
Landroid/service/media/MediaBrowserService;->KEY_MEDIA_ITEM:Ljava/lang/String;
+Landroid/service/notification/NotificationListenerService;->isBound()Z
+Landroid/service/notification/NotificationListenerService;->mHandler:Landroid/os/Handler;
Landroid/service/notification/NotificationListenerService;->registerAsSystemService(Landroid/content/Context;Landroid/content/ComponentName;I)V
Landroid/service/notification/NotificationListenerService;->unregisterAsSystemService()V
+Landroid/service/notification/StatusBarNotification;->getInitialPid()I
Landroid/service/notification/StatusBarNotification;->getUid()I
+Landroid/service/persistentdata/IPersistentDataBlockService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/service/persistentdata/IPersistentDataBlockService;
Landroid/service/voice/AlwaysOnHotwordDetector$EventPayload;->getCaptureSession()Ljava/lang/Integer;
Landroid/service/voice/VoiceInteractionService;->isKeyphraseAndLocaleSupportedForHotword(Ljava/lang/String;Ljava/util/Locale;)Z
Landroid/service/vr/IVrManager;->getVr2dDisplayId()I
@@ -2112,6 +2369,7 @@
Landroid/telephony/CellSignalStrengthLte;->mRsrq:I
Landroid/telephony/CellSignalStrengthLte;->mRssnr:I
Landroid/telephony/CellSignalStrengthLte;->mSignalStrength:I
+Landroid/telephony/CellSignalStrengthLte;->mTimingAdvance:I
Landroid/telephony/CellSignalStrengthWcdma;->mBitErrorRate:I
Landroid/telephony/CellSignalStrengthWcdma;->mSignalStrength:I
Landroid/telephony/PhoneNumberUtils;->isLocalEmergencyNumber(Landroid/content/Context;ILjava/lang/String;)Z
@@ -2121,6 +2379,7 @@
Landroid/telephony/SignalStrength;->getAsuLevel()I
Landroid/telephony/SignalStrength;->getCdmaLevel()I
Landroid/telephony/SignalStrength;->getDbm()I
+Landroid/telephony/SignalStrength;->getGsmDbm()I
Landroid/telephony/SignalStrength;->getLteDbm()I
Landroid/telephony/SignalStrength;->getLteRsrp()I
Landroid/telephony/SignalStrength;->getLteRsrq()I
@@ -2185,6 +2444,7 @@
Landroid/telephony/TelephonyManager;->hasIccCard(I)Z
Landroid/telephony/TelephonyManager;->isMultiSimEnabled()Z
Landroid/telephony/TelephonyManager;->isNetworkRoaming(I)Z
+Landroid/telephony/TelephonyManager;->isVideoTelephonyAvailable()Z
Landroid/telephony/TelephonyManager;->isVolteAvailable()Z
Landroid/telephony/TelephonyManager;->isWifiCallingAvailable()Z
Landroid/telephony/TelephonyManager;->mSubscriptionManager:Landroid/telephony/SubscriptionManager;
@@ -2266,6 +2526,7 @@
Landroid/util/ArrayMap;->mBaseCacheSize:I
Landroid/util/ArrayMap;->mTwiceBaseCacheSize:I
Landroid/util/ArraySet;-><init>(Ljava/util/Collection;)V
+Landroid/util/DisplayMetrics;->DENSITY_DEVICE:I
Landroid/util/DisplayMetrics;->noncompatHeightPixels:I
Landroid/util/DisplayMetrics;->noncompatWidthPixels:I
Landroid/util/EventLog$Event;-><init>([B)V
@@ -2332,6 +2593,9 @@
Landroid/view/ContextThemeWrapper;->mTheme:Landroid/content/res/Resources$Theme;
Landroid/view/ContextThemeWrapper;->mThemeResource:I
Landroid/view/Display$HdrCapabilities;-><init>([IFFF)V
+Landroid/view/Display;->getDisplayAdjustments()Landroid/view/DisplayAdjustments;
+Landroid/view/DisplayAdjustments;->getConfiguration()Landroid/content/res/Configuration;
+Landroid/view/DisplayAdjustments;->setCompatibilityInfo(Landroid/content/res/CompatibilityInfo;)V
Landroid/view/DisplayEventReceiver;->dispatchHotplug(JIZ)V
Landroid/view/DisplayEventReceiver;->dispatchVsync(JII)V
Landroid/view/DisplayListCanvas;->callDrawGLFunction2(J)V
@@ -2345,6 +2609,7 @@
Landroid/view/GhostView;->addGhost(Landroid/view/View;Landroid/view/ViewGroup;Landroid/graphics/Matrix;)Landroid/view/GhostView;
Landroid/view/GhostView;->removeGhost(Landroid/view/View;)V
Landroid/view/IGraphicsStats$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
+Landroid/view/IGraphicsStats$Stub;->asInterface(Landroid/os/IBinder;)Landroid/view/IGraphicsStats;
Landroid/view/InputChannel;-><init>()V
Landroid/view/InputChannel;->mPtr:J
Landroid/view/InputDevice;-><init>(IIILjava/lang/String;IILjava/lang/String;ZIILandroid/view/KeyCharacterMap;ZZZ)V
@@ -2358,6 +2623,7 @@
Landroid/view/inputmethod/InputMethodManager;->finishInputLocked()V
Landroid/view/inputmethod/InputMethodManager;->focusIn(Landroid/view/View;)V
Landroid/view/inputmethod/InputMethodManager;->focusOut(Landroid/view/View;)V
+Landroid/view/inputmethod/InputMethodManager;->getClient()Lcom/android/internal/view/IInputMethodClient;
Landroid/view/inputmethod/InputMethodManager;->getInputMethodWindowVisibleHeight()I
Landroid/view/inputmethod/InputMethodManager;->getInstance()Landroid/view/inputmethod/InputMethodManager;
Landroid/view/inputmethod/InputMethodManager;->mCurId:Ljava/lang/String;
@@ -2493,6 +2759,7 @@
Landroid/view/TextureView;->mNativeWindow:J
Landroid/view/TextureView;->mSurface:Landroid/graphics/SurfaceTexture;
Landroid/view/TextureView;->mUpdateListener:Landroid/graphics/SurfaceTexture$OnFrameAvailableListener;
+Landroid/view/ThreadedRenderer;->setupDiskCache(Ljava/io/File;)V
Landroid/view/TouchDelegate;->mDelegateTargeted:Z
Landroid/view/VelocityTracker$Estimator;->confidence:F
Landroid/view/VelocityTracker$Estimator;->degree:I
@@ -2533,6 +2800,7 @@
Landroid/view/View;->includeForAccessibility()Z
Landroid/view/View;->initializeScrollbars(Landroid/content/res/TypedArray;)V
Landroid/view/View;->internalSetPadding(IIII)V
+Landroid/view/View;->invalidateParentIfNeeded()V
Landroid/view/View;->isPaddingResolved()Z
Landroid/view/View;->isRootNamespace()Z
Landroid/view/View;->isVisibleToUser()Z
@@ -2645,10 +2913,12 @@
Landroid/view/Window;->mContext:Landroid/content/Context;
Landroid/view/Window;->mHardwareAccelerated:Z
Landroid/view/Window;->mWindowStyle:Landroid/content/res/TypedArray;
+Landroid/view/Window;->setNeedsMenuKey(I)V
Landroid/view/WindowAnimationFrameStats;->init(J[J)V
Landroid/view/WindowContentFrameStats;->init(J[J[J[J)V
Landroid/view/WindowManager$LayoutParams;->hideTimeoutMilliseconds:J
Landroid/view/WindowManager$LayoutParams;->needsMenuKey:I
+Landroid/view/WindowManager$LayoutParams;->NEEDS_MENU_SET_FALSE:I
Landroid/view/WindowManager$LayoutParams;->NEEDS_MENU_SET_TRUE:I
Landroid/view/WindowManager$LayoutParams;->userActivityTimeout:J
Landroid/view/WindowManagerGlobal;->getInstance()Landroid/view/WindowManagerGlobal;
@@ -2706,7 +2976,9 @@
Landroid/webkit/WebView;->savePicture(Landroid/os/Bundle;Ljava/io/File;)Z
Landroid/webkit/WebView;->sEnforceThreadChecking:Z
Landroid/webkit/WebViewClient;->onUnhandledInputEvent(Landroid/webkit/WebView;Landroid/view/InputEvent;)V
+Landroid/webkit/WebViewDelegate;-><init>()V
Landroid/webkit/WebViewFactory;->getProvider()Landroid/webkit/WebViewFactoryProvider;
+Landroid/webkit/WebViewFactory;->getUpdateService()Landroid/webkit/IWebViewUpdateService;
Landroid/webkit/WebViewFactory;->getWebViewContextAndSetProvider()Landroid/content/Context;
Landroid/webkit/WebViewFactory;->sPackageInfo:Landroid/content/pm/PackageInfo;
Landroid/webkit/WebViewFactory;->sProviderInstance:Landroid/webkit/WebViewFactoryProvider;
@@ -2764,6 +3036,7 @@
Landroid/widget/AutoCompleteTextView;->setDropDownAlwaysVisible(Z)V
Landroid/widget/AutoCompleteTextView;->setForceIgnoreOutsideTouch(Z)V
Landroid/widget/BaseAdapter;->mDataSetObservable:Landroid/database/DataSetObservable;
+Landroid/widget/CompoundButton;->mBroadcasting:Z
Landroid/widget/CompoundButton;->mButtonDrawable:Landroid/graphics/drawable/Drawable;
Landroid/widget/CompoundButton;->mOnCheckedChangeListener:Landroid/widget/CompoundButton$OnCheckedChangeListener;
Landroid/widget/CursorAdapter;->mChangeObserver:Landroid/widget/CursorAdapter$ChangeObserver;
@@ -2773,6 +3046,7 @@
Landroid/widget/DatePicker;->mDelegate:Landroid/widget/DatePicker$DatePickerDelegate;
Landroid/widget/EdgeEffect;->mPaint:Landroid/graphics/Paint;
Landroid/widget/Editor;->invalidateTextDisplayList()V
+Landroid/widget/Editor;->mSelectHandleLeft:Landroid/graphics/drawable/Drawable;
Landroid/widget/Editor;->mShowCursor:J
Landroid/widget/Editor;->mShowSoftInputOnFocus:Z
Landroid/widget/ExpandableListView;->mChildDivider:Landroid/graphics/drawable/Drawable;
@@ -2811,6 +3085,7 @@
Landroid/widget/ImageView;->mDrawMatrix:Landroid/graphics/Matrix;
Landroid/widget/ImageView;->mMaxHeight:I
Landroid/widget/ImageView;->mMaxWidth:I
+Landroid/widget/ImageView;->mRecycleableBitmapDrawable:Landroid/graphics/drawable/BitmapDrawable;
Landroid/widget/ImageView;->mResource:I
Landroid/widget/ImageView;->mUri:Landroid/net/Uri;
Landroid/widget/ImageView;->updateDrawable(Landroid/graphics/drawable/Drawable;)V
@@ -2883,11 +3158,14 @@
Landroid/widget/RemoteViews$ReflectionAction;->methodName:Ljava/lang/String;
Landroid/widget/RemoteViews$ReflectionAction;->value:Ljava/lang/Object;
Landroid/widget/RemoteViews$SetOnClickPendingIntent;->pendingIntent:Landroid/app/PendingIntent;
+Landroid/widget/RemoteViews$SetPendingIntentTemplate;->pendingIntentTemplate:Landroid/app/PendingIntent;
+Landroid/widget/RemoteViews$ViewGroupActionAdd;->mNestedViews:Landroid/widget/RemoteViews;
Landroid/widget/RemoteViews;->estimateMemoryUsage()I
Landroid/widget/RemoteViews;->mActions:Ljava/util/ArrayList;
Landroid/widget/RemoteViews;->mApplication:Landroid/content/pm/ApplicationInfo;
Landroid/widget/RemoteViews;->mBitmapCache:Landroid/widget/RemoteViews$BitmapCache;
Landroid/widget/RemoteViews;->mergeRemoteViews(Landroid/widget/RemoteViews;)V
+Landroid/widget/RemoteViews;->mLayoutId:I
Landroid/widget/RemoteViews;->mPortrait:Landroid/widget/RemoteViews;
Landroid/widget/RemoteViewsAdapter;->mCache:Landroid/widget/RemoteViewsAdapter$FixedSizeRemoteViewsCache;
Landroid/widget/RemoteViewsAdapter;->mWorkerThread:Landroid/os/HandlerThread;
@@ -2935,10 +3213,12 @@
Landroid/widget/TextView;->mMaximum:I
Landroid/widget/TextView;->mMaxMode:I
Landroid/widget/TextView;->mSingleLine:Z
+Landroid/widget/TextView;->mText:Ljava/lang/CharSequence;
Landroid/widget/TextView;->mTextPaint:Landroid/text/TextPaint;
Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;Landroid/widget/TextView$BufferType;ZI)V
Landroid/widget/Toast$TN;->mNextView:Landroid/view/View;
Landroid/widget/Toast$TN;->mParams:Landroid/view/WindowManager$LayoutParams;
+Landroid/widget/Toast$TN;->mView:Landroid/view/View;
Landroid/widget/Toast;->getService()Landroid/app/INotificationManager;
Landroid/widget/Toast;->getWindowParams()Landroid/view/WindowManager$LayoutParams;
Landroid/widget/Toast;->mDuration:I
@@ -3037,6 +3317,9 @@
Lcom/android/internal/app/IVoiceInteractionManagerService$Stub$Proxy;->showSessionFromSession(Landroid/os/IBinder;Landroid/os/Bundle;I)Z
Lcom/android/internal/app/IVoiceInteractionManagerService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/app/IVoiceInteractionManagerService;
Lcom/android/internal/app/IVoiceInteractionManagerService;->getKeyphraseSoundModel(ILjava/lang/String;)Landroid/hardware/soundtrigger/SoundTrigger$KeyphraseSoundModel;
+Lcom/android/internal/appwidget/IAppWidgetService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/appwidget/IAppWidgetService;
+Lcom/android/internal/content/ReferrerIntent;-><init>(Landroid/content/Intent;Ljava/lang/String;)V
+Lcom/android/internal/content/ReferrerIntent;->mReferrer:Ljava/lang/String;
Lcom/android/internal/location/ILocationProvider$Stub;-><init>()V
Lcom/android/internal/os/BatterySipper;-><init>(Lcom/android/internal/os/BatterySipper$DrainType;Landroid/os/BatteryStats$Uid;D)V
Lcom/android/internal/os/BatterySipper;->add(Lcom/android/internal/os/BatterySipper;)V
@@ -3081,10 +3364,12 @@
Lcom/android/internal/os/BatteryStatsImpl;->getUidStatsLocked(I)Lcom/android/internal/os/BatteryStatsImpl$Uid;
Lcom/android/internal/os/FuseAppLoop;->onCommand(IJJJI[B)V
Lcom/android/internal/os/FuseAppLoop;->onOpen(JJ)[B
+Lcom/android/internal/os/IDropBoxManagerService$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/os/IDropBoxManagerService;
Lcom/android/internal/os/PowerProfile;-><init>(Landroid/content/Context;)V
Lcom/android/internal/os/PowerProfile;->getAveragePower(Ljava/lang/String;)D
Lcom/android/internal/os/PowerProfile;->getAveragePower(Ljava/lang/String;I)D
Lcom/android/internal/os/PowerProfile;->getBatteryCapacity()D
+Lcom/android/internal/os/SomeArgs;->arg1:Ljava/lang/Object;
Lcom/android/internal/R$array;->config_mobile_hotspot_provision_app:I
Lcom/android/internal/R$array;->config_tether_wifi_regexs:I
Lcom/android/internal/R$array;->maps_starting_lat_lng:I
@@ -3287,12 +3572,14 @@
Lcom/android/internal/R$styleable;->Window_windowIsTranslucent:I
Lcom/android/internal/R$styleable;->Window_windowShowWallpaper:I
Lcom/android/internal/R$xml;->power_profile:I
+Lcom/android/internal/telephony/IMms$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IMms;
Lcom/android/internal/telephony/IPhoneSubInfo$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/telephony/IPhoneSubInfo$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IPhoneSubInfo;
Lcom/android/internal/telephony/ISms$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ISms;
Lcom/android/internal/telephony/ISub$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->endCall()Z
+Lcom/android/internal/telephony/ITelephony$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Lcom/android/internal/telephony/ITelephony$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ITelephony;
Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_call:I
Lcom/android/internal/telephony/ITelephony$Stub;->TRANSACTION_endCall:I
@@ -3303,11 +3590,13 @@
Lcom/android/internal/telephony/ITelephony;->disableDataConnectivity()Z
Lcom/android/internal/telephony/ITelephony;->enableDataConnectivity()Z
Lcom/android/internal/telephony/ITelephony;->endCall()Z
+Lcom/android/internal/telephony/ITelephony;->endCallForSubscriber(I)Z
Lcom/android/internal/telephony/ITelephony;->getCallState()I
Lcom/android/internal/telephony/ITelephony;->getDataState()I
Lcom/android/internal/telephony/ITelephony;->isIdle(Ljava/lang/String;)Z
Lcom/android/internal/telephony/ITelephony;->setRadio(Z)Z
Lcom/android/internal/telephony/ITelephony;->silenceRinger()V
+Lcom/android/internal/telephony/ITelephonyRegistry$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Lcom/android/internal/telephony/ITelephonyRegistry$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/ITelephonyRegistry;
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyCallState(ILjava/lang/String;)V
Lcom/android/internal/telephony/SmsHeader$ConcatRef;->msgCount:I
@@ -3441,9 +3730,12 @@
Ldalvik/system/DexPathList;->splitPaths(Ljava/lang/String;Z)Ljava/util/List;
Ldalvik/system/DexPathList;->systemNativeLibraryDirectories:Ljava/util/List;
Ldalvik/system/VMDebug;->dumpReferenceTables()V
+Ldalvik/system/VMDebug;->isDebuggerConnected()Z
Ldalvik/system/VMRuntime;->addressOf(Ljava/lang/Object;)J
Ldalvik/system/VMRuntime;->clearGrowthLimit()V
+Ldalvik/system/VMRuntime;->gcSoftReferences()V
Ldalvik/system/VMRuntime;->getCurrentInstructionSet()Ljava/lang/String;
+Ldalvik/system/VMRuntime;->getExternalBytesAllocated()J
Ldalvik/system/VMRuntime;->getInstructionSet(Ljava/lang/String;)Ljava/lang/String;
Ldalvik/system/VMRuntime;->getRuntime()Ldalvik/system/VMRuntime;
Ldalvik/system/VMRuntime;->is64Bit()Z
@@ -3510,6 +3802,7 @@
Ljava/lang/ref/Reference;->referent:Ljava/lang/Object;
Ljava/lang/ref/ReferenceQueue;->add(Ljava/lang/ref/Reference;)V
Ljava/lang/reflect/Executable;->artMethod:J
+Ljava/lang/reflect/Field;->accessFlags:I
Ljava/lang/reflect/Parameter;-><init>(Ljava/lang/String;ILjava/lang/reflect/Executable;I)V
Ljava/lang/reflect/Proxy;->invoke(Ljava/lang/reflect/Proxy;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;
Ljava/lang/Runtime;->load(Ljava/lang/String;Ljava/lang/ClassLoader;)V
diff --git a/config/hiddenapi-vendor-list.txt b/config/hiddenapi-vendor-list.txt
index 228bf94..4f878ac 100644
--- a/config/hiddenapi-vendor-list.txt
+++ b/config/hiddenapi-vendor-list.txt
@@ -36,7 +36,6 @@
Landroid/app/IActivityManager;->startActivityAsUser(Landroid/app/IApplicationThread;Ljava/lang/String;Landroid/content/Intent;Ljava/lang/String;Landroid/os/IBinder;Ljava/lang/String;IILandroid/app/ProfilerInfo;Landroid/os/Bundle;I)I
Landroid/app/IActivityManager;->startActivityFromRecents(ILandroid/os/Bundle;)I
Landroid/app/IActivityManager;->startRecentsActivity(Landroid/content/Intent;Landroid/app/IAssistDataReceiver;Landroid/view/IRecentsAnimationRunner;)V
-Landroid/app/IAlarmManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/app/IAlarmManager;
Landroid/app/IAlarmManager;->setTime(J)Z
Landroid/app/IAssistDataReceiver$Stub;-><init>()V
Landroid/app/IAssistDataReceiver;->onHandleAssistData(Landroid/os/Bundle;)V
@@ -92,7 +91,6 @@
Landroid/content/Intent;->getIBinderExtra(Ljava/lang/String;)Landroid/os/IBinder;
Landroid/content/Intent;->resolveSystemService(Landroid/content/pm/PackageManager;I)Landroid/content/ComponentName;
Landroid/content/pm/IPackageDataObserver$Stub;-><init>()V
-Landroid/content/pm/IPackageDataObserver;->onRemoveCompleted(Ljava/lang/String;Z)V
Landroid/content/pm/IPackageDeleteObserver$Stub;-><init>()V
Landroid/content/pm/IPackageDeleteObserver;->packageDeleted(Ljava/lang/String;I)V
Landroid/content/pm/IPackageManager;->getActivityInfo(Landroid/content/ComponentName;II)Landroid/content/pm/ActivityInfo;
@@ -168,7 +166,6 @@
Landroid/net/IConnectivityManager;->getAllNetworkState()[Landroid/net/NetworkState;
Landroid/net/INetd$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/INetd;
Landroid/net/INetd;->interfaceAddAddress(Ljava/lang/String;Ljava/lang/String;I)V
-Landroid/net/INetworkPolicyManager$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/INetworkPolicyManager;
Landroid/net/INetworkPolicyManager;->getNetworkQuotaInfo(Landroid/net/NetworkState;)Landroid/net/NetworkQuotaInfo;
Landroid/net/INetworkStatsService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/INetworkStatsService;
Landroid/net/INetworkStatsService;->openSession()Landroid/net/INetworkStatsSession;
@@ -768,7 +765,6 @@
Lcom/android/internal/os/BatteryStatsImpl;->getPhoneSignalStrengthTime(IJI)J
Lcom/android/internal/os/BatteryStatsImpl;->getScreenBrightnessTime(IJI)J
Lcom/android/internal/os/BatteryStatsImpl;->getWifiOnTime(JI)J
-Lcom/android/internal/os/SomeArgs;->arg1:Ljava/lang/Object;
Lcom/android/internal/os/SomeArgs;->arg2:Ljava/lang/Object;
Lcom/android/internal/os/SomeArgs;->arg3:Ljava/lang/Object;
Lcom/android/internal/os/SomeArgs;->obtain()Lcom/android/internal/os/SomeArgs;
diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
index 452225c..ed684d7 100644
--- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
+++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java
@@ -302,7 +302,16 @@
/**
* This flag requests that all fingerprint gestures be sent to the accessibility service.
- * It is handled in {@link FingerprintGestureController}
+ * <p>
+ * Services that want to set this flag have to declare the capability
+ * to retrieve window content in their meta-data by setting the attribute
+ * {@link android.R.attr#canRequestFingerprintGestures} to
+ * true, otherwise this flag will be ignored. For how to declare the meta-data
+ * of a service refer to {@value AccessibilityService#SERVICE_META_DATA}.
+ * </p>
+ *
+ * @see android.R.styleable#AccessibilityService_canRequestFingerprintGestures
+ * @see AccessibilityService#getFingerprintGestureController()
*/
public static final int FLAG_REQUEST_FINGERPRINT_GESTURES = 0x00000200;
diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java
index a44bd03..07b4b9c 100644
--- a/core/java/android/app/AlertDialog.java
+++ b/core/java/android/app/AlertDialog.java
@@ -16,8 +16,6 @@
package android.app;
-import com.android.internal.app.AlertController;
-
import android.annotation.ArrayRes;
import android.annotation.AttrRes;
import android.annotation.DrawableRes;
@@ -30,17 +28,19 @@
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.os.Message;
+import android.text.Layout;
+import android.text.method.MovementMethod;
import android.util.TypedValue;
import android.view.ContextThemeWrapper;
import android.view.KeyEvent;
import android.view.View;
-import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.ListAdapter;
import android.widget.ListView;
import com.android.internal.R;
+import com.android.internal.app.AlertController;
/**
* A subclass of Dialog that can display one, two or three buttons. If you only want to
@@ -54,7 +54,7 @@
* </pre>
*
* <p>The AlertDialog class takes care of automatically setting
- * {@link WindowManager.LayoutParams#FLAG_ALT_FOCUSABLE_IM
+ * {@link android.view.WindowManager.LayoutParams#FLAG_ALT_FOCUSABLE_IM
* WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM} for you based on whether
* any views in the dialog return true from {@link View#onCheckIsTextEditor()
* View.onCheckIsTextEditor()}. Generally you want this set for a Dialog
@@ -266,6 +266,17 @@
mAlert.setMessage(message);
}
+ /** @hide */
+ public void setMessageMovementMethod(MovementMethod movementMethod) {
+ mAlert.setMessageMovementMethod(movementMethod);
+ }
+
+ /** @hide */
+ public void setMessageHyphenationFrequency(
+ @Layout.HyphenationFrequency int hyphenationFrequency) {
+ mAlert.setMessageHyphenationFrequency(hyphenationFrequency);
+ }
+
/**
* Set the view to display in that dialog.
*/
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index ab0001c..dcf4eec 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -109,6 +109,48 @@
*/
public static final int MODE_DEFAULT = 3;
+ /**
+ * Metrics about an op when its uid is persistent.
+ * @hide
+ */
+ public static final int UID_STATE_PERSISTENT = 0;
+
+ /**
+ * Metrics about an op when its uid is at the top.
+ * @hide
+ */
+ public static final int UID_STATE_TOP = 1;
+
+ /**
+ * Metrics about an op when its uid is running a foreground service.
+ * @hide
+ */
+ public static final int UID_STATE_FOREGROUND_SERVICE = 2;
+
+ /**
+ * Metrics about an op when its uid is in the foreground for any other reasons.
+ * @hide
+ */
+ public static final int UID_STATE_FOREGROUND = 3;
+
+ /**
+ * Metrics about an op when its uid is in the background for any reason.
+ * @hide
+ */
+ public static final int UID_STATE_BACKGROUND = 4;
+
+ /**
+ * Metrics about an op when its uid is cached.
+ * @hide
+ */
+ public static final int UID_STATE_CACHED = 5;
+
+ /**
+ * Number of uid states we track.
+ * @hide
+ */
+ public static final int _NUM_UID_STATE = 6;
+
// when adding one of these:
// - increment _NUM_OP
// - define an OPSTR_* constant (marked as @SystemApi)
@@ -1471,8 +1513,8 @@
public static class OpEntry implements Parcelable {
private final int mOp;
private final int mMode;
- private final long mTime;
- private final long mRejectTime;
+ private final long[] mTimes;
+ private final long[] mRejectTimes;
private final int mDuration;
private final int mProxyUid;
private final String mProxyPackageName;
@@ -1481,8 +1523,23 @@
int proxyUid, String proxyPackage) {
mOp = op;
mMode = mode;
- mTime = time;
- mRejectTime = rejectTime;
+ mTimes = new long[_NUM_UID_STATE];
+ mRejectTimes = new long[_NUM_UID_STATE];
+ mTimes[0] = time;
+ mRejectTimes[0] = rejectTime;
+ mDuration = duration;
+ mProxyUid = proxyUid;
+ mProxyPackageName = proxyPackage;
+ }
+
+ public OpEntry(int op, int mode, long[] times, long[] rejectTimes, int duration,
+ int proxyUid, String proxyPackage) {
+ mOp = op;
+ mMode = mode;
+ mTimes = new long[_NUM_UID_STATE];
+ mRejectTimes = new long[_NUM_UID_STATE];
+ System.arraycopy(times, 0, mTimes, 0, _NUM_UID_STATE);
+ System.arraycopy(rejectTimes, 0, mRejectTimes, 0, _NUM_UID_STATE);
mDuration = duration;
mProxyUid = proxyUid;
mProxyPackageName = proxyPackage;
@@ -1497,11 +1554,31 @@
}
public long getTime() {
- return mTime;
+ long time = 0;
+ for (int i = 0; i < _NUM_UID_STATE; i++) {
+ if (mTimes[i] > time) {
+ time = mTimes[i];
+ }
+ }
+ return time;
+ }
+
+ public long getTimeFor(int uidState) {
+ return mTimes[uidState];
}
public long getRejectTime() {
- return mRejectTime;
+ long time = 0;
+ for (int i = 0; i < _NUM_UID_STATE; i++) {
+ if (mRejectTimes[i] > time) {
+ time = mRejectTimes[i];
+ }
+ }
+ return time;
+ }
+
+ public long getRejectTimeFor(int uidState) {
+ return mRejectTimes[uidState];
}
public boolean isRunning() {
@@ -1509,7 +1586,7 @@
}
public int getDuration() {
- return mDuration == -1 ? (int)(System.currentTimeMillis()-mTime) : mDuration;
+ return mDuration;
}
public int getProxyUid() {
@@ -1529,8 +1606,8 @@
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mOp);
dest.writeInt(mMode);
- dest.writeLong(mTime);
- dest.writeLong(mRejectTime);
+ dest.writeLongArray(mTimes);
+ dest.writeLongArray(mRejectTimes);
dest.writeInt(mDuration);
dest.writeInt(mProxyUid);
dest.writeString(mProxyPackageName);
@@ -1539,8 +1616,8 @@
OpEntry(Parcel source) {
mOp = source.readInt();
mMode = source.readInt();
- mTime = source.readLong();
- mRejectTime = source.readLong();
+ mTimes = source.createLongArray();
+ mRejectTimes = source.createLongArray();
mDuration = source.readInt();
mProxyUid = source.readInt();
mProxyPackageName = source.readString();
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index eeec7ca..c5b8019 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -5553,7 +5553,8 @@
*
* @hide
*/
- public static Notification maybeCloneStrippedForDelivery(Notification n, boolean isLowRam) {
+ public static Notification maybeCloneStrippedForDelivery(Notification n, boolean isLowRam,
+ Context context) {
String templateClass = n.extras.getString(EXTRA_TEMPLATE);
// Only strip views for known Styles because we won't know how to
@@ -5595,9 +5596,13 @@
clone.extras.remove(EXTRA_REBUILD_HEADS_UP_CONTENT_VIEW_ACTION_COUNT);
}
if (isLowRam) {
- clone.extras.remove(Notification.TvExtender.EXTRA_TV_EXTENDER);
- clone.extras.remove(WearableExtender.EXTRA_WEARABLE_EXTENSIONS);
- clone.extras.remove(CarExtender.EXTRA_CAR_EXTENDER);
+ String[] allowedServices = context.getResources().getStringArray(
+ R.array.config_allowedManagedServicesOnLowRamDevices);
+ if (allowedServices.length == 0) {
+ clone.extras.remove(Notification.TvExtender.EXTRA_TV_EXTENDER);
+ clone.extras.remove(WearableExtender.EXTRA_WEARABLE_EXTENSIONS);
+ clone.extras.remove(CarExtender.EXTRA_CAR_EXTENDER);
+ }
}
return clone;
}
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index 93be932..f6dc5d1 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -399,7 +399,8 @@
ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE);
boolean isLowRam = am.isLowRamDevice();
- final Notification copy = Builder.maybeCloneStrippedForDelivery(notification, isLowRam);
+ final Notification copy = Builder.maybeCloneStrippedForDelivery(notification, isLowRam,
+ mContext);
try {
service.enqueueNotificationWithTag(pkg, mContext.getOpPackageName(), tag, id,
copy, user.getIdentifier());
diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java
index 46566e7..21d6762 100644
--- a/core/java/android/app/WindowConfiguration.java
+++ b/core/java/android/app/WindowConfiguration.java
@@ -495,7 +495,15 @@
* @hide
*/
public boolean tasksAreFloating() {
- return mWindowingMode == WINDOWING_MODE_FREEFORM || mWindowingMode == WINDOWING_MODE_PINNED;
+ return isFloating(mWindowingMode);
+ }
+
+ /**
+ * Returns true if the windowingMode represents a floating window.
+ * @hide
+ */
+ public static boolean isFloating(int windowingMode) {
+ return windowingMode == WINDOWING_MODE_FREEFORM || windowingMode == WINDOWING_MODE_PINNED;
}
/**
diff --git a/core/java/android/app/usage/EventList.java b/core/java/android/app/usage/EventList.java
new file mode 100644
index 0000000..aaae57e5
--- /dev/null
+++ b/core/java/android/app/usage/EventList.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2018 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.app.usage;
+
+import java.util.ArrayList;
+
+/**
+ * A container to keep {@link UsageEvents.Event usage events} in non-descending order of their
+ * {@link UsageEvents.Event#mTimeStamp timestamps}.
+ *
+ * @hide
+ */
+public class EventList {
+
+ private final ArrayList<UsageEvents.Event> mEvents;
+
+ /**
+ * Create a new event list with default capacity
+ */
+ public EventList() {
+ mEvents = new ArrayList<>();
+ }
+
+ /**
+ * Returns the size of the list
+ * @return the number of events in the list
+ */
+ public int size() {
+ return mEvents.size();
+ }
+
+ /**
+ * Removes all events from the list
+ */
+ public void clear() {
+ mEvents.clear();
+ }
+
+ /**
+ * Returns the {@link UsageEvents.Event event} at the specified position in this list.
+ * @param index the index of the event to return, such that {@code 0 <= index < size()}
+ * @return The {@link UsageEvents.Event event} at position {@code index}
+ */
+ public UsageEvents.Event get(int index) {
+ return mEvents.get(index);
+ }
+
+ /**
+ * Inserts the given {@link UsageEvents.Event event} into the list while keeping the list sorted
+ * based on the event {@link UsageEvents.Event#mTimeStamp timestamps}.
+ *
+ * @param event The event to insert
+ */
+ public void insert(UsageEvents.Event event) {
+ final int size = mEvents.size();
+ // fast case: just append if this is the latest event
+ if (size == 0 || event.mTimeStamp >= mEvents.get(size - 1).mTimeStamp) {
+ mEvents.add(event);
+ return;
+ }
+ // To minimize number of elements being shifted, insert at the first occurrence of the next
+ // greatest timestamp in the list.
+ final int insertIndex = firstIndexOnOrAfter(event.mTimeStamp + 1);
+ mEvents.add(insertIndex, event);
+ }
+
+ /**
+ * Finds the index of the first event whose timestamp is greater than or equal to the given
+ * timestamp.
+ *
+ * @param timeStamp The timestamp for which to search the list.
+ * @return The smallest {@code index} for which {@code (get(index).mTimeStamp >= timeStamp)} is
+ * {@code true}, or {@link #size() size} if no such {@code index} exists.
+ */
+ public int firstIndexOnOrAfter(long timeStamp) {
+ final int size = mEvents.size();
+ int result = size;
+ int lo = 0;
+ int hi = size - 1;
+ while (lo <= hi) {
+ final int mid = (lo + hi) >>> 1;
+ final long midTimeStamp = mEvents.get(mid).mTimeStamp;
+ if (midTimeStamp >= timeStamp) {
+ hi = mid - 1;
+ result = mid;
+ } else {
+ lo = mid + 1;
+ }
+ }
+ return result;
+ }
+}
diff --git a/core/java/android/app/usage/TimeSparseArray.java b/core/java/android/app/usage/TimeSparseArray.java
index 4ec0e9e..2bd6b24 100644
--- a/core/java/android/app/usage/TimeSparseArray.java
+++ b/core/java/android/app/usage/TimeSparseArray.java
@@ -27,14 +27,12 @@
public class TimeSparseArray<E> extends LongSparseArray<E> {
private static final String TAG = TimeSparseArray.class.getSimpleName();
+ private boolean mWtfReported;
+
public TimeSparseArray() {
super();
}
- public TimeSparseArray(int initialCapacity) {
- super(initialCapacity);
- }
-
/**
* Finds the index of the first element whose timestamp is greater or equal to
* the given time.
@@ -75,22 +73,16 @@
/**
* {@inheritDoc}
*
- * Overridden to ensure no collisions. The key (time in milliseconds) is incremented till an
- * empty place is found.
+ * <p> As this container is being used only to keep {@link android.util.AtomicFile files},
+ * there should not be any collisions. Reporting a {@link Slog#wtf(String, String)} in case that
+ * happens, as that will lead to one whole file being dropped.
*/
@Override
public void put(long key, E value) {
- final long origKey = key;
- int keyIndex = indexOfKey(key);
- if (keyIndex >= 0) {
- final long sz = size();
- while (keyIndex < sz && keyAt(keyIndex) == key) {
- key++;
- keyIndex++;
- }
- if (key >= origKey + 100) {
- Slog.w(TAG, "Value " + value + " supposed to be inserted at " + origKey
- + " displaced to " + key);
+ if (indexOfKey(key) >= 0) {
+ if (!mWtfReported) {
+ Slog.wtf(TAG, "Overwriting value " + get(key) + " by " + value);
+ mWtfReported = true;
}
}
super.put(key, value);
diff --git a/core/java/android/hardware/camera2/legacy/SurfaceTextureRenderer.java b/core/java/android/hardware/camera2/legacy/SurfaceTextureRenderer.java
index a05a8ec..83a0228 100644
--- a/core/java/android/hardware/camera2/legacy/SurfaceTextureRenderer.java
+++ b/core/java/android/hardware/camera2/legacy/SurfaceTextureRenderer.java
@@ -529,14 +529,32 @@
private boolean swapBuffers(EGLSurface surface)
throws LegacyExceptionUtils.BufferQueueAbandonedException {
boolean result = EGL14.eglSwapBuffers(mEGLDisplay, surface);
+
int error = EGL14.eglGetError();
- if (error == EGL14.EGL_BAD_SURFACE) {
- throw new LegacyExceptionUtils.BufferQueueAbandonedException();
- } else if (error != EGL14.EGL_SUCCESS) {
- throw new IllegalStateException("swapBuffers: EGL error: 0x" +
- Integer.toHexString(error));
+ switch (error) {
+ case EGL14.EGL_SUCCESS:
+ return result;
+
+ // Check for an abandoned buffer queue, or other error conditions out
+ // of the user's control.
+ //
+ // From the EGL 1.4 spec (2013-12-04), Section 3.9.4 Posting Errors:
+ //
+ // If eglSwapBuffers is called and the native window associated with
+ // surface is no longer valid, an EGL_BAD_NATIVE_WINDOW error is
+ // generated.
+ //
+ // We also interpret EGL_BAD_SURFACE as indicating an abandoned
+ // surface, even though the EGL spec does not document it as such, for
+ // backwards compatibility with older versions of this file.
+ case EGL14.EGL_BAD_NATIVE_WINDOW:
+ case EGL14.EGL_BAD_SURFACE:
+ throw new LegacyExceptionUtils.BufferQueueAbandonedException();
+
+ default:
+ throw new IllegalStateException(
+ "swapBuffers: EGL error: 0x" + Integer.toHexString(error));
}
- return result;
}
private void checkEglError(String msg) {
diff --git a/core/java/android/net/IpSecManager.java b/core/java/android/net/IpSecManager.java
index a61ea50..d4c3edc 100644
--- a/core/java/android/net/IpSecManager.java
+++ b/core/java/android/net/IpSecManager.java
@@ -26,6 +26,9 @@
import android.os.Binder;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
+import android.os.ServiceSpecificException;
+import android.system.ErrnoException;
+import android.system.OsConstants;
import android.util.AndroidException;
import android.util.Log;
@@ -172,11 +175,16 @@
public void close() {
try {
mService.releaseSecurityParameterIndex(mResourceId);
- mResourceId = INVALID_RESOURCE_ID;
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
+ } catch (Exception e) {
+ // On close we swallow all random exceptions since failure to close is not
+ // actionable by the user.
+ Log.e(TAG, "Failed to close " + this + ", Exception=" + e);
+ } finally {
+ mResourceId = INVALID_RESOURCE_ID;
+ mCloseGuard.close();
}
- mCloseGuard.close();
}
/** Check that the SPI was closed properly. */
@@ -227,7 +235,6 @@
throw new RuntimeException(
"Invalid Resource ID returned by IpSecService: " + status);
}
-
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -239,6 +246,17 @@
public int getResourceId() {
return mResourceId;
}
+
+ @Override
+ public String toString() {
+ return new StringBuilder()
+ .append("SecurityParameterIndex{spi=")
+ .append(mSpi)
+ .append(",resourceId=")
+ .append(mResourceId)
+ .append("}")
+ .toString();
+ }
}
/**
@@ -261,7 +279,11 @@
mService,
destinationAddress,
IpSecManager.INVALID_SECURITY_PARAMETER_INDEX);
+ } catch (ServiceSpecificException e) {
+ throw rethrowUncheckedExceptionFromServiceSpecificException(e);
} catch (SpiUnavailableException unlikely) {
+ // Because this function allocates a totally random SPI, it really shouldn't ever
+ // fail to allocate an SPI; we simply need this because the exception is checked.
throw new ResourceUnavailableException("No SPIs available");
}
}
@@ -274,8 +296,8 @@
*
* @param destinationAddress the destination address for traffic bearing the requested SPI.
* For inbound traffic, the destination should be an address currently assigned on-device.
- * @param requestedSpi the requested SPI, or '0' to allocate a random SPI. The range 1-255 is
- * reserved and may not be used. See RFC 4303 Section 2.1.
+ * @param requestedSpi the requested SPI. The range 1-255 is reserved and may not be used. See
+ * RFC 4303 Section 2.1.
* @return the reserved SecurityParameterIndex
* @throws {@link #ResourceUnavailableException} indicating that too many SPIs are
* currently allocated for this user
@@ -289,7 +311,11 @@
if (requestedSpi == IpSecManager.INVALID_SECURITY_PARAMETER_INDEX) {
throw new IllegalArgumentException("Requested SPI must be a valid (non-zero) SPI");
}
- return new SecurityParameterIndex(mService, destinationAddress, requestedSpi);
+ try {
+ return new SecurityParameterIndex(mService, destinationAddress, requestedSpi);
+ } catch (ServiceSpecificException e) {
+ throw rethrowUncheckedExceptionFromServiceSpecificException(e);
+ }
}
/**
@@ -424,6 +450,8 @@
// constructor takes control and closes the user's FD when we exit the method.
try (ParcelFileDescriptor pfd = ParcelFileDescriptor.dup(socket)) {
mService.applyTransportModeTransform(pfd, direction, transform.getResourceId());
+ } catch (ServiceSpecificException e) {
+ throw rethrowCheckedExceptionFromServiceSpecificException(e);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -482,6 +510,8 @@
public void removeTransportModeTransforms(@NonNull FileDescriptor socket) throws IOException {
try (ParcelFileDescriptor pfd = ParcelFileDescriptor.dup(socket)) {
mService.removeTransportModeTransforms(pfd);
+ } catch (ServiceSpecificException e) {
+ throw rethrowCheckedExceptionFromServiceSpecificException(e);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -575,6 +605,13 @@
mResourceId = INVALID_RESOURCE_ID;
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
+ } catch (Exception e) {
+ // On close we swallow all random exceptions since failure to close is not
+ // actionable by the user.
+ Log.e(TAG, "Failed to close " + this + ", Exception=" + e);
+ } finally {
+ mResourceId = INVALID_RESOURCE_ID;
+ mCloseGuard.close();
}
try {
@@ -583,7 +620,6 @@
Log.e(TAG, "Failed to close UDP Encapsulation Socket with Port= " + mPort);
throw e;
}
- mCloseGuard.close();
}
/** Check that the socket was closed properly. */
@@ -600,6 +636,17 @@
public int getResourceId() {
return mResourceId;
}
+
+ @Override
+ public String toString() {
+ return new StringBuilder()
+ .append("UdpEncapsulationSocket{port=")
+ .append(mPort)
+ .append(",resourceId=")
+ .append(mResourceId)
+ .append("}")
+ .toString();
+ }
};
/**
@@ -627,7 +674,11 @@
if (port == 0) {
throw new IllegalArgumentException("Specified port must be a valid port number!");
}
- return new UdpEncapsulationSocket(mService, port);
+ try {
+ return new UdpEncapsulationSocket(mService, port);
+ } catch (ServiceSpecificException e) {
+ throw rethrowCheckedExceptionFromServiceSpecificException(e);
+ }
}
/**
@@ -650,7 +701,11 @@
@NonNull
public UdpEncapsulationSocket openUdpEncapsulationSocket()
throws IOException, ResourceUnavailableException {
- return new UdpEncapsulationSocket(mService, 0);
+ try {
+ return new UdpEncapsulationSocket(mService, 0);
+ } catch (ServiceSpecificException e) {
+ throw rethrowCheckedExceptionFromServiceSpecificException(e);
+ }
}
/**
@@ -696,6 +751,8 @@
try {
mService.addAddressToTunnelInterface(
mResourceId, new LinkAddress(address, prefixLen), mOpPackageName);
+ } catch (ServiceSpecificException e) {
+ throw rethrowCheckedExceptionFromServiceSpecificException(e);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -715,6 +772,8 @@
try {
mService.removeAddressFromTunnelInterface(
mResourceId, new LinkAddress(address, prefixLen), mOpPackageName);
+ } catch (ServiceSpecificException e) {
+ throw rethrowCheckedExceptionFromServiceSpecificException(e);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -767,11 +826,16 @@
public void close() {
try {
mService.deleteTunnelInterface(mResourceId, mOpPackageName);
- mResourceId = INVALID_RESOURCE_ID;
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
+ } catch (Exception e) {
+ // On close we swallow all random exceptions since failure to close is not
+ // actionable by the user.
+ Log.e(TAG, "Failed to close " + this + ", Exception=" + e);
+ } finally {
+ mResourceId = INVALID_RESOURCE_ID;
+ mCloseGuard.close();
}
- mCloseGuard.close();
}
/** Check that the Interface was closed properly. */
@@ -788,6 +852,17 @@
public int getResourceId() {
return mResourceId;
}
+
+ @Override
+ public String toString() {
+ return new StringBuilder()
+ .append("IpSecTunnelInterface{ifname=")
+ .append(mInterfaceName)
+ .append(",resourceId=")
+ .append(mResourceId)
+ .append("}")
+ .toString();
+ }
}
/**
@@ -810,8 +885,12 @@
public IpSecTunnelInterface createIpSecTunnelInterface(@NonNull InetAddress localAddress,
@NonNull InetAddress remoteAddress, @NonNull Network underlyingNetwork)
throws ResourceUnavailableException, IOException {
- return new IpSecTunnelInterface(
- mContext, mService, localAddress, remoteAddress, underlyingNetwork);
+ try {
+ return new IpSecTunnelInterface(
+ mContext, mService, localAddress, remoteAddress, underlyingNetwork);
+ } catch (ServiceSpecificException e) {
+ throw rethrowCheckedExceptionFromServiceSpecificException(e);
+ }
}
/**
@@ -838,6 +917,8 @@
mService.applyTunnelModeTransform(
tunnel.getResourceId(), direction,
transform.getResourceId(), mContext.getOpPackageName());
+ } catch (ServiceSpecificException e) {
+ throw rethrowCheckedExceptionFromServiceSpecificException(e);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -853,4 +934,44 @@
mContext = ctx;
mService = checkNotNull(service, "missing service");
}
+
+ private static void maybeHandleServiceSpecificException(ServiceSpecificException sse) {
+ // OsConstants are late binding, so switch statements can't be used.
+ if (sse.errorCode == OsConstants.EINVAL) {
+ throw new IllegalArgumentException(sse);
+ } else if (sse.errorCode == OsConstants.EAGAIN) {
+ throw new IllegalStateException(sse);
+ } else if (sse.errorCode == OsConstants.EOPNOTSUPP) {
+ throw new UnsupportedOperationException(sse);
+ }
+ }
+
+ /**
+ * Convert an Errno SSE to the correct Unchecked exception type.
+ *
+ * This method never actually returns.
+ */
+ // package
+ static RuntimeException
+ rethrowUncheckedExceptionFromServiceSpecificException(ServiceSpecificException sse) {
+ maybeHandleServiceSpecificException(sse);
+ throw new RuntimeException(sse);
+ }
+
+ /**
+ * Convert an Errno SSE to the correct Checked or Unchecked exception type.
+ *
+ * This method may throw IOException, or it may throw an unchecked exception; it will never
+ * actually return.
+ */
+ // package
+ static IOException rethrowCheckedExceptionFromServiceSpecificException(
+ ServiceSpecificException sse) throws IOException {
+ // First see if this is an unchecked exception of a type we know.
+ // If so, then we prefer the unchecked (specific) type of exception.
+ maybeHandleServiceSpecificException(sse);
+ // If not, then all we can do is provide the SSE in the form of an IOException.
+ throw new ErrnoException(
+ "IpSec encountered errno=" + sse.errorCode, sse.errorCode).rethrowAsIOException();
+ }
}
diff --git a/core/java/android/net/IpSecTransform.java b/core/java/android/net/IpSecTransform.java
index 62f7996..a12df28 100644
--- a/core/java/android/net/IpSecTransform.java
+++ b/core/java/android/net/IpSecTransform.java
@@ -28,6 +28,7 @@
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.ServiceSpecificException;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
@@ -136,6 +137,8 @@
mResourceId = result.resourceId;
Log.d(TAG, "Added Transform with Id " + mResourceId);
mCloseGuard.open("build");
+ } catch (ServiceSpecificException e) {
+ throw IpSecManager.rethrowUncheckedExceptionFromServiceSpecificException(e);
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
}
@@ -180,6 +183,10 @@
stopNattKeepalive();
} catch (RemoteException e) {
throw e.rethrowAsRuntimeException();
+ } catch (Exception e) {
+ // On close we swallow all random exceptions since failure to close is not
+ // actionable by the user.
+ Log.e(TAG, "Failed to close " + this + ", Exception=" + e);
} finally {
mResourceId = INVALID_RESOURCE_ID;
mCloseGuard.close();
@@ -502,4 +509,13 @@
mConfig = new IpSecConfig();
}
}
+
+ @Override
+ public String toString() {
+ return new StringBuilder()
+ .append("IpSecTransform{resourceId=")
+ .append(mResourceId)
+ .append("}")
+ .toString();
+ }
}
diff --git a/core/java/android/net/NetworkRequest.java b/core/java/android/net/NetworkRequest.java
index bd4a27c..227a4cb 100644
--- a/core/java/android/net/NetworkRequest.java
+++ b/core/java/android/net/NetworkRequest.java
@@ -228,7 +228,7 @@
* @param capability The capability to add to unwanted capability list.
* @return The builder to facilitate chaining.
*
- * @removed
+ * @hide
*/
public Builder addUnwantedCapability(@NetworkCapabilities.NetCapability int capability) {
mNetworkCapabilities.addUnwantedCapability(capability);
@@ -436,7 +436,7 @@
/**
* @see Builder#addUnwantedCapability(int)
*
- * @removed
+ * @hide
*/
public boolean hasUnwantedCapability(@NetCapability int capability) {
return networkCapabilities.hasUnwantedCapability(capability);
diff --git a/core/java/android/os/BaseBundle.java b/core/java/android/os/BaseBundle.java
index f5a7433..0fef78d 100644
--- a/core/java/android/os/BaseBundle.java
+++ b/core/java/android/os/BaseBundle.java
@@ -40,8 +40,9 @@
private static final String TAG = "Bundle";
static final boolean DEBUG = false;
- // Keep in sync with frameworks/native/libs/binder/PersistableBundle.cpp.
- static final int BUNDLE_MAGIC = 0x4C444E42; // 'B' 'N' 'D' 'L'
+ // Keep them in sync with frameworks/native/libs/binder/PersistableBundle.cpp.
+ private static final int BUNDLE_MAGIC = 0x4C444E42; // 'B' 'N' 'D' 'L'
+ private static final int BUNDLE_MAGIC_NATIVE = 0x4C444E44; // 'B' 'N' 'D' 'N'
/**
* Flag indicating that this Bundle is okay to "defuse." That is, it's okay
@@ -91,6 +92,11 @@
Parcel mParcelledData = null;
/**
+ * Whether {@link #mParcelledData} was generated by native coed or not.
+ */
+ private boolean mParcelledByNative;
+
+ /**
* The ClassLoader used when unparcelling data from mParcelledData.
*/
private ClassLoader mClassLoader;
@@ -223,7 +229,7 @@
synchronized (this) {
final Parcel source = mParcelledData;
if (source != null) {
- initializeFromParcelLocked(source, /*recycleParcel=*/ true);
+ initializeFromParcelLocked(source, /*recycleParcel=*/ true, mParcelledByNative);
} else {
if (DEBUG) {
Log.d(TAG, "unparcel "
@@ -234,7 +240,8 @@
}
}
- private void initializeFromParcelLocked(@NonNull Parcel parcelledData, boolean recycleParcel) {
+ private void initializeFromParcelLocked(@NonNull Parcel parcelledData, boolean recycleParcel,
+ boolean parcelledByNative) {
if (LOG_DEFUSABLE && sShouldDefuse && (mFlags & FLAG_DEFUSABLE) == 0) {
Slog.wtf(TAG, "Attempting to unparcel a Bundle while in transit; this may "
+ "clobber all data inside!", new Throwable());
@@ -251,6 +258,7 @@
mMap.erase();
}
mParcelledData = null;
+ mParcelledByNative = false;
return;
}
@@ -270,7 +278,15 @@
map.ensureCapacity(count);
}
try {
- parcelledData.readArrayMapInternal(map, count, mClassLoader);
+ if (parcelledByNative) {
+ // If it was parcelled by native code, then the array map keys aren't sorted
+ // by their hash codes, so use the safe (slow) one.
+ parcelledData.readArrayMapSafelyInternal(map, count, mClassLoader);
+ } else {
+ // If parcelled by Java, we know the contents are sorted properly,
+ // so we can use ArrayMap.append().
+ parcelledData.readArrayMapInternal(map, count, mClassLoader);
+ }
} catch (BadParcelableException e) {
if (sShouldDefuse) {
Log.w(TAG, "Failed to parse Bundle, but defusing quietly", e);
@@ -284,6 +300,7 @@
recycleParcel(parcelledData);
}
mParcelledData = null;
+ mParcelledByNative = false;
}
if (DEBUG) {
Log.d(TAG, "unparcel " + Integer.toHexString(System.identityHashCode(this))
@@ -403,14 +420,17 @@
if (from.mParcelledData != null) {
if (from.isEmptyParcel()) {
mParcelledData = NoImagePreloadHolder.EMPTY_PARCEL;
+ mParcelledByNative = false;
} else {
mParcelledData = Parcel.obtain();
mParcelledData.appendFrom(from.mParcelledData, 0,
from.mParcelledData.dataSize());
mParcelledData.setDataPosition(0);
+ mParcelledByNative = from.mParcelledByNative;
}
} else {
mParcelledData = null;
+ mParcelledByNative = false;
}
if (from.mMap != null) {
@@ -1538,7 +1558,7 @@
} else {
int length = mParcelledData.dataSize();
parcel.writeInt(length);
- parcel.writeInt(BUNDLE_MAGIC);
+ parcel.writeInt(mParcelledByNative ? BUNDLE_MAGIC_NATIVE : BUNDLE_MAGIC);
parcel.appendFrom(mParcelledData, 0, length);
}
return;
@@ -1585,11 +1605,14 @@
} else if (length == 0) {
// Empty Bundle or end of data.
mParcelledData = NoImagePreloadHolder.EMPTY_PARCEL;
+ mParcelledByNative = false;
return;
}
final int magic = parcel.readInt();
- if (magic != BUNDLE_MAGIC) {
+ final boolean isJavaBundle = magic == BUNDLE_MAGIC;
+ final boolean isNativeBundle = magic == BUNDLE_MAGIC_NATIVE;
+ if (!isJavaBundle && !isNativeBundle) {
throw new IllegalStateException("Bad magic number for Bundle: 0x"
+ Integer.toHexString(magic));
}
@@ -1598,7 +1621,7 @@
// If the parcel has a read-write helper, then we can't lazily-unparcel it, so just
// unparcel right away.
synchronized (this) {
- initializeFromParcelLocked(parcel, /*recycleParcel=*/ false);
+ initializeFromParcelLocked(parcel, /*recycleParcel=*/ false, isNativeBundle);
}
return;
}
@@ -1616,6 +1639,7 @@
p.setDataPosition(0);
mParcelledData = p;
+ mParcelledByNative = isNativeBundle;
}
/** {@hide} */
diff --git a/core/java/android/os/VibrationEffect.java b/core/java/android/os/VibrationEffect.java
index e9b4853..4d238c0 100644
--- a/core/java/android/os/VibrationEffect.java
+++ b/core/java/android/os/VibrationEffect.java
@@ -349,6 +349,26 @@
return new OneShot(mDuration, newAmplitude);
}
+ /**
+ * Resolve default values into integer amplitude numbers.
+ *
+ * @param defaultAmplitude the default amplitude to apply, must be between 0 and
+ * MAX_AMPLITUDE
+ * @return A {@link OneShot} effect with same physical meaning but explicitly set amplitude
+ *
+ * @hide
+ */
+ public OneShot resolve(int defaultAmplitude) {
+ if (defaultAmplitude > MAX_AMPLITUDE || defaultAmplitude < 0) {
+ throw new IllegalArgumentException(
+ "Amplitude is negative or greater than MAX_AMPLITUDE");
+ }
+ if (mAmplitude == DEFAULT_AMPLITUDE) {
+ return new OneShot(mDuration, defaultAmplitude);
+ }
+ return this;
+ }
+
@Override
public void validate() {
if (mAmplitude < -1 || mAmplitude == 0 || mAmplitude > 255) {
@@ -470,6 +490,30 @@
return new Waveform(mTimings, scaledAmplitudes, mRepeat);
}
+ /**
+ * Resolve default values into integer amplitude numbers.
+ *
+ * @param defaultAmplitude the default amplitude to apply, must be between 0 and
+ * MAX_AMPLITUDE
+ * @return A {@link Waveform} effect with same physical meaning but explicitly set
+ * amplitude
+ *
+ * @hide
+ */
+ public Waveform resolve(int defaultAmplitude) {
+ if (defaultAmplitude > MAX_AMPLITUDE || defaultAmplitude < 0) {
+ throw new IllegalArgumentException(
+ "Amplitude is negative or greater than MAX_AMPLITUDE");
+ }
+ int[] resolvedAmplitudes = Arrays.copyOf(mAmplitudes, mAmplitudes.length);
+ for (int i = 0; i < resolvedAmplitudes.length; i++) {
+ if (resolvedAmplitudes[i] == DEFAULT_AMPLITUDE) {
+ resolvedAmplitudes[i] = defaultAmplitude;
+ }
+ }
+ return new Waveform(mTimings, resolvedAmplitudes, mRepeat);
+ }
+
@Override
public void validate() {
if (mTimings.length != mAmplitudes.length) {
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 6b6e14f..fdae191 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -86,6 +86,7 @@
import android.view.textservice.TextServicesManager;
import com.android.internal.annotations.GuardedBy;
+import com.android.internal.app.ColorDisplayController;
import com.android.internal.widget.ILockSettings;
import java.io.IOException;
@@ -3147,7 +3148,9 @@
public static final String DISPLAY_COLOR_MODE = "display_color_mode";
private static final Validator DISPLAY_COLOR_MODE_VALIDATOR =
- new SettingsValidators.InclusiveIntegerRangeValidator(0, 2);
+ new SettingsValidators.InclusiveIntegerRangeValidator(
+ ColorDisplayController.COLOR_MODE_NATURAL,
+ ColorDisplayController.COLOR_MODE_AUTOMATIC);
/**
* The amount of time in milliseconds before the device goes to sleep or begins
@@ -10776,6 +10779,7 @@
* read_binary_cpu_time (boolean)
* proc_state_cpu_times_read_delay_ms (long)
* external_stats_collection_rate_limit_ms (long)
+ * battery_level_collection_delay_ms (long)
* </pre>
*
* <p>
@@ -10796,15 +10800,28 @@
public static final String SYNC_MANAGER_CONSTANTS = "sync_manager_constants";
/**
- * Whether or not App Standby feature is enabled. This controls throttling of apps
- * based on usage patterns and predictions.
+ * Whether or not App Standby feature is enabled by system. This controls throttling of apps
+ * based on usage patterns and predictions. Platform will turn on this feature if both this
+ * flag and {@link #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED} is on.
* Type: int (0 for false, 1 for true)
* Default: 1
* @hide
+ * @see #ADAPTIVE_BATTERY_MANAGEMENT_ENABLED
*/
public static final String APP_STANDBY_ENABLED = "app_standby_enabled";
/**
+ * Whether or not adaptive battery feature is enabled by user. Platform will turn on this
+ * feature if both this flag and {@link #APP_STANDBY_ENABLED} is on.
+ * Type: int (0 for false, 1 for true)
+ * Default: 1
+ * @hide
+ * @see #APP_STANDBY_ENABLED
+ */
+ public static final String ADAPTIVE_BATTERY_MANAGEMENT_ENABLED =
+ "adaptive_battery_management_enabled";
+
+ /**
* Whether or not app auto restriction is enabled. When it is enabled, settings app will
* auto restrict the app if it has bad behavior(e.g. hold wakelock for long time).
*
diff --git a/core/java/android/service/autofill/BatchUpdates.java b/core/java/android/service/autofill/BatchUpdates.java
index 90acc88..2ba0376 100644
--- a/core/java/android/service/autofill/BatchUpdates.java
+++ b/core/java/android/service/autofill/BatchUpdates.java
@@ -82,6 +82,9 @@
* {@link #transformChild(int, Transformation) transformations} are applied to the children
* views.
*
+ * <p>Theme does not work with RemoteViews layout. Avoid hardcoded text color
+ * or background color: Autofill on different platforms may have different themes.
+ *
* @param updates a {@link RemoteViews} with the updated actions to be applied in the
* underlying presentation template.
*
diff --git a/core/java/android/service/autofill/Dataset.java b/core/java/android/service/autofill/Dataset.java
index ccec483..5211767 100644
--- a/core/java/android/service/autofill/Dataset.java
+++ b/core/java/android/service/autofill/Dataset.java
@@ -336,6 +336,9 @@
* higher, datasets that require authentication can be also be filtered by passing a
* {@link AutofillValue#forText(CharSequence) text value} as the {@code value} parameter.
*
+ * <p>Theme does not work with RemoteViews layout. Avoid hardcoded text color
+ * or background color: Autofill on different platforms may have different themes.
+ *
* @param id id returned by {@link
* android.app.assist.AssistStructure.ViewNode#getAutofillId()}.
* @param value the value to be autofilled. Pass {@code null} if you do not have the value
diff --git a/core/java/android/service/autofill/FillResponse.java b/core/java/android/service/autofill/FillResponse.java
index 2bc4b8f..7bf1f83 100644
--- a/core/java/android/service/autofill/FillResponse.java
+++ b/core/java/android/service/autofill/FillResponse.java
@@ -241,6 +241,9 @@
* immutable by using {@link android.app.PendingIntent#FLAG_IMMUTABLE} as the
* platform needs to fill in the authentication arguments.
*
+ * <p>Theme does not work with RemoteViews layout. Avoid hardcoded text color
+ * or background color: Autofill on different platforms may have different themes.
+ *
* @param authentication Intent to an activity with your authentication flow.
* @param presentation The presentation to visualize the response.
* @param ids id of Views that when focused will display the authentication UI.
@@ -449,6 +452,9 @@
* authentication (as the header could have been set directly in the main presentation in
* these cases).
*
+ * <p>Theme does not work with RemoteViews layout. Avoid hardcoded text color
+ * or background color: Autofill on different platforms may have different themes.
+ *
* @param header a presentation to represent the header. This presentation is not clickable
* —calling
* {@link RemoteViews#setOnClickPendingIntent(int, android.app.PendingIntent)} on it would
@@ -477,6 +483,9 @@
* authentication (as the footer could have been set directly in the main presentation in
* these cases).
*
+ * <p>Theme does not work with RemoteViews layout. Avoid hardcoded text color
+ * or background color: Autofill on different platforms may have different themes.
+ *
* @param footer a presentation to represent the footer. This presentation is not clickable
* —calling
* {@link RemoteViews#setOnClickPendingIntent(int, android.app.PendingIntent)} on it would
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index 03f1c12..1c2e43e 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -2413,11 +2413,16 @@
/**
* Returns whether node represents a heading.
+ * <p><strong>Note:</strong> Returns {@code true} if either {@link #setHeading(boolean)}
+ * marks this node as a heading or if the node has a {@link CollectionItemInfo} that marks
+ * it as such, to accomodate apps that use the now-deprecated API.</p>
*
* @return {@code true} if the node is a heading, {@code false} otherwise.
*/
public boolean isHeading() {
- return getBooleanProperty(BOOLEAN_PROPERTY_IS_HEADING);
+ if (getBooleanProperty(BOOLEAN_PROPERTY_IS_HEADING)) return true;
+ CollectionItemInfo itemInfo = getCollectionItemInfo();
+ return ((itemInfo != null) && itemInfo.mHeading);
}
/**
@@ -3437,6 +3442,7 @@
mPackageName = other.mPackageName;
mClassName = other.mClassName;
mText = other.mText;
+ mOriginalText = other.mOriginalText;
mHintText = other.mHintText;
mError = other.mError;
mContentDescription = other.mContentDescription;
diff --git a/core/java/android/view/autofill/AutofillPopupWindow.java b/core/java/android/view/autofill/AutofillPopupWindow.java
index a6495d1..8266207 100644
--- a/core/java/android/view/autofill/AutofillPopupWindow.java
+++ b/core/java/android/view/autofill/AutofillPopupWindow.java
@@ -19,6 +19,7 @@
import static android.view.autofill.Helper.sVerbose;
import android.annotation.NonNull;
+import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.IBinder;
@@ -79,11 +80,6 @@
public AutofillPopupWindow(@NonNull IAutofillWindowPresenter presenter) {
mWindowPresenter = new WindowPresenter(presenter);
- // We want to show the window as system controlled one so it covers app windows, but it has
- // to be an application type (so it's contained inside the application area).
- // Hence, we set it to the application type with the highest z-order, which currently
- // is TYPE_APPLICATION_ABOVE_SUB_PANEL.
- setWindowLayoutType(WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL);
setTouchModal(false);
setOutsideTouchable(true);
setInputMethodMode(INPUT_METHOD_NOT_NEEDED);
@@ -110,7 +106,16 @@
*/
public void update(View anchor, int offsetX, int offsetY, int width, int height,
Rect virtualBounds) {
- mFullScreen = width == LayoutParams.MATCH_PARENT && height == LayoutParams.MATCH_PARENT;
+ mFullScreen = width == LayoutParams.MATCH_PARENT;
+ // For no fullscreen autofill window, we want to show the window as system controlled one
+ // so it covers app windows, but it has to be an application type (so it's contained inside
+ // the application area). Hence, we set it to the application type with the highest z-order,
+ // which currently is TYPE_APPLICATION_ABOVE_SUB_PANEL.
+ // For fullscreen mode, autofill window is at the bottom of screen, it should not be
+ // clipped by app activity window. Fullscreen autofill window does not need to follow app
+ // anchor view position.
+ setWindowLayoutType(mFullScreen ? WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG
+ : WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL);
// If we are showing the popup for a virtual view we use a fake view which
// delegates to the anchor but present itself with the same bounds as the
// virtual view. This ensures that the location logic in popup works
@@ -119,6 +124,15 @@
if (mFullScreen) {
offsetX = 0;
offsetY = 0;
+ // If it is not fullscreen height, put window at bottom. Computes absolute position.
+ // Note that we cannot easily change default gravity from Gravity.TOP to
+ // Gravity.BOTTOM because PopupWindow base class does not expose computeGravity().
+ final Point outPoint = new Point();
+ anchor.getContext().getDisplay().getSize(outPoint);
+ width = outPoint.x;
+ if (height != LayoutParams.MATCH_PARENT) {
+ offsetY = outPoint.y - height;
+ }
actualAnchor = anchor;
} else if (virtualBounds != null) {
final int[] mLocationOnScreen = new int[] {virtualBounds.left, virtualBounds.top};
@@ -202,6 +216,16 @@
actualAnchor = anchor;
}
+ if (!mFullScreen) {
+ // No fullscreen window animation is controlled by PopupWindow.
+ setAnimationStyle(-1);
+ } else if (height == LayoutParams.MATCH_PARENT) {
+ // Complete fullscreen autofill window has no animation.
+ setAnimationStyle(0);
+ } else {
+ // Slide half screen height autofill window from bottom.
+ setAnimationStyle(com.android.internal.R.style.AutofillHalfScreenAnimation);
+ }
if (!isShowing()) {
setWidth(width);
setHeight(height);
@@ -223,7 +247,12 @@
protected boolean findDropDownPosition(View anchor, LayoutParams outParams,
int xOffset, int yOffset, int width, int height, int gravity, boolean allowScroll) {
if (mFullScreen) {
- // Do not patch LayoutParams if force full screen
+ // In fullscreen mode, don't need consider the anchor view.
+ outParams.x = xOffset;
+ outParams.y = yOffset;
+ outParams.width = width;
+ outParams.height = height;
+ outParams.gravity = gravity;
return false;
}
return super.findDropDownPosition(anchor, outParams, xOffset, yOffset,
@@ -316,11 +345,6 @@
}
@Override
- public void setAnimationStyle(int animationStyle) {
- throw new IllegalStateException("You can't call this!");
- }
-
- @Override
public void setBackgroundDrawable(Drawable background) {
throw new IllegalStateException("You can't call this!");
}
diff --git a/core/java/android/widget/Magnifier.java b/core/java/android/widget/Magnifier.java
index cb362e6..f1a1457 100644
--- a/core/java/android/widget/Magnifier.java
+++ b/core/java/android/widget/Magnifier.java
@@ -170,7 +170,7 @@
if (mWindow == null) {
synchronized (mLock) {
mWindow = new InternalPopupWindow(mView.getContext(), mView.getDisplay(),
- getValidViewSurface(),
+ getValidParentSurfaceForMagnifier(),
mWindowWidth, mWindowHeight, mWindowElevation, mWindowCornerRadius,
Handler.getMain() /* draw the magnifier on the UI thread */, mLock,
mCallback);
@@ -245,18 +245,20 @@
}
@Nullable
- private Surface getValidViewSurface() {
- // TODO: deduplicate this against the first part of #performPixelCopy
- final Surface surface;
- if (mView instanceof SurfaceView) {
- surface = ((SurfaceView) mView).getHolder().getSurface();
- } else if (mView.getViewRootImpl() != null) {
- surface = mView.getViewRootImpl().mSurface;
- } else {
- surface = null;
+ private Surface getValidParentSurfaceForMagnifier() {
+ if (mView.getViewRootImpl() != null) {
+ final Surface mainWindowSurface = mView.getViewRootImpl().mSurface;
+ if (mainWindowSurface != null && mainWindowSurface.isValid()) {
+ return mainWindowSurface;
+ }
}
-
- return (surface != null && surface.isValid()) ? surface : null;
+ if (mView instanceof SurfaceView) {
+ final Surface surfaceViewSurface = ((SurfaceView) mView).getHolder().getSurface();
+ if (surfaceViewSurface != null && surfaceViewSurface.isValid()) {
+ return surfaceViewSurface;
+ }
+ }
+ return null;
}
private void configureCoordinates(final float xPosInView, final float yPosInView) {
@@ -264,12 +266,12 @@
// magnifier. These are relative to the surface the content is copied from.
final float posX;
final float posY;
+ mView.getLocationInSurface(mViewCoordinatesInSurface);
if (mView instanceof SurfaceView) {
// No offset required if the backing Surface matches the size of the SurfaceView.
posX = xPosInView;
posY = yPosInView;
} else {
- mView.getLocationInSurface(mViewCoordinatesInSurface);
posX = xPosInView + mViewCoordinatesInSurface[0];
posY = yPosInView + mViewCoordinatesInSurface[1];
}
@@ -282,6 +284,14 @@
R.dimen.magnifier_offset);
mWindowCoords.x = mCenterZoomCoords.x - mWindowWidth / 2;
mWindowCoords.y = mCenterZoomCoords.y - mWindowHeight / 2 - verticalOffset;
+ if (mView instanceof SurfaceView && mView.getViewRootImpl() != null) {
+ // TODO: deduplicate against the first part of #getValidParentSurfaceForMagnifier()
+ final Surface mainWindowSurface = mView.getViewRootImpl().mSurface;
+ if (mainWindowSurface != null && mainWindowSurface.isValid()) {
+ mWindowCoords.x += mViewCoordinatesInSurface[0];
+ mWindowCoords.y += mViewCoordinatesInSurface[1];
+ }
+ }
}
private void performPixelCopy(final int startXInSurface, final int startYInSurface,
@@ -361,6 +371,9 @@
// The alpha set on the magnifier's content, which defines how
// prominent the white background is.
private static final int CONTENT_BITMAP_ALPHA = 242;
+ // The z of the magnifier surface, defining its z order in the list of
+ // siblings having the same parent surface (usually the main app surface).
+ private static final int SURFACE_Z = 5;
// Display associated to the view the magnifier is attached to.
private final Display mDisplay;
@@ -602,6 +615,7 @@
mSurfaceControl.setPosition(pendingX, pendingY);
}
if (firstDraw) {
+ mSurfaceControl.setLayer(SURFACE_Z);
mSurfaceControl.show();
}
SurfaceControl.closeTransaction();
diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java
index 5ecbf90a..4865dab 100644
--- a/core/java/android/widget/RemoteViews.java
+++ b/core/java/android/widget/RemoteViews.java
@@ -21,6 +21,7 @@
import android.annotation.ColorInt;
import android.annotation.DimenRes;
import android.annotation.NonNull;
+import android.annotation.StyleRes;
import android.app.ActivityOptions;
import android.app.ActivityThread;
import android.app.Application;
@@ -56,6 +57,7 @@
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.Log;
+import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.LayoutInflater.Filter;
import android.view.RemotableViewMethod;
@@ -182,6 +184,12 @@
private boolean mIsRoot = true;
/**
+ * Optional theme resource id applied in inflateView(). When 0, Theme.DeviceDefault will be
+ * used.
+ */
+ private int mApplyThemeResId;
+
+ /**
* Whether reapply is disallowed on this remoteview. This maybe be true if some actions modify
* the layout in a way that isn't recoverable, since views are being removed.
*/
@@ -3267,6 +3275,14 @@
}
/**
+ * Set the theme used in apply() and applyASync().
+ * @hide
+ */
+ public void setApplyTheme(@StyleRes int themeResId) {
+ mApplyThemeResId = themeResId;
+ }
+
+ /**
* Inflates the view hierarchy represented by this object and applies
* all of the actions.
*
@@ -3301,6 +3317,10 @@
final Context contextForResources = getContextForResources(context);
Context inflationContext = new RemoteViewsContextWrapper(context, contextForResources);
+ // If mApplyThemeResId is not given, Theme.DeviceDefault will be used.
+ if (mApplyThemeResId != 0) {
+ inflationContext = new ContextThemeWrapper(inflationContext, mApplyThemeResId);
+ }
LayoutInflater inflater = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
diff --git a/core/java/android/widget/StackView.java b/core/java/android/widget/StackView.java
index 1b9055c..6cc86b9 100644
--- a/core/java/android/widget/StackView.java
+++ b/core/java/android/widget/StackView.java
@@ -28,7 +28,6 @@
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.RectF;
-import android.graphics.Region;
import android.graphics.TableMaskFilter;
import android.os.Bundle;
import android.util.AttributeSet;
@@ -550,8 +549,8 @@
// We only expand the clip bounds if necessary.
if (expandClipRegion) {
- canvas.save(Canvas.CLIP_SAVE_FLAG);
- canvas.clipRect(stackInvalidateRect, Region.Op.UNION);
+ canvas.save();
+ canvas.clipRectUnion(stackInvalidateRect);
super.dispatchDraw(canvas);
canvas.restore();
} else {
diff --git a/core/java/com/android/internal/app/AlertController.java b/core/java/com/android/internal/app/AlertController.java
index 46cb546..7321721 100644
--- a/core/java/com/android/internal/app/AlertController.java
+++ b/core/java/com/android/internal/app/AlertController.java
@@ -30,7 +30,10 @@
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Message;
+import android.text.Layout;
import android.text.TextUtils;
+import android.text.method.LinkMovementMethod;
+import android.text.method.MovementMethod;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity;
@@ -101,6 +104,9 @@
private ImageView mIconView;
private TextView mTitleView;
protected TextView mMessageView;
+ private MovementMethod mMessageMovementMethod;
+ @Layout.HyphenationFrequency
+ private Integer mMessageHyphenationFrequency;
private View mCustomTitleView;
private boolean mForceInverseBackground;
@@ -290,6 +296,21 @@
}
}
+ public void setMessageMovementMethod(MovementMethod movementMethod) {
+ mMessageMovementMethod = movementMethod;
+ if (mMessageView != null) {
+ mMessageView.setMovementMethod(movementMethod);
+ }
+ }
+
+ public void setMessageHyphenationFrequency(
+ @Layout.HyphenationFrequency int hyphenationFrequency) {
+ mMessageHyphenationFrequency = hyphenationFrequency;
+ if (mMessageView != null) {
+ mMessageView.setHyphenationFrequency(hyphenationFrequency);
+ }
+ }
+
/**
* Set the view resource to display in the dialog.
*/
@@ -676,6 +697,12 @@
if (mMessage != null) {
mMessageView.setText(mMessage);
+ if (mMessageMovementMethod != null) {
+ mMessageView.setMovementMethod(mMessageMovementMethod);
+ }
+ if (mMessageHyphenationFrequency != null) {
+ mMessageView.setHyphenationFrequency(mMessageHyphenationFrequency);
+ }
} else {
mMessageView.setVisibility(View.GONE);
mScrollView.removeView(mMessageView);
diff --git a/core/java/com/android/internal/app/ColorDisplayController.java b/core/java/com/android/internal/app/ColorDisplayController.java
index f1539ee..6cc964b 100644
--- a/core/java/com/android/internal/app/ColorDisplayController.java
+++ b/core/java/com/android/internal/app/ColorDisplayController.java
@@ -82,7 +82,7 @@
public static final int AUTO_MODE_TWILIGHT = 2;
@Retention(RetentionPolicy.SOURCE)
- @IntDef({ COLOR_MODE_NATURAL, COLOR_MODE_BOOSTED, COLOR_MODE_SATURATED })
+ @IntDef({ COLOR_MODE_NATURAL, COLOR_MODE_BOOSTED, COLOR_MODE_SATURATED, COLOR_MODE_AUTOMATIC })
public @interface ColorMode {}
/**
@@ -103,12 +103,12 @@
* @see #setColorMode(int)
*/
public static final int COLOR_MODE_SATURATED = 2;
-
/**
- * See com.android.server.display.DisplayTransformManager.
+ * Color mode with automatic colors.
+ *
+ * @see #setColorMode(int)
*/
- private static final String PERSISTENT_PROPERTY_SATURATION = "persist.sys.sf.color_saturation";
- private static final String PERSISTENT_PROPERTY_NATIVE_MODE = "persist.sys.sf.native_mode";
+ public static final int COLOR_MODE_AUTOMATIC = 3;
private final Context mContext;
private final int mUserId;
@@ -362,6 +362,41 @@
}
/**
+ * Get the current color mode from system properties, or return -1.
+ *
+ * See com.android.server.display.DisplayTransformManager.
+ */
+ private @ColorMode int getCurrentColorModeFromSystemProperties() {
+ int displayColorSetting = SystemProperties.getInt("persist.sys.sf.native_mode", 0);
+ if (displayColorSetting == 0) {
+ return "1.0".equals(SystemProperties.get("persist.sys.sf.color_saturation"))
+ ? COLOR_MODE_NATURAL : COLOR_MODE_BOOSTED;
+ } else if (displayColorSetting == 1) {
+ return COLOR_MODE_SATURATED;
+ } else if (displayColorSetting == 2) {
+ return COLOR_MODE_AUTOMATIC;
+ } else {
+ return -1;
+ }
+ }
+
+ private boolean isColorModeAvailable(@ColorMode int colorMode) {
+ // SATURATED is always allowed
+ if (colorMode == COLOR_MODE_SATURATED) {
+ return true;
+ }
+
+ final int[] availableColorModes = mContext.getResources().getIntArray(
+ R.array.config_availableColorModes);
+ for (int mode : availableColorModes) {
+ if (mode == colorMode) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
* Get the current color mode.
*/
public int getColorMode() {
@@ -369,17 +404,27 @@
return COLOR_MODE_SATURATED;
}
- final int colorMode = System.getIntForUser(mContext.getContentResolver(),
+ int colorMode = System.getIntForUser(mContext.getContentResolver(),
System.DISPLAY_COLOR_MODE, -1, mUserId);
- if (colorMode < COLOR_MODE_NATURAL || colorMode > COLOR_MODE_SATURATED) {
+ if (colorMode == -1) {
// There still might be a legacy system property controlling color mode that we need to
// respect.
- if ("1".equals(SystemProperties.get(PERSISTENT_PROPERTY_NATIVE_MODE))) {
- return COLOR_MODE_SATURATED;
- }
- return "1.0".equals(SystemProperties.get(PERSISTENT_PROPERTY_SATURATION))
- ? COLOR_MODE_NATURAL : COLOR_MODE_BOOSTED;
+ colorMode = getCurrentColorModeFromSystemProperties();
}
+
+ // This happens when a color mode is no longer available (e.g., after system update or B&R)
+ // or the device does not support any color mode.
+ if (!isColorModeAvailable(colorMode)) {
+ if (colorMode == COLOR_MODE_BOOSTED && isColorModeAvailable(COLOR_MODE_NATURAL)) {
+ colorMode = COLOR_MODE_NATURAL;
+ } else if (colorMode == COLOR_MODE_SATURATED
+ && isColorModeAvailable(COLOR_MODE_AUTOMATIC)) {
+ colorMode = COLOR_MODE_AUTOMATIC;
+ } else {
+ colorMode = COLOR_MODE_SATURATED;
+ }
+ }
+
return colorMode;
}
@@ -389,7 +434,7 @@
* @param colorMode the color mode
*/
public void setColorMode(@ColorMode int colorMode) {
- if (colorMode < COLOR_MODE_NATURAL || colorMode > COLOR_MODE_SATURATED) {
+ if (!isColorModeAvailable(colorMode)) {
throw new IllegalArgumentException("Invalid colorMode: " + colorMode);
}
System.putIntForUser(mContext.getContentResolver(), System.DISPLAY_COLOR_MODE, colorMode,
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index a4680ca..be83498 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -585,6 +585,7 @@
boolean onBatteryScreenOff);
Future<?> scheduleCpuSyncDueToWakelockChange(long delayMillis);
void cancelCpuSyncDueToWakelockChange();
+ Future<?> scheduleSyncDueToBatteryLevelChange(long delayMillis);
}
public Handler mHandler;
@@ -12614,7 +12615,8 @@
// TODO(adamlesinski): Schedule the creation of a HistoryStepDetails record
// which will pull external stats.
- scheduleSyncExternalStatsLocked("battery-level", ExternalStatsSync.UPDATE_ALL);
+ mExternalSync.scheduleSyncDueToBatteryLevelChange(
+ mConstants.BATTERY_LEVEL_COLLECTION_DELAY_MS);
}
if (mHistoryCur.batteryStatus != status) {
mHistoryCur.batteryStatus = (byte)status;
@@ -13270,6 +13272,8 @@
= "uid_remove_delay_ms";
public static final String KEY_EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS
= "external_stats_collection_rate_limit_ms";
+ public static final String KEY_BATTERY_LEVEL_COLLECTION_DELAY_MS
+ = "battery_level_collection_delay_ms";
private static final boolean DEFAULT_TRACK_CPU_TIMES_BY_PROC_STATE = true;
private static final boolean DEFAULT_TRACK_CPU_ACTIVE_CLUSTER_TIME = true;
@@ -13277,6 +13281,7 @@
private static final long DEFAULT_KERNEL_UID_READERS_THROTTLE_TIME = 10_000;
private static final long DEFAULT_UID_REMOVE_DELAY_MS = 5L * 60L * 1000L;
private static final long DEFAULT_EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS = 600_000;
+ private static final long DEFAULT_BATTERY_LEVEL_COLLECTION_DELAY_MS = 300_000;
public boolean TRACK_CPU_TIMES_BY_PROC_STATE = DEFAULT_TRACK_CPU_TIMES_BY_PROC_STATE;
public boolean TRACK_CPU_ACTIVE_CLUSTER_TIME = DEFAULT_TRACK_CPU_ACTIVE_CLUSTER_TIME;
@@ -13285,6 +13290,8 @@
public long UID_REMOVE_DELAY_MS = DEFAULT_UID_REMOVE_DELAY_MS;
public long EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS
= DEFAULT_EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS;
+ public long BATTERY_LEVEL_COLLECTION_DELAY_MS
+ = DEFAULT_BATTERY_LEVEL_COLLECTION_DELAY_MS;
private ContentResolver mResolver;
private final KeyValueListParser mParser = new KeyValueListParser(',');
@@ -13333,6 +13340,9 @@
EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS = mParser.getLong(
KEY_EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS,
DEFAULT_EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS);
+ BATTERY_LEVEL_COLLECTION_DELAY_MS = mParser.getLong(
+ KEY_BATTERY_LEVEL_COLLECTION_DELAY_MS,
+ DEFAULT_BATTERY_LEVEL_COLLECTION_DELAY_MS);
}
}
@@ -13384,6 +13394,8 @@
pw.println(KERNEL_UID_READERS_THROTTLE_TIME);
pw.print(KEY_EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS); pw.print("=");
pw.println(EXTERNAL_STATS_COLLECTION_RATE_LIMIT_MS);
+ pw.print(KEY_BATTERY_LEVEL_COLLECTION_DELAY_MS); pw.print("=");
+ pw.println(BATTERY_LEVEL_COLLECTION_DELAY_MS);
}
}
diff --git a/core/java/com/android/internal/widget/FloatingToolbar.java b/core/java/com/android/internal/widget/FloatingToolbar.java
index 63c2e96..f70c554 100644
--- a/core/java/com/android/internal/widget/FloatingToolbar.java
+++ b/core/java/com/android/internal/widget/FloatingToolbar.java
@@ -452,7 +452,7 @@
mLineHeight = context.getResources()
.getDimensionPixelSize(R.dimen.floating_toolbar_height);
mIconTextSpacing = context.getResources()
- .getDimensionPixelSize(R.dimen.floating_toolbar_menu_button_side_padding);
+ .getDimensionPixelSize(R.dimen.floating_toolbar_icon_text_spacing);
// Interpolators
mLogAccelerateInterpolator = new LogAccelerateInterpolator();
@@ -481,7 +481,7 @@
mOverflowButton = createOverflowButton();
mOverflowButtonSize = measure(mOverflowButton);
mMainPanel = createMainPanel();
- mOverflowPanelViewHelper = new OverflowPanelViewHelper(mContext);
+ mOverflowPanelViewHelper = new OverflowPanelViewHelper(mContext, mIconTextSpacing);
mOverflowPanel = createOverflowPanel();
// Animation. Need views.
@@ -1573,10 +1573,9 @@
private final Context mContext;
- public OverflowPanelViewHelper(Context context) {
+ public OverflowPanelViewHelper(Context context, int iconTextSpacing) {
mContext = Preconditions.checkNotNull(context);
- mIconTextSpacing = context.getResources()
- .getDimensionPixelSize(R.dimen.floating_toolbar_menu_button_side_padding);
+ mIconTextSpacing = iconTextSpacing;
mSidePadding = context.getResources()
.getDimensionPixelSize(R.dimen.floating_toolbar_overflow_side_padding);
mCalculator = createMenuButton(null);
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index da494d4..8235507 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1424,6 +1424,13 @@
<permission android:name="android.permission.NETWORK_SETTINGS"
android:protectionLevel="signature" />
+ <!-- Allows SetupWizard to call methods in Networking services
+ <p>Not for use by any other third-party or privileged applications.
+ @hide This should only be used by SetupWizard.
+ -->
+ <permission android:name="android.permission.NETWORK_SETUP_WIZARD"
+ android:protectionLevel="signature|setup" />
+
<!-- #SystemApi @hide Allows applications to access information about LoWPAN interfaces.
<p>Not for use by third-party applications. -->
<permission android:name="android.permission.ACCESS_LOWPAN_STATE"
diff --git a/core/res/res/anim-ldrtl/task_close_enter.xml b/core/res/res/anim-ldrtl/task_close_enter.xml
new file mode 100644
index 0000000..7abada3
--- /dev/null
+++ b/core/res/res/anim-ldrtl/task_close_enter.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2018 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
+ -->
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false"
+ android:zAdjustment="top"
+ android:showWallpaper="true">
+
+ <alpha
+ android:fromAlpha="1"
+ android:toAlpha="1.0"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/linear"
+ android:startOffset="67"
+ android:duration="217"/>
+
+ <translate
+ android:fromXDelta="105%"
+ android:toXDelta="0"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/aggressive_ease"
+ android:startOffset="50"
+ android:duration="383"/>
+
+ <scale
+ android:fromXScale="1.0526"
+ android:toXScale="1"
+ android:fromYScale="1.0526"
+ android:toYScale="1"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/fast_out_slow_in"
+ android:duration="283"/>
+
+ <scale
+ android:fromXScale="0.95"
+ android:toXScale="1"
+ android:fromYScale="0.95"
+ android:toYScale="1"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/fast_out_slow_in"
+ android:startOffset="283"
+ android:duration="317"/>
+</set>
\ No newline at end of file
diff --git a/core/res/res/anim-ldrtl/task_close_exit.xml b/core/res/res/anim-ldrtl/task_close_exit.xml
new file mode 100644
index 0000000..a017820
--- /dev/null
+++ b/core/res/res/anim-ldrtl/task_close_exit.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2018 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
+ -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false"
+ android:showWallpaper="true">
+
+ <alpha
+ android:fromAlpha="1.0"
+ android:toAlpha="1"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/linear"
+ android:startOffset="67"
+ android:duration="283"/>
+
+ <translate
+ android:fromXDelta="0"
+ android:toXDelta="-105%"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/aggressive_ease"
+ android:startOffset="50"
+ android:duration="383"/>
+
+ <scale
+ android:fromXScale="1.0"
+ android:toXScale="0.95"
+ android:fromYScale="1.0"
+ android:toYScale="0.95"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:interpolator="@interpolator/fast_out_slow_in"
+ android:duration="283"/>
+
+ <!-- This is needed to keep the animation running while task_open_enter completes -->
+ <alpha
+ android:fromAlpha="1.0"
+ android:toAlpha="1.0"
+ android:duration="600"/>
+</set>
\ No newline at end of file
diff --git a/core/res/res/anim-ldrtl/task_open_enter.xml b/core/res/res/anim-ldrtl/task_open_enter.xml
new file mode 100644
index 0000000..0433664
--- /dev/null
+++ b/core/res/res/anim-ldrtl/task_open_enter.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2018 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
+ -->
+<!-- This should in sync with task_open_enter_cross_profile_apps.xml -->
+<!-- This should in sync with cross_profile_apps_thumbnail_enter.xml -->
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false"
+ android:zAdjustment="top"
+ android:showWallpaper="true">
+
+ <alpha
+ android:fromAlpha="1"
+ android:toAlpha="1.0"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/linear"
+ android:startOffset="67"
+ android:duration="217"/>
+
+ <translate
+ android:fromXDelta="-105%"
+ android:toXDelta="0"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/aggressive_ease"
+ android:startOffset="50"
+ android:duration="383"/>
+
+ <scale
+ android:fromXScale="1.0526"
+ android:toXScale="1"
+ android:fromYScale="1.0526"
+ android:toYScale="1"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/fast_out_slow_in"
+ android:duration="283"/>
+
+ <scale
+ android:fromXScale="0.95"
+ android:toXScale="1"
+ android:fromYScale="0.95"
+ android:toYScale="1"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/fast_out_slow_in"
+ android:startOffset="283"
+ android:duration="317"/>
+</set>
\ No newline at end of file
diff --git a/core/res/res/anim-ldrtl/task_open_enter_cross_profile_apps.xml b/core/res/res/anim-ldrtl/task_open_enter_cross_profile_apps.xml
new file mode 100644
index 0000000..45ca80e
--- /dev/null
+++ b/core/res/res/anim-ldrtl/task_open_enter_cross_profile_apps.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2018 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
+ -->
+<!-- This should in sync with task_open_enter.xml -->
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false"
+ android:zAdjustment="top"
+ android:showWallpaper="true">
+
+ <alpha
+ android:fromAlpha="1"
+ android:toAlpha="1.0"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/linear"
+ android:startOffset="67"
+ android:duration="217"/>
+
+ <translate
+ android:fromXDelta="-105%"
+ android:toXDelta="0"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/aggressive_ease"
+ android:startOffset="50"
+ android:duration="383"/>
+
+ <scale
+ android:fromXScale="1.0526"
+ android:toXScale="1"
+ android:fromYScale="1.0526"
+ android:toYScale="1"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/fast_out_slow_in"
+ android:duration="283"/>
+
+ <scale
+ android:fromXScale="0.95"
+ android:toXScale="1"
+ android:fromYScale="0.95"
+ android:toYScale="1"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/fast_out_slow_in"
+ android:startOffset="283"
+ android:duration="317"/>
+
+ <!-- To keep the transition around longer for the thumbnail, should be kept in sync with
+ cross_profile_apps_thumbmail.xml -->
+ <alpha
+ android:fromAlpha="1.0"
+ android:toAlpha="1.0"
+ android:startOffset="717"
+ android:duration="200"/>
+</set>
\ No newline at end of file
diff --git a/core/res/res/anim-ldrtl/task_open_exit.xml b/core/res/res/anim-ldrtl/task_open_exit.xml
new file mode 100644
index 0000000..f50494d
--- /dev/null
+++ b/core/res/res/anim-ldrtl/task_open_exit.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ Copyright (C) 2018 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
+ -->
+
+<set xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shareInterpolator="false"
+ android:showWallpaper="true">
+
+ <alpha
+ android:fromAlpha="1.0"
+ android:toAlpha="1"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/linear"
+ android:startOffset="67"
+ android:duration="283"/>
+
+ <translate
+ android:fromXDelta="0"
+ android:toXDelta="105%"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:interpolator="@interpolator/aggressive_ease"
+ android:startOffset="50"
+ android:duration="383"/>
+
+ <scale
+ android:fromXScale="1.0"
+ android:toXScale="0.95"
+ android:fromYScale="1.0"
+ android:toYScale="0.95"
+ android:fillEnabled="true"
+ android:fillBefore="true"
+ android:fillAfter="true"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:interpolator="@interpolator/fast_out_slow_in"
+ android:duration="283"/>
+
+ <!-- This is needed to keep the animation running while task_open_enter completes -->
+ <alpha
+ android:fromAlpha="1.0"
+ android:toAlpha="1.0"
+ android:duration="600"/>
+</set>
\ No newline at end of file
diff --git a/core/res/res/anim/task_close_enter.xml b/core/res/res/anim/task_close_enter.xml
index c298b80..b059aa9 100644
--- a/core/res/res/anim/task_close_enter.xml
+++ b/core/res/res/anim/task_close_enter.xml
@@ -31,7 +31,7 @@
android:duration="217"/>
<translate
- android:fromXDelta="105%"
+ android:fromXDelta="-105%"
android:toXDelta="0"
android:fillEnabled="true"
android:fillBefore="true"
diff --git a/core/res/res/anim/task_close_exit.xml b/core/res/res/anim/task_close_exit.xml
index 9394c57..c9ade22 100644
--- a/core/res/res/anim/task_close_exit.xml
+++ b/core/res/res/anim/task_close_exit.xml
@@ -32,7 +32,7 @@
<translate
android:fromXDelta="0"
- android:toXDelta="-105%"
+ android:toXDelta="105%"
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
diff --git a/core/res/res/anim/task_open_enter.xml b/core/res/res/anim/task_open_enter.xml
index e23201f..5c61859 100644
--- a/core/res/res/anim/task_open_enter.xml
+++ b/core/res/res/anim/task_open_enter.xml
@@ -33,7 +33,7 @@
android:duration="217"/>
<translate
- android:fromXDelta="-105%"
+ android:fromXDelta="105%"
android:toXDelta="0"
android:fillEnabled="true"
android:fillBefore="true"
diff --git a/core/res/res/anim/task_open_enter_cross_profile_apps.xml b/core/res/res/anim/task_open_enter_cross_profile_apps.xml
index defea08..6441047 100644
--- a/core/res/res/anim/task_open_enter_cross_profile_apps.xml
+++ b/core/res/res/anim/task_open_enter_cross_profile_apps.xml
@@ -33,7 +33,7 @@
android:duration="217"/>
<translate
- android:fromXDelta="-105%"
+ android:fromXDelta="105%"
android:toXDelta="0"
android:fillEnabled="true"
android:fillBefore="true"
diff --git a/core/res/res/anim/task_open_exit.xml b/core/res/res/anim/task_open_exit.xml
index c9ade22..9394c57 100644
--- a/core/res/res/anim/task_open_exit.xml
+++ b/core/res/res/anim/task_open_exit.xml
@@ -32,7 +32,7 @@
<translate
android:fromXDelta="0"
- android:toXDelta="105%"
+ android:toXDelta="-105%"
android:fillEnabled="true"
android:fillBefore="true"
android:fillAfter="true"
diff --git a/core/res/res/layout-television/autofill_save.xml b/core/res/res/layout-television/autofill_save.xml
new file mode 100644
index 0000000..ebd2dec
--- /dev/null
+++ b/core/res/res/layout-television/autofill_save.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2018 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.
+-->
+
+<!-- NOTE: outer layout is required to provide proper shadow. -->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:id="@+id/autofill_save"
+ android:background="?android:attr/colorBackground"
+ android:layout_marginTop="32dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingStart="40dp"
+ android:paddingEnd="40dp"
+ android:paddingTop="40dp"
+ android:paddingBottom="40dp">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginEnd="32dp">
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="6dp">
+
+ <ImageView
+ android:id="@+id/autofill_save_icon"
+ android:scaleType="fitStart"
+ android:layout_marginEnd="10dp"
+ android:layout_gravity="center_vertical"
+ android:layout_width="48dp"
+ android:layout_height="48dp"/>
+ <TextView
+ android:id="@+id/autofill_save_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/autofill_save_title"
+ android:layout_gravity="center_vertical"
+ android:textSize="24sp" />
+ </LinearLayout>
+
+ <com.android.server.autofill.ui.CustomScrollView
+ android:id="@+id/autofill_save_custom_subtitle"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="4dp"
+ android:visibility="gone"/>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="304dp"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <Button
+ android:id="@+id/autofill_save_no"
+ style="?attr/borderlessButtonStyle"
+ android:textAlignment="viewStart"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/autofill_save_no">
+ </Button>
+
+ <Button
+ android:id="@+id/autofill_save_yes"
+ style="?attr/borderlessButtonStyle"
+ android:textAlignment="viewStart"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/autofill_save_yes">
+ </Button>
+ </LinearLayout>
+
+ </LinearLayout>
+
+</LinearLayout>
diff --git a/core/res/res/layout/autofill_dataset_picker.xml b/core/res/res/layout/autofill_dataset_picker.xml
index ef19f87..a88836e 100644
--- a/core/res/res/layout/autofill_dataset_picker.xml
+++ b/core/res/res/layout/autofill_dataset_picker.xml
@@ -14,8 +14,7 @@
limitations under the License.
-->
-<view xmlns:android="http://schemas.android.com/apk/res/android"
- class="com.android.server.autofill.ui.FillUi$AutofillFrameLayout"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/autofill_dataset_picker"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@@ -31,4 +30,4 @@
android:visibility="gone">
</ListView>
-</view>
+</FrameLayout>
diff --git a/core/res/res/layout/autofill_dataset_picker_fullscreen.xml b/core/res/res/layout/autofill_dataset_picker_fullscreen.xml
index 07298c1..1d2b5e5 100644
--- a/core/res/res/layout/autofill_dataset_picker_fullscreen.xml
+++ b/core/res/res/layout/autofill_dataset_picker_fullscreen.xml
@@ -14,35 +14,73 @@
limitations under the License.
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/autofill_dataset_picker"
- style="@style/AutofillDatasetPicker"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:background="?android:attr/windowBackground"
+ android:paddingStart="40dp"
+ android:paddingEnd="40dp"
+ android:paddingTop="40dp"
+ android:paddingBottom="40dp">
- <TextView
- android:layout_width="wrap_content"
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:text="@string/autofill_window_title"
- android:layout_above="@+id/autofill_dataset_container"
- android:layout_alignStart="@+id/autofill_dataset_container"
- android:textSize="16sp"/>
+ android:layout_weight="1"
+ android:layout_marginEnd="32dp">
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="6dp"
+ >
+ <ImageView
+ android:id="@+id/autofill_dataset_icon"
+ android:scaleType="fitStart"
+ android:layout_marginEnd="10dp"
+ android:layout_gravity="center_vertical"
+ android:layout_width="48dp"
+ android:layout_height="48dp"/>
+ <TextView
+ android:id="@+id/autofill_dataset_title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:textSize="24sp" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/autofill_dataset_header"
+ android:visibility="gone"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"/>
+
+ </LinearLayout>
<!-- autofill_container is the common parent for inserting authentication item or
- autofill_dataset_list-->
- <FrameLayout
- android:id="@+id/autofill_dataset_container"
- android:layout_width="wrap_content"
+ autofill_dataset_list, autofill_dataset_foolter-->
+ <LinearLayout
+ android:layout_width="304dp"
android:layout_height="wrap_content"
- android:layout_centerInParent="true">
+ android:id="@+id/autofill_dataset_picker"
+ android:orientation="vertical">
<ListView
android:id="@+id/autofill_dataset_list"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:divider="@null"
android:drawSelectorOnTop="true"
android:visibility="gone"/>
- </FrameLayout>
+ <LinearLayout
+ android:id="@+id/autofill_dataset_footer"
+ android:visibility="gone"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"/>
+ </LinearLayout>
-</RelativeLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/core/res/res/layout/autofill_dataset_picker_header_footer.xml b/core/res/res/layout/autofill_dataset_picker_header_footer.xml
index 048494a..093f035 100644
--- a/core/res/res/layout/autofill_dataset_picker_header_footer.xml
+++ b/core/res/res/layout/autofill_dataset_picker_header_footer.xml
@@ -14,8 +14,7 @@
limitations under the License.
-->
-<view xmlns:android="http://schemas.android.com/apk/res/android"
- class="com.android.server.autofill.ui.FillUi$AutofillFrameLayout"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/autofill_dataset_picker"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@@ -54,4 +53,4 @@
</LinearLayout>
-</view>
+</FrameLayout>
diff --git a/core/res/res/layout/autofill_dataset_picker_header_footer_fullscreen.xml b/core/res/res/layout/autofill_dataset_picker_header_footer_fullscreen.xml
deleted file mode 100644
index 24b14a0..0000000
--- a/core/res/res/layout/autofill_dataset_picker_header_footer_fullscreen.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2018 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.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/autofill_dataset_picker"
- style="@style/AutofillDatasetPicker"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent">
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/autofill_window_title"
- android:layout_above="@+id/autofill_dataset_container"
- android:layout_alignStart="@+id/autofill_dataset_container"
- android:textSize="16sp"/>
-
- <!-- autofill_container is the common parent for inserting authentication item or
- autofill_dataset_list-->
- <FrameLayout
- android:id="@+id/autofill_dataset_container"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerInParent="true">
-
- <LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <LinearLayout
- android:id="@+id/autofill_dataset_header"
- android:visibility="gone"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"/>
-
- <ListView
- android:id="@+id/autofill_dataset_list"
- android:layout_weight="1"
- android:layout_width="fill_parent"
- android:layout_height="0dp"
- android:clickable="true"
- android:divider="@null"
- android:drawSelectorOnTop="true"
- android:visibility="gone"/>
-
- <LinearLayout
- android:id="@+id/autofill_dataset_footer"
- android:visibility="gone"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"/>
-
- </LinearLayout>
-
- </FrameLayout>
-
-</RelativeLayout>
diff --git a/core/res/res/layout/notification_template_material_big_text.xml b/core/res/res/layout/notification_template_material_big_text.xml
index 3a6f573..d1861d9 100644
--- a/core/res/res/layout/notification_template_material_big_text.xml
+++ b/core/res/res/layout/notification_template_material_big_text.xml
@@ -53,10 +53,10 @@
android:layout_marginTop="@dimen/notification_progress_margin_top"
android:layout_marginBottom="6dp"/>
<com.android.internal.widget.ImageFloatingTextView android:id="@+id/big_text"
+ style="@style/Widget.Material.Notification.Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/notification_text_margin_top"
- android:textAppearance="@style/TextAppearance.Material.Notification"
android:singleLine="false"
android:gravity="top"
android:visibility="gone"
diff --git a/core/res/res/layout/notification_template_material_inbox.xml b/core/res/res/layout/notification_template_material_inbox.xml
index 23d8799..d6f0e1d 100644
--- a/core/res/res/layout/notification_template_material_inbox.xml
+++ b/core/res/res/layout/notification_template_material_inbox.xml
@@ -53,7 +53,7 @@
android:layout_marginTop="@dimen/notification_progress_margin_top"
android:layout_marginBottom="2dp"/>
<TextView android:id="@+id/inbox_text0"
- android:textAppearance="@style/TextAppearance.Material.Notification"
+ style="@style/Widget.Material.Notification.Text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -62,7 +62,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text1"
- android:textAppearance="@style/TextAppearance.Material.Notification"
+ style="@style/Widget.Material.Notification.Text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -71,7 +71,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text2"
- android:textAppearance="@style/TextAppearance.Material.Notification"
+ style="@style/Widget.Material.Notification.Text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -80,7 +80,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text3"
- android:textAppearance="@style/TextAppearance.Material.Notification"
+ style="@style/Widget.Material.Notification.Text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -89,7 +89,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text4"
- android:textAppearance="@style/TextAppearance.Material.Notification"
+ style="@style/Widget.Material.Notification.Text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -98,7 +98,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text5"
- android:textAppearance="@style/TextAppearance.Material.Notification"
+ style="@style/Widget.Material.Notification.Text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
@@ -107,7 +107,7 @@
android:layout_weight="1"
/>
<TextView android:id="@+id/inbox_text6"
- android:textAppearance="@style/TextAppearance.Material.Notification"
+ style="@style/Widget.Material.Notification.Text"
android:layout_width="match_parent"
android:layout_height="0dp"
android:singleLine="true"
diff --git a/core/res/res/layout/notification_template_messaging_group.xml b/core/res/res/layout/notification_template_messaging_group.xml
index d2fd467..9bdc495 100644
--- a/core/res/res/layout/notification_template_messaging_group.xml
+++ b/core/res/res/layout/notification_template_messaging_group.xml
@@ -41,6 +41,7 @@
android:id="@+id/group_message_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_marginTop="@dimen/notification_text_margin_top"
android:spacing="2dp"
android:layout_weight="1"/>
</com.android.internal.widget.RemeasuringLinearLayout>
diff --git a/core/res/res/layout/notification_template_part_line1.xml b/core/res/res/layout/notification_template_part_line1.xml
index ca35de3..6459bb8 100644
--- a/core/res/res/layout/notification_template_part_line1.xml
+++ b/core/res/res/layout/notification_template_part_line1.xml
@@ -31,7 +31,7 @@
android:textAlignment="viewStart"
/>
<TextView android:id="@+id/text_line_1"
- android:textAppearance="@style/TextAppearance.Material.Notification"
+ style="@style/Widget.Material.Notification.Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end|bottom"
diff --git a/core/res/res/layout/notification_template_text.xml b/core/res/res/layout/notification_template_text.xml
index 68f34c8..3b27666 100644
--- a/core/res/res/layout/notification_template_text.xml
+++ b/core/res/res/layout/notification_template_text.xml
@@ -15,6 +15,7 @@
~ limitations under the License
-->
<com.android.internal.widget.ImageFloatingTextView xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/Widget.Material.Notification.Text"
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -25,5 +26,4 @@
android:gravity="top"
android:singleLine="true"
android:textAlignment="viewStart"
- android:textAppearance="@style/TextAppearance.Material.Notification"
/>
diff --git a/core/res/res/values-television/dimens.xml b/core/res/res/values-television/dimens.xml
index aa56251..4c25225 100644
--- a/core/res/res/values-television/dimens.xml
+++ b/core/res/res/values-television/dimens.xml
@@ -20,8 +20,4 @@
<item type="dimen" format="float" name="ambient_shadow_alpha">0.15</item>
<item type="dimen" format="float" name="spot_shadow_alpha">0.3</item>
- <!-- Max width/height of the autofill data set picker as a fraction of the screen width/height -->
- <dimen name="autofill_dataset_picker_max_width">60%</dimen>
- <dimen name="autofill_dataset_picker_max_height">70%</dimen>
-
</resources>
diff --git a/core/res/res/values-television/themes_device_defaults.xml b/core/res/res/values-television/themes_device_defaults.xml
index e01caa3..e380a7b 100644
--- a/core/res/res/values-television/themes_device_defaults.xml
+++ b/core/res/res/values-television/themes_device_defaults.xml
@@ -16,4 +16,6 @@
<resources>
<style name="Theme.DeviceDefault.Dialog.Alert" parent="Theme.Leanback.Dialog.Alert" />
<style name="Theme.DeviceDefault.Light.Dialog.Alert" parent="Theme.Leanback.Light.Dialog.Alert" />
+ <style name="Theme.DeviceDefault.Autofill" parent="Theme.Material.Autofill" />
+ <style name="Theme.DeviceDefault.Autofill.Save" parent="Theme.Material.Autofill.Save" />
</resources>
diff --git a/core/res/res/values/colors_material.xml b/core/res/res/values/colors_material.xml
index 3609fb8..2966aff 100644
--- a/core/res/res/values/colors_material.xml
+++ b/core/res/res/values/colors_material.xml
@@ -145,4 +145,8 @@
<color name="datepicker_default_view_animator_color_material_light">#fff2f2f2</color>
<color name="datepicker_default_view_animator_color_material_dark">#ff303030</color>
+ <!-- Autofill colors -->
+ <color name="autofill_background_material_dark">@color/material_blue_grey_900</color>
+ <color name="autofill_background_material_light">@color/material_grey_50</color>
+
</resources>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 7b90444..5c80d4d2 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -948,6 +948,16 @@
<!-- B y-intercept --> <item>-0.198650895</item>
</string-array>
+
+ <!-- Indicate available ColorDisplayController.COLOR_MODE_xxx. -->
+ <integer-array name="config_availableColorModes">
+ <!-- Example:
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ -->
+ </integer-array>
+
<!-- Indicate whether to allow the device to suspend when the screen is off
due to the proximity sensor. This resource should only be set to true
if the sensor HAL correctly handles the proximity sensor as a wake-up source.
@@ -2853,6 +2863,9 @@
<!-- For performance and storage reasons, limit the number of fingerprints per user -->
<integer name="config_fingerprintMaxTemplatesPerUser">5</integer>
+ <!-- Specify if the fingerprint hardware support gestures-->
+ <bool name="config_fingerprintSupportsGestures">false</bool>
+
<!-- This config is used to force VoiceInteractionService to start on certain low ram devices.
It declares the package name of VoiceInteractionService that should be started. -->
<string translatable="false" name="config_forceVoiceInteractionServicePackage"></string>
@@ -3178,6 +3191,9 @@
<!-- An array of packages for which notifications cannot be blocked. -->
<string-array translatable="false" name="config_nonBlockableNotificationPackages" />
+ <!-- An array of packages which can listen for notifications on low ram devices. -->
+ <string-array translatable="false" name="config_allowedManagedServicesOnLowRamDevices" />
+
<!-- The default value for transition animation scale found in developer settings.
1.0 corresponds to 1x animator scale, 0 means that there will be no transition
animations. Note that this is only a default and will be overridden by a
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 84f23a9..45814ea 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -531,7 +531,7 @@
<dimen name="floating_toolbar_menu_image_width">24dp</dimen>
<dimen name="floating_toolbar_menu_image_button_width">56dp</dimen>
<dimen name="floating_toolbar_menu_image_button_vertical_padding">12dp</dimen>
- <dimen name="floating_toolbar_menu_button_side_padding">8dp</dimen>
+ <dimen name="floating_toolbar_menu_button_side_padding">11dp</dimen>
<dimen name="floating_toolbar_overflow_image_button_width">60dp</dimen>
<dimen name="floating_toolbar_overflow_side_padding">18dp</dimen>
<dimen name="floating_toolbar_text_size">14sp</dimen>
@@ -542,6 +542,7 @@
<dimen name="floating_toolbar_horizontal_margin">16dp</dimen>
<dimen name="floating_toolbar_vertical_margin">8dp</dimen>
<dimen name="content_rect_bottom_clip_allowance">20dp</dimen>
+ <dimen name="floating_toolbar_icon_text_spacing">8dp</dimen>
<!-- Magnifier dimensions -->
<dimen name="magnifier_width">100dp</dimen>
@@ -628,7 +629,7 @@
<!-- The maximum width of a image in a media notification. The images will be reduced to that width in case they are bigger.-->
<dimen name="notification_media_image_max_width_low_ram">100dp</dimen>
<!-- The size of the right icon image when on low ram -->
- <dimen name="notification_right_icon_size_low_ram">@dimen/notification_right_icon_size_low_ram</dimen>
+ <dimen name="notification_right_icon_size_low_ram">38dp</dimen>
<dimen name="messaging_avatar_size">@dimen/notification_right_icon_size</dimen>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 395b269..b92052b 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -2196,8 +2196,8 @@
<!-- Text to show in the auto complete drop down list on a text view when the WebView can auto fill the entire form but the user has not configured an AutoFill profile [CHAR-LIMIT=19] -->
<string name="setup_autofill">Set up Autofill</string>
- <!-- Title of fullscreen autofill window [CHAR-LIMIT=80] -->
- <string name="autofill_window_title">Autofill</string>
+ <!-- Title of fullscreen autofill window, including the name of which autofill service it is using [CHAR-LIMIT=NONE] -->
+ <string name="autofill_window_title">Autofill with <xliff:g id="serviceName" example="MyPass">%1$s</xliff:g></string>
<!-- String used to separate FirstName and LastName when writing out a local name
e.g. John<separator>Smith [CHAR-LIMIT=NONE]-->
@@ -4514,7 +4514,10 @@
<!-- Notification shown when device owner silently deletes a package [CHAR LIMIT=NONE] -->
<string name="package_deleted_device_owner">Deleted by your admin</string>
- <!-- [CHAR_LIMIT=NONE] Battery saver: Feature description -->
+ <!-- [CHAR_LIMIT=NONE] Battery saver: Feature description, with a "learn more" link. -->
+ <string name="battery_saver_description_with_learn_more">To extend your battery life, Battery Saver turns off some device features and restricts apps. <annotation id="url">Learn More</annotation></string>
+
+ <!-- [CHAR_LIMIT=NONE] Battery saver: Feature description, without a "learn more" link. -->
<string name="battery_saver_description">To extend your battery life, Battery Saver turns off some device features and restricts apps.</string>
<!-- [CHAR_LIMIT=NONE] Data saver: Feature description -->
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index 984461b..50a6ff3 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -1487,13 +1487,19 @@
<item name="successColor">@color/lock_pattern_view_success_color</item>
</style>
- <!-- @hide -->
+ <!-- @hide Autofill background for popup window (not for fullscreen) -->
<style name="AutofillDatasetPicker">
<item name="elevation">4dp</item>
<item name="background">@drawable/autofill_dataset_picker_background</item>
</style>
<!-- @hide -->
+ <style name="AutofillHalfScreenAnimation">
+ <item name="android:windowEnterAnimation">@anim/slide_in_up</item>
+ <item name="android:windowExitAnimation">@anim/slide_out_down</item>
+ </style>
+
+ <!-- @hide -->
<style name="AutofillSaveAnimation">
<item name="android:windowEnterAnimation">@anim/slide_in_up</item>
<item name="android:windowExitAnimation">@anim/slide_out_down</item>
diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml
index b8a046f..2d97db0 100644
--- a/core/res/res/values/styles_material.xml
+++ b/core/res/res/values/styles_material.xml
@@ -500,11 +500,15 @@
<style name="Widget.Material.Notification.ProgressBar" parent="Widget.Material.Light.ProgressBar.Horizontal" />
- <style name="Widget.Material.Notification.MessagingText" parent="Widget.Material.Light.TextView">
+ <style name="Widget.Material.Notification.Text" parent="Widget.Material.Light.TextView">
+ <item name="lineHeight">20sp</item>
+ <item name="textAppearance">@style/TextAppearance.Material.Notification</item>
+ </style>
+
+ <style name="Widget.Material.Notification.MessagingText" parent="Widget.Material.Notification.Text">
<item name="layout_width">wrap_content</item>
<item name="layout_height">wrap_content</item>
- <item name="ellipsize">end</item>
- <item name="textAppearance">@style/TextAppearance.Material.Notification</item>
+ <item name="ellipsize">end</item>z
</style>
<style name="Widget.Material.Notification.MessagingName" parent="Widget.Material.Light.TextView">
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 6721f93..5298e5b 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -663,6 +663,7 @@
<java-symbol type="string" name="autofill_state_re" />
<java-symbol type="string" name="autofill_this_form" />
<java-symbol type="string" name="autofill_username_re" />
+ <java-symbol type="string" name="autofill_window_title" />
<java-symbol type="string" name="autofill_zip_4_re" />
<java-symbol type="string" name="autofill_zip_code" />
<java-symbol type="string" name="autofill_zip_code_re" />
@@ -2407,6 +2408,7 @@
<!-- Fingerprint config -->
<java-symbol type="integer" name="config_fingerprintMaxTemplatesPerUser"/>
+ <java-symbol type="bool" name="config_fingerprintSupportsGestures"/>
<!-- From various Material changes -->
<java-symbol type="attr" name="titleTextAppearance" />
@@ -2575,6 +2577,7 @@
<java-symbol type="dimen" name="floating_toolbar_maximum_overflow_height" />
<java-symbol type="dimen" name="floating_toolbar_horizontal_margin" />
<java-symbol type="dimen" name="floating_toolbar_vertical_margin" />
+ <java-symbol type="dimen" name="floating_toolbar_icon_text_spacing" />
<java-symbol type="dimen" name="content_rect_bottom_clip_allowance" />
<java-symbol type="drawable" name="ft_avd_tooverflow" />
<java-symbol type="drawable" name="ft_avd_toarrow" />
@@ -2961,6 +2964,7 @@
<java-symbol type="integer" name="config_nightDisplayColorTemperatureMax" />
<java-symbol type="array" name="config_nightDisplayColorTemperatureCoefficients" />
<java-symbol type="array" name="config_nightDisplayColorTemperatureCoefficientsNative" />
+ <java-symbol type="array" name="config_availableColorModes" />
<!-- Default first user restrictions -->
<java-symbol type="array" name="config_defaultFirstUserRestrictions" />
@@ -2977,6 +2981,8 @@
<java-symbol type="array" name="config_nonBlockableNotificationPackages" />
+ <java-symbol type="array" name="config_allowedManagedServicesOnLowRamDevices" />
+
<!-- Screen-size-dependent modes for picker dialogs. -->
<java-symbol type="integer" name="time_picker_mode" />
<java-symbol type="integer" name="date_picker_mode" />
@@ -3051,13 +3057,13 @@
<java-symbol type="layout" name="autofill_dataset_picker"/>
<java-symbol type="layout" name="autofill_dataset_picker_fullscreen"/>
<java-symbol type="layout" name="autofill_dataset_picker_header_footer"/>
- <java-symbol type="layout" name="autofill_dataset_picker_header_footer_fullscreen"/>
<java-symbol type="id" name="autofill" />
- <java-symbol type="id" name="autofill_dataset_container"/>
<java-symbol type="id" name="autofill_dataset_footer"/>
<java-symbol type="id" name="autofill_dataset_header"/>
+ <java-symbol type="id" name="autofill_dataset_icon" />
<java-symbol type="id" name="autofill_dataset_list"/>
<java-symbol type="id" name="autofill_dataset_picker"/>
+ <java-symbol type="id" name="autofill_dataset_title" />
<java-symbol type="id" name="autofill_save_custom_subtitle" />
<java-symbol type="id" name="autofill_save_icon" />
<java-symbol type="id" name="autofill_save_no" />
@@ -3082,6 +3088,7 @@
<java-symbol type="string" name="autofill_save_type_email_address" />
<java-symbol type="drawable" name="autofill_dataset_picker_background" />
<java-symbol type="style" name="AutofillDatasetPicker" />
+ <java-symbol type="style" name="AutofillHalfScreenAnimation" />
<java-symbol type="style" name="AutofillSaveAnimation" />
<java-symbol type="dimen" name="autofill_dataset_picker_max_width"/>
<java-symbol type="dimen" name="autofill_dataset_picker_max_height"/>
@@ -3089,6 +3096,9 @@
<java-symbol type="dimen" name="autofill_save_icon_max_size"/>
<java-symbol type="integer" name="autofill_max_visible_datasets" />
+ <java-symbol type="style" name="Theme.DeviceDefault.Autofill" />
+ <java-symbol type="style" name="Theme.DeviceDefault.Autofill.Save" />
+
<java-symbol type="dimen" name="notification_big_picture_max_height"/>
<java-symbol type="dimen" name="notification_big_picture_max_width"/>
<java-symbol type="dimen" name="notification_media_image_max_width"/>
@@ -3369,4 +3379,5 @@
<java-symbol type="id" name="user_loading_avatar" />
<java-symbol type="id" name="user_loading" />
+ <java-symbol type="string" name="battery_saver_description_with_learn_more" />
</resources>
diff --git a/core/res/res/values/themes_device_defaults.xml b/core/res/res/values/themes_device_defaults.xml
index 92b2f33..14e5082 100644
--- a/core/res/res/values/themes_device_defaults.xml
+++ b/core/res/res/values/themes_device_defaults.xml
@@ -1673,6 +1673,15 @@
<item name="toolbarStyle">@style/Widget.DeviceDefault.Toolbar</item>
</style>
+
+ <!-- @hide DeviceDefault theme for the autofill FillUi -->
+ <style name="Theme.DeviceDefault.Autofill" parent="Theme.Material.Autofill.Light">
+ </style>
+
+ <!-- @hide DeviceDefault theme for the autofill SaveUi -->
+ <style name="Theme.DeviceDefault.Autofill.Save" parent="Theme.Material.Autofill.Save.Light">
+ </style>
+
<!-- DeviceDefault theme for the default system theme. -->
<style name="Theme.DeviceDefault.System" parent="Theme.DeviceDefault.Light.DarkActionBar" />
diff --git a/core/res/res/values/themes_material.xml b/core/res/res/values/themes_material.xml
index 9b633fc..b3e33d5 100644
--- a/core/res/res/values/themes_material.xml
+++ b/core/res/res/values/themes_material.xml
@@ -1417,4 +1417,25 @@
<item name="colorPrimaryDark">@color/primary_dark_material_settings</item>
<item name="colorSecondary">@color/secondary_material_settings</item>
</style>
+
+ <!-- @hide -->
+ <style name="Theme.Material.Autofill" parent="Theme.Material">
+ <item name="colorBackground">@color/autofill_background_material_dark</item>
+ </style>
+
+ <!-- @hide -->
+ <style name="Theme.Material.Autofill.Light" parent="Theme.Material.Light">
+ <item name="colorBackground">@color/autofill_background_material_light</item>
+ </style>
+
+ <!-- @hide -->
+ <style name="Theme.Material.Autofill.Save" parent="Theme.Material.Panel">
+ <item name="colorBackground">@color/autofill_background_material_dark</item>
+ </style>
+
+ <!-- @hide -->
+ <style name="Theme.Material.Autofill.Save.Light" parent="Theme.Material.Light.Panel">
+ <item name="colorBackground">@color/autofill_background_material_light</item>
+ </style>
+
</resources>
diff --git a/core/tests/coretests/src/android/app/usage/EventListTest.java b/core/tests/coretests/src/android/app/usage/EventListTest.java
new file mode 100644
index 0000000..9dc0d43
--- /dev/null
+++ b/core/tests/coretests/src/android/app/usage/EventListTest.java
@@ -0,0 +1,130 @@
+/*
+ * Copyright (C) 2018 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.app.usage;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import android.support.test.filters.SmallTest;
+import android.support.test.runner.AndroidJUnit4;
+import android.util.Log;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.util.Random;
+
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+public class EventListTest {
+ private static final String TAG = EventListTest.class.getSimpleName();
+
+ private UsageEvents.Event getUsageEvent(long timeStamp) {
+ final UsageEvents.Event event = new UsageEvents.Event();
+ event.mTimeStamp = timeStamp;
+ return event;
+ }
+
+ private static String getListTimeStamps(EventList list) {
+ final StringBuilder builder = new StringBuilder("[");
+ for (int i = 0; i < list.size() - 1; i++) {
+ builder.append(list.get(i).mTimeStamp);
+ builder.append(", ");
+ }
+ builder.append(list.get(list.size() - 1).mTimeStamp);
+ builder.append("]");
+ return builder.toString();
+ }
+
+ private static void assertSorted(EventList eventList) {
+ for (int i = 1; i < eventList.size(); i++) {
+ final long lastTimeStamp = eventList.get(i - 1).mTimeStamp;
+ if (eventList.get(i).mTimeStamp < lastTimeStamp) {
+ Log.e(TAG, "Unsorted timestamps in list: " + getListTimeStamps(eventList));
+ fail("Timestamp " + eventList.get(i).mTimeStamp + " at " + i
+ + " follows larger timestamp " + lastTimeStamp);
+ }
+ }
+ }
+
+ @Test
+ public void testInsertsSortedRandom() {
+ final Random random = new Random(128);
+ final EventList listUnderTest = new EventList();
+ for (int i = 0; i < 100; i++) {
+ listUnderTest.insert(getUsageEvent(random.nextLong()));
+ }
+ assertSorted(listUnderTest);
+ }
+
+ @Test
+ public void testInsertsSortedWithDuplicates() {
+ final Random random = new Random(256);
+ final EventList listUnderTest = new EventList();
+ for (int i = 0; i < 10; i++) {
+ final long randomTimeStamp = random.nextLong();
+ for (int j = 0; j < 10; j++) {
+ listUnderTest.insert(getUsageEvent(randomTimeStamp));
+ }
+ }
+ assertSorted(listUnderTest);
+ }
+
+ @Test
+ public void testFirstIndexOnOrAfter() {
+ final EventList listUnderTest = new EventList();
+ listUnderTest.insert(getUsageEvent(2));
+ listUnderTest.insert(getUsageEvent(5));
+ listUnderTest.insert(getUsageEvent(5));
+ listUnderTest.insert(getUsageEvent(5));
+ listUnderTest.insert(getUsageEvent(8));
+ assertTrue(listUnderTest.firstIndexOnOrAfter(1) == 0);
+ assertTrue(listUnderTest.firstIndexOnOrAfter(2) == 0);
+ assertTrue(listUnderTest.firstIndexOnOrAfter(3) == 1);
+ assertTrue(listUnderTest.firstIndexOnOrAfter(4) == 1);
+ assertTrue(listUnderTest.firstIndexOnOrAfter(5) == 1);
+ assertTrue(listUnderTest.firstIndexOnOrAfter(6) == 4);
+ assertTrue(listUnderTest.firstIndexOnOrAfter(7) == 4);
+ assertTrue(listUnderTest.firstIndexOnOrAfter(8) == 4);
+ assertTrue(listUnderTest.firstIndexOnOrAfter(9) == listUnderTest.size());
+ assertTrue(listUnderTest.firstIndexOnOrAfter(100) == listUnderTest.size());
+
+ listUnderTest.clear();
+ assertTrue(listUnderTest.firstIndexOnOrAfter(5) == 0);
+ assertTrue(listUnderTest.firstIndexOnOrAfter(100) == 0);
+ }
+
+ @Test
+ public void testClear() {
+ final EventList listUnderTest = new EventList();
+ for (int i = 1; i <= 100; i++) {
+ listUnderTest.insert(getUsageEvent(i));
+ }
+ listUnderTest.clear();
+ assertEquals(0, listUnderTest.size());
+ }
+
+ @Test
+ public void testSize() {
+ final EventList listUnderTest = new EventList();
+ for (int i = 1; i <= 100; i++) {
+ listUnderTest.insert(getUsageEvent(i));
+ }
+ assertEquals(100, listUnderTest.size());
+ }
+}
diff --git a/core/tests/coretests/src/android/app/usage/TimeSparseArrayTest.java b/core/tests/coretests/src/android/app/usage/TimeSparseArrayTest.java
deleted file mode 100644
index db46740..0000000
--- a/core/tests/coretests/src/android/app/usage/TimeSparseArrayTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2018 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.app.usage;
-
-import static org.junit.Assert.assertTrue;
-
-import android.os.SystemClock;
-import android.support.test.filters.SmallTest;
-import android.support.test.runner.AndroidJUnit4;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-@RunWith(AndroidJUnit4.class)
-@SmallTest
-public class TimeSparseArrayTest {
- @Test
- public void testDuplicateKeysNotDropped() {
- final TimeSparseArray<Integer> testTimeSparseArray = new TimeSparseArray<>();
- final long key = SystemClock.elapsedRealtime();
- for (int i = 0; i < 5; i++) {
- testTimeSparseArray.put(key, i);
- }
- for (int i = 0; i < 5; i++) {
- final int valueIndex = testTimeSparseArray.indexOfValue(i);
- assertTrue("Value " + i + " not found; intended key: " + key , valueIndex >= 0);
- final long keyForValue = testTimeSparseArray.keyAt(valueIndex);
- assertTrue("Value " + i + " stored too far (at " + keyForValue + ") from intended key "
- + key, Math.abs(keyForValue - key) < 100);
- }
- }
-}
diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
index 43e980e..dafd475 100644
--- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java
+++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
@@ -98,6 +98,7 @@
private static final Set<String> BACKUP_BLACKLISTED_GLOBAL_SETTINGS =
newHashSet(
Settings.Global.ACTIVITY_MANAGER_CONSTANTS,
+ Settings.Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED,
Settings.Global.ADB_ENABLED,
Settings.Global.ADD_USERS_WHEN_LOCKED,
Settings.Global.AIRPLANE_MODE_ON,
diff --git a/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java b/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
index 36e54ad..b68f6b1 100644
--- a/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
+++ b/core/tests/coretests/src/com/android/internal/os/MockBatteryStatsImpl.java
@@ -190,6 +190,11 @@
@Override
public void cancelCpuSyncDueToWakelockChange() {
}
+
+ @Override
+ public Future<?> scheduleSyncDueToBatteryLevelChange(long delayMillis) {
+ return null;
+ }
}
}
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index 3cc92bc..a465eea 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -829,6 +829,17 @@
}
/**
+ * DON'T USE THIS METHOD. It exists only to support a particular legacy behavior in
+ * the view system and will be removed as soon as that code is refactored to no longer
+ * depend on this behavior.
+ * @hide
+ */
+ public boolean clipRectUnion(@NonNull Rect rect) {
+ return nClipRect(mNativeCanvasWrapper, rect.left, rect.top, rect.right, rect.bottom,
+ Region.Op.UNION.nativeInt);
+ }
+
+ /**
* Intersect the current clip with the specified rectangle, which is
* expressed in local coordinates.
*
diff --git a/graphics/java/android/graphics/drawable/NinePatchDrawable.java b/graphics/java/android/graphics/drawable/NinePatchDrawable.java
index 66f2a31..5ff49ab 100644
--- a/graphics/java/android/graphics/drawable/NinePatchDrawable.java
+++ b/graphics/java/android/graphics/drawable/NinePatchDrawable.java
@@ -692,13 +692,13 @@
mPadding = new Rect();
}
mPadding.left = Drawable.scaleFromDensity(
- sourcePadding.left, sourceDensity, targetDensity, false);
+ sourcePadding.left, sourceDensity, targetDensity, true);
mPadding.top = Drawable.scaleFromDensity(
- sourcePadding.top, sourceDensity, targetDensity, false);
+ sourcePadding.top, sourceDensity, targetDensity, true);
mPadding.right = Drawable.scaleFromDensity(
- sourcePadding.right, sourceDensity, targetDensity, false);
+ sourcePadding.right, sourceDensity, targetDensity, true);
mPadding.bottom = Drawable.scaleFromDensity(
- sourcePadding.bottom, sourceDensity, targetDensity, false);
+ sourcePadding.bottom, sourceDensity, targetDensity, true);
} else {
mPadding = null;
}
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp
index 7d4e6f8..b3a3f45 100644
--- a/libs/androidfw/ResourceTypes.cpp
+++ b/libs/androidfw/ResourceTypes.cpp
@@ -3504,13 +3504,14 @@
{
PackageGroup(
ResTable* _owner, const String16& _name, uint32_t _id,
- bool appAsLib, bool _isSystemAsset)
+ bool appAsLib, bool _isSystemAsset, bool _isDynamic)
: owner(_owner)
, name(_name)
, id(_id)
, largestTypeId(0)
, dynamicRefTable(static_cast<uint8_t>(_id), appAsLib)
, isSystemAsset(_isSystemAsset)
+ , isDynamic(_isDynamic)
{ }
~PackageGroup() {
@@ -3614,6 +3615,7 @@
// If the package group comes from a system asset. Used in
// determining non-system locales.
const bool isSystemAsset;
+ const bool isDynamic;
};
ResTable::Theme::Theme(const ResTable& table)
@@ -3982,6 +3984,11 @@
return ((ssize_t)mPackageMap[Res_GETPACKAGE(resID)+1])-1;
}
+inline ssize_t ResTable::getResourcePackageIndexFromPackage(uint8_t packageID) const
+{
+ return ((ssize_t)mPackageMap[packageID])-1;
+}
+
status_t ResTable::add(const void* data, size_t size, const int32_t cookie, bool copyData) {
return addInternal(data, size, NULL, 0, false, cookie, copyData);
}
@@ -4037,7 +4044,7 @@
for (size_t i=0; i < src->mPackageGroups.size(); i++) {
PackageGroup* srcPg = src->mPackageGroups[i];
PackageGroup* pg = new PackageGroup(this, srcPg->name, srcPg->id,
- false /* appAsLib */, isSystemAsset || srcPg->isSystemAsset);
+ false /* appAsLib */, isSystemAsset || srcPg->isSystemAsset, srcPg->isDynamic);
for (size_t j=0; j<srcPg->packages.size(); j++) {
pg->packages.add(srcPg->packages[j]);
}
@@ -6277,6 +6284,68 @@
return true;
}
+bool ResTable::isPackageDynamic(uint8_t packageID) const {
+ if (mError != NO_ERROR) {
+ return false;
+ }
+ if (packageID == 0) {
+ ALOGW("Invalid package number 0x%08x", packageID);
+ return false;
+ }
+
+ const ssize_t p = getResourcePackageIndexFromPackage(packageID);
+
+ if (p < 0) {
+ ALOGW("Unknown package number 0x%08x", packageID);
+ return false;
+ }
+
+ const PackageGroup* const grp = mPackageGroups[p];
+ if (grp == NULL) {
+ ALOGW("Bad identifier for package number 0x%08x", packageID);
+ return false;
+ }
+
+ return grp->isDynamic;
+}
+
+bool ResTable::isResourceDynamic(uint32_t resID) const {
+ if (mError != NO_ERROR) {
+ return false;
+ }
+
+ const ssize_t p = getResourcePackageIndex(resID);
+ const int t = Res_GETTYPE(resID);
+ const int e = Res_GETENTRY(resID);
+
+ if (p < 0) {
+ if (Res_GETPACKAGE(resID)+1 == 0) {
+ ALOGW("No package identifier for resource number 0x%08x", resID);
+ } else {
+ ALOGW("No known package for resource number 0x%08x", resID);
+ }
+ return false;
+ }
+ if (t < 0) {
+ ALOGW("No type identifier for resource number 0x%08x", resID);
+ return false;
+ }
+
+ const PackageGroup* const grp = mPackageGroups[p];
+ if (grp == NULL) {
+ ALOGW("Bad identifier for resource number 0x%08x", resID);
+ return false;
+ }
+
+ Entry entry;
+ status_t err = getEntry(grp, t, e, NULL, &entry);
+ if (err != NO_ERROR) {
+ return false;
+ }
+
+ return grp->isDynamic;
+}
+
static bool keyCompare(const ResTable_sparseTypeEntry& entry , uint16_t entryIdx) {
return dtohs(entry.idx) < entryIdx;
}
@@ -6520,12 +6589,14 @@
id = targetPackageId;
}
+ bool isDynamic = false;
if (id >= 256) {
LOG_ALWAYS_FATAL("Package id out of range");
return NO_ERROR;
} else if (id == 0 || (id == 0x7f && appAsLib) || isSystemAsset) {
// This is a library or a system asset, so assign an ID
id = mNextPackageId++;
+ isDynamic = true;
}
PackageGroup* group = NULL;
@@ -6553,10 +6624,9 @@
size_t idx = mPackageMap[id];
if (idx == 0) {
idx = mPackageGroups.size() + 1;
-
char16_t tmpName[sizeof(pkg->name)/sizeof(pkg->name[0])];
strcpy16_dtoh(tmpName, pkg->name, sizeof(pkg->name)/sizeof(pkg->name[0]));
- group = new PackageGroup(this, String16(tmpName), id, appAsLib, isSystemAsset);
+ group = new PackageGroup(this, String16(tmpName), id, appAsLib, isSystemAsset, isDynamic);
if (group == NULL) {
delete package;
return (mError=NO_MEMORY);
diff --git a/libs/androidfw/include/androidfw/ResourceTypes.h b/libs/androidfw/include/androidfw/ResourceTypes.h
index bc0a07a..63b9e3a 100644
--- a/libs/androidfw/include/androidfw/ResourceTypes.h
+++ b/libs/androidfw/include/androidfw/ResourceTypes.h
@@ -1716,6 +1716,18 @@
bool getResourceFlags(uint32_t resID, uint32_t* outFlags) const;
/**
+ * Returns whether or not the package for the given resource has been dynamically assigned.
+ * If the resource can't be found, returns 'false'.
+ */
+ bool isResourceDynamic(uint32_t resID) const;
+
+ /**
+ * Returns whether or not the given package has been dynamically assigned.
+ * If the package can't be found, returns 'false'.
+ */
+ bool isPackageDynamic(uint8_t packageID) const;
+
+ /**
* Retrieve the value of a resource. If the resource is found, returns a
* value >= 0 indicating the table it is in (for use with
* getTableStringBlock() and getTableCookie()) and fills in 'outValue'. If
@@ -2024,6 +2036,7 @@
bool appAsLib, const int32_t cookie, bool copyData, bool isSystemAsset=false);
ssize_t getResourcePackageIndex(uint32_t resID) const;
+ ssize_t getResourcePackageIndexFromPackage(uint8_t packageID) const;
status_t getEntry(
const PackageGroup* packageGroup, int typeIndex, int entryIndex,
diff --git a/libs/hwui/hwui/Bitmap.cpp b/libs/hwui/hwui/Bitmap.cpp
index 795ec5b..263d249 100644
--- a/libs/hwui/hwui/Bitmap.cpp
+++ b/libs/hwui/hwui/Bitmap.cpp
@@ -296,6 +296,11 @@
outBitmap->allocPixels(info());
}
uirenderer::renderthread::RenderProxy::copyGraphicBufferInto(graphicBuffer(), outBitmap);
+ if (mInfo.colorSpace()) {
+ sk_sp<SkPixelRef> pixelRef = sk_ref_sp(outBitmap->pixelRef());
+ outBitmap->setInfo(mInfo);
+ outBitmap->setPixelRef(std::move(pixelRef), 0, 0);
+ }
return;
}
outBitmap->setInfo(mInfo, rowBytes());
diff --git a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
index 0e2a0e0..91c04fa 100644
--- a/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
+++ b/packages/CaptivePortalLogin/src/com/android/captiveportallogin/CaptivePortalLoginActivity.java
@@ -321,6 +321,7 @@
// TODO: reuse NetworkMonitor facilities for consistent captive portal detection.
new Thread(new Runnable() {
public void run() {
+ final Network network = ResolvUtil.makeNetworkWithPrivateDnsBypass(mNetwork);
// Give time for captive portal to open.
try {
Thread.sleep(1000);
@@ -329,7 +330,7 @@
HttpURLConnection urlConnection = null;
int httpResponseCode = 500;
try {
- urlConnection = (HttpURLConnection) mNetwork.openConnection(mUrl);
+ urlConnection = (HttpURLConnection) network.openConnection(mUrl);
urlConnection.setInstanceFollowRedirects(false);
urlConnection.setConnectTimeout(SOCKET_TIMEOUT_MS);
urlConnection.setReadTimeout(SOCKET_TIMEOUT_MS);
diff --git a/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java b/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
index aeb4a85..8bab3ca 100644
--- a/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/RestrictedLockUtils.java
@@ -46,6 +46,7 @@
import com.android.internal.widget.LockPatternUtils;
import java.util.List;
+import java.util.Objects;
/**
* Utility class to host methods usable in adding a restricted padlock icon and showing admin
@@ -90,29 +91,29 @@
// Restriction is not enforced.
return null;
} else if (enforcingUsers.size() > 1) {
- return EnforcedAdmin.MULTIPLE_ENFORCED_ADMIN;
+ return EnforcedAdmin.createDefaultEnforcedAdminWithRestriction(userRestriction);
}
final int restrictionSource = enforcingUsers.get(0).getUserRestrictionSource();
final int adminUserId = enforcingUsers.get(0).getUserHandle().getIdentifier();
-
if (restrictionSource == UserManager.RESTRICTION_SOURCE_PROFILE_OWNER) {
// Check if it is a profile owner of the user under consideration.
if (adminUserId == userId) {
- return getProfileOwner(context, adminUserId);
+ return getProfileOwner(context, userRestriction, adminUserId);
} else {
// Check if it is a profile owner of a managed profile of the current user.
// Otherwise it is in a separate user and we return a default EnforcedAdmin.
final UserInfo parentUser = um.getProfileParent(adminUserId);
return (parentUser != null && parentUser.id == userId)
- ? getProfileOwner(context, adminUserId)
- : EnforcedAdmin.MULTIPLE_ENFORCED_ADMIN;
+ ? getProfileOwner(context, userRestriction, adminUserId)
+ : EnforcedAdmin.createDefaultEnforcedAdminWithRestriction(userRestriction);
}
} else if (restrictionSource == UserManager.RESTRICTION_SOURCE_DEVICE_OWNER) {
// When the restriction is enforced by device owner, return the device owner admin only
// if the admin is for the {@param userId} otherwise return a default EnforcedAdmin.
return adminUserId == userId
- ? getDeviceOwner(context) : EnforcedAdmin.MULTIPLE_ENFORCED_ADMIN;
+ ? getDeviceOwner(context, userRestriction)
+ : EnforcedAdmin.createDefaultEnforcedAdminWithRestriction(userRestriction);
}
// If the restriction is enforced by system then return null.
@@ -406,7 +407,6 @@
* or {@code null} if no quality requirements are set. If the requirements are set by
* multiple device admins, then the admin component will be set to {@code null} and userId to
* {@link UserHandle#USER_NULL}.
- *
*/
public static EnforcedAdmin checkIfPasswordQualityIsSet(Context context, int userId) {
final LockSettingCheck check =
@@ -518,6 +518,11 @@
}
public static EnforcedAdmin getProfileOrDeviceOwner(Context context, int userId) {
+ return getProfileOrDeviceOwner(context, null, userId);
+ }
+
+ public static EnforcedAdmin getProfileOrDeviceOwner(
+ Context context, String enforcedRestriction, int userId) {
if (userId == UserHandle.USER_NULL) {
return null;
}
@@ -528,18 +533,22 @@
}
ComponentName adminComponent = dpm.getProfileOwnerAsUser(userId);
if (adminComponent != null) {
- return new EnforcedAdmin(adminComponent, userId);
+ return new EnforcedAdmin(adminComponent, enforcedRestriction, userId);
}
if (dpm.getDeviceOwnerUserId() == userId) {
adminComponent = dpm.getDeviceOwnerComponentOnAnyUser();
if (adminComponent != null) {
- return new EnforcedAdmin(adminComponent, userId);
+ return new EnforcedAdmin(adminComponent, enforcedRestriction, userId);
}
}
return null;
}
public static EnforcedAdmin getDeviceOwner(Context context) {
+ return getDeviceOwner(context, null);
+ }
+
+ private static EnforcedAdmin getDeviceOwner(Context context, String enforcedRestriction) {
final DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(
Context.DEVICE_POLICY_SERVICE);
if (dpm == null) {
@@ -547,12 +556,18 @@
}
ComponentName adminComponent = dpm.getDeviceOwnerComponentOnAnyUser();
if (adminComponent != null) {
- return new EnforcedAdmin(adminComponent, dpm.getDeviceOwnerUserId());
+ return new EnforcedAdmin(
+ adminComponent, enforcedRestriction, dpm.getDeviceOwnerUserId());
}
return null;
}
private static EnforcedAdmin getProfileOwner(Context context, int userId) {
+ return getProfileOwner(context, null, userId);
+ }
+
+ private static EnforcedAdmin getProfileOwner(
+ Context context, String enforcedRestriction, int userId) {
if (userId == UserHandle.USER_NULL) {
return null;
}
@@ -563,7 +578,7 @@
}
ComponentName adminComponent = dpm.getProfileOwnerAsUser(userId);
if (adminComponent != null) {
- return new EnforcedAdmin(adminComponent, userId);
+ return new EnforcedAdmin(adminComponent, enforcedRestriction, userId);
}
return null;
}
@@ -626,6 +641,7 @@
&& isCurrentUserOrProfile(context, admin.userId)) {
targetUserId = admin.userId;
}
+ intent.putExtra(DevicePolicyManager.EXTRA_RESTRICTION, admin.enforcedRestriction);
context.startActivityAsUser(intent, new UserHandle(targetUserId));
}
@@ -700,53 +716,71 @@
}
public static class EnforcedAdmin {
+ @Nullable
public ComponentName component = null;
+ /**
+ * The restriction enforced by admin. It could be any user restriction or policy like
+ * {@link DevicePolicyManager#POLICY_DISABLE_CAMERA}.
+ */
+ @Nullable
+ public String enforcedRestriction = null;
public int userId = UserHandle.USER_NULL;
// We use this to represent the case where a policy is enforced by multiple admins.
public final static EnforcedAdmin MULTIPLE_ENFORCED_ADMIN = new EnforcedAdmin();
+ public static EnforcedAdmin createDefaultEnforcedAdminWithRestriction(
+ String enforcedRestriction) {
+ EnforcedAdmin enforcedAdmin = new EnforcedAdmin();
+ enforcedAdmin.enforcedRestriction = enforcedRestriction;
+ return enforcedAdmin;
+ }
+
public EnforcedAdmin(ComponentName component, int userId) {
this.component = component;
this.userId = userId;
}
+ public EnforcedAdmin(ComponentName component, String enforcedRestriction, int userId) {
+ this.component = component;
+ this.enforcedRestriction = enforcedRestriction;
+ this.userId = userId;
+ }
+
public EnforcedAdmin(EnforcedAdmin other) {
if (other == null) {
throw new IllegalArgumentException();
}
this.component = other.component;
+ this.enforcedRestriction = other.enforcedRestriction;
this.userId = other.userId;
}
- public EnforcedAdmin() {}
+ public EnforcedAdmin() {
+ }
@Override
- public boolean equals(Object object) {
- if (object == this) return true;
- if (!(object instanceof EnforcedAdmin)) return false;
- EnforcedAdmin other = (EnforcedAdmin) object;
- if (userId != other.userId) {
- return false;
- }
- if ((component == null && other.component == null) ||
- (component != null && component.equals(other.component))) {
- return true;
- }
- return false;
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ EnforcedAdmin that = (EnforcedAdmin) o;
+ return userId == that.userId &&
+ Objects.equals(component, that.component) &&
+ Objects.equals(enforcedRestriction, that.enforcedRestriction);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(component, enforcedRestriction, userId);
}
@Override
public String toString() {
- return "EnforcedAdmin{component=" + component + ",userId=" + userId + "}";
- }
-
- public void copyTo(EnforcedAdmin other) {
- if (other == null) {
- throw new IllegalArgumentException();
- }
- other.component = component;
- other.userId = userId;
+ return "EnforcedAdmin{" +
+ "component=" + component +
+ ", enforcedRestriction='" + enforcedRestriction +
+ ", userId=" + userId +
+ '}';
}
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java b/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
new file mode 100644
index 0000000..55723f9
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/display/BrightnessUtils.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2018 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.settingslib.display;
+
+import android.util.MathUtils;
+
+public class BrightnessUtils {
+
+ public static final int GAMMA_SPACE_MAX = 1023;
+
+ // Hybrid Log Gamma constant values
+ private static final float R = 0.5f;
+ private static final float A = 0.17883277f;
+ private static final float B = 0.28466892f;
+ private static final float C = 0.55991073f;
+
+ /**
+ * A function for converting from the gamma space that the slider works in to the
+ * linear space that the setting works in.
+ *
+ * The gamma space effectively provides us a way to make linear changes to the slider that
+ * result in linear changes in perception. If we made changes to the slider in the linear space
+ * then we'd see an approximately logarithmic change in perception (c.f. Fechner's Law).
+ *
+ * Internally, this implements the Hybrid Log Gamma electro-optical transfer function, which is
+ * a slight improvement to the typical gamma transfer function for displays whose max
+ * brightness exceeds the 120 nit reference point, but doesn't set a specific reference
+ * brightness like the PQ function does.
+ *
+ * Note that this transfer function is only valid if the display's backlight value is a linear
+ * control. If it's calibrated to be something non-linear, then a different transfer function
+ * should be used.
+ *
+ * @param val The slider value.
+ * @param min The minimum acceptable value for the setting.
+ * @param max The maximum acceptable value for the setting.
+ * @return The corresponding setting value.
+ */
+ public static final int convertGammaToLinear(int val, int min, int max) {
+ final float normalizedVal = MathUtils.norm(0, GAMMA_SPACE_MAX, val);
+ final float ret;
+ if (normalizedVal <= R) {
+ ret = MathUtils.sq(normalizedVal / R);
+ } else {
+ ret = MathUtils.exp((normalizedVal - C) / A) + B;
+ }
+
+ // HLG is normalized to the range [0, 12], so we need to re-normalize to the range [0, 1]
+ // in order to derive the correct setting value.
+ return Math.round(MathUtils.lerp(min, max, ret / 12));
+ }
+
+ /**
+ * A function for converting from the linear space that the setting works in to the
+ * gamma space that the slider works in.
+ *
+ * The gamma space effectively provides us a way to make linear changes to the slider that
+ * result in linear changes in perception. If we made changes to the slider in the linear space
+ * then we'd see an approximately logarithmic change in perception (c.f. Fechner's Law).
+ *
+ * Internally, this implements the Hybrid Log Gamma opto-electronic transfer function, which is
+ * a slight improvement to the typical gamma transfer function for displays whose max
+ * brightness exceeds the 120 nit reference point, but doesn't set a specific reference
+ * brightness like the PQ function does.
+ *
+ * Note that this transfer function is only valid if the display's backlight value is a linear
+ * control. If it's calibrated to be something non-linear, then a different transfer function
+ * should be used.
+ *
+ * @param val The brightness setting value.
+ * @param min The minimum acceptable value for the setting.
+ * @param max The maximum acceptable value for the setting.
+ * @return The corresponding slider value
+ */
+ public static final int convertLinearToGamma(int val, int min, int max) {
+ // For some reason, HLG normalizes to the range [0, 12] rather than [0, 1]
+ final float normalizedVal = MathUtils.norm(min, max, val) * 12;
+ final float ret;
+ if (normalizedVal <= 1f) {
+ ret = MathUtils.sqrt(normalizedVal) * R;
+ } else {
+ ret = A * MathUtils.log(normalizedVal - B) + C;
+ }
+
+ return Math.round(MathUtils.lerp(0, GAMMA_SPACE_MAX, ret));
+ }
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/users/UserManagerHelper.java b/packages/SettingsLib/src/com/android/settingslib/users/UserManagerHelper.java
index 113256f..e2faf6a 100644
--- a/packages/SettingsLib/src/com/android/settingslib/users/UserManagerHelper.java
+++ b/packages/SettingsLib/src/com/android/settingslib/users/UserManagerHelper.java
@@ -354,20 +354,15 @@
return;
}
- if (userInfo.isGuest()) {
- switchToGuest(userInfo.name);
- return;
- }
-
switchToUserId(userInfo.id);
}
/**
- * Creates a guest session and switches into the guest session.
+ * Creates a new guest session and switches into the guest session.
*
* @param guestName Username for the guest user.
*/
- public void switchToGuest(String guestName) {
+ public void startNewGuestSession(String guestName) {
UserInfo guest = mUserManager.createGuest(mContext, guestName);
if (guest == null) {
// Couldn't create user, most likely because there are too many, but we haven't
@@ -375,6 +370,7 @@
Log.w(TAG, "can't create user.");
return;
}
+ assignDefaultIcon(guest);
switchToUserId(guest.id);
}
@@ -417,6 +413,27 @@
mUserManager.setUserName(user.id, name);
}
+ /**
+ * Gets a bitmap representing the user's default avatar.
+ *
+ * @param userInfo User whose avatar should be returned.
+ * @return Default user icon
+ */
+ public Bitmap getUserDefaultIcon(UserInfo userInfo) {
+ return UserIcons.convertToBitmap(
+ UserIcons.getDefaultUserIcon(mContext.getResources(), userInfo.id, false));
+ }
+
+ /**
+ * Gets a bitmap representing the default icon for a Guest user.
+ *
+ * @return Degault guest icon
+ */
+ public Bitmap getGuestDefaultIcon() {
+ return UserIcons.convertToBitmap(UserIcons.getDefaultUserIcon(
+ mContext.getResources(), UserHandle.USER_NULL, false));
+ }
+
private void registerReceiver() {
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_USER_REMOVED);
@@ -435,8 +452,7 @@
* @return Bitmap that has been assigned to the user.
*/
private Bitmap assignDefaultIcon(UserInfo userInfo) {
- Bitmap bitmap = UserIcons.convertToBitmap(
- UserIcons.getDefaultUserIcon(mContext.getResources(), userInfo.id, false));
+ Bitmap bitmap = userInfo.isGuest() ? getGuestDefaultIcon() : getUserDefaultIcon(userInfo);
mUserManager.setUserIcon(userInfo.id, bitmap);
return bitmap;
}
diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/users/UserManagerHelperTest.java b/packages/SettingsLib/tests/integ/src/com/android/settingslib/users/UserManagerHelperTest.java
index 15f7770..54510b2 100644
--- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/users/UserManagerHelperTest.java
+++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/users/UserManagerHelperTest.java
@@ -247,13 +247,13 @@
}
@Test
- public void switchToGuest() {
- mHelper.switchToGuest("Test Guest");
+ public void startNewGuestSession() {
+ mHelper.startNewGuestSession("Test Guest");
verify(mUserManager).createGuest(mContext, "Test Guest");
UserInfo guestInfo = new UserInfo(21, "Test Guest", UserInfo.FLAG_GUEST);
when(mUserManager.createGuest(mContext, "Test Guest")).thenReturn(guestInfo);
- mHelper.switchToGuest("Test Guest");
+ mHelper.startNewGuestSession("Test Guest");
verify(mActivityManager).switchUser(21);
}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedLockUtilsTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedLockUtilsTest.java
index 5f60868..710dbc22 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedLockUtilsTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/RestrictedLockUtilsTest.java
@@ -32,6 +32,7 @@
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
+import android.os.UserHandle;
import android.os.UserManager;
import org.junit.Before;
@@ -42,6 +43,7 @@
import org.mockito.MockitoAnnotations;
import java.util.Arrays;
+import java.util.Collections;
@RunWith(SettingsLibRobolectricTestRunner.class)
public class RestrictedLockUtilsTest {
@@ -77,6 +79,42 @@
}
@Test
+ public void checkIfRestrictionEnforced_deviceOwner() {
+ UserManager.EnforcingUser enforcingUser = new UserManager.EnforcingUser(mUserId,
+ UserManager.RESTRICTION_SOURCE_DEVICE_OWNER);
+ final String userRestriction = UserManager.DISALLOW_UNINSTALL_APPS;
+ when(mUserManager.getUserRestrictionSources(userRestriction,
+ UserHandle.of(mUserId))).
+ thenReturn(Collections.singletonList(enforcingUser));
+ setUpDeviceOwner(mAdmin1);
+
+ EnforcedAdmin enforcedAdmin = RestrictedLockUtils.checkIfRestrictionEnforced(mContext,
+ userRestriction, mUserId);
+
+ assertThat(enforcedAdmin).isNotNull();
+ assertThat(enforcedAdmin.enforcedRestriction).isEqualTo(userRestriction);
+ assertThat(enforcedAdmin.component).isEqualTo(mAdmin1);
+ }
+
+ @Test
+ public void checkIfRestrictionEnforced_profileOwner() {
+ UserManager.EnforcingUser enforcingUser = new UserManager.EnforcingUser(mUserId,
+ UserManager.RESTRICTION_SOURCE_PROFILE_OWNER);
+ final String userRestriction = UserManager.DISALLOW_UNINSTALL_APPS;
+ when(mUserManager.getUserRestrictionSources(userRestriction,
+ UserHandle.of(mUserId))).
+ thenReturn(Collections.singletonList(enforcingUser));
+ setUpProfileOwner(mAdmin1, mUserId);
+
+ EnforcedAdmin enforcedAdmin = RestrictedLockUtils.checkIfRestrictionEnforced(mContext,
+ userRestriction, mUserId);
+
+ assertThat(enforcedAdmin).isNotNull();
+ assertThat(enforcedAdmin.enforcedRestriction).isEqualTo(userRestriction);
+ assertThat(enforcedAdmin.component).isEqualTo(mAdmin1);
+ }
+
+ @Test
public void checkIfDevicePolicyServiceDisabled_noEnforceAdminForManagedProfile() {
when(mContext.getSystemService(Context.DEVICE_POLICY_SERVICE)).thenReturn(null);
final EnforcedAdmin enforcedAdmin = RestrictedLockUtils.checkIfAccountManagementDisabled(
@@ -263,4 +301,12 @@
when(mDevicePolicyManager.getActiveAdminsAsUser(userId))
.thenReturn(Arrays.asList(activeAdmins));
}
+
+ private void setUpDeviceOwner(ComponentName admin) {
+ when(mDevicePolicyManager.getDeviceOwnerComponentOnAnyUser()).thenReturn(admin);
+ }
+
+ private void setUpProfileOwner(ComponentName admin, int userId) {
+ when(mDevicePolicyManager.getProfileOwnerAsUser(userId)).thenReturn(admin);
+ }
}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/display/BrightnessUtilsTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/display/BrightnessUtilsTest.java
new file mode 100644
index 0000000..eb7ad6d
--- /dev/null
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/display/BrightnessUtilsTest.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2018 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.settingslib.display;
+
+import static com.android.settingslib.display.BrightnessUtils.GAMMA_SPACE_MAX;
+import static com.google.common.truth.Truth.assertThat;
+
+import com.android.settingslib.SettingsLibRobolectricTestRunner;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(SettingsLibRobolectricTestRunner.class)
+public class BrightnessUtilsTest {
+
+ private static final int MIN = 1;
+ private static final int MAX = 255;
+
+ @Test
+ public void linearToGamma_minValue_shouldReturn0() {
+ assertThat(BrightnessUtils.convertLinearToGamma(MIN, MIN, MAX)).isEqualTo(0);
+ }
+
+ @Test
+ public void linearToGamma_maxValue_shouldReturnGammaSpaceMax() {
+ assertThat(BrightnessUtils.convertLinearToGamma(MAX, MIN, MAX)).isEqualTo(GAMMA_SPACE_MAX);
+ }
+
+ @Test
+ public void gammaToLinear_minValue_shouldReturnMin() {
+ assertThat(BrightnessUtils.convertGammaToLinear(MIN, MIN, MAX)).isEqualTo(MIN);
+ }
+
+ @Test
+ public void gammaToLinear_gammaSpaceValue_shouldReturnMax() {
+ assertThat(BrightnessUtils.convertGammaToLinear(GAMMA_SPACE_MAX, MIN, MAX)).isEqualTo(MAX);
+ }
+}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/users/UserManagerHelperRoboTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/users/UserManagerHelperRoboTest.java
index f2ea3a4..890abef 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/users/UserManagerHelperRoboTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/users/UserManagerHelperRoboTest.java
@@ -185,12 +185,7 @@
mHelper.switchToUser(createUserInfoForId(20));
assertThat(ShadowActivityManager.getShadow().getSwitchUserCalled()).isFalse();
- // Switching to Guest calls createGuest.
- UserInfo guestInfo = new UserInfo(21, "Test Guest", UserInfo.FLAG_GUEST);
- mHelper.switchToUser(guestInfo);
- verify(mUserManager).createGuest(mContext, "Test Guest");
-
- // Switching to non-current, non-guest user, simply calls switchUser.
+ // Switching to non-foreground user, simply calls switchUser.
UserInfo userToSwitchTo = new UserInfo(22, "Test User", 0);
mHelper.switchToUser(userToSwitchTo);
assertThat(ShadowActivityManager.getShadow().getSwitchUserCalled()).isTrue();
diff --git a/packages/SystemUI/res/drawable/ic_lock_lockdown.xml b/packages/SystemUI/res/drawable/ic_lock_lockdown.xml
index 65b9813..d591aa8 100644
--- a/packages/SystemUI/res/drawable/ic_lock_lockdown.xml
+++ b/packages/SystemUI/res/drawable/ic_lock_lockdown.xml
@@ -17,10 +17,10 @@
android:width="24.0dp"
android:height="24.0dp"
android:viewportWidth="24.0"
- android:viewportHeight="24.0">
+ android:viewportHeight="24.0"
+ android:tint="?attr/colorControlNormal">
<path
android:fillColor="#000000"
- android:alpha="0.87"
android:pathData="M18.0,8.0l-1.0,0.0L17.0,6.0c0.0,-2.8 -2.2,-5.0 -5.0,-5.0C9.2,1.0 7.0,3.2 7.0,6.0l0.0,2.0L6.0,8.0c-1.1,0.0 -2.0,0.9 -2.0,2.0l0.0,10.0c0.0,1.1 0.9,2.0 2.0,2.0l12.0,0.0c1.1,0.0 2.0,-0.9 2.0,-2.0L20.0,10.0C20.0,8.9 19.1,8.0 18.0,8.0zM12.0,17.0c-1.1,0.0 -2.0,-0.9 -2.0,-2.0s0.9,-2.0 2.0,-2.0c1.1,0.0 2.0,0.9 2.0,2.0S13.1,17.0 12.0,17.0zM15.1,8.0L8.9,8.0L8.9,6.0c0.0,-1.7 1.4,-3.1 3.1,-3.1c1.7,0.0 3.1,1.4 3.1,3.1L15.1,8.0z"/>
</vector>
diff --git a/packages/SystemUI/res/layout/hybrid_notification.xml b/packages/SystemUI/res/layout/hybrid_notification.xml
index f4501da..bccf207 100644
--- a/packages/SystemUI/res/layout/hybrid_notification.xml
+++ b/packages/SystemUI/res/layout/hybrid_notification.xml
@@ -34,7 +34,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
- android:textAppearance="@*android:style/TextAppearance.Material.Notification"
style="?attr/hybridNotificationTextStyle"
/>
</com.android.systemui.statusbar.notification.HybridNotificationView>
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/hybrid_overflow_number.xml b/packages/SystemUI/res/layout/hybrid_overflow_number.xml
index 792f424..08f8f94 100644
--- a/packages/SystemUI/res/layout/hybrid_overflow_number.xml
+++ b/packages/SystemUI/res/layout/hybrid_overflow_number.xml
@@ -16,10 +16,10 @@
-->
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@*android:style/Widget.Material.Notification.Text"
android:id="@+id/notification_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textAppearance="@*android:style/TextAppearance.Material.Notification"
android:paddingEnd="@dimen/group_overflow_number_padding"
android:gravity="end"
android:singleLine="true"
diff --git a/packages/SystemUI/res/layout/qs_tile_label.xml b/packages/SystemUI/res/layout/qs_tile_label.xml
index 49d142a..8ca867f 100644
--- a/packages/SystemUI/res/layout/qs_tile_label.xml
+++ b/packages/SystemUI/res/layout/qs_tile_label.xml
@@ -41,7 +41,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
- android:maxLines="2"
android:padding="0dp"
android:gravity="center"
android:ellipsize="marquee"
diff --git a/packages/SystemUI/res/layout/quick_qs_status_icons.xml b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
index 5f73bef..4301fdb 100644
--- a/packages/SystemUI/res/layout/quick_qs_status_icons.xml
+++ b/packages/SystemUI/res/layout/quick_qs_status_icons.xml
@@ -18,13 +18,15 @@
xmlns:systemui="http://schemas.android.com/apk/res-auto"
android:id="@+id/quick_qs_status_icons"
android:layout_width="match_parent"
- android:layout_height="20dp"
+ android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="14dp"
- android:layout_marginStart="8dp"
- android:layout_marginEnd="@dimen/notification_side_paddings"
+ android:layout_marginStart="@dimen/status_bar_padding_start"
+ android:layout_marginEnd="@dimen/status_bar_padding_end"
android:layout_below="@id/quick_status_bar_system_icons"
- android:paddingEnd="@dimen/status_bar_padding_end" >
+ android:clipChildren="false"
+ android:clipToPadding="false"
+ android:minHeight="20dp" >
<com.android.systemui.statusbar.policy.DateView
android:id="@+id/date"
diff --git a/packages/SystemUI/res/layout/quick_settings_header_info.xml b/packages/SystemUI/res/layout/quick_settings_header_info.xml
index 54baa4a..0892f73 100644
--- a/packages/SystemUI/res/layout/quick_settings_header_info.xml
+++ b/packages/SystemUI/res/layout/quick_settings_header_info.xml
@@ -45,14 +45,16 @@
android:layout_width="@dimen/qs_header_alarm_icon_size"
android:layout_height="@dimen/qs_header_alarm_icon_size"
android:src="@drawable/stat_sys_alarm"
- android:tint="?android:attr/textColorPrimary" />
+ android:tint="?android:attr/textColorPrimary"
+ android:visibility="gone"/>
<TextView
android:id="@+id/next_alarm_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/qs_header_alarm_text_margin_start"
- android:textAppearance="@style/TextAppearance.QS.TileLabel" />
+ android:textAppearance="@style/TextAppearance.QS.TileLabel"
+ android:visibility="gone"/>
<View
android:id="@+id/status_separator"
@@ -61,20 +63,23 @@
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="@android:color/white"
- android:backgroundTint="?android:attr/textColorPrimary" />
+ android:backgroundTint="?android:attr/textColorPrimary"
+ android:visibility="gone"/>
<ImageView
android:id="@+id/ringer_mode_icon"
android:layout_width="@dimen/qs_header_alarm_icon_size"
android:layout_height="@dimen/qs_header_alarm_icon_size"
- android:tint="?android:attr/textColorPrimary" />
+ android:tint="?android:attr/textColorPrimary"
+ android:visibility="gone"/>
<TextView
android:id="@+id/ringer_mode_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/qs_header_alarm_text_margin_start"
- android:textAppearance="@style/TextAppearance.QS.TileLabel" />
+ android:textAppearance="@style/TextAppearance.QS.TileLabel"
+ android:visibility="gone"/>
</LinearLayout>
diff --git a/packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml b/packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml
index a9fe862..d40534e 100644
--- a/packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml
+++ b/packages/SystemUI/res/layout/quick_status_bar_header_system_icons.xml
@@ -20,15 +20,12 @@
android:id="@+id/quick_status_bar_system_icons"
android:layout_width="match_parent"
android:layout_height="@*android:dimen/quick_qs_offset_height"
- android:layout_marginRight="@dimen/notification_side_paddings"
- android:layout_marginLeft="@dimen/notification_side_paddings"
- android:layout_alignParentEnd="true"
android:clipChildren="false"
android:clipToPadding="false"
android:gravity="center"
+ android:orientation="horizontal"
android:paddingStart="@dimen/status_bar_padding_start"
- android:paddingEnd="@dimen/status_bar_padding_end"
- android:orientation="horizontal">
+ android:paddingEnd="@dimen/status_bar_padding_end" >
<com.android.systemui.statusbar.policy.Clock
android:id="@+id/clock"
diff --git a/packages/SystemUI/res/layout/volume_dnd_icon.xml b/packages/SystemUI/res/layout/volume_dnd_icon.xml
index acf9aed..ac235b7 100644
--- a/packages/SystemUI/res/layout/volume_dnd_icon.xml
+++ b/packages/SystemUI/res/layout/volume_dnd_icon.xml
@@ -15,11 +15,11 @@
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="@dimen/volume_dialog_panel_width"
+ android:id="@+id/dnd_icon"
+ android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
- android:id="@+id/dnd_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_marginTop="6dp"
diff --git a/packages/SystemUI/res/values/config_car.xml b/packages/SystemUI/res/values/config_car.xml
index db829f2..2c549bc 100644
--- a/packages/SystemUI/res/values/config_car.xml
+++ b/packages/SystemUI/res/values/config_car.xml
@@ -27,4 +27,5 @@
<bool name="config_enableLeftNavigationBar">false</bool>
<bool name="config_enableRightNavigationBar">false</bool>
<bool name="config_enableBottomNavigationBar">true</bool>
+ <bool name="config_hideNavWhenKeyguardBouncerShown">true</bool>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 875000c..ac9fb2b 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -326,7 +326,7 @@
<dimen name="pull_span_min">25dp</dimen>
<dimen name="qs_tile_height">106dp</dimen>
- <dimen name="qs_tile_layout_margin_side">9dp</dimen>
+ <dimen name="qs_tile_layout_margin_side">6dp</dimen>
<dimen name="qs_tile_margin_horizontal">18dp</dimen>
<dimen name="qs_tile_margin_vertical">24dp</dimen>
<dimen name="qs_tile_margin_top_bottom">12dp</dimen>
@@ -917,6 +917,8 @@
<dimen name="edge_margin">8dp</dimen>
<dimen name="rounded_corner_radius">0dp</dimen>
+ <dimen name="rounded_corner_radius_top">0dp</dimen>
+ <dimen name="rounded_corner_radius_bottom">0dp</dimen>
<dimen name="rounded_corner_content_padding">0dp</dimen>
<dimen name="nav_content_padding">0dp</dimen>
<dimen name="nav_quick_scrub_track_edge_padding">42dp</dimen>
diff --git a/packages/SystemUI/res/values/ids_car.xml b/packages/SystemUI/res/values/ids_car.xml
new file mode 100644
index 0000000..27ed2e2
--- /dev/null
+++ b/packages/SystemUI/res/values/ids_car.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2018 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>
+ <!-- Values used for finding elements on the system ui nav bars -->
+ <item type="id" name="lock_screen_nav_buttons"/>
+ <item type="id" name="nav_buttons"/>
+</resources>
\ No newline at end of file
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index d82b00c..697ab06 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -2223,4 +2223,6 @@
<!-- An action on the dialog that tells that scheduled (i.e. automatic) battery saver: user acknowledges and closes the dialog. [CHAR LIMIT=NONE]-->
<string name="auto_saver_okay_action">Got it</string>
+ <!-- URl of the webpage that explains battery saver. -->
+ <string name="help_uri_battery_saver_learn_more_link_target" translatable="false"></string>
</resources>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 804ca2c..1e19534 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -137,7 +137,8 @@
<item name="android:layout_marginTop">4dp</item>
</style>
- <style name="hybrid_notification_text">
+ <style name="hybrid_notification_text"
+ parent="@*android:style/Widget.Material.Notification.Text">
<item name="android:paddingEnd">4dp</item>
</style>
@@ -360,10 +361,6 @@
parent="@*android:style/TextAppearance.Material.Notification.Info">
</style>
- <style name="TextAppearance.Material.Notification.HybridNotificationDivider"
- parent="@*android:style/TextAppearance.Material.Notification">
- </style>
-
<style name="SearchPanelCircle">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/NavigationBarCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/NavigationBarCompat.java
index 8d451c1..5a0dddc 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/NavigationBarCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/NavigationBarCompat.java
@@ -33,10 +33,21 @@
* touch slop is when the respected operation will occur when exceeded. Touch slop must be
* larger than the drag slop.
*/
- public static final int QUICK_STEP_DRAG_SLOP_PX = convertDpToPixel(10);
- public static final int QUICK_SCRUB_DRAG_SLOP_PX = convertDpToPixel(20);
- public static final int QUICK_STEP_TOUCH_SLOP_PX = convertDpToPixel(24);
- public static final int QUICK_SCRUB_TOUCH_SLOP_PX = convertDpToPixel(35);
+ public static int getQuickStepDragSlopPx() {
+ return convertDpToPixel(10);
+ }
+
+ public static int getQuickScrubDragSlopPx() {
+ return convertDpToPixel(20);
+ }
+
+ public static int getQuickStepTouchSlopPx() {
+ return convertDpToPixel(24);
+ }
+
+ public static int getQuickScrubTouchSlopPx() {
+ return convertDpToPixel(35);
+ }
@Retention(RetentionPolicy.SOURCE)
@IntDef({HIT_TARGET_NONE, HIT_TARGET_BACK, HIT_TARGET_HOME, HIT_TARGET_OVERVIEW})
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
index c826aaa..d24675c 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java
@@ -68,6 +68,7 @@
import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener;
import android.telephony.TelephonyManager;
import android.util.Log;
+import android.util.Slog;
import android.util.SparseBooleanArray;
import android.util.SparseIntArray;
@@ -87,7 +88,6 @@
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map.Entry;
@@ -400,9 +400,16 @@
// Hack level over 9000: Because the subscription id is not yet valid when we see the
// first update in handleSimStateChange, we need to force refresh all all SIM states
// so the subscription id for them is consistent.
- List<Integer> changedSubscriptionIds = refreshSimState(subscriptionInfos);
- for (int i = 0; i < changedSubscriptionIds.size(); i++) {
- SimData data = mSimDatas.get(changedSubscriptionIds.get(i));
+ ArrayList<SubscriptionInfo> changedSubscriptions = new ArrayList<>();
+ for (int i = 0; i < subscriptionInfos.size(); i++) {
+ SubscriptionInfo info = subscriptionInfos.get(i);
+ boolean changed = refreshSimState(info.getSubscriptionId(), info.getSimSlotIndex());
+ if (changed) {
+ changedSubscriptions.add(info);
+ }
+ }
+ for (int i = 0; i < changedSubscriptions.size(); i++) {
+ SimData data = mSimDatas.get(changedSubscriptions.get(i).getSubscriptionId());
for (int j = 0; j < mCallbacks.size(); j++) {
KeyguardUpdateMonitorCallback cb = mCallbacks.get(j).get();
if (cb != null) {
@@ -1839,61 +1846,34 @@
};
/**
- * @return A list of changed subscriptions, maybe empty but never null
+ * @return true if and only if the state has changed for the specified {@code slotId}
*/
- private List<Integer> refreshSimState(final List<SubscriptionInfo> activeSubscriptionInfos) {
+ private boolean refreshSimState(int subId, int slotId) {
// This is awful. It exists because there are two APIs for getting the SIM status
// 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 TelephonyManager tele = TelephonyManager.from(mContext);
- ArrayList<Integer> changedSubscriptionIds = new ArrayList<>();
- HashSet<Integer> activeSubIds = new HashSet<>();
- HashSet<Integer> activeSlotIds = new HashSet<>();
-
- for (SubscriptionInfo info : activeSubscriptionInfos) {
- int subId = info.getSubscriptionId();
- int slotId = info.getSimSlotIndex();
- int simState = tele.getSimState(slotId);
- State state;
- try {
- state = State.intToState(simState);
- } catch(IllegalArgumentException ex) {
- Log.w(TAG, "Unknown sim state: " + simState);
- state = State.UNKNOWN;
- }
-
- SimData data = mSimDatas.get(subId);
- final boolean changed;
- if (data == null) {
- data = new SimData(state, slotId, subId);
- mSimDatas.put(subId, data);
- changed = true; // no data yet; force update
- } else {
- changed = data.simState != state;
- data.simState = state;
- }
- if (changed) {
- changedSubscriptionIds.add(subId);
- }
-
- activeSubIds.add(subId);
- activeSlotIds.add(slotId);
+ int simState = tele.getSimState(slotId);
+ State state;
+ try {
+ state = State.intToState(simState);
+ } catch(IllegalArgumentException ex) {
+ Log.w(TAG, "Unknown sim state: " + simState);
+ state = State.UNKNOWN;
}
-
- for (SimData data : mSimDatas.values()) {
- if (!activeSubIds.contains(data.subId)
- && !activeSlotIds.contains(data.slotId)
- && data.simState != State.ABSENT) {
- // for the inactive subscriptions, reset state to ABSENT
- if (DEBUG_SIM_STATES) Log.d(TAG, "reset state to ABSENT for subId:" + data.subId);
- data.simState = State.ABSENT;
- changedSubscriptionIds.add(data.subId);
- }
+ SimData data = mSimDatas.get(subId);
+ final boolean changed;
+ if (data == null) {
+ data = new SimData(state, slotId, subId);
+ mSimDatas.put(subId, data);
+ changed = true; // no data yet; force update
+ } else {
+ changed = data.simState != state;
+ data.simState = state;
}
-
- return changedSubscriptionIds;
+ return changed;
}
public static boolean isSimPinSecure(IccCardConstants.State state) {
diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
index 72f6cdc..8d32e4d 100644
--- a/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
+++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorations.java
@@ -78,6 +78,8 @@
SystemProperties.getBoolean("debug.screenshot_rounded_corners", false);
private int mRoundedDefault;
+ private int mRoundedDefaultTop;
+ private int mRoundedDefaultBottom;
private View mOverlay;
private View mBottomOverlay;
private float mDensity;
@@ -89,9 +91,14 @@
mWindowManager = mContext.getSystemService(WindowManager.class);
mRoundedDefault = mContext.getResources().getDimensionPixelSize(
R.dimen.rounded_corner_radius);
- if (mRoundedDefault != 0 || shouldDrawCutout()) {
+ mRoundedDefaultTop = mContext.getResources().getDimensionPixelSize(
+ R.dimen.rounded_corner_radius_top);
+ mRoundedDefaultBottom = mContext.getResources().getDimensionPixelSize(
+ R.dimen.rounded_corner_radius_bottom);
+ if (hasRoundedCorners() || shouldDrawCutout()) {
setupDecorations();
}
+
int padding = mContext.getResources().getDimensionPixelSize(
R.dimen.rounded_corner_content_padding);
if (padding != 0) {
@@ -208,11 +215,15 @@
private void updateWindowVisibility(View overlay) {
boolean visibleForCutout = shouldDrawCutout()
&& overlay.findViewById(R.id.display_cutout).getVisibility() == View.VISIBLE;
- boolean visibleForRoundedCorners = mRoundedDefault > 0;
+ boolean visibleForRoundedCorners = hasRoundedCorners();
overlay.setVisibility(visibleForCutout || visibleForRoundedCorners
? View.VISIBLE : View.GONE);
}
+ private boolean hasRoundedCorners() {
+ return mRoundedDefault > 0 || mRoundedDefaultBottom > 0 || mRoundedDefaultTop > 0;
+ }
+
private boolean shouldDrawCutout() {
return shouldDrawCutout(mContext);
}
@@ -284,14 +295,26 @@
if (mOverlay == null) return;
if (SIZE.equals(key)) {
int size = mRoundedDefault;
- try {
- size = (int) (Integer.parseInt(newValue) * mDensity);
- } catch (Exception e) {
+ int sizeTop = mRoundedDefaultTop;
+ int sizeBottom = mRoundedDefaultBottom;
+ if (newValue != null) {
+ try {
+ size = (int) (Integer.parseInt(newValue) * mDensity);
+ } catch (Exception e) {
+ }
}
- setSize(mOverlay.findViewById(R.id.left), size);
- setSize(mOverlay.findViewById(R.id.right), size);
- setSize(mBottomOverlay.findViewById(R.id.left), size);
- setSize(mBottomOverlay.findViewById(R.id.right), size);
+
+ if (sizeTop == 0) {
+ sizeTop = size;
+ }
+ if (sizeBottom == 0) {
+ sizeBottom = size;
+ }
+
+ setSize(mOverlay.findViewById(R.id.left), sizeTop);
+ setSize(mOverlay.findViewById(R.id.right), sizeTop);
+ setSize(mBottomOverlay.findViewById(R.id.left), sizeBottom);
+ setSize(mBottomOverlay.findViewById(R.id.right), sizeBottom);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/car/CarSystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/car/CarSystemUIFactory.java
index 9459ce1..cc9fec0 100644
--- a/packages/SystemUI/src/com/android/systemui/car/CarSystemUIFactory.java
+++ b/packages/SystemUI/src/com/android/systemui/car/CarSystemUIFactory.java
@@ -17,17 +17,29 @@
import android.content.Context;
import android.util.ArrayMap;
+import android.view.View;
+import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.ViewMediatorCallback;
import com.android.systemui.Dependency.DependencyProvider;
import com.android.systemui.SystemUIFactory;
import com.android.systemui.statusbar.NotificationEntryManager;
import com.android.systemui.statusbar.car.CarFacetButtonController;
+import com.android.systemui.statusbar.car.CarStatusBar;
+import com.android.systemui.statusbar.car.CarStatusBarKeyguardViewManager;
import com.android.systemui.statusbar.car.hvac.HvacController;
+import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
/**
* Class factory to provide car specific SystemUI components.
*/
public class CarSystemUIFactory extends SystemUIFactory {
+
+ public StatusBarKeyguardViewManager createStatusBarKeyguardViewManager(Context context,
+ ViewMediatorCallback viewMediatorCallback, LockPatternUtils lockPatternUtils) {
+ return new CarStatusBarKeyguardViewManager(context, viewMediatorCallback, lockPatternUtils);
+ }
+
@Override
public void injectDependencies(ArrayMap<Object, DependencyProvider> providers,
Context context) {
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java b/packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java
index a0fdb9d..b0bda16 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java
@@ -36,7 +36,13 @@
* Delay entering low power mode when animating to make sure that we'll have
* time to move all elements into their final positions while still at 60 fps.
*/
- private static final int ENTER_DOZE_DELAY = 3000;
+ private static final int ENTER_DOZE_DELAY = 6000;
+ /**
+ * Hide wallpaper earlier when entering low power mode. The gap between
+ * hiding the wallpaper and changing the display mode is necessary to hide
+ * the black frame that's inherent to hardware specs.
+ */
+ public static final int ENTER_DOZE_HIDE_WALLPAPER_DELAY = 2000;
private final DozeMachine.Service mDozeService;
private final Handler mHandler;
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 0be3d70..ca92d35 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -1854,6 +1854,8 @@
synchronized (KeyguardViewMediator.this) {
if (!mHiding) {
+ // Tell ActivityManager that we canceled the keyguardExitAnimation.
+ setShowingLocked(mShowing, mAodShowing, mSecondaryDisplayShowing, true /* force */);
return;
}
mHiding = false;
diff --git a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
index d860fc5..c6bb17c 100644
--- a/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
+++ b/packages/SystemUI/src/com/android/systemui/power/PowerNotificationWarnings.java
@@ -19,17 +19,29 @@
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
+import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioAttributes;
+import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.os.UserHandle;
import android.support.annotation.VisibleForTesting;
+import android.text.Annotation;
+import android.text.Layout;
+import android.text.SpannableString;
+import android.text.SpannableStringBuilder;
+import android.text.TextPaint;
+import android.text.TextUtils;
+import android.text.method.LinkMovementMethod;
+import android.text.style.URLSpan;
+import android.util.Log;
import android.util.Slog;
+import android.view.View;
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.settingslib.Utils;
@@ -42,6 +54,8 @@
import java.io.PrintWriter;
import java.text.NumberFormat;
+import java.util.Locale;
+import java.util.Objects;
public class PowerNotificationWarnings implements PowerUI.WarningsUI {
private static final String TAG = PowerUI.TAG + ".Notification";
@@ -87,6 +101,8 @@
private static final String SETTINGS_ACTION_OPEN_BATTERY_SAVER_SETTING =
"android.settings.BATTERY_SAVER_SETTINGS";
+ private static final String BATTERY_SAVER_DESCRIPTION_URL_KEY = "url";
+
private static final AudioAttributes AUDIO_ATTRIBUTES = new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_ASSISTANCE_SONIFICATION)
@@ -461,7 +477,16 @@
if (mSaverConfirmation != null) return;
final SystemUIDialog d = new SystemUIDialog(mContext);
d.setTitle(R.string.battery_saver_confirmation_title);
- d.setMessage(com.android.internal.R.string.battery_saver_description);
+ d.setMessage(getBatterySaverDescription());
+
+ // Sad hack for http://b/78261259 and http://b/78298335. Otherwise "Battery" may be split
+ // into "Bat-tery".
+ if (isEnglishLocale()) {
+ d.setMessageHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_NONE);
+ }
+ // We need to set LinkMovementMethod to make the link clickable.
+ d.setMessageMovementMethod(LinkMovementMethod.getInstance());
+
d.setNegativeButton(android.R.string.cancel, null);
d.setPositiveButton(R.string.battery_saver_confirmation_ok,
(dialog, which) -> setSaverMode(true, false));
@@ -471,6 +496,79 @@
mSaverConfirmation = d;
}
+ private boolean isEnglishLocale() {
+ return Objects.equals(Locale.getDefault().getLanguage(),
+ Locale.ENGLISH.getLanguage());
+ }
+
+ /**
+ * Generates the message for the "want to start battery saver?" dialog with a "learn more" link.
+ */
+ private CharSequence getBatterySaverDescription() {
+ final String learnMoreUrl = mContext.getText(
+ R.string.help_uri_battery_saver_learn_more_link_target).toString();
+
+ // If there's no link, use the string with no "learn more".
+ if (TextUtils.isEmpty(learnMoreUrl)) {
+ return mContext.getText(
+ com.android.internal.R.string.battery_saver_description);
+ }
+
+ // If we have a link, use the string with the "learn more" link.
+ final CharSequence rawText = mContext.getText(
+ com.android.internal.R.string.battery_saver_description_with_learn_more);
+ final SpannableString message = new SpannableString(rawText);
+ final SpannableStringBuilder builder = new SpannableStringBuilder(message);
+
+ // Look for the "learn more" part of the string, and set a URL span on it.
+ // We use a customized URLSpan to add FLAG_RECEIVER_FOREGROUND to the intent, and
+ // also to close the dialog.
+ for (Annotation annotation : message.getSpans(0, message.length(), Annotation.class)) {
+ final String key = annotation.getValue();
+
+ if (!BATTERY_SAVER_DESCRIPTION_URL_KEY.equals(key)) {
+ continue;
+ }
+ final int start = message.getSpanStart(annotation);
+ final int end = message.getSpanEnd(annotation);
+
+ // Replace the "learn more" with a custom URL span, with
+ // - No underline.
+ // - When clicked, close the dialog and the notification shade.
+ final URLSpan urlSpan = new URLSpan(learnMoreUrl) {
+ @Override
+ public void updateDrawState(TextPaint ds) {
+ super.updateDrawState(ds);
+ ds.setUnderlineText(false);
+ }
+
+ @Override
+ public void onClick(View widget) {
+ // Close the parent dialog.
+ if (mSaverConfirmation != null) {
+ mSaverConfirmation.dismiss();
+ }
+ // Also close the notification shade, if it's open.
+ mContext.sendBroadcast(
+ new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)
+ .setFlags(Intent.FLAG_RECEIVER_FOREGROUND));
+
+ final Uri uri = Uri.parse(getURL());
+ Context context = widget.getContext();
+ Intent intent = new Intent(Intent.ACTION_VIEW, uri)
+ .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ try {
+ context.startActivity(intent);
+ } catch (ActivityNotFoundException e) {
+ Log.w(TAG, "Activity was not found for intent, " + intent.toString());
+ }
+ }
+ };
+ builder.setSpan(urlSpan, start, end, message.getSpanFlags(urlSpan));
+ }
+ return builder;
+ }
+
private void showAutoSaverEnabledConfirmation() {
if (mSaverEnabledConfirmation != null) return;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java
index a44f9433..d8bf990 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java
@@ -40,7 +40,7 @@
private int mHeightOverride = -1;
private QSPanel mQSPanel;
private View mQSDetail;
- private View mHeader;
+ private QuickStatusBarHeader mHeader;
private float mQsExpansion;
private QSCustomizer mQSCustomizer;
private View mQSFooter;
@@ -178,7 +178,7 @@
setMargins(mBackground);
setMargins(mQSFooter);
mQSPanel.setMargins(mSideMargins);
- setMargins(mHeader);
+ mHeader.setMargins(mSideMargins);
}
private void setMargins(View view) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
index f027c4b..ad2efbd 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
@@ -41,6 +41,7 @@
import android.view.View;
import android.view.WindowInsets;
import android.widget.ImageView;
+import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -591,4 +592,16 @@
public static float getColorIntensity(@ColorInt int color) {
return color == Color.WHITE ? 0 : 1;
}
+
+ public void setMargins(int sideMargins) {
+ for (int i = 0; i < getChildCount(); i++) {
+ View v = getChildAt(i);
+ if (v == mSystemIconsView || v == mQuickQsStatusIcons || v == mHeaderQsPanel) {
+ continue;
+ }
+ RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams) v.getLayoutParams();
+ lp.leftMargin = sideMargins;
+ lp.rightMargin = sideMargins;
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java
index 5649f7f..22ad550 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileView.java
@@ -36,6 +36,7 @@
/** View that represents a standard quick settings tile. **/
public class QSTileView extends QSTileBaseView {
+ private static final int MAX_LABEL_LINES = 2;
private static final boolean DUAL_TARGET_ALLOWED = false;
private View mDivider;
protected TextView mLabel;
@@ -98,9 +99,10 @@
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- // Remeasure view if the secondary label text will be cut off.
- if (!TextUtils.isEmpty(mSecondLine.getText())
- && mSecondLine.getLineHeight() > mSecondLine.getHeight()) {
+ // Remeasure view if the primary label requires more then 2 lines or the secondary label
+ // text will be cut off.
+ if (mLabel.getLineCount() > MAX_LABEL_LINES || !TextUtils.isEmpty(mSecondLine.getText())
+ && mSecondLine.getLineHeight() > mSecondLine.getHeight()) {
mLabel.setSingleLine();
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
index a25c466..cd00311 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
@@ -124,8 +124,9 @@
final boolean transientEnabling = arg == ARG_SHOW_TRANSIENT_ENABLING;
final boolean enabled = transientEnabling || mController.isBluetoothEnabled();
final boolean connected = mController.isBluetoothConnected();
- state.isTransient = transientEnabling || mController.isBluetoothConnecting()
- || mController.getBluetoothState() == BluetoothAdapter.STATE_TURNING_ON;
+ final boolean connecting = mController.isBluetoothConnecting();
+ state.isTransient = transientEnabling || connecting ||
+ mController.getBluetoothState() == BluetoothAdapter.STATE_TURNING_ON;
state.dualTarget = true;
state.value = enabled;
if (state.slash == null) {
@@ -134,7 +135,7 @@
state.slash.isSlashed = !enabled;
state.label = mContext.getString(R.string.quick_settings_bluetooth_label);
state.secondaryLabel = TextUtils.emptyIfNull(
- getSecondaryLabel(enabled, connected, state.isTransient));
+ getSecondaryLabel(enabled, connecting, connected, state.isTransient));
if (enabled) {
if (connected) {
state.icon = new BluetoothConnectedTileIcon();
@@ -170,13 +171,17 @@
* Returns the secondary label to use for the given bluetooth connection in the form of the
* battery level or bluetooth profile name. If the bluetooth is disabled, there's no connected
* devices, or we can't map the bluetooth class to a profile, this instead returns {@code null}.
- *
* @param enabled whether bluetooth is enabled
+ * @param connecting whether bluetooth is connecting to a device
* @param connected whether there's a device connected via bluetooth
* @param isTransient whether bluetooth is currently in a transient state turning on
*/
@Nullable
- private String getSecondaryLabel(boolean enabled, boolean connected, boolean isTransient) {
+ private String getSecondaryLabel(boolean enabled, boolean connecting, boolean connected,
+ boolean isTransient) {
+ if (connecting) {
+ return mContext.getString(R.string.quick_settings_connecting);
+ }
if (isTransient) {
return mContext.getString(R.string.quick_settings_bluetooth_secondary_label_transient);
}
diff --git a/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java
index 1736f38..be0aa11 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java
@@ -16,6 +16,10 @@
package com.android.systemui.settings;
+import static com.android.settingslib.display.BrightnessUtils.GAMMA_SPACE_MAX;
+import static com.android.settingslib.display.BrightnessUtils.convertGammaToLinear;
+import static com.android.settingslib.display.BrightnessUtils.convertLinearToGamma;
+
import android.animation.ValueAnimator;
import android.content.ContentResolver;
import android.content.Context;
@@ -24,7 +28,6 @@
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Handler;
-import android.os.IPowerManager;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
@@ -36,7 +39,6 @@
import android.service.vr.IVrManager;
import android.service.vr.IVrStateCallbacks;
import android.util.Log;
-import android.util.MathUtils;
import android.widget.ImageView;
import com.android.internal.logging.MetricsLogger;
@@ -50,15 +52,8 @@
private static final String TAG = "StatusBar.BrightnessController";
private static final boolean SHOW_AUTOMATIC_ICON = false;
- private static final int SLIDER_MAX = 1023;
private static final int SLIDER_ANIMATION_DURATION = 3000;
- // Hybrid Log Gamma constant values
- private static final float R = 0.5f;
- private static final float A = 0.17883277f;
- private static final float B = 0.28466892f;
- private static final float C = 0.55991073f;
-
private static final int MSG_UPDATE_ICON = 0;
private static final int MSG_UPDATE_SLIDER = 1;
private static final int MSG_SET_CHECKED = 2;
@@ -273,7 +268,7 @@
mContext = context;
mIcon = icon;
mControl = control;
- mControl.setMax(SLIDER_MAX);
+ mControl.setMax(GAMMA_SPACE_MAX);
mBackgroundHandler = new Handler((Looper) Dependency.get(Dependency.BG_LOOPER));
mUserTracker = new CurrentUserTracker(mContext) {
@Override
@@ -481,76 +476,4 @@
mSliderAnimator.start();
}
- /**
- * A function for converting from the linear space that the setting works in to the
- * gamma space that the slider works in.
- *
- * The gamma space effectively provides us a way to make linear changes to the slider that
- * result in linear changes in perception. If we made changes to the slider in the linear space
- * then we'd see an approximately logarithmic change in perception (c.f. Fechner's Law).
- *
- * Internally, this implements the Hybrid Log Gamma opto-electronic transfer function, which is
- * a slight improvement to the typical gamma transfer function for displays whose max
- * brightness exceeds the 120 nit reference point, but doesn't set a specific reference
- * brightness like the PQ function does.
- *
- * Note that this transfer function is only valid if the display's backlight value is a linear
- * control. If it's calibrated to be something non-linear, then a different transfer function
- * should be used.
- *
- * @param val The brightness setting value.
- * @param min The minimum acceptable value for the setting.
- * @param max The maximum acceptable value for the setting.
- *
- * @return The corresponding slider value
- */
- private static final int convertLinearToGamma(int val, int min, int max) {
- // For some reason, HLG normalizes to the range [0, 12] rather than [0, 1]
- final float normalizedVal = MathUtils.norm(min, max, val) * 12;
- final float ret;
- if (normalizedVal <= 1f) {
- ret = MathUtils.sqrt(normalizedVal) * R;
- } else {
- ret = A * MathUtils.log(normalizedVal - B) + C;
- }
-
- return Math.round(MathUtils.lerp(0, SLIDER_MAX, ret));
- }
-
- /**
- * A function for converting from the gamma space that the slider works in to the
- * linear space that the setting works in.
- *
- * The gamma space effectively provides us a way to make linear changes to the slider that
- * result in linear changes in perception. If we made changes to the slider in the linear space
- * then we'd see an approximately logarithmic change in perception (c.f. Fechner's Law).
- *
- * Internally, this implements the Hybrid Log Gamma electro-optical transfer function, which is
- * a slight improvement to the typical gamma transfer function for displays whose max
- * brightness exceeds the 120 nit reference point, but doesn't set a specific reference
- * brightness like the PQ function does.
- *
- * Note that this transfer function is only valid if the display's backlight value is a linear
- * control. If it's calibrated to be something non-linear, then a different transfer function
- * should be used.
- *
- * @param val The slider value.
- * @param min The minimum acceptable value for the setting.
- * @param max The maximum acceptable value for the setting.
- *
- * @return The corresponding setting value.
- */
- private static final int convertGammaToLinear(int val, int min, int max) {
- final float normalizedVal = MathUtils.norm(0, SLIDER_MAX, val);
- final float ret;
- if (normalizedVal <= R) {
- ret = MathUtils.sq(normalizedVal/R);
- } else {
- ret = MathUtils.exp((normalizedVal - C) / A) + B;
- }
-
- // HLG is normalized to the range [0, 12], so we need to re-normalize to the range [0, 1]
- // in order to derive the correct setting value.
- return Math.round(MathUtils.lerp(min, max, ret / 12));
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index 44136c5..d3caf03 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -407,13 +407,14 @@
boolean needsContinuousClipping = ViewState.isAnimatingY(icon) && !mAmbientState.isDark();
boolean isContinuousClipping = icon.getTag(TAG_CONTINUOUS_CLIPPING) != null;
if (needsContinuousClipping && !isContinuousClipping) {
+ final ViewTreeObserver observer = icon.getViewTreeObserver();
ViewTreeObserver.OnPreDrawListener predrawListener =
new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
boolean animatingY = ViewState.isAnimatingY(icon);
- if (!animatingY || !icon.isAttachedToWindow()) {
- icon.getViewTreeObserver().removeOnPreDrawListener(this);
+ if (!animatingY) {
+ observer.removeOnPreDrawListener(this);
icon.setTag(TAG_CONTINUOUS_CLIPPING, null);
return true;
}
@@ -421,7 +422,20 @@
return true;
}
};
- icon.getViewTreeObserver().addOnPreDrawListener(predrawListener);
+ observer.addOnPreDrawListener(predrawListener);
+ icon.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {
+ @Override
+ public void onViewAttachedToWindow(View v) {
+ }
+
+ @Override
+ public void onViewDetachedFromWindow(View v) {
+ if (v == icon) {
+ observer.removeOnPreDrawListener(predrawListener);
+ icon.setTag(TAG_CONTINUOUS_CLIPPING, null);
+ }
+ }
+ });
icon.setTag(TAG_CONTINUOUS_CLIPPING, predrawListener);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
index f4e45812..5748ec9b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarMobileView.java
@@ -100,13 +100,13 @@
}
if (mState == null) {
- mState = state;
+ mState = state.copy();
initViewState();
return;
}
if (!mState.equals(state)) {
- updateState(state);
+ updateState(state.copy());
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarWifiView.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarWifiView.java
index 0e2714d..bf94c1f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarWifiView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarWifiView.java
@@ -64,6 +64,7 @@
private WifiIconState mState;
private String mSlot;
private float mDarkIntensity = 0;
+ private int mVisibleState = -1;
private ContextThemeWrapper mDarkContext;
private ContextThemeWrapper mLightContext;
@@ -73,6 +74,7 @@
StatusBarWifiView v = (StatusBarWifiView) inflater.inflate(R.layout.status_bar_wifi_group, null);
v.setSlot(slot);
v.init();
+ v.setVisibleState(STATE_ICON);
return v;
}
@@ -123,6 +125,11 @@
@Override
public void setVisibleState(int state) {
+ if (state == mVisibleState) {
+ return;
+ }
+ mVisibleState = state;
+
switch (state) {
case STATE_ICON:
mWifiGroup.setVisibility(View.VISIBLE);
@@ -139,12 +146,6 @@
}
}
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- int width = MeasureSpec.getSize(widthMeasureSpec);
- }
-
private void init() {
int dualToneLightTheme = Utils.getThemeAttr(mContext, R.attr.lightIconTheme);
int dualToneDarkTheme = Utils.getThemeAttr(mContext, R.attr.darkIconTheme);
@@ -180,12 +181,12 @@
}
if (mState == null) {
- mState = state;
+ mState = state.copy();
initViewState();
}
if (!mState.equals(state)) {
- updateState(state);
+ updateState(state.copy());
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarFacetButtonController.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarFacetButtonController.java
index 8160f90..20986ad 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarFacetButtonController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarFacetButtonController.java
@@ -7,6 +7,7 @@
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.view.Display;
+import android.view.View;
import java.util.HashMap;
import java.util.List;
@@ -73,36 +74,43 @@
*/
public void taskChanged(List<ActivityManager.StackInfo> stackInfoList) {
int displayId = getDisplayId();
+ ActivityManager.StackInfo validStackInfo = null;
for (ActivityManager.StackInfo stackInfo :stackInfoList) {
- // if the display id is known and does not match the stack we skip
- if (displayId != -1 && displayId != stackInfo.displayId ||
- stackInfo.topActivity == null) {
- continue;
- }
-
- if (mSelectedFacetButton != null) {
- mSelectedFacetButton.setSelected(false);
- }
-
- String packageName = stackInfo.topActivity.getPackageName();
- CarFacetButton facetButton = findFacetButtongByComponentName(stackInfo.topActivity);
- if (facetButton == null) {
- facetButton = mButtonsByPackage.get(packageName);
- }
-
- if (facetButton == null) {
- String category = getPackageCategory(packageName);
- if (category != null) {
- facetButton = mButtonsByCategory.get(category);
- }
- }
-
- if (facetButton != null) {
- facetButton.setSelected(true);
- mSelectedFacetButton = facetButton;
- return;
+ // If the display id is unknown or it matches the stack, it's valid for use
+ if ((displayId == -1 || displayId == stackInfo.displayId) &&
+ stackInfo.topActivity != null) {
+ validStackInfo = stackInfo;
+ break;
}
}
+
+ if (validStackInfo == null) {
+ // No stack was found that was on the same display as the facet buttons thus return
+ return;
+ }
+
+ if (mSelectedFacetButton != null) {
+ mSelectedFacetButton.setSelected(false);
+ }
+
+ String packageName = validStackInfo.topActivity.getPackageName();
+ CarFacetButton facetButton = findFacetButtongByComponentName(validStackInfo.topActivity);
+ if (facetButton == null) {
+ facetButton = mButtonsByPackage.get(packageName);
+ }
+
+ if (facetButton == null) {
+ String category = getPackageCategory(packageName);
+ if (category != null) {
+ facetButton = mButtonsByCategory.get(category);
+ }
+ }
+
+ if (facetButton != null && facetButton.getVisibility() == View.VISIBLE) {
+ facetButton.setSelected(true);
+ mSelectedFacetButton = facetButton;
+ }
+
}
private int getDisplayId() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java
index b2cef16..9ed0929 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarNavigationBarView.java
@@ -36,10 +36,11 @@
* in a linear layout.
*/
class CarNavigationBarView extends LinearLayout {
- private LinearLayout mNavButtons;
+ private View mNavButtons;
private AlphaOptimizedImageButton mNotificationsButton;
private CarStatusBar mCarStatusBar;
private Context mContext;
+ private View mLockScreenButtons;
public CarNavigationBarView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -49,6 +50,7 @@
@Override
public void onFinishInflate() {
mNavButtons = findViewById(R.id.nav_buttons);
+ mLockScreenButtons = findViewById(R.id.lock_screen_nav_buttons);
mNotificationsButton = findViewById(R.id.notifications);
if (mNotificationsButton != null) {
@@ -74,4 +76,28 @@
protected void onNotificationsClick(View v) {
mCarStatusBar.togglePanel();
}
+
+ /**
+ * If there are buttons declared in the layout they will be shown and the normal
+ * Nav buttons will be hidden.
+ */
+ public void showKeyguardButtons() {
+ if (mLockScreenButtons == null) {
+ return;
+ }
+ mLockScreenButtons.setVisibility(View.VISIBLE);
+ mNavButtons.setVisibility(View.GONE);
+ }
+
+ /**
+ * If there are buttons declared in the layout they will be hidden and the normal
+ * Nav buttons will be shown.
+ */
+ public void hideKeyguardButtons() {
+ if (mLockScreenButtons == null) {
+ return;
+ }
+ mNavButtons.setVisibility(View.VISIBLE);
+ mLockScreenButtons.setVisibility(View.GONE);
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
index 9c60f5c..83021ca 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBar.java
@@ -141,6 +141,52 @@
buildNavBarContent();
}
+ /**
+ * Allows for showing or hiding just the navigation bars. This is indented to be used when
+ * the full screen user selector is shown.
+ */
+ void setNavBarVisibility(@View.Visibility int visibility) {
+ if (mNavigationBarWindow != null) {
+ mNavigationBarWindow.setVisibility(visibility);
+ }
+ if (mLeftNavigationBarWindow != null) {
+ mLeftNavigationBarWindow.setVisibility(visibility);
+ }
+ if (mRightNavigationBarWindow != null) {
+ mRightNavigationBarWindow.setVisibility(visibility);
+ }
+ }
+
+
+ @Override
+ public boolean hideKeyguard() {
+ boolean result = super.hideKeyguard();
+ if (mNavigationBarView != null) {
+ mNavigationBarView.hideKeyguardButtons();
+ }
+ if (mLeftNavigationBarView != null) {
+ mLeftNavigationBarView.hideKeyguardButtons();
+ }
+ if (mRightNavigationBarView != null) {
+ mRightNavigationBarView.hideKeyguardButtons();
+ }
+ return result;
+ }
+
+
+ @Override
+ public void showKeyguard() {
+ super.showKeyguard();
+ if (mNavigationBarView != null) {
+ mNavigationBarView.showKeyguardButtons();
+ }
+ if (mLeftNavigationBarView != null) {
+ mLeftNavigationBarView.showKeyguardButtons();
+ }
+ if (mRightNavigationBarView != null) {
+ mRightNavigationBarView.showKeyguardButtons();
+ }
+ }
@Override
public void destroy() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBarKeyguardViewManager.java
new file mode 100644
index 0000000..7a8d22b
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/CarStatusBarKeyguardViewManager.java
@@ -0,0 +1,31 @@
+package com.android.systemui.statusbar.car;
+
+import android.content.Context;
+import android.view.View;
+
+import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.ViewMediatorCallback;
+import com.android.systemui.R;
+import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager;
+
+public class CarStatusBarKeyguardViewManager extends StatusBarKeyguardViewManager {
+
+ protected boolean mShouldHideNavBar;
+
+ public CarStatusBarKeyguardViewManager(Context context,
+ ViewMediatorCallback callback,
+ LockPatternUtils lockPatternUtils) {
+ super(context, callback, lockPatternUtils);
+ mShouldHideNavBar =context.getResources()
+ .getBoolean(R.bool.config_hideNavWhenKeyguardBouncerShown);
+ }
+
+ @Override
+ protected void updateNavigationBarVisibility(boolean navBarVisible) {
+ if(!mShouldHideNavBar) {
+ return;
+ }
+ CarStatusBar statusBar = (CarStatusBar) mStatusBar;
+ statusBar.setNavBarVisibility(navBarVisible ? View.VISIBLE : View.GONE);
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/UserGridRecyclerView.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/UserGridRecyclerView.java
index 1148fad..5768fa2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/UserGridRecyclerView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/UserGridRecyclerView.java
@@ -207,7 +207,7 @@
// If the user selects Guest, start the guest session.
if (userRecord.mIsStartGuestSession) {
- mUserManagerHelper.switchToGuest(mGuestName);
+ mUserManagerHelper.startNewGuestSession(mGuestName);
return;
}
@@ -241,8 +241,7 @@
private Bitmap getUserRecordIcon(UserRecord userRecord) {
if (userRecord.mIsStartGuestSession) {
- return UserIcons.convertToBitmap(UserIcons.getDefaultUserIcon(
- mContext.getResources(), UserHandle.USER_NULL, false));
+ return mUserManagerHelper.getGuestDefaultIcon();
}
if (userRecord.mIsAddUser) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/hvac/TemperatureTextView.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/hvac/TemperatureTextView.java
new file mode 100644
index 0000000..8143c13
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/hvac/TemperatureTextView.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.car.hvac;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.widget.TextView;
+
+import com.android.systemui.Dependency;
+import com.android.systemui.R;
+
+/**
+ * Simple text display of HVAC properties, It is designed to show temperature and is configured in
+ * the XML.
+ * XML properties:
+ * hvacPropertyId - Example: CarHvacManager.ID_ZONED_TEMP_SETPOINT (16385)
+ * hvacAreaId - Example: VehicleSeat.SEAT_ROW_1_LEFT (1)
+ * hvacTempFormat - Example: "%.1f\u00B0" (1 decimal and the degree symbol)
+ *
+ * Note: It registers itself with {@link HvacController}
+ */
+public class TemperatureTextView extends TextView implements TemperatureView {
+
+ private final int mAreaId;
+ private final int mPropertyId;
+ private final String mTempFormat;
+
+ public TemperatureTextView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.TemperatureView);
+ mAreaId = typedArray.getInt(R.styleable.TemperatureView_hvacAreaId,-1);
+ mPropertyId = typedArray.getInt(R.styleable.TemperatureView_hvacPropertyId, -1);
+ String format = typedArray.getString(R.styleable.TemperatureView_hvacTempFormat);
+ mTempFormat = (format == null) ? "%.1f\u00B0" : format;
+
+ // register with controller
+ HvacController hvacController = Dependency.get(HvacController.class);
+ hvacController.addHvacTextView(this);
+ }
+
+ /**
+ * Formats the float for display
+ * @param temp - The current temp or NaN
+ */
+ @Override
+ public void setTemp(float temp) {
+ if (Float.isNaN(temp)) {
+ setText("--");
+ return;
+ }
+ setText(String.format(mTempFormat, temp));
+ }
+
+ /**
+ * @return propertiyId Example: CarHvacManager.ID_ZONED_TEMP_SETPOINT (16385)
+ */
+ @Override
+ public int getPropertyId() {
+ return mPropertyId;
+ }
+
+ /**
+ * @return hvac AreaId - Example: VehicleSeat.SEAT_ROW_1_LEFT (1)
+ */
+ @Override
+ public int getAreaId() {
+ return mAreaId;
+ }
+}
+
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/car/hvac/TemperatureView.java b/packages/SystemUI/src/com/android/systemui/statusbar/car/hvac/TemperatureView.java
index 4049ec3..7651356 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/car/hvac/TemperatureView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/car/hvac/TemperatureView.java
@@ -16,67 +16,25 @@
package com.android.systemui.statusbar.car.hvac;
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.util.AttributeSet;
-import android.widget.TextView;
-
-import com.android.systemui.Dependency;
-import com.android.systemui.R;
-
/**
- * Simple text display of HVAC properties, It is designed to show temperature and is configured in
- * the XML.
- * XML properties:
- * hvacPropertyId - Example: CarHvacManager.ID_ZONED_TEMP_SETPOINT (16385)
- * hvacAreaId - Example: VehicleSeat.SEAT_ROW_1_LEFT (1)
- * hvacTempFormat - Example: "%.1f\u00B0" (1 decimal and the degree symbol)
- *
- * Note: It registers itself with {@link HvacController}
+ * Interface for Views that display temperature HVAC properties
*/
-public class TemperatureView extends TextView {
-
- private final int mAreaId;
- private final int mPropertyId;
- private final String mTempFormat;
-
- public TemperatureView(Context context, AttributeSet attrs) {
- super(context, attrs);
- TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.TemperatureView);
- mAreaId = typedArray.getInt(R.styleable.TemperatureView_hvacAreaId,-1);
- mPropertyId = typedArray.getInt(R.styleable.TemperatureView_hvacPropertyId, -1);
- String format = typedArray.getString(R.styleable.TemperatureView_hvacTempFormat);
- mTempFormat = (format == null) ? "%.1f\u00B0" : format;
-
- // register with controller
- HvacController hvacController = Dependency.get(HvacController.class);
- hvacController.addHvacTextView(this);
- }
-
+public interface TemperatureView {
/**
* Formats the float for display
+ *
* @param temp - The current temp or NaN
*/
- public void setTemp(float temp) {
- if (Float.isNaN(temp)) {
- setText("--");
- return;
- }
- setText(String.format(mTempFormat, temp));
- }
+ void setTemp(float temp);
+
/**
* @return propertiyId Example: CarHvacManager.ID_ZONED_TEMP_SETPOINT (16385)
*/
- public int getPropertyId() {
- return mPropertyId;
- }
+ int getPropertyId();
/**
* @return hvac AreaId - Example: VehicleSeat.SEAT_ROW_1_LEFT (1)
*/
- public int getAreaId() {
- return mAreaId;
- }
+ int getAreaId();
}
-
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java
index b8bce95..20ab64c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimator.java
@@ -123,83 +123,102 @@
IRemoteAnimationFinishedCallback iRemoteAnimationFinishedCallback)
throws RemoteException {
mSourceNotification.post(() -> {
- for (RemoteAnimationTarget app : remoteAnimationTargets) {
- if (app.mode == RemoteAnimationTarget.MODE_OPENING) {
- setExpandAnimationRunning(true);
- mInstantCollapsePanel = app.position.y == 0
- && app.sourceContainerBounds.height()
- >= mNotificationPanel.getHeight();
- if (!mInstantCollapsePanel) {
- mNotificationPanel.collapseWithDuration(ANIMATION_DURATION);
+ RemoteAnimationTarget primary = getPrimaryRemoteAnimationTarget(
+ remoteAnimationTargets);
+ if (primary == null) {
+ setAnimationPending(false);
+ invokeCallback(iRemoteAnimationFinishedCallback);
+ return;
+ }
+
+ setExpandAnimationRunning(true);
+ mInstantCollapsePanel = primary.position.y == 0
+ && primary.sourceContainerBounds.height()
+ >= mNotificationPanel.getHeight();
+ if (!mInstantCollapsePanel) {
+ mNotificationPanel.collapseWithDuration(ANIMATION_DURATION);
+ }
+ ValueAnimator anim = ValueAnimator.ofFloat(0, 1);
+ mParams.startPosition = mSourceNotification.getLocationOnScreen();
+ mParams.startTranslationZ = mSourceNotification.getTranslationZ();
+ mParams.startClipTopAmount = mSourceNotification.getClipTopAmount();
+ if (mSourceNotification.isChildInGroup()) {
+ int parentClip = mSourceNotification
+ .getNotificationParent().getClipTopAmount();
+ mParams.parentStartClipTopAmount = parentClip;
+ // We need to calculate how much the child is clipped by the parent
+ // because children always have 0 clipTopAmount
+ if (parentClip != 0) {
+ float childClip = parentClip
+ - mSourceNotification.getTranslationY();
+ if (childClip > 0.0f) {
+ mParams.startClipTopAmount = (int) Math.ceil(childClip);
}
- ValueAnimator anim = ValueAnimator.ofFloat(0, 1);
- mParams.startPosition = mSourceNotification.getLocationOnScreen();
- mParams.startTranslationZ = mSourceNotification.getTranslationZ();
- mParams.startClipTopAmount = mSourceNotification.getClipTopAmount();
- if (mSourceNotification.isChildInGroup()) {
- int parentClip = mSourceNotification
- .getNotificationParent().getClipTopAmount();
- mParams.parentStartClipTopAmount = parentClip;
- // We need to calculate how much the child is clipped by the parent
- // because children always have 0 clipTopAmount
- if (parentClip != 0) {
- float childClip = parentClip
- - mSourceNotification.getTranslationY();
- if (childClip > 0.0f) {
- mParams.startClipTopAmount = (int) Math.ceil(childClip);
- }
- }
- }
- int targetWidth = app.sourceContainerBounds.width();
- int notificationHeight = mSourceNotification.getActualHeight()
- - mSourceNotification.getClipBottomAmount();
- int notificationWidth = mSourceNotification.getWidth();
- anim.setDuration(ANIMATION_DURATION);
- anim.setInterpolator(Interpolators.LINEAR);
- anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
- @Override
- public void onAnimationUpdate(ValueAnimator animation) {
- mParams.linearProgress = animation.getAnimatedFraction();
- float progress
- = Interpolators.FAST_OUT_SLOW_IN.getInterpolation(
- mParams.linearProgress);
- int newWidth = (int) MathUtils.lerp(notificationWidth,
- targetWidth, progress);
- mParams.left = (int) ((targetWidth - newWidth) / 2.0f);
- mParams.right = mParams.left + newWidth;
- mParams.top = (int) MathUtils.lerp(mParams.startPosition[1],
- app.position.y, progress);
- mParams.bottom = (int) MathUtils.lerp(mParams.startPosition[1]
- + notificationHeight,
- app.position.y + app.sourceContainerBounds.bottom,
- progress);
- applyParamsToWindow(app);
- applyParamsToNotification(mParams);
- applyParamsToNotificationList(mParams);
- }
- });
- anim.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- setExpandAnimationRunning(false);
- if (mInstantCollapsePanel) {
- mStatusBar.collapsePanel(false /* animate */);
- }
- try {
- iRemoteAnimationFinishedCallback.onAnimationFinished();
- } catch (RemoteException e) {
- e.printStackTrace();
- }
- }
- });
- anim.start();
- break;
}
}
+ int targetWidth = primary.sourceContainerBounds.width();
+ int notificationHeight = mSourceNotification.getActualHeight()
+ - mSourceNotification.getClipBottomAmount();
+ int notificationWidth = mSourceNotification.getWidth();
+ anim.setDuration(ANIMATION_DURATION);
+ anim.setInterpolator(Interpolators.LINEAR);
+ anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ @Override
+ public void onAnimationUpdate(ValueAnimator animation) {
+ mParams.linearProgress = animation.getAnimatedFraction();
+ float progress
+ = Interpolators.FAST_OUT_SLOW_IN.getInterpolation(
+ mParams.linearProgress);
+ int newWidth = (int) MathUtils.lerp(notificationWidth,
+ targetWidth, progress);
+ mParams.left = (int) ((targetWidth - newWidth) / 2.0f);
+ mParams.right = mParams.left + newWidth;
+ mParams.top = (int) MathUtils.lerp(mParams.startPosition[1],
+ primary.position.y, progress);
+ mParams.bottom = (int) MathUtils.lerp(mParams.startPosition[1]
+ + notificationHeight,
+ primary.position.y + primary.sourceContainerBounds.bottom,
+ progress);
+ applyParamsToWindow(primary);
+ applyParamsToNotification(mParams);
+ applyParamsToNotificationList(mParams);
+ }
+ });
+ anim.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ setExpandAnimationRunning(false);
+ if (mInstantCollapsePanel) {
+ mStatusBar.collapsePanel(false /* animate */);
+ }
+ invokeCallback(iRemoteAnimationFinishedCallback);
+ }
+ });
+ anim.start();
setAnimationPending(false);
});
}
+ private void invokeCallback(IRemoteAnimationFinishedCallback callback) {
+ try {
+ callback.onAnimationFinished();
+ } catch (RemoteException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private RemoteAnimationTarget getPrimaryRemoteAnimationTarget(
+ RemoteAnimationTarget[] remoteAnimationTargets) {
+ RemoteAnimationTarget primary = null;
+ for (RemoteAnimationTarget app : remoteAnimationTargets) {
+ if (app.mode == RemoteAnimationTarget.MODE_OPENING) {
+ primary = app;
+ break;
+ }
+ }
+ return primary;
+ }
+
private void setExpandAnimationRunning(boolean running) {
mNotificationPanel.setLaunchingNotification(running);
mSourceNotification.setExpandAnimationRunning(running);
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 d2d9c4c..85fac16 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java
@@ -30,6 +30,7 @@
import com.android.systemui.Dependency;
import com.android.systemui.R;
import com.android.systemui.doze.AlwaysOnDisplayPolicy;
+import com.android.systemui.doze.DozeScreenState;
import com.android.systemui.tuner.TunerService;
import java.io.PrintWriter;
@@ -153,7 +154,8 @@
* @return duration in millis.
*/
public long getWallpaperAodDuration() {
- return mAlwaysOnPolicy.wallpaperVisibilityDuration;
+ return shouldControlScreenOff() ? DozeScreenState.ENTER_DOZE_HIDE_WALLPAPER_DELAY
+ : mAlwaysOnPolicy.wallpaperVisibilityDuration;
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
index 66176b3..2ddae74 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarFragment.java
@@ -281,6 +281,7 @@
IntentFilter filter = new IntentFilter(Intent.ACTION_SCREEN_OFF);
filter.addAction(Intent.ACTION_SCREEN_ON);
+ filter.addAction(Intent.ACTION_USER_SWITCHED);
getContext().registerReceiverAsUser(mBroadcastReceiver, UserHandle.ALL, filter, null, null);
notifyNavigationBarScreenOn();
mOverviewProxyService.addCallback(mOverviewProxyListener);
@@ -521,7 +522,7 @@
// Clear any pending suggestion flag as it has either been nullified or is being shown
mPendingRotationSuggestion = false;
- getView().removeCallbacks(mCancelPendingRotationProposal);
+ if (getView() != null) getView().removeCallbacks(mCancelPendingRotationProposal);
// Handle the visibility change and animation
if (visible) { // Appear and change (cannot force)
@@ -1084,6 +1085,10 @@
|| Intent.ACTION_SCREEN_ON.equals(action)) {
notifyNavigationBarScreenOn();
}
+ if (Intent.ACTION_USER_SWITCHED.equals(action)) {
+ // The accessibility settings may be different for the new user
+ updateAccessibilityServicesState(mAccessibilityManager);
+ };
}
};
@@ -1141,6 +1146,7 @@
private final Runnable mRipple = new Runnable() {
@Override
public void run() { // Cause the ripple to fire via false presses
+ if (!mRoot.isAttachedToWindow()) return;
mRoot.setPressed(true);
mRoot.setPressed(false);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java
index ff5d0e3..6b0ac94 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickStepController.java
@@ -34,7 +34,6 @@
import android.util.Slog;
import android.view.MotionEvent;
import android.view.View;
-import android.view.ViewConfiguration;
import android.view.WindowManagerGlobal;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
@@ -45,16 +44,13 @@
import com.android.systemui.plugins.statusbar.phone.NavGesture.GestureHelper;
import com.android.systemui.shared.recents.IOverviewProxy;
import com.android.systemui.shared.recents.utilities.Utilities;
+import com.android.systemui.shared.system.NavigationBarCompat;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_LEFT;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_BOTTOM;
import static com.android.systemui.OverviewProxyService.DEBUG_OVERVIEW_PROXY;
import static com.android.systemui.OverviewProxyService.TAG_OPS;
import static com.android.systemui.shared.system.NavigationBarCompat.HIT_TARGET_HOME;
-import static com.android.systemui.shared.system.NavigationBarCompat.QUICK_SCRUB_DRAG_SLOP_PX;
-import static com.android.systemui.shared.system.NavigationBarCompat.QUICK_SCRUB_TOUCH_SLOP_PX;
-import static com.android.systemui.shared.system.NavigationBarCompat.QUICK_STEP_DRAG_SLOP_PX;
-import static com.android.systemui.shared.system.NavigationBarCompat.QUICK_STEP_TOUCH_SLOP_PX;
/**
* Class to detect gestures on the navigation bar and implement quick scrub.
@@ -215,17 +211,23 @@
int pos, touchDown, offset, trackSize;
if (mIsVertical) {
- exceededScrubTouchSlop = yDiff > QUICK_SCRUB_TOUCH_SLOP_PX && yDiff > xDiff;
- exceededSwipeUpTouchSlop = xDiff > QUICK_STEP_TOUCH_SLOP_PX && xDiff > yDiff;
- exceededScrubDragSlop = yDiff > QUICK_SCRUB_DRAG_SLOP_PX && yDiff > xDiff;
+ exceededScrubTouchSlop =
+ yDiff > NavigationBarCompat.getQuickScrubTouchSlopPx() && yDiff > xDiff;
+ exceededSwipeUpTouchSlop =
+ xDiff > NavigationBarCompat.getQuickStepTouchSlopPx() && xDiff > yDiff;
+ exceededScrubDragSlop =
+ yDiff > NavigationBarCompat.getQuickScrubDragSlopPx() && yDiff > xDiff;
pos = y;
touchDown = mTouchDownY;
offset = pos - mTrackRect.top;
trackSize = mTrackRect.height();
} else {
- exceededScrubTouchSlop = xDiff > QUICK_SCRUB_TOUCH_SLOP_PX && xDiff > yDiff;
- exceededSwipeUpTouchSlop = yDiff > QUICK_STEP_TOUCH_SLOP_PX && yDiff > xDiff;
- exceededScrubDragSlop = xDiff > QUICK_SCRUB_DRAG_SLOP_PX && xDiff > yDiff;
+ exceededScrubTouchSlop =
+ xDiff > NavigationBarCompat.getQuickScrubTouchSlopPx() && xDiff > yDiff;
+ exceededSwipeUpTouchSlop =
+ yDiff > NavigationBarCompat.getQuickStepTouchSlopPx() && yDiff > xDiff;
+ exceededScrubDragSlop =
+ xDiff > NavigationBarCompat.getQuickScrubDragSlopPx() && xDiff > yDiff;
pos = x;
touchDown = mTouchDownX;
offset = pos - mTrackRect.left;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
index b4e7575..24a5896 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconControllerImpl.java
@@ -88,7 +88,7 @@
List<Slot> allSlots = getSlots();
for (int i = 0; i < allSlots.size(); i++) {
Slot slot = allSlots.get(i);
- List<StatusBarIconHolder> holders = slot.getHolderList();
+ List<StatusBarIconHolder> holders = slot.getHolderListInViewOrder();
boolean blocked = mIconBlacklist.contains(slot.getName());
for (StatusBarIconHolder holder : holders) {
@@ -121,7 +121,7 @@
// Remove all the icons.
for (int i = currentSlots.size() - 1; i >= 0; i--) {
Slot s = currentSlots.get(i);
- slotsToReAdd.put(s, s.getHolderList());
+ slotsToReAdd.put(s, s.getHolderListInViewOrder());
removeAllIconsForSlot(s.getName());
}
@@ -281,7 +281,7 @@
mIconLogger.onIconHidden(slotName);
int slotIndex = getSlotIndex(slotName);
- List<StatusBarIconHolder> iconsToRemove = slot.getHolderList();
+ List<StatusBarIconHolder> iconsToRemove = slot.getHolderListInViewOrder();
for (StatusBarIconHolder holder : iconsToRemove) {
int viewIndex = getViewIndex(slotIndex, holder.getTag());
slot.removeForTag(holder.getTag());
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconHolder.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconHolder.java
index e854dd0..c4ff85f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconHolder.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconHolder.java
@@ -110,6 +110,10 @@
}
public void setVisible(boolean visible) {
+ if (isVisible() == visible) {
+ return;
+ }
+
switch (mType) {
case TYPE_ICON:
mIcon.visible = visible;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconList.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconList.java
index c773170..b7e1cfb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconList.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconList.java
@@ -211,7 +211,7 @@
}
/**
- * View index is backwards from regular index
+ * View index is inverted from regular index, because they are laid out back-to-front
* @param tag the tag of the holder being viewed
* @return (1 + mSubSlots.size() - indexOfTag)
*/
@@ -228,14 +228,22 @@
return subSlots - getIndexForTag(tag) - 1;
}
- public List<StatusBarIconHolder> getHolderList() {
+ /**
+ * Build a list of the {@link StatusBarIconHolder}s in the same order they appear in their
+ * view group. This provides a safe list that can be iterated and inserted into its group.
+ *
+ * @return all holders contained here, in view order
+ */
+ public List<StatusBarIconHolder> getHolderListInViewOrder() {
ArrayList<StatusBarIconHolder> holders = new ArrayList<>();
- if (mHolder != null) {
- holders.add(mHolder);
+ if (mSubSlots != null) {
+ for (int i = mSubSlots.size() - 1; i >= 0; i--) {
+ holders.add(mSubSlots.get(i));
+ }
}
- if (mSubSlots != null) {
- holders.addAll(mSubSlots);
+ if (mHolder != null) {
+ holders.add(mHolder);
}
return holders;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index e63a2e5..b517d11 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -586,20 +586,7 @@
boolean navBarVisible = isNavBarVisible();
boolean lastNavBarVisible = getLastNavBarVisible();
if (navBarVisible != lastNavBarVisible || mFirstUpdate) {
- if (mStatusBar.getNavigationBarView() != null) {
- if (navBarVisible) {
- long delay = getNavBarShowDelay();
- if (delay == 0) {
- mMakeNavigationBarVisibleRunnable.run();
- } else {
- mContainer.postOnAnimationDelayed(mMakeNavigationBarVisibleRunnable,
- delay);
- }
- } else {
- mContainer.removeCallbacks(mMakeNavigationBarVisibleRunnable);
- mStatusBar.getNavigationBarView().getRootView().setVisibility(View.GONE);
- }
- }
+ updateNavigationBarVisibility(navBarVisible);
}
if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
@@ -626,6 +613,23 @@
mStatusBar.onKeyguardViewManagerStatesUpdated();
}
+ protected void updateNavigationBarVisibility(boolean navBarVisible) {
+ if (mStatusBar.getNavigationBarView() != null) {
+ if (navBarVisible) {
+ long delay = getNavBarShowDelay();
+ if (delay == 0) {
+ mMakeNavigationBarVisibleRunnable.run();
+ } else {
+ mContainer.postOnAnimationDelayed(mMakeNavigationBarVisibleRunnable,
+ delay);
+ }
+ } else {
+ mContainer.removeCallbacks(mMakeNavigationBarVisibleRunnable);
+ mStatusBar.getNavigationBarView().getRootView().setVisibility(View.GONE);
+ }
+ }
+ }
+
/**
* @return Whether the navigation bar should be made visible based on the current state.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
index 669a8c8..7cd433a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarSignalPolicy.java
@@ -388,6 +388,12 @@
typeContentDescription);
}
+ public MobileIconState copy() {
+ MobileIconState copy = new MobileIconState(this.subId);
+ copyTo(copy);
+ return copy;
+ }
+
public void copyTo(MobileIconState other) {
super.copyTo(other);
other.subId = subId;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
index 44e87ff..8df51db 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
@@ -234,6 +234,7 @@
mEnabled = bluetoothState == BluetoothAdapter.STATE_ON
|| bluetoothState == BluetoothAdapter.STATE_TURNING_ON;
mState = bluetoothState;
+ updateConnected();
mHandler.sendEmptyMessage(H.MSG_STATE_CHANGED);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
index 22a48f0..85cfde8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java
@@ -49,12 +49,11 @@
import com.android.systemui.R;
import com.android.systemui.plugins.statusbar.phone.NavBarButtonProvider.ButtonInterface;
import com.android.systemui.shared.system.ActivityManagerWrapper;
+import com.android.systemui.shared.system.NavigationBarCompat;
import static android.view.KeyEvent.KEYCODE_HOME;
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK;
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_LONG_CLICK;
-import static com.android.systemui.shared.system.NavigationBarCompat.QUICK_SCRUB_TOUCH_SLOP_PX;
-import static com.android.systemui.shared.system.NavigationBarCompat.QUICK_STEP_TOUCH_SLOP_PX;
public class KeyButtonView extends ImageView implements ButtonInterface {
private static final String TAG = KeyButtonView.class.getSimpleName();
@@ -234,10 +233,12 @@
x = (int)ev.getRawX();
y = (int)ev.getRawY();
- boolean exceededTouchSlopX = Math.abs(x - mTouchDownX) >
- (mIsVertical ? QUICK_SCRUB_TOUCH_SLOP_PX : QUICK_STEP_TOUCH_SLOP_PX);
- boolean exceededTouchSlopY = Math.abs(y - mTouchDownY) >
- (mIsVertical ? QUICK_STEP_TOUCH_SLOP_PX : QUICK_SCRUB_TOUCH_SLOP_PX);
+ boolean exceededTouchSlopX = Math.abs(x - mTouchDownX) > (mIsVertical
+ ? NavigationBarCompat.getQuickScrubTouchSlopPx()
+ : NavigationBarCompat.getQuickStepTouchSlopPx());
+ boolean exceededTouchSlopY = Math.abs(y - mTouchDownY) > (mIsVertical
+ ? NavigationBarCompat.getQuickStepTouchSlopPx()
+ : NavigationBarCompat.getQuickScrubTouchSlopPx());
if (exceededTouchSlopX || exceededTouchSlopY) {
// When quick step is enabled, prevent animating the ripple triggered by
// setPressed and decide to run it on touch up
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
index 5c7ce59..d7aedc4 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java
@@ -53,7 +53,6 @@
import android.os.Message;
import android.os.SystemClock;
import android.os.VibrationEffect;
-import android.os.Vibrator;
import android.provider.Settings;
import android.provider.Settings.Global;
import android.text.InputFilter;
@@ -73,8 +72,8 @@
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager.AccessibilityServicesStateChangeListener;
import android.view.animation.DecelerateInterpolator;
+import android.widget.FrameLayout;
import android.widget.ImageButton;
-import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;
@@ -122,7 +121,7 @@
private ImageButton mRingerIcon;
private View mSettingsView;
private ImageButton mSettingsIcon;
- private ImageView mZenIcon;
+ private FrameLayout mZenIcon;
private final List<VolumeRow> mRows = new ArrayList<>();
private ConfigurableTexts mConfigurableTexts;
private final SparseBooleanArray mDynamic = new SparseBooleanArray();
@@ -132,7 +131,6 @@
private final Accessibility mAccessibility = new Accessibility();
private final ColorStateList mActiveTint;
private final ColorStateList mInactiveTint;
- private final Vibrator mVibrator;
private boolean mShowing;
private boolean mShowA11yStream;
@@ -153,7 +151,6 @@
mActiveTint = ColorStateList.valueOf(Utils.getColorAccent(mContext));
mInactiveTint = loadColorStateList(R.color.volume_slider_inactive);
mDeviceProvisionedController = Dependency.get(DeviceProvisionedController.class);
- mVibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
}
public void init(int windowType, Callback callback) {
@@ -673,7 +670,28 @@
* @param enable whether to enable volume row views and hide dnd icon
*/
private void enableVolumeRowViewsH(VolumeRow row, boolean enable) {
- row.dndIcon.setVisibility(enable ? GONE : VISIBLE);
+ boolean showDndIcon = !enable;
+ row.dndIcon.setVisibility(showDndIcon ? VISIBLE : GONE);
+
+ if (showDndIcon && getNumVisibleRows() == 1) {
+ row.dndIcon.setLayoutParams(new FrameLayout.LayoutParams(
+ mContext.getResources().getDimensionPixelSize(
+ R.dimen.volume_dialog_panel_width),
+ FrameLayout.LayoutParams.WRAP_CONTENT));
+ } else if (row.view.getVisibility() == VISIBLE) {
+ row.dndIcon.setLayoutParams(new FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT));
+ }
+ }
+
+ private int getNumVisibleRows() {
+ int count = 0;
+ for (int i = 0; i < mRows.size(); i++) {
+ if (mRows.get(i).view.getVisibility() == VISIBLE) {
+ count++;
+ }
+ }
+ return count;
}
/**
@@ -1241,6 +1259,6 @@
private ObjectAnimator anim; // slider progress animation for non-touch-related updates
private int animTargetProgress;
private int lastAudibleLevel = 1;
- private ImageView dndIcon;
+ private FrameLayout dndIcon;
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconListTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconListTest.java
index 07ac11b..e529e4c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconListTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconListTest.java
@@ -132,7 +132,7 @@
*/
@Test
- public void testSlot_OrderIsPreserved() {
+ public void testSlot_ViewOrder() {
Slot testSlot = new Slot("test_name", null);
// no tag bc it defaults to 0
@@ -144,17 +144,18 @@
int sb3Tag = 2;
when(sbHolder3.getTag()).thenReturn(sb3Tag);
- ArrayList<StatusBarIconHolder> expected = new ArrayList<>();
- expected.add(sbHolder1);
- expected.add(sbHolder2);
- expected.add(sbHolder3);
-
-
// Add 3 icons in the same slot, and verify that the list we get is equal to what we gave
- for (StatusBarIconHolder holder : expected) {
- testSlot.addHolder(holder);
- }
- assertTrue(listsEqual(expected, testSlot.getHolderList()));
+ testSlot.addHolder(sbHolder1);
+ testSlot.addHolder(sbHolder2);
+ testSlot.addHolder(sbHolder3);
+
+ // View order is reverse of the order added
+ ArrayList<StatusBarIconHolder> expected = new ArrayList<>();
+ expected.add(sbHolder3);
+ expected.add(sbHolder2);
+ expected.add(sbHolder1);
+
+ assertTrue(listsEqual(expected, testSlot.getHolderListInViewOrder()));
}
private boolean listsEqual(List<StatusBarIconHolder> list1, List<StatusBarIconHolder> list2) {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java
index 550a35d..532019f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeParametersTest.java
@@ -22,6 +22,7 @@
import android.test.suitebuilder.annotation.SmallTest;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.doze.DozeScreenState;
import com.android.systemui.statusbar.phone.DozeParameters.IntInOutMatcher;
import org.junit.Assert;
@@ -218,6 +219,15 @@
verify(dozeParameters.getPowerManager()).setDozeAfterScreenOff(eq(false));
}
+ @Test
+ public void test_getWallpaperAodDuration_when_shouldControlScreenOff() {
+ TestableDozeParameters dozeParameters = new TestableDozeParameters(getContext());
+ dozeParameters.setControlScreenOffAnimation(true);
+ Assert.assertEquals("wallpaper hides faster when controlling screen off",
+ dozeParameters.getWallpaperAodDuration(),
+ DozeScreenState.ENTER_DOZE_HIDE_WALLPAPER_DELAY);
+ }
+
private class TestableDozeParameters extends DozeParameters {
private PowerManager mPowerManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BluetoothControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BluetoothControllerImplTest.java
index 54153a7..d246350 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BluetoothControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BluetoothControllerImplTest.java
@@ -16,6 +16,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -162,4 +163,38 @@
mainLooper.destroy();
}
}
+
+ @Test
+ public void testOnServiceConnected_updatesConnectionState() {
+ when(mMockAdapter.getConnectionState()).thenReturn(BluetoothAdapter.STATE_CONNECTING);
+
+ mBluetoothControllerImpl.onServiceConnected();
+
+ assertTrue(mBluetoothControllerImpl.isBluetoothConnecting());
+ assertFalse(mBluetoothControllerImpl.isBluetoothConnected());
+ }
+
+ @Test
+ public void testOnBluetoothStateChange_updatesBluetoothState() {
+ mBluetoothControllerImpl.onBluetoothStateChanged(BluetoothAdapter.STATE_OFF);
+
+ assertEquals(BluetoothAdapter.STATE_OFF, mBluetoothControllerImpl.getBluetoothState());
+
+ mBluetoothControllerImpl.onBluetoothStateChanged(BluetoothAdapter.STATE_ON);
+
+ assertEquals(BluetoothAdapter.STATE_ON, mBluetoothControllerImpl.getBluetoothState());
+ }
+
+ @Test
+ public void testOnBluetoothStateChange_updatesConnectionState() {
+ when(mMockAdapter.getConnectionState()).thenReturn(
+ BluetoothAdapter.STATE_CONNECTING,
+ BluetoothAdapter.STATE_DISCONNECTED);
+
+ mBluetoothControllerImpl.onServiceConnected();
+ mBluetoothControllerImpl.onBluetoothStateChanged(BluetoothAdapter.STATE_OFF);
+
+ assertFalse(mBluetoothControllerImpl.isBluetoothConnecting());
+ assertFalse(mBluetoothControllerImpl.isBluetoothConnected());
+ }
}
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index 08aa063..7798cf7 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -2232,7 +2232,7 @@
}
if (service != null) {
mFingerprintGestureDispatcher = new FingerprintGestureDispatcher(
- service, mLock);
+ service, mContext.getResources(), mLock);
break;
}
}
diff --git a/services/accessibility/java/com/android/server/accessibility/FingerprintGestureDispatcher.java b/services/accessibility/java/com/android/server/accessibility/FingerprintGestureDispatcher.java
index fe787b3..96418aac 100644
--- a/services/accessibility/java/com/android/server/accessibility/FingerprintGestureDispatcher.java
+++ b/services/accessibility/java/com/android/server/accessibility/FingerprintGestureDispatcher.java
@@ -17,6 +17,7 @@
package com.android.server.accessibility;
import android.accessibilityservice.FingerprintGestureController;
+import android.content.res.Resources;
import android.hardware.fingerprint.IFingerprintClientActiveCallback;
import android.hardware.fingerprint.IFingerprintService;
import android.os.Binder;
@@ -42,6 +43,7 @@
private final Object mLock;
private final IFingerprintService mFingerprintService;
private final Handler mHandler;
+ private final boolean mHardwareSupportsGestures;
// This field is ground truth for whether or not we are registered. Only write to it in handler.
private boolean mRegisteredReadOnlyExceptInHandler;
@@ -50,8 +52,11 @@
* @param fingerprintService The system's fingerprint service
* @param lock A lock to use when managing internal state
*/
- public FingerprintGestureDispatcher(IFingerprintService fingerprintService, Object lock) {
+ public FingerprintGestureDispatcher(IFingerprintService fingerprintService,
+ Resources resources, Object lock) {
mFingerprintService = fingerprintService;
+ mHardwareSupportsGestures = resources.getBoolean(
+ com.android.internal.R.bool.config_fingerprintSupportsGestures);
mLock = lock;
mHandler = new Handler(this);
}
@@ -61,9 +66,11 @@
* @param lock A lock to use when managing internal state
* @param handler A handler to use internally. Used for testing.
*/
- public FingerprintGestureDispatcher(IFingerprintService fingerprintService, Object lock,
- Handler handler) {
+ public FingerprintGestureDispatcher(IFingerprintService fingerprintService,
+ Resources resources, Object lock, Handler handler) {
mFingerprintService = fingerprintService;
+ mHardwareSupportsGestures = resources.getBoolean(
+ com.android.internal.R.bool.config_fingerprintSupportsGestures);
mLock = lock;
mHandler = handler;
}
@@ -74,6 +81,8 @@
* @param clientList The list of potential clients.
*/
public void updateClientList(List<? extends FingerprintGestureClient> clientList) {
+ if (!mHardwareSupportsGestures) return;
+
synchronized (mLock) {
mCapturingClients.clear();
for (int i = 0; i < clientList.size(); i++) {
@@ -96,6 +105,8 @@
@Override
public void onClientActiveChanged(boolean nonGestureFingerprintClientActive) {
+ if (!mHardwareSupportsGestures) return;
+
synchronized (mLock) {
for (int i = 0; i < mCapturingClients.size(); i++) {
mCapturingClients.get(i).onFingerprintGestureDetectionActiveChanged(
@@ -105,6 +116,8 @@
}
public boolean isFingerprintGestureDetectionAvailable() {
+ if (!mHardwareSupportsGestures) return false;
+
long identity = Binder.clearCallingIdentity();
try {
return !mFingerprintService.isClientActive();
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index e6b2a35..c055060 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -2079,7 +2079,8 @@
}
getUiForShowing().showFillUi(filledId, response, filterText,
- mService.getServicePackageName(), mComponentName.getPackageName(), this);
+ mService.getServicePackageName(), mComponentName.getPackageName(),
+ mService.getServiceLabel(), mService.getServiceIcon(), this);
synchronized (mLock) {
if (mUiShownTime == 0) {
diff --git a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java
index 21a39e4..ee18dc2 100644
--- a/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java
+++ b/services/autofill/java/com/android/server/autofill/ui/AutoFillUI.java
@@ -163,11 +163,14 @@
* @param filterText text of the view to be filled
* @param servicePackageName package name of the autofill service filling the activity
* @param packageName package name of the activity that is filled
+ * @param serviceLabel label of autofill service
+ * @param serviceIcon icon of autofill service
* @param callback Identifier for the caller
*/
public void showFillUi(@NonNull AutofillId focusedId, @NonNull FillResponse response,
@Nullable String filterText, @Nullable String servicePackageName,
- @NonNull String packageName, @NonNull AutoFillUiCallback callback) {
+ @NonNull String packageName, @NonNull CharSequence serviceLabel,
+ @NonNull Drawable serviceIcon, @NonNull AutoFillUiCallback callback) {
if (sDebug) {
final int size = filterText == null ? 0 : filterText.length();
Slog.d(TAG, "showFillUi(): id=" + focusedId + ", filter=" + size + " chars");
@@ -185,7 +188,7 @@
}
hideAllUiThread(callback);
mFillUi = new FillUi(mContext, response, focusedId,
- filterText, mOverlayControl, new FillUi.Callback() {
+ filterText, mOverlayControl, serviceLabel, serviceIcon, new FillUi.Callback() {
@Override
public void onResponsePicked(FillResponse response) {
log.setType(MetricsEvent.TYPE_DETAIL);
diff --git a/services/autofill/java/com/android/server/autofill/ui/FillUi.java b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
index d29ca05..1aeb3b9 100644
--- a/services/autofill/java/com/android/server/autofill/ui/FillUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/FillUi.java
@@ -26,6 +26,8 @@
import android.annotation.Nullable;
import android.app.PendingIntent;
import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.view.ContextThemeWrapper;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.PackageManager;
@@ -53,9 +55,11 @@
import android.widget.Filter;
import android.widget.Filterable;
import android.widget.FrameLayout;
+import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RemoteViews;
+import android.widget.TextView;
import com.android.internal.R;
import com.android.server.UiThread;
@@ -72,30 +76,10 @@
final class FillUi {
private static final String TAG = "FillUi";
+ private static final int THEME_ID = com.android.internal.R.style.Theme_DeviceDefault_Autofill;
+
private static final TypedValue sTempTypedValue = new TypedValue();
- public static final class AutofillFrameLayout extends FrameLayout {
-
- OnKeyListener mUnhandledListener;
-
- public AutofillFrameLayout(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public AutofillFrameLayout(Context context, AttributeSet attrs, @AttrRes int defStyleAttr) {
- super(context, attrs, defStyleAttr);
- }
-
- @Override
- public boolean dispatchKeyEvent(KeyEvent event) {
- boolean handled = super.dispatchKeyEvent(event);
- if (!handled) {
- handled = mUnhandledListener.onKey(this, event.getKeyCode(), event);
- }
- return handled;
- }
- }
-
interface Callback {
void onResponsePicked(@NonNull FillResponse response);
void onDatasetPicked(@NonNull Dataset dataset);
@@ -146,51 +130,64 @@
FillUi(@NonNull Context context, @NonNull FillResponse response,
@NonNull AutofillId focusedViewId, @NonNull @Nullable String filterText,
- @NonNull OverlayControl overlayControl, @NonNull Callback callback) {
- mContext = context;
+ @NonNull OverlayControl overlayControl, @NonNull CharSequence serviceLabel,
+ @NonNull Drawable serviceIcon, @NonNull Callback callback) {
mCallback = callback;
mFullScreen = isFullScreen(context);
-
- final LayoutInflater inflater = LayoutInflater.from(context);
+ mContext = new ContextThemeWrapper(context, THEME_ID);
+ final LayoutInflater inflater = LayoutInflater.from(mContext);
final RemoteViews headerPresentation = response.getHeader();
final RemoteViews footerPresentation = response.getFooter();
final ViewGroup decor;
- if (headerPresentation != null || footerPresentation != null) {
- decor = (ViewGroup) inflater.inflate(
- mFullScreen ? R.layout.autofill_dataset_picker_header_footer_fullscreen
- : R.layout.autofill_dataset_picker_header_footer, null);
+ if (mFullScreen) {
+ decor = (ViewGroup) inflater.inflate(R.layout.autofill_dataset_picker_fullscreen, null);
+ } else if (headerPresentation != null || footerPresentation != null) {
+ decor = (ViewGroup) inflater.inflate(R.layout.autofill_dataset_picker_header_footer,
+ null);
} else {
- decor = (ViewGroup) inflater.inflate(
- mFullScreen ? R.layout.autofill_dataset_picker_fullscreen
- : R.layout.autofill_dataset_picker, null);
+ decor = (ViewGroup) inflater.inflate(R.layout.autofill_dataset_picker, null);
+ }
+ final TextView titleView = decor.findViewById(R.id.autofill_dataset_title);
+ if (titleView != null) {
+ titleView.setText(mContext.getString(R.string.autofill_window_title, serviceLabel));
+ }
+ final ImageView iconView = decor.findViewById(R.id.autofill_dataset_icon);
+ if (iconView != null) {
+ iconView.setImageDrawable(serviceIcon);
}
- // if autofill ui is not fullscreen, send unhandled keyevent to app window.
- if (!mFullScreen) {
- if (decor instanceof AutofillFrameLayout) {
- ((AutofillFrameLayout) decor).mUnhandledListener =
- (View view, int keyCode, KeyEvent event) -> {
- switch (keyCode) {
- case KeyEvent.KEYCODE_BACK:
- case KeyEvent.KEYCODE_ESCAPE:
- case KeyEvent.KEYCODE_ENTER:
- case KeyEvent.KEYCODE_DPAD_CENTER:
- case KeyEvent.KEYCODE_DPAD_LEFT:
- case KeyEvent.KEYCODE_DPAD_UP:
- case KeyEvent.KEYCODE_DPAD_RIGHT:
- case KeyEvent.KEYCODE_DPAD_DOWN:
- return false;
- default:
- mCallback.dispatchUnhandledKey(event);
- return true;
- }
- };
- } else {
- Slog.wtf(TAG, "Unable to send unhandled key");
+ // In full screen we only initialize size once assuming screen size never changes
+ if (mFullScreen) {
+ final Point outPoint = mTempPoint;
+ mContext.getDisplay().getSize(outPoint);
+ // full with of screen and half height of screen
+ mContentWidth = LayoutParams.MATCH_PARENT;
+ mContentHeight = outPoint.y / 2;
+ if (sVerbose) {
+ Slog.v(TAG, "initialized fillscreen LayoutParams "
+ + mContentWidth + "," + mContentHeight);
}
}
+ // Send unhandled keyevent to app window.
+ decor.addOnUnhandledKeyEventListener((View view, KeyEvent event) -> {
+ switch (event.getKeyCode() ) {
+ case KeyEvent.KEYCODE_BACK:
+ case KeyEvent.KEYCODE_ESCAPE:
+ case KeyEvent.KEYCODE_ENTER:
+ case KeyEvent.KEYCODE_DPAD_CENTER:
+ case KeyEvent.KEYCODE_DPAD_LEFT:
+ case KeyEvent.KEYCODE_DPAD_UP:
+ case KeyEvent.KEYCODE_DPAD_RIGHT:
+ case KeyEvent.KEYCODE_DPAD_DOWN:
+ return false;
+ default:
+ mCallback.dispatchUnhandledKey(event);
+ return true;
+ }
+ });
+
if (sVisibleDatasetsMaxCount > 0) {
mVisibleDatasetsMaxCount = sVisibleDatasetsMaxCount;
if (sVerbose) {
@@ -218,14 +215,12 @@
mFooter = null;
mAdapter = null;
- // insert authentication item under autofill_dataset_container or decor
- ViewGroup container = decor.findViewById(R.id.autofill_dataset_container);
- if (container == null) {
- container = decor;
- }
+ // insert authentication item under autofill_dataset_picker
+ ViewGroup container = decor.findViewById(R.id.autofill_dataset_picker);
final View content;
try {
- content = response.getPresentation().apply(context, decor, interceptionHandler);
+ response.getPresentation().setApplyTheme(THEME_ID);
+ content = response.getPresentation().apply(mContext, decor, interceptionHandler);
container.addView(content);
} catch (RuntimeException e) {
callback.onCanceled();
@@ -236,20 +231,22 @@
decor.setFocusable(true);
decor.setOnClickListener(v -> mCallback.onResponsePicked(response));
- final Point maxSize = mTempPoint;
- resolveMaxWindowSize(context, maxSize);
- // fullScreen mode occupy the full width defined by autofill_dataset_picker_max_width
- content.getLayoutParams().width = mFullScreen ? maxSize.x
- : ViewGroup.LayoutParams.WRAP_CONTENT;
- content.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT;
- final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(maxSize.x,
- MeasureSpec.AT_MOST);
- final int heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxSize.y,
- MeasureSpec.AT_MOST);
+ if (!mFullScreen) {
+ final Point maxSize = mTempPoint;
+ resolveMaxWindowSize(mContext, maxSize);
+ // fullScreen mode occupy the full width defined by autofill_dataset_picker_max_width
+ content.getLayoutParams().width = mFullScreen ? maxSize.x
+ : ViewGroup.LayoutParams.WRAP_CONTENT;
+ content.getLayoutParams().height = ViewGroup.LayoutParams.WRAP_CONTENT;
+ final int widthMeasureSpec = MeasureSpec.makeMeasureSpec(maxSize.x,
+ MeasureSpec.AT_MOST);
+ final int heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxSize.y,
+ MeasureSpec.AT_MOST);
- decor.measure(widthMeasureSpec, heightMeasureSpec);
- mContentWidth = content.getMeasuredWidth();
- mContentHeight = content.getMeasuredHeight();
+ decor.measure(widthMeasureSpec, heightMeasureSpec);
+ mContentWidth = content.getMeasuredWidth();
+ mContentHeight = content.getMeasuredHeight();
+ }
mWindow = new AnchoredWindow(decor, overlayControl);
requestShowFillUi();
@@ -263,7 +260,8 @@
RemoteViews.OnClickHandler clickBlocker = null;
if (headerPresentation != null) {
clickBlocker = newClickBlocker();
- mHeader = headerPresentation.apply(context, null, clickBlocker);
+ headerPresentation.setApplyTheme(THEME_ID);
+ mHeader = headerPresentation.apply(mContext, null, clickBlocker);
final LinearLayout headerContainer =
decor.findViewById(R.id.autofill_dataset_header);
if (sVerbose) Slog.v(TAG, "adding header");
@@ -274,15 +272,21 @@
}
if (footerPresentation != null) {
- if (clickBlocker == null) { // already set for header
- clickBlocker = newClickBlocker();
- }
- mFooter = footerPresentation.apply(context, null, clickBlocker);
final LinearLayout footerContainer =
decor.findViewById(R.id.autofill_dataset_footer);
- if (sVerbose) Slog.v(TAG, "adding footer");
- footerContainer.addView(mFooter);
- footerContainer.setVisibility(View.VISIBLE);
+ if (footerContainer != null) {
+ if (clickBlocker == null) { // already set for header
+ clickBlocker = newClickBlocker();
+ }
+ footerPresentation.setApplyTheme(THEME_ID);
+ mFooter = footerPresentation.apply(mContext, null, clickBlocker);
+ // Footer not supported on some platform e.g. TV
+ if (sVerbose) Slog.v(TAG, "adding footer");
+ footerContainer.addView(mFooter);
+ footerContainer.setVisibility(View.VISIBLE);
+ } else {
+ mFooter = null;
+ }
} else {
mFooter = null;
}
@@ -301,7 +305,8 @@
final View view;
try {
if (sVerbose) Slog.v(TAG, "setting remote view for " + focusedViewId);
- view = presentation.apply(context, null, interceptionHandler);
+ presentation.setApplyTheme(THEME_ID);
+ view = presentation.apply(mContext, null, interceptionHandler);
} catch (RuntimeException e) {
Slog.e(TAG, "Error inflating remote views", e);
continue;
@@ -352,12 +357,7 @@
}
void requestShowFillUi() {
- if (mFullScreen) {
- mCallback.requestShowFillUi(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT,
- mWindowPresenter);
- } else {
- mCallback.requestShowFillUi(mContentWidth, mContentHeight, mWindowPresenter);
- }
+ mCallback.requestShowFillUi(mContentWidth, mContentHeight, mWindowPresenter);
}
/**
@@ -388,12 +388,6 @@
mCallback.requestHideFillUi();
} else {
if (updateContentSize()) {
- if (mFullScreen) {
- LayoutParams lp = mListView.getLayoutParams();
- lp.width = mContentWidth;
- lp.height = mContentHeight;
- mListView.setLayoutParams(lp);
- }
requestShowFillUi();
}
if (mAdapter.getCount() > mVisibleDatasetsMaxCount) {
@@ -452,6 +446,10 @@
if (mAdapter == null) {
return false;
}
+ if (mFullScreen) {
+ // always request show fill window with fixed size for fullscreen
+ return true;
+ }
boolean changed = false;
if (mAdapter.getCount() <= 0) {
if (mContentWidth != 0) {
@@ -476,11 +474,6 @@
final int heightMeasureSpec = MeasureSpec.makeMeasureSpec(maxSize.y,
MeasureSpec.AT_MOST);
final int itemCount = mAdapter.getCount();
- if (mFullScreen) {
- // fullScreen mode occupy the full width defined by autofill_dataset_picker_max_width
- changed = true;
- mContentWidth = maxSize.x;
- }
if (mHeader != null) {
mHeader.measure(widthMeasureSpec, heightMeasureSpec);
@@ -491,20 +484,9 @@
for (int i = 0; i < itemCount; i++) {
final View view = mAdapter.getItem(i).view;
view.measure(widthMeasureSpec, heightMeasureSpec);
- if (mFullScreen) {
- // for fullscreen, add up all children height until hit max height.
- final int newContentHeight = mContentHeight + view.getMeasuredHeight();
- final int clampedNewHeight = Math.min(newContentHeight, maxSize.y);
- if (clampedNewHeight != mContentHeight) {
- mContentHeight = clampedNewHeight;
- } else if (view.getMeasuredHeight() > 0) {
- break;
- }
- } else {
- changed |= updateWidth(view, maxSize);
- if (i < mVisibleDatasetsMaxCount) {
- changed |= updateHeight(view, maxSize);
- }
+ changed |= updateWidth(view, maxSize);
+ if (i < mVisibleDatasetsMaxCount) {
+ changed |= updateHeight(view, maxSize);
}
}
diff --git a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
index f96fa7c2..80903c1 100644
--- a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
+++ b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java
@@ -42,6 +42,7 @@
import android.util.ArraySet;
import android.util.Pair;
import android.util.Slog;
+import android.view.ContextThemeWrapper;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@@ -70,6 +71,9 @@
private static final String TAG = "AutofillSaveUi";
+ private static final int THEME_ID =
+ com.android.internal.R.style.Theme_DeviceDefault_Autofill_Save;
+
public interface OnSaveListener {
void onSave();
void onCancel(IntentSender listener);
@@ -144,6 +148,7 @@
mServicePackageName = servicePackageName;
mPackageName = packageName;
+ context = new ContextThemeWrapper(context, THEME_ID);
final LayoutInflater inflater = LayoutInflater.from(context);
final View view = inflater.inflate(R.layout.autofill_save, null);
@@ -222,7 +227,7 @@
final View yesButton = view.findViewById(R.id.autofill_save_yes);
yesButton.setOnClickListener((v) -> mListener.onSave());
- mDialog = new Dialog(context, R.style.Theme_DeviceDefault_Light_Panel);
+ mDialog = new Dialog(context, THEME_ID);
mDialog.setContentView(view);
// Dialog can be dismissed when touched outside, but the negative listener should not be
@@ -309,6 +314,7 @@
try {
// Create the remote view peer.
+ template.setApplyTheme(THEME_ID);
final View customSubtitleView = template.apply(context, null, handler);
// And apply batch updates (if any).
diff --git a/services/core/java/com/android/server/AppOpsService.java b/services/core/java/com/android/server/AppOpsService.java
index b860191..d818bd6 100644
--- a/services/core/java/com/android/server/AppOpsService.java
+++ b/services/core/java/com/android/server/AppOpsService.java
@@ -39,6 +39,7 @@
import android.os.ServiceManager;
import android.os.ShellCallback;
import android.os.ShellCommand;
+import android.os.SystemClock;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageManagerInternal;
@@ -77,14 +78,24 @@
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import static android.app.AppOpsManager.UID_STATE_BACKGROUND;
+import static android.app.AppOpsManager.UID_STATE_CACHED;
+import static android.app.AppOpsManager.UID_STATE_FOREGROUND;
+import static android.app.AppOpsManager.UID_STATE_FOREGROUND_SERVICE;
+import static android.app.AppOpsManager._NUM_UID_STATE;
+import static android.app.AppOpsManager.UID_STATE_PERSISTENT;
+import static android.app.AppOpsManager.UID_STATE_TOP;
+
public class AppOpsService extends IAppOpsService.Stub {
static final String TAG = "AppOps";
static final boolean DEBUG = false;
@@ -100,6 +111,64 @@
// Constant meaning that any UID should be matched when dispatching callbacks
private static final int UID_ANY = -2;
+ // Map from process states to the uid states we track.
+ private static final int[] PROCESS_STATE_TO_UID_STATE = new int[] {
+ UID_STATE_PERSISTENT, // ActivityManager.PROCESS_STATE_PERSISTENT
+ UID_STATE_PERSISTENT, // ActivityManager.PROCESS_STATE_PERSISTENT_UI
+ UID_STATE_TOP, // ActivityManager.PROCESS_STATE_TOP
+ UID_STATE_FOREGROUND_SERVICE, // ActivityManager.PROCESS_STATE_FOREGROUND_SERVICE
+ UID_STATE_FOREGROUND, // ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE
+ UID_STATE_FOREGROUND, // ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND
+ UID_STATE_BACKGROUND, // ActivityManager.PROCESS_STATE_IMPORTANT_BACKGROUND
+ UID_STATE_BACKGROUND, // ActivityManager.PROCESS_STATE_TRANSIENT_BACKGROUND
+ UID_STATE_BACKGROUND, // ActivityManager.PROCESS_STATE_BACKUP
+ UID_STATE_BACKGROUND, // ActivityManager.PROCESS_STATE_SERVICE
+ UID_STATE_BACKGROUND, // ActivityManager.PROCESS_STATE_RECEIVER
+ UID_STATE_CACHED, // ActivityManager.PROCESS_STATE_TOP_SLEEPING
+ UID_STATE_CACHED, // ActivityManager.PROCESS_STATE_HEAVY_WEIGHT
+ UID_STATE_CACHED, // ActivityManager.PROCESS_STATE_HOME
+ UID_STATE_CACHED, // ActivityManager.PROCESS_STATE_LAST_ACTIVITY
+ UID_STATE_CACHED, // ActivityManager.PROCESS_STATE_CACHED_ACTIVITY
+ UID_STATE_CACHED, // ActivityManager.PROCESS_STATE_CACHED_ACTIVITY_CLIENT
+ UID_STATE_CACHED, // ActivityManager.PROCESS_STATE_CACHED_RECENT
+ UID_STATE_CACHED, // ActivityManager.PROCESS_STATE_CACHED_EMPTY
+ UID_STATE_CACHED, // ActivityManager.PROCESS_STATE_NONEXISTENT
+ };
+
+ static final String[] UID_STATE_NAMES = new String[] {
+ "pers ", // UID_STATE_PERSISTENT
+ "top ", // UID_STATE_TOP
+ "fgsvc", // UID_STATE_FOREGROUND_SERVICE
+ "fg ", // UID_STATE_FOREGROUND
+ "bg ", // UID_STATE_BACKGROUND
+ "cch ", // UID_STATE_CACHED
+ };
+
+ static final String[] UID_STATE_TIME_ATTRS = new String[] {
+ "tp", // UID_STATE_PERSISTENT
+ "tt", // UID_STATE_TOP
+ "tfs", // UID_STATE_FOREGROUND_SERVICE
+ "tf", // UID_STATE_FOREGROUND
+ "tb", // UID_STATE_BACKGROUND
+ "tc", // UID_STATE_CACHED
+ };
+
+ static final String[] UID_STATE_REJECT_ATTRS = new String[] {
+ "rp", // UID_STATE_PERSISTENT
+ "rt", // UID_STATE_TOP
+ "rfs", // UID_STATE_FOREGROUND_SERVICE
+ "rf", // UID_STATE_FOREGROUND
+ "rb", // UID_STATE_BACKGROUND
+ "rc", // UID_STATE_CACHED
+ };
+
+ static final String[] MODE_NAMES = new String[] {
+ "allow", // MODE_ALLOWED
+ "ignore", // MODE_IGNORED
+ "deny", // MODE_ERRORED
+ "default", // MODE_DEFAULT
+ };
+
Context mContext;
final AtomicFile mFile;
final Handler mHandler;
@@ -133,6 +202,8 @@
@VisibleForTesting
static final class UidState {
public final int uid;
+ public int state = UID_STATE_CACHED;
+ public int startNesting;
public ArrayMap<String, Ops> pkgOps;
public SparseIntArray opModes;
@@ -151,36 +222,51 @@
}
}
- public final static class Ops extends SparseArray<Op> {
- public final String packageName;
- public final UidState uidState;
- public final boolean isPrivileged;
+ final static class Ops extends SparseArray<Op> {
+ final String packageName;
+ final UidState uidState;
+ final boolean isPrivileged;
- public Ops(String _packageName, UidState _uidState, boolean _isPrivileged) {
+ Ops(String _packageName, UidState _uidState, boolean _isPrivileged) {
packageName = _packageName;
uidState = _uidState;
isPrivileged = _isPrivileged;
}
}
- public final static class Op {
- public final int uid;
- public final String packageName;
- public int proxyUid = -1;
- public String proxyPackageName;
- public final int op;
- public int mode;
- public int duration;
- public long time;
- public long rejectTime;
- public int nesting;
+ final static class Op {
+ final UidState uidState;
+ final int uid;
+ final String packageName;
+ final int op;
+ int proxyUid = -1;
+ String proxyPackageName;
+ int mode;
+ int duration;
+ long time[] = new long[_NUM_UID_STATE];
+ long rejectTime[] = new long[_NUM_UID_STATE];
+ int startNesting;
+ long startRealtime;
- public Op(int _uid, String _packageName, int _op) {
- uid = _uid;
+ Op(UidState _uidState, String _packageName, int _op) {
+ uidState = _uidState;
+ uid = _uidState.uid;
packageName = _packageName;
op = _op;
mode = AppOpsManager.opToDefaultMode(op);
}
+
+ boolean hasAnyTime() {
+ for (int i = 0; i < AppOpsManager._NUM_UID_STATE; i++) {
+ if (time[i] != 0) {
+ return true;
+ }
+ if (rejectTime[i] != 0) {
+ return true;
+ }
+ }
+ return false;
+ }
}
final SparseArray<ArraySet<ModeCallback>> mOpModeWatchers = new SparseArray<>();
@@ -189,13 +275,13 @@
final ArrayMap<IBinder, SparseArray<ActiveCallback>> mActiveWatchers = new ArrayMap<>();
final SparseArray<SparseArray<Restriction>> mAudioRestrictions = new SparseArray<>();
- public final class ModeCallback implements DeathRecipient {
+ final class ModeCallback implements DeathRecipient {
final IAppOpsCallback mCallback;
final int mWatchingUid;
final int mCallingUid;
final int mCallingPid;
- public ModeCallback(IAppOpsCallback callback, int watchingUid, int callingUid,
+ ModeCallback(IAppOpsCallback callback, int watchingUid, int callingUid,
int callingPid) {
mCallback = callback;
mWatchingUid = watchingUid;
@@ -222,7 +308,7 @@
return sb.toString();
}
- public void unlinkToDeath() {
+ void unlinkToDeath() {
mCallback.asBinder().unlinkToDeath(this, 0);
}
@@ -232,13 +318,13 @@
}
}
- public final class ActiveCallback implements DeathRecipient {
+ final class ActiveCallback implements DeathRecipient {
final IAppOpsActiveCallback mCallback;
final int mWatchingUid;
final int mCallingUid;
final int mCallingPid;
- public ActiveCallback(IAppOpsActiveCallback callback, int watchingUid, int callingUid,
+ ActiveCallback(IAppOpsActiveCallback callback, int watchingUid, int callingUid,
int callingPid) {
mCallback = callback;
mWatchingUid = watchingUid;
@@ -265,7 +351,7 @@
return sb.toString();
}
- public void destroy() {
+ void destroy() {
mCallback.asBinder().unlinkToDeath(this, 0);
}
@@ -277,12 +363,12 @@
final ArrayMap<IBinder, ClientState> mClients = new ArrayMap<>();
- public final class ClientState extends Binder implements DeathRecipient {
+ final class ClientState extends Binder implements DeathRecipient {
final ArrayList<Op> mStartedOps = new ArrayList<>();
final IBinder mAppToken;
final int mPid;
- public ClientState(IBinder appToken) {
+ ClientState(IBinder appToken) {
mAppToken = appToken;
mPid = Binder.getCallingPid();
// Watch only for remote processes dying
@@ -453,7 +539,7 @@
if (uid == op.uid && packageName.equals(op.packageName)) {
finishOperationLocked(op, /*finishNested*/ true);
client.mStartedOps.remove(j);
- if (op.nesting <= 0) {
+ if (op.startNesting <= 0) {
scheduleOpActiveChangedIfNeededLocked(op.op,
uid, packageName, false);
}
@@ -485,6 +571,31 @@
}
}
+ public void updateUidProcState(int uid, int procState) {
+ synchronized (this) {
+ final UidState uidState = getUidStateLocked(uid, true);
+ final int newState = PROCESS_STATE_TO_UID_STATE[procState];
+ if (uidState != null && uidState.state != newState) {
+ if (uidState.startNesting != 0) {
+ // There is some actively running operation... need to find it
+ // and appropriately update its state.
+ final long now = System.currentTimeMillis();
+ for (int i = uidState.pkgOps.size() - 1; i >= 0; i--) {
+ final Ops ops = uidState.pkgOps.valueAt(i);
+ for (int j = ops.size() - 1; j >= 0; j--) {
+ final Op op = ops.valueAt(j);
+ if (op.startNesting > 0) {
+ op.time[uidState.state] = now;
+ op.time[newState] = now;
+ }
+ }
+ }
+ }
+ uidState.state = newState;
+ }
+ }
+ }
+
public void shutdown() {
Slog.w(TAG, "Writing app ops before shutdown...");
boolean doWrite = false;
@@ -501,12 +612,16 @@
private ArrayList<AppOpsManager.OpEntry> collectOps(Ops pkgOps, int[] ops) {
ArrayList<AppOpsManager.OpEntry> resOps = null;
+ final long elapsedNow = SystemClock.elapsedRealtime();
if (ops == null) {
- resOps = new ArrayList<AppOpsManager.OpEntry>();
+ resOps = new ArrayList<>();
for (int j=0; j<pkgOps.size(); j++) {
Op curOp = pkgOps.valueAt(j);
+ long duration = curOp.duration == -1
+ ? (elapsedNow - curOp.startRealtime)
+ : curOp.duration;
resOps.add(new AppOpsManager.OpEntry(curOp.op, curOp.mode, curOp.time,
- curOp.rejectTime, curOp.duration, curOp.proxyUid,
+ curOp.rejectTime, (int) duration, curOp.proxyUid,
curOp.proxyPackageName));
}
} else {
@@ -514,10 +629,13 @@
Op curOp = pkgOps.get(ops[j]);
if (curOp != null) {
if (resOps == null) {
- resOps = new ArrayList<AppOpsManager.OpEntry>();
+ resOps = new ArrayList<>();
}
+ long duration = curOp.duration == -1
+ ? (elapsedNow - curOp.startRealtime)
+ : curOp.duration;
resOps.add(new AppOpsManager.OpEntry(curOp.op, curOp.mode, curOp.time,
- curOp.rejectTime, curOp.duration, curOp.proxyUid,
+ curOp.rejectTime, (int) duration, curOp.proxyUid,
curOp.proxyPackageName));
}
}
@@ -628,7 +746,7 @@
}
private void pruneOp(Op op, int uid, String packageName) {
- if (op.time == 0 && op.rejectTime == 0) {
+ if (!op.hasAnyTime()) {
Ops ops = getOpsRawLocked(uid, packageName, false /* edit */,
false /* uidMismatchExpected */);
if (ops != null) {
@@ -946,7 +1064,7 @@
mOpModeWatchers.get(curOp.op));
callbacks = addCallbacks(callbacks, curOp.op, curOp.uid, packageName,
mPackageModeWatchers.get(packageName));
- if (curOp.time == 0 && curOp.rejectTime == 0) {
+ if (!curOp.hasAnyTime()) {
pkgOps.removeAt(j);
}
}
@@ -1212,24 +1330,25 @@
private int noteOperationUnchecked(int code, int uid, String packageName,
int proxyUid, String proxyPackageName) {
synchronized (this) {
- Ops ops = getOpsRawLocked(uid, packageName, true /* edit */,
+ final Ops ops = getOpsRawLocked(uid, packageName, true /* edit */,
false /* uidMismatchExpected */);
if (ops == null) {
if (DEBUG) Slog.d(TAG, "noteOperation: no op for code " + code + " uid " + uid
+ " package " + packageName);
return AppOpsManager.MODE_ERRORED;
}
- Op op = getOpLocked(ops, code, true);
+ final Op op = getOpLocked(ops, code, true);
if (isOpRestrictedLocked(uid, code, packageName)) {
return AppOpsManager.MODE_IGNORED;
}
+ final UidState uidState = ops.uidState;
if (op.duration == -1) {
Slog.w(TAG, "Noting op not finished: uid " + uid + " pkg " + packageName
- + " code " + code + " time=" + op.time + " duration=" + op.duration);
+ + " code " + code + " time=" + op.time[uidState.state]
+ + " duration=" + op.duration);
}
op.duration = 0;
final int switchCode = AppOpsManager.opToSwitch(code);
- UidState uidState = ops.uidState;
// If there is a non-default per UID policy (we set UID op mode only if
// non-default) it takes over, otherwise use the per package policy.
if (uidState.opModes != null && uidState.opModes.indexOfKey(switchCode) >= 0) {
@@ -1238,7 +1357,7 @@
if (DEBUG) Slog.d(TAG, "noteOperation: reject #" + op.mode + " for code "
+ switchCode + " (" + code + ") uid " + uid + " package "
+ packageName);
- op.rejectTime = System.currentTimeMillis();
+ op.rejectTime[uidState.state] = System.currentTimeMillis();
return uidMode;
}
} else {
@@ -1247,14 +1366,14 @@
if (DEBUG) Slog.d(TAG, "noteOperation: reject #" + op.mode + " for code "
+ switchCode + " (" + code + ") uid " + uid + " package "
+ packageName);
- op.rejectTime = System.currentTimeMillis();
+ op.rejectTime[uidState.state] = System.currentTimeMillis();
return switchOp.mode;
}
}
if (DEBUG) Slog.d(TAG, "noteOperation: allowing code " + code + " uid " + uid
+ " package " + packageName);
- op.time = System.currentTimeMillis();
- op.rejectTime = 0;
+ op.time[uidState.state] = System.currentTimeMillis();
+ op.rejectTime[uidState.state] = 0;
op.proxyUid = proxyUid;
op.proxyPackageName = proxyPackageName;
return AppOpsManager.MODE_ALLOWED;
@@ -1323,19 +1442,19 @@
}
ClientState client = (ClientState)token;
synchronized (this) {
- Ops ops = getOpsRawLocked(uid, resolvedPackageName, true /* edit */,
+ final Ops ops = getOpsRawLocked(uid, resolvedPackageName, true /* edit */,
false /* uidMismatchExpected */);
if (ops == null) {
if (DEBUG) Slog.d(TAG, "startOperation: no op for code " + code + " uid " + uid
+ " package " + resolvedPackageName);
return AppOpsManager.MODE_ERRORED;
}
- Op op = getOpLocked(ops, code, true);
+ final Op op = getOpLocked(ops, code, true);
if (isOpRestrictedLocked(uid, code, resolvedPackageName)) {
return AppOpsManager.MODE_IGNORED;
}
final int switchCode = AppOpsManager.opToSwitch(code);
- UidState uidState = ops.uidState;
+ final UidState uidState = ops.uidState;
// If there is a non-default per UID policy (we set UID op mode only if
// non-default) it takes over, otherwise use the per package policy.
if (uidState.opModes != null && uidState.opModes.indexOfKey(switchCode) >= 0) {
@@ -1345,7 +1464,7 @@
if (DEBUG) Slog.d(TAG, "noteOperation: reject #" + op.mode + " for code "
+ switchCode + " (" + code + ") uid " + uid + " package "
+ resolvedPackageName);
- op.rejectTime = System.currentTimeMillis();
+ op.rejectTime[uidState.state] = System.currentTimeMillis();
return uidMode;
}
} else {
@@ -1355,19 +1474,21 @@
if (DEBUG) Slog.d(TAG, "startOperation: reject #" + op.mode + " for code "
+ switchCode + " (" + code + ") uid " + uid + " package "
+ resolvedPackageName);
- op.rejectTime = System.currentTimeMillis();
+ op.rejectTime[uidState.state] = System.currentTimeMillis();
return switchOp.mode;
}
}
if (DEBUG) Slog.d(TAG, "startOperation: allowing code " + code + " uid " + uid
+ " package " + resolvedPackageName);
- if (op.nesting == 0) {
- op.time = System.currentTimeMillis();
- op.rejectTime = 0;
+ if (op.startNesting == 0) {
+ op.startRealtime = SystemClock.elapsedRealtime();
+ op.time[uidState.state] = System.currentTimeMillis();
+ op.rejectTime[uidState.state] = 0;
op.duration = -1;
scheduleOpActiveChangedIfNeededLocked(code, uid, packageName, true);
}
- op.nesting++;
+ op.startNesting++;
+ uidState.startNesting++;
if (client.mStartedOps != null) {
client.mStartedOps.add(op);
}
@@ -1415,7 +1536,7 @@
return;
}
finishOperationLocked(op, /*finishNested*/ false);
- if (op.nesting <= 0) {
+ if (op.startNesting <= 0) {
scheduleOpActiveChangedIfNeededLocked(code, uid, packageName, false);
}
}
@@ -1476,18 +1597,22 @@
}
void finishOperationLocked(Op op, boolean finishNested) {
- if (op.nesting <= 1 || finishNested) {
- if (op.nesting == 1 || finishNested) {
- op.duration = (int)(System.currentTimeMillis() - op.time);
- op.time += op.duration;
+ if (op.startNesting <= 1 || finishNested) {
+ if (op.startNesting == 1 || finishNested) {
+ op.duration = (int)(SystemClock.elapsedRealtime() - op.startRealtime);
+ op.time[op.uidState.state] = System.currentTimeMillis();
} else {
Slog.w(TAG, "Finishing op nesting under-run: uid " + op.uid + " pkg "
+ op.packageName + " code " + op.op + " time=" + op.time
- + " duration=" + op.duration + " nesting=" + op.nesting);
+ + " duration=" + op.duration + " nesting=" + op.startNesting);
}
- op.nesting = 0;
+ if (op.startNesting >= 1) {
+ op.uidState.startNesting -= op.startNesting;
+ }
+ op.startNesting = 0;
} else {
- op.nesting--;
+ op.startNesting--;
+ op.uidState.startNesting--;
}
}
@@ -1617,7 +1742,7 @@
if (!edit) {
return null;
}
- op = new Op(ops.uidState.uid, ops.packageName, code);
+ op = new Op(ops.uidState, ops.packageName, code);
ops.put(code, op);
}
if (edit) {
@@ -1750,7 +1875,7 @@
if (ops != null) {
final Op op = ops.get(AppOpsManager.OP_RUN_IN_BACKGROUND);
if (op != null && op.mode != AppOpsManager.opToDefaultMode(op.op)) {
- final Op copy = new Op(op.uid, op.packageName,
+ final Op copy = new Op(op.uidState, op.packageName,
AppOpsManager.OP_RUN_ANY_IN_BACKGROUND);
copy.mode = op.mode;
ops.put(AppOpsManager.OP_RUN_ANY_IN_BACKGROUND, copy);
@@ -1860,37 +1985,86 @@
String tagName = parser.getName();
if (tagName.equals("op")) {
- Op op = new Op(uid, pkgName, Integer.parseInt(parser.getAttributeValue(null, "n")));
- String mode = parser.getAttributeValue(null, "m");
- if (mode != null) {
- op.mode = Integer.parseInt(mode);
- }
- String time = parser.getAttributeValue(null, "t");
- if (time != null) {
- op.time = Long.parseLong(time);
- }
- time = parser.getAttributeValue(null, "r");
- if (time != null) {
- op.rejectTime = Long.parseLong(time);
- }
- String dur = parser.getAttributeValue(null, "d");
- if (dur != null) {
- op.duration = Integer.parseInt(dur);
- }
- String proxyUid = parser.getAttributeValue(null, "pu");
- if (proxyUid != null) {
- op.proxyUid = Integer.parseInt(proxyUid);
- }
- String proxyPackageName = parser.getAttributeValue(null, "pp");
- if (proxyPackageName != null) {
- op.proxyPackageName = proxyPackageName;
- }
-
UidState uidState = getUidStateLocked(uid, true);
if (uidState.pkgOps == null) {
uidState.pkgOps = new ArrayMap<>();
}
+ Op op = new Op(uidState, pkgName,
+ Integer.parseInt(parser.getAttributeValue(null, "n")));
+
+ for (int i = parser.getAttributeCount()-1; i >= 0; i--) {
+ final String name = parser.getAttributeName(i);
+ final String value = parser.getAttributeValue(i);
+ switch (name) {
+ case "m":
+ op.mode = Integer.parseInt(value);
+ break;
+ case "d":
+ op.duration = Integer.parseInt(value);
+ break;
+ case "pu":
+ op.proxyUid = Integer.parseInt(value);
+ break;
+ case "pp":
+ op.proxyPackageName = value;
+ break;
+ case "tp":
+ op.time[AppOpsManager.UID_STATE_PERSISTENT] = Long.parseLong(value);
+ break;
+ case "tt":
+ op.time[AppOpsManager.UID_STATE_TOP] = Long.parseLong(value);
+ break;
+ case "tfs":
+ op.time[AppOpsManager.UID_STATE_FOREGROUND_SERVICE]
+ = Long.parseLong(value);
+ break;
+ case "tf":
+ op.time[AppOpsManager.UID_STATE_FOREGROUND] = Long.parseLong(value);
+ break;
+ case "tb":
+ op.time[AppOpsManager.UID_STATE_BACKGROUND] = Long.parseLong(value);
+ break;
+ case "tc":
+ op.time[AppOpsManager.UID_STATE_CACHED] = Long.parseLong(value);
+ break;
+ case "rp":
+ op.rejectTime[AppOpsManager.UID_STATE_PERSISTENT]
+ = Long.parseLong(value);
+ break;
+ case "rt":
+ op.rejectTime[AppOpsManager.UID_STATE_TOP] = Long.parseLong(value);
+ break;
+ case "rfs":
+ op.rejectTime[AppOpsManager.UID_STATE_FOREGROUND_SERVICE]
+ = Long.parseLong(value);
+ break;
+ case "rf":
+ op.rejectTime[AppOpsManager.UID_STATE_FOREGROUND]
+ = Long.parseLong(value);
+ break;
+ case "rb":
+ op.rejectTime[AppOpsManager.UID_STATE_BACKGROUND]
+ = Long.parseLong(value);
+ break;
+ case "rc":
+ op.rejectTime[AppOpsManager.UID_STATE_CACHED]
+ = Long.parseLong(value);
+ break;
+ case "t":
+ // Backwards compat.
+ op.time[AppOpsManager.UID_STATE_TOP] = Long.parseLong(value);
+ break;
+ case "r":
+ // Backwards compat.
+ op.rejectTime[AppOpsManager.UID_STATE_TOP] = Long.parseLong(value);
+ break;
+ default:
+ Slog.w(TAG, "Unknown attribute in 'op' tag: " + name);
+ break;
+ }
+ }
+
Ops ops = uidState.pkgOps.get(pkgName);
if (ops == null) {
ops = new Ops(pkgName, uidState, isPrivileged);
@@ -1977,13 +2151,17 @@
if (op.getMode() != AppOpsManager.opToDefaultMode(op.getOp())) {
out.attribute(null, "m", Integer.toString(op.getMode()));
}
- long time = op.getTime();
- if (time != 0) {
- out.attribute(null, "t", Long.toString(time));
- }
- time = op.getRejectTime();
- if (time != 0) {
- out.attribute(null, "r", Long.toString(time));
+ for (int k = 0; k < _NUM_UID_STATE; k++) {
+ final long time = op.getTimeFor(k);
+ if (time != 0) {
+ out.attribute(null, UID_STATE_TIME_ATTRS[k],
+ Long.toString(time));
+ }
+ final long rejectTime = op.getRejectTimeFor(k);
+ if (rejectTime != 0) {
+ out.attribute(null, UID_STATE_REJECT_ATTRS[k],
+ Long.toString(rejectTime));
+ }
}
int dur = op.getDuration();
if (dur != 0) {
@@ -2069,15 +2247,10 @@
}
int strModeToMode(String modeStr, PrintWriter err) {
- switch (modeStr) {
- case "allow":
- return AppOpsManager.MODE_ALLOWED;
- case "deny":
- return AppOpsManager.MODE_ERRORED;
- case "ignore":
- return AppOpsManager.MODE_IGNORED;
- case "default":
- return AppOpsManager.MODE_DEFAULT;
+ for (int i = MODE_NAMES.length - 1; i >= 0; i--) {
+ if (MODE_NAMES[i].equals(modeStr)) {
+ return i;
+ }
}
try {
return Integer.parseInt(modeStr);
@@ -2466,6 +2639,34 @@
pw.println(" none");
}
+ private void dumpTimesLocked(PrintWriter pw, String firstPrefix, String prefix, long[] times,
+ long now, SimpleDateFormat sdf, Date date) {
+ boolean hasTime = false;
+ for (int i = 0; i < _NUM_UID_STATE; i++) {
+ if (times[i] != 0) {
+ hasTime = true;
+ break;
+ }
+ }
+ if (!hasTime) {
+ return;
+ }
+ boolean first = true;
+ for (int i = 0; i < _NUM_UID_STATE; i++) {
+ if (times[i] != 0) {
+ pw.print(first ? firstPrefix : prefix);
+ first = false;
+ pw.print(UID_STATE_NAMES[i]);
+ pw.print(" = ");
+ date.setTime(times[i]);
+ pw.print(sdf.format(date));
+ pw.print(" (");
+ TimeUtils.formatDuration(times[i]-now, pw);
+ pw.println(")");
+ }
+ }
+ }
+
@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw)) return;
@@ -2491,6 +2692,9 @@
synchronized (this) {
pw.println("Current AppOps Service state:");
final long now = System.currentTimeMillis();
+ final long nowElapsed = SystemClock.elapsedRealtime();
+ final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
+ final Date date = new Date();
boolean needSep = false;
if (mOpModeWatchers.size() > 0) {
needSep = true;
@@ -2585,7 +2789,7 @@
pw.print(" "); pw.print(op);
pw.print(" usage="); pw.print(AudioAttributes.usageToString(usage));
Restriction r = restrictions.valueAt(i);
- pw.print(": mode="); pw.println(r.mode);
+ pw.print(": mode="); pw.println(MODE_NAMES[r.mode]);
if (!r.exceptionPackages.isEmpty()) {
pw.println(" Exceptions:");
for (int j=0; j<r.exceptionPackages.size(); j++) {
@@ -2602,6 +2806,12 @@
UidState uidState = mUidStates.valueAt(i);
pw.print(" Uid "); UserHandle.formatUid(pw, uidState.uid); pw.println(":");
+ pw.print(" state=");
+ pw.println(UID_STATE_NAMES[uidState.state]);
+ if (uidState.startNesting != 0) {
+ pw.print(" startNesting=");
+ pw.println(uidState.startNesting);
+ }
needSep = true;
SparseIntArray opModes = uidState.opModes;
@@ -2611,7 +2821,7 @@
final int code = opModes.keyAt(j);
final int mode = opModes.valueAt(j);
pw.print(" "); pw.print(AppOpsManager.opToName(code));
- pw.print(": mode="); pw.println(mode);
+ pw.print(": mode="); pw.println(MODE_NAMES[mode]);
}
}
@@ -2625,21 +2835,26 @@
for (int j=0; j<ops.size(); j++) {
Op op = ops.valueAt(j);
pw.print(" "); pw.print(AppOpsManager.opToName(op.op));
- pw.print(": mode="); pw.print(op.mode);
- if (op.time != 0) {
- pw.print("; time="); TimeUtils.formatDuration(now-op.time, pw);
- pw.print(" ago");
- }
- if (op.rejectTime != 0) {
- pw.print("; rejectTime="); TimeUtils.formatDuration(now-op.rejectTime, pw);
- pw.print(" ago");
- }
+ pw.print(" ("); pw.print(MODE_NAMES[op.mode]); pw.println("): ");
+ dumpTimesLocked(pw,
+ " Access: ",
+ " ", op.time, now, sdf, date);
+ dumpTimesLocked(pw,
+ " Reject: ",
+ " ", op.rejectTime, now, sdf, date);
if (op.duration == -1) {
- pw.print(" (running)");
+ pw.print(" Running start at: ");
+ TimeUtils.formatDuration(nowElapsed-op.startRealtime, pw);
+ pw.println();
} else if (op.duration != 0) {
- pw.print("; duration="); TimeUtils.formatDuration(op.duration, pw);
+ pw.print(" duration=");
+ TimeUtils.formatDuration(op.duration, pw);
+ pw.println();
}
- pw.println();
+ if (op.startNesting != 0) {
+ pw.print(" startNesting=");
+ pw.println(op.startNesting);
+ }
}
}
}
diff --git a/services/core/java/com/android/server/BinderCallsStatsService.java b/services/core/java/com/android/server/BinderCallsStatsService.java
index ae14dfa..1cd853f 100644
--- a/services/core/java/com/android/server/BinderCallsStatsService.java
+++ b/services/core/java/com/android/server/BinderCallsStatsService.java
@@ -56,7 +56,10 @@
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (args != null) {
for (final String arg : args) {
- if ("--reset".equals(arg)) {
+ if ("-a".equals(arg)) {
+ // We currently dump all information by default
+ continue;
+ } else if ("--reset".equals(arg)) {
reset();
pw.println("binder_calls_stats reset.");
return;
@@ -78,7 +81,6 @@
return;
} else {
pw.println("Unknown option: " + arg);
- return;
}
}
}
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index 8d10cfa..2c0e97e 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -285,6 +285,9 @@
try {
mBluetoothLock.readLock().lock();
if (mBluetooth != null) {
+ addActiveLog(
+ BluetoothProtoEnums.ENABLE_DISABLE_REASON_AIRPLANE_MODE,
+ mContext.getPackageName(), false);
mBluetooth.onBrEdrDown();
mEnable = false;
mEnableExternal = false;
@@ -677,6 +680,8 @@
try {
mBluetoothLock.readLock().lock();
if (mBluetooth != null) {
+ addActiveLog(BluetoothProtoEnums.ENABLE_DISABLE_REASON_APPLICATION_REQUEST,
+ mContext.getPackageName(), false);
mBluetooth.onBrEdrDown();
}
} catch (RemoteException e) {
diff --git a/services/core/java/com/android/server/IpSecService.java b/services/core/java/com/android/server/IpSecService.java
index cd90e3f..33ca02f 100644
--- a/services/core/java/com/android/server/IpSecService.java
+++ b/services/core/java/com/android/server/IpSecService.java
@@ -1101,9 +1101,11 @@
new RefcountedResource<SpiRecord>(
new SpiRecord(resourceId, "", destinationAddress, spi), binder));
} catch (ServiceSpecificException e) {
- // TODO: Add appropriate checks when other ServiceSpecificException types are supported
- return new IpSecSpiResponse(
- IpSecManager.Status.SPI_UNAVAILABLE, INVALID_RESOURCE_ID, spi);
+ if (e.errorCode == OsConstants.ENOENT) {
+ return new IpSecSpiResponse(
+ IpSecManager.Status.SPI_UNAVAILABLE, INVALID_RESOURCE_ID, spi);
+ }
+ throw e;
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -1115,7 +1117,6 @@
*/
private void releaseResource(RefcountedResourceArray resArray, int resourceId)
throws RemoteException {
-
resArray.getRefcountedResourceOrThrow(resourceId).userRelease();
}
@@ -1315,15 +1316,12 @@
releaseNetId(ikey);
releaseNetId(okey);
throw e.rethrowFromSystemServer();
- } catch (ServiceSpecificException e) {
- // FIXME: get the error code and throw is at an IOException from Errno Exception
+ } catch (Throwable t) {
+ // Release keys if we got an error.
+ releaseNetId(ikey);
+ releaseNetId(okey);
+ throw t;
}
-
- // If we make it to here, then something has gone wrong and we couldn't create a VTI.
- // Release the keys that we reserved, and return an error status.
- releaseNetId(ikey);
- releaseNetId(okey);
- return new IpSecTunnelInterfaceResponse(IpSecManager.Status.RESOURCE_UNAVAILABLE);
}
/**
@@ -1352,9 +1350,6 @@
localAddr.getPrefixLength());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
- } catch (ServiceSpecificException e) {
- // If we get here, one of the arguments provided was invalid. Wrap the SSE, and throw.
- throw new IllegalArgumentException(e);
}
}
@@ -1384,9 +1379,6 @@
localAddr.getPrefixLength());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
- } catch (ServiceSpecificException e) {
- // If we get here, one of the arguments provided was invalid. Wrap the SSE, and throw.
- throw new IllegalArgumentException(e);
}
}
@@ -1590,12 +1582,7 @@
dependencies.add(refcountedSpiRecord);
SpiRecord spiRecord = refcountedSpiRecord.getResource();
- try {
- createOrUpdateTransform(c, resourceId, spiRecord, socketRecord);
- } catch (ServiceSpecificException e) {
- // FIXME: get the error code and throw is at an IOException from Errno Exception
- return new IpSecTransformResponse(IpSecManager.Status.RESOURCE_UNAVAILABLE);
- }
+ createOrUpdateTransform(c, resourceId, spiRecord, socketRecord);
// SA was created successfully, time to construct a record and lock it away
userRecord.mTransformRecords.put(
@@ -1642,23 +1629,15 @@
c.getMode() == IpSecTransform.MODE_TRANSPORT,
"Transform mode was not Transport mode; cannot be applied to a socket");
- try {
- mSrvConfig
- .getNetdInstance()
- .ipSecApplyTransportModeTransform(
- socket.getFileDescriptor(),
- resourceId,
- direction,
- c.getSourceAddress(),
- c.getDestinationAddress(),
- info.getSpiRecord().getSpi());
- } catch (ServiceSpecificException e) {
- if (e.errorCode == EINVAL) {
- throw new IllegalArgumentException(e.toString());
- } else {
- throw e;
- }
- }
+ mSrvConfig
+ .getNetdInstance()
+ .ipSecApplyTransportModeTransform(
+ socket.getFileDescriptor(),
+ resourceId,
+ direction,
+ c.getSourceAddress(),
+ c.getDestinationAddress(),
+ info.getSpiRecord().getSpi());
}
/**
@@ -1670,13 +1649,9 @@
@Override
public synchronized void removeTransportModeTransforms(ParcelFileDescriptor socket)
throws RemoteException {
- try {
- mSrvConfig
- .getNetdInstance()
- .ipSecRemoveTransportModeTransform(socket.getFileDescriptor());
- } catch (ServiceSpecificException e) {
- // FIXME: get the error code and throw is at an IOException from Errno Exception
- }
+ mSrvConfig
+ .getNetdInstance()
+ .ipSecRemoveTransportModeTransform(socket.getFileDescriptor());
}
/**
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java
index 60d11d7..41f413d 100644
--- a/services/core/java/com/android/server/TelephonyRegistry.java
+++ b/services/core/java/com/android/server/TelephonyRegistry.java
@@ -351,7 +351,7 @@
mCallForwarding[i] = false;
mCellLocation[i] = new Bundle();
mCellInfo.add(i, null);
- mPhysicalChannelConfigs.add(i, null);
+ mPhysicalChannelConfigs.add(i, new ArrayList<PhysicalChannelConfig>());
}
// Note that location can be null for non-phone builds like
diff --git a/services/core/java/com/android/server/VibratorService.java b/services/core/java/com/android/server/VibratorService.java
index 83d2bf7..ede870f 100644
--- a/services/core/java/com/android/server/VibratorService.java
+++ b/services/core/java/com/android/server/VibratorService.java
@@ -704,9 +704,11 @@
VibrationEffect scaledEffect = null;
if (vib.effect instanceof VibrationEffect.OneShot) {
VibrationEffect.OneShot oneShot = (VibrationEffect.OneShot) vib.effect;
+ oneShot = oneShot.resolve(mDefaultVibrationAmplitude);
scaledEffect = oneShot.scale(gamma, maxAmplitude);
} else if (vib.effect instanceof VibrationEffect.Waveform) {
VibrationEffect.Waveform waveform = (VibrationEffect.Waveform) vib.effect;
+ waveform = waveform.resolve(mDefaultVibrationAmplitude);
scaledEffect = waveform.scale(gamma, maxAmplitude);
} else {
Slog.w(TAG, "Unable to apply intensity scaling, unknown VibrationEffect type");
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index 228171f..f413639 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -422,13 +422,9 @@
}
// If we're starting indirectly (e.g. from PendingIntent), figure out whether
- // we're launching into an app in a background state.
- final int uidState = mAm.getUidStateLocked(r.appInfo.uid);
- if (DEBUG_SERVICE) {
- Slog.v(TAG_SERVICE, "Uid state " + uidState + " indirect starting " + r.shortName);
- }
- final boolean bgLaunch = (uidState >
- ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND);
+ // we're launching into an app in a background state. This keys off of the same
+ // idleness state tracking as e.g. O+ background service start policy.
+ final boolean bgLaunch = !mAm.isUidActiveLocked(r.appInfo.uid);
// If the app has strict background restrictions, we treat any bg service
// start analogously to the legacy-app forced-restrictions case, regardless
@@ -1197,10 +1193,13 @@
if (!ignoreForeground &&
appRestrictedAnyInBackground(r.appInfo.uid, r.packageName)) {
- ignoreForeground = true;
Slog.w(TAG,
"Service.startForeground() not allowed due to bg restriction: service "
+ r.shortName);
+ // Back off of any foreground expectations around this service, since we've
+ // just turned down its fg request.
+ updateServiceForegroundLocked(r.app, false);
+ ignoreForeground = true;
}
// Apps under strict background restrictions simply don't get to have foreground
diff --git a/services/core/java/com/android/server/am/ActivityDisplay.java b/services/core/java/com/android/server/am/ActivityDisplay.java
index fac3f92..0f42103 100644
--- a/services/core/java/com/android/server/am/ActivityDisplay.java
+++ b/services/core/java/com/android/server/am/ActivityDisplay.java
@@ -420,7 +420,9 @@
if (!otherStack.inSplitScreenSecondaryWindowingMode()) {
continue;
}
- otherStack.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
+ otherStack.setWindowingMode(WINDOWING_MODE_FULLSCREEN, false /* animate */,
+ false /* showRecents */, false /* enteringSplitScreenMode */,
+ true /* deferEnsuringVisibility */);
}
} finally {
final ActivityStack topFullscreenStack =
@@ -450,7 +452,7 @@
}
otherStack.setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY,
false /* animate */, false /* showRecents */,
- true /* enteringSplitScreenMode */);
+ true /* enteringSplitScreenMode */, true /* deferEnsuringVisibility */);
}
} finally {
mSupervisor.mWindowManager.continueSurfaceLayout();
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 6cd6a31..193d3f4 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -5306,7 +5306,8 @@
final long origId = Binder.clearCallingIdentity();
try {
synchronized (this) {
- mWindowManager.cancelRecentsAnimation(restoreHomeStackPosition
+ // Cancel the recents animation synchronously (do not hold the WM lock)
+ mWindowManager.cancelRecentsAnimationSynchronously(restoreHomeStackPosition
? REORDER_MOVE_TO_ORIGINAL_POSITION
: REORDER_KEEP_IN_PLACE, "cancelRecentsAnimation");
}
@@ -11270,7 +11271,7 @@
stack.moveToFront("setTaskWindowingModeSplitScreenPrimary", task);
}
stack.setWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY, animate, showRecents,
- false /* enteringSplitScreenMode */);
+ false /* enteringSplitScreenMode */, false /* deferEnsuringVisibility */);
return windowingMode != task.getWindowingMode();
} finally {
Binder.restoreCallingIdentity(ident);
@@ -22928,6 +22929,7 @@
private void noteUidProcessState(final int uid, final int state) {
mBatteryStatsService.noteUidProcessState(uid, state);
+ mAppOpsService.updateUidProcState(uid, state);
if (mTrackingAssociations) {
for (int i1=0, N1=mAssociations.size(); i1<N1; i1++) {
ArrayMap<ComponentName, SparseArray<ArrayMap<String, Association>>> targetComponents
@@ -26624,8 +26626,7 @@
@Override
public boolean isUidActive(int uid) {
synchronized (ActivityManagerService.this) {
- final UidRecord uidRec = mActiveUids.get(uid);
- return (uidRec != null) && !uidRec.idle;
+ return isUidActiveLocked(uid);
}
}
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 9fb3e11..e86850e 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -515,11 +515,11 @@
@Override
public void setWindowingMode(int windowingMode) {
setWindowingMode(windowingMode, false /* animate */, false /* showRecents */,
- false /* enteringSplitScreenMode */);
+ false /* enteringSplitScreenMode */, false /* deferEnsuringVisibility */);
}
void setWindowingMode(int preferredWindowingMode, boolean animate, boolean showRecents,
- boolean enteringSplitScreenMode) {
+ boolean enteringSplitScreenMode, boolean deferEnsuringVisibility) {
final boolean creating = mWindowContainerController == null;
final int currentMode = getWindowingMode();
final ActivityDisplay display = getDisplay();
@@ -555,7 +555,9 @@
// doesn't support split-screen mode, go ahead an dismiss split-screen and display a
// warning toast about it.
mService.mTaskChangeNotificationController.notifyActivityDismissingDockedStack();
- display.getSplitScreenPrimaryStack().setWindowingMode(WINDOWING_MODE_FULLSCREEN);
+ display.getSplitScreenPrimaryStack().setWindowingMode(WINDOWING_MODE_FULLSCREEN,
+ false /* animate */, false /* showRecents */,
+ false /* enteringSplitScreenMode */, true /* deferEnsuringVisibility */);
}
}
@@ -646,9 +648,7 @@
wm.continueSurfaceLayout();
}
- // Don't ensure visible activities if the windowing mode change was a side effect of us
- // entering split-screen mode.
- if (!enteringSplitScreenMode) {
+ if (!deferEnsuringVisibility) {
mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, PRESERVE_WINDOWS);
mStackSupervisor.resumeFocusedStackTopActivityLocked();
}
diff --git a/services/core/java/com/android/server/am/AppWarnings.java b/services/core/java/com/android/server/am/AppWarnings.java
index ea0251e..30a3844 100644
--- a/services/core/java/com/android/server/am/AppWarnings.java
+++ b/services/core/java/com/android/server/am/AppWarnings.java
@@ -122,7 +122,7 @@
return;
}
- // TODO(b/77862563): temp. fix while P is being finalized. To be reverted
+ // TODO(b/75318890): Need to move this to when the app actually crashes.
if (/*ActivityManager.isRunningInTestHarness()
&&*/ !mAlwaysShowUnsupportedCompileSdkWarningActivities.contains(r.realActivity)) {
// Don't show warning if we are running in a test harness and we don't have to always
diff --git a/services/core/java/com/android/server/am/BatteryExternalStatsWorker.java b/services/core/java/com/android/server/am/BatteryExternalStatsWorker.java
index 87194bc..49fa902 100644
--- a/services/core/java/com/android/server/am/BatteryExternalStatsWorker.java
+++ b/services/core/java/com/android/server/am/BatteryExternalStatsWorker.java
@@ -103,6 +103,9 @@
@GuardedBy("this")
private Future<?> mWakelockChangesUpdate;
+ @GuardedBy("this")
+ private Future<?> mBatteryLevelSync;
+
private final Object mWorkerLock = new Object();
@GuardedBy("mWorkerLock")
@@ -197,35 +200,75 @@
@Override
public Future<?> scheduleCpuSyncDueToWakelockChange(long delayMillis) {
- if (mExecutorService.isShutdown()) {
- return CompletableFuture.failedFuture(new IllegalStateException("worker shutdown"));
+ synchronized (BatteryExternalStatsWorker.this) {
+ mWakelockChangesUpdate = scheduleDelayedSyncLocked(mWakelockChangesUpdate,
+ () -> {
+ scheduleSync("wakelock-change", UPDATE_CPU);
+ scheduleRunnable(() -> mStats.postBatteryNeedsCpuUpdateMsg());
+ },
+ delayMillis);
+ return mWakelockChangesUpdate;
}
-
- if (mWakelockChangesUpdate != null) {
- // If there's already a scheduled task, leave it as is if we're trying to re-schedule
- // it again with a delay, otherwise cancel and re-schedule it.
- if (delayMillis == 0) {
- mWakelockChangesUpdate.cancel(false);
- } else {
- return mWakelockChangesUpdate;
- }
- }
-
- mWakelockChangesUpdate = mExecutorService.schedule(() -> {
- scheduleSync("wakelock-change", UPDATE_CPU);
- scheduleRunnable(() -> mStats.postBatteryNeedsCpuUpdateMsg());
- mWakelockChangesUpdate = null;
- }, delayMillis, TimeUnit.MILLISECONDS);
- return mWakelockChangesUpdate;
}
@Override
public void cancelCpuSyncDueToWakelockChange() {
- if (mWakelockChangesUpdate != null) {
- mWakelockChangesUpdate.cancel(false);
+ synchronized (BatteryExternalStatsWorker.this) {
+ if (mWakelockChangesUpdate != null) {
+ mWakelockChangesUpdate.cancel(false);
+ mWakelockChangesUpdate = null;
+ }
}
}
+ @Override
+ public Future<?> scheduleSyncDueToBatteryLevelChange(long delayMillis) {
+ synchronized (BatteryExternalStatsWorker.this) {
+ mBatteryLevelSync = scheduleDelayedSyncLocked(mBatteryLevelSync,
+ () -> scheduleSync("battery-level", UPDATE_ALL),
+ delayMillis);
+ return mBatteryLevelSync;
+ }
+ }
+
+ @GuardedBy("this")
+ private void cancelSyncDueToBatteryLevelChangeLocked() {
+ if (mBatteryLevelSync != null) {
+ mBatteryLevelSync.cancel(false);
+ mBatteryLevelSync = null;
+ }
+ }
+
+ /**
+ * Schedule a sync {@param syncRunnable} with a delay. If there's already a scheduled sync, a
+ * new sync won't be scheduled unless it is being scheduled to run immediately (delayMillis=0).
+ *
+ * @param lastScheduledSync the task which was earlier scheduled to run
+ * @param syncRunnable the task that needs to be scheduled to run
+ * @param delayMillis time after which {@param syncRunnable} needs to be scheduled
+ * @return scheduled {@link Future} which can be used to check if task is completed or to
+ * cancel it if needed
+ */
+ @GuardedBy("this")
+ private Future<?> scheduleDelayedSyncLocked(Future<?> lastScheduledSync, Runnable syncRunnable,
+ long delayMillis) {
+ if (mExecutorService.isShutdown()) {
+ return CompletableFuture.failedFuture(new IllegalStateException("worker shutdown"));
+ }
+
+ if (lastScheduledSync != null) {
+ // If there's already a scheduled task, leave it as is if we're trying to
+ // re-schedule it again with a delay, otherwise cancel and re-schedule it.
+ if (delayMillis == 0) {
+ lastScheduledSync.cancel(false);
+ } else {
+ return lastScheduledSync;
+ }
+ }
+
+ return mExecutorService.schedule(syncRunnable, delayMillis, TimeUnit.MILLISECONDS);
+ }
+
public synchronized Future<?> scheduleWrite() {
if (mExecutorService.isShutdown()) {
return CompletableFuture.failedFuture(new IllegalStateException("worker shutdown"));
@@ -294,6 +337,12 @@
mUidsToRemove.clear();
mCurrentFuture = null;
mUseLatestStates = true;
+ if ((updateFlags & UPDATE_ALL) != 0) {
+ cancelSyncDueToBatteryLevelChangeLocked();
+ }
+ if ((updateFlags & UPDATE_CPU) != 0) {
+ cancelCpuSyncDueToWakelockChange();
+ }
}
try {
diff --git a/services/core/java/com/android/server/am/CarUserSwitchingDialog.java b/services/core/java/com/android/server/am/CarUserSwitchingDialog.java
index 676f0c7..1149e87 100644
--- a/services/core/java/com/android/server/am/CarUserSwitchingDialog.java
+++ b/services/core/java/com/android/server/am/CarUserSwitchingDialog.java
@@ -23,6 +23,7 @@
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
+import android.os.UserManager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
@@ -59,11 +60,14 @@
View view = LayoutInflater.from(getContext()).inflate(R.layout.car_user_switching_dialog,
null);
- FileDescriptor fileDescriptor = UserManagerService.getInstance()
- .getUserIcon(mNewUser.id).getFileDescriptor();
- Bitmap bitmap = BitmapFactory.decodeFileDescriptor(fileDescriptor);
- ((ImageView) view.findViewById(R.id.user_loading_avatar))
- .setImageBitmap(bitmap);
+ UserManager userManager =
+ (UserManager) getContext().getSystemService(Context.USER_SERVICE);
+ Bitmap bitmap = userManager.getUserIcon(mNewUser.id);
+ if (bitmap != null) {
+ ((ImageView) view.findViewById(R.id.user_loading_avatar))
+ .setImageBitmap(bitmap);
+ }
+
((TextView) view.findViewById(R.id.user_loading))
.setText(res.getString(R.string.car_loading_profile));
setView(view);
diff --git a/services/core/java/com/android/server/am/KeyguardController.java b/services/core/java/com/android/server/am/KeyguardController.java
index 1b7f75b..5764382 100644
--- a/services/core/java/com/android/server/am/KeyguardController.java
+++ b/services/core/java/com/android/server/am/KeyguardController.java
@@ -121,6 +121,8 @@
void setKeyguardShown(boolean keyguardShowing, boolean aodShowing,
int secondaryDisplayShowing) {
boolean showingChanged = keyguardShowing != mKeyguardShowing || aodShowing != mAodShowing;
+ // If keyguard is going away, but SystemUI aborted the transition, need to reset state.
+ showingChanged |= mKeyguardGoingAway && keyguardShowing;
if (!showingChanged && secondaryDisplayShowing == mSecondaryDisplayShowing) {
return;
}
diff --git a/services/core/java/com/android/server/am/OWNERS b/services/core/java/com/android/server/am/OWNERS
index 9964053..f60c5c3 100644
--- a/services/core/java/com/android/server/am/OWNERS
+++ b/services/core/java/com/android/server/am/OWNERS
@@ -1,4 +1,34 @@
+
+# Applications & Processes
+yamasani@google.com
+jsharkey@google.com
+hackbod@google.com
+omakoto@google.com
+fkupolov@google.com
+ctate@google.com
+huiyu@google.com
+mwachens@google.com
+sudheersai@google.com
+suprabh@google.com
+
+# Windows & Activities
+ogunwale@google.com
+jjaggi@google.com
+racarr@google.com
+chaviw@google.com
+brycelee@google.com
+akulian@google.com
+roosa@google.com
+
+# Permissions & Packages
+svetoslavganov@google.com
+toddke@google.com
+
+# Londoners
+michaelwr@google.com
+narayan@google.com
+
per-file GlobalSettingsToPropertiesMapper.java=fkupolov@google.com
per-file GlobalSettingsToPropertiesMapper.java=omakoto@google.com
per-file GlobalSettingsToPropertiesMapper.java=svetoslavganov@google.com
-per-file GlobalSettingsToPropertiesMapper.java=yamasani@google.com
\ No newline at end of file
+per-file GlobalSettingsToPropertiesMapper.java=yamasani@google.com
diff --git a/services/core/java/com/android/server/am/PendingIntentRecord.java b/services/core/java/com/android/server/am/PendingIntentRecord.java
index 550c37a..483fec6 100644
--- a/services/core/java/com/android/server/am/PendingIntentRecord.java
+++ b/services/core/java/com/android/server/am/PendingIntentRecord.java
@@ -219,6 +219,9 @@
}
public void unregisterCancelListenerLocked(IResultReceiver receiver) {
+ if (mCancelCallbacks == null) {
+ return; // Already unregistered or detached.
+ }
mCancelCallbacks.unregister(receiver);
if (mCancelCallbacks.getRegisteredCallbackCount() <= 0) {
mCancelCallbacks = null;
diff --git a/services/core/java/com/android/server/am/RecentTasks.java b/services/core/java/com/android/server/am/RecentTasks.java
index c83bacb..06a3078 100644
--- a/services/core/java/com/android/server/am/RecentTasks.java
+++ b/services/core/java/com/android/server/am/RecentTasks.java
@@ -22,8 +22,10 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
+import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
import static android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
@@ -1255,7 +1257,8 @@
for (int i = 0; i < recentsCount; i++) {
final TaskRecord tr = mTasks.get(i);
if (task != tr) {
- if (!task.hasCompatibleActivityType(tr) || task.userId != tr.userId) {
+ if (!hasCompatibleActivityTypeAndWindowingMode(task, tr)
+ || task.userId != tr.userId) {
continue;
}
final Intent trIntent = tr.intent;
@@ -1547,4 +1550,29 @@
return rti;
}
+
+ /**
+ * @return Whether the activity types and windowing modes of the two tasks are considered
+ * compatible. This is necessary because we currently don't persist the activity type
+ * or the windowing mode with the task, so they can be undefined when restored.
+ */
+ private boolean hasCompatibleActivityTypeAndWindowingMode(TaskRecord t1, TaskRecord t2) {
+ final int activityType = t1.getActivityType();
+ final int windowingMode = t1.getWindowingMode();
+ final boolean isUndefinedType = activityType == ACTIVITY_TYPE_UNDEFINED;
+ final boolean isUndefinedMode = windowingMode == WINDOWING_MODE_UNDEFINED;
+ final int otherActivityType = t2.getActivityType();
+ final int otherWindowingMode = t2.getWindowingMode();
+ final boolean isOtherUndefinedType = otherActivityType == ACTIVITY_TYPE_UNDEFINED;
+ final boolean isOtherUndefinedMode = otherWindowingMode == WINDOWING_MODE_UNDEFINED;
+
+ // An activity type and windowing mode is compatible if they are the exact same type/mode,
+ // or if one of the type/modes is undefined
+ final boolean isCompatibleType = activityType == otherActivityType
+ || isUndefinedType || isOtherUndefinedType;
+ final boolean isCompatibleMode = windowingMode == otherWindowingMode
+ || isUndefinedMode || isOtherUndefinedMode;
+
+ return isCompatibleType && isCompatibleMode;
+ }
}
diff --git a/services/core/java/com/android/server/am/RecentsAnimation.java b/services/core/java/com/android/server/am/RecentsAnimation.java
index f2ed6a2..b5047ae 100644
--- a/services/core/java/com/android/server/am/RecentsAnimation.java
+++ b/services/core/java/com/android/server/am/RecentsAnimation.java
@@ -101,9 +101,7 @@
: ACTIVITY_TYPE_HOME;
final ActivityStack targetStack = mDefaultDisplay.getStack(WINDOWING_MODE_UNDEFINED,
mTargetActivityType);
- ActivityRecord targetActivity = targetStack != null
- ? targetStack.getTopActivity()
- : null;
+ ActivityRecord targetActivity = getTargetActivity(targetStack, intent.getComponent());
final boolean hasExistingActivity = targetActivity != null;
if (hasExistingActivity) {
final ActivityDisplay display = targetActivity.getDisplay();
@@ -149,6 +147,14 @@
display.moveStackBehindBottomMostVisibleStack(targetStack);
if (DEBUG) Slog.d(TAG, "Moved stack=" + targetStack + " behind stack="
+ display.getStackAbove(targetStack));
+
+ // If there are multiple tasks in the target stack (ie. the home stack, with 3p
+ // and default launchers coexisting), then move the task to the top as a part of
+ // moving the stack to the front
+ if (targetStack.topTask() != targetActivity.getTask()) {
+ targetStack.addTask(targetActivity.getTask(), true /* toTop */,
+ "startRecentsActivity");
+ }
} else {
// No recents activity
ActivityOptions options = ActivityOptions.makeBasic();
@@ -179,8 +185,9 @@
targetActivity.mLaunchTaskBehind = true;
// Fetch all the surface controls and pass them to the client to get the animation
- // started
- mWindowManager.cancelRecentsAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION,
+ // started. Cancel any existing recents animation running synchronously (do not hold the
+ // WM lock)
+ mWindowManager.cancelRecentsAnimationSynchronously(REORDER_MOVE_TO_ORIGINAL_POSITION,
"startRecentsActivity");
mWindowManager.initializeRecentsAnimation(mTargetActivityType, recentsAnimationRunner,
this, display.mDisplayId, mStackSupervisor.mRecentTasks.getRecentTaskIds());
@@ -200,12 +207,11 @@
}
}
- @Override
- public void onAnimationFinished(@RecentsAnimationController.ReorderMode int reorderMode) {
+ private void finishAnimation(@RecentsAnimationController.ReorderMode int reorderMode) {
synchronized (mService) {
if (DEBUG) Slog.d(TAG, "onAnimationFinished(): controller="
- + mWindowManager.getRecentsAnimationController()
- + " reorderMode=" + reorderMode);
+ + mWindowManager.getRecentsAnimationController()
+ + " reorderMode=" + reorderMode);
// Cancel the associated assistant data request
if (mAssistDataRequester != null) {
@@ -298,6 +304,16 @@
}
}
+ @Override
+ public void onAnimationFinished(@RecentsAnimationController.ReorderMode int reorderMode,
+ boolean runSychronously) {
+ if (runSychronously) {
+ finishAnimation(reorderMode);
+ } else {
+ mService.mHandler.post(() -> finishAnimation(reorderMode));
+ }
+ }
+
/**
* Called only when the animation should be canceled prior to starting.
*/
@@ -322,4 +338,22 @@
}
return null;
}
+
+ /**
+ * @return the top activity in the {@param targetStack} matching the {@param component}, or just
+ * the top activity of the top task if no task matches the component.
+ */
+ private ActivityRecord getTargetActivity(ActivityStack targetStack, ComponentName component) {
+ if (targetStack == null) {
+ return null;
+ }
+
+ for (int i = targetStack.getChildCount() - 1; i >= 0; i--) {
+ final TaskRecord task = (TaskRecord) targetStack.getChildAt(i);
+ if (task.getBaseIntent().getComponent().equals(component)) {
+ return task.getTopActivity();
+ }
+ }
+ return targetStack.getTopActivity();
+ }
}
diff --git a/services/core/java/com/android/server/am/TaskRecord.java b/services/core/java/com/android/server/am/TaskRecord.java
index 1cd1dd6..9a5b1a6 100644
--- a/services/core/java/com/android/server/am/TaskRecord.java
+++ b/services/core/java/com/android/server/am/TaskRecord.java
@@ -1820,7 +1820,7 @@
final StackWindowController stackController = mStack.getWindowContainerController();
stackController.adjustConfigurationForBounds(bounds, insetBounds,
mTmpNonDecorBounds, mTmpStableBounds, overrideWidth, overrideHeight, density,
- config, parentConfig);
+ config, parentConfig, getWindowingMode());
} else {
throw new IllegalArgumentException("Expected stack when calculating override config");
}
diff --git a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
index ff86453..dc564ba 100644
--- a/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
+++ b/services/core/java/com/android/server/audio/PlaybackActivityMonitor.java
@@ -267,6 +267,7 @@
public void releasePlayer(int piid, int binderUid) {
if (DEBUG) { Log.v(TAG, "releasePlayer() for piid=" + piid); }
+ boolean change = false;
synchronized(mPlayerLock) {
final AudioPlaybackConfiguration apc = mPlayers.get(new Integer(piid));
if (checkConfigurationCaller(piid, apc, binderUid)) {
@@ -275,9 +276,12 @@
mPlayers.remove(new Integer(piid));
mDuckingManager.removeReleased(apc);
checkVolumeForPrivilegedAlarm(apc, AudioPlaybackConfiguration.PLAYER_STATE_RELEASED);
- apc.handleStateEvent(AudioPlaybackConfiguration.PLAYER_STATE_RELEASED);
+ change = apc.handleStateEvent(AudioPlaybackConfiguration.PLAYER_STATE_RELEASED);
}
}
+ if (change) {
+ dispatchPlaybackChange(true /*iplayerreleased*/);
+ }
}
// Implementation of AudioPlaybackConfiguration.PlayerDeathMonitor
diff --git a/services/core/java/com/android/server/clipboard/ClipboardService.java b/services/core/java/com/android/server/clipboard/ClipboardService.java
index f74ac47..5db20b0 100644
--- a/services/core/java/com/android/server/clipboard/ClipboardService.java
+++ b/services/core/java/com/android/server/clipboard/ClipboardService.java
@@ -621,7 +621,7 @@
private boolean clipboardAccessAllowed(int op, String callingPackage, int callingUid) {
// Check the AppOp.
- if (mAppOps.checkOp(op, callingUid, callingPackage) != AppOpsManager.MODE_ALLOWED) {
+ if (mAppOps.noteOp(op, callingUid, callingPackage) != AppOpsManager.MODE_ALLOWED) {
return false;
}
try {
diff --git a/services/core/java/com/android/server/display/ColorDisplayService.java b/services/core/java/com/android/server/display/ColorDisplayService.java
index 37035c3..030c915 100644
--- a/services/core/java/com/android/server/display/ColorDisplayService.java
+++ b/services/core/java/com/android/server/display/ColorDisplayService.java
@@ -293,7 +293,7 @@
mColorMatrixAnimator.cancel();
}
- setCoefficientMatrix(getContext(), mode == ColorDisplayController.COLOR_MODE_SATURATED);
+ setCoefficientMatrix(getContext(), DisplayTransformManager.isColorModeNative(mode));
setMatrix(mController.getColorTemperature(), mMatrixNight);
final DisplayTransformManager dtm = getLocalService(DisplayTransformManager.class);
diff --git a/services/core/java/com/android/server/display/DisplayTransformManager.java b/services/core/java/com/android/server/display/DisplayTransformManager.java
index a94f049..57d88e1 100644
--- a/services/core/java/com/android/server/display/DisplayTransformManager.java
+++ b/services/core/java/com/android/server/display/DisplayTransformManager.java
@@ -60,14 +60,24 @@
private static final int SURFACE_FLINGER_TRANSACTION_DALTONIZER = 1014;
private static final String PERSISTENT_PROPERTY_SATURATION = "persist.sys.sf.color_saturation";
- private static final String PERSISTENT_PROPERTY_NATIVE_MODE = "persist.sys.sf.native_mode";
+ private static final String PERSISTENT_PROPERTY_DISPLAY_COLOR = "persist.sys.sf.native_mode";
+ /**
+ * SurfaceFlinger global saturation factor.
+ */
private static final int SURFACE_FLINGER_TRANSACTION_SATURATION = 1022;
- private static final int SURFACE_FLINGER_TRANSACTION_NATIVE_MODE = 1023;
+ /**
+ * SurfaceFlinger display color (managed, unmanaged, etc.).
+ */
+ private static final int SURFACE_FLINGER_TRANSACTION_DISPLAY_COLOR = 1023;
private static final float COLOR_SATURATION_NATURAL = 1.0f;
private static final float COLOR_SATURATION_BOOSTED = 1.1f;
+ private static final int DISPLAY_COLOR_MANAGED = 0;
+ private static final int DISPLAY_COLOR_UNMANAGED = 1;
+ private static final int DISPLAY_COLOR_ENHANCED = 2;
+
/**
* Map of level -> color transformation matrix.
*/
@@ -220,20 +230,37 @@
}
}
+ /**
+ * Return true when colors are stretched from the working color space to the
+ * native color space.
+ */
public static boolean isNativeModeEnabled() {
- return SystemProperties.getBoolean(PERSISTENT_PROPERTY_NATIVE_MODE, false);
+ return SystemProperties.getInt(PERSISTENT_PROPERTY_DISPLAY_COLOR,
+ DISPLAY_COLOR_MANAGED) != DISPLAY_COLOR_MANAGED;
+ }
+
+ /**
+ * Return true when the specified colorMode stretches colors from the
+ * working color space to the native color space.
+ */
+ public static boolean isColorModeNative(int colorMode) {
+ return !(colorMode == ColorDisplayController.COLOR_MODE_NATURAL ||
+ colorMode == ColorDisplayController.COLOR_MODE_BOOSTED);
}
public boolean setColorMode(int colorMode, float[] nightDisplayMatrix) {
if (colorMode == ColorDisplayController.COLOR_MODE_NATURAL) {
applySaturation(COLOR_SATURATION_NATURAL);
- setNativeMode(false);
+ setDisplayColor(DISPLAY_COLOR_MANAGED);
} else if (colorMode == ColorDisplayController.COLOR_MODE_BOOSTED) {
applySaturation(COLOR_SATURATION_BOOSTED);
- setNativeMode(false);
+ setDisplayColor(DISPLAY_COLOR_MANAGED);
} else if (colorMode == ColorDisplayController.COLOR_MODE_SATURATED) {
applySaturation(COLOR_SATURATION_NATURAL);
- setNativeMode(true);
+ setDisplayColor(DISPLAY_COLOR_UNMANAGED);
+ } else if (colorMode == ColorDisplayController.COLOR_MODE_AUTOMATIC) {
+ applySaturation(COLOR_SATURATION_NATURAL);
+ setDisplayColor(DISPLAY_COLOR_ENHANCED);
}
setColorMatrix(LEVEL_COLOR_MATRIX_NIGHT_DISPLAY, nightDisplayMatrix);
@@ -265,17 +292,17 @@
/**
* Toggles native mode on/off in SurfaceFlinger.
*/
- private void setNativeMode(boolean enabled) {
- SystemProperties.set(PERSISTENT_PROPERTY_NATIVE_MODE, enabled ? "1" : "0");
+ private void setDisplayColor(int color) {
+ SystemProperties.set(PERSISTENT_PROPERTY_DISPLAY_COLOR, Integer.toString(color));
final IBinder flinger = ServiceManager.getService(SURFACE_FLINGER);
if (flinger != null) {
final Parcel data = Parcel.obtain();
data.writeInterfaceToken("android.ui.ISurfaceComposer");
- data.writeInt(enabled ? 1 : 0);
+ data.writeInt(color);
try {
- flinger.transact(SURFACE_FLINGER_TRANSACTION_NATIVE_MODE, data, null, 0);
+ flinger.transact(SURFACE_FLINGER_TRANSACTION_DISPLAY_COLOR, data, null, 0);
} catch (RemoteException ex) {
- Log.e(TAG, "Failed to set native mode", ex);
+ Log.e(TAG, "Failed to set display color", ex);
} finally {
data.recycle();
}
diff --git a/services/core/java/com/android/server/fingerprint/FingerprintService.java b/services/core/java/com/android/server/fingerprint/FingerprintService.java
index ef40a1c..c9f92d2 100644
--- a/services/core/java/com/android/server/fingerprint/FingerprintService.java
+++ b/services/core/java/com/android/server/fingerprint/FingerprintService.java
@@ -619,6 +619,15 @@
void startRemove(IBinder token, int fingerId, int groupId, int userId,
IFingerprintServiceReceiver receiver, boolean restricted, boolean internal) {
+ if (token == null) {
+ Slog.w(TAG, "startRemove: token is null");
+ return;
+ }
+ if (receiver == null) {
+ Slog.w(TAG, "startRemove: receiver is null");
+ return;
+ }
+
IBiometricsFingerprint daemon = getFingerprintDaemon();
if (daemon == null) {
Slog.w(TAG, "startRemove: no fingerprint HAL!");
diff --git a/services/core/java/com/android/server/job/controllers/TimeController.java b/services/core/java/com/android/server/job/controllers/TimeController.java
index fa48b5e..04d5795 100644
--- a/services/core/java/com/android/server/job/controllers/TimeController.java
+++ b/services/core/java/com/android/server/job/controllers/TimeController.java
@@ -90,7 +90,10 @@
return;
} else if (job.hasTimingDelayConstraint() && evaluateTimingDelayConstraint(job,
nowElapsedMillis)) {
- return;
+ if (!job.hasDeadlineConstraint()) {
+ // If it doesn't have a deadline, we'll never have to touch it again.
+ return;
+ }
}
boolean isInsert = false;
diff --git a/services/core/java/com/android/server/location/GnssGeofenceProvider.java b/services/core/java/com/android/server/location/GnssGeofenceProvider.java
new file mode 100644
index 0000000..6ac4aeb
--- /dev/null
+++ b/services/core/java/com/android/server/location/GnssGeofenceProvider.java
@@ -0,0 +1,188 @@
+package com.android.server.location;
+
+import android.location.IGpsGeofenceHardware;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.util.Log;
+import android.util.SparseArray;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.FutureTask;
+
+/**
+ * Manages GNSS Geofence operations.
+ */
+class GnssGeofenceProvider extends IGpsGeofenceHardware.Stub {
+
+ private static final String TAG = "GnssGeofenceProvider";
+ private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+
+ /** Holds the parameters of a geofence. */
+ private static class GeofenceEntry {
+ public int geofenceId;
+ public double latitude;
+ public double longitude;
+ public double radius;
+ public int lastTransition;
+ public int monitorTransitions;
+ public int notificationResponsiveness;
+ public int unknownTimer;
+ public boolean paused;
+ }
+
+ private final GnssGeofenceProviderNative mNative;
+ private final SparseArray<GeofenceEntry> mGeofenceEntries = new SparseArray<>();
+ private final Handler mHandler;
+
+ GnssGeofenceProvider(Looper looper) {
+ this(looper, new GnssGeofenceProviderNative());
+ }
+
+ @VisibleForTesting
+ GnssGeofenceProvider(Looper looper, GnssGeofenceProviderNative gnssGeofenceProviderNative) {
+ mHandler = new Handler(looper);
+ mNative = gnssGeofenceProviderNative;
+ }
+
+ // TODO(b/37460011): use this method in HAL death recovery.
+ void resumeIfStarted() {
+ if (DEBUG) {
+ Log.d(TAG, "resumeIfStarted");
+ }
+ mHandler.post(() -> {
+ for (int i = 0; i < mGeofenceEntries.size(); i++) {
+ GeofenceEntry entry = mGeofenceEntries.valueAt(i);
+ boolean added = mNative.addGeofence(entry.geofenceId, entry.latitude,
+ entry.longitude,
+ entry.radius,
+ entry.lastTransition, entry.monitorTransitions,
+ entry.notificationResponsiveness, entry.unknownTimer);
+ if (added && entry.paused) {
+ mNative.pauseGeofence(entry.geofenceId);
+ }
+ }
+ });
+ }
+
+ private boolean runOnHandlerThread(Callable<Boolean> callable) {
+ FutureTask<Boolean> futureTask = new FutureTask<>(callable);
+ mHandler.post(futureTask);
+ try {
+ return futureTask.get();
+ } catch (InterruptedException | ExecutionException e) {
+ Log.e(TAG, "Failed running callable.", e);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isHardwareGeofenceSupported() {
+ return runOnHandlerThread(mNative::isGeofenceSupported);
+ }
+
+ @Override
+ public boolean addCircularHardwareGeofence(int geofenceId, double latitude,
+ double longitude, double radius, int lastTransition, int monitorTransitions,
+ int notificationResponsiveness, int unknownTimer) {
+ return runOnHandlerThread(() -> {
+ boolean added = mNative.addGeofence(geofenceId, latitude, longitude, radius,
+ lastTransition, monitorTransitions, notificationResponsiveness,
+ unknownTimer);
+ if (added) {
+ GeofenceEntry entry = new GeofenceEntry();
+ entry.geofenceId = geofenceId;
+ entry.latitude = latitude;
+ entry.longitude = longitude;
+ entry.radius = radius;
+ entry.lastTransition = lastTransition;
+ entry.monitorTransitions = monitorTransitions;
+ entry.notificationResponsiveness = notificationResponsiveness;
+ entry.unknownTimer = unknownTimer;
+ mGeofenceEntries.put(geofenceId, entry);
+ }
+ return added;
+ });
+ }
+
+ @Override
+ public boolean removeHardwareGeofence(int geofenceId) {
+ return runOnHandlerThread(() -> {
+ boolean removed = mNative.removeGeofence(geofenceId);
+ if (removed) {
+ mGeofenceEntries.remove(geofenceId);
+ }
+ return removed;
+ });
+ }
+
+ @Override
+ public boolean pauseHardwareGeofence(int geofenceId) {
+ return runOnHandlerThread(() -> {
+ boolean paused = mNative.pauseGeofence(geofenceId);
+ if (paused) {
+ GeofenceEntry entry = mGeofenceEntries.get(geofenceId);
+ if (entry != null) {
+ entry.paused = true;
+ }
+ }
+ return paused;
+ });
+ }
+
+ @Override
+ public boolean resumeHardwareGeofence(int geofenceId, int monitorTransitions) {
+ return runOnHandlerThread(() -> {
+ boolean resumed = mNative.resumeGeofence(geofenceId, monitorTransitions);
+ if (resumed) {
+ GeofenceEntry entry = mGeofenceEntries.get(geofenceId);
+ if (entry != null) {
+ entry.paused = false;
+ entry.monitorTransitions = monitorTransitions;
+ }
+ }
+ return resumed;
+ });
+ }
+
+ @VisibleForTesting
+ static class GnssGeofenceProviderNative {
+ public boolean isGeofenceSupported() {
+ return native_is_geofence_supported();
+ }
+
+ public boolean addGeofence(int geofenceId, double latitude, double longitude, double radius,
+ int lastTransition, int monitorTransitions, int notificationResponsiveness,
+ int unknownTimer) {
+ return native_add_geofence(geofenceId, latitude, longitude, radius, lastTransition,
+ monitorTransitions, notificationResponsiveness, unknownTimer);
+ }
+
+ public boolean removeGeofence(int geofenceId) {
+ return native_remove_geofence(geofenceId);
+ }
+
+ public boolean resumeGeofence(int geofenceId, int transitions) {
+ return native_resume_geofence(geofenceId, transitions);
+ }
+
+ public boolean pauseGeofence(int geofenceId) {
+ return native_pause_geofence(geofenceId);
+ }
+ }
+
+ private static native boolean native_is_geofence_supported();
+
+ private static native boolean native_add_geofence(int geofenceId, double latitude,
+ double longitude, double radius, int lastTransition, int monitorTransitions,
+ int notificationResponsivenes, int unknownTimer);
+
+ private static native boolean native_remove_geofence(int geofenceId);
+
+ private static native boolean native_resume_geofence(int geofenceId, int transitions);
+
+ private static native boolean native_pause_geofence(int geofenceId);
+}
diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/GnssLocationProvider.java
index 756d06b..64750b0 100644
--- a/services/core/java/com/android/server/location/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/GnssLocationProvider.java
@@ -419,6 +419,7 @@
private final LocationChangeListener mFusedLocationListener = new FusedLocationListener();
private final NtpTimeHelper mNtpTimeHelper;
private final GnssBatchingProvider mGnssBatchingProvider;
+ private final GnssGeofenceProvider mGnssGeofenceProvider;
// Handler for processing events
private Handler mHandler;
@@ -493,7 +494,7 @@
}
public IGpsGeofenceHardware getGpsGeofenceProxy() {
- return mGpsGeofenceBinder;
+ return mGnssGeofenceProvider;
}
public GnssMeasurementsProvider getGnssMeasurementsProvider() {
@@ -817,37 +818,7 @@
}
};
- mGnssMeasurementsProvider = new GnssMeasurementsProvider(mHandler) {
- @Override
- public boolean isAvailableInPlatform() {
- return native_is_measurement_supported();
- }
-
- @Override
- protected int registerWithService() {
- int devOptions = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0);
- int fullTrackingToggled = Settings.Global.getInt(mContext.getContentResolver(),
- Settings.Global.ENABLE_GNSS_RAW_MEAS_FULL_TRACKING , 0);
- boolean result = false;
- if (devOptions == 1 /* Developer Mode enabled */
- && fullTrackingToggled == 1 /* Raw Measurements Full Tracking enabled */) {
- result = native_start_measurement_collection(true /* enableFullTracking */);
- } else {
- result = native_start_measurement_collection(false /* enableFullTracking */);
- }
- if (result) {
- return RemoteListenerHelper.RESULT_SUCCESS;
- } else {
- return RemoteListenerHelper.RESULT_INTERNAL_ERROR;
- }
- }
-
- @Override
- protected void unregisterFromService() {
- native_stop_measurement_collection();
- }
-
+ mGnssMeasurementsProvider = new GnssMeasurementsProvider(mContext, mHandler) {
@Override
protected boolean isGpsEnabled() {
return isEnabled();
@@ -856,26 +827,6 @@
mGnssNavigationMessageProvider = new GnssNavigationMessageProvider(mHandler) {
@Override
- protected boolean isAvailableInPlatform() {
- return native_is_navigation_message_supported();
- }
-
- @Override
- protected int registerWithService() {
- boolean result = native_start_navigation_message_collection();
- if (result) {
- return RemoteListenerHelper.RESULT_SUCCESS;
- } else {
- return RemoteListenerHelper.RESULT_INTERNAL_ERROR;
- }
- }
-
- @Override
- protected void unregisterFromService() {
- native_stop_navigation_message_collection();
- }
-
- @Override
protected boolean isGpsEnabled() {
return isEnabled();
}
@@ -887,6 +838,7 @@
looper, this);
mHandler.post(mGnssSatelliteBlacklistHelper::updateSatelliteBlacklist);
mGnssBatchingProvider = new GnssBatchingProvider();
+ mGnssGeofenceProvider = new GnssGeofenceProvider(looper);
}
/**
@@ -1030,7 +982,7 @@
Log.e(TAG, "Invalid status to release SUPL connection: " + agpsDataConnStatus);
}
}
-
+
private void handleRequestLocation(boolean independentFromGnss) {
if (isRequestLocationRateLimited()) {
if (DEBUG) {
@@ -1501,31 +1453,6 @@
}
}
- private IGpsGeofenceHardware mGpsGeofenceBinder = new IGpsGeofenceHardware.Stub() {
- public boolean isHardwareGeofenceSupported() {
- return native_is_geofence_supported();
- }
-
- public boolean addCircularHardwareGeofence(int geofenceId, double latitude,
- double longitude, double radius, int lastTransition, int monitorTransitions,
- int notificationResponsiveness, int unknownTimer) {
- return native_add_geofence(geofenceId, latitude, longitude, radius,
- lastTransition, monitorTransitions, notificationResponsiveness, unknownTimer);
- }
-
- public boolean removeHardwareGeofence(int geofenceId) {
- return native_remove_geofence(geofenceId);
- }
-
- public boolean pauseHardwareGeofence(int geofenceId) {
- return native_pause_geofence(geofenceId);
- }
-
- public boolean resumeHardwareGeofence(int geofenceId, int monitorTransition) {
- return native_resume_geofence(geofenceId, monitorTransition);
- }
- };
-
private boolean deleteAidingData(Bundle extras) {
int flags;
@@ -2813,33 +2740,6 @@
private native void native_update_network_state(boolean connected, int type,
boolean roaming, boolean available, String extraInfo, String defaultAPN);
- // Hardware Geofence support.
- private static native boolean native_is_geofence_supported();
-
- private static native boolean native_add_geofence(int geofenceId, double latitude,
- double longitude, double radius, int lastTransition, int monitorTransitions,
- int notificationResponsivenes, int unknownTimer);
-
- private static native boolean native_remove_geofence(int geofenceId);
-
- private static native boolean native_resume_geofence(int geofenceId, int transitions);
-
- private static native boolean native_pause_geofence(int geofenceId);
-
- // Gps Hal measurements support.
- private static native boolean native_is_measurement_supported();
-
- private native boolean native_start_measurement_collection(boolean enableFullTracking);
-
- private native boolean native_stop_measurement_collection();
-
- // Gps Navigation message support.
- private static native boolean native_is_navigation_message_supported();
-
- private native boolean native_start_navigation_message_collection();
-
- private native boolean native_stop_navigation_message_collection();
-
// GNSS Configuration
private static native boolean native_set_supl_version(int version);
diff --git a/services/core/java/com/android/server/location/GnssMeasurementsProvider.java b/services/core/java/com/android/server/location/GnssMeasurementsProvider.java
index 477dae6..0add863 100644
--- a/services/core/java/com/android/server/location/GnssMeasurementsProvider.java
+++ b/services/core/java/com/android/server/location/GnssMeasurementsProvider.java
@@ -16,12 +16,16 @@
package com.android.server.location;
+import android.content.Context;
import android.location.GnssMeasurementsEvent;
import android.location.IGnssMeasurementsListener;
import android.os.Handler;
import android.os.RemoteException;
+import android.provider.Settings;
import android.util.Log;
+import com.android.internal.annotations.VisibleForTesting;
+
/**
* An base implementation for GPS measurements provider.
* It abstracts out the responsibility of handling listeners, while still allowing technology
@@ -29,22 +33,73 @@
*
* @hide
*/
-public abstract class GnssMeasurementsProvider
- extends RemoteListenerHelper<IGnssMeasurementsListener> {
+public abstract class GnssMeasurementsProvider extends
+ RemoteListenerHelper<IGnssMeasurementsListener> {
private static final String TAG = "GnssMeasurementsProvider";
+ private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
- protected GnssMeasurementsProvider(Handler handler) {
+ private final Context mContext;
+ private final GnssMeasurementProviderNative mNative;
+
+ private boolean mIsCollectionStarted;
+ private boolean mEnableFullTracking;
+
+ protected GnssMeasurementsProvider(Context context, Handler handler) {
+ this(context, handler, new GnssMeasurementProviderNative());
+ }
+
+ @VisibleForTesting
+ GnssMeasurementsProvider(Context context, Handler handler,
+ GnssMeasurementProviderNative aNative) {
super(handler, TAG);
+ mContext = context;
+ mNative = aNative;
+ }
+
+ // TODO(b/37460011): Use this with death recovery logic.
+ void resumeIfStarted() {
+ if (DEBUG) {
+ Log.d(TAG, "resumeIfStarted");
+ }
+ if (mIsCollectionStarted) {
+ mNative.startMeasurementCollection(mEnableFullTracking);
+ }
+ }
+
+ @Override
+ public boolean isAvailableInPlatform() {
+ return mNative.isMeasurementSupported();
+ }
+
+ @Override
+ protected int registerWithService() {
+ int devOptions = Settings.Secure.getInt(mContext.getContentResolver(),
+ Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0);
+ int fullTrackingToggled = Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.ENABLE_GNSS_RAW_MEAS_FULL_TRACKING, 0);
+ boolean enableFullTracking = (devOptions == 1 /* Developer Mode enabled */)
+ && (fullTrackingToggled == 1 /* Raw Measurements Full Tracking enabled */);
+ boolean result = mNative.startMeasurementCollection(enableFullTracking);
+ if (result) {
+ mIsCollectionStarted = true;
+ mEnableFullTracking = enableFullTracking;
+ return RemoteListenerHelper.RESULT_SUCCESS;
+ } else {
+ return RemoteListenerHelper.RESULT_INTERNAL_ERROR;
+ }
+ }
+
+ @Override
+ protected void unregisterFromService() {
+ boolean stopped = mNative.stopMeasurementCollection();
+ if (stopped) {
+ mIsCollectionStarted = false;
+ }
}
public void onMeasurementsAvailable(final GnssMeasurementsEvent event) {
ListenerOperation<IGnssMeasurementsListener> operation =
- new ListenerOperation<IGnssMeasurementsListener>() {
- @Override
- public void execute(IGnssMeasurementsListener listener) throws RemoteException {
- listener.onGnssMeasurementsReceived(event);
- }
- };
+ listener -> listener.onGnssMeasurementsReceived(event);
foreach(operation);
}
@@ -98,4 +153,25 @@
listener.onStatusChanged(mStatus);
}
}
+
+ @VisibleForTesting
+ static class GnssMeasurementProviderNative {
+ public boolean isMeasurementSupported() {
+ return native_is_measurement_supported();
+ }
+
+ public boolean startMeasurementCollection(boolean enableFullTracking) {
+ return native_start_measurement_collection(enableFullTracking);
+ }
+
+ public boolean stopMeasurementCollection() {
+ return native_stop_measurement_collection();
+ }
+ }
+
+ private static native boolean native_is_measurement_supported();
+
+ private static native boolean native_start_measurement_collection(boolean enableFullTracking);
+
+ private static native boolean native_stop_measurement_collection();
}
diff --git a/services/core/java/com/android/server/location/GnssNavigationMessageProvider.java b/services/core/java/com/android/server/location/GnssNavigationMessageProvider.java
index df3c49b..1b4fd18 100644
--- a/services/core/java/com/android/server/location/GnssNavigationMessageProvider.java
+++ b/services/core/java/com/android/server/location/GnssNavigationMessageProvider.java
@@ -22,6 +22,8 @@
import android.os.RemoteException;
import android.util.Log;
+import com.android.internal.annotations.VisibleForTesting;
+
/**
* An base implementation for GPS navigation messages provider.
* It abstracts out the responsibility of handling listeners, while still allowing technology
@@ -32,9 +34,53 @@
public abstract class GnssNavigationMessageProvider
extends RemoteListenerHelper<IGnssNavigationMessageListener> {
private static final String TAG = "GnssNavigationMessageProvider";
+ private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
+
+ private final GnssNavigationMessageProviderNative mNative;
+ private boolean mCollectionStarted;
protected GnssNavigationMessageProvider(Handler handler) {
+ this(handler, new GnssNavigationMessageProviderNative());
+ }
+
+ @VisibleForTesting
+ GnssNavigationMessageProvider(Handler handler, GnssNavigationMessageProviderNative aNative) {
super(handler, TAG);
+ mNative = aNative;
+ }
+
+ // TODO(b/37460011): Use this with death recovery logic.
+ void resumeIfStarted() {
+ if (DEBUG) {
+ Log.d(TAG, "resumeIfStarted");
+ }
+ if (mCollectionStarted) {
+ mNative.startNavigationMessageCollection();
+ }
+ }
+
+ @Override
+ protected boolean isAvailableInPlatform() {
+ return mNative.isNavigationMessageSupported();
+ }
+
+ @Override
+ protected int registerWithService() {
+ boolean result = mNative.startNavigationMessageCollection();
+ if (result) {
+ mCollectionStarted = true;
+ return RemoteListenerHelper.RESULT_SUCCESS;
+ } else {
+ return RemoteListenerHelper.RESULT_INTERNAL_ERROR;
+ }
+ }
+
+ @Override
+ protected void unregisterFromService() {
+ boolean stopped = mNative.stopNavigationMessageCollection();
+ if (stopped) {
+ mCollectionStarted = false;
+ }
}
public void onNavigationMessageAvailable(final GnssNavigationMessage event) {
@@ -96,4 +142,25 @@
listener.onStatusChanged(mStatus);
}
}
+
+ @VisibleForTesting
+ static class GnssNavigationMessageProviderNative {
+ public boolean isNavigationMessageSupported() {
+ return native_is_navigation_message_supported();
+ }
+
+ public boolean startNavigationMessageCollection() {
+ return native_start_navigation_message_collection();
+ }
+
+ public boolean stopNavigationMessageCollection() {
+ return native_stop_navigation_message_collection();
+ }
+ }
+
+ private static native boolean native_is_navigation_message_supported();
+
+ private static native boolean native_start_navigation_message_collection();
+
+ private static native boolean native_stop_navigation_message_collection();
}
diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java
index 269a0da..f7becd5 100644
--- a/services/core/java/com/android/server/notification/ManagedServices.java
+++ b/services/core/java/com/android/server/notification/ManagedServices.java
@@ -72,6 +72,8 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import java.util.function.Predicate;
+import java.util.stream.Collectors;
/**
* Manages the lifecycle of application-provided services bound by system server.
@@ -336,7 +338,7 @@
loadAllowedComponentsFromSettings();
}
- public void readXml(XmlPullParser parser)
+ public void readXml(XmlPullParser parser, Predicate<String> allowedManagedServicePackages)
throws XmlPullParserException, IOException {
// upgrade xml
int xmlVersion = XmlUtils.readIntAttribute(parser, ATT_VERSION, 0);
@@ -361,10 +363,14 @@
final int userId = XmlUtils.readIntAttribute(parser, ATT_USER_ID, 0);
final boolean isPrimary =
XmlUtils.readBooleanAttribute(parser, ATT_IS_PRIMARY, true);
- if (mUm.getUserInfo(userId) != null) {
- addApprovedList(approved, userId, isPrimary);
+
+ if (allowedManagedServicePackages == null ||
+ allowedManagedServicePackages.test(getPackageName(approved))) {
+ if (mUm.getUserInfo(userId) != null) {
+ addApprovedList(approved, userId, isPrimary);
+ }
+ mUseXml = true;
}
- mUseXml = true;
}
}
}
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 5948864..ec3949f 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -233,6 +233,7 @@
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit;
+import java.util.function.Predicate;
/** {@hide} */
public class NotificationManagerService extends SystemService {
@@ -397,6 +398,7 @@
private boolean mIsTelevision;
private MetricsLogger mMetricsLogger;
+ private Predicate<String> mAllowedManagedServicePackages;
private static class Archive {
final int mBufferSize;
@@ -518,18 +520,15 @@
} else if (RankingHelper.TAG_RANKING.equals(parser.getName())){
mRankingHelper.readXml(parser, forRestore);
}
- // No non-system managed services are allowed on low ram devices
- if (canUseManagedServices()) {
- if (mListeners.getConfig().xmlTag.equals(parser.getName())) {
- mListeners.readXml(parser);
- migratedManagedServices = true;
- } else if (mAssistants.getConfig().xmlTag.equals(parser.getName())) {
- mAssistants.readXml(parser);
- migratedManagedServices = true;
- } else if (mConditionProviders.getConfig().xmlTag.equals(parser.getName())) {
- mConditionProviders.readXml(parser);
- migratedManagedServices = true;
- }
+ if (mListeners.getConfig().xmlTag.equals(parser.getName())) {
+ mListeners.readXml(parser, mAllowedManagedServicePackages);
+ migratedManagedServices = true;
+ } else if (mAssistants.getConfig().xmlTag.equals(parser.getName())) {
+ mAssistants.readXml(parser, mAllowedManagedServicePackages);
+ migratedManagedServices = true;
+ } else if (mConditionProviders.getConfig().xmlTag.equals(parser.getName())) {
+ mConditionProviders.readXml(parser, mAllowedManagedServicePackages);
+ migratedManagedServices = true;
}
}
@@ -1429,6 +1428,9 @@
// This is a MangedServices object that keeps track of the assistant.
mAssistants = notificationAssistants;
+ // Needs to be set before loadPolicyFile
+ mAllowedManagedServicePackages = this::canUseManagedServices;
+
mPolicyFile = policyFile;
loadPolicyFile();
@@ -3218,7 +3220,7 @@
checkCallerIsSystemOrShell();
final long identity = Binder.clearCallingIdentity();
try {
- if (canUseManagedServices()) {
+ if (mAllowedManagedServicePackages.test(pkg)) {
mConditionProviders.setPackageOrComponentEnabled(
pkg, userId, true, granted);
@@ -3349,7 +3351,7 @@
checkCallerIsSystemOrShell();
final long identity = Binder.clearCallingIdentity();
try {
- if (canUseManagedServices()) {
+ if (mAllowedManagedServicePackages.test(listener.getPackageName())) {
mConditionProviders.setPackageOrComponentEnabled(listener.flattenToString(),
userId, false, granted);
mListeners.setPackageOrComponentEnabled(listener.flattenToString(),
@@ -3375,7 +3377,7 @@
checkCallerIsSystemOrShell();
final long identity = Binder.clearCallingIdentity();
try {
- if (canUseManagedServices()) {
+ if (mAllowedManagedServicePackages.test(assistant.getPackageName())) {
mConditionProviders.setPackageOrComponentEnabled(assistant.flattenToString(),
userId, false, granted);
mAssistants.setPackageOrComponentEnabled(assistant.flattenToString(),
@@ -6183,9 +6185,19 @@
}
}
- private boolean canUseManagedServices() {
- return !mActivityManager.isLowRamDevice()
+ @VisibleForTesting
+ boolean canUseManagedServices(String pkg) {
+ boolean canUseManagedServices = !mActivityManager.isLowRamDevice()
|| mPackageManagerClient.hasSystemFeature(PackageManager.FEATURE_WATCH);
+
+ for (String whitelisted : getContext().getResources().getStringArray(
+ R.array.config_allowedManagedServicesOnLowRamDevices)) {
+ if (whitelisted.equals(pkg)) {
+ canUseManagedServices = true;
+ }
+ }
+
+ return canUseManagedServices;
}
private class TrimCache {
diff --git a/services/core/java/com/android/server/om/OverlayManagerService.java b/services/core/java/com/android/server/om/OverlayManagerService.java
index fd51be5..3b8a994 100644
--- a/services/core/java/com/android/server/om/OverlayManagerService.java
+++ b/services/core/java/com/android/server/om/OverlayManagerService.java
@@ -694,25 +694,32 @@
private final class OverlayChangeListener
implements OverlayManagerServiceImpl.OverlayChangeListener {
@Override
- public void onOverlaysChanged(@NonNull final String targetPackageName, final int userId) {
+ public void onChanged(@NonNull final String targetPackageName, final int userId,
+ boolean targetChanged, boolean overlayChanged) {
schedulePersistSettings();
FgThread.getHandler().post(() -> {
- updateAssets(userId, targetPackageName);
-
- final Intent intent = new Intent(Intent.ACTION_OVERLAY_CHANGED,
- Uri.fromParts("package", targetPackageName, null));
- intent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
-
- if (DEBUG) {
- Slog.d(TAG, "send broadcast " + intent);
+ // Update the targets' overlays if a change to the target or an overlay occurs
+ if (targetChanged || overlayChanged) {
+ updateAssets(userId, targetPackageName);
}
- try {
- ActivityManager.getService().broadcastIntent(null, intent, null, null, 0,
- null, null, null, android.app.AppOpsManager.OP_NONE, null, false, false,
- userId);
- } catch (RemoteException e) {
- // Intentionally left empty.
+ // Create the broadcast if the overlay changes
+ if (overlayChanged) {
+ final Intent intent = new Intent(Intent.ACTION_OVERLAY_CHANGED,
+ Uri.fromParts("package", targetPackageName, null));
+ intent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
+
+ if (DEBUG) {
+ Slog.d(TAG, "send broadcast " + intent);
+ }
+
+ try {
+ ActivityManager.getService().broadcastIntent(null, intent, null, null, 0,
+ null, null, null, android.app.AppOpsManager.OP_NONE, null, false,
+ false, userId);
+ } catch (RemoteException e) {
+ // Intentionally left empty.
+ }
}
});
}
diff --git a/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java b/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java
index 74eb2ea..a487ae9 100644
--- a/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java
+++ b/services/core/java/com/android/server/om/OverlayManagerServiceImpl.java
@@ -207,9 +207,7 @@
Slog.d(TAG, "onTargetPackageAdded packageName=" + packageName + " userId=" + userId);
}
- if (updateAllOverlaysForTarget(packageName, userId, 0)) {
- mListener.onOverlaysChanged(packageName, userId);
- }
+ updateAllOverlaysForTarget(packageName, userId, 0);
}
void onTargetPackageChanged(@NonNull final String packageName, final int userId) {
@@ -217,9 +215,7 @@
Slog.d(TAG, "onTargetPackageChanged packageName=" + packageName + " userId=" + userId);
}
- if (updateAllOverlaysForTarget(packageName, userId, 0)) {
- mListener.onOverlaysChanged(packageName, userId);
- }
+ updateAllOverlaysForTarget(packageName, userId, 0);
}
void onTargetPackageUpgrading(@NonNull final String packageName, final int userId) {
@@ -228,9 +224,7 @@
+ userId);
}
- if (updateAllOverlaysForTarget(packageName, userId, FLAG_TARGET_IS_UPGRADING)) {
- mListener.onOverlaysChanged(packageName, userId);
- }
+ updateAllOverlaysForTarget(packageName, userId, FLAG_TARGET_IS_UPGRADING);
}
void onTargetPackageUpgraded(@NonNull final String packageName, final int userId) {
@@ -238,9 +232,7 @@
Slog.d(TAG, "onTargetPackageUpgraded packageName=" + packageName + " userId=" + userId);
}
- if (updateAllOverlaysForTarget(packageName, userId, 0)) {
- mListener.onOverlaysChanged(packageName, userId);
- }
+ updateAllOverlaysForTarget(packageName, userId, 0);
}
void onTargetPackageRemoved(@NonNull final String packageName, final int userId) {
@@ -248,17 +240,17 @@
Slog.d(TAG, "onTargetPackageRemoved packageName=" + packageName + " userId=" + userId);
}
- if (updateAllOverlaysForTarget(packageName, userId, 0)) {
- mListener.onOverlaysChanged(packageName, userId);
- }
+ updateAllOverlaysForTarget(packageName, userId, 0);
}
/**
- * Returns true if the settings were modified for this target.
+ * Calls OverlayChangeListener#onChanged if the settings for the overlay target were modified,
+ * and calls OverlayChangeListener#onTargetChanged to signal a change in the target package that
+ * requires updating target overlays.
*/
- private boolean updateAllOverlaysForTarget(@NonNull final String targetPackageName,
+ private void updateAllOverlaysForTarget(@NonNull final String targetPackageName,
final int userId, final int flags) {
- boolean modified = false;
+ boolean overlayModified = false;
final List<OverlayInfo> ois = mSettings.getOverlaysForTarget(targetPackageName, userId);
final int N = ois.size();
for (int i = 0; i < N; i++) {
@@ -266,18 +258,19 @@
final PackageInfo overlayPackage = mPackageManager.getPackageInfo(oi.packageName,
userId);
if (overlayPackage == null) {
- modified |= mSettings.remove(oi.packageName, oi.userId);
+ overlayModified |= mSettings.remove(oi.packageName, oi.userId);
removeIdmapIfPossible(oi);
} else {
try {
- modified |= updateState(targetPackageName, oi.packageName, userId, flags);
+ overlayModified |= updateState(targetPackageName, oi.packageName, userId, flags);
} catch (OverlayManagerSettings.BadKeyException e) {
Slog.e(TAG, "failed to update settings", e);
- modified |= mSettings.remove(oi.packageName, userId);
+ overlayModified |= mSettings.remove(oi.packageName, userId);
}
}
}
- return modified;
+
+ mListener.onChanged(targetPackageName, userId, /* targetChanged */ true, overlayModified);
}
void onOverlayPackageAdded(@NonNull final String packageName, final int userId) {
@@ -298,7 +291,8 @@
overlayPackage.overlayCategory);
try {
if (updateState(overlayPackage.overlayTarget, packageName, userId, 0)) {
- mListener.onOverlaysChanged(overlayPackage.overlayTarget, userId);
+ mListener.onChanged(overlayPackage.overlayTarget, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
} catch (OverlayManagerSettings.BadKeyException e) {
Slog.e(TAG, "failed to update settings", e);
@@ -314,7 +308,8 @@
try {
final OverlayInfo oi = mSettings.getOverlayInfo(packageName, userId);
if (updateState(oi.targetPackageName, packageName, userId, 0)) {
- mListener.onOverlaysChanged(oi.targetPackageName, userId);
+ mListener.onChanged(oi.targetPackageName, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
} catch (OverlayManagerSettings.BadKeyException e) {
Slog.e(TAG, "failed to update settings", e);
@@ -331,7 +326,8 @@
final OverlayInfo oi = mSettings.getOverlayInfo(packageName, userId);
if (updateState(oi.targetPackageName, packageName, userId, FLAG_OVERLAY_IS_UPGRADING)) {
removeIdmapIfPossible(oi);
- mListener.onOverlaysChanged(oi.targetPackageName, userId);
+ mListener.onChanged(oi.targetPackageName, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
} catch (OverlayManagerSettings.BadKeyException e) {
Slog.e(TAG, "failed to update settings", e);
@@ -365,7 +361,8 @@
}
if (updateState(pkg.overlayTarget, packageName, userId, 0)) {
- mListener.onOverlaysChanged(pkg.overlayTarget, userId);
+ mListener.onChanged(pkg.overlayTarget, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
} catch (OverlayManagerSettings.BadKeyException e) {
Slog.e(TAG, "failed to update settings", e);
@@ -379,7 +376,8 @@
removeIdmapIfPossible(overlayInfo);
if (overlayInfo.isEnabled()) {
// Only trigger updates if the overlay was enabled.
- mListener.onOverlaysChanged(overlayInfo.targetPackageName, userId);
+ mListener.onChanged(overlayInfo.targetPackageName, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
}
} catch (OverlayManagerSettings.BadKeyException e) {
@@ -427,7 +425,8 @@
modified |= updateState(oi.targetPackageName, oi.packageName, userId, 0);
if (modified) {
- mListener.onOverlaysChanged(oi.targetPackageName, userId);
+ mListener.onChanged(oi.targetPackageName, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
return true;
} catch (OverlayManagerSettings.BadKeyException e) {
@@ -486,7 +485,8 @@
modified |= updateState(targetPackageName, packageName, userId, 0);
if (modified) {
- mListener.onOverlaysChanged(targetPackageName, userId);
+ mListener.onChanged(targetPackageName, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
return true;
} catch (OverlayManagerSettings.BadKeyException e) {
@@ -519,7 +519,8 @@
}
if (mSettings.setPriority(packageName, newParentPackageName, userId)) {
- mListener.onOverlaysChanged(overlayPackage.overlayTarget, userId);
+ mListener.onChanged(overlayPackage.overlayTarget, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
return true;
}
@@ -539,7 +540,8 @@
}
if (mSettings.setHighestPriority(packageName, userId)) {
- mListener.onOverlaysChanged(overlayPackage.overlayTarget, userId);
+ mListener.onChanged(overlayPackage.overlayTarget, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
return true;
}
@@ -559,7 +561,8 @@
}
if (mSettings.setLowestPriority(packageName, userId)) {
- mListener.onOverlaysChanged(overlayPackage.overlayTarget, userId);
+ mListener.onChanged(overlayPackage.overlayTarget, userId,
+ /* targetChanged */ false, /* overlayChanged */ true);
}
return true;
}
@@ -690,7 +693,8 @@
}
interface OverlayChangeListener {
- void onOverlaysChanged(@NonNull String targetPackage, int userId);
+ void onChanged(@NonNull String targetPackage, int userId,
+ boolean targetChanged, boolean overlayChanged);
}
interface PackageManagerHelper {
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 50eaa5c..bb1f5c0 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -4223,6 +4223,11 @@
|| appId == Process.ROOT_UID) {
return false;
}
+ // Installer gets to see all static libs.
+ if (PackageManager.PERMISSION_GRANTED
+ == checkUidPermission(Manifest.permission.INSTALL_PACKAGES, uid)) {
+ return false;
+ }
}
// No package means no static lib as it is always on internal storage
diff --git a/services/core/java/com/android/server/slice/SliceManagerService.java b/services/core/java/com/android/server/slice/SliceManagerService.java
index a9cdafd..507f0a8 100644
--- a/services/core/java/com/android/server/slice/SliceManagerService.java
+++ b/services/core/java/com/android/server/slice/SliceManagerService.java
@@ -155,11 +155,10 @@
enforceAccess(pkg, uri);
int user = Binder.getCallingUserHandle().getIdentifier();
uri = maybeAddUserId(uri, user);
- getOrCreatePinnedSlice(uri, pkg).pin(pkg, specs, token);
+ String slicePkg = getProviderPkg(uri, user);
+ getOrCreatePinnedSlice(uri, slicePkg).pin(pkg, specs, token);
- Uri finalUri = uri;
mHandler.post(() -> {
- String slicePkg = getProviderPkg(finalUri, user);
if (slicePkg != null && !Objects.equals(pkg, slicePkg)) {
mAppUsageStats.reportEvent(slicePkg, user,
isAssistant(pkg, user) || isDefaultHomeApp(pkg, user)
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index c761754..2f174c2 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -984,6 +984,7 @@
(height - thumbnailSize) / 2,
(width + thumbnailSize) / 2,
(height + thumbnailSize) / 2);
+ drawable.setTint(mContext.getColor(android.R.color.white));
drawable.draw(canvas);
picture.endRecording();
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index a701d42..a9560e6 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -1984,7 +1984,7 @@
final Rect frame = win.mFrame;
final int thumbnailDrawableRes = getTask().mUserId == mService.mCurrentUserId
? R.drawable.ic_account_circle
- : R.drawable.ic_corp_badge_no_background;
+ : R.drawable.ic_corp_badge;
final GraphicBuffer thumbnail =
mService.mAppTransition
.createCrossProfileAppsThumbnail(thumbnailDrawableRes, frame);
diff --git a/services/core/java/com/android/server/wm/BoundsAnimationController.java b/services/core/java/com/android/server/wm/BoundsAnimationController.java
index 112d93c..b2a12be 100644
--- a/services/core/java/com/android/server/wm/BoundsAnimationController.java
+++ b/services/core/java/com/android/server/wm/BoundsAnimationController.java
@@ -401,12 +401,13 @@
+ " replacing=" + replacing);
if (replacing) {
- if (existing.isAnimatingTo(to)) {
+ if (existing.isAnimatingTo(to) && (!moveToFullscreen || existing.mMoveToFullscreen)
+ && (!moveFromFullscreen || existing.mMoveFromFullscreen)) {
// Just let the current animation complete if it has the same destination as the
- // one we are trying to start.
- if (DEBUG) Slog.d(TAG, "animateBounds: same destination as existing=" + existing
- + " ignoring...");
-
+ // one we are trying to start, and, if moveTo/FromFullscreen was requested, already
+ // has that flag set.
+ if (DEBUG) Slog.d(TAG, "animateBounds: same destination and moveTo/From flags as "
+ + "existing=" + existing + ", ignoring...");
return existing;
}
@@ -434,6 +435,13 @@
}
}
+ // We need to keep the previous moveTo/FromFullscreen flag, unless the new animation
+ // specifies a direction.
+ if (!moveFromFullscreen && !moveToFullscreen) {
+ moveToFullscreen = existing.mMoveToFullscreen;
+ moveFromFullscreen = existing.mMoveFromFullscreen;
+ }
+
// Since we are replacing, we skip both animation start and end callbacks
existing.cancel();
}
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 4fd31ff..38fb30e 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -3906,7 +3906,7 @@
* with {@link #WindowState#assignLayer}
*/
void assignRelativeLayerForImeTargetChild(SurfaceControl.Transaction t, WindowContainer child) {
- t.setRelativeLayer(child.getSurfaceControl(), mImeWindowsContainers.getSurfaceControl(), 1);
+ child.assignRelativeLayer(t, mImeWindowsContainers.getSurfaceControl(), 1);
}
@Override
diff --git a/services/core/java/com/android/server/wm/OWNERS b/services/core/java/com/android/server/wm/OWNERS
new file mode 100644
index 0000000..fff42c5
--- /dev/null
+++ b/services/core/java/com/android/server/wm/OWNERS
@@ -0,0 +1,7 @@
+ogunwale@google.com
+jjaggi@google.com
+racarr@google.com
+chaviw@google.com
+brycelee@google.com
+akulian@google.com
+roosa@google.com
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index b057b1d..85e4ac7 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -83,9 +83,8 @@
private final RecentsAnimationCallbacks mCallbacks;
private final ArrayList<TaskAnimationAdapter> mPendingAnimations = new ArrayList<>();
private final int mDisplayId;
- private final Runnable mFailsafeRunnable = () -> {
- cancelAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION, "failSafeRunnable");
- };
+ private final Runnable mFailsafeRunnable = () ->
+ cancelAnimation(REORDER_MOVE_TO_ORIGINAL_POSITION, "failSafeRunnable");
// The recents component app token that is shown behind the visibile tasks
private AppWindowToken mTargetAppToken;
@@ -112,7 +111,7 @@
private boolean mLinkedToDeathOfRunner;
public interface RecentsAnimationCallbacks {
- void onAnimationFinished(@ReorderMode int reorderMode);
+ void onAnimationFinished(@ReorderMode int reorderMode, boolean runSychronously);
}
private final IRecentsAnimationController mController =
@@ -164,7 +163,8 @@
// prior to calling the callback
mCallbacks.onAnimationFinished(moveHomeToTop
? REORDER_MOVE_TO_TOP
- : REORDER_MOVE_TO_ORIGINAL_POSITION);
+ : REORDER_MOVE_TO_ORIGINAL_POSITION,
+ true /* runSynchronously */);
} finally {
Binder.restoreCallingIdentity(token);
}
@@ -385,7 +385,17 @@
}
void cancelAnimation(@ReorderMode int reorderMode, String reason) {
- if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "cancelAnimation(): reason=" + reason);
+ cancelAnimation(reorderMode, false /* runSynchronously */, reason);
+ }
+
+ void cancelAnimationSynchronously(@ReorderMode int reorderMode, String reason) {
+ cancelAnimation(reorderMode, true /* runSynchronously */, reason);
+ }
+
+ private void cancelAnimation(@ReorderMode int reorderMode, boolean runSynchronously,
+ String reason) {
+ if (DEBUG_RECENTS_ANIMATIONS) Slog.d(TAG, "cancelAnimation(): reason=" + reason
+ + " runSynchronously=" + runSynchronously);
synchronized (mService.getWindowManagerLock()) {
if (mCanceled) {
// We've already canceled the animation
@@ -401,8 +411,7 @@
}
// Clean up and return to the previous app
- // Don't hold the WM lock here as it calls back to AM/RecentsAnimation
- mCallbacks.onAnimationFinished(reorderMode);
+ mCallbacks.onAnimationFinished(reorderMode, runSynchronously);
}
void cleanupAnimation(@ReorderMode int reorderMode) {
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index fd965fb..50d0d0a 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -692,6 +692,7 @@
wallpaperDestroyed = true;
}
win.destroySurfaceUnchecked();
+ win.mWinAnimator.destroyPreservedSurfaceLocked();
} while (i > 0);
mService.mDestroySurface.clear();
}
diff --git a/services/core/java/com/android/server/wm/StackWindowController.java b/services/core/java/com/android/server/wm/StackWindowController.java
index ddb67b4..653850a 100644
--- a/services/core/java/com/android/server/wm/StackWindowController.java
+++ b/services/core/java/com/android/server/wm/StackWindowController.java
@@ -16,6 +16,7 @@
package com.android.server.wm;
+import android.app.WindowConfiguration;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.os.Handler;
@@ -244,12 +245,15 @@
}
/**
- * Adjusts the screen size in dp's for the {@param config} for the given params.
+ * Adjusts the screen size in dp's for the {@param config} for the given params. The provided
+ * params represent the desired state of a configuration change. Since this utility is used
+ * before mContainer has been updated, any relevant properties (like {@param windowingMode})
+ * need to be passed in.
*/
public void adjustConfigurationForBounds(Rect bounds, Rect insetBounds,
Rect nonDecorBounds, Rect stableBounds, boolean overrideWidth,
boolean overrideHeight, float density, Configuration config,
- Configuration parentConfig) {
+ Configuration parentConfig, int windowingMode) {
synchronized (mWindowMap) {
final TaskStack stack = mContainer;
final DisplayContent displayContent = stack.getDisplayContent();
@@ -272,10 +276,10 @@
config.windowConfiguration.setAppBounds(!bounds.isEmpty() ? bounds : null);
boolean intersectParentBounds = false;
- if (stack.getWindowConfiguration().tasksAreFloating()) {
+ if (WindowConfiguration.isFloating(windowingMode)) {
// Floating tasks should not be resized to the screen's bounds.
- if (stack.inPinnedWindowingMode()
+ if (windowingMode == WindowConfiguration.WINDOWING_MODE_PINNED
&& bounds.width() == mTmpDisplayBounds.width()
&& bounds.height() == mTmpDisplayBounds.height()) {
// If the bounds we are animating is the same as the fullscreen stack
@@ -316,7 +320,7 @@
config.screenWidthDp = width;
config.screenHeightDp = height;
config.smallestScreenWidthDp = getSmallestWidthForTaskBounds(
- insetBounds != null ? insetBounds : bounds, density);
+ insetBounds != null ? insetBounds : bounds, density, windowingMode);
}
}
@@ -338,11 +342,12 @@
}
/**
- * Calculates the smallest width for a task given the {@param bounds}.
+ * Calculates the smallest width for a task given the target {@param bounds} and
+ * {@param windowingMode}. Avoid using values from mContainer since they can be out-of-date.
*
* @return the smallest width to be used in the Configuration, in dips
*/
- private int getSmallestWidthForTaskBounds(Rect bounds, float density) {
+ private int getSmallestWidthForTaskBounds(Rect bounds, float density, int windowingMode) {
final DisplayContent displayContent = mContainer.getDisplayContent();
final DisplayInfo displayInfo = displayContent.getDisplayInfo();
@@ -350,7 +355,7 @@
bounds.height() == displayInfo.logicalHeight)) {
// If the bounds are fullscreen, return the value of the fullscreen configuration
return displayContent.getConfiguration().smallestScreenWidthDp;
- } else if (mContainer.getWindowConfiguration().tasksAreFloating()) {
+ } else if (WindowConfiguration.isFloating(windowingMode)) {
// For floating tasks, calculate the smallest width from the bounds of the task
return (int) (Math.min(bounds.width(), bounds.height()) / density);
} else {
diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java
index eab391e..19c5a3d 100644
--- a/services/core/java/com/android/server/wm/WindowContainer.java
+++ b/services/core/java/com/android/server/wm/WindowContainer.java
@@ -922,6 +922,10 @@
* @return Whether this WindowContainer should be magnified by the accessibility magnifier.
*/
boolean shouldMagnify() {
+ if (mSurfaceControl == null) {
+ return false;
+ }
+
for (int i = 0; i < mChildren.size(); i++) {
if (!mChildren.get(i).shouldMagnify()) {
return false;
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 06e8d47..10dfdf2 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -2732,17 +2732,15 @@
/**
* Cancels any running recents animation. The caller should NOT hold the WM lock while calling
- * this method, as it can call back into AM, and locking will be done in the animation
- * controller itself.
+ * this method, as it will call back into AM and may cause a deadlock. Any locking will be done
+ * in the animation controller itself.
*/
- public void cancelRecentsAnimation(@RecentsAnimationController.ReorderMode int reorderMode,
- String reason) {
- // Note: Do not hold the WM lock, this will lock appropriately in the call which also
- // calls through to AM/RecentsAnimation.onAnimationFinished()
+ public void cancelRecentsAnimationSynchronously(
+ @RecentsAnimationController.ReorderMode int reorderMode, String reason) {
if (mRecentsAnimationController != null) {
// This call will call through to cleanupAnimation() below after the animation is
// canceled
- mRecentsAnimationController.cancelAnimation(reorderMode, reason);
+ mRecentsAnimationController.cancelAnimationSynchronously(reorderMode, reason);
}
}
@@ -7491,7 +7489,7 @@
boolean hasWideColorGamutSupport() {
return mHasWideColorGamutSupport &&
- !SystemProperties.getBoolean("persist.sys.sf.native_mode", false);
+ SystemProperties.getInt("persist.sys.sf.native_mode", 0) != 1;
}
void updateNonSystemOverlayWindowsVisibilityIfNeeded(WindowState win, boolean surfaceShown) {
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 6c2821d..86aed47 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -3865,9 +3865,13 @@
windowInfo.title = mAttrs.accessibilityTitle;
// Panel windows have no public way to set the a11y title directly. Use the
// regular title as a fallback.
- if (TextUtils.isEmpty(windowInfo.title)
- && (mAttrs.type >= WindowManager.LayoutParams.FIRST_SUB_WINDOW)
- && (mAttrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW)) {
+ final boolean isPanelWindow = (mAttrs.type >= WindowManager.LayoutParams.FIRST_SUB_WINDOW)
+ && (mAttrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW);
+ // Accessibility overlays should have titles that work for accessibility, and can't set
+ // the a11y title themselves.
+ final boolean isAccessibilityOverlay =
+ windowInfo.type == WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY;
+ if (TextUtils.isEmpty(windowInfo.title) && (isPanelWindow || isAccessibilityOverlay)) {
windowInfo.title = mAttrs.getTitle();
}
windowInfo.accessibilityIdOfAnchor = mAttrs.accessibilityIdOfAnchor;
@@ -4270,6 +4274,24 @@
}
}
+ private boolean skipDecorCrop() {
+ // The decor frame is used to specify the region not covered by the system
+ // decorations (nav bar, status bar). In case this is empty, for example with
+ // FLAG_TRANSLUCENT_NAVIGATION, we don't need to do any cropping.
+ if (mDecorFrame.isEmpty()) {
+ return true;
+ }
+
+ // But if we have a frame, and are an application window, then we must be cropped.
+ if (mAppToken != null) {
+ return false;
+ }
+
+ // For non application windows, we may be allowed to extend over the decor bars
+ // depending on our type and permissions assosciated with our token.
+ return mToken.canLayerAboveSystemBars();
+ }
+
/**
* Calculate the window crop according to system decor policy. In general this is
* the system decor rect (see #calculateSystemDecorRect), but we also have some
@@ -4287,7 +4309,7 @@
policyCrop.intersect(-mCompatFrame.left, -mCompatFrame.top,
displayInfo.logicalWidth - mCompatFrame.left,
displayInfo.logicalHeight - mCompatFrame.top);
- } else if (mDecorFrame.isEmpty()) {
+ } else if (skipDecorCrop()) {
// Windows without policy decor aren't cropped.
policyCrop.set(0, 0, mCompatFrame.width(), mCompatFrame.height());
} else {
diff --git a/services/core/java/com/android/server/wm/WindowToken.java b/services/core/java/com/android/server/wm/WindowToken.java
index 14680d9..b97460a 100644
--- a/services/core/java/com/android/server/wm/WindowToken.java
+++ b/services/core/java/com/android/server/wm/WindowToken.java
@@ -17,7 +17,7 @@
package com.android.server.wm;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
-
+import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ADD_REMOVE;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_FOCUS;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_WINDOW_MOVEMENT;
@@ -336,4 +336,16 @@
boolean okToAnimate() {
return mDisplayContent != null && mDisplayContent.okToAnimate();
}
+
+ /**
+ * Return whether windows from this token can layer above the
+ * system bars, or in other words extend outside of the "Decor Frame"
+ */
+ boolean canLayerAboveSystemBars() {
+ int layer = mService.mPolicy.getWindowLayerFromTypeLw(windowType,
+ mOwnerCanManageAppTokens);
+ int navLayer = mService.mPolicy.getWindowLayerFromTypeLw(TYPE_NAVIGATION_BAR,
+ mOwnerCanManageAppTokens);
+ return mOwnerCanManageAppTokens && (layer > navLayer);
+ }
}
diff --git a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
index 92ef9f1..a3a7e1e 100644
--- a/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
+++ b/services/core/jni/com_android_server_location_GnssLocationProvider.cpp
@@ -1745,12 +1745,12 @@
}
}
-static jboolean android_location_GnssLocationProvider_is_geofence_supported(
+static jboolean android_location_GnssGeofenceProvider_is_geofence_supported(
JNIEnv* /* env */, jobject /* obj */) {
return (gnssGeofencingIface != nullptr) ? JNI_TRUE : JNI_FALSE;
}
-static jboolean android_location_GnssLocationProvider_add_geofence(JNIEnv* /* env */,
+static jboolean android_location_GnssGeofenceProvider_add_geofence(JNIEnv* /* env */,
jobject /* obj */, jint geofenceId, jdouble latitude, jdouble longitude, jdouble radius,
jint last_transition, jint monitor_transition, jint notification_responsiveness,
jint unknown_timer) {
@@ -1766,7 +1766,7 @@
return JNI_FALSE;
}
-static jboolean android_location_GnssLocationProvider_remove_geofence(JNIEnv* /* env */,
+static jboolean android_location_GnssGeofenceProvider_remove_geofence(JNIEnv* /* env */,
jobject /* obj */, jint geofenceId) {
if (gnssGeofencingIface != nullptr) {
auto result = gnssGeofencingIface->removeGeofence(geofenceId);
@@ -1777,7 +1777,7 @@
return JNI_FALSE;
}
-static jboolean android_location_GnssLocationProvider_pause_geofence(JNIEnv* /* env */,
+static jboolean android_location_GnssGeofenceProvider_pause_geofence(JNIEnv* /* env */,
jobject /* obj */, jint geofenceId) {
if (gnssGeofencingIface != nullptr) {
auto result = gnssGeofencingIface->pauseGeofence(geofenceId);
@@ -1788,7 +1788,7 @@
return JNI_FALSE;
}
-static jboolean android_location_GnssLocationProvider_resume_geofence(JNIEnv* /* env */,
+static jboolean android_location_GnssGeofenceProvider_resume_geofence(JNIEnv* /* env */,
jobject /* obj */, jint geofenceId, jint monitor_transition) {
if (gnssGeofencingIface != nullptr) {
auto result = gnssGeofencingIface->resumeGeofence(geofenceId, monitor_transition);
@@ -1799,7 +1799,7 @@
return JNI_FALSE;
}
-static jboolean android_location_GnssLocationProvider_is_measurement_supported(
+static jboolean android_location_GnssMeasurementsProvider_is_measurement_supported(
JNIEnv* env, jclass clazz) {
if (gnssMeasurementIface != nullptr) {
return JNI_TRUE;
@@ -1808,7 +1808,7 @@
return JNI_FALSE;
}
-static jboolean android_location_GnssLocationProvider_start_measurement_collection(
+static jboolean android_location_GnssMeasurementsProvider_start_measurement_collection(
JNIEnv* /* env */,
jobject /* obj */,
jboolean enableFullTracking) {
@@ -1842,7 +1842,7 @@
return JNI_TRUE;
}
-static jboolean android_location_GnssLocationProvider_stop_measurement_collection(
+static jboolean android_location_GnssMeasurementsProvider_stop_measurement_collection(
JNIEnv* env,
jobject obj) {
if (gnssMeasurementIface == nullptr) {
@@ -1854,7 +1854,7 @@
return boolToJbool(result.isOk());
}
-static jboolean android_location_GnssLocationProvider_is_navigation_message_supported(
+static jboolean android_location_GnssNavigationMessageProvider_is_navigation_message_supported(
JNIEnv* env,
jclass clazz) {
if (gnssNavigationMessageIface != nullptr) {
@@ -1863,7 +1863,7 @@
return JNI_FALSE;
}
-static jboolean android_location_GnssLocationProvider_start_navigation_message_collection(
+static jboolean android_location_GnssNavigationMessageProvider_start_navigation_message_collection(
JNIEnv* env,
jobject obj) {
if (gnssNavigationMessageIface == nullptr) {
@@ -1884,7 +1884,7 @@
return JNI_TRUE;
}
-static jboolean android_location_GnssLocationProvider_stop_navigation_message_collection(
+static jboolean android_location_GnssNavigationMessageProvider_stop_navigation_message_collection(
JNIEnv* env,
jobject obj) {
if (gnssNavigationMessageIface == nullptr) {
@@ -2178,44 +2178,6 @@
{"native_update_network_state",
"(ZIZZLjava/lang/String;Ljava/lang/String;)V",
reinterpret_cast<void *>(android_location_GnssLocationProvider_update_network_state)},
- {"native_is_geofence_supported",
- "()Z",
- reinterpret_cast<void *>(android_location_GnssLocationProvider_is_geofence_supported)},
- {"native_add_geofence",
- "(IDDDIIII)Z",
- reinterpret_cast<void *>(android_location_GnssLocationProvider_add_geofence)},
- {"native_remove_geofence",
- "(I)Z",
- reinterpret_cast<void *>(android_location_GnssLocationProvider_remove_geofence)},
- {"native_pause_geofence", "(I)Z", reinterpret_cast<void *>(
- android_location_GnssLocationProvider_pause_geofence)},
- {"native_resume_geofence",
- "(II)Z",
- reinterpret_cast<void *>(android_location_GnssLocationProvider_resume_geofence)},
- {"native_is_measurement_supported",
- "()Z",
- reinterpret_cast<void *>(
- android_location_GnssLocationProvider_is_measurement_supported)},
- {"native_start_measurement_collection",
- "(Z)Z",
- reinterpret_cast<void *>(
- android_location_GnssLocationProvider_start_measurement_collection)},
- {"native_stop_measurement_collection",
- "()Z",
- reinterpret_cast<void *>(
- android_location_GnssLocationProvider_stop_measurement_collection)},
- {"native_is_navigation_message_supported",
- "()Z",
- reinterpret_cast<void *>(
- android_location_GnssLocationProvider_is_navigation_message_supported)},
- {"native_start_navigation_message_collection",
- "()Z",
- reinterpret_cast<void *>(
- android_location_GnssLocationProvider_start_navigation_message_collection)},
- {"native_stop_navigation_message_collection",
- "()Z",
- reinterpret_cast<void *>(
- android_location_GnssLocationProvider_stop_navigation_message_collection)},
{"native_set_supl_es",
"(I)Z",
reinterpret_cast<void *>(android_location_GnssLocationProvider_set_supl_es)},
@@ -2265,12 +2227,77 @@
reinterpret_cast<void *>(android_location_GnssBatchingProvider_cleanup_batching)},
};
+static const JNINativeMethod sGeofenceMethods[] = {
+ /* name, signature, funcPtr */
+ {"native_is_geofence_supported",
+ "()Z",
+ reinterpret_cast<void *>(android_location_GnssGeofenceProvider_is_geofence_supported)},
+ {"native_add_geofence",
+ "(IDDDIIII)Z",
+ reinterpret_cast<void *>(android_location_GnssGeofenceProvider_add_geofence)},
+ {"native_remove_geofence",
+ "(I)Z",
+ reinterpret_cast<void *>(android_location_GnssGeofenceProvider_remove_geofence)},
+ {"native_pause_geofence", "(I)Z", reinterpret_cast<void *>(
+ android_location_GnssGeofenceProvider_pause_geofence)},
+ {"native_resume_geofence",
+ "(II)Z",
+ reinterpret_cast<void *>(android_location_GnssGeofenceProvider_resume_geofence)},
+};
+
+static const JNINativeMethod sMeasurementMethods[] = {
+ /* name, signature, funcPtr */
+ {"native_is_measurement_supported",
+ "()Z",
+ reinterpret_cast<void *>(
+ android_location_GnssMeasurementsProvider_is_measurement_supported)},
+ {"native_start_measurement_collection",
+ "(Z)Z",
+ reinterpret_cast<void *>(
+ android_location_GnssMeasurementsProvider_start_measurement_collection)},
+ {"native_stop_measurement_collection",
+ "()Z",
+ reinterpret_cast<void *>(
+ android_location_GnssMeasurementsProvider_stop_measurement_collection)},
+};
+
+static const JNINativeMethod sNavigationMessageMethods[] = {
+ /* name, signature, funcPtr */
+ {"native_is_navigation_message_supported",
+ "()Z",
+ reinterpret_cast<void *>(
+ android_location_GnssNavigationMessageProvider_is_navigation_message_supported)},
+ {"native_start_navigation_message_collection",
+ "()Z",
+ reinterpret_cast<void *>(
+ android_location_GnssNavigationMessageProvider_start_navigation_message_collection)},
+ {"native_stop_navigation_message_collection",
+ "()Z",
+ reinterpret_cast<void *>(
+ android_location_GnssNavigationMessageProvider_stop_navigation_message_collection)},
+};
+
int register_android_server_location_GnssLocationProvider(JNIEnv* env) {
jniRegisterNativeMethods(
env,
"com/android/server/location/GnssBatchingProvider",
sMethodsBatching,
NELEM(sMethodsBatching));
+ jniRegisterNativeMethods(
+ env,
+ "com/android/server/location/GnssGeofenceProvider",
+ sGeofenceMethods,
+ NELEM(sGeofenceMethods));
+ jniRegisterNativeMethods(
+ env,
+ "com/android/server/location/GnssMeasurementsProvider",
+ sMeasurementMethods,
+ NELEM(sMeasurementMethods));
+ jniRegisterNativeMethods(
+ env,
+ "com/android/server/location/GnssNavigationMessageProvider",
+ sNavigationMessageMethods,
+ NELEM(sNavigationMessageMethods));
return jniRegisterNativeMethods(
env,
"com/android/server/location/GnssLocationProvider",
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 51ce7c2..94f8f38 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -3961,8 +3961,6 @@
DevicePolicyData policy = getUserData(credentialOwner);
PasswordMetrics metrics = getUserPasswordMetricsLocked(credentialOwner);
if (metrics == null) {
- Slog.wtf(LOG_TAG, "Should have had a valid password metrics for updating checkpoint " +
- "validity.");
metrics = new PasswordMetrics();
}
policy.mPasswordValidAtLastCheckpoint =
@@ -4511,7 +4509,8 @@
}
if (metrics == null) {
- Slog.wtf(LOG_TAG, "FBE device, should have been unlocked and had valid metrics.");
+ // This could happen if the user never had a password set, for example, so
+ // setActivePasswordState has never been called for it.
metrics = new PasswordMetrics();
}
return isPasswordSufficientForUserWithoutCheckpointLocked(metrics, userHandle, parent);
diff --git a/services/net/java/android/net/apf/ApfCapabilities.java b/services/net/java/android/net/apf/ApfCapabilities.java
index 703b415..dec8ca2 100644
--- a/services/net/java/android/net/apf/ApfCapabilities.java
+++ b/services/net/java/android/net/apf/ApfCapabilities.java
@@ -49,4 +49,14 @@
return String.format("%s{version: %d, maxSize: %d, format: %d}", getClass().getSimpleName(),
apfVersionSupported, maximumApfProgramSize, apfPacketFormat);
}
+
+ /**
+ * Returns true if the APF interpreter advertises support for the data buffer access opcodes
+ * LDDW and STDW.
+ *
+ * Full LDDW and STDW support is present from APFv4 on.
+ */
+ public boolean hasDataAccess() {
+ return apfVersionSupported >= 4;
+ }
}
diff --git a/services/net/java/android/net/apf/ApfFilter.java b/services/net/java/android/net/apf/ApfFilter.java
index 9a97ba7..2bf6e92 100644
--- a/services/net/java/android/net/apf/ApfFilter.java
+++ b/services/net/java/android/net/apf/ApfFilter.java
@@ -24,6 +24,7 @@
import static com.android.internal.util.BitUtils.getUint8;
import static com.android.internal.util.BitUtils.uint32;
+import android.annotation.Nullable;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -102,6 +103,70 @@
UPDATE_EXPIRY // APF program updated for expiry
}
+ /**
+ * APF packet counters.
+ *
+ * Packet counters are 32bit big-endian values, and allocated near the end of the APF data
+ * buffer, using negative byte offsets, where -4 is equivalent to maximumApfProgramSize - 4,
+ * the last writable 32bit word.
+ */
+ @VisibleForTesting
+ private static enum Counter {
+ RESERVED_OOB, // Points to offset 0 from the end of the buffer (out-of-bounds)
+ TOTAL_PACKETS,
+ PASSED_ARP,
+ PASSED_DHCP,
+ PASSED_IPV4,
+ PASSED_IPV6_NON_ICMP,
+ PASSED_IPV4_UNICAST,
+ PASSED_IPV6_ICMP,
+ PASSED_IPV6_UNICAST_NON_ICMP,
+ PASSED_ARP_NON_IPV4,
+ PASSED_ARP_UNKNOWN,
+ PASSED_ARP_UNICAST_REPLY,
+ PASSED_NON_IP_UNICAST,
+ DROPPED_ETH_BROADCAST,
+ DROPPED_RA,
+ DROPPED_GARP_REPLY,
+ DROPPED_ARP_OTHER_HOST,
+ DROPPED_IPV4_L2_BROADCAST,
+ DROPPED_IPV4_BROADCAST_ADDR,
+ DROPPED_IPV4_BROADCAST_NET,
+ DROPPED_IPV4_MULTICAST,
+ DROPPED_IPV6_ROUTER_SOLICITATION,
+ DROPPED_IPV6_MULTICAST_NA,
+ DROPPED_IPV6_MULTICAST,
+ DROPPED_IPV6_MULTICAST_PING,
+ DROPPED_IPV6_NON_ICMP_MULTICAST,
+ DROPPED_802_3_FRAME,
+ DROPPED_ETHERTYPE_BLACKLISTED;
+
+ // Returns the negative byte offset from the end of the APF data segment for
+ // a given counter.
+ public int offset() {
+ return - this.ordinal() * 4; // Currently, all counters are 32bit long.
+ }
+
+ // Returns the total size of the data segment in bytes.
+ public static int totalSize() {
+ return (Counter.class.getEnumConstants().length - 1) * 4;
+ }
+ }
+
+ /**
+ * When APFv4 is supported, loads R1 with the offset of the specified counter.
+ */
+ private void maybeSetCounter(ApfGenerator gen, Counter c) {
+ if (mApfCapabilities.hasDataAccess()) {
+ gen.addLoadImmediate(Register.R1, c.offset());
+ }
+ }
+
+ // When APFv4 is supported, these point to the trampolines generated by emitEpilogue().
+ // Otherwise, they're just aliases for PASS_LABEL and DROP_LABEL.
+ private final String mCountAndPassLabel;
+ private final String mCountAndDropLabel;
+
// Thread to listen for RAs.
@VisibleForTesting
class ReceiveThread extends Thread {
@@ -289,6 +354,16 @@
mDrop802_3Frames = config.ieee802_3Filter;
mContext = context;
+ if (mApfCapabilities.hasDataAccess()) {
+ mCountAndPassLabel = "countAndPass";
+ mCountAndDropLabel = "countAndDrop";
+ } else {
+ // APFv4 unsupported: turn jumps to the counter trampolines to immediately PASS or DROP,
+ // preserving the original pre-APFv4 behavior.
+ mCountAndPassLabel = ApfGenerator.PASS_LABEL;
+ mCountAndDropLabel = ApfGenerator.DROP_LABEL;
+ }
+
// Now fill the black list from the passed array
mEthTypeBlackList = filterEthTypeBlackList(config.ethTypeBlackList);
@@ -302,6 +377,10 @@
new IntentFilter(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED));
}
+ public synchronized void setDataSnapshot(byte[] data) {
+ mDataSnapshot = data;
+ }
+
private void log(String s) {
Log.d(TAG, "(" + mInterfaceParams.name + "): " + s);
}
@@ -350,6 +429,10 @@
try {
mHardwareAddress = mInterfaceParams.macAddr.toByteArray();
synchronized(this) {
+ // Clear APF memory.
+ byte[] zeroes = new byte[mApfCapabilities.maximumApfProgramSize];
+ mIpClientCallback.installPacketFilter(zeroes);
+
// Install basic filters
installNewProgramLocked();
}
@@ -729,7 +812,8 @@
gen.addJumpIfR0LessThan(filterLifetime, nextFilterLabel);
}
}
- gen.addJump(gen.DROP_LABEL);
+ maybeSetCounter(gen, Counter.DROPPED_RA);
+ gen.addJump(mCountAndDropLabel);
gen.defineLabel(nextFilterLabel);
return filterLifetime;
}
@@ -764,6 +848,16 @@
@GuardedBy("this")
private byte[] mLastInstalledProgram;
+ /**
+ * For debugging only. Contains the latest APF buffer snapshot captured from the firmware.
+ *
+ * A typical size for this buffer is 4KB. It is present only if the WiFi HAL supports
+ * IWifiStaIface#readApfPacketFilterData(), and the APF interpreter advertised support for
+ * the opcodes to access the data buffer (LDDW and STDW).
+ */
+ @GuardedBy("this") @Nullable
+ private byte[] mDataSnapshot;
+
// How many times the program was updated since we started.
@GuardedBy("this")
private int mNumProgramUpdates = 0;
@@ -799,31 +893,37 @@
// Pass if not ARP IPv4.
gen.addLoadImmediate(Register.R0, ARP_HEADER_OFFSET);
- gen.addJumpIfBytesNotEqual(Register.R0, ARP_IPV4_HEADER, gen.PASS_LABEL);
+ maybeSetCounter(gen, Counter.PASSED_ARP_NON_IPV4);
+ gen.addJumpIfBytesNotEqual(Register.R0, ARP_IPV4_HEADER, mCountAndPassLabel);
// Pass if unknown ARP opcode.
gen.addLoad16(Register.R0, ARP_OPCODE_OFFSET);
gen.addJumpIfR0Equals(ARP_OPCODE_REQUEST, checkTargetIPv4); // Skip to unicast check
- gen.addJumpIfR0NotEquals(ARP_OPCODE_REPLY, gen.PASS_LABEL);
+ maybeSetCounter(gen, Counter.PASSED_ARP_UNKNOWN);
+ gen.addJumpIfR0NotEquals(ARP_OPCODE_REPLY, mCountAndPassLabel);
// Pass if unicast reply.
gen.addLoadImmediate(Register.R0, ETH_DEST_ADDR_OFFSET);
- gen.addJumpIfBytesNotEqual(Register.R0, ETH_BROADCAST_MAC_ADDRESS, gen.PASS_LABEL);
+ maybeSetCounter(gen, Counter.PASSED_ARP_UNICAST_REPLY);
+ gen.addJumpIfBytesNotEqual(Register.R0, ETH_BROADCAST_MAC_ADDRESS, mCountAndPassLabel);
// Either a unicast request, a unicast reply, or a broadcast reply.
gen.defineLabel(checkTargetIPv4);
if (mIPv4Address == null) {
// When there is no IPv4 address, drop GARP replies (b/29404209).
gen.addLoad32(Register.R0, ARP_TARGET_IP_ADDRESS_OFFSET);
- gen.addJumpIfR0Equals(IPV4_ANY_HOST_ADDRESS, gen.DROP_LABEL);
+ maybeSetCounter(gen, Counter.DROPPED_GARP_REPLY);
+ gen.addJumpIfR0Equals(IPV4_ANY_HOST_ADDRESS, mCountAndDropLabel);
} else {
// When there is an IPv4 address, drop unicast/broadcast requests
// and broadcast replies with a different target IPv4 address.
gen.addLoadImmediate(Register.R0, ARP_TARGET_IP_ADDRESS_OFFSET);
- gen.addJumpIfBytesNotEqual(Register.R0, mIPv4Address, gen.DROP_LABEL);
+ maybeSetCounter(gen, Counter.DROPPED_ARP_OTHER_HOST);
+ gen.addJumpIfBytesNotEqual(Register.R0, mIPv4Address, mCountAndDropLabel);
}
- gen.addJump(gen.PASS_LABEL);
+ maybeSetCounter(gen, Counter.PASSED_ARP);
+ gen.addJump(mCountAndPassLabel);
}
/**
@@ -866,7 +966,8 @@
// NOTE: Relies on R1 containing IPv4 header offset.
gen.addAddR1();
gen.addJumpIfBytesNotEqual(Register.R0, mHardwareAddress, skipDhcpv4Filter);
- gen.addJump(gen.PASS_LABEL);
+ maybeSetCounter(gen, Counter.PASSED_DHCP);
+ gen.addJump(mCountAndPassLabel);
// Drop all multicasts/broadcasts.
gen.defineLabel(skipDhcpv4Filter);
@@ -874,24 +975,31 @@
// If IPv4 destination address is in multicast range, drop.
gen.addLoad8(Register.R0, IPV4_DEST_ADDR_OFFSET);
gen.addAnd(0xf0);
- gen.addJumpIfR0Equals(0xe0, gen.DROP_LABEL);
+ maybeSetCounter(gen, Counter.DROPPED_IPV4_MULTICAST);
+ gen.addJumpIfR0Equals(0xe0, mCountAndDropLabel);
// If IPv4 broadcast packet, drop regardless of L2 (b/30231088).
+ maybeSetCounter(gen, Counter.DROPPED_IPV4_BROADCAST_ADDR);
gen.addLoad32(Register.R0, IPV4_DEST_ADDR_OFFSET);
- gen.addJumpIfR0Equals(IPV4_BROADCAST_ADDRESS, gen.DROP_LABEL);
+ gen.addJumpIfR0Equals(IPV4_BROADCAST_ADDRESS, mCountAndDropLabel);
if (mIPv4Address != null && mIPv4PrefixLength < 31) {
+ maybeSetCounter(gen, Counter.DROPPED_IPV4_BROADCAST_NET);
int broadcastAddr = ipv4BroadcastAddress(mIPv4Address, mIPv4PrefixLength);
- gen.addJumpIfR0Equals(broadcastAddr, gen.DROP_LABEL);
+ gen.addJumpIfR0Equals(broadcastAddr, mCountAndDropLabel);
}
// If L2 broadcast packet, drop.
+ // TODO: can we invert this condition to fall through to the common pass case below?
+ maybeSetCounter(gen, Counter.PASSED_IPV4_UNICAST);
gen.addLoadImmediate(Register.R0, ETH_DEST_ADDR_OFFSET);
- gen.addJumpIfBytesNotEqual(Register.R0, ETH_BROADCAST_MAC_ADDRESS, gen.PASS_LABEL);
- gen.addJump(gen.DROP_LABEL);
+ gen.addJumpIfBytesNotEqual(Register.R0, ETH_BROADCAST_MAC_ADDRESS, mCountAndPassLabel);
+ maybeSetCounter(gen, Counter.DROPPED_IPV4_L2_BROADCAST);
+ gen.addJump(mCountAndDropLabel);
}
// Otherwise, pass
- gen.addJump(gen.PASS_LABEL);
+ maybeSetCounter(gen, Counter.PASSED_IPV4);
+ gen.addJump(mCountAndPassLabel);
}
@@ -938,14 +1046,17 @@
// Drop all other packets sent to ff00::/8 (multicast prefix).
gen.defineLabel(dropAllIPv6MulticastsLabel);
+ maybeSetCounter(gen, Counter.DROPPED_IPV6_NON_ICMP_MULTICAST);
gen.addLoad8(Register.R0, IPV6_DEST_ADDR_OFFSET);
- gen.addJumpIfR0Equals(0xff, gen.DROP_LABEL);
+ gen.addJumpIfR0Equals(0xff, mCountAndDropLabel);
// Not multicast. Pass.
- gen.addJump(gen.PASS_LABEL);
+ maybeSetCounter(gen, Counter.PASSED_IPV6_UNICAST_NON_ICMP);
+ gen.addJump(mCountAndPassLabel);
gen.defineLabel(skipIPv6MulticastFilterLabel);
} else {
// If not ICMPv6, pass.
- gen.addJumpIfR0NotEquals(IPPROTO_ICMPV6, gen.PASS_LABEL);
+ maybeSetCounter(gen, Counter.PASSED_IPV6_NON_ICMP);
+ gen.addJumpIfR0NotEquals(IPPROTO_ICMPV6, mCountAndPassLabel);
}
// If we got this far, the packet is ICMPv6. Drop some specific types.
@@ -954,7 +1065,8 @@
String skipUnsolicitedMulticastNALabel = "skipUnsolicitedMulticastNA";
gen.addLoad8(Register.R0, ICMP6_TYPE_OFFSET);
// Drop all router solicitations (b/32833400)
- gen.addJumpIfR0Equals(ICMPV6_ROUTER_SOLICITATION, gen.DROP_LABEL);
+ maybeSetCounter(gen, Counter.DROPPED_IPV6_ROUTER_SOLICITATION);
+ gen.addJumpIfR0Equals(ICMPV6_ROUTER_SOLICITATION, mCountAndDropLabel);
// If not neighbor announcements, skip filter.
gen.addJumpIfR0NotEquals(ICMPV6_NEIGHBOR_ADVERTISEMENT, skipUnsolicitedMulticastNALabel);
// If to ff02::1, drop.
@@ -962,7 +1074,8 @@
gen.addLoadImmediate(Register.R0, IPV6_DEST_ADDR_OFFSET);
gen.addJumpIfBytesNotEqual(Register.R0, IPV6_ALL_NODES_ADDRESS,
skipUnsolicitedMulticastNALabel);
- gen.addJump(gen.DROP_LABEL);
+ maybeSetCounter(gen, Counter.DROPPED_IPV6_MULTICAST_NA);
+ gen.addJump(mCountAndDropLabel);
gen.defineLabel(skipUnsolicitedMulticastNALabel);
}
@@ -985,10 +1098,18 @@
* </ul>
*/
@GuardedBy("this")
- private ApfGenerator beginProgramLocked() throws IllegalInstructionException {
+ private ApfGenerator emitPrologueLocked() throws IllegalInstructionException {
// This is guaranteed to succeed because of the check in maybeCreate.
ApfGenerator gen = new ApfGenerator(mApfCapabilities.apfVersionSupported);
+ if (mApfCapabilities.hasDataAccess()) {
+ // Increment TOTAL_PACKETS
+ maybeSetCounter(gen, Counter.TOTAL_PACKETS);
+ gen.addLoadData(Register.R0, 0); // load counter
+ gen.addAdd(1);
+ gen.addStoreData(Register.R0, 0); // write-back counter
+ }
+
// Here's a basic summary of what the initial program does:
//
// if it's a 802.3 Frame (ethtype < 0x0600):
@@ -1009,12 +1130,14 @@
if (mDrop802_3Frames) {
// drop 802.3 frames (ethtype < 0x0600)
- gen.addJumpIfR0LessThan(ETH_TYPE_MIN, gen.DROP_LABEL);
+ maybeSetCounter(gen, Counter.DROPPED_802_3_FRAME);
+ gen.addJumpIfR0LessThan(ETH_TYPE_MIN, mCountAndDropLabel);
}
// Handle ether-type black list
+ maybeSetCounter(gen, Counter.DROPPED_ETHERTYPE_BLACKLISTED);
for (int p : mEthTypeBlackList) {
- gen.addJumpIfR0Equals(p, gen.DROP_LABEL);
+ gen.addJumpIfR0Equals(p, mCountAndDropLabel);
}
// Add ARP filters:
@@ -1041,8 +1164,10 @@
// Drop non-IP non-ARP broadcasts, pass the rest
gen.addLoadImmediate(Register.R0, ETH_DEST_ADDR_OFFSET);
- gen.addJumpIfBytesNotEqual(Register.R0, ETH_BROADCAST_MAC_ADDRESS, gen.PASS_LABEL);
- gen.addJump(gen.DROP_LABEL);
+ maybeSetCounter(gen, Counter.PASSED_NON_IP_UNICAST);
+ gen.addJumpIfBytesNotEqual(Register.R0, ETH_BROADCAST_MAC_ADDRESS, mCountAndPassLabel);
+ maybeSetCounter(gen, Counter.DROPPED_ETH_BROADCAST);
+ gen.addJump(mCountAndDropLabel);
// Add IPv6 filters:
gen.defineLabel(ipv6FilterLabel);
@@ -1051,6 +1176,39 @@
}
/**
+ * Append packet counting epilogue to the APF program.
+ *
+ * Currently, the epilogue consists of two trampolines which count passed and dropped packets
+ * before jumping to the actual PASS and DROP labels.
+ */
+ @GuardedBy("this")
+ private void emitEpilogue(ApfGenerator gen) throws IllegalInstructionException {
+ // If APFv4 is unsupported, no epilogue is necessary: if execution reached this far, it
+ // will just fall-through to the PASS label.
+ if (!mApfCapabilities.hasDataAccess()) return;
+
+ // Execution will reach the bottom of the program if none of the filters match,
+ // which will pass the packet to the application processor.
+ maybeSetCounter(gen, Counter.PASSED_IPV6_ICMP);
+
+ // Append the count & pass trampoline, which increments the counter at the data address
+ // pointed to by R1, then jumps to the pass label. This saves a few bytes over inserting
+ // the entire sequence inline for every counter.
+ gen.defineLabel(mCountAndPassLabel);
+ gen.addLoadData(Register.R0, 0); // R0 = *(R1 + 0)
+ gen.addAdd(1); // R0++
+ gen.addStoreData(Register.R0, 0); // *(R1 + 0) = R0
+ gen.addJump(gen.PASS_LABEL);
+
+ // Same as above for the count & drop trampoline.
+ gen.defineLabel(mCountAndDropLabel);
+ gen.addLoadData(Register.R0, 0); // R0 = *(R1 + 0)
+ gen.addAdd(1); // R0++
+ gen.addStoreData(Register.R0, 0); // *(R1 + 0) = R0
+ gen.addJump(gen.DROP_LABEL);
+ }
+
+ /**
* Generate and install a new filter program.
*/
@GuardedBy("this")
@@ -1060,22 +1218,39 @@
ArrayList<Ra> rasToFilter = new ArrayList<>();
final byte[] program;
long programMinLifetime = Long.MAX_VALUE;
+ long maximumApfProgramSize = mApfCapabilities.maximumApfProgramSize;
+ if (mApfCapabilities.hasDataAccess()) {
+ // Reserve space for the counters.
+ maximumApfProgramSize -= Counter.totalSize();
+ }
+
try {
// Step 1: Determine how many RA filters we can fit in the program.
- ApfGenerator gen = beginProgramLocked();
+ ApfGenerator gen = emitPrologueLocked();
+
+ // The epilogue normally goes after the RA filters, but add it early to include its
+ // length when estimating the total.
+ emitEpilogue(gen);
+
+ // Can't fit the program even without any RA filters?
+ if (gen.programLengthOverEstimate() > maximumApfProgramSize) {
+ Log.e(TAG, "Program exceeds maximum size " + maximumApfProgramSize);
+ return;
+ }
+
for (Ra ra : mRas) {
ra.generateFilterLocked(gen);
// Stop if we get too big.
- if (gen.programLengthOverEstimate() > mApfCapabilities.maximumApfProgramSize) break;
+ if (gen.programLengthOverEstimate() > maximumApfProgramSize) break;
rasToFilter.add(ra);
}
+
// Step 2: Actually generate the program
- gen = beginProgramLocked();
+ gen = emitPrologueLocked();
for (Ra ra : rasToFilter) {
programMinLifetime = Math.min(programMinLifetime, ra.generateFilterLocked(gen));
}
- // Execution will reach the end of the program if no filters match, which will pass the
- // packet to the AP.
+ emitEpilogue(gen);
program = gen.generate();
} catch (IllegalInstructionException|IllegalStateException e) {
Log.e(TAG, "Failed to generate APF program.", e);
@@ -1278,6 +1453,23 @@
installNewProgramLocked();
}
+ static public long counterValue(byte[] data, Counter counter)
+ throws ArrayIndexOutOfBoundsException {
+ // Follow the same wrap-around addressing scheme of the interpreter.
+ int offset = counter.offset();
+ if (offset < 0) {
+ offset = data.length + offset;
+ }
+
+ // Decode 32bit big-endian integer into a long so we can count up beyond 2^31.
+ long value = 0;
+ for (int i = 0; i < 4; i++) {
+ value = value << 8 | (data[offset] & 0xFF);
+ offset++;
+ }
+ return value;
+ }
+
public synchronized void dump(IndentingPrintWriter pw) {
pw.println("Capabilities: " + mApfCapabilities);
pw.println("Receive thread: " + (mReceiveThread != null ? "RUNNING" : "STOPPED"));
@@ -1319,6 +1511,32 @@
pw.println(HexDump.toHexString(mLastInstalledProgram, false /* lowercase */));
pw.decreaseIndent();
}
+
+ pw.println("APF packet counters: ");
+ pw.increaseIndent();
+ if (!mApfCapabilities.hasDataAccess()) {
+ pw.println("APF counters not supported");
+ } else if (mDataSnapshot == null) {
+ pw.println("No last snapshot.");
+ } else {
+ try {
+ Counter[] counters = Counter.class.getEnumConstants();
+ for (Counter c : Arrays.asList(counters).subList(1, counters.length)) {
+ long value = counterValue(mDataSnapshot, c);
+ // Only print non-zero counters
+ if (value != 0) {
+ pw.println(c.toString() + ": " + value);
+ }
+ }
+ } catch (ArrayIndexOutOfBoundsException e) {
+ pw.println("Uh-oh: " + e);
+ }
+ if (VDBG) {
+ pw.println("Raw data dump: ");
+ pw.println(HexDump.dumpHexString(mDataSnapshot));
+ }
+ }
+ pw.decreaseIndent();
}
// TODO: move to android.net.NetworkUtils
diff --git a/services/net/java/android/net/apf/ApfGenerator.java b/services/net/java/android/net/apf/ApfGenerator.java
index 99b2fc6..87a1b5e 100644
--- a/services/net/java/android/net/apf/ApfGenerator.java
+++ b/services/net/java/android/net/apf/ApfGenerator.java
@@ -378,8 +378,7 @@
}
/**
- * Returns true if the specified {@code version} is supported by the ApfGenerator, otherwise
- * false.
+ * Returns true if the ApfGenerator supports the specified {@code version}, otherwise false.
*/
public static boolean supportsVersion(int version) {
return version >= MIN_APF_VERSION;
@@ -753,7 +752,7 @@
/**
* Add an instruction to the end of the program to jump to {@code target} if the bytes of the
- * packet at, an offset specified by {@code register}, match {@code bytes}.
+ * packet at an offset specified by {@code register} match {@code bytes}.
*/
public ApfGenerator addJumpIfBytesNotEqual(Register register, byte[] bytes, String target)
throws IllegalInstructionException {
diff --git a/services/net/java/android/net/dns/ResolvUtil.java b/services/net/java/android/net/dns/ResolvUtil.java
index 97d20f4..a2a6615 100644
--- a/services/net/java/android/net/dns/ResolvUtil.java
+++ b/services/net/java/android/net/dns/ResolvUtil.java
@@ -62,4 +62,13 @@
final long netidForResolv = NETID_USE_LOCAL_NAMESERVERS | (long) network.netId;
return new Network((int) netidForResolv);
}
+
+ public static Network makeNetworkWithPrivateDnsBypass(Network network) {
+ return new Network(network) {
+ @Override
+ public InetAddress[] getAllByName(String host) throws UnknownHostException {
+ return blockingResolveAllLocally(network, host);
+ }
+ };
+ }
}
diff --git a/services/net/java/android/net/ip/IpClient.java b/services/net/java/android/net/ip/IpClient.java
index 9fdb31e..d6999dd 100644
--- a/services/net/java/android/net/ip/IpClient.java
+++ b/services/net/java/android/net/ip/IpClient.java
@@ -624,7 +624,14 @@
private ApfFilter mApfFilter;
private boolean mMulticastFiltering;
private long mStartTimeMillis;
- private byte[] mApfDataSnapshot;
+
+ /**
+ * Reading the snapshot is an asynchronous operation initiated by invoking
+ * Callback.startReadPacketFilter() and completed when the WiFi Service responds with an
+ * EVENT_READ_PACKET_FILTER_COMPLETE message. The mApfDataSnapshotComplete condition variable
+ * signals when a new snapshot is ready.
+ */
+ private final ConditionVariable mApfDataSnapshotComplete = new ConditionVariable();
public static class Dependencies {
public INetworkManagementService getNMS() {
@@ -881,13 +888,21 @@
final ProvisioningConfiguration provisioningConfig = mConfiguration;
final ApfCapabilities apfCapabilities = (provisioningConfig != null)
? provisioningConfig.mApfCapabilities : null;
- final byte[] apfDataSnapshot = mApfDataSnapshot;
IndentingPrintWriter pw = new IndentingPrintWriter(writer, " ");
pw.println(mTag + " APF dump:");
pw.increaseIndent();
if (apfFilter != null) {
+ if (apfCapabilities.hasDataAccess()) {
+ // Request a new snapshot, then wait for it.
+ mApfDataSnapshotComplete.close();
+ mCallback.startReadPacketFilter();
+ if (!mApfDataSnapshotComplete.block(1000)) {
+ pw.print("TIMEOUT: DUMPING STALE APF SNAPSHOT");
+ }
+ }
apfFilter.dump(pw);
+
} else {
pw.print("No active ApfFilter; ");
if (provisioningConfig == null) {
@@ -899,15 +914,6 @@
}
}
pw.decreaseIndent();
- pw.println(mTag + " latest APF data snapshot: ");
- pw.increaseIndent();
- if (apfDataSnapshot != null) {
- pw.println(HexDump.dumpHexString(apfDataSnapshot));
- } else {
- pw.println("No last snapshot.");
- }
- pw.decreaseIndent();
-
pw.println();
pw.println(mTag + " current ProvisioningConfiguration:");
pw.increaseIndent();
@@ -1704,7 +1710,10 @@
}
case EVENT_READ_PACKET_FILTER_COMPLETE: {
- mApfDataSnapshot = (byte[]) msg.obj;
+ if (mApfFilter != null) {
+ mApfFilter.setDataSnapshot((byte[]) msg.obj);
+ }
+ mApfDataSnapshotComplete.open();
break;
}
diff --git a/services/robotests/src/com/android/server/location/GnssGeofenceProviderTest.java b/services/robotests/src/com/android/server/location/GnssGeofenceProviderTest.java
new file mode 100644
index 0000000..187303c
--- /dev/null
+++ b/services/robotests/src/com/android/server/location/GnssGeofenceProviderTest.java
@@ -0,0 +1,121 @@
+package com.android.server.location;
+
+import static org.mockito.Matchers.anyDouble;
+import static org.mockito.Matchers.anyInt;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.os.Looper;
+import android.os.RemoteException;
+import android.platform.test.annotations.Presubmit;
+
+import com.android.server.testing.FrameworkRobolectricTestRunner;
+import com.android.server.testing.SystemLoaderPackages;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.annotation.Config;
+
+/**
+ * Unit tests for {@link GnssGeofenceProvider}.
+ */
+@RunWith(FrameworkRobolectricTestRunner.class)
+@Config(
+ manifest = Config.NONE,
+ sdk = 27
+)
+@SystemLoaderPackages({"com.android.server.location"})
+@Presubmit
+public class GnssGeofenceProviderTest {
+ private static final int GEOFENCE_ID = 12345;
+ private static final double LATITUDE = 10.0;
+ private static final double LONGITUDE = 20.0;
+ private static final double RADIUS = 5.0;
+ private static final int LAST_TRANSITION = 0;
+ private static final int MONITOR_TRANSITIONS = 0;
+ private static final int NOTIFICATION_RESPONSIVENESS = 0;
+ private static final int UNKNOWN_TIMER = 0;
+ @Mock
+ private GnssGeofenceProvider.GnssGeofenceProviderNative mMockNative;
+ private GnssGeofenceProvider mTestProvider;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ when(mMockNative.addGeofence(anyInt(), anyDouble(), anyDouble(), anyDouble(), anyInt(),
+ anyInt(), anyInt(), anyInt())).thenReturn(true);
+ when(mMockNative.pauseGeofence(anyInt())).thenReturn(true);
+ when(mMockNative.removeGeofence(anyInt())).thenReturn(true);
+ when(mMockNative.resumeGeofence(anyInt(), anyInt())).thenReturn(true);
+ mTestProvider = new GnssGeofenceProvider(Looper.myLooper(), mMockNative);
+ mTestProvider.addCircularHardwareGeofence(GEOFENCE_ID, LATITUDE,
+ LONGITUDE, RADIUS, LAST_TRANSITION, MONITOR_TRANSITIONS,
+ NOTIFICATION_RESPONSIVENESS,
+ UNKNOWN_TIMER);
+ }
+
+ @Test
+ public void addGeofence_nativeAdded() {
+ verify(mMockNative).addGeofence(eq(GEOFENCE_ID), eq(LATITUDE), eq(LONGITUDE),
+ eq(RADIUS), eq(LAST_TRANSITION), eq(MONITOR_TRANSITIONS),
+ eq(NOTIFICATION_RESPONSIVENESS),
+ eq(UNKNOWN_TIMER));
+ }
+
+ @Test
+ public void pauseGeofence_nativePaused() {
+ mTestProvider.pauseHardwareGeofence(GEOFENCE_ID);
+ verify(mMockNative).pauseGeofence(eq(GEOFENCE_ID));
+ }
+
+ @Test
+ public void removeGeofence_nativeRemoved() {
+ mTestProvider.removeHardwareGeofence(GEOFENCE_ID);
+ verify(mMockNative).removeGeofence(eq(GEOFENCE_ID));
+ }
+
+ @Test
+ public void resumeGeofence_nativeResumed() {
+ mTestProvider.pauseHardwareGeofence(GEOFENCE_ID);
+ mTestProvider.resumeHardwareGeofence(GEOFENCE_ID, MONITOR_TRANSITIONS);
+ verify(mMockNative).resumeGeofence(eq(GEOFENCE_ID), eq(MONITOR_TRANSITIONS));
+ }
+
+ @Test
+ public void addGeofence_restart_added() throws RemoteException {
+ mTestProvider.resumeIfStarted();
+
+ verify(mMockNative, times(2)).addGeofence(eq(GEOFENCE_ID), eq(LATITUDE), eq(LONGITUDE),
+ eq(RADIUS), eq(LAST_TRANSITION), eq(MONITOR_TRANSITIONS),
+ eq(NOTIFICATION_RESPONSIVENESS),
+ eq(UNKNOWN_TIMER));
+ }
+
+ @Test
+ public void removeGeofence_restart_notAdded() throws RemoteException {
+ mTestProvider.removeHardwareGeofence(GEOFENCE_ID);
+ mTestProvider.resumeIfStarted();
+
+ verify(mMockNative, times(1)).addGeofence(eq(GEOFENCE_ID), eq(LATITUDE), eq(LONGITUDE),
+ eq(RADIUS), eq(LAST_TRANSITION), eq(MONITOR_TRANSITIONS),
+ eq(NOTIFICATION_RESPONSIVENESS),
+ eq(UNKNOWN_TIMER));
+ }
+
+ @Test
+ public void pauseGeofence_restart_paused() throws RemoteException {
+ mTestProvider.pauseHardwareGeofence(GEOFENCE_ID);
+ mTestProvider.resumeIfStarted();
+
+ verify(mMockNative, times(2)).addGeofence(eq(GEOFENCE_ID), eq(LATITUDE), eq(LONGITUDE),
+ eq(RADIUS), eq(LAST_TRANSITION), eq(MONITOR_TRANSITIONS),
+ eq(NOTIFICATION_RESPONSIVENESS),
+ eq(UNKNOWN_TIMER));
+ verify(mMockNative, times(2)).pauseGeofence(eq(GEOFENCE_ID));
+ }
+}
diff --git a/services/robotests/src/com/android/server/location/GnssMeasurementsProviderTest.java b/services/robotests/src/com/android/server/location/GnssMeasurementsProviderTest.java
new file mode 100644
index 0000000..23d6cf6
--- /dev/null
+++ b/services/robotests/src/com/android/server/location/GnssMeasurementsProviderTest.java
@@ -0,0 +1,90 @@
+package com.android.server.location;
+
+import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.os.Handler;
+import android.os.Looper;
+import android.platform.test.annotations.Presubmit;
+
+import com.android.server.testing.FrameworkRobolectricTestRunner;
+import com.android.server.testing.SystemLoaderPackages;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+/**
+ * Unit tests for {@link GnssMeasurementsProvider}.
+ */
+@RunWith(FrameworkRobolectricTestRunner.class)
+@Config(
+ manifest = Config.NONE,
+ sdk = 27
+)
+@SystemLoaderPackages({"com.android.server.location"})
+@Presubmit
+public class GnssMeasurementsProviderTest {
+ @Mock
+ private GnssMeasurementsProvider.GnssMeasurementProviderNative mMockNative;
+ private GnssMeasurementsProvider mTestProvider;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ when(mMockNative.startMeasurementCollection(anyBoolean())).thenReturn(true);
+ when(mMockNative.stopMeasurementCollection()).thenReturn(true);
+
+ mTestProvider = new GnssMeasurementsProvider(RuntimeEnvironment.application,
+ new Handler(Looper.myLooper()), mMockNative) {
+ @Override
+ public boolean isGpsEnabled() {
+ return true;
+ }
+ };
+ }
+
+ @Test
+ public void register_nativeStarted() {
+ mTestProvider.registerWithService();
+ verify(mMockNative).startMeasurementCollection(anyBoolean());
+ }
+
+ @Test
+ public void unregister_nativeStopped() {
+ mTestProvider.registerWithService();
+ mTestProvider.unregisterFromService();
+ verify(mMockNative).stopMeasurementCollection();
+ }
+
+ @Test
+ public void isSupported_nativeIsSupported() {
+ when(mMockNative.isMeasurementSupported()).thenReturn(true);
+ assertThat(mTestProvider.isAvailableInPlatform()).isTrue();
+
+ when(mMockNative.isMeasurementSupported()).thenReturn(false);
+ assertThat(mTestProvider.isAvailableInPlatform()).isFalse();
+ }
+
+ @Test
+ public void register_resume_started() {
+ mTestProvider.registerWithService();
+ mTestProvider.resumeIfStarted();
+ verify(mMockNative, times(2)).startMeasurementCollection(anyBoolean());
+ }
+
+ @Test
+ public void unregister_resume_notStarted() {
+ mTestProvider.registerWithService();
+ mTestProvider.unregisterFromService();
+ mTestProvider.resumeIfStarted();
+ verify(mMockNative, times(1)).startMeasurementCollection(anyBoolean());
+ }
+}
diff --git a/services/robotests/src/com/android/server/location/GnssNavigationMessageProviderTest.java b/services/robotests/src/com/android/server/location/GnssNavigationMessageProviderTest.java
new file mode 100644
index 0000000..8d3de3c
--- /dev/null
+++ b/services/robotests/src/com/android/server/location/GnssNavigationMessageProviderTest.java
@@ -0,0 +1,89 @@
+package com.android.server.location;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.os.Handler;
+import android.os.Looper;
+import android.platform.test.annotations.Presubmit;
+
+import com.android.server.testing.FrameworkRobolectricTestRunner;
+import com.android.server.testing.SystemLoaderPackages;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.annotation.Config;
+
+/**
+ * Unit tests for {@link GnssNavigationMessageProvider}.
+ */
+@RunWith(FrameworkRobolectricTestRunner.class)
+@Config(
+ manifest = Config.NONE,
+ sdk = 27
+)
+@SystemLoaderPackages({"com.android.server.location"})
+@Presubmit
+public class GnssNavigationMessageProviderTest {
+ @Mock
+ private GnssNavigationMessageProvider.GnssNavigationMessageProviderNative mMockNative;
+ private GnssNavigationMessageProvider mTestProvider;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ when(mMockNative.startNavigationMessageCollection()).thenReturn(true);
+ when(mMockNative.stopNavigationMessageCollection()).thenReturn(true);
+
+ mTestProvider = new GnssNavigationMessageProvider(new Handler(Looper.myLooper()),
+ mMockNative) {
+ @Override
+ public boolean isGpsEnabled() {
+ return true;
+ }
+ };
+ }
+
+ @Test
+ public void register_nativeStarted() {
+ mTestProvider.registerWithService();
+ verify(mMockNative).startNavigationMessageCollection();
+ }
+
+ @Test
+ public void unregister_nativeStopped() {
+ mTestProvider.registerWithService();
+ mTestProvider.unregisterFromService();
+ verify(mMockNative).stopNavigationMessageCollection();
+ }
+
+ @Test
+ public void isSupported_nativeIsSupported() {
+ when(mMockNative.isNavigationMessageSupported()).thenReturn(true);
+ assertThat(mTestProvider.isAvailableInPlatform()).isTrue();
+
+ when(mMockNative.isNavigationMessageSupported()).thenReturn(false);
+ assertThat(mTestProvider.isAvailableInPlatform()).isFalse();
+ }
+
+ @Test
+ public void register_resume_started() {
+ mTestProvider.registerWithService();
+ mTestProvider.resumeIfStarted();
+ verify(mMockNative, times(2)).startNavigationMessageCollection();
+ }
+
+ @Test
+ public void unregister_resume_notStarted() {
+ mTestProvider.registerWithService();
+ mTestProvider.unregisterFromService();
+ mTestProvider.resumeIfStarted();
+ verify(mMockNative, times(1)).startNavigationMessageCollection();
+ }
+}
diff --git a/services/tests/servicestests/src/com/android/server/ColorDisplayServiceTest.java b/services/tests/servicestests/src/com/android/server/ColorDisplayServiceTest.java
index 43701e9..c004074 100644
--- a/services/tests/servicestests/src/com/android/server/ColorDisplayServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/ColorDisplayServiceTest.java
@@ -898,6 +898,10 @@
@Test
public void accessibility_colorInversion_transformActivated() {
+ if (!mContext.getResources().getConfiguration().isScreenWideColorGamut()) {
+ return;
+ }
+
setAccessibilityColorInversion(true);
setColorMode(ColorDisplayController.COLOR_MODE_NATURAL);
@@ -909,6 +913,10 @@
@Test
public void accessibility_colorCorrection_transformActivated() {
+ if (!mContext.getResources().getConfiguration().isScreenWideColorGamut()) {
+ return;
+ }
+
setAccessibilityColorCorrection(true);
setColorMode(ColorDisplayController.COLOR_MODE_NATURAL);
@@ -920,6 +928,10 @@
@Test
public void accessibility_all_transformActivated() {
+ if (!mContext.getResources().getConfiguration().isScreenWideColorGamut()) {
+ return;
+ }
+
setAccessibilityColorCorrection(true);
setAccessibilityColorInversion(true);
setColorMode(ColorDisplayController.COLOR_MODE_NATURAL);
@@ -932,6 +944,10 @@
@Test
public void accessibility_none_transformActivated() {
+ if (!mContext.getResources().getConfiguration().isScreenWideColorGamut()) {
+ return;
+ }
+
setAccessibilityColorCorrection(false);
setAccessibilityColorInversion(false);
setColorMode(ColorDisplayController.COLOR_MODE_NATURAL);
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/FingerprintGestureDispatcherTest.java b/services/tests/servicestests/src/com/android/server/accessibility/FingerprintGestureDispatcherTest.java
index 98bf53c..6ce7bbe 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/FingerprintGestureDispatcherTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/FingerprintGestureDispatcherTest.java
@@ -17,14 +17,17 @@
package com.android.server.accessibility;
import android.accessibilityservice.FingerprintGestureController;
+import android.content.res.Resources;
import android.hardware.fingerprint.IFingerprintService;
import android.os.Handler;
+import android.os.Looper;
import android.os.Message;
import android.view.KeyEvent;
import com.android.server.accessibility.FingerprintGestureDispatcher.FingerprintGestureClient;
import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@@ -49,16 +52,27 @@
private @Mock IFingerprintService mMockFingerprintService;
private @Mock FingerprintGestureClient mNonGestureCapturingClient;
private @Mock FingerprintGestureClient mGestureCapturingClient;
- private @Mock FingerprintGestureDispatcher mFingerprintGestureDispatcher;
+ private @Mock Resources mMockResources;
+
private MessageCapturingHandler mMessageCapturingHandler;
+ private FingerprintGestureDispatcher mFingerprintGestureDispatcher;
+
+ @BeforeClass
+ public static void oneTimeInitialization() {
+ if (Looper.myLooper() == null) {
+ Looper.prepare();
+ }
+ }
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
+ // For most tests, we support fingerprint gestures
+ when(mMockResources.getBoolean(anyInt())).thenReturn(true);
mMessageCapturingHandler = new MessageCapturingHandler(
msg -> mFingerprintGestureDispatcher.handleMessage(msg));
mFingerprintGestureDispatcher = new FingerprintGestureDispatcher(mMockFingerprintService,
- new Object(), mMessageCapturingHandler);
+ mMockResources, new Object(), mMessageCapturingHandler);
when(mNonGestureCapturingClient.isCapturingFingerprintGestures()).thenReturn(false);
when(mGestureCapturingClient.isCapturingFingerprintGestures()).thenReturn(true);
}
@@ -149,10 +163,23 @@
}
@Test
- public void testIsGestureDetectionActive_dependsOnFingerprintService() throws Exception {
+ public void testIsGestureDetectionAvailable_dependsOnFingerprintService() throws Exception {
when(mMockFingerprintService.isClientActive()).thenReturn(true);
assertFalse(mFingerprintGestureDispatcher.isFingerprintGestureDetectionAvailable());
when(mMockFingerprintService.isClientActive()).thenReturn(false);
assertTrue(mFingerprintGestureDispatcher.isFingerprintGestureDetectionAvailable());
}
+
+ @Test
+ public void ifGestureDectionNotSupported_neverSaysAvailable() throws Exception {
+ when(mMockResources.getBoolean(anyInt())).thenReturn(false);
+ // Need to create a new dispatcher, since it picks up the resource value in its
+ // constructor. This is fine since hardware config values don't change dynamically.
+ FingerprintGestureDispatcher fingerprintGestureDispatcher =
+ new FingerprintGestureDispatcher(mMockFingerprintService, mMockResources,
+ new Object(), mMessageCapturingHandler);
+
+ when(mMockFingerprintService.isClientActive()).thenReturn(false);
+ assertFalse(fingerprintGestureDispatcher.isFingerprintGestureDetectionAvailable());
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java b/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
index 592f7b1..b73ac89 100644
--- a/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/RecentTasksTest.java
@@ -21,6 +21,7 @@
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
+import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK;
@@ -303,6 +304,8 @@
@Test
public void testAddTaskCompatibleActivityType_expectRemove() throws Exception {
+ // Test with undefined activity type since the type is not persisted by the task persister
+ // and we want to ensure that a new task will match a restored task
Configuration config1 = new Configuration();
config1.windowConfiguration.setActivityType(ACTIVITY_TYPE_UNDEFINED);
TaskRecord task1 = createTaskBuilder(".Task1")
@@ -355,6 +358,65 @@
}
@Test
+ public void testAddTaskCompatibleWindowingMode_expectRemove() throws Exception {
+ Configuration config1 = new Configuration();
+ config1.windowConfiguration.setWindowingMode(WINDOWING_MODE_UNDEFINED);
+ TaskRecord task1 = createTaskBuilder(".Task1")
+ .setFlags(FLAG_ACTIVITY_NEW_TASK)
+ .setStack(mStack)
+ .build();
+ task1.onConfigurationChanged(config1);
+ assertTrue(task1.getWindowingMode() == WINDOWING_MODE_UNDEFINED);
+ mRecentTasks.add(task1);
+ mCallbacksRecorder.clear();
+
+ Configuration config2 = new Configuration();
+ config2.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
+ TaskRecord task2 = createTaskBuilder(".Task1")
+ .setFlags(FLAG_ACTIVITY_NEW_TASK)
+ .setStack(mStack)
+ .build();
+ task2.onConfigurationChanged(config2);
+ assertTrue(task2.getWindowingMode() == WINDOWING_MODE_FULLSCREEN);
+ mRecentTasks.add(task2);
+
+ assertTrue(mCallbacksRecorder.added.size() == 1);
+ assertTrue(mCallbacksRecorder.added.contains(task2));
+ assertTrue(mCallbacksRecorder.trimmed.isEmpty());
+ assertTrue(mCallbacksRecorder.removed.size() == 1);
+ assertTrue(mCallbacksRecorder.removed.contains(task1));
+ }
+
+ @Test
+ public void testAddTaskIncompatibleWindowingMode_expectNoRemove() throws Exception {
+ Configuration config1 = new Configuration();
+ config1.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
+ TaskRecord task1 = createTaskBuilder(".Task1")
+ .setFlags(FLAG_ACTIVITY_NEW_TASK)
+ .setStack(mStack)
+ .build();
+ task1.onConfigurationChanged(config1);
+ assertTrue(task1.getWindowingMode() == WINDOWING_MODE_FULLSCREEN);
+ mRecentTasks.add(task1);
+
+ Configuration config2 = new Configuration();
+ config2.windowConfiguration.setWindowingMode(WINDOWING_MODE_PINNED);
+ TaskRecord task2 = createTaskBuilder(".Task1")
+ .setFlags(FLAG_ACTIVITY_NEW_TASK)
+ .setStack(mStack)
+ .build();
+ task2.onConfigurationChanged(config2);
+ assertTrue(task2.getWindowingMode() == WINDOWING_MODE_PINNED);
+ mRecentTasks.add(task2);
+
+ assertTrue(mCallbacksRecorder.added.size() == 2);
+ assertTrue(mCallbacksRecorder.added.contains(task1));
+ assertTrue(mCallbacksRecorder.added.contains(task2));
+ assertTrue(mCallbacksRecorder.trimmed.isEmpty());
+ assertTrue(mCallbacksRecorder.removed.isEmpty());
+ }
+
+ @Test
public void testUsersTasks() throws Exception {
mRecentTasks.setOnlyTestVisibleRange();
diff --git a/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java b/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java
index 6019958..ff631e7 100644
--- a/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/BoundsAnimationControllerTests.java
@@ -545,7 +545,7 @@
.restart(BOUNDS_SMALLER_FLOATING,
false /* expectStartedAndPipModeChangedCallback */)
.end()
- .expectEnded(SCHEDULE_PIP_MODE_CHANGED, !MOVE_TO_FULLSCREEN);
+ .expectEnded(SCHEDULE_PIP_MODE_CHANGED, MOVE_TO_FULLSCREEN);
}
/** !F->!F w/ CANCEL **/
diff --git a/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java b/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java
index 51b019a..204e26c 100644
--- a/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/RootWindowContainerTests.java
@@ -24,27 +24,29 @@
public class RootWindowContainerTests extends WindowTestsBase {
@Test
public void testSetDisplayOverrideConfigurationIfNeeded() throws Exception {
- // Add first stack we expect to be updated with configuration change.
- final TaskStack stack = createTaskStackOnDisplay(mDisplayContent);
- stack.getOverrideConfiguration().windowConfiguration.setBounds(new Rect(0, 0, 5, 5));
+ synchronized (sWm.mWindowMap) {
+ // Add first stack we expect to be updated with configuration change.
+ final TaskStack stack = createTaskStackOnDisplay(mDisplayContent);
+ stack.getOverrideConfiguration().windowConfiguration.setBounds(new Rect(0, 0, 5, 5));
- // Add second task that will be set for deferred removal that should not be returned
- // with the configuration change.
- final TaskStack deferredDeletedStack = createTaskStackOnDisplay(mDisplayContent);
- deferredDeletedStack.getOverrideConfiguration().windowConfiguration.setBounds(
- new Rect(0, 0, 5, 5));
- deferredDeletedStack.mDeferRemoval = true;
+ // Add second task that will be set for deferred removal that should not be returned
+ // with the configuration change.
+ final TaskStack deferredDeletedStack = createTaskStackOnDisplay(mDisplayContent);
+ deferredDeletedStack.getOverrideConfiguration().windowConfiguration.setBounds(
+ new Rect(0, 0, 5, 5));
+ deferredDeletedStack.mDeferRemoval = true;
- final Configuration override = new Configuration(
- mDisplayContent.getOverrideConfiguration());
- override.windowConfiguration.setBounds(new Rect(0, 0, 10, 10));
+ final Configuration override = new Configuration(
+ mDisplayContent.getOverrideConfiguration());
+ override.windowConfiguration.setBounds(new Rect(0, 0, 10, 10));
- // Set display override.
- final int[] results = sWm.mRoot.setDisplayOverrideConfigurationIfNeeded(override,
- mDisplayContent.getDisplayId());
+ // Set display override.
+ final int[] results = sWm.mRoot.setDisplayOverrideConfigurationIfNeeded(override,
+ mDisplayContent.getDisplayId());
- // Ensure only first stack is returned.
- assertTrue(results.length == 1);
- assertTrue(results[0] == stack.mStackId);
+ // Ensure only first stack is returned.
+ assertTrue(results.length == 1);
+ assertTrue(results[0] == stack.mStackId);
+ }
}
}
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java b/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
index 41e446b..513c1ec 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowConfigurationTests.java
@@ -208,7 +208,8 @@
final WindowConfiguration winConfig = config.windowConfiguration;
stackController.adjustConfigurationForBounds(bounds, null /*insetBounds*/,
new Rect() /*nonDecorBounds*/, new Rect() /*stableBounds*/, false /*overrideWidth*/,
- false /*overrideHeight*/, mDisplayInfo.logicalDensityDpi, config, parentConfig);
+ false /*overrideHeight*/, mDisplayInfo.logicalDensityDpi, config, parentConfig,
+ windowingMode);
// Assert that both expected and actual are null or are equal to each other
assertEquals(expectedConfigBounds, winConfig.getAppBounds());
diff --git a/services/tests/servicestests/src/com/android/server/wm/WindowTestUtils.java b/services/tests/servicestests/src/com/android/server/wm/WindowTestUtils.java
index d74defc..2e4740b 100644
--- a/services/tests/servicestests/src/com/android/server/wm/WindowTestUtils.java
+++ b/services/tests/servicestests/src/com/android/server/wm/WindowTestUtils.java
@@ -34,6 +34,7 @@
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyFloat;
+import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -72,7 +73,7 @@
config.windowConfiguration.setBounds(bounds);
return null;
}).when(controller).adjustConfigurationForBounds(any(), any(), any(), any(),
- anyBoolean(), anyBoolean(), anyFloat(), any(), any());
+ anyBoolean(), anyBoolean(), anyFloat(), any(), any(), anyInt());
return controller;
}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/ManagedServicesTest.java b/services/tests/uiservicestests/src/com/android/server/notification/ManagedServicesTest.java
index 4668ed4..d0a656c 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/ManagedServicesTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/ManagedServicesTest.java
@@ -343,7 +343,7 @@
parser.setInput(new BufferedInputStream(
new ByteArrayInputStream(baos.toByteArray())), null);
parser.nextTag();
- service.readXml(parser);
+ service.readXml(parser, null);
verifyExpectedApprovedEntries(service);
assertFalse(service.isPackageOrComponentAllowed("this.is.a.package.name", 0));
@@ -665,7 +665,7 @@
parser.setInput(new BufferedInputStream(
new ByteArrayInputStream(xml.toString().getBytes())), null);
parser.nextTag();
- service.readXml(parser);
+ service.readXml(parser, null);
}
private void addExpectedServices(final ManagedServices service, final List<String> packages,
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationAssistantsTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationAssistantsTest.java
index a8b9dff..f9a4f78 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationAssistantsTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationAssistantsTest.java
@@ -124,7 +124,7 @@
parser.setInput(new BufferedInputStream(
new ByteArrayInputStream(xml.toString().getBytes())), null);
parser.nextTag();
- mAssistants.readXml(parser);
+ mAssistants.readXml(parser, null);
verify(mNm, never()).readDefaultAssistant(anyInt());
verify(mAssistants, times(1)).addApprovedList(
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationComparatorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationComparatorTest.java
index 30fae01..7ee0501 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationComparatorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationComparatorTest.java
@@ -138,12 +138,14 @@
mRecordInlineReply.setUserImportance(NotificationManager.IMPORTANCE_HIGH);
mRecordInlineReply.setPackagePriority(Notification.PRIORITY_MAX);
- Notification n5 = new Notification.Builder(mContext, TEST_CHANNEL_ID)
- .setCategory(Notification.CATEGORY_MESSAGE).build();
- mRecordSms = new NotificationRecord(mContext, new StatusBarNotification(smsPkg,
- smsPkg, 1, "sms", smsUid, smsUid, n5, new UserHandle(userId),
- "", 1299), getDefaultChannel());
- mRecordSms.setUserImportance(NotificationManager.IMPORTANCE_DEFAULT);
+ if (smsPkg != null) {
+ Notification n5 = new Notification.Builder(mContext, TEST_CHANNEL_ID)
+ .setCategory(Notification.CATEGORY_MESSAGE).build();
+ mRecordSms = new NotificationRecord(mContext, new StatusBarNotification(smsPkg,
+ smsPkg, 1, "sms", smsUid, smsUid, n5, new UserHandle(userId),
+ "", 1299), getDefaultChannel());
+ mRecordSms.setUserImportance(NotificationManager.IMPORTANCE_DEFAULT);
+ }
Notification n6 = new Notification.Builder(mContext, TEST_CHANNEL_ID).build();
mRecordStarredContact = new NotificationRecord(mContext, new StatusBarNotification(pkg2,
@@ -230,7 +232,9 @@
expected.add(mRecordColorized);
expected.add(mRecordHighCall);
expected.add(mRecordInlineReply);
- expected.add(mRecordSms);
+ if (mRecordSms != null) {
+ expected.add(mRecordSms);
+ }
expected.add(mRecordStarredContact);
expected.add(mRecordContact);
expected.add(mRecordEmail);
@@ -253,7 +257,9 @@
public void testMessaging() throws Exception {
NotificationComparator comp = new NotificationComparator(mContext);
assertTrue(comp.isImportantMessaging(mRecordInlineReply));
- assertTrue(comp.isImportantMessaging(mRecordSms));
+ if (mRecordSms != null) {
+ assertTrue(comp.isImportantMessaging(mRecordSms));
+ }
assertFalse(comp.isImportantMessaging(mRecordEmail));
assertFalse(comp.isImportantMessaging(mRecordCheater));
}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 0c2928a9..eb1c997 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -80,6 +80,7 @@
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
import android.content.pm.ParceledListSlice;
+import android.content.res.Resources;
import android.graphics.Color;
import android.media.AudioAttributes;
import android.media.AudioManager;
@@ -105,6 +106,7 @@
import android.util.ArrayMap;
import android.util.AtomicFile;
+import com.android.internal.R;
import com.android.internal.statusbar.NotificationVisibility;
import com.android.server.UiServiceTestCase;
import com.android.server.lights.Light;
@@ -160,6 +162,8 @@
@Mock
ActivityManager mActivityManager;
NotificationManagerService.WorkerHandler mHandler;
+ @Mock
+ Resources mResources;
private NotificationChannel mTestNotificationChannel = new NotificationChannel(
TEST_CHANNEL_ID, TEST_CHANNEL_ID, NotificationManager.IMPORTANCE_DEFAULT);
@@ -391,7 +395,7 @@
public void testCreateNotificationChannels_NullChannelThrowsException() throws Exception {
try {
mBinderService.createNotificationChannels(PKG,
- new ParceledListSlice(Arrays.asList(null)));
+ new ParceledListSlice(Arrays.asList((Object[])null)));
fail("Exception should be thrown immediately.");
} catch (NullPointerException e) {
// pass
@@ -2197,9 +2201,9 @@
+ "</notification-policy>";
mService.readPolicyXml(
new BufferedInputStream(new ByteArrayInputStream(upgradeXml.getBytes())), false);
- verify(mListeners, times(1)).readXml(any());
- verify(mConditionProviders, times(1)).readXml(any());
- verify(mAssistants, times(1)).readXml(any());
+ verify(mListeners, times(1)).readXml(any(), any());
+ verify(mConditionProviders, times(1)).readXml(any(), any());
+ verify(mAssistants, times(1)).readXml(any(), any());
// numbers are inflated for setup
verify(mListeners, times(1)).migrateToXml();
@@ -2216,9 +2220,9 @@
+ "</notification-policy>";
mService.readPolicyXml(
new BufferedInputStream(new ByteArrayInputStream(preupgradeXml.getBytes())), false);
- verify(mListeners, never()).readXml(any());
- verify(mConditionProviders, never()).readXml(any());
- verify(mAssistants, never()).readXml(any());
+ verify(mListeners, never()).readXml(any(), any());
+ verify(mConditionProviders, never()).readXml(any(), any());
+ verify(mAssistants, never()).readXml(any(), any());
// numbers are inflated for setup
verify(mListeners, times(2)).migrateToXml();
@@ -2780,4 +2784,70 @@
verify(mListeners, times(1)).notifyHiddenLocked(captor.capture());
assertEquals(0, captor.getValue().size());
}
+
+ @Test
+ public void testCanUseManagedServicesLowRamNoWatchNullPkg() {
+ when(mPackageManagerClient.hasSystemFeature(FEATURE_WATCH)).thenReturn(false);
+ when(mActivityManager.isLowRamDevice()).thenReturn(true);
+ when(mResources.getStringArray(R.array.config_allowedManagedServicesOnLowRamDevices))
+ .thenReturn(new String[] {"a", "b", "c"});
+ when(mContext.getResources()).thenReturn(mResources);
+
+ assertEquals(false, mService.canUseManagedServices(null));
+ }
+
+ @Test
+ public void testCanUseManagedServicesLowRamNoWatchValidPkg() {
+ when(mPackageManagerClient.hasSystemFeature(FEATURE_WATCH)).thenReturn(false);
+ when(mActivityManager.isLowRamDevice()).thenReturn(true);
+ when(mResources.getStringArray(R.array.config_allowedManagedServicesOnLowRamDevices))
+ .thenReturn(new String[] {"a", "b", "c"});
+ when(mContext.getResources()).thenReturn(mResources);
+
+ assertEquals(true, mService.canUseManagedServices("b"));
+ }
+
+ @Test
+ public void testCanUseManagedServicesLowRamNoWatchNoValidPkg() {
+ when(mPackageManagerClient.hasSystemFeature(FEATURE_WATCH)).thenReturn(false);
+ when(mActivityManager.isLowRamDevice()).thenReturn(true);
+ when(mResources.getStringArray(R.array.config_allowedManagedServicesOnLowRamDevices))
+ .thenReturn(new String[] {"a", "b", "c"});
+ when(mContext.getResources()).thenReturn(mResources);
+
+ assertEquals(false, mService.canUseManagedServices("d"));
+ }
+
+ @Test
+ public void testCanUseManagedServicesLowRamWatchNoValidPkg() {
+ when(mPackageManagerClient.hasSystemFeature(FEATURE_WATCH)).thenReturn(true);
+ when(mActivityManager.isLowRamDevice()).thenReturn(true);
+ when(mResources.getStringArray(R.array.config_allowedManagedServicesOnLowRamDevices))
+ .thenReturn(new String[] {"a", "b", "c"});
+ when(mContext.getResources()).thenReturn(mResources);
+
+ assertEquals(true, mService.canUseManagedServices("d"));
+ }
+
+ @Test
+ public void testCanUseManagedServicesNoLowRamNoWatchValidPkg() {
+ when(mPackageManagerClient.hasSystemFeature(FEATURE_WATCH)).thenReturn(false);
+ when(mActivityManager.isLowRamDevice()).thenReturn(false);
+ when(mResources.getStringArray(R.array.config_allowedManagedServicesOnLowRamDevices))
+ .thenReturn(new String[] {"a", "b", "c"});
+ when(mContext.getResources()).thenReturn(mResources);
+
+ assertEquals(true, mService.canUseManagedServices("d"));
+ }
+
+ @Test
+ public void testCanUseManagedServicesNoLowRamWatchValidPkg() {
+ when(mPackageManagerClient.hasSystemFeature(FEATURE_WATCH)).thenReturn(true);
+ when(mActivityManager.isLowRamDevice()).thenReturn(false);
+ when(mResources.getStringArray(R.array.config_allowedManagedServicesOnLowRamDevices))
+ .thenReturn(new String[] {"a", "b", "c"});
+ when(mContext.getResources()).thenReturn(mResources);
+
+ assertEquals(true, mService.canUseManagedServices("d"));
+ }
}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java
index 9f7205b..d846d21 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationTest.java
@@ -25,6 +25,8 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
import android.app.ActivityManager;
import android.app.Notification;
@@ -33,6 +35,8 @@
import android.app.RemoteInput;
import android.content.Context;
import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.Icon;
@@ -57,20 +61,29 @@
@Mock
ActivityManager mAm;
+ @Mock
+ Resources mResources;
+
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
}
@Test
- public void testStripsExtendersInLowRamMode() {
+ public void testStripsExtendersInLowRamModeNoWhitelistNoTv() {
Notification.Builder nb = new Notification.Builder(mContext, "channel");
nb.extend(new Notification.CarExtender().setColor(Color.RED));
nb.extend(new Notification.TvExtender().setChannelId("different channel"));
nb.extend(new Notification.WearableExtender().setDismissalId("dismiss"));
Notification before = nb.build();
- Notification after = Notification.Builder.maybeCloneStrippedForDelivery(before, true);
+ // No whitelist
+ Context context = spy(getContext());
+ when(context.getResources()).thenReturn(mResources);
+ when(mResources.getStringArray(anyInt())).thenReturn(new String[0]);
+
+ Notification after = Notification.Builder.maybeCloneStrippedForDelivery(before, true,
+ context);
assertEquals("different channel", new Notification.TvExtender(before).getChannelId());
assertNull(new Notification.TvExtender(after).getChannelId());
@@ -83,8 +96,34 @@
}
@Test
+ public void testStripsExtendersInLowRamModeHasWhitelist() {
+ Notification.Builder nb = new Notification.Builder(mContext, "channel");
+ nb.extend(new Notification.CarExtender().setColor(Color.RED));
+ nb.extend(new Notification.TvExtender().setChannelId("different channel"));
+ nb.extend(new Notification.WearableExtender().setDismissalId("dismiss"));
+ Notification before = nb.build();
+
+ // Has whitelist
+ Context context = spy(mContext);
+ when(context.getResources()).thenReturn(mResources);
+ when(mResources.getStringArray(anyInt())).thenReturn(new String[1]);
+
+ Notification after = Notification.Builder.maybeCloneStrippedForDelivery(before, true,
+ context);
+
+ assertEquals("different channel", new Notification.TvExtender(before).getChannelId());
+ assertEquals("different channel", new Notification.TvExtender(after).getChannelId());
+
+ assertEquals(Color.RED, new Notification.CarExtender(before).getColor());
+ assertEquals(Color.RED, new Notification.CarExtender(after).getColor());
+
+ assertEquals("dismiss", new Notification.WearableExtender(before).getDismissalId());
+ assertEquals("dismiss", new Notification.WearableExtender(after).getDismissalId());
+ }
+
+ @Test
public void testStripsRemoteViewsInLowRamMode() {
- Context context = spy(getContext());
+ Context context = spy(mContext);
ApplicationInfo ai = new ApplicationInfo();
ai.targetSdkVersion = Build.VERSION_CODES.M;
when(context.getApplicationInfo()).thenReturn(ai);
@@ -97,7 +136,8 @@
.setStyle(style)
.build();
- Notification after = Notification.Builder.maybeCloneStrippedForDelivery(before, true);
+ Notification after = Notification.Builder.maybeCloneStrippedForDelivery(before, true,
+ mContext);
assertNotNull(before.contentView);
assertNotNull(before.bigContentView);
assertNotNull(before.headsUpContentView);
@@ -113,7 +153,8 @@
nb.extend(new Notification.TvExtender().setChannelId("different channel"));
nb.extend(new Notification.WearableExtender().setDismissalId("dismiss"));
Notification before = nb.build();
- Notification after = Notification.Builder.maybeCloneStrippedForDelivery(before, false);
+ Notification after = Notification.Builder.maybeCloneStrippedForDelivery(before, false,
+ mContext);
assertTrue(before == after);
diff --git a/services/tests/uiservicestests/src/com/android/server/slice/SliceManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/slice/SliceManagerServiceTest.java
index d49ba3e..43a4e27 100644
--- a/services/tests/uiservicestests/src/com/android/server/slice/SliceManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/slice/SliceManagerServiceTest.java
@@ -93,7 +93,7 @@
mService.pinSlice("pkg", TEST_URI, EMPTY_SPECS, mToken);
mService.pinSlice("pkg", TEST_URI, EMPTY_SPECS, mToken);
- verify(mService, times(1)).createPinnedSlice(eq(TEST_URI), eq("pkg"));
+ verify(mService, times(1)).createPinnedSlice(eq(TEST_URI), anyString());
}
@Test
@@ -126,4 +126,4 @@
verify(mContextSpy).checkPermission(eq("perm2"), eq(Process.myPid()), eq(Process.myUid()));
}
-}
\ No newline at end of file
+}
diff --git a/services/usage/java/com/android/server/usage/AppStandbyController.java b/services/usage/java/com/android/server/usage/AppStandbyController.java
index 920a605..97c5ac9 100644
--- a/services/usage/java/com/android/server/usage/AppStandbyController.java
+++ b/services/usage/java/com/android/server/usage/AppStandbyController.java
@@ -81,7 +81,7 @@
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.UserHandle;
-import android.provider.Settings;
+import android.provider.Settings.Global;
import android.telephony.TelephonyManager;
import android.util.ArraySet;
import android.util.KeyValueListParser;
@@ -1439,8 +1439,10 @@
boolean isAppIdleEnabled() {
final boolean buildFlag = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_enableAutoPowerModes);
- final boolean runtimeFlag = Settings.Global.getInt(mContext.getContentResolver(),
- Settings.Global.APP_STANDBY_ENABLED, 1) == 1;
+ final boolean runtimeFlag = Global.getInt(mContext.getContentResolver(),
+ Global.APP_STANDBY_ENABLED, 1) == 1
+ && Global.getInt(mContext.getContentResolver(),
+ Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED, 1) == 1;
return buildFlag && runtimeFlag;
}
@@ -1489,8 +1491,8 @@
}
String getAppIdleSettings() {
- return Settings.Global.getString(mContext.getContentResolver(),
- Settings.Global.APP_IDLE_CONSTANTS);
+ return Global.getString(mContext.getContentResolver(),
+ Global.APP_IDLE_CONSTANTS);
}
}
@@ -1610,7 +1612,7 @@
};
/**
- * Observe settings changes for {@link Settings.Global#APP_IDLE_CONSTANTS}.
+ * Observe settings changes for {@link Global#APP_IDLE_CONSTANTS}.
*/
private class SettingsObserver extends ContentObserver {
/**
@@ -1650,10 +1652,11 @@
}
void registerObserver() {
- mContext.getContentResolver().registerContentObserver(Settings.Global.getUriFor(
- Settings.Global.APP_IDLE_CONSTANTS), false, this);
- mContext.getContentResolver().registerContentObserver(Settings.Global.getUriFor(
- Settings.Global.APP_STANDBY_ENABLED), false, this);
+ final ContentResolver cr = mContext.getContentResolver();
+ cr.registerContentObserver(Global.getUriFor(Global.APP_IDLE_CONSTANTS), false, this);
+ cr.registerContentObserver(Global.getUriFor(Global.APP_STANDBY_ENABLED), false, this);
+ cr.registerContentObserver(Global.getUriFor(Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED),
+ false, this);
}
@Override
@@ -1665,11 +1668,14 @@
void updateSettings() {
if (DEBUG) {
Slog.d(TAG,
- "appidle=" + Settings.Global.getString(mContext.getContentResolver(),
- Settings.Global.APP_STANDBY_ENABLED));
- Slog.d(TAG, "appidleconstants=" + Settings.Global.getString(
+ "appidle=" + Global.getString(mContext.getContentResolver(),
+ Global.APP_STANDBY_ENABLED));
+ Slog.d(TAG,
+ "adaptivebat=" + Global.getString(mContext.getContentResolver(),
+ Global.ADAPTIVE_BATTERY_MANAGEMENT_ENABLED));
+ Slog.d(TAG, "appidleconstants=" + Global.getString(
mContext.getContentResolver(),
- Settings.Global.APP_IDLE_CONSTANTS));
+ Global.APP_IDLE_CONSTANTS));
}
// Check if app_idle_enabled has changed
setAppIdleEnabled(mInjector.isAppIdleEnabled());
diff --git a/services/usage/java/com/android/server/usage/IntervalStats.java b/services/usage/java/com/android/server/usage/IntervalStats.java
index c914689..0dce738 100644
--- a/services/usage/java/com/android/server/usage/IntervalStats.java
+++ b/services/usage/java/com/android/server/usage/IntervalStats.java
@@ -16,6 +16,7 @@
package com.android.server.usage;
import android.app.usage.ConfigurationStats;
+import android.app.usage.EventList;
import android.app.usage.EventStats;
import android.app.usage.TimeSparseArray;
import android.app.usage.UsageEvents;
@@ -37,7 +38,7 @@
public final ArrayMap<String, UsageStats> packageStats = new ArrayMap<>();
public final ArrayMap<Configuration, ConfigurationStats> configurations = new ArrayMap<>();
public Configuration activeConfiguration;
- public TimeSparseArray<UsageEvents.Event> events;
+ public EventList events;
// A string cache. This is important as when we're parsing XML files, we don't want to
// keep hundreds of strings that have the same contents. We will read the string
diff --git a/services/usage/java/com/android/server/usage/UsageStatsXmlV1.java b/services/usage/java/com/android/server/usage/UsageStatsXmlV1.java
index fe3a884..aa832ad 100644
--- a/services/usage/java/com/android/server/usage/UsageStatsXmlV1.java
+++ b/services/usage/java/com/android/server/usage/UsageStatsXmlV1.java
@@ -22,12 +22,11 @@
import org.xmlpull.v1.XmlSerializer;
import android.app.usage.ConfigurationStats;
-import android.app.usage.TimeSparseArray;
+import android.app.usage.EventList;
import android.app.usage.UsageEvents;
import android.app.usage.UsageStats;
import android.content.res.Configuration;
import android.util.ArrayMap;
-import android.util.Pair;
import java.io.IOException;
import java.net.ProtocolException;
@@ -193,9 +192,9 @@
}
if (statsOut.events == null) {
- statsOut.events = new TimeSparseArray<>();
+ statsOut.events = new EventList();
}
- statsOut.events.put(event.mTimeStamp, event);
+ statsOut.events.insert(event);
}
private static void writeUsageStats(XmlSerializer xml, final IntervalStats stats,
@@ -411,7 +410,7 @@
xml.startTag(null, EVENT_LOG_TAG);
final int eventCount = stats.events != null ? stats.events.size() : 0;
for (int i = 0; i < eventCount; i++) {
- writeEvent(xml, stats, stats.events.valueAt(i));
+ writeEvent(xml, stats, stats.events.get(i));
}
xml.endTag(null, EVENT_LOG_TAG);
}
diff --git a/services/usage/java/com/android/server/usage/UserUsageStatsService.java b/services/usage/java/com/android/server/usage/UserUsageStatsService.java
index d9fc066..9cb98f3 100644
--- a/services/usage/java/com/android/server/usage/UserUsageStatsService.java
+++ b/services/usage/java/com/android/server/usage/UserUsageStatsService.java
@@ -17,15 +17,14 @@
package com.android.server.usage;
import android.app.usage.ConfigurationStats;
+import android.app.usage.EventList;
import android.app.usage.EventStats;
-import android.app.usage.TimeSparseArray;
import android.app.usage.UsageEvents;
import android.app.usage.UsageStats;
import android.app.usage.UsageStatsManager;
import android.content.res.Configuration;
import android.os.SystemClock;
import android.content.Context;
-import android.text.format.DateFormat;
import android.text.format.DateUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -174,10 +173,10 @@
// Add the event to the daily list.
if (currentDailyStats.events == null) {
- currentDailyStats.events = new TimeSparseArray<>();
+ currentDailyStats.events = new EventList();
}
if (event.mEventType != UsageEvents.Event.SYSTEM_INTERACTION) {
- currentDailyStats.events.put(event.mTimeStamp, event);
+ currentDailyStats.events.insert(event);
}
boolean incrementAppLaunch = false;
@@ -367,18 +366,14 @@
return;
}
- final int startIndex = stats.events.closestIndexOnOrAfter(beginTime);
- if (startIndex < 0) {
- return;
- }
-
+ final int startIndex = stats.events.firstIndexOnOrAfter(beginTime);
final int size = stats.events.size();
for (int i = startIndex; i < size; i++) {
- if (stats.events.keyAt(i) >= endTime) {
+ if (stats.events.get(i).mTimeStamp >= endTime) {
return;
}
- UsageEvents.Event event = stats.events.valueAt(i);
+ UsageEvents.Event event = stats.events.get(i);
if (obfuscateInstantApps) {
event = event.getObfuscatedIfInstantApp();
}
@@ -410,18 +405,14 @@
return;
}
- final int startIndex = stats.events.closestIndexOnOrAfter(beginTime);
- if (startIndex < 0) {
- return;
- }
-
+ final int startIndex = stats.events.firstIndexOnOrAfter(beginTime);
final int size = stats.events.size();
for (int i = startIndex; i < size; i++) {
- if (stats.events.keyAt(i) >= endTime) {
+ if (stats.events.get(i).mTimeStamp >= endTime) {
return;
}
- final UsageEvents.Event event = stats.events.valueAt(i);
+ final UsageEvents.Event event = stats.events.get(i);
if (!packageName.equals(event.mPackage)) {
continue;
}
@@ -633,18 +624,14 @@
return;
}
- final int startIndex = stats.events.closestIndexOnOrAfter(beginTime);
- if (startIndex < 0) {
- return;
- }
-
+ final int startIndex = stats.events.firstIndexOnOrAfter(beginTime);
final int size = stats.events.size();
for (int i = startIndex; i < size; i++) {
- if (stats.events.keyAt(i) >= endTime) {
+ if (stats.events.get(i).mTimeStamp >= endTime) {
return;
}
- UsageEvents.Event event = stats.events.valueAt(i);
+ UsageEvents.Event event = stats.events.get(i);
if (pkg != null && !pkg.equals(event.mPackage)) {
continue;
}
@@ -779,10 +766,10 @@
if (!skipEvents) {
pw.println("events");
pw.increaseIndent();
- final TimeSparseArray<UsageEvents.Event> events = stats.events;
+ final EventList events = stats.events;
final int eventCount = events != null ? events.size() : 0;
for (int i = 0; i < eventCount; i++) {
- final UsageEvents.Event event = events.valueAt(i);
+ final UsageEvents.Event event = events.get(i);
if (pkg != null && !pkg.equals(event.mPackage)) {
continue;
}
diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java
index c16701b..006d7ab9 100644
--- a/telephony/java/android/telephony/PhoneStateListener.java
+++ b/telephony/java/android/telephony/PhoneStateListener.java
@@ -16,6 +16,7 @@
package android.telephony;
+import android.annotation.NonNull;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
@@ -591,7 +592,8 @@
* @param configs List of the current {@link PhysicalChannelConfig}s
* @hide
*/
- public void onPhysicalChannelConfigurationChanged(List<PhysicalChannelConfig> configs) {
+ public void onPhysicalChannelConfigurationChanged(
+ @NonNull List<PhysicalChannelConfig> configs) {
// default implementation empty
}
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index c850004..01fb299 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -2786,6 +2786,22 @@
}
/**
+ * Test method to reload the UICC profile.
+ *
+ * @hide
+ */
+ @TestApi
+ @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
+ public void refreshUiccProfile() {
+ try {
+ ITelephony telephony = getITelephony();
+ telephony.refreshUiccProfile(mSubId);
+ } catch (RemoteException ex) {
+ Rlog.w(TAG, "RemoteException", ex);
+ }
+ }
+
+ /**
* Map logicalSlot to physicalSlot, and activate the physicalSlot if it is inactive. For
* example, passing the physicalSlots array [1, 0] means mapping the first item 1, which is
* physical slot index 1, to the logical slot 0; and mapping the second item 0, which is
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 73cd498..639dd74 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -1520,4 +1520,10 @@
* A test API to return installed carrier id list version.
*/
int getCarrierIdListVersion(int subId);
+
+ /**
+ * A test API to reload the UICC profile.
+ * @hide
+ */
+ void refreshUiccProfile(int subId);
}
diff --git a/tests/net/java/android/net/apf/ApfTest.java b/tests/net/java/android/net/apf/ApfTest.java
index f8a4132..ed9cbab 100644
--- a/tests/net/java/android/net/apf/ApfTest.java
+++ b/tests/net/java/android/net/apf/ApfTest.java
@@ -150,15 +150,24 @@
assertVerdict(DROP, program, packet);
}
- private void assertDataMemoryContents(
- int expected, byte[] program, byte[] packet, byte[] data, byte[] expected_data)
- throws IllegalInstructionException, Exception {
+ private void assertProgramEquals(byte[] expected, byte[] program) throws AssertionError {
+ // assertArrayEquals() would only print one byte, making debugging difficult.
+ if (!java.util.Arrays.equals(expected, program)) {
+ throw new AssertionError(
+ "\nexpected: " + HexDump.toHexString(expected) +
+ "\nactual: " + HexDump.toHexString(program));
+ }
+ }
+
+ private void assertDataMemoryContents(
+ int expected, byte[] program, byte[] packet, byte[] data, byte[] expected_data)
+ throws IllegalInstructionException, Exception {
assertReturnCodesEqual(expected, apfSimulate(program, packet, data, 0 /* filterAge */));
// assertArrayEquals() would only print one byte, making debugging difficult.
if (!java.util.Arrays.equals(expected_data, data)) {
throw new Exception(
- "program: " + HexDump.toHexString(program) +
+ "\nprogram: " + HexDump.toHexString(program) +
"\ndata memory: " + HexDump.toHexString(data) +
"\nexpected: " + HexDump.toHexString(expected_data));
}
@@ -622,6 +631,64 @@
}
}
+ /**
+ * Test that the generator emits immediates using the shortest possible encoding.
+ */
+ @Test
+ public void testImmediateEncoding() throws IllegalInstructionException {
+ final int LI_OPCODE = 13 << 3;
+ ApfGenerator gen;
+
+ // 0-byte immediate: li R0, 0
+ gen = new ApfGenerator(3);
+ gen.addLoadImmediate(Register.R0, 0);
+ assertProgramEquals(new byte[]{LI_OPCODE | (0 << 1)}, gen.generate());
+
+ // 1-byte immediate: li R0, 42
+ gen = new ApfGenerator(3);
+ gen.addLoadImmediate(Register.R0, 42);
+ assertProgramEquals(new byte[]{LI_OPCODE | (1 << 1), 42}, gen.generate());
+
+ // 2-byte immediate: li R1, 0x1234
+ gen = new ApfGenerator(3);
+ gen.addLoadImmediate(Register.R1, 0x1234);
+ assertProgramEquals(new byte[]{LI_OPCODE | (2 << 1) | 1 , 0x12, 0x34}, gen.generate());
+
+ // 4-byte immediate: li R0, 0x12345678
+ gen = new ApfGenerator(3);
+ gen.addLoadImmediate(Register.R0, 0x12345678);
+ assertProgramEquals(
+ new byte[]{LI_OPCODE | (3 << 1), 0x12, 0x34, 0x56, 0x78},
+ gen.generate());
+ }
+
+ /**
+ * Test that the generator emits negative immediates using the shortest possible encoding.
+ */
+ @Test
+ public void testNegativeImmediateEncoding() throws IllegalInstructionException {
+ final int LI_OPCODE = 13 << 3;
+ ApfGenerator gen;
+
+ // 1-byte negative immediate: li R0, -42
+ gen = new ApfGenerator(3);
+ gen.addLoadImmediate(Register.R0, -42);
+ assertProgramEquals(new byte[]{LI_OPCODE | (1 << 1), -42}, gen.generate());
+
+ // 2-byte negative immediate: li R1, -0x1234
+ gen = new ApfGenerator(3);
+ gen.addLoadImmediate(Register.R1, -0x1122);
+ assertProgramEquals(new byte[]{LI_OPCODE | (2 << 1) | 1, (byte)0xEE, (byte)0xDE},
+ gen.generate());
+
+ // 4-byte negative immediate: li R0, -0x11223344
+ gen = new ApfGenerator(3);
+ gen.addLoadImmediate(Register.R0, -0x11223344);
+ assertProgramEquals(
+ new byte[]{LI_OPCODE | (3 << 1), (byte)0xEE, (byte)0xDD, (byte)0xCC, (byte)0xBC},
+ gen.generate());
+ }
+
@Test
public void testApfDataWrite() throws IllegalInstructionException, Exception {
byte[] packet = new byte[MIN_PKT_SIZE];
diff --git a/tools/aapt2/ResourceValues.cpp b/tools/aapt2/ResourceValues.cpp
index 6f213e1..34b46c5 100644
--- a/tools/aapt2/ResourceValues.cpp
+++ b/tools/aapt2/ResourceValues.cpp
@@ -117,8 +117,7 @@
bool Reference::Flatten(android::Res_value* out_value) const {
const ResourceId resid = id.value_or_default(ResourceId(0));
- const bool dynamic = resid.is_valid_dynamic() && resid.package_id() != kFrameworkPackageId &&
- resid.package_id() < kAppPackageId;
+ const bool dynamic = resid.is_valid_dynamic() && is_dynamic;
if (reference_type == Reference::Type::kResource) {
if (dynamic) {
diff --git a/tools/aapt2/ResourceValues.h b/tools/aapt2/ResourceValues.h
index 6371c4c..168ad61 100644
--- a/tools/aapt2/ResourceValues.h
+++ b/tools/aapt2/ResourceValues.h
@@ -157,6 +157,7 @@
Maybe<ResourceId> id;
Reference::Type reference_type;
bool private_reference = false;
+ bool is_dynamic = false;
Reference();
explicit Reference(const ResourceNameRef& n, Type type = Type::kResource);
diff --git a/tools/aapt2/cmd/Link.cpp b/tools/aapt2/cmd/Link.cpp
index b90e7b3..0910040 100644
--- a/tools/aapt2/cmd/Link.cpp
+++ b/tools/aapt2/cmd/Link.cpp
@@ -129,6 +129,12 @@
// Stable ID options.
std::unordered_map<ResourceName, ResourceId> stable_id_map;
Maybe<std::string> resource_id_map_path;
+
+ // When 'true', allow reserved package IDs to be used for applications. Pre-O, the platform
+ // treats negative resource IDs [those with a package ID of 0x80 or higher] as invalid.
+ // In order to work around this limitation, we allow the use of traditionally reserved
+ // resource IDs [those between 0x02 and 0x7E].
+ bool allow_reserved_package_id = false;
};
class LinkContext : public IAaptContext {
@@ -899,9 +905,7 @@
// Capture the shared libraries so that the final resource table can be properly flattened
// with support for shared libraries.
for (auto& entry : asset_source->GetAssignedPackageIds()) {
- if (entry.first > kFrameworkPackageId && entry.first < kAppPackageId) {
- final_table_.included_packages_[entry.first] = entry.second;
- } else if (entry.first == kAppPackageId) {
+ if (entry.first == kAppPackageId) {
// Capture the included base feature package.
included_feature_base_ = entry.second;
} else if (entry.first == kFrameworkPackageId) {
@@ -915,6 +919,8 @@
// android:versionCode from the framework AndroidManifest.xml.
ExtractCompileSdkVersions(asset_source->GetAssetManager());
}
+ } else if (asset_source->IsPackageDynamic(entry.first)) {
+ final_table_.included_packages_[entry.first] = entry.second;
}
}
@@ -1599,7 +1605,15 @@
// If required, the package name is modifed before flattening, and then modified back
// to its original name.
ResourceTablePackage* package_to_rewrite = nullptr;
- if (context_->GetPackageId() > kAppPackageId &&
+ // Pre-O, the platform treats negative resource IDs [those with a package ID of 0x80
+ // or higher] as invalid. In order to work around this limitation, we allow the use
+ // of traditionally reserved resource IDs [those between 0x02 and 0x7E]. Allow the
+ // definition of what a valid "split" package ID is to account for this.
+ const bool isSplitPackage = (options_.allow_reserved_package_id &&
+ context_->GetPackageId() != kAppPackageId &&
+ context_->GetPackageId() != kFrameworkPackageId)
+ || (!options_.allow_reserved_package_id && context_->GetPackageId() > kAppPackageId);
+ if (isSplitPackage &&
included_feature_base_ == make_value(context_->GetCompilationPackage())) {
// The base APK is included, and this is a feature split. If the base package is
// the same as this package, then we are building an old style Android Instant Apps feature
@@ -2150,6 +2164,10 @@
"Generates a text file containing the resource symbols of the R class in\n"
"the specified folder.",
&options.generate_text_symbols_path)
+ .OptionalSwitch("--allow-reserved-package-id",
+ "Allows the use of a reserved package ID. This should on be used for\n"
+ "packages with a pre-O min-sdk\n",
+ &options.allow_reserved_package_id)
.OptionalSwitch("--auto-add-overlay",
"Allows the addition of new resources in overlays without\n"
"<add-resource> tags.",
@@ -2249,7 +2267,9 @@
}
const uint32_t package_id_int = maybe_package_id_int.value();
- if (package_id_int < kAppPackageId || package_id_int > std::numeric_limits<uint8_t>::max()) {
+ if (package_id_int > std::numeric_limits<uint8_t>::max()
+ || package_id_int == kFrameworkPackageId
+ || (!options.allow_reserved_package_id && package_id_int < kAppPackageId)) {
context.GetDiagnostics()->Error(
DiagMessage() << StringPrintf(
"invalid package ID 0x%02x. Must be in the range 0x7f-0xff.", package_id_int));
diff --git a/tools/aapt2/link/ReferenceLinker.cpp b/tools/aapt2/link/ReferenceLinker.cpp
index 9aaaa69..3a5d585 100644
--- a/tools/aapt2/link/ReferenceLinker.cpp
+++ b/tools/aapt2/link/ReferenceLinker.cpp
@@ -340,6 +340,7 @@
// against libraries without assigned IDs.
// Ex: Linking against own resources when building a static library.
reference->id = s->id;
+ reference->is_dynamic = s->is_dynamic;
return true;
}
diff --git a/tools/aapt2/process/SymbolTable.cpp b/tools/aapt2/process/SymbolTable.cpp
index 2e97a2f..fc4c9b5 100644
--- a/tools/aapt2/process/SymbolTable.cpp
+++ b/tools/aapt2/process/SymbolTable.cpp
@@ -227,6 +227,10 @@
return package_map;
}
+bool AssetManagerSymbolSource::IsPackageDynamic(uint32_t packageId) const {
+ return assets_.getResources(false).isPackageDynamic(packageId);
+}
+
static std::unique_ptr<SymbolTable::Symbol> LookupAttributeInTable(
const android::ResTable& table, ResourceId id) {
// Try as a bag.
@@ -330,6 +334,7 @@
} else {
s = util::make_unique<SymbolTable::Symbol>();
s->id = res_id;
+ s->is_dynamic = table.isResourceDynamic(res_id.id);
}
if (s) {
@@ -354,7 +359,6 @@
// Exit early and avoid the error logs from AssetManager.
return {};
}
-
const android::ResTable& table = assets_.getResources(false);
Maybe<ResourceName> maybe_name = GetResourceName(table, id);
if (!maybe_name) {
@@ -370,6 +374,7 @@
} else {
s = util::make_unique<SymbolTable::Symbol>();
s->id = id;
+ s->is_dynamic = table.isResourceDynamic(id.id);
}
if (s) {
diff --git a/tools/aapt2/process/SymbolTable.h b/tools/aapt2/process/SymbolTable.h
index b676efb..51a2e37 100644
--- a/tools/aapt2/process/SymbolTable.h
+++ b/tools/aapt2/process/SymbolTable.h
@@ -68,6 +68,7 @@
Maybe<ResourceId> id;
std::shared_ptr<Attribute> attribute;
bool is_public = false;
+ bool is_dynamic = false;
};
SymbolTable(NameMangler* mangler);
@@ -192,6 +193,7 @@
bool AddAssetPath(const android::StringPiece& path);
std::map<size_t, std::string> GetAssignedPackageIds() const;
+ bool IsPackageDynamic(uint32_t packageId) const;
std::unique_ptr<SymbolTable::Symbol> FindByName(
const ResourceName& name) override;