Advertisement
Guest User

Untitled

a guest
Aug 27th, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.92 KB | None | 0 0
  1. package com.cyanogenmod.pawitp.a700.fixportrait;
  2.  
  3. import android.content.BroadcastReceiver;
  4. import android.content.Context;
  5. import android.content.Intent;
  6. import android.os.IBinder;
  7. import android.os.Parcel;
  8. import android.os.RemoteException;
  9. import android.os.ServiceManager;
  10.  
  11. // Temporary portrait display fix by disabling transform hint
  12.  
  13. public class Startup extends BroadcastReceiver {
  14.  
  15.     @Override
  16.     public void onReceive(final Context context, final Intent bootintent) {
  17.         try {
  18.             IBinder flinger = ServiceManager.getService("SurfaceFlinger");
  19.             if (flinger != null) {
  20.                 Parcel data = Parcel.obtain();
  21.                 data.writeInterfaceToken("android.ui.ISurfaceComposer");
  22.                 data.writeInt(1);
  23.                 flinger.transact(1009, data, null, 0);
  24.                 data.recycle();
  25.             }
  26.         } catch (RemoteException ex) {
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement