Loading AndroidManifest.xml +3 −2 Original line number Diff line number Diff line Loading @@ -305,10 +305,11 @@ android:label="@string/phoneAppLabel" android:excludeFromRecents="true" android:launchMode="singleInstance" android:configChanges="keyboardHidden" android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboardHidden" android:exported="false" android:screenOrientation="nosensor" android:encryptionAware="true" > android:encryptionAware="true" android:resizeableActivity="true"> </activity> <!-- BroadcastReceiver for receiving Intents from Notification mechanism. --> Loading InCallUI/src/com/android/incallui/InCallActivity.java +28 −1 Original line number Diff line number Diff line Loading @@ -88,6 +88,12 @@ public class InCallActivity extends TransactionSafeActivity implements FragmentD private static final int DIALPAD_REQUEST_SHOW = 2; private static final int DIALPAD_REQUEST_HIDE = 3; /** * This is used to relaunch the activity if resizing beyond which it needs to load different * layout file. */ private static final int SCREEN_HEIGHT_RESIZE_THRESHOLD = 500; private CallButtonFragment mCallButtonFragment; private CallCardFragment mCallCardFragment; private AnswerFragment mAnswerFragment; Loading Loading @@ -353,6 +359,27 @@ public class InCallActivity extends TransactionSafeActivity implements FragmentD } } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); Configuration oldConfig = getResources().getConfiguration(); Log.v(this, String.format( "incallui config changed, screen size: w%ddp x h%ddp old:w%ddp x h%ddp", newConfig.screenWidthDp, newConfig.screenHeightDp, oldConfig.screenWidthDp, oldConfig.screenHeightDp)); // Recreate this activity if height is changing beyond the threshold to load different // layout file. if (oldConfig.screenHeightDp < SCREEN_HEIGHT_RESIZE_THRESHOLD && newConfig.screenHeightDp > SCREEN_HEIGHT_RESIZE_THRESHOLD || oldConfig.screenHeightDp > SCREEN_HEIGHT_RESIZE_THRESHOLD && newConfig.screenHeightDp < SCREEN_HEIGHT_RESIZE_THRESHOLD) { Log.i(this, String.format( "Recreate activity due to resize beyond threshold: %d dp", SCREEN_HEIGHT_RESIZE_THRESHOLD)); recreate(); } } /** * Returns true when the Activity is currently visible. */ Loading Loading
AndroidManifest.xml +3 −2 Original line number Diff line number Diff line Loading @@ -305,10 +305,11 @@ android:label="@string/phoneAppLabel" android:excludeFromRecents="true" android:launchMode="singleInstance" android:configChanges="keyboardHidden" android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation|keyboardHidden" android:exported="false" android:screenOrientation="nosensor" android:encryptionAware="true" > android:encryptionAware="true" android:resizeableActivity="true"> </activity> <!-- BroadcastReceiver for receiving Intents from Notification mechanism. --> Loading
InCallUI/src/com/android/incallui/InCallActivity.java +28 −1 Original line number Diff line number Diff line Loading @@ -88,6 +88,12 @@ public class InCallActivity extends TransactionSafeActivity implements FragmentD private static final int DIALPAD_REQUEST_SHOW = 2; private static final int DIALPAD_REQUEST_HIDE = 3; /** * This is used to relaunch the activity if resizing beyond which it needs to load different * layout file. */ private static final int SCREEN_HEIGHT_RESIZE_THRESHOLD = 500; private CallButtonFragment mCallButtonFragment; private CallCardFragment mCallCardFragment; private AnswerFragment mAnswerFragment; Loading Loading @@ -353,6 +359,27 @@ public class InCallActivity extends TransactionSafeActivity implements FragmentD } } @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); Configuration oldConfig = getResources().getConfiguration(); Log.v(this, String.format( "incallui config changed, screen size: w%ddp x h%ddp old:w%ddp x h%ddp", newConfig.screenWidthDp, newConfig.screenHeightDp, oldConfig.screenWidthDp, oldConfig.screenHeightDp)); // Recreate this activity if height is changing beyond the threshold to load different // layout file. if (oldConfig.screenHeightDp < SCREEN_HEIGHT_RESIZE_THRESHOLD && newConfig.screenHeightDp > SCREEN_HEIGHT_RESIZE_THRESHOLD || oldConfig.screenHeightDp > SCREEN_HEIGHT_RESIZE_THRESHOLD && newConfig.screenHeightDp < SCREEN_HEIGHT_RESIZE_THRESHOLD) { Log.i(this, String.format( "Recreate activity due to resize beyond threshold: %d dp", SCREEN_HEIGHT_RESIZE_THRESHOLD)); recreate(); } } /** * Returns true when the Activity is currently visible. */ Loading