Loading core/java/android/provider/Settings.java +1 −1 Original line number Diff line number Diff line Loading @@ -3420,7 +3420,7 @@ public final class Settings { public static final String FONT_SCALE = "font_scale"; private static final Validator FONT_SCALE_VALIDATOR = new SettingsValidators.InclusiveFloatRangeValidator(0.85f, 1.3f); new SettingsValidators.InclusiveFloatRangeValidator(0.25f, 5.0f); /** * The serialized system locale value. Loading core/java/android/view/InputChannel.java +7 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,13 @@ public final class InputChannel implements Parcelable { return name != null ? name : "uninitialized"; } /** * @hide */ public boolean isValid() { return mPtr != 0; } /** * Disposes the input channel. * Explicitly releases the reference this object is holding on the input channel. Loading core/java/android/view/ViewRootImpl.java +2 −5 Original line number Diff line number Diff line Loading @@ -875,10 +875,7 @@ public final class ViewRootImpl implements ViewParent, // manager, to make sure we do the relayout before receiving // any other events from the system. requestLayout(); if ((mWindowAttributes.inputFeatures & WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL) == 0) { mInputChannel = new InputChannel(); } mForceDecorViewVisibility = (mWindowAttributes.privateFlags & PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY) != 0; try { Loading Loading @@ -971,7 +968,7 @@ public final class ViewRootImpl implements ViewParent, mInputQueueCallback = ((RootViewSurfaceTaker)view).willYouTakeTheInputQueue(); } if (mInputChannel != null) { if (mInputChannel.isValid()) { if (mInputQueueCallback != null) { mInputQueue = new InputQueue(); mInputQueueCallback.onInputQueueCreated(mInputQueue); Loading core/java/com/android/internal/util/ScreenshotHelper.java +34 −13 Original line number Diff line number Diff line package com.android.internal.util; import static android.content.Intent.ACTION_USER_SWITCHED; import static android.view.WindowManager.TAKE_SCREENSHOT_SELECTED_REGION; import android.annotation.NonNull; import android.content.BroadcastReceiver; import android.annotation.Nullable; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; import android.net.Uri; import android.os.Handler; Loading Loading @@ -35,8 +38,21 @@ public class ScreenshotHelper { private ServiceConnection mScreenshotConnection = null; private final Context mContext; private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { synchronized (mScreenshotLock) { if (ACTION_USER_SWITCHED.equals(intent.getAction())) { resetConnection(); } } } }; public ScreenshotHelper(Context context) { mContext = context; IntentFilter filter = new IntentFilter(ACTION_USER_SWITCHED); mContext.registerReceiver(mBroadcastReceiver, filter); } /** Loading Loading @@ -100,16 +116,13 @@ public class ScreenshotHelper { SYSUI_SCREENSHOT_SERVICE); final Intent serviceIntent = new Intent(); final Runnable mScreenshotTimeout = new Runnable() { @Override public void run() { final Runnable mScreenshotTimeout = () -> { synchronized (mScreenshotLock) { if (mScreenshotConnection != null) { mContext.unbindService(mScreenshotConnection); mScreenshotConnection = null; Log.e(TAG, "Timed out before getting screenshot capture response"); resetConnection(); notifyScreenshotError(); } } if (completionConsumer != null) { completionConsumer.accept(null); } Loading @@ -132,8 +145,7 @@ public class ScreenshotHelper { public void handleMessage(Message msg) { synchronized (mScreenshotLock) { if (mScreenshotConnection == myConn) { mContext.unbindService(mScreenshotConnection); mScreenshotConnection = null; resetConnection(); handler.removeCallbacks(mScreenshotTimeout); } } Loading Loading @@ -162,8 +174,7 @@ public class ScreenshotHelper { public void onServiceDisconnected(ComponentName name) { synchronized (mScreenshotLock) { if (mScreenshotConnection != null) { mContext.unbindService(mScreenshotConnection); mScreenshotConnection = null; resetConnection(); handler.removeCallbacks(mScreenshotTimeout); notifyScreenshotError(); } Loading @@ -181,6 +192,16 @@ public class ScreenshotHelper { } } /** * Unbinds the current screenshot connection (if any). */ private void resetConnection() { if (mScreenshotConnection != null) { mContext.unbindService(mScreenshotConnection); mScreenshotConnection = null; } } /** * Notifies the screenshot service to show an error. */ Loading data/etc/privapp-permissions-platform.xml +1 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ applications that come with the platform <permission name="android.permission.GET_ACCOUNTS_PRIVILEGED"/> <permission name="android.permission.INTERACT_ACROSS_USERS"/> <permission name="android.permission.MANAGE_USERS"/> <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE"/> <permission name="android.permission.UPDATE_APP_OPS_STATS"/> <permission name="android.permission.USE_RESERVED_DISK"/> </privapp-permissions> Loading Loading
core/java/android/provider/Settings.java +1 −1 Original line number Diff line number Diff line Loading @@ -3420,7 +3420,7 @@ public final class Settings { public static final String FONT_SCALE = "font_scale"; private static final Validator FONT_SCALE_VALIDATOR = new SettingsValidators.InclusiveFloatRangeValidator(0.85f, 1.3f); new SettingsValidators.InclusiveFloatRangeValidator(0.25f, 5.0f); /** * The serialized system locale value. Loading
core/java/android/view/InputChannel.java +7 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,13 @@ public final class InputChannel implements Parcelable { return name != null ? name : "uninitialized"; } /** * @hide */ public boolean isValid() { return mPtr != 0; } /** * Disposes the input channel. * Explicitly releases the reference this object is holding on the input channel. Loading
core/java/android/view/ViewRootImpl.java +2 −5 Original line number Diff line number Diff line Loading @@ -875,10 +875,7 @@ public final class ViewRootImpl implements ViewParent, // manager, to make sure we do the relayout before receiving // any other events from the system. requestLayout(); if ((mWindowAttributes.inputFeatures & WindowManager.LayoutParams.INPUT_FEATURE_NO_INPUT_CHANNEL) == 0) { mInputChannel = new InputChannel(); } mForceDecorViewVisibility = (mWindowAttributes.privateFlags & PRIVATE_FLAG_FORCE_DECOR_VIEW_VISIBILITY) != 0; try { Loading Loading @@ -971,7 +968,7 @@ public final class ViewRootImpl implements ViewParent, mInputQueueCallback = ((RootViewSurfaceTaker)view).willYouTakeTheInputQueue(); } if (mInputChannel != null) { if (mInputChannel.isValid()) { if (mInputQueueCallback != null) { mInputQueue = new InputQueue(); mInputQueueCallback.onInputQueueCreated(mInputQueue); Loading
core/java/com/android/internal/util/ScreenshotHelper.java +34 −13 Original line number Diff line number Diff line package com.android.internal.util; import static android.content.Intent.ACTION_USER_SWITCHED; import static android.view.WindowManager.TAKE_SCREENSHOT_SELECTED_REGION; import android.annotation.NonNull; import android.content.BroadcastReceiver; import android.annotation.Nullable; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; import android.net.Uri; import android.os.Handler; Loading Loading @@ -35,8 +38,21 @@ public class ScreenshotHelper { private ServiceConnection mScreenshotConnection = null; private final Context mContext; private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { synchronized (mScreenshotLock) { if (ACTION_USER_SWITCHED.equals(intent.getAction())) { resetConnection(); } } } }; public ScreenshotHelper(Context context) { mContext = context; IntentFilter filter = new IntentFilter(ACTION_USER_SWITCHED); mContext.registerReceiver(mBroadcastReceiver, filter); } /** Loading Loading @@ -100,16 +116,13 @@ public class ScreenshotHelper { SYSUI_SCREENSHOT_SERVICE); final Intent serviceIntent = new Intent(); final Runnable mScreenshotTimeout = new Runnable() { @Override public void run() { final Runnable mScreenshotTimeout = () -> { synchronized (mScreenshotLock) { if (mScreenshotConnection != null) { mContext.unbindService(mScreenshotConnection); mScreenshotConnection = null; Log.e(TAG, "Timed out before getting screenshot capture response"); resetConnection(); notifyScreenshotError(); } } if (completionConsumer != null) { completionConsumer.accept(null); } Loading @@ -132,8 +145,7 @@ public class ScreenshotHelper { public void handleMessage(Message msg) { synchronized (mScreenshotLock) { if (mScreenshotConnection == myConn) { mContext.unbindService(mScreenshotConnection); mScreenshotConnection = null; resetConnection(); handler.removeCallbacks(mScreenshotTimeout); } } Loading Loading @@ -162,8 +174,7 @@ public class ScreenshotHelper { public void onServiceDisconnected(ComponentName name) { synchronized (mScreenshotLock) { if (mScreenshotConnection != null) { mContext.unbindService(mScreenshotConnection); mScreenshotConnection = null; resetConnection(); handler.removeCallbacks(mScreenshotTimeout); notifyScreenshotError(); } Loading @@ -181,6 +192,16 @@ public class ScreenshotHelper { } } /** * Unbinds the current screenshot connection (if any). */ private void resetConnection() { if (mScreenshotConnection != null) { mContext.unbindService(mScreenshotConnection); mScreenshotConnection = null; } } /** * Notifies the screenshot service to show an error. */ Loading
data/etc/privapp-permissions-platform.xml +1 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ applications that come with the platform <permission name="android.permission.GET_ACCOUNTS_PRIVILEGED"/> <permission name="android.permission.INTERACT_ACROSS_USERS"/> <permission name="android.permission.MANAGE_USERS"/> <permission name="android.permission.READ_PRIVILEGED_PHONE_STATE"/> <permission name="android.permission.UPDATE_APP_OPS_STATS"/> <permission name="android.permission.USE_RESERVED_DISK"/> </privapp-permissions> Loading