Loading core/java/android/hardware/input/InputManagerInternal.java +5 −0 Original line number Diff line number Diff line Loading @@ -59,4 +59,9 @@ public abstract class InputManagerInternal { * @param deviceId The id of input device. */ public abstract void toggleCapsLock(int deviceId); /** * Set whether the input stack should deliver pulse gesture events when the device is asleep. */ public abstract void setPulseGestureEnabled(boolean enabled); } core/java/android/webkit/WebViewFactory.java +27 −22 Original line number Diff line number Diff line Loading @@ -141,17 +141,38 @@ public final class WebViewFactory { */ public static int loadWebViewNativeLibraryFromPackage(String packageName, ClassLoader clazzLoader) { int ret = waitForProviderAndSetPackageInfo(); if (ret != LIBLOAD_SUCCESS && ret != LIBLOAD_FAILED_WAITING_FOR_RELRO) { return ret; WebViewProviderResponse response = null; try { response = getUpdateService().waitForAndGetProvider(); } catch (RemoteException e) { Log.e(LOGTAG, "error waiting for relro creation", e); return LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN; } if (response.status != LIBLOAD_SUCCESS && response.status != LIBLOAD_FAILED_WAITING_FOR_RELRO) { return response.status; } if (!sPackageInfo.packageName.equals(packageName)) if (!response.packageInfo.packageName.equals(packageName)) { return LIBLOAD_WRONG_PACKAGE_NAME; } PackageManager packageManager = AppGlobals.getInitialApplication().getPackageManager(); PackageInfo packageInfo; try { packageInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_META_DATA | PackageManager.MATCH_DEBUG_TRIAGED_MISSING); } catch (PackageManager.NameNotFoundException e) { Log.e(LOGTAG, "Couldn't find package " + packageName); return LIBLOAD_WRONG_PACKAGE_NAME; } sPackageInfo = packageInfo; int loadNativeRet = loadNativeLibrary(clazzLoader); // If we failed waiting for relro we want to return that fact even if we successfully load // the relro file. if (loadNativeRet == LIBLOAD_SUCCESS) return ret; if (loadNativeRet == LIBLOAD_SUCCESS) return response.status; return loadNativeRet; } Loading Loading @@ -288,7 +309,7 @@ public final class WebViewFactory { Context webViewContext = initialApplication.createApplicationContext( newPackageInfo.applicationInfo, Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY); sPackageInfo = response.packageInfo; sPackageInfo = newPackageInfo; return webViewContext; } finally { Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW); Loading Loading @@ -599,22 +620,6 @@ public final class WebViewFactory { } } private static int waitForProviderAndSetPackageInfo() { WebViewProviderResponse response = null; try { response = getUpdateService().waitForAndGetProvider(); if (response.status == LIBLOAD_SUCCESS || response.status == LIBLOAD_FAILED_WAITING_FOR_RELRO) { sPackageInfo = response.packageInfo; } } catch (RemoteException e) { Log.e(LOGTAG, "error waiting for relro creation", e); return LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN; } return response.status; } // Assumes that we have waited for relro creation and set sPackageInfo private static int loadNativeLibrary(ClassLoader clazzLoader) { if (!sAddressSpaceReserved) { Loading core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -2464,6 +2464,10 @@ <!-- True if the device supports Sustained Performance Mode--> <bool name="config_sustainedPerformanceModeSupported">false</bool> <!-- File used to enable the double touch gesture. TODO: move to input HAL once ready. --> <string name="config_doubleTouchGestureEnableFile"></string> <!-- Controls how we deal with externally connected physical keyboards. 0 - When using this device, it is not clear for users to recognize when the physical keyboard is (should be) connected and when it is (should be) disconnected. Most of Loading core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2614,6 +2614,8 @@ <!-- Pinner Service --> <java-symbol type="array" name="config_defaultPinnerServiceFiles" /> <java-symbol type="string" name="config_doubleTouchGestureEnableFile" /> <java-symbol type="string" name="suspended_widget_accessibility" /> <!-- Used internally for assistant to launch activity transitions --> Loading services/core/java/com/android/server/dreams/DreamManagerService.java +21 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.Manifest.permission.BIND_DREAM_SERVICE; import com.android.internal.util.DumpUtils; import com.android.server.FgThread; import com.android.server.LocalServices; import com.android.server.SystemService; import android.Manifest; Loading @@ -32,6 +33,8 @@ import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ServiceInfo; import android.database.ContentObserver; import android.hardware.input.InputManagerInternal; import android.os.Binder; import android.os.Build; import android.os.Handler; Loading Loading @@ -111,11 +114,16 @@ public final class DreamManagerService extends SystemService { mContext.registerReceiver(new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { writePulseGestureEnabled(); synchronized (mLock) { stopDreamLocked(false /*immediate*/); } } }, new IntentFilter(Intent.ACTION_USER_SWITCHED), null, mHandler); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.DOZE_ENABLED), false, mDozeEnabledObserver, UserHandle.USER_ALL); writePulseGestureEnabled(); } } Loading Loading @@ -414,6 +422,12 @@ public final class DreamManagerService extends SystemService { } } private void writePulseGestureEnabled() { ComponentName name = getDozeComponent(); boolean dozeEnabled = validateDream(name); LocalServices.getService(InputManagerInternal.class).setPulseGestureEnabled(dozeEnabled); } private static String componentsToString(ComponentName[] componentNames) { StringBuilder names = new StringBuilder(); if (componentNames != null) { Loading Loading @@ -450,6 +464,13 @@ public final class DreamManagerService extends SystemService { } }; private final ContentObserver mDozeEnabledObserver = new ContentObserver(null) { @Override public void onChange(boolean selfChange) { writePulseGestureEnabled(); } }; /** * Handler for asynchronous operations performed by the dream manager. * Ensures operations to {@link DreamController} are single-threaded. Loading Loading
core/java/android/hardware/input/InputManagerInternal.java +5 −0 Original line number Diff line number Diff line Loading @@ -59,4 +59,9 @@ public abstract class InputManagerInternal { * @param deviceId The id of input device. */ public abstract void toggleCapsLock(int deviceId); /** * Set whether the input stack should deliver pulse gesture events when the device is asleep. */ public abstract void setPulseGestureEnabled(boolean enabled); }
core/java/android/webkit/WebViewFactory.java +27 −22 Original line number Diff line number Diff line Loading @@ -141,17 +141,38 @@ public final class WebViewFactory { */ public static int loadWebViewNativeLibraryFromPackage(String packageName, ClassLoader clazzLoader) { int ret = waitForProviderAndSetPackageInfo(); if (ret != LIBLOAD_SUCCESS && ret != LIBLOAD_FAILED_WAITING_FOR_RELRO) { return ret; WebViewProviderResponse response = null; try { response = getUpdateService().waitForAndGetProvider(); } catch (RemoteException e) { Log.e(LOGTAG, "error waiting for relro creation", e); return LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN; } if (response.status != LIBLOAD_SUCCESS && response.status != LIBLOAD_FAILED_WAITING_FOR_RELRO) { return response.status; } if (!sPackageInfo.packageName.equals(packageName)) if (!response.packageInfo.packageName.equals(packageName)) { return LIBLOAD_WRONG_PACKAGE_NAME; } PackageManager packageManager = AppGlobals.getInitialApplication().getPackageManager(); PackageInfo packageInfo; try { packageInfo = packageManager.getPackageInfo(packageName, PackageManager.GET_META_DATA | PackageManager.MATCH_DEBUG_TRIAGED_MISSING); } catch (PackageManager.NameNotFoundException e) { Log.e(LOGTAG, "Couldn't find package " + packageName); return LIBLOAD_WRONG_PACKAGE_NAME; } sPackageInfo = packageInfo; int loadNativeRet = loadNativeLibrary(clazzLoader); // If we failed waiting for relro we want to return that fact even if we successfully load // the relro file. if (loadNativeRet == LIBLOAD_SUCCESS) return ret; if (loadNativeRet == LIBLOAD_SUCCESS) return response.status; return loadNativeRet; } Loading Loading @@ -288,7 +309,7 @@ public final class WebViewFactory { Context webViewContext = initialApplication.createApplicationContext( newPackageInfo.applicationInfo, Context.CONTEXT_INCLUDE_CODE | Context.CONTEXT_IGNORE_SECURITY); sPackageInfo = response.packageInfo; sPackageInfo = newPackageInfo; return webViewContext; } finally { Trace.traceEnd(Trace.TRACE_TAG_WEBVIEW); Loading Loading @@ -599,22 +620,6 @@ public final class WebViewFactory { } } private static int waitForProviderAndSetPackageInfo() { WebViewProviderResponse response = null; try { response = getUpdateService().waitForAndGetProvider(); if (response.status == LIBLOAD_SUCCESS || response.status == LIBLOAD_FAILED_WAITING_FOR_RELRO) { sPackageInfo = response.packageInfo; } } catch (RemoteException e) { Log.e(LOGTAG, "error waiting for relro creation", e); return LIBLOAD_FAILED_WAITING_FOR_WEBVIEW_REASON_UNKNOWN; } return response.status; } // Assumes that we have waited for relro creation and set sPackageInfo private static int loadNativeLibrary(ClassLoader clazzLoader) { if (!sAddressSpaceReserved) { Loading
core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -2464,6 +2464,10 @@ <!-- True if the device supports Sustained Performance Mode--> <bool name="config_sustainedPerformanceModeSupported">false</bool> <!-- File used to enable the double touch gesture. TODO: move to input HAL once ready. --> <string name="config_doubleTouchGestureEnableFile"></string> <!-- Controls how we deal with externally connected physical keyboards. 0 - When using this device, it is not clear for users to recognize when the physical keyboard is (should be) connected and when it is (should be) disconnected. Most of Loading
core/res/res/values/symbols.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2614,6 +2614,8 @@ <!-- Pinner Service --> <java-symbol type="array" name="config_defaultPinnerServiceFiles" /> <java-symbol type="string" name="config_doubleTouchGestureEnableFile" /> <java-symbol type="string" name="suspended_widget_accessibility" /> <!-- Used internally for assistant to launch activity transitions --> Loading
services/core/java/com/android/server/dreams/DreamManagerService.java +21 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.Manifest.permission.BIND_DREAM_SERVICE; import com.android.internal.util.DumpUtils; import com.android.server.FgThread; import com.android.server.LocalServices; import com.android.server.SystemService; import android.Manifest; Loading @@ -32,6 +33,8 @@ import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ServiceInfo; import android.database.ContentObserver; import android.hardware.input.InputManagerInternal; import android.os.Binder; import android.os.Build; import android.os.Handler; Loading Loading @@ -111,11 +114,16 @@ public final class DreamManagerService extends SystemService { mContext.registerReceiver(new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { writePulseGestureEnabled(); synchronized (mLock) { stopDreamLocked(false /*immediate*/); } } }, new IntentFilter(Intent.ACTION_USER_SWITCHED), null, mHandler); mContext.getContentResolver().registerContentObserver( Settings.Secure.getUriFor(Settings.Secure.DOZE_ENABLED), false, mDozeEnabledObserver, UserHandle.USER_ALL); writePulseGestureEnabled(); } } Loading Loading @@ -414,6 +422,12 @@ public final class DreamManagerService extends SystemService { } } private void writePulseGestureEnabled() { ComponentName name = getDozeComponent(); boolean dozeEnabled = validateDream(name); LocalServices.getService(InputManagerInternal.class).setPulseGestureEnabled(dozeEnabled); } private static String componentsToString(ComponentName[] componentNames) { StringBuilder names = new StringBuilder(); if (componentNames != null) { Loading Loading @@ -450,6 +464,13 @@ public final class DreamManagerService extends SystemService { } }; private final ContentObserver mDozeEnabledObserver = new ContentObserver(null) { @Override public void onChange(boolean selfChange) { writePulseGestureEnabled(); } }; /** * Handler for asynchronous operations performed by the dream manager. * Ensures operations to {@link DreamController} are single-threaded. Loading